@netless/appliance-plugin 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-CjGKnN.js +439 -0
- package/cdn/subWorker-DUJqv_.js +439 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/core/enum.d.ts +20 -16
- package/dist/core/mainEngine.d.ts +1 -0
- package/dist/core/mainThread/base.d.ts +6 -0
- package/dist/core/mainThread/snapshotThread.d.ts +7 -1
- package/dist/core/mainThread/subLocalThread.d.ts +7 -4
- package/dist/core/mainThread/subServiceThread.d.ts +1 -0
- package/dist/core/mainThread/subTopThread.d.ts +2 -2
- package/dist/core/mainThread/workerMainThread.d.ts +1 -1
- package/dist/core/msgEvent/baseForMainThread.d.ts +3 -3
- package/dist/core/msgEvent/baseForWorker.d.ts +3 -3
- package/dist/core/msgEvent/forMainThread.d.ts +2 -4
- package/dist/core/msgEvent/forWorker.d.ts +2 -4
- package/dist/core/tools/base.d.ts +12 -0
- package/dist/core/tools/image.d.ts +6 -3
- package/dist/core/tools/pencilEraser.d.ts +0 -2
- package/dist/core/tools/pencilEraserBitMap.d.ts +83 -0
- package/dist/core/tools/selector.d.ts +2 -5
- package/dist/core/tools/utils.d.ts +6 -5
- package/dist/core/types.d.ts +3 -2
- package/dist/core/utils/image.d.ts +5 -0
- package/dist/core/utils/math.d.ts +3 -0
- package/dist/core/worker/base.d.ts +11 -2
- package/dist/core/worker/fullWorkerLocal.d.ts +4 -2
- package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
- package/dist/core/worker/workerManager.d.ts +1 -0
- package/dist/fullWorker.js +153 -152
- package/dist/index-C29o_HLi.js +1 -0
- package/dist/{index-DBzmxM2f.mjs → index-C4KNxHht.mjs} +708 -547
- package/dist/{index-CWXxYSm5.mjs → index-CIJP6_Qj.mjs} +5880 -5414
- package/dist/index-DmfRoAiB.js +1 -0
- package/dist/plugin/baseApplianceManager.d.ts +5 -4
- package/dist/plugin/const.d.ts +3 -0
- package/dist/plugin/types.d.ts +28 -1
- package/dist/subWorker.js +153 -152
- package/package.json +2 -2
- package/cdn/fullWorker-8AH6yz.js +0 -438
- package/cdn/subWorker-B-aVKt.js +0 -438
- package/dist/index-B42Mnde_.js +0 -1
- package/dist/index-CBeudPfv.js +0 -1
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["rect","willUpdateNodes","isLockSentEventCursor","scenePath"],_excluded4=["render"],_excluded5=["render"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)o=s[r],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.includes(n))continue;t[n]=r[n];}return t;}function _superPropSet(t,e,o,r,p,f){return _set(_getPrototypeOf(f?t.prototype:t),e,o,r,p);}function set(e,r,t,o){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=_superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1;}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f);}else _defineProperty(o,r,t);return!0;},set(e,r,t,o);}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError("failed to set property");return t;}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _superPropGet(t,e,r,o){var p=_get(_getPrototypeOf(1&o?t.prototype:t),e,r);return 2&o?function(t){return p.apply(r,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _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 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 _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 _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n7=0,F=function F(){};return{s:F,n:function n(){return _n7>=r.length?{done:!0}:{done:!1,value:r[_n7++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _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 _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);}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}var wi=Object.defineProperty;var Di=function Di(h,r,t){return r in h?wi(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var rt=function rt(h,r,t){return Di(h,_typeof(r)!="symbol"?r+"":r,t);};var Lt=/* @__PURE__ */function(h){return h.Normal="Normal",h.Stroke="Stroke",h.Dotted="Dotted",h.LongDotted="LongDotted",h;}(Lt||{}),bt=/* @__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;}(bt||{}),ut=/* @__PURE__ */function(h){return h[h.Pencil=1]="Pencil",h[h.Eraser=2]="Eraser",h[h.PencilEraser=3]="PencilEraser",h[h.BitMapEraser=4]="BitMapEraser",h[h.Selector=5]="Selector",h[h.Clicker=6]="Clicker",h[h.Arrow=7]="Arrow",h[h.Hand=8]="Hand",h[h.LaserPen=9]="LaserPen",h[h.Text=10]="Text",h[h.Straight=11]="Straight",h[h.Rectangle=12]="Rectangle",h[h.Ellipse=13]="Ellipse",h[h.Star=14]="Star",h[h.Triangle=15]="Triangle",h[h.Rhombus=16]="Rhombus",h[h.Polygon=17]="Polygon",h[h.SpeechBalloon=18]="SpeechBalloon",h[h.Image=19]="Image",h;}(ut||{}),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||{}),lt=/* @__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[h.CursorBlur=19]="CursorBlur",h[h.Console=20]="Console",h[h.PriorityWorker=21]="PriorityWorker",h[h.PriorityMainThreadWorker=22]="PriorityMainThreadWorker",h[h.GetImageBitMap=23]="GetImageBitMap",h;}(lt||{}),ye=/* @__PURE__ */function(h){return h.Webgl2="webgl2",h.Webgl="webgl",h.Canvas2d="2d",h;}(ye||{}),St=/* @__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;}(St||{}),jt=/* @__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;}(jt||{}),Pe=/* @__PURE__ */function(h){return h[h.inside=0]="inside",h[h.outside=1]="outside",h[h.intersect=2]="intersect",h;}(Pe||{});var te=/*#__PURE__*/function(){function te(){_classCallCheck(this,te);rt(this,"localWork");rt(this,"serviceWork");rt(this,"threadEngine");}return _createClass(te,[{key:"registerForWorker",value:function registerForWorker(r){return this.threadEngine=r,this.localWork=r.localWork,this.serviceWork=r.serviceWork,this;}}]);}();var Ni=/*#__PURE__*/function(_te){function Ni(){var _this;_classCallCheck(this,Ni);_this=_callSuper(this,Ni,arguments);rt(_this,"emitEventType",bt.CopyNode);return _this;}_inherits(Ni,_te);return _createClass(Ni,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.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);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(te);var xr="++",Nt="selector",Wi="all";var Bi=/*#__PURE__*/function(_te2){function Bi(){var _this2;_classCallCheck(this,Bi);_this2=_callSuper(this,Bi,arguments);rt(_this2,"emitEventType",bt.SetColorNode);return _this2;}_inherits(Bi,_te2);return _createClass(Bi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(t){var l,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context2.t0=e===Nt&&n;if(!_context2.t0){_context2.next=5;break;}_context2.next=5;return(l=this.localWork)==null?void 0:l.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context2.stop();}},_callee2,this);}));function consumeForLocalWorker(_x2){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,l=n.render||[],d=n.sp||[];if(a){var _iterator2=_createForOfIteratorHelper(i.entries()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=_slicedToArray(_step2.value,2),c=_step2$value[0],p=_step2$value[1];s&&p.toolsType===ut.Text?d.push(_objectSpread(_objectSpread({},p),{},{workId:c,type:lt.TextUpdate,dataType:Mt.Local,willSyncService:!0})):d.push(_objectSpread(_objectSpread({},p),{},{workId:c,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:l,sp:d};}}]);}(te);var Fi=/*#__PURE__*/function(_te3){function Fi(){var _this3;_classCallCheck(this,Fi);_this3=_callSuper(this,Fi,arguments);rt(_this3,"emitEventType",bt.ZIndexNode);return _this3;}_inherits(Fi,_te3);return _createClass(Fi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context3.t0=e===Nt&&n;if(!_context3.t0){_context3.next=5;break;}_context3.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 _context3.stop();}},_callee3,this);}));function consumeForLocalWorker(_x3){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||[],l=n.sp||[];if(a&&l){var _iterator3=_createForOfIteratorHelper(i.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),d=_step3$value[0],c=_step3$value[1];l.push(_objectSpread(_objectSpread({},c),{},{workId:d,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:s,sp:l};}}]);}(te);var Ui=/*#__PURE__*/function(_te4){function Ui(){var _this4;_classCallCheck(this,Ui);_this4=_callSuper(this,Ui,arguments);rt(_this4,"emitEventType",bt.TranslateNode);return _this4;}_inherits(Ui,_te4);return _createClass(Ui,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(t){var d,c,e,n,i,a,o,s,l;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker,l=t.emitEventType;_context4.t0=e===Nt&&n;if(!_context4.t0){_context4.next=9;break;}if(!(n.workState===Rt.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Rt.Done)){_context4.next=8;break;}_context4.next=6;return(d=this.localWork)==null?void 0:d.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,isSync:!0,textUpdateForWoker:s,emitEventType:l,callback:this.updateSelectorCallback});case 6:_context4.next=9;break;case 8:n.workState===Rt.Done&&((c=this.localWork)==null||c.vNodes.deleteLastTarget());case 9:case"end":return _context4.stop();}},_callee4,this);}));function consumeForLocalWorker(_x4){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,l=e.isSync,d=e.updateSelectorOpt,c=e.textUpdateForWoker,p=d.workState,y=n.render||[],P=n.sp||[];if(p===Rt.Start)return{sp:[],render:[]};var T=o==null?void 0:o.selectRect;if(s){P.push({type:lt.Select,selectIds:a.selectIds,selectRect:T,willSyncService:!0,isSync:!0,points:p===Rt.Done&&a.getChildrenPoints()||void 0,textOpt:a.textOpt});var _iterator4=_createForOfIteratorHelper(i.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),v=_step4$value[0],x=_step4$value[1];c&&x.toolsType===ut.Text?P.push(_objectSpread(_objectSpread({},x),{},{workId:v,type:lt.TextUpdate,dataType:Mt.Local,willSyncService:!0})):P.push(_objectSpread(_objectSpread({},x),{},{workId:v,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:y,sp:P};}}]);}(te);var ji=/*#__PURE__*/function(_te5){function ji(){var _this5;_classCallCheck(this,ji);_this5=_callSuper(this,ji,arguments);rt(_this5,"emitEventType",bt.DeleteNode);return _this5;}_inherits(ji,_te5);return _createClass(ji,[{key:"consume",value:function consume(){return!1;}}]);}(te);var $i=/*#__PURE__*/function(_te6){function $i(){var _this6;_classCallCheck(this,$i);_this6=_callSuper(this,$i,arguments);rt(_this6,"emitEventType",bt.ScaleNode);return _this6;}_inherits($i,_te6);return _createClass($i,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(t){var o,e,n,i,a;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willSyncService,a=t.willSerializeData;_context5.t0=e===Nt&&n;if(!_context5.t0){_context5.next=5;break;}_context5.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:a,isSync:!0,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return _context5.stop();}},_callee5,this);}));function consumeForLocalWorker(_x5){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,l=e.willSyncService,d=s.workState,c=n.render||[],p=n.sp||[],y=a==null?void 0:a.selectRect;if(d===Rt.Start)return{sp:[],render:[]};if(l){p.push({type:lt.Select,selectIds:i.selectIds,selectRect:y,willSyncService:!0,isSync:!0,points:d===Rt.Done&&i.getChildrenPoints()||void 0,textOpt:i.textOpt});var _iterator5=_createForOfIteratorHelper(o.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),P=_step5$value[0],T=_step5$value[1];T.toolsType===ut.Text?p.push(_objectSpread(_objectSpread({},T),{},{workId:P,type:lt.TextUpdate,dataType:Mt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},T),{},{workId:P,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:c,sp:p};}}]);}(te);var zi=/*#__PURE__*/function(_te7){function zi(){var _this7;_classCallCheck(this,zi);_this7=_callSuper(this,zi,arguments);rt(_this7,"emitEventType",bt.RotateNode);return _this7;}_inherits(zi,_te7);return _createClass(zi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t){var l,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.emitEventType;_context6.t0=e===Nt&&n;if(!_context6.t0){_context6.next=5;break;}_context6.next=5;return(l=this.localWork)==null?void 0:l.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,emitEventType:s,isSync:!0,callback:this.updateSelectorCallback});case 5:case"end":return _context6.stop();}},_callee6,this);}));function consumeForLocalWorker(_x6){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,l=e.willSyncService,d=e.willSerializeData,c=e.isSync,p=s.workState,y=n.render||[],P=n.sp||[],T=a==null?void 0:a.selectRect;if(l){d&&p===Rt.Done&&P.push({type:lt.Select,selectIds:i.selectIds,selectRect:T,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,thickness:i.thickness,useStroke:i.useStroke,strokeType:i.strokeType});var _iterator6=_createForOfIteratorHelper(o.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),v=_step6$value[0],x=_step6$value[1];P.push(_objectSpread(_objectSpread({},x),{},{workId:v,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:P};}}]);}(te);var Gi=/*#__PURE__*/function(_te8){function Gi(){var _this8;_classCallCheck(this,Gi);_this8=_callSuper(this,Gi,arguments);rt(_this8,"emitEventType",bt.SetFontStyle);return _this8;}_inherits(Gi,_te8);return _createClass(Gi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var l,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context7.t0=e===Nt&&n;if(!_context7.t0){_context7.next=5;break;}_context7.next=5;return(l=this.localWork)==null?void 0:l.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context7.stop();}},_callee7,this);}));function consumeForLocalWorker(_x7){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,l=e.isSync,d=e.updateSelectorOpt,c=e.textUpdateForWoker,p=n.render||[],y=n.sp||[],P=o==null?void 0:o.selectRect;if(s&&y){d.fontSize&&y.push({type:lt.Select,selectIds:a.selectIds,selectRect:P,willSyncService:s,isSync:l,points:a.getChildrenPoints()});var _iterator7=_createForOfIteratorHelper(i.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),T=_step7$value[0],v=_step7$value[1];c&&v.toolsType===ut.Text?y.push(_objectSpread(_objectSpread({},v),{},{workId:T,type:lt.TextUpdate,dataType:Mt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},v),{},{workId:T,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:p,sp:y};}}]);}(te);var Hi=/*#__PURE__*/function(_te9){function Hi(){var _this9;_classCallCheck(this,Hi);_this9=_callSuper(this,Hi,arguments);rt(_this9,"emitEventType",bt.SetPoint);return _this9;}_inherits(Hi,_te9);return _createClass(Hi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t){var l,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context8.t0=e===Nt&&n;if(!_context8.t0){_context8.next=5;break;}_context8.next=5;return(l=this.localWork)==null?void 0:l.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context8.stop();}},_callee8,this);}));function consumeForLocalWorker(_x8){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,l=e.isSync,d=n.render||[],c=n.sp||[],p=o==null?void 0:o.selectRect;if(s&&c){var _iterator8=_createForOfIteratorHelper(i.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),y=_step8$value[0],P=_step8$value[1];c.push(_objectSpread(_objectSpread({},P),{},{workId:y,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}c.push({type:lt.Select,selectIds:a.selectIds,selectRect:p,willSyncService:s,isSync:l,points:a.getChildrenPoints()});}return{render:d,sp:c};}}]);}(te);var Ki=/*#__PURE__*/function(_te10){function Ki(){var _this10;_classCallCheck(this,Ki);_this10=_callSuper(this,Ki,arguments);rt(_this10,"emitEventType",bt.SetLock);return _this10;}_inherits(Ki,_te10);return _createClass(Ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context9.t0=e===Nt&&n;if(!_context9.t0){_context9.next=5;break;}_context9.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 _context9.stop();}},_callee9,this);}));function consumeForLocalWorker(_x9){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,l=e.isSync,d=e.updateSelectorOpt,c=n.render||[],p=n.sp||[],y=o==null?void 0:o.selectRect;if(s&&p){var _iterator9=_createForOfIteratorHelper(i.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),P=_step9$value[0],T=_step9$value[1];p.push(_objectSpread(_objectSpread({},T),{},{workId:P,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}p.push({isLocked:d.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:lt.Select,selectIds:a.selectIds,selectRect:y,willSyncService:s,isSync:l});}return{render:c,sp:p};}}]);}(te);var Yi=/*#__PURE__*/function(_te11){function Yi(){var _this11;_classCallCheck(this,Yi);_this11=_callSuper(this,Yi,arguments);rt(_this11,"emitEventType",bt.SetShapeOpt);return _this11;}_inherits(Yi,_te11);return _createClass(Yi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===lt.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context10.t0=e===Nt&&n;if(!_context10.t0){_context10.next=5;break;}_context10.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 _context10.stop();}},_callee10,this);}));function consumeForLocalWorker(_x10){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||[],l=n.sp||[];if(a&&l){var _iterator10=_createForOfIteratorHelper(i.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),d=_step10$value[0],c=_step10$value[1];l.push(_objectSpread(_objectSpread({},c),{},{workId:d,type:lt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:s,sp:l};}}]);}(te);var Vi=/*#__PURE__*/function(){function Vi(r){var _this12=this;_classCallCheck(this,Vi);rt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this12.build(t)];}));}return _createClass(Vi,[{key:"build",value:function build(r){switch(r){case bt.TranslateNode:return new Ui();case bt.ZIndexNode:return new Fi();case bt.CopyNode:return new Ni();case bt.SetColorNode:return new Bi();case bt.DeleteNode:return new ji();case bt.ScaleNode:return new $i();case bt.RotateNode:return new zi();case bt.SetFontStyle:return new Gi();case bt.SetPoint:return new Hi();case bt.SetLock:return new Ki();case bt.SetShapeOpt:return new Yi();}}},{key:"registerForWorker",value:function registerForWorker(r){return this.builders.forEach(function(t){t&&t.registerForWorker(r);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(r){var _iterator11=_createForOfIteratorHelper(this.builders.values()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var t=_step11.value;if(t!=null&&t.consume(r))return!0;}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return!1;}}]);}();var Xi={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
|
|
2
|
+
);}},{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));}/**
|
|
3
|
+
* Get the nearest point on a line with a known unit vector that passes through point A
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* Vec.nearestPointOnLineThroughPoint(A, u, Point)
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* @param A - Any point on the line
|
|
10
|
+
* @param u - The unit vector for the line.
|
|
11
|
+
* @param P - A point not on the line to test.
|
|
12
|
+
*/},{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));}/**
|
|
13
|
+
* Get an array of points (with simulated pressure) between two points.
|
|
14
|
+
*
|
|
15
|
+
* @param A - The first point.
|
|
16
|
+
* @param B - The second point.
|
|
17
|
+
* @param steps - The number of points to return.
|
|
18
|
+
*/},{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=Xi.easeInQuad(i/(e-1)),o=_.Lrp(r,t,a);o.z=Math.min(1,0.5+Math.abs(0.5-ki(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 ki=function ki(h){return h<0.5?2*h*h:-1+(4-2*h)*h;};var xt=/*#__PURE__*/function(_ref2){function xt(){var _this13;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,xt);_this13=_callSuper(this,xt,[r,t,e]),_this13.x=r,_this13.y=t,_this13.z=e,_this13.v=n,_this13.t=i,_this13.a=a;return _this13;}_inherits(xt,_ref2);return _createClass(xt,[{key:"timestamp",get:function get(){return this.t;}},{key:"pressure",get:function get(){return this.z;}},{key:"angleNum",get:function get(){return this.a;}},{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setA",value:function setA(r){this.a=r;}},{key:"setT",value:function setT(r){this.t=r;}},{key:"setv",value:function setv(r){return this.v={x:r.x,y:r.y},this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a,this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z,n=this.v,i=this.t,a=this.a,o={x:n.x,y:n.y};return new xt(r,t,e,o,i,a);}},{key:"distance",value:function distance(r){return xt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return xt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return xt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new xt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new xt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return xt.Len(r.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(r,t,e){var n=t.x-r.x,i=e.x-t.x,a=t.y-r.y,o=e.y-t.y;var s=0;var l=Math.sqrt(n*n+a*a),d=Math.sqrt(i*i+o*o);if(l&&d){var c=n*i+a*o;s=Math.acos(c/(l*d)),s=s/Math.PI*180;var p=n*o-a*i;p=p>0?1:-1,s=180+p*s;}return s;}},{key:"IsNear",value:function IsNear(r,t,e){return xt.Len(r.clone().sub(t))<e;}},{key:"RotWith",value:function RotWith(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;var i=r.x-t.x,a=r.y-t.y,o=Math.sin(e),s=Math.cos(e),l=Math.pow(10,n),d=Math.floor((t.x+(i*s-a*o))*l)/l,c=Math.floor((t.y+(i*o+a*s))*l)/l;return new xt(d,c);}/**
|
|
19
|
+
* 根据圆心和半径,获取圆上的等份点
|
|
20
|
+
* @param o 圆心
|
|
21
|
+
* @param radius 半径
|
|
22
|
+
* @param average 均分数
|
|
23
|
+
* @returns
|
|
24
|
+
*/},{key:"GetDotStroke",value:function GetDotStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new _(1,1),i=Math.PI+1e-3,a=xt.Add(r,xt.Sub(r,n).uni().per().mul(-t)),o=[];for(var s=1/e,l=s;l<=1;l+=s)o.push(xt.RotWith(a,r,i*2*l));return o;}/**
|
|
25
|
+
* 根据圆心和圆上的起始点,获取半圆上的等份点
|
|
26
|
+
* @param o 圆心
|
|
27
|
+
* @param p 圆弧起始点
|
|
28
|
+
* @param radian 1,逆时针180度 -1,顺时针
|
|
29
|
+
* @param average 均分数
|
|
30
|
+
* @returns
|
|
31
|
+
*/},{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(xt.RotWith(t,r,i*s));return a;}}]);}(_);var Wt=/******/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 w;}),t.d(r,"isSpriteNode",function(){return I;}),t.d(r,"registerNode",function(){return A;});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 l=t(226);t.d(r,"Path",function(){return l["default"];});var d=t(229);t.d(r,"Rect",function(){return d["default"];});var c=t(231);t.d(r,"Triangle",function(){return c["default"];});var p=t(236);t.d(r,"Parallel",function(){return p["default"];});var y=t(238);t.d(r,"Regular",function(){return y["default"];});var P=t(240);t.d(r,"Star",function(){return P["default"];});var T=t(242);t.d(r,"Ellipse",function(){return T["default"];});var v=t(244);t.d(r,"Arc",function(){return v["default"];});var x=t(246);t.d(r,"Ring",function(){return x["default"];});var f=t(232);t.d(r,"Polyline",function(){return f["default"];});var g=t(248);t.d(r,"Label",function(){return g["default"];});var u=t(250);t.d(r,"Group",function(){return u["default"];});var m=t(286);t.d(r,"Layer",function(){return m["default"];});var M=t(287);t.d(r,"SpriteSvg",function(){return M["default"];});var E=t(289);t.d(r,"LayerWorker",function(){return E["default"];});var R=t(290);t.d(r,"Scene",function(){return R["default"];});var b=t(213),O=t(221);t.d(r,"Color",function(){return O.Color;}),t.d(r,"Gradient",function(){return O.Gradient;});var L=t(72);t(1).glMatrix.setMatrixArrayType(Array);var w=b["default"].createElement,I=b["default"].isSpriteNode,A=b["default"].registerNode,W={parseColor:O.parseColor,sizeToPixel:L.sizeToPixel,toArray:L.toArray,toString:L.toString,toNumber:L.toNumber};var z;z="3.8.3";var K=z;},/* 1 */ /***/function(h,r,t){t.r(r);var e=t(2);t.d(r,"glMatrix",function(){return e;});var n=t(3);t.d(r,"mat2",function(){return n;});var i=t(4);t.d(r,"mat2d",function(){return i;});var a=t(5);t.d(r,"mat3",function(){return a;});var o=t(6);t.d(r,"mat4",function(){return o;});var s=t(7);t.d(r,"quat",function(){return s;});var l=t(10);t.d(r,"quat2",function(){return l;});var d=t(11);t.d(r,"vec2",function(){return d;});var c=t(8);t.d(r,"vec3",function(){return c;});var p=t(9);t.d(r,"vec4",function(){return p;});},/* 2 */ /***/function(h,r,t){t.r(r),t.d(r,"EPSILON",function(){return e;}),t.d(r,"ARRAY_TYPE",function(){return n;}),t.d(r,"RANDOM",function(){return i;}),t.d(r,"setMatrixArrayType",function(){return a;}),t.d(r,"toRadian",function(){return s;}),t.d(r,"equals",function(){return l;});var e=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function a(d){n=d;}var o=Math.PI/180;function s(d){return d*o;}function l(d,c){return Math.abs(d-c)<=e*Math.max(1,Math.abs(d),Math.abs(c));}Math.hypot||(Math.hypot=function(){for(var d=0,c=arguments.length;c--;)d+=arguments[c]*arguments[c];return Math.sqrt(d);});},/* 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 l;}),t.d(r,"transpose",function(){return d;}),t.d(r,"invert",function(){return c;}),t.d(r,"adjoint",function(){return p;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return P;}),t.d(r,"rotate",function(){return T;}),t.d(r,"scale",function(){return v;}),t.d(r,"fromRotation",function(){return x;}),t.d(r,"fromScaling",function(){return f;}),t.d(r,"str",function(){return g;}),t.d(r,"frob",function(){return u;}),t.d(r,"LDU",function(){return m;}),t.d(r,"add",function(){return M;}),t.d(r,"subtract",function(){return E;}),t.d(r,"exactEquals",function(){return R;}),t.d(r,"equals",function(){return b;}),t.d(r,"multiplyScalar",function(){return O;}),t.d(r,"multiplyScalarAndAdd",function(){return L;}),t.d(r,"mul",function(){return w;}),t.d(r,"sub",function(){return I;});var e=t(2);function n(){var A=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(A[1]=0,A[2]=0),A[0]=1,A[3]=1,A;}function i(A){var W=new e.ARRAY_TYPE(4);return W[0]=A[0],W[1]=A[1],W[2]=A[2],W[3]=A[3],W;}function a(A,W){return A[0]=W[0],A[1]=W[1],A[2]=W[2],A[3]=W[3],A;}function o(A){return A[0]=1,A[1]=0,A[2]=0,A[3]=1,A;}function s(A,W,z,K){var k=new e.ARRAY_TYPE(4);return k[0]=A,k[1]=W,k[2]=z,k[3]=K,k;}function l(A,W,z,K,k){return A[0]=W,A[1]=z,A[2]=K,A[3]=k,A;}function d(A,W){if(A===W){var z=W[1];A[1]=W[2],A[2]=z;}else A[0]=W[0],A[1]=W[2],A[2]=W[1],A[3]=W[3];return A;}function c(A,W){var z=W[0],K=W[1],k=W[2],q=W[3],U=z*q-k*K;return U?(U=1/U,A[0]=q*U,A[1]=-K*U,A[2]=-k*U,A[3]=z*U,A):null;}function p(A,W){var z=W[0];return A[0]=W[3],A[1]=-W[1],A[2]=-W[2],A[3]=z,A;}function y(A){return A[0]*A[3]-A[2]*A[1];}function P(A,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=z[0],Z=z[1],nt=z[2],et=z[3];return A[0]=K*G+q*Z,A[1]=k*G+U*Z,A[2]=K*nt+q*et,A[3]=k*nt+U*et,A;}function T(A,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=Math.sin(z),Z=Math.cos(z);return A[0]=K*Z+q*G,A[1]=k*Z+U*G,A[2]=K*-G+q*Z,A[3]=k*-G+U*Z,A;}function v(A,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=z[0],Z=z[1];return A[0]=K*G,A[1]=k*G,A[2]=q*Z,A[3]=U*Z,A;}function x(A,W){var z=Math.sin(W),K=Math.cos(W);return A[0]=K,A[1]=z,A[2]=-z,A[3]=K,A;}function f(A,W){return A[0]=W[0],A[1]=0,A[2]=0,A[3]=W[1],A;}function g(A){return"mat2("+A[0]+", "+A[1]+", "+A[2]+", "+A[3]+")";}function u(A){return Math.hypot(A[0],A[1],A[2],A[3]);}function m(A,W,z,K){return A[2]=K[2]/K[0],z[0]=K[0],z[1]=K[1],z[3]=K[3]-A[2]*z[1],[A,W,z];}function M(A,W,z){return A[0]=W[0]+z[0],A[1]=W[1]+z[1],A[2]=W[2]+z[2],A[3]=W[3]+z[3],A;}function E(A,W,z){return A[0]=W[0]-z[0],A[1]=W[1]-z[1],A[2]=W[2]-z[2],A[3]=W[3]-z[3],A;}function R(A,W){return A[0]===W[0]&&A[1]===W[1]&&A[2]===W[2]&&A[3]===W[3];}function b(A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=W[0],G=W[1],Z=W[2],nt=W[3];return Math.abs(z-U)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(U))&&Math.abs(K-G)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(G))&&Math.abs(k-Z)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(Z))&&Math.abs(q-nt)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(nt));}function O(A,W,z){return A[0]=W[0]*z,A[1]=W[1]*z,A[2]=W[2]*z,A[3]=W[3]*z,A;}function L(A,W,z,K){return A[0]=W[0]+z[0]*K,A[1]=W[1]+z[1]*K,A[2]=W[2]+z[2]*K,A[3]=W[3]+z[3]*K,A;}var w=P,I=E;},/* 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 l;}),t.d(r,"invert",function(){return d;}),t.d(r,"determinant",function(){return c;}),t.d(r,"multiply",function(){return p;}),t.d(r,"rotate",function(){return y;}),t.d(r,"scale",function(){return P;}),t.d(r,"translate",function(){return T;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromScaling",function(){return x;}),t.d(r,"fromTranslation",function(){return f;}),t.d(r,"str",function(){return g;}),t.d(r,"frob",function(){return u;}),t.d(r,"add",function(){return m;}),t.d(r,"subtract",function(){return M;}),t.d(r,"multiplyScalar",function(){return E;}),t.d(r,"multiplyScalarAndAdd",function(){return R;}),t.d(r,"exactEquals",function(){return b;}),t.d(r,"equals",function(){return O;}),t.d(r,"mul",function(){return L;}),t.d(r,"sub",function(){return w;});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 A=new e.ARRAY_TYPE(6);return A[0]=I[0],A[1]=I[1],A[2]=I[2],A[3]=I[3],A[4]=I[4],A[5]=I[5],A;}function a(I,A){return I[0]=A[0],I[1]=A[1],I[2]=A[2],I[3]=A[3],I[4]=A[4],I[5]=A[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,A,W,z,K,k){var q=new e.ARRAY_TYPE(6);return q[0]=I,q[1]=A,q[2]=W,q[3]=z,q[4]=K,q[5]=k,q;}function l(I,A,W,z,K,k,q){return I[0]=A,I[1]=W,I[2]=z,I[3]=K,I[4]=k,I[5]=q,I;}function d(I,A){var W=A[0],z=A[1],K=A[2],k=A[3],q=A[4],U=A[5],G=W*k-z*K;return G?(G=1/G,I[0]=k*G,I[1]=-z*G,I[2]=-K*G,I[3]=W*G,I[4]=(K*U-k*q)*G,I[5]=(z*q-W*U)*G,I):null;}function c(I){return I[0]*I[3]-I[1]*I[2];}function p(I,A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=A[4],G=A[5],Z=W[0],nt=W[1],et=W[2],tt=W[3],J=W[4],ht=W[5];return I[0]=z*Z+k*nt,I[1]=K*Z+q*nt,I[2]=z*et+k*tt,I[3]=K*et+q*tt,I[4]=z*J+k*ht+U,I[5]=K*J+q*ht+G,I;}function y(I,A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=A[4],G=A[5],Z=Math.sin(W),nt=Math.cos(W);return I[0]=z*nt+k*Z,I[1]=K*nt+q*Z,I[2]=z*-Z+k*nt,I[3]=K*-Z+q*nt,I[4]=U,I[5]=G,I;}function P(I,A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=A[4],G=A[5],Z=W[0],nt=W[1];return I[0]=z*Z,I[1]=K*Z,I[2]=k*nt,I[3]=q*nt,I[4]=U,I[5]=G,I;}function T(I,A,W){var z=A[0],K=A[1],k=A[2],q=A[3],U=A[4],G=A[5],Z=W[0],nt=W[1];return I[0]=z,I[1]=K,I[2]=k,I[3]=q,I[4]=z*Z+k*nt+U,I[5]=K*Z+q*nt+G,I;}function v(I,A){var W=Math.sin(A),z=Math.cos(A);return I[0]=z,I[1]=W,I[2]=-W,I[3]=z,I[4]=0,I[5]=0,I;}function x(I,A){return I[0]=A[0],I[1]=0,I[2]=0,I[3]=A[1],I[4]=0,I[5]=0,I;}function f(I,A){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=A[0],I[5]=A[1],I;}function g(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 m(I,A,W){return I[0]=A[0]+W[0],I[1]=A[1]+W[1],I[2]=A[2]+W[2],I[3]=A[3]+W[3],I[4]=A[4]+W[4],I[5]=A[5]+W[5],I;}function M(I,A,W){return I[0]=A[0]-W[0],I[1]=A[1]-W[1],I[2]=A[2]-W[2],I[3]=A[3]-W[3],I[4]=A[4]-W[4],I[5]=A[5]-W[5],I;}function E(I,A,W){return I[0]=A[0]*W,I[1]=A[1]*W,I[2]=A[2]*W,I[3]=A[3]*W,I[4]=A[4]*W,I[5]=A[5]*W,I;}function R(I,A,W,z){return I[0]=A[0]+W[0]*z,I[1]=A[1]+W[1]*z,I[2]=A[2]+W[2]*z,I[3]=A[3]+W[3]*z,I[4]=A[4]+W[4]*z,I[5]=A[5]+W[5]*z,I;}function b(I,A){return I[0]===A[0]&&I[1]===A[1]&&I[2]===A[2]&&I[3]===A[3]&&I[4]===A[4]&&I[5]===A[5];}function O(I,A){var W=I[0],z=I[1],K=I[2],k=I[3],q=I[4],U=I[5],G=A[0],Z=A[1],nt=A[2],et=A[3],tt=A[4],J=A[5];return Math.abs(W-G)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(G))&&Math.abs(z-Z)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(Z))&&Math.abs(K-nt)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(nt))&&Math.abs(k-et)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(et))&&Math.abs(q-tt)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(tt))&&Math.abs(U-J)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(J));}var L=p,w=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 l;}),t.d(r,"identity",function(){return d;}),t.d(r,"transpose",function(){return c;}),t.d(r,"invert",function(){return p;}),t.d(r,"adjoint",function(){return y;}),t.d(r,"determinant",function(){return P;}),t.d(r,"multiply",function(){return T;}),t.d(r,"translate",function(){return v;}),t.d(r,"rotate",function(){return x;}),t.d(r,"scale",function(){return f;}),t.d(r,"fromTranslation",function(){return g;}),t.d(r,"fromRotation",function(){return u;}),t.d(r,"fromScaling",function(){return m;}),t.d(r,"fromMat2d",function(){return M;}),t.d(r,"fromQuat",function(){return E;}),t.d(r,"normalFromMat4",function(){return R;}),t.d(r,"projection",function(){return b;}),t.d(r,"str",function(){return O;}),t.d(r,"frob",function(){return L;}),t.d(r,"add",function(){return w;}),t.d(r,"subtract",function(){return I;}),t.d(r,"multiplyScalar",function(){return A;}),t.d(r,"multiplyScalarAndAdd",function(){return W;}),t.d(r,"exactEquals",function(){return z;}),t.d(r,"equals",function(){return K;}),t.d(r,"mul",function(){return k;}),t.d(r,"sub",function(){return q;});var e=t(2);function n(){var U=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(U[1]=0,U[2]=0,U[3]=0,U[5]=0,U[6]=0,U[7]=0),U[0]=1,U[4]=1,U[8]=1,U;}function i(U,G){return U[0]=G[0],U[1]=G[1],U[2]=G[2],U[3]=G[4],U[4]=G[5],U[5]=G[6],U[6]=G[8],U[7]=G[9],U[8]=G[10],U;}function a(U){var G=new e.ARRAY_TYPE(9);return G[0]=U[0],G[1]=U[1],G[2]=U[2],G[3]=U[3],G[4]=U[4],G[5]=U[5],G[6]=U[6],G[7]=U[7],G[8]=U[8],G;}function o(U,G){return U[0]=G[0],U[1]=G[1],U[2]=G[2],U[3]=G[3],U[4]=G[4],U[5]=G[5],U[6]=G[6],U[7]=G[7],U[8]=G[8],U;}function s(U,G,Z,nt,et,tt,J,ht,dt){var B=new e.ARRAY_TYPE(9);return B[0]=U,B[1]=G,B[2]=Z,B[3]=nt,B[4]=et,B[5]=tt,B[6]=J,B[7]=ht,B[8]=dt,B;}function l(U,G,Z,nt,et,tt,J,ht,dt,B){return U[0]=G,U[1]=Z,U[2]=nt,U[3]=et,U[4]=tt,U[5]=J,U[6]=ht,U[7]=dt,U[8]=B,U;}function d(U){return U[0]=1,U[1]=0,U[2]=0,U[3]=0,U[4]=1,U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function c(U,G){if(U===G){var Z=G[1],nt=G[2],et=G[5];U[1]=G[3],U[2]=G[6],U[3]=Z,U[5]=G[7],U[6]=nt,U[7]=et;}else U[0]=G[0],U[1]=G[3],U[2]=G[6],U[3]=G[1],U[4]=G[4],U[5]=G[7],U[6]=G[2],U[7]=G[5],U[8]=G[8];return U;}function p(U,G){var Z=G[0],nt=G[1],et=G[2],tt=G[3],J=G[4],ht=G[5],dt=G[6],B=G[7],F=G[8],Y=F*J-ht*B,X=-F*tt+ht*dt,N=B*tt-J*dt,$=Z*Y+nt*X+et*N;return $?($=1/$,U[0]=Y*$,U[1]=(-F*nt+et*B)*$,U[2]=(ht*nt-et*J)*$,U[3]=X*$,U[4]=(F*Z-et*dt)*$,U[5]=(-ht*Z+et*tt)*$,U[6]=N*$,U[7]=(-B*Z+nt*dt)*$,U[8]=(J*Z-nt*tt)*$,U):null;}function y(U,G){var Z=G[0],nt=G[1],et=G[2],tt=G[3],J=G[4],ht=G[5],dt=G[6],B=G[7],F=G[8];return U[0]=J*F-ht*B,U[1]=et*B-nt*F,U[2]=nt*ht-et*J,U[3]=ht*dt-tt*F,U[4]=Z*F-et*dt,U[5]=et*tt-Z*ht,U[6]=tt*B-J*dt,U[7]=nt*dt-Z*B,U[8]=Z*J-nt*tt,U;}function P(U){var G=U[0],Z=U[1],nt=U[2],et=U[3],tt=U[4],J=U[5],ht=U[6],dt=U[7],B=U[8];return G*(B*tt-J*dt)+Z*(-B*et+J*ht)+nt*(dt*et-tt*ht);}function T(U,G,Z){var nt=G[0],et=G[1],tt=G[2],J=G[3],ht=G[4],dt=G[5],B=G[6],F=G[7],Y=G[8],X=Z[0],N=Z[1],$=Z[2],S=Z[3],C=Z[4],D=Z[5],j=Z[6],H=Z[7],V=Z[8];return U[0]=X*nt+N*J+$*B,U[1]=X*et+N*ht+$*F,U[2]=X*tt+N*dt+$*Y,U[3]=S*nt+C*J+D*B,U[4]=S*et+C*ht+D*F,U[5]=S*tt+C*dt+D*Y,U[6]=j*nt+H*J+V*B,U[7]=j*et+H*ht+V*F,U[8]=j*tt+H*dt+V*Y,U;}function v(U,G,Z){var nt=G[0],et=G[1],tt=G[2],J=G[3],ht=G[4],dt=G[5],B=G[6],F=G[7],Y=G[8],X=Z[0],N=Z[1];return U[0]=nt,U[1]=et,U[2]=tt,U[3]=J,U[4]=ht,U[5]=dt,U[6]=X*nt+N*J+B,U[7]=X*et+N*ht+F,U[8]=X*tt+N*dt+Y,U;}function x(U,G,Z){var nt=G[0],et=G[1],tt=G[2],J=G[3],ht=G[4],dt=G[5],B=G[6],F=G[7],Y=G[8],X=Math.sin(Z),N=Math.cos(Z);return U[0]=N*nt+X*J,U[1]=N*et+X*ht,U[2]=N*tt+X*dt,U[3]=N*J-X*nt,U[4]=N*ht-X*et,U[5]=N*dt-X*tt,U[6]=B,U[7]=F,U[8]=Y,U;}function f(U,G,Z){var nt=Z[0],et=Z[1];return U[0]=nt*G[0],U[1]=nt*G[1],U[2]=nt*G[2],U[3]=et*G[3],U[4]=et*G[4],U[5]=et*G[5],U[6]=G[6],U[7]=G[7],U[8]=G[8],U;}function g(U,G){return U[0]=1,U[1]=0,U[2]=0,U[3]=0,U[4]=1,U[5]=0,U[6]=G[0],U[7]=G[1],U[8]=1,U;}function u(U,G){var Z=Math.sin(G),nt=Math.cos(G);return U[0]=nt,U[1]=Z,U[2]=0,U[3]=-Z,U[4]=nt,U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function m(U,G){return U[0]=G[0],U[1]=0,U[2]=0,U[3]=0,U[4]=G[1],U[5]=0,U[6]=0,U[7]=0,U[8]=1,U;}function M(U,G){return U[0]=G[0],U[1]=G[1],U[2]=0,U[3]=G[2],U[4]=G[3],U[5]=0,U[6]=G[4],U[7]=G[5],U[8]=1,U;}function E(U,G){var Z=G[0],nt=G[1],et=G[2],tt=G[3],J=Z+Z,ht=nt+nt,dt=et+et,B=Z*J,F=nt*J,Y=nt*ht,X=et*J,N=et*ht,$=et*dt,S=tt*J,C=tt*ht,D=tt*dt;return U[0]=1-Y-$,U[3]=F-D,U[6]=X+C,U[1]=F+D,U[4]=1-B-$,U[7]=N-S,U[2]=X-C,U[5]=N+S,U[8]=1-B-Y,U;}function R(U,G){var Z=G[0],nt=G[1],et=G[2],tt=G[3],J=G[4],ht=G[5],dt=G[6],B=G[7],F=G[8],Y=G[9],X=G[10],N=G[11],$=G[12],S=G[13],C=G[14],D=G[15],j=Z*ht-nt*J,H=Z*dt-et*J,V=Z*B-tt*J,Q=nt*dt-et*ht,it=nt*B-tt*ht,st=et*B-tt*dt,ct=F*S-Y*$,gt=F*C-X*$,at=F*D-N*$,ot=Y*C-X*S,ft=Y*D-N*S,mt=X*D-N*C,yt=j*mt-H*ft+V*ot+Q*at-it*gt+st*ct;return yt?(yt=1/yt,U[0]=(ht*mt-dt*ft+B*ot)*yt,U[1]=(dt*at-J*mt-B*gt)*yt,U[2]=(J*ft-ht*at+B*ct)*yt,U[3]=(et*ft-nt*mt-tt*ot)*yt,U[4]=(Z*mt-et*at+tt*gt)*yt,U[5]=(nt*at-Z*ft-tt*ct)*yt,U[6]=(S*st-C*it+D*Q)*yt,U[7]=(C*V-$*st-D*H)*yt,U[8]=($*it-S*V+D*j)*yt,U):null;}function b(U,G,Z){return U[0]=2/G,U[1]=0,U[2]=0,U[3]=0,U[4]=-2/Z,U[5]=0,U[6]=-1,U[7]=1,U[8]=1,U;}function O(U){return"mat3("+U[0]+", "+U[1]+", "+U[2]+", "+U[3]+", "+U[4]+", "+U[5]+", "+U[6]+", "+U[7]+", "+U[8]+")";}function L(U){return Math.hypot(U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],U[8]);}function w(U,G,Z){return U[0]=G[0]+Z[0],U[1]=G[1]+Z[1],U[2]=G[2]+Z[2],U[3]=G[3]+Z[3],U[4]=G[4]+Z[4],U[5]=G[5]+Z[5],U[6]=G[6]+Z[6],U[7]=G[7]+Z[7],U[8]=G[8]+Z[8],U;}function I(U,G,Z){return U[0]=G[0]-Z[0],U[1]=G[1]-Z[1],U[2]=G[2]-Z[2],U[3]=G[3]-Z[3],U[4]=G[4]-Z[4],U[5]=G[5]-Z[5],U[6]=G[6]-Z[6],U[7]=G[7]-Z[7],U[8]=G[8]-Z[8],U;}function A(U,G,Z){return U[0]=G[0]*Z,U[1]=G[1]*Z,U[2]=G[2]*Z,U[3]=G[3]*Z,U[4]=G[4]*Z,U[5]=G[5]*Z,U[6]=G[6]*Z,U[7]=G[7]*Z,U[8]=G[8]*Z,U;}function W(U,G,Z,nt){return U[0]=G[0]+Z[0]*nt,U[1]=G[1]+Z[1]*nt,U[2]=G[2]+Z[2]*nt,U[3]=G[3]+Z[3]*nt,U[4]=G[4]+Z[4]*nt,U[5]=G[5]+Z[5]*nt,U[6]=G[6]+Z[6]*nt,U[7]=G[7]+Z[7]*nt,U[8]=G[8]+Z[8]*nt,U;}function z(U,G){return U[0]===G[0]&&U[1]===G[1]&&U[2]===G[2]&&U[3]===G[3]&&U[4]===G[4]&&U[5]===G[5]&&U[6]===G[6]&&U[7]===G[7]&&U[8]===G[8];}function K(U,G){var Z=U[0],nt=U[1],et=U[2],tt=U[3],J=U[4],ht=U[5],dt=U[6],B=U[7],F=U[8],Y=G[0],X=G[1],N=G[2],$=G[3],S=G[4],C=G[5],D=G[6],j=G[7],H=G[8];return Math.abs(Z-Y)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(Y))&&Math.abs(nt-X)<=e.EPSILON*Math.max(1,Math.abs(nt),Math.abs(X))&&Math.abs(et-N)<=e.EPSILON*Math.max(1,Math.abs(et),Math.abs(N))&&Math.abs(tt-$)<=e.EPSILON*Math.max(1,Math.abs(tt),Math.abs($))&&Math.abs(J-S)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(S))&&Math.abs(ht-C)<=e.EPSILON*Math.max(1,Math.abs(ht),Math.abs(C))&&Math.abs(dt-D)<=e.EPSILON*Math.max(1,Math.abs(dt),Math.abs(D))&&Math.abs(B-j)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(j))&&Math.abs(F-H)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(H));}var k=T,q=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 l;}),t.d(r,"transpose",function(){return d;}),t.d(r,"invert",function(){return c;}),t.d(r,"adjoint",function(){return p;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return P;}),t.d(r,"translate",function(){return T;}),t.d(r,"scale",function(){return v;}),t.d(r,"rotate",function(){return x;}),t.d(r,"rotateX",function(){return f;}),t.d(r,"rotateY",function(){return g;}),t.d(r,"rotateZ",function(){return u;}),t.d(r,"fromTranslation",function(){return m;}),t.d(r,"fromScaling",function(){return M;}),t.d(r,"fromRotation",function(){return E;}),t.d(r,"fromXRotation",function(){return R;}),t.d(r,"fromYRotation",function(){return b;}),t.d(r,"fromZRotation",function(){return O;}),t.d(r,"fromRotationTranslation",function(){return L;}),t.d(r,"fromQuat2",function(){return w;}),t.d(r,"getTranslation",function(){return I;}),t.d(r,"getScaling",function(){return A;}),t.d(r,"getRotation",function(){return W;}),t.d(r,"fromRotationTranslationScale",function(){return z;}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return K;}),t.d(r,"fromQuat",function(){return k;}),t.d(r,"frustum",function(){return q;}),t.d(r,"perspective",function(){return U;}),t.d(r,"perspectiveFromFieldOfView",function(){return G;}),t.d(r,"ortho",function(){return Z;}),t.d(r,"lookAt",function(){return nt;}),t.d(r,"targetTo",function(){return et;}),t.d(r,"str",function(){return tt;}),t.d(r,"frob",function(){return J;}),t.d(r,"add",function(){return ht;}),t.d(r,"subtract",function(){return dt;}),t.d(r,"multiplyScalar",function(){return B;}),t.d(r,"multiplyScalarAndAdd",function(){return F;}),t.d(r,"exactEquals",function(){return Y;}),t.d(r,"equals",function(){return X;}),t.d(r,"mul",function(){return N;}),t.d(r,"sub",function(){return $;});var e=t(2);function n(){var S=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0),S[0]=1,S[5]=1,S[10]=1,S[15]=1,S;}function i(S){var C=new e.ARRAY_TYPE(16);return C[0]=S[0],C[1]=S[1],C[2]=S[2],C[3]=S[3],C[4]=S[4],C[5]=S[5],C[6]=S[6],C[7]=S[7],C[8]=S[8],C[9]=S[9],C[10]=S[10],C[11]=S[11],C[12]=S[12],C[13]=S[13],C[14]=S[14],C[15]=S[15],C;}function a(S,C){return S[0]=C[0],S[1]=C[1],S[2]=C[2],S[3]=C[3],S[4]=C[4],S[5]=C[5],S[6]=C[6],S[7]=C[7],S[8]=C[8],S[9]=C[9],S[10]=C[10],S[11]=C[11],S[12]=C[12],S[13]=C[13],S[14]=C[14],S[15]=C[15],S;}function o(S,C,D,j,H,V,Q,it,st,ct,gt,at,ot,ft,mt,yt){var pt=new e.ARRAY_TYPE(16);return pt[0]=S,pt[1]=C,pt[2]=D,pt[3]=j,pt[4]=H,pt[5]=V,pt[6]=Q,pt[7]=it,pt[8]=st,pt[9]=ct,pt[10]=gt,pt[11]=at,pt[12]=ot,pt[13]=ft,pt[14]=mt,pt[15]=yt,pt;}function s(S,C,D,j,H,V,Q,it,st,ct,gt,at,ot,ft,mt,yt,pt){return S[0]=C,S[1]=D,S[2]=j,S[3]=H,S[4]=V,S[5]=Q,S[6]=it,S[7]=st,S[8]=ct,S[9]=gt,S[10]=at,S[11]=ot,S[12]=ft,S[13]=mt,S[14]=yt,S[15]=pt,S;}function l(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function d(S,C){if(S===C){var D=C[1],j=C[2],H=C[3],V=C[6],Q=C[7],it=C[11];S[1]=C[4],S[2]=C[8],S[3]=C[12],S[4]=D,S[6]=C[9],S[7]=C[13],S[8]=j,S[9]=V,S[11]=C[14],S[12]=H,S[13]=Q,S[14]=it;}else S[0]=C[0],S[1]=C[4],S[2]=C[8],S[3]=C[12],S[4]=C[1],S[5]=C[5],S[6]=C[9],S[7]=C[13],S[8]=C[2],S[9]=C[6],S[10]=C[10],S[11]=C[14],S[12]=C[3],S[13]=C[7],S[14]=C[11],S[15]=C[15];return S;}function c(S,C){var D=C[0],j=C[1],H=C[2],V=C[3],Q=C[4],it=C[5],st=C[6],ct=C[7],gt=C[8],at=C[9],ot=C[10],ft=C[11],mt=C[12],yt=C[13],pt=C[14],Tt=C[15],It=D*it-j*Q,Ot=D*st-H*Q,Et=D*ct-V*Q,Ct=j*st-H*it,At=j*ct-V*it,Ht=H*ct-V*st,$t=gt*yt-at*mt,zt=gt*pt-ot*mt,Gt=gt*Tt-ft*mt,Kt=at*pt-ot*yt,Yt=at*Tt-ft*yt,Vt=ot*Tt-ft*pt,Dt=It*Vt-Ot*Yt+Et*Kt+Ct*Gt-At*zt+Ht*$t;return Dt?(Dt=1/Dt,S[0]=(it*Vt-st*Yt+ct*Kt)*Dt,S[1]=(H*Yt-j*Vt-V*Kt)*Dt,S[2]=(yt*Ht-pt*At+Tt*Ct)*Dt,S[3]=(ot*At-at*Ht-ft*Ct)*Dt,S[4]=(st*Gt-Q*Vt-ct*zt)*Dt,S[5]=(D*Vt-H*Gt+V*zt)*Dt,S[6]=(pt*Et-mt*Ht-Tt*Ot)*Dt,S[7]=(gt*Ht-ot*Et+ft*Ot)*Dt,S[8]=(Q*Yt-it*Gt+ct*$t)*Dt,S[9]=(j*Gt-D*Yt-V*$t)*Dt,S[10]=(mt*At-yt*Et+Tt*It)*Dt,S[11]=(at*Et-gt*At-ft*It)*Dt,S[12]=(it*zt-Q*Kt-st*$t)*Dt,S[13]=(D*Kt-j*zt+H*$t)*Dt,S[14]=(yt*Ot-mt*Ct-pt*It)*Dt,S[15]=(gt*Ct-at*Ot+ot*It)*Dt,S):null;}function p(S,C){var D=C[0],j=C[1],H=C[2],V=C[3],Q=C[4],it=C[5],st=C[6],ct=C[7],gt=C[8],at=C[9],ot=C[10],ft=C[11],mt=C[12],yt=C[13],pt=C[14],Tt=C[15];return S[0]=it*(ot*Tt-ft*pt)-at*(st*Tt-ct*pt)+yt*(st*ft-ct*ot),S[1]=-(j*(ot*Tt-ft*pt)-at*(H*Tt-V*pt)+yt*(H*ft-V*ot)),S[2]=j*(st*Tt-ct*pt)-it*(H*Tt-V*pt)+yt*(H*ct-V*st),S[3]=-(j*(st*ft-ct*ot)-it*(H*ft-V*ot)+at*(H*ct-V*st)),S[4]=-(Q*(ot*Tt-ft*pt)-gt*(st*Tt-ct*pt)+mt*(st*ft-ct*ot)),S[5]=D*(ot*Tt-ft*pt)-gt*(H*Tt-V*pt)+mt*(H*ft-V*ot),S[6]=-(D*(st*Tt-ct*pt)-Q*(H*Tt-V*pt)+mt*(H*ct-V*st)),S[7]=D*(st*ft-ct*ot)-Q*(H*ft-V*ot)+gt*(H*ct-V*st),S[8]=Q*(at*Tt-ft*yt)-gt*(it*Tt-ct*yt)+mt*(it*ft-ct*at),S[9]=-(D*(at*Tt-ft*yt)-gt*(j*Tt-V*yt)+mt*(j*ft-V*at)),S[10]=D*(it*Tt-ct*yt)-Q*(j*Tt-V*yt)+mt*(j*ct-V*it),S[11]=-(D*(it*ft-ct*at)-Q*(j*ft-V*at)+gt*(j*ct-V*it)),S[12]=-(Q*(at*pt-ot*yt)-gt*(it*pt-st*yt)+mt*(it*ot-st*at)),S[13]=D*(at*pt-ot*yt)-gt*(j*pt-H*yt)+mt*(j*ot-H*at),S[14]=-(D*(it*pt-st*yt)-Q*(j*pt-H*yt)+mt*(j*st-H*it)),S[15]=D*(it*ot-st*at)-Q*(j*ot-H*at)+gt*(j*st-H*it),S;}function y(S){var C=S[0],D=S[1],j=S[2],H=S[3],V=S[4],Q=S[5],it=S[6],st=S[7],ct=S[8],gt=S[9],at=S[10],ot=S[11],ft=S[12],mt=S[13],yt=S[14],pt=S[15],Tt=C*Q-D*V,It=C*it-j*V,Ot=C*st-H*V,Et=D*it-j*Q,Ct=D*st-H*Q,At=j*st-H*it,Ht=ct*mt-gt*ft,$t=ct*yt-at*ft,zt=ct*pt-ot*ft,Gt=gt*yt-at*mt,Kt=gt*pt-ot*mt,Yt=at*pt-ot*yt;return Tt*Yt-It*Kt+Ot*Gt+Et*zt-Ct*$t+At*Ht;}function P(S,C,D){var j=C[0],H=C[1],V=C[2],Q=C[3],it=C[4],st=C[5],ct=C[6],gt=C[7],at=C[8],ot=C[9],ft=C[10],mt=C[11],yt=C[12],pt=C[13],Tt=C[14],It=C[15],Ot=D[0],Et=D[1],Ct=D[2],At=D[3];return S[0]=Ot*j+Et*it+Ct*at+At*yt,S[1]=Ot*H+Et*st+Ct*ot+At*pt,S[2]=Ot*V+Et*ct+Ct*ft+At*Tt,S[3]=Ot*Q+Et*gt+Ct*mt+At*It,Ot=D[4],Et=D[5],Ct=D[6],At=D[7],S[4]=Ot*j+Et*it+Ct*at+At*yt,S[5]=Ot*H+Et*st+Ct*ot+At*pt,S[6]=Ot*V+Et*ct+Ct*ft+At*Tt,S[7]=Ot*Q+Et*gt+Ct*mt+At*It,Ot=D[8],Et=D[9],Ct=D[10],At=D[11],S[8]=Ot*j+Et*it+Ct*at+At*yt,S[9]=Ot*H+Et*st+Ct*ot+At*pt,S[10]=Ot*V+Et*ct+Ct*ft+At*Tt,S[11]=Ot*Q+Et*gt+Ct*mt+At*It,Ot=D[12],Et=D[13],Ct=D[14],At=D[15],S[12]=Ot*j+Et*it+Ct*at+At*yt,S[13]=Ot*H+Et*st+Ct*ot+At*pt,S[14]=Ot*V+Et*ct+Ct*ft+At*Tt,S[15]=Ot*Q+Et*gt+Ct*mt+At*It,S;}function T(S,C,D){var j=D[0],H=D[1],V=D[2],Q,it,st,ct,gt,at,ot,ft,mt,yt,pt,Tt;return C===S?(S[12]=C[0]*j+C[4]*H+C[8]*V+C[12],S[13]=C[1]*j+C[5]*H+C[9]*V+C[13],S[14]=C[2]*j+C[6]*H+C[10]*V+C[14],S[15]=C[3]*j+C[7]*H+C[11]*V+C[15]):(Q=C[0],it=C[1],st=C[2],ct=C[3],gt=C[4],at=C[5],ot=C[6],ft=C[7],mt=C[8],yt=C[9],pt=C[10],Tt=C[11],S[0]=Q,S[1]=it,S[2]=st,S[3]=ct,S[4]=gt,S[5]=at,S[6]=ot,S[7]=ft,S[8]=mt,S[9]=yt,S[10]=pt,S[11]=Tt,S[12]=Q*j+gt*H+mt*V+C[12],S[13]=it*j+at*H+yt*V+C[13],S[14]=st*j+ot*H+pt*V+C[14],S[15]=ct*j+ft*H+Tt*V+C[15]),S;}function v(S,C,D){var j=D[0],H=D[1],V=D[2];return S[0]=C[0]*j,S[1]=C[1]*j,S[2]=C[2]*j,S[3]=C[3]*j,S[4]=C[4]*H,S[5]=C[5]*H,S[6]=C[6]*H,S[7]=C[7]*H,S[8]=C[8]*V,S[9]=C[9]*V,S[10]=C[10]*V,S[11]=C[11]*V,S[12]=C[12],S[13]=C[13],S[14]=C[14],S[15]=C[15],S;}function x(S,C,D,j){var H=j[0],V=j[1],Q=j[2],it=Math.hypot(H,V,Q),st,ct,gt,at,ot,ft,mt,yt,pt,Tt,It,Ot,Et,Ct,At,Ht,$t,zt,Gt,Kt,Yt,Vt,Dt,Qt;return it<e.EPSILON?null:(it=1/it,H*=it,V*=it,Q*=it,st=Math.sin(D),ct=Math.cos(D),gt=1-ct,at=C[0],ot=C[1],ft=C[2],mt=C[3],yt=C[4],pt=C[5],Tt=C[6],It=C[7],Ot=C[8],Et=C[9],Ct=C[10],At=C[11],Ht=H*H*gt+ct,$t=V*H*gt+Q*st,zt=Q*H*gt-V*st,Gt=H*V*gt-Q*st,Kt=V*V*gt+ct,Yt=Q*V*gt+H*st,Vt=H*Q*gt+V*st,Dt=V*Q*gt-H*st,Qt=Q*Q*gt+ct,S[0]=at*Ht+yt*$t+Ot*zt,S[1]=ot*Ht+pt*$t+Et*zt,S[2]=ft*Ht+Tt*$t+Ct*zt,S[3]=mt*Ht+It*$t+At*zt,S[4]=at*Gt+yt*Kt+Ot*Yt,S[5]=ot*Gt+pt*Kt+Et*Yt,S[6]=ft*Gt+Tt*Kt+Ct*Yt,S[7]=mt*Gt+It*Kt+At*Yt,S[8]=at*Vt+yt*Dt+Ot*Qt,S[9]=ot*Vt+pt*Dt+Et*Qt,S[10]=ft*Vt+Tt*Dt+Ct*Qt,S[11]=mt*Vt+It*Dt+At*Qt,C!==S&&(S[12]=C[12],S[13]=C[13],S[14]=C[14],S[15]=C[15]),S);}function f(S,C,D){var j=Math.sin(D),H=Math.cos(D),V=C[4],Q=C[5],it=C[6],st=C[7],ct=C[8],gt=C[9],at=C[10],ot=C[11];return C!==S&&(S[0]=C[0],S[1]=C[1],S[2]=C[2],S[3]=C[3],S[12]=C[12],S[13]=C[13],S[14]=C[14],S[15]=C[15]),S[4]=V*H+ct*j,S[5]=Q*H+gt*j,S[6]=it*H+at*j,S[7]=st*H+ot*j,S[8]=ct*H-V*j,S[9]=gt*H-Q*j,S[10]=at*H-it*j,S[11]=ot*H-st*j,S;}function g(S,C,D){var j=Math.sin(D),H=Math.cos(D),V=C[0],Q=C[1],it=C[2],st=C[3],ct=C[8],gt=C[9],at=C[10],ot=C[11];return C!==S&&(S[4]=C[4],S[5]=C[5],S[6]=C[6],S[7]=C[7],S[12]=C[12],S[13]=C[13],S[14]=C[14],S[15]=C[15]),S[0]=V*H-ct*j,S[1]=Q*H-gt*j,S[2]=it*H-at*j,S[3]=st*H-ot*j,S[8]=V*j+ct*H,S[9]=Q*j+gt*H,S[10]=it*j+at*H,S[11]=st*j+ot*H,S;}function u(S,C,D){var j=Math.sin(D),H=Math.cos(D),V=C[0],Q=C[1],it=C[2],st=C[3],ct=C[4],gt=C[5],at=C[6],ot=C[7];return C!==S&&(S[8]=C[8],S[9]=C[9],S[10]=C[10],S[11]=C[11],S[12]=C[12],S[13]=C[13],S[14]=C[14],S[15]=C[15]),S[0]=V*H+ct*j,S[1]=Q*H+gt*j,S[2]=it*H+at*j,S[3]=st*H+ot*j,S[4]=ct*H-V*j,S[5]=gt*H-Q*j,S[6]=at*H-it*j,S[7]=ot*H-st*j,S;}function m(S,C){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=C[0],S[13]=C[1],S[14]=C[2],S[15]=1,S;}function M(S,C){return S[0]=C[0],S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=C[1],S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=C[2],S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function E(S,C,D){var j=D[0],H=D[1],V=D[2],Q=Math.hypot(j,H,V),it,st,ct;return Q<e.EPSILON?null:(Q=1/Q,j*=Q,H*=Q,V*=Q,it=Math.sin(C),st=Math.cos(C),ct=1-st,S[0]=j*j*ct+st,S[1]=H*j*ct+V*it,S[2]=V*j*ct-H*it,S[3]=0,S[4]=j*H*ct-V*it,S[5]=H*H*ct+st,S[6]=V*H*ct+j*it,S[7]=0,S[8]=j*V*ct+H*it,S[9]=H*V*ct-j*it,S[10]=V*V*ct+st,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S);}function R(S,C){var D=Math.sin(C),j=Math.cos(C);return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=j,S[6]=D,S[7]=0,S[8]=0,S[9]=-D,S[10]=j,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function b(S,C){var D=Math.sin(C),j=Math.cos(C);return S[0]=j,S[1]=0,S[2]=-D,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=D,S[9]=0,S[10]=j,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function O(S,C){var D=Math.sin(C),j=Math.cos(C);return S[0]=j,S[1]=D,S[2]=0,S[3]=0,S[4]=-D,S[5]=j,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function L(S,C,D){var j=C[0],H=C[1],V=C[2],Q=C[3],it=j+j,st=H+H,ct=V+V,gt=j*it,at=j*st,ot=j*ct,ft=H*st,mt=H*ct,yt=V*ct,pt=Q*it,Tt=Q*st,It=Q*ct;return S[0]=1-(ft+yt),S[1]=at+It,S[2]=ot-Tt,S[3]=0,S[4]=at-It,S[5]=1-(gt+yt),S[6]=mt+pt,S[7]=0,S[8]=ot+Tt,S[9]=mt-pt,S[10]=1-(gt+ft),S[11]=0,S[12]=D[0],S[13]=D[1],S[14]=D[2],S[15]=1,S;}function w(S,C){var D=new e.ARRAY_TYPE(3),j=-C[0],H=-C[1],V=-C[2],Q=C[3],it=C[4],st=C[5],ct=C[6],gt=C[7],at=j*j+H*H+V*V+Q*Q;return at>0?(D[0]=(it*Q+gt*j+st*V-ct*H)*2/at,D[1]=(st*Q+gt*H+ct*j-it*V)*2/at,D[2]=(ct*Q+gt*V+it*H-st*j)*2/at):(D[0]=(it*Q+gt*j+st*V-ct*H)*2,D[1]=(st*Q+gt*H+ct*j-it*V)*2,D[2]=(ct*Q+gt*V+it*H-st*j)*2),L(S,C,D),S;}function I(S,C){return S[0]=C[12],S[1]=C[13],S[2]=C[14],S;}function A(S,C){var D=C[0],j=C[1],H=C[2],V=C[4],Q=C[5],it=C[6],st=C[8],ct=C[9],gt=C[10];return S[0]=Math.hypot(D,j,H),S[1]=Math.hypot(V,Q,it),S[2]=Math.hypot(st,ct,gt),S;}function W(S,C){var D=new e.ARRAY_TYPE(3);A(D,C);var j=1/D[0],H=1/D[1],V=1/D[2],Q=C[0]*j,it=C[1]*H,st=C[2]*V,ct=C[4]*j,gt=C[5]*H,at=C[6]*V,ot=C[8]*j,ft=C[9]*H,mt=C[10]*V,yt=Q+gt+mt,pt=0;return yt>0?(pt=Math.sqrt(yt+1)*2,S[3]=0.25*pt,S[0]=(at-ft)/pt,S[1]=(ot-st)/pt,S[2]=(it-ct)/pt):Q>gt&&Q>mt?(pt=Math.sqrt(1+Q-gt-mt)*2,S[3]=(at-ft)/pt,S[0]=0.25*pt,S[1]=(it+ct)/pt,S[2]=(ot+st)/pt):gt>mt?(pt=Math.sqrt(1+gt-Q-mt)*2,S[3]=(ot-st)/pt,S[0]=(it+ct)/pt,S[1]=0.25*pt,S[2]=(at+ft)/pt):(pt=Math.sqrt(1+mt-Q-gt)*2,S[3]=(it-ct)/pt,S[0]=(ot+st)/pt,S[1]=(at+ft)/pt,S[2]=0.25*pt),S;}function z(S,C,D,j){var H=C[0],V=C[1],Q=C[2],it=C[3],st=H+H,ct=V+V,gt=Q+Q,at=H*st,ot=H*ct,ft=H*gt,mt=V*ct,yt=V*gt,pt=Q*gt,Tt=it*st,It=it*ct,Ot=it*gt,Et=j[0],Ct=j[1],At=j[2];return S[0]=(1-(mt+pt))*Et,S[1]=(ot+Ot)*Et,S[2]=(ft-It)*Et,S[3]=0,S[4]=(ot-Ot)*Ct,S[5]=(1-(at+pt))*Ct,S[6]=(yt+Tt)*Ct,S[7]=0,S[8]=(ft+It)*At,S[9]=(yt-Tt)*At,S[10]=(1-(at+mt))*At,S[11]=0,S[12]=D[0],S[13]=D[1],S[14]=D[2],S[15]=1,S;}function K(S,C,D,j,H){var V=C[0],Q=C[1],it=C[2],st=C[3],ct=V+V,gt=Q+Q,at=it+it,ot=V*ct,ft=V*gt,mt=V*at,yt=Q*gt,pt=Q*at,Tt=it*at,It=st*ct,Ot=st*gt,Et=st*at,Ct=j[0],At=j[1],Ht=j[2],$t=H[0],zt=H[1],Gt=H[2],Kt=(1-(yt+Tt))*Ct,Yt=(ft+Et)*Ct,Vt=(mt-Ot)*Ct,Dt=(ft-Et)*At,Qt=(1-(ot+Tt))*At,Le=(pt+It)*At,be=(mt+Ot)*Ht,$r=(pt-It)*Ht,zr=(1-(ot+yt))*Ht;return S[0]=Kt,S[1]=Yt,S[2]=Vt,S[3]=0,S[4]=Dt,S[5]=Qt,S[6]=Le,S[7]=0,S[8]=be,S[9]=$r,S[10]=zr,S[11]=0,S[12]=D[0]+$t-(Kt*$t+Dt*zt+be*Gt),S[13]=D[1]+zt-(Yt*$t+Qt*zt+$r*Gt),S[14]=D[2]+Gt-(Vt*$t+Le*zt+zr*Gt),S[15]=1,S;}function k(S,C){var D=C[0],j=C[1],H=C[2],V=C[3],Q=D+D,it=j+j,st=H+H,ct=D*Q,gt=j*Q,at=j*it,ot=H*Q,ft=H*it,mt=H*st,yt=V*Q,pt=V*it,Tt=V*st;return S[0]=1-at-mt,S[1]=gt+Tt,S[2]=ot-pt,S[3]=0,S[4]=gt-Tt,S[5]=1-ct-mt,S[6]=ft+yt,S[7]=0,S[8]=ot+pt,S[9]=ft-yt,S[10]=1-ct-at,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function q(S,C,D,j,H,V,Q){var it=1/(D-C),st=1/(H-j),ct=1/(V-Q);return S[0]=V*2*it,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=V*2*st,S[6]=0,S[7]=0,S[8]=(D+C)*it,S[9]=(H+j)*st,S[10]=(Q+V)*ct,S[11]=-1,S[12]=0,S[13]=0,S[14]=Q*V*2*ct,S[15]=0,S;}function U(S,C,D,j,H){var V=1/Math.tan(C/2),Q;return S[0]=V/D,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=V,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,H!=null&&H!==1/0?(Q=1/(j-H),S[10]=(H+j)*Q,S[14]=2*H*j*Q):(S[10]=-1,S[14]=-2*j),S;}function G(S,C,D,j){var H=Math.tan(C.upDegrees*Math.PI/180),V=Math.tan(C.downDegrees*Math.PI/180),Q=Math.tan(C.leftDegrees*Math.PI/180),it=Math.tan(C.rightDegrees*Math.PI/180),st=2/(Q+it),ct=2/(H+V);return S[0]=st,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=ct,S[6]=0,S[7]=0,S[8]=-((Q-it)*st*0.5),S[9]=(H-V)*ct*0.5,S[10]=j/(D-j),S[11]=-1,S[12]=0,S[13]=0,S[14]=j*D/(D-j),S[15]=0,S;}function Z(S,C,D,j,H,V,Q){var it=1/(C-D),st=1/(j-H),ct=1/(V-Q);return S[0]=-2*it,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*st,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*ct,S[11]=0,S[12]=(C+D)*it,S[13]=(H+j)*st,S[14]=(Q+V)*ct,S[15]=1,S;}function nt(S,C,D,j){var H,V,Q,it,st,ct,gt,at,ot,ft,mt=C[0],yt=C[1],pt=C[2],Tt=j[0],It=j[1],Ot=j[2],Et=D[0],Ct=D[1],At=D[2];return Math.abs(mt-Et)<e.EPSILON&&Math.abs(yt-Ct)<e.EPSILON&&Math.abs(pt-At)<e.EPSILON?l(S):(gt=mt-Et,at=yt-Ct,ot=pt-At,ft=1/Math.hypot(gt,at,ot),gt*=ft,at*=ft,ot*=ft,H=It*ot-Ot*at,V=Ot*gt-Tt*ot,Q=Tt*at-It*gt,ft=Math.hypot(H,V,Q),ft?(ft=1/ft,H*=ft,V*=ft,Q*=ft):(H=0,V=0,Q=0),it=at*Q-ot*V,st=ot*H-gt*Q,ct=gt*V-at*H,ft=Math.hypot(it,st,ct),ft?(ft=1/ft,it*=ft,st*=ft,ct*=ft):(it=0,st=0,ct=0),S[0]=H,S[1]=it,S[2]=gt,S[3]=0,S[4]=V,S[5]=st,S[6]=at,S[7]=0,S[8]=Q,S[9]=ct,S[10]=ot,S[11]=0,S[12]=-(H*mt+V*yt+Q*pt),S[13]=-(it*mt+st*yt+ct*pt),S[14]=-(gt*mt+at*yt+ot*pt),S[15]=1,S);}function et(S,C,D,j){var H=C[0],V=C[1],Q=C[2],it=j[0],st=j[1],ct=j[2],gt=H-D[0],at=V-D[1],ot=Q-D[2],ft=gt*gt+at*at+ot*ot;ft>0&&(ft=1/Math.sqrt(ft),gt*=ft,at*=ft,ot*=ft);var mt=st*ot-ct*at,yt=ct*gt-it*ot,pt=it*at-st*gt;return ft=mt*mt+yt*yt+pt*pt,ft>0&&(ft=1/Math.sqrt(ft),mt*=ft,yt*=ft,pt*=ft),S[0]=mt,S[1]=yt,S[2]=pt,S[3]=0,S[4]=at*pt-ot*yt,S[5]=ot*mt-gt*pt,S[6]=gt*yt-at*mt,S[7]=0,S[8]=gt,S[9]=at,S[10]=ot,S[11]=0,S[12]=H,S[13]=V,S[14]=Q,S[15]=1,S;}function tt(S){return"mat4("+S[0]+", "+S[1]+", "+S[2]+", "+S[3]+", "+S[4]+", "+S[5]+", "+S[6]+", "+S[7]+", "+S[8]+", "+S[9]+", "+S[10]+", "+S[11]+", "+S[12]+", "+S[13]+", "+S[14]+", "+S[15]+")";}function J(S){return Math.hypot(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[8],S[9],S[10],S[11],S[12],S[13],S[14],S[15]);}function ht(S,C,D){return S[0]=C[0]+D[0],S[1]=C[1]+D[1],S[2]=C[2]+D[2],S[3]=C[3]+D[3],S[4]=C[4]+D[4],S[5]=C[5]+D[5],S[6]=C[6]+D[6],S[7]=C[7]+D[7],S[8]=C[8]+D[8],S[9]=C[9]+D[9],S[10]=C[10]+D[10],S[11]=C[11]+D[11],S[12]=C[12]+D[12],S[13]=C[13]+D[13],S[14]=C[14]+D[14],S[15]=C[15]+D[15],S;}function dt(S,C,D){return S[0]=C[0]-D[0],S[1]=C[1]-D[1],S[2]=C[2]-D[2],S[3]=C[3]-D[3],S[4]=C[4]-D[4],S[5]=C[5]-D[5],S[6]=C[6]-D[6],S[7]=C[7]-D[7],S[8]=C[8]-D[8],S[9]=C[9]-D[9],S[10]=C[10]-D[10],S[11]=C[11]-D[11],S[12]=C[12]-D[12],S[13]=C[13]-D[13],S[14]=C[14]-D[14],S[15]=C[15]-D[15],S;}function B(S,C,D){return S[0]=C[0]*D,S[1]=C[1]*D,S[2]=C[2]*D,S[3]=C[3]*D,S[4]=C[4]*D,S[5]=C[5]*D,S[6]=C[6]*D,S[7]=C[7]*D,S[8]=C[8]*D,S[9]=C[9]*D,S[10]=C[10]*D,S[11]=C[11]*D,S[12]=C[12]*D,S[13]=C[13]*D,S[14]=C[14]*D,S[15]=C[15]*D,S;}function F(S,C,D,j){return S[0]=C[0]+D[0]*j,S[1]=C[1]+D[1]*j,S[2]=C[2]+D[2]*j,S[3]=C[3]+D[3]*j,S[4]=C[4]+D[4]*j,S[5]=C[5]+D[5]*j,S[6]=C[6]+D[6]*j,S[7]=C[7]+D[7]*j,S[8]=C[8]+D[8]*j,S[9]=C[9]+D[9]*j,S[10]=C[10]+D[10]*j,S[11]=C[11]+D[11]*j,S[12]=C[12]+D[12]*j,S[13]=C[13]+D[13]*j,S[14]=C[14]+D[14]*j,S[15]=C[15]+D[15]*j,S;}function Y(S,C){return S[0]===C[0]&&S[1]===C[1]&&S[2]===C[2]&&S[3]===C[3]&&S[4]===C[4]&&S[5]===C[5]&&S[6]===C[6]&&S[7]===C[7]&&S[8]===C[8]&&S[9]===C[9]&&S[10]===C[10]&&S[11]===C[11]&&S[12]===C[12]&&S[13]===C[13]&&S[14]===C[14]&&S[15]===C[15];}function X(S,C){var D=S[0],j=S[1],H=S[2],V=S[3],Q=S[4],it=S[5],st=S[6],ct=S[7],gt=S[8],at=S[9],ot=S[10],ft=S[11],mt=S[12],yt=S[13],pt=S[14],Tt=S[15],It=C[0],Ot=C[1],Et=C[2],Ct=C[3],At=C[4],Ht=C[5],$t=C[6],zt=C[7],Gt=C[8],Kt=C[9],Yt=C[10],Vt=C[11],Dt=C[12],Qt=C[13],Le=C[14],be=C[15];return Math.abs(D-It)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(It))&&Math.abs(j-Ot)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(Ot))&&Math.abs(H-Et)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(Et))&&Math.abs(V-Ct)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(Ct))&&Math.abs(Q-At)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(At))&&Math.abs(it-Ht)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs(Ht))&&Math.abs(st-$t)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs($t))&&Math.abs(ct-zt)<=e.EPSILON*Math.max(1,Math.abs(ct),Math.abs(zt))&&Math.abs(gt-Gt)<=e.EPSILON*Math.max(1,Math.abs(gt),Math.abs(Gt))&&Math.abs(at-Kt)<=e.EPSILON*Math.max(1,Math.abs(at),Math.abs(Kt))&&Math.abs(ot-Yt)<=e.EPSILON*Math.max(1,Math.abs(ot),Math.abs(Yt))&&Math.abs(ft-Vt)<=e.EPSILON*Math.max(1,Math.abs(ft),Math.abs(Vt))&&Math.abs(mt-Dt)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(Dt))&&Math.abs(yt-Qt)<=e.EPSILON*Math.max(1,Math.abs(yt),Math.abs(Qt))&&Math.abs(pt-Le)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Le))&&Math.abs(Tt-be)<=e.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(be));}var N=P,$=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 l;}),t.d(r,"getAxisAngle",function(){return d;}),t.d(r,"getAngle",function(){return c;}),t.d(r,"multiply",function(){return p;}),t.d(r,"rotateX",function(){return y;}),t.d(r,"rotateY",function(){return P;}),t.d(r,"rotateZ",function(){return T;}),t.d(r,"calculateW",function(){return v;}),t.d(r,"exp",function(){return x;}),t.d(r,"ln",function(){return f;}),t.d(r,"pow",function(){return g;}),t.d(r,"slerp",function(){return u;}),t.d(r,"random",function(){return m;}),t.d(r,"invert",function(){return M;}),t.d(r,"conjugate",function(){return E;}),t.d(r,"fromMat3",function(){return R;}),t.d(r,"fromEuler",function(){return b;}),t.d(r,"str",function(){return O;}),t.d(r,"clone",function(){return L;}),t.d(r,"fromValues",function(){return w;}),t.d(r,"copy",function(){return I;}),t.d(r,"set",function(){return A;}),t.d(r,"add",function(){return W;}),t.d(r,"mul",function(){return z;}),t.d(r,"scale",function(){return K;}),t.d(r,"dot",function(){return k;}),t.d(r,"lerp",function(){return q;}),t.d(r,"length",function(){return U;}),t.d(r,"len",function(){return G;}),t.d(r,"squaredLength",function(){return Z;}),t.d(r,"sqrLen",function(){return nt;}),t.d(r,"normalize",function(){return et;}),t.d(r,"exactEquals",function(){return tt;}),t.d(r,"equals",function(){return J;}),t.d(r,"rotationTo",function(){return ht;}),t.d(r,"sqlerp",function(){return dt;}),t.d(r,"setAxes",function(){return B;});var e=t(2),n=t(5),i=t(8),a=t(9);function o(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0),F[3]=1,F;}function s(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F;}function l(F,Y,X){X=X*0.5;var N=Math.sin(X);return F[0]=N*Y[0],F[1]=N*Y[1],F[2]=N*Y[2],F[3]=Math.cos(X),F;}function d(F,Y){var X=Math.acos(Y[3])*2,N=Math.sin(X/2);return N>e.EPSILON?(F[0]=Y[0]/N,F[1]=Y[1]/N,F[2]=Y[2]/N):(F[0]=1,F[1]=0,F[2]=0),X;}function c(F,Y){var X=k(F,Y);return Math.acos(2*X*X-1);}function p(F,Y,X){var N=Y[0],$=Y[1],S=Y[2],C=Y[3],D=X[0],j=X[1],H=X[2],V=X[3];return F[0]=N*V+C*D+$*H-S*j,F[1]=$*V+C*j+S*D-N*H,F[2]=S*V+C*H+N*j-$*D,F[3]=C*V-N*D-$*j-S*H,F;}function y(F,Y,X){X*=0.5;var N=Y[0],$=Y[1],S=Y[2],C=Y[3],D=Math.sin(X),j=Math.cos(X);return F[0]=N*j+C*D,F[1]=$*j+S*D,F[2]=S*j-$*D,F[3]=C*j-N*D,F;}function P(F,Y,X){X*=0.5;var N=Y[0],$=Y[1],S=Y[2],C=Y[3],D=Math.sin(X),j=Math.cos(X);return F[0]=N*j-S*D,F[1]=$*j+C*D,F[2]=S*j+N*D,F[3]=C*j-$*D,F;}function T(F,Y,X){X*=0.5;var N=Y[0],$=Y[1],S=Y[2],C=Y[3],D=Math.sin(X),j=Math.cos(X);return F[0]=N*j+$*D,F[1]=$*j-N*D,F[2]=S*j+C*D,F[3]=C*j-S*D,F;}function v(F,Y){var X=Y[0],N=Y[1],$=Y[2];return F[0]=X,F[1]=N,F[2]=$,F[3]=Math.sqrt(Math.abs(1-X*X-N*N-$*$)),F;}function x(F,Y){var X=Y[0],N=Y[1],$=Y[2],S=Y[3],C=Math.sqrt(X*X+N*N+$*$),D=Math.exp(S),j=C>0?D*Math.sin(C)/C:0;return F[0]=X*j,F[1]=N*j,F[2]=$*j,F[3]=D*Math.cos(C),F;}function f(F,Y){var X=Y[0],N=Y[1],$=Y[2],S=Y[3],C=Math.sqrt(X*X+N*N+$*$),D=C>0?Math.atan2(C,S)/C:0;return F[0]=X*D,F[1]=N*D,F[2]=$*D,F[3]=0.5*Math.log(X*X+N*N+$*$+S*S),F;}function g(F,Y,X){return f(F,Y),K(F,F,X),x(F,F),F;}function u(F,Y,X,N){var $=Y[0],S=Y[1],C=Y[2],D=Y[3],j=X[0],H=X[1],V=X[2],Q=X[3],it,st,ct,gt,at;return st=$*j+S*H+C*V+D*Q,st<0&&(st=-st,j=-j,H=-H,V=-V,Q=-Q),1-st>e.EPSILON?(it=Math.acos(st),ct=Math.sin(it),gt=Math.sin((1-N)*it)/ct,at=Math.sin(N*it)/ct):(gt=1-N,at=N),F[0]=gt*$+at*j,F[1]=gt*S+at*H,F[2]=gt*C+at*V,F[3]=gt*D+at*Q,F;}function m(F){var Y=e.RANDOM(),X=e.RANDOM(),N=e.RANDOM(),$=Math.sqrt(1-Y),S=Math.sqrt(Y);return F[0]=$*Math.sin(2*Math.PI*X),F[1]=$*Math.cos(2*Math.PI*X),F[2]=S*Math.sin(2*Math.PI*N),F[3]=S*Math.cos(2*Math.PI*N),F;}function M(F,Y){var X=Y[0],N=Y[1],$=Y[2],S=Y[3],C=X*X+N*N+$*$+S*S,D=C?1/C:0;return F[0]=-X*D,F[1]=-N*D,F[2]=-$*D,F[3]=S*D,F;}function E(F,Y){return F[0]=-Y[0],F[1]=-Y[1],F[2]=-Y[2],F[3]=Y[3],F;}function R(F,Y){var X=Y[0]+Y[4]+Y[8],N;if(X>0)N=Math.sqrt(X+1),F[3]=0.5*N,N=0.5/N,F[0]=(Y[5]-Y[7])*N,F[1]=(Y[6]-Y[2])*N,F[2]=(Y[1]-Y[3])*N;else{var $=0;Y[4]>Y[0]&&($=1),Y[8]>Y[$*3+$]&&($=2);var S=($+1)%3,C=($+2)%3;N=Math.sqrt(Y[$*3+$]-Y[S*3+S]-Y[C*3+C]+1),F[$]=0.5*N,N=0.5/N,F[3]=(Y[S*3+C]-Y[C*3+S])*N,F[S]=(Y[S*3+$]+Y[$*3+S])*N,F[C]=(Y[C*3+$]+Y[$*3+C])*N;}return F;}function b(F,Y,X,N){var $=0.5*Math.PI/180;Y*=$,X*=$,N*=$;var S=Math.sin(Y),C=Math.cos(Y),D=Math.sin(X),j=Math.cos(X),H=Math.sin(N),V=Math.cos(N);return F[0]=S*j*V-C*D*H,F[1]=C*D*V+S*j*H,F[2]=C*j*H-S*D*V,F[3]=C*j*V+S*D*H,F;}function O(F){return"quat("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}var L=a.clone,w=a.fromValues,I=a.copy,A=a.set,W=a.add,z=p,K=a.scale,k=a.dot,q=a.lerp,U=a.length,G=U,Z=a.squaredLength,nt=Z,et=a.normalize,tt=a.exactEquals,J=a.equals,ht=function(){var F=i.create(),Y=i.fromValues(1,0,0),X=i.fromValues(0,1,0);return function(N,$,S){var C=i.dot($,S);return C<-0.999999?(i.cross(F,Y,$),i.len(F)<1e-6&&i.cross(F,X,$),i.normalize(F,F),l(N,F,Math.PI),N):C>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(F,$,S),N[0]=F[0],N[1]=F[1],N[2]=F[2],N[3]=1+C,et(N,N));};}(),dt=function(){var F=o(),Y=o();return function(X,N,$,S,C,D){return u(F,N,C,D),u(Y,$,S,D),u(X,F,Y,2*D*(1-D)),X;};}(),B=function(){var F=n.create();return function(Y,X,N,$){return F[0]=N[0],F[3]=N[1],F[6]=N[2],F[1]=$[0],F[4]=$[1],F[7]=$[2],F[2]=-X[0],F[5]=-X[1],F[8]=-X[2],et(Y,R(Y,F));};}();},/* 8 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"length",function(){return a;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return l;}),t.d(r,"add",function(){return d;}),t.d(r,"subtract",function(){return c;}),t.d(r,"multiply",function(){return p;}),t.d(r,"divide",function(){return y;}),t.d(r,"ceil",function(){return P;}),t.d(r,"floor",function(){return T;}),t.d(r,"min",function(){return v;}),t.d(r,"max",function(){return x;}),t.d(r,"round",function(){return f;}),t.d(r,"scale",function(){return g;}),t.d(r,"scaleAndAdd",function(){return u;}),t.d(r,"distance",function(){return m;}),t.d(r,"squaredDistance",function(){return M;}),t.d(r,"squaredLength",function(){return E;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return w;}),t.d(r,"lerp",function(){return I;}),t.d(r,"hermite",function(){return A;}),t.d(r,"bezier",function(){return W;}),t.d(r,"random",function(){return z;}),t.d(r,"transformMat4",function(){return K;}),t.d(r,"transformMat3",function(){return k;}),t.d(r,"transformQuat",function(){return q;}),t.d(r,"rotateX",function(){return U;}),t.d(r,"rotateY",function(){return G;}),t.d(r,"rotateZ",function(){return Z;}),t.d(r,"angle",function(){return nt;}),t.d(r,"zero",function(){return et;}),t.d(r,"str",function(){return tt;}),t.d(r,"exactEquals",function(){return J;}),t.d(r,"equals",function(){return ht;}),t.d(r,"sub",function(){return dt;}),t.d(r,"mul",function(){return B;}),t.d(r,"div",function(){return F;}),t.d(r,"dist",function(){return Y;}),t.d(r,"sqrDist",function(){return X;}),t.d(r,"len",function(){return N;}),t.d(r,"sqrLen",function(){return $;}),t.d(r,"forEach",function(){return S;});var e=t(2);function n(){var C=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(C[0]=0,C[1]=0,C[2]=0),C;}function i(C){var D=new e.ARRAY_TYPE(3);return D[0]=C[0],D[1]=C[1],D[2]=C[2],D;}function a(C){var D=C[0],j=C[1],H=C[2];return Math.hypot(D,j,H);}function o(C,D,j){var H=new e.ARRAY_TYPE(3);return H[0]=C,H[1]=D,H[2]=j,H;}function s(C,D){return C[0]=D[0],C[1]=D[1],C[2]=D[2],C;}function l(C,D,j,H){return C[0]=D,C[1]=j,C[2]=H,C;}function d(C,D,j){return C[0]=D[0]+j[0],C[1]=D[1]+j[1],C[2]=D[2]+j[2],C;}function c(C,D,j){return C[0]=D[0]-j[0],C[1]=D[1]-j[1],C[2]=D[2]-j[2],C;}function p(C,D,j){return C[0]=D[0]*j[0],C[1]=D[1]*j[1],C[2]=D[2]*j[2],C;}function y(C,D,j){return C[0]=D[0]/j[0],C[1]=D[1]/j[1],C[2]=D[2]/j[2],C;}function P(C,D){return C[0]=Math.ceil(D[0]),C[1]=Math.ceil(D[1]),C[2]=Math.ceil(D[2]),C;}function T(C,D){return C[0]=Math.floor(D[0]),C[1]=Math.floor(D[1]),C[2]=Math.floor(D[2]),C;}function v(C,D,j){return C[0]=Math.min(D[0],j[0]),C[1]=Math.min(D[1],j[1]),C[2]=Math.min(D[2],j[2]),C;}function x(C,D,j){return C[0]=Math.max(D[0],j[0]),C[1]=Math.max(D[1],j[1]),C[2]=Math.max(D[2],j[2]),C;}function f(C,D){return C[0]=Math.round(D[0]),C[1]=Math.round(D[1]),C[2]=Math.round(D[2]),C;}function g(C,D,j){return C[0]=D[0]*j,C[1]=D[1]*j,C[2]=D[2]*j,C;}function u(C,D,j,H){return C[0]=D[0]+j[0]*H,C[1]=D[1]+j[1]*H,C[2]=D[2]+j[2]*H,C;}function m(C,D){var j=D[0]-C[0],H=D[1]-C[1],V=D[2]-C[2];return Math.hypot(j,H,V);}function M(C,D){var j=D[0]-C[0],H=D[1]-C[1],V=D[2]-C[2];return j*j+H*H+V*V;}function E(C){var D=C[0],j=C[1],H=C[2];return D*D+j*j+H*H;}function R(C,D){return C[0]=-D[0],C[1]=-D[1],C[2]=-D[2],C;}function b(C,D){return C[0]=1/D[0],C[1]=1/D[1],C[2]=1/D[2],C;}function O(C,D){var j=D[0],H=D[1],V=D[2],Q=j*j+H*H+V*V;return Q>0&&(Q=1/Math.sqrt(Q)),C[0]=D[0]*Q,C[1]=D[1]*Q,C[2]=D[2]*Q,C;}function L(C,D){return C[0]*D[0]+C[1]*D[1]+C[2]*D[2];}function w(C,D,j){var H=D[0],V=D[1],Q=D[2],it=j[0],st=j[1],ct=j[2];return C[0]=V*ct-Q*st,C[1]=Q*it-H*ct,C[2]=H*st-V*it,C;}function I(C,D,j,H){var V=D[0],Q=D[1],it=D[2];return C[0]=V+H*(j[0]-V),C[1]=Q+H*(j[1]-Q),C[2]=it+H*(j[2]-it),C;}function A(C,D,j,H,V,Q){var it=Q*Q,st=it*(2*Q-3)+1,ct=it*(Q-2)+Q,gt=it*(Q-1),at=it*(3-2*Q);return C[0]=D[0]*st+j[0]*ct+H[0]*gt+V[0]*at,C[1]=D[1]*st+j[1]*ct+H[1]*gt+V[1]*at,C[2]=D[2]*st+j[2]*ct+H[2]*gt+V[2]*at,C;}function W(C,D,j,H,V,Q){var it=1-Q,st=it*it,ct=Q*Q,gt=st*it,at=3*Q*st,ot=3*ct*it,ft=ct*Q;return C[0]=D[0]*gt+j[0]*at+H[0]*ot+V[0]*ft,C[1]=D[1]*gt+j[1]*at+H[1]*ot+V[1]*ft,C[2]=D[2]*gt+j[2]*at+H[2]*ot+V[2]*ft,C;}function z(C,D){D=D||1;var j=e.RANDOM()*2*Math.PI,H=e.RANDOM()*2-1,V=Math.sqrt(1-H*H)*D;return C[0]=Math.cos(j)*V,C[1]=Math.sin(j)*V,C[2]=H*D,C;}function K(C,D,j){var H=D[0],V=D[1],Q=D[2],it=j[3]*H+j[7]*V+j[11]*Q+j[15];return it=it||1,C[0]=(j[0]*H+j[4]*V+j[8]*Q+j[12])/it,C[1]=(j[1]*H+j[5]*V+j[9]*Q+j[13])/it,C[2]=(j[2]*H+j[6]*V+j[10]*Q+j[14])/it,C;}function k(C,D,j){var H=D[0],V=D[1],Q=D[2];return C[0]=H*j[0]+V*j[3]+Q*j[6],C[1]=H*j[1]+V*j[4]+Q*j[7],C[2]=H*j[2]+V*j[5]+Q*j[8],C;}function q(C,D,j){var H=j[0],V=j[1],Q=j[2],it=j[3],st=D[0],ct=D[1],gt=D[2],at=V*gt-Q*ct,ot=Q*st-H*gt,ft=H*ct-V*st,mt=V*ft-Q*ot,yt=Q*at-H*ft,pt=H*ot-V*at,Tt=it*2;return at*=Tt,ot*=Tt,ft*=Tt,mt*=2,yt*=2,pt*=2,C[0]=st+at+mt,C[1]=ct+ot+yt,C[2]=gt+ft+pt,C;}function U(C,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[0],Q[1]=V[1]*Math.cos(H)-V[2]*Math.sin(H),Q[2]=V[1]*Math.sin(H)+V[2]*Math.cos(H),C[0]=Q[0]+j[0],C[1]=Q[1]+j[1],C[2]=Q[2]+j[2],C;}function G(C,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[2]*Math.sin(H)+V[0]*Math.cos(H),Q[1]=V[1],Q[2]=V[2]*Math.cos(H)-V[0]*Math.sin(H),C[0]=Q[0]+j[0],C[1]=Q[1]+j[1],C[2]=Q[2]+j[2],C;}function Z(C,D,j,H){var V=[],Q=[];return V[0]=D[0]-j[0],V[1]=D[1]-j[1],V[2]=D[2]-j[2],Q[0]=V[0]*Math.cos(H)-V[1]*Math.sin(H),Q[1]=V[0]*Math.sin(H)+V[1]*Math.cos(H),Q[2]=V[2],C[0]=Q[0]+j[0],C[1]=Q[1]+j[1],C[2]=Q[2]+j[2],C;}function nt(C,D){var j=C[0],H=C[1],V=C[2],Q=D[0],it=D[1],st=D[2],ct=Math.sqrt(j*j+H*H+V*V),gt=Math.sqrt(Q*Q+it*it+st*st),at=ct*gt,ot=at&&L(C,D)/at;return Math.acos(Math.min(Math.max(ot,-1),1));}function et(C){return C[0]=0,C[1]=0,C[2]=0,C;}function tt(C){return"vec3("+C[0]+", "+C[1]+", "+C[2]+")";}function J(C,D){return C[0]===D[0]&&C[1]===D[1]&&C[2]===D[2];}function ht(C,D){var j=C[0],H=C[1],V=C[2],Q=D[0],it=D[1],st=D[2];return Math.abs(j-Q)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(Q))&&Math.abs(H-it)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(it))&&Math.abs(V-st)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(st));}var dt=c,B=p,F=y,Y=m,X=M,N=a,$=E,S=function(){var C=n();return function(D,j,H,V,Q,it){var st,ct;for(j||(j=3),H||(H=0),V?ct=Math.min(V*j+H,D.length):ct=D.length,st=H;st<ct;st+=j)C[0]=D[st],C[1]=D[st+1],C[2]=D[st+2],Q(C,C,it),D[st]=C[0],D[st+1]=C[1],D[st+2]=C[2];return D;};}();},/* 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 l;}),t.d(r,"subtract",function(){return d;}),t.d(r,"multiply",function(){return c;}),t.d(r,"divide",function(){return p;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return P;}),t.d(r,"min",function(){return T;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return x;}),t.d(r,"scale",function(){return f;}),t.d(r,"scaleAndAdd",function(){return g;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return m;}),t.d(r,"length",function(){return M;}),t.d(r,"squaredLength",function(){return E;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return w;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return A;}),t.d(r,"transformMat4",function(){return W;}),t.d(r,"transformQuat",function(){return z;}),t.d(r,"zero",function(){return K;}),t.d(r,"str",function(){return k;}),t.d(r,"exactEquals",function(){return q;}),t.d(r,"equals",function(){return U;}),t.d(r,"sub",function(){return G;}),t.d(r,"mul",function(){return Z;}),t.d(r,"div",function(){return nt;}),t.d(r,"dist",function(){return et;}),t.d(r,"sqrDist",function(){return tt;}),t.d(r,"len",function(){return J;}),t.d(r,"sqrLen",function(){return ht;}),t.d(r,"forEach",function(){return dt;});var e=t(2);function n(){var B=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(B[0]=0,B[1]=0,B[2]=0,B[3]=0),B;}function i(B){var F=new e.ARRAY_TYPE(4);return F[0]=B[0],F[1]=B[1],F[2]=B[2],F[3]=B[3],F;}function a(B,F,Y,X){var N=new e.ARRAY_TYPE(4);return N[0]=B,N[1]=F,N[2]=Y,N[3]=X,N;}function o(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B;}function s(B,F,Y,X,N){return B[0]=F,B[1]=Y,B[2]=X,B[3]=N,B;}function l(B,F,Y){return B[0]=F[0]+Y[0],B[1]=F[1]+Y[1],B[2]=F[2]+Y[2],B[3]=F[3]+Y[3],B;}function d(B,F,Y){return B[0]=F[0]-Y[0],B[1]=F[1]-Y[1],B[2]=F[2]-Y[2],B[3]=F[3]-Y[3],B;}function c(B,F,Y){return B[0]=F[0]*Y[0],B[1]=F[1]*Y[1],B[2]=F[2]*Y[2],B[3]=F[3]*Y[3],B;}function p(B,F,Y){return B[0]=F[0]/Y[0],B[1]=F[1]/Y[1],B[2]=F[2]/Y[2],B[3]=F[3]/Y[3],B;}function y(B,F){return B[0]=Math.ceil(F[0]),B[1]=Math.ceil(F[1]),B[2]=Math.ceil(F[2]),B[3]=Math.ceil(F[3]),B;}function P(B,F){return B[0]=Math.floor(F[0]),B[1]=Math.floor(F[1]),B[2]=Math.floor(F[2]),B[3]=Math.floor(F[3]),B;}function T(B,F,Y){return B[0]=Math.min(F[0],Y[0]),B[1]=Math.min(F[1],Y[1]),B[2]=Math.min(F[2],Y[2]),B[3]=Math.min(F[3],Y[3]),B;}function v(B,F,Y){return B[0]=Math.max(F[0],Y[0]),B[1]=Math.max(F[1],Y[1]),B[2]=Math.max(F[2],Y[2]),B[3]=Math.max(F[3],Y[3]),B;}function x(B,F){return B[0]=Math.round(F[0]),B[1]=Math.round(F[1]),B[2]=Math.round(F[2]),B[3]=Math.round(F[3]),B;}function f(B,F,Y){return B[0]=F[0]*Y,B[1]=F[1]*Y,B[2]=F[2]*Y,B[3]=F[3]*Y,B;}function g(B,F,Y,X){return B[0]=F[0]+Y[0]*X,B[1]=F[1]+Y[1]*X,B[2]=F[2]+Y[2]*X,B[3]=F[3]+Y[3]*X,B;}function u(B,F){var Y=F[0]-B[0],X=F[1]-B[1],N=F[2]-B[2],$=F[3]-B[3];return Math.hypot(Y,X,N,$);}function m(B,F){var Y=F[0]-B[0],X=F[1]-B[1],N=F[2]-B[2],$=F[3]-B[3];return Y*Y+X*X+N*N+$*$;}function M(B){var F=B[0],Y=B[1],X=B[2],N=B[3];return Math.hypot(F,Y,X,N);}function E(B){var F=B[0],Y=B[1],X=B[2],N=B[3];return F*F+Y*Y+X*X+N*N;}function R(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=-F[3],B;}function b(B,F){return B[0]=1/F[0],B[1]=1/F[1],B[2]=1/F[2],B[3]=1/F[3],B;}function O(B,F){var Y=F[0],X=F[1],N=F[2],$=F[3],S=Y*Y+X*X+N*N+$*$;return S>0&&(S=1/Math.sqrt(S)),B[0]=Y*S,B[1]=X*S,B[2]=N*S,B[3]=$*S,B;}function L(B,F){return B[0]*F[0]+B[1]*F[1]+B[2]*F[2]+B[3]*F[3];}function w(B,F,Y,X){var N=Y[0]*X[1]-Y[1]*X[0],$=Y[0]*X[2]-Y[2]*X[0],S=Y[0]*X[3]-Y[3]*X[0],C=Y[1]*X[2]-Y[2]*X[1],D=Y[1]*X[3]-Y[3]*X[1],j=Y[2]*X[3]-Y[3]*X[2],H=F[0],V=F[1],Q=F[2],it=F[3];return B[0]=V*j-Q*D+it*C,B[1]=-(H*j)+Q*S-it*$,B[2]=H*D-V*S+it*N,B[3]=-(H*C)+V*$-Q*N,B;}function I(B,F,Y,X){var N=F[0],$=F[1],S=F[2],C=F[3];return B[0]=N+X*(Y[0]-N),B[1]=$+X*(Y[1]-$),B[2]=S+X*(Y[2]-S),B[3]=C+X*(Y[3]-C),B;}function A(B,F){F=F||1;var Y,X,N,$,S,C;do Y=e.RANDOM()*2-1,X=e.RANDOM()*2-1,S=Y*Y+X*X;while(S>=1);do N=e.RANDOM()*2-1,$=e.RANDOM()*2-1,C=N*N+$*$;while(C>=1);var D=Math.sqrt((1-S)/C);return B[0]=F*Y,B[1]=F*X,B[2]=F*N*D,B[3]=F*$*D,B;}function W(B,F,Y){var X=F[0],N=F[1],$=F[2],S=F[3];return B[0]=Y[0]*X+Y[4]*N+Y[8]*$+Y[12]*S,B[1]=Y[1]*X+Y[5]*N+Y[9]*$+Y[13]*S,B[2]=Y[2]*X+Y[6]*N+Y[10]*$+Y[14]*S,B[3]=Y[3]*X+Y[7]*N+Y[11]*$+Y[15]*S,B;}function z(B,F,Y){var X=F[0],N=F[1],$=F[2],S=Y[0],C=Y[1],D=Y[2],j=Y[3],H=j*X+C*$-D*N,V=j*N+D*X-S*$,Q=j*$+S*N-C*X,it=-S*X-C*N-D*$;return B[0]=H*j+it*-S+V*-D-Q*-C,B[1]=V*j+it*-C+Q*-S-H*-D,B[2]=Q*j+it*-D+H*-C-V*-S,B[3]=F[3],B;}function K(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=0,B;}function k(B){return"vec4("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+")";}function q(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3];}function U(B,F){var Y=B[0],X=B[1],N=B[2],$=B[3],S=F[0],C=F[1],D=F[2],j=F[3];return Math.abs(Y-S)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(S))&&Math.abs(X-C)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(C))&&Math.abs(N-D)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(D))&&Math.abs($-j)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(j));}var G=d,Z=c,nt=p,et=u,tt=m,J=M,ht=E,dt=function(){var B=n();return function(F,Y,X,N,$,S){var C,D;for(Y||(Y=4),X||(X=0),N?D=Math.min(N*Y+X,F.length):D=F.length,C=X;C<D;C+=Y)B[0]=F[C],B[1]=F[C+1],B[2]=F[C+2],B[3]=F[C+3],$(B,B,S),F[C]=B[0],F[C+1]=B[1],F[C+2]=B[2],F[C+3]=B[3];return F;};}();},/* 10 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return a;}),t.d(r,"clone",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"fromRotationTranslationValues",function(){return l;}),t.d(r,"fromRotationTranslation",function(){return d;}),t.d(r,"fromTranslation",function(){return c;}),t.d(r,"fromRotation",function(){return p;}),t.d(r,"fromMat4",function(){return y;}),t.d(r,"copy",function(){return P;}),t.d(r,"identity",function(){return T;}),t.d(r,"set",function(){return v;}),t.d(r,"getReal",function(){return x;}),t.d(r,"getDual",function(){return f;}),t.d(r,"setReal",function(){return g;}),t.d(r,"setDual",function(){return u;}),t.d(r,"getTranslation",function(){return m;}),t.d(r,"translate",function(){return M;}),t.d(r,"rotateX",function(){return E;}),t.d(r,"rotateY",function(){return R;}),t.d(r,"rotateZ",function(){return b;}),t.d(r,"rotateByQuatAppend",function(){return O;}),t.d(r,"rotateByQuatPrepend",function(){return L;}),t.d(r,"rotateAroundAxis",function(){return w;}),t.d(r,"add",function(){return I;}),t.d(r,"multiply",function(){return A;}),t.d(r,"mul",function(){return W;}),t.d(r,"scale",function(){return z;}),t.d(r,"dot",function(){return K;}),t.d(r,"lerp",function(){return k;}),t.d(r,"invert",function(){return q;}),t.d(r,"conjugate",function(){return U;}),t.d(r,"length",function(){return G;}),t.d(r,"len",function(){return Z;}),t.d(r,"squaredLength",function(){return nt;}),t.d(r,"sqrLen",function(){return et;}),t.d(r,"normalize",function(){return tt;}),t.d(r,"str",function(){return J;}),t.d(r,"exactEquals",function(){return ht;}),t.d(r,"equals",function(){return dt;});var e=t(2),n=t(7),i=t(6);function a(){var B=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(B[0]=0,B[1]=0,B[2]=0,B[4]=0,B[5]=0,B[6]=0,B[7]=0),B[3]=1,B;}function o(B){var F=new e.ARRAY_TYPE(8);return F[0]=B[0],F[1]=B[1],F[2]=B[2],F[3]=B[3],F[4]=B[4],F[5]=B[5],F[6]=B[6],F[7]=B[7],F;}function s(B,F,Y,X,N,$,S,C){var D=new e.ARRAY_TYPE(8);return D[0]=B,D[1]=F,D[2]=Y,D[3]=X,D[4]=N,D[5]=$,D[6]=S,D[7]=C,D;}function l(B,F,Y,X,N,$,S){var C=new e.ARRAY_TYPE(8);C[0]=B,C[1]=F,C[2]=Y,C[3]=X;var D=N*0.5,j=$*0.5,H=S*0.5;return C[4]=D*X+j*Y-H*F,C[5]=j*X+H*B-D*Y,C[6]=H*X+D*F-j*B,C[7]=-D*B-j*F-H*Y,C;}function d(B,F,Y){var X=Y[0]*0.5,N=Y[1]*0.5,$=Y[2]*0.5,S=F[0],C=F[1],D=F[2],j=F[3];return B[0]=S,B[1]=C,B[2]=D,B[3]=j,B[4]=X*j+N*D-$*C,B[5]=N*j+$*S-X*D,B[6]=$*j+X*C-N*S,B[7]=-X*S-N*C-$*D,B;}function c(B,F){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=F[0]*0.5,B[5]=F[1]*0.5,B[6]=F[2]*0.5,B[7]=0,B;}function p(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B[4]=0,B[5]=0,B[6]=0,B[7]=0,B;}function y(B,F){var Y=n.create();i.getRotation(Y,F);var X=new e.ARRAY_TYPE(3);return i.getTranslation(X,F),d(B,Y,X),B;}function P(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B[4]=F[4],B[5]=F[5],B[6]=F[6],B[7]=F[7],B;}function T(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B[6]=0,B[7]=0,B;}function v(B,F,Y,X,N,$,S,C,D){return B[0]=F,B[1]=Y,B[2]=X,B[3]=N,B[4]=$,B[5]=S,B[6]=C,B[7]=D,B;}var x=n.copy;function f(B,F){return B[0]=F[4],B[1]=F[5],B[2]=F[6],B[3]=F[7],B;}var g=n.copy;function u(B,F){return B[4]=F[0],B[5]=F[1],B[6]=F[2],B[7]=F[3],B;}function m(B,F){var Y=F[4],X=F[5],N=F[6],$=F[7],S=-F[0],C=-F[1],D=-F[2],j=F[3];return B[0]=(Y*j+$*S+X*D-N*C)*2,B[1]=(X*j+$*C+N*S-Y*D)*2,B[2]=(N*j+$*D+Y*C-X*S)*2,B;}function M(B,F,Y){var X=F[0],N=F[1],$=F[2],S=F[3],C=Y[0]*0.5,D=Y[1]*0.5,j=Y[2]*0.5,H=F[4],V=F[5],Q=F[6],it=F[7];return B[0]=X,B[1]=N,B[2]=$,B[3]=S,B[4]=S*C+N*j-$*D+H,B[5]=S*D+$*C-X*j+V,B[6]=S*j+X*D-N*C+Q,B[7]=-X*C-N*D-$*j+it,B;}function E(B,F,Y){var X=-F[0],N=-F[1],$=-F[2],S=F[3],C=F[4],D=F[5],j=F[6],H=F[7],V=C*S+H*X+D*$-j*N,Q=D*S+H*N+j*X-C*$,it=j*S+H*$+C*N-D*X,st=H*S-C*X-D*N-j*$;return n.rotateX(B,F,Y),X=B[0],N=B[1],$=B[2],S=B[3],B[4]=V*S+st*X+Q*$-it*N,B[5]=Q*S+st*N+it*X-V*$,B[6]=it*S+st*$+V*N-Q*X,B[7]=st*S-V*X-Q*N-it*$,B;}function R(B,F,Y){var X=-F[0],N=-F[1],$=-F[2],S=F[3],C=F[4],D=F[5],j=F[6],H=F[7],V=C*S+H*X+D*$-j*N,Q=D*S+H*N+j*X-C*$,it=j*S+H*$+C*N-D*X,st=H*S-C*X-D*N-j*$;return n.rotateY(B,F,Y),X=B[0],N=B[1],$=B[2],S=B[3],B[4]=V*S+st*X+Q*$-it*N,B[5]=Q*S+st*N+it*X-V*$,B[6]=it*S+st*$+V*N-Q*X,B[7]=st*S-V*X-Q*N-it*$,B;}function b(B,F,Y){var X=-F[0],N=-F[1],$=-F[2],S=F[3],C=F[4],D=F[5],j=F[6],H=F[7],V=C*S+H*X+D*$-j*N,Q=D*S+H*N+j*X-C*$,it=j*S+H*$+C*N-D*X,st=H*S-C*X-D*N-j*$;return n.rotateZ(B,F,Y),X=B[0],N=B[1],$=B[2],S=B[3],B[4]=V*S+st*X+Q*$-it*N,B[5]=Q*S+st*N+it*X-V*$,B[6]=it*S+st*$+V*N-Q*X,B[7]=st*S-V*X-Q*N-it*$,B;}function O(B,F,Y){var X=Y[0],N=Y[1],$=Y[2],S=Y[3],C=F[0],D=F[1],j=F[2],H=F[3];return B[0]=C*S+H*X+D*$-j*N,B[1]=D*S+H*N+j*X-C*$,B[2]=j*S+H*$+C*N-D*X,B[3]=H*S-C*X-D*N-j*$,C=F[4],D=F[5],j=F[6],H=F[7],B[4]=C*S+H*X+D*$-j*N,B[5]=D*S+H*N+j*X-C*$,B[6]=j*S+H*$+C*N-D*X,B[7]=H*S-C*X-D*N-j*$,B;}function L(B,F,Y){var X=F[0],N=F[1],$=F[2],S=F[3],C=Y[0],D=Y[1],j=Y[2],H=Y[3];return B[0]=X*H+S*C+N*j-$*D,B[1]=N*H+S*D+$*C-X*j,B[2]=$*H+S*j+X*D-N*C,B[3]=S*H-X*C-N*D-$*j,C=Y[4],D=Y[5],j=Y[6],H=Y[7],B[4]=X*H+S*C+N*j-$*D,B[5]=N*H+S*D+$*C-X*j,B[6]=$*H+S*j+X*D-N*C,B[7]=S*H-X*C-N*D-$*j,B;}function w(B,F,Y,X){if(Math.abs(X)<e.EPSILON)return P(B,F);var N=Math.hypot(Y[0],Y[1],Y[2]);X=X*0.5;var $=Math.sin(X),S=$*Y[0]/N,C=$*Y[1]/N,D=$*Y[2]/N,j=Math.cos(X),H=F[0],V=F[1],Q=F[2],it=F[3];B[0]=H*j+it*S+V*D-Q*C,B[1]=V*j+it*C+Q*S-H*D,B[2]=Q*j+it*D+H*C-V*S,B[3]=it*j-H*S-V*C-Q*D;var st=F[4],ct=F[5],gt=F[6],at=F[7];return B[4]=st*j+at*S+ct*D-gt*C,B[5]=ct*j+at*C+gt*S-st*D,B[6]=gt*j+at*D+st*C-ct*S,B[7]=at*j-st*S-ct*C-gt*D,B;}function I(B,F,Y){return B[0]=F[0]+Y[0],B[1]=F[1]+Y[1],B[2]=F[2]+Y[2],B[3]=F[3]+Y[3],B[4]=F[4]+Y[4],B[5]=F[5]+Y[5],B[6]=F[6]+Y[6],B[7]=F[7]+Y[7],B;}function A(B,F,Y){var X=F[0],N=F[1],$=F[2],S=F[3],C=Y[4],D=Y[5],j=Y[6],H=Y[7],V=F[4],Q=F[5],it=F[6],st=F[7],ct=Y[0],gt=Y[1],at=Y[2],ot=Y[3];return B[0]=X*ot+S*ct+N*at-$*gt,B[1]=N*ot+S*gt+$*ct-X*at,B[2]=$*ot+S*at+X*gt-N*ct,B[3]=S*ot-X*ct-N*gt-$*at,B[4]=X*H+S*C+N*j-$*D+V*ot+st*ct+Q*at-it*gt,B[5]=N*H+S*D+$*C-X*j+Q*ot+st*gt+it*ct-V*at,B[6]=$*H+S*j+X*D-N*C+it*ot+st*at+V*gt-Q*ct,B[7]=S*H-X*C-N*D-$*j+st*ot-V*ct-Q*gt-it*at,B;}var W=A;function z(B,F,Y){return B[0]=F[0]*Y,B[1]=F[1]*Y,B[2]=F[2]*Y,B[3]=F[3]*Y,B[4]=F[4]*Y,B[5]=F[5]*Y,B[6]=F[6]*Y,B[7]=F[7]*Y,B;}var K=n.dot;function k(B,F,Y,X){var N=1-X;return K(F,Y)<0&&(X=-X),B[0]=F[0]*N+Y[0]*X,B[1]=F[1]*N+Y[1]*X,B[2]=F[2]*N+Y[2]*X,B[3]=F[3]*N+Y[3]*X,B[4]=F[4]*N+Y[4]*X,B[5]=F[5]*N+Y[5]*X,B[6]=F[6]*N+Y[6]*X,B[7]=F[7]*N+Y[7]*X,B;}function q(B,F){var Y=nt(F);return B[0]=-F[0]/Y,B[1]=-F[1]/Y,B[2]=-F[2]/Y,B[3]=F[3]/Y,B[4]=-F[4]/Y,B[5]=-F[5]/Y,B[6]=-F[6]/Y,B[7]=F[7]/Y,B;}function U(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=F[3],B[4]=-F[4],B[5]=-F[5],B[6]=-F[6],B[7]=F[7],B;}var G=n.length,Z=G,nt=n.squaredLength,et=nt;function tt(B,F){var Y=nt(F);if(Y>0){Y=Math.sqrt(Y);var X=F[0]/Y,N=F[1]/Y,$=F[2]/Y,S=F[3]/Y,C=F[4],D=F[5],j=F[6],H=F[7],V=X*C+N*D+$*j+S*H;B[0]=X,B[1]=N,B[2]=$,B[3]=S,B[4]=(C-X*V)/Y,B[5]=(D-N*V)/Y,B[6]=(j-$*V)/Y,B[7]=(H-S*V)/Y;}return B;}function J(B){return"quat2("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+")";}function ht(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3]&&B[4]===F[4]&&B[5]===F[5]&&B[6]===F[6]&&B[7]===F[7];}function dt(B,F){var Y=B[0],X=B[1],N=B[2],$=B[3],S=B[4],C=B[5],D=B[6],j=B[7],H=F[0],V=F[1],Q=F[2],it=F[3],st=F[4],ct=F[5],gt=F[6],at=F[7];return Math.abs(Y-H)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(H))&&Math.abs(X-V)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(V))&&Math.abs(N-Q)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(Q))&&Math.abs($-it)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(it))&&Math.abs(S-st)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(st))&&Math.abs(C-ct)<=e.EPSILON*Math.max(1,Math.abs(C),Math.abs(ct))&&Math.abs(D-gt)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(gt))&&Math.abs(j-at)<=e.EPSILON*Math.max(1,Math.abs(j),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 l;}),t.d(r,"subtract",function(){return d;}),t.d(r,"multiply",function(){return c;}),t.d(r,"divide",function(){return p;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return P;}),t.d(r,"min",function(){return T;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return x;}),t.d(r,"scale",function(){return f;}),t.d(r,"scaleAndAdd",function(){return g;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return m;}),t.d(r,"length",function(){return M;}),t.d(r,"squaredLength",function(){return E;}),t.d(r,"negate",function(){return R;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return w;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return A;}),t.d(r,"transformMat2",function(){return W;}),t.d(r,"transformMat2d",function(){return z;}),t.d(r,"transformMat3",function(){return K;}),t.d(r,"transformMat4",function(){return k;}),t.d(r,"rotate",function(){return q;}),t.d(r,"angle",function(){return U;}),t.d(r,"zero",function(){return G;}),t.d(r,"str",function(){return Z;}),t.d(r,"exactEquals",function(){return nt;}),t.d(r,"equals",function(){return et;}),t.d(r,"len",function(){return tt;}),t.d(r,"sub",function(){return J;}),t.d(r,"mul",function(){return ht;}),t.d(r,"div",function(){return dt;}),t.d(r,"dist",function(){return B;}),t.d(r,"sqrDist",function(){return F;}),t.d(r,"sqrLen",function(){return Y;}),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 $=new e.ARRAY_TYPE(2);return $[0]=N[0],$[1]=N[1],$;}function a(N,$){var S=new e.ARRAY_TYPE(2);return S[0]=N,S[1]=$,S;}function o(N,$){return N[0]=$[0],N[1]=$[1],N;}function s(N,$,S){return N[0]=$,N[1]=S,N;}function l(N,$,S){return N[0]=$[0]+S[0],N[1]=$[1]+S[1],N;}function d(N,$,S){return N[0]=$[0]-S[0],N[1]=$[1]-S[1],N;}function c(N,$,S){return N[0]=$[0]*S[0],N[1]=$[1]*S[1],N;}function p(N,$,S){return N[0]=$[0]/S[0],N[1]=$[1]/S[1],N;}function y(N,$){return N[0]=Math.ceil($[0]),N[1]=Math.ceil($[1]),N;}function P(N,$){return N[0]=Math.floor($[0]),N[1]=Math.floor($[1]),N;}function T(N,$,S){return N[0]=Math.min($[0],S[0]),N[1]=Math.min($[1],S[1]),N;}function v(N,$,S){return N[0]=Math.max($[0],S[0]),N[1]=Math.max($[1],S[1]),N;}function x(N,$){return N[0]=Math.round($[0]),N[1]=Math.round($[1]),N;}function f(N,$,S){return N[0]=$[0]*S,N[1]=$[1]*S,N;}function g(N,$,S,C){return N[0]=$[0]+S[0]*C,N[1]=$[1]+S[1]*C,N;}function u(N,$){var S=$[0]-N[0],C=$[1]-N[1];return Math.hypot(S,C);}function m(N,$){var S=$[0]-N[0],C=$[1]-N[1];return S*S+C*C;}function M(N){var $=N[0],S=N[1];return Math.hypot($,S);}function E(N){var $=N[0],S=N[1];return $*$+S*S;}function R(N,$){return N[0]=-$[0],N[1]=-$[1],N;}function b(N,$){return N[0]=1/$[0],N[1]=1/$[1],N;}function O(N,$){var S=$[0],C=$[1],D=S*S+C*C;return D>0&&(D=1/Math.sqrt(D)),N[0]=$[0]*D,N[1]=$[1]*D,N;}function L(N,$){return N[0]*$[0]+N[1]*$[1];}function w(N,$,S){var C=$[0]*S[1]-$[1]*S[0];return N[0]=N[1]=0,N[2]=C,N;}function I(N,$,S,C){var D=$[0],j=$[1];return N[0]=D+C*(S[0]-D),N[1]=j+C*(S[1]-j),N;}function A(N,$){$=$||1;var S=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(S)*$,N[1]=Math.sin(S)*$,N;}function W(N,$,S){var C=$[0],D=$[1];return N[0]=S[0]*C+S[2]*D,N[1]=S[1]*C+S[3]*D,N;}function z(N,$,S){var C=$[0],D=$[1];return N[0]=S[0]*C+S[2]*D+S[4],N[1]=S[1]*C+S[3]*D+S[5],N;}function K(N,$,S){var C=$[0],D=$[1];return N[0]=S[0]*C+S[3]*D+S[6],N[1]=S[1]*C+S[4]*D+S[7],N;}function k(N,$,S){var C=$[0],D=$[1];return N[0]=S[0]*C+S[4]*D+S[12],N[1]=S[1]*C+S[5]*D+S[13],N;}function q(N,$,S,C){var D=$[0]-S[0],j=$[1]-S[1],H=Math.sin(C),V=Math.cos(C);return N[0]=D*V-j*H+S[0],N[1]=D*H+j*V+S[1],N;}function U(N,$){var S=N[0],C=N[1],D=$[0],j=$[1],H=Math.sqrt(S*S+C*C)*Math.sqrt(D*D+j*j),V=H&&(S*D+C*j)/H;return Math.acos(Math.min(Math.max(V,-1),1));}function G(N){return N[0]=0,N[1]=0,N;}function Z(N){return"vec2("+N[0]+", "+N[1]+")";}function nt(N,$){return N[0]===$[0]&&N[1]===$[1];}function et(N,$){var S=N[0],C=N[1],D=$[0],j=$[1];return Math.abs(S-D)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(D))&&Math.abs(C-j)<=e.EPSILON*Math.max(1,Math.abs(C),Math.abs(j));}var tt=M,J=d,ht=c,dt=p,B=u,F=m,Y=E,X=function(){var N=n();return function($,S,C,D,j,H){var V,Q;for(S||(S=2),C||(C=0),D?Q=Math.min(D*S+C,$.length):Q=$.length,V=C;V<Q;V+=S)N[0]=$[V],N[1]=$[V+1],j(N,N,H),$[V]=N[0],$[V+1]=N[1];return $;};}();},/* 12 */ /***/function(h,r,t){t.r(r);var e=t(13);t.d(r,"Renderer",function(){return e["default"];});var n=t(40);t.d(r,"Figure2D",function(){return n["default"];});var i=t(56);t.d(r,"Mesh2D",function(){return i["default"];});var a=t(29);t.d(r,"MeshCloud",function(){return a["default"];});var o=t(23);t.d(r,"parseFont",function(){return o["default"];});var s=t(31);t.d(r,"parseColor",function(){return s["default"];});var l=t(21);t.d(r,"ENV",function(){return l["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),l=t(56),d=t(29),c=t(59),p=t(21),y=t(63);t(1).glMatrix.setMatrixArrayType(Array);var P={autoUpdate:!1,// premultipliedAlpha: true,
|
|
32
|
+
preserveDrawingBuffer:!1,// depth: false,
|
|
33
|
+
// antialias: false,
|
|
34
|
+
bufferSize:1500},T="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\nvoid main() {\n gl_PointSize = 1.0;\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0); \n vTextureCoord = a_vertexTextureCoord; \n}\n",v="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",x=Symbol("glRenderer"),f=Symbol("canvasRenderer"),g=Symbol("options"),u=Symbol("globalTransform"),m=Symbol("applyGlobalTransform"),M=Symbol("canvas");function E(O){var L=O.gl,w=O.fbo;w&&L.bindFramebuffer(L.FRAMEBUFFER,w),O._draw(),w&&L.bindFramebuffer(L.FRAMEBUFFER,null);}function R(O,L,w,I){var A=O.createTexture(L.canvas),W=[[[0,0],[w,0],[w,I],[0,I],[0,0]]];W.closed=!0;var z=new l["default"]({contours:W});z.setTexture(A),O.setMeshData([z.meshData]),E(O),A["delete"](),L.clearRect(0,0,w,I),delete L._filter;}var b=/*#__PURE__*/function(){function b(L){var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,b);var I=w.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!L.getContext){var A=L;L={getContext:function getContext(){return A;},width:w.width,height:w.height},A.canvas=L,I="2d";}if(this[M]=L,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(w.contextType=I,this[g]=Object.assign({},P,w),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[g].webgl2=!0);var _A=new e["default"](L,this[g]);I==="webgl2"&&!_A.isWebGL2&&(w.contextType="webgl"),Object(y.createShaders)(_A),Object(y.applyShader)(_A),Object(y.createCloudShaders)(_A);var W=_A.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[x]=_A;}else this[f]=new i["default"](L,this[g]);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[f];}},{key:"glRenderer",get:function get(){return this[x];}},{key:"isWebGL2",get:function get(){return this[x]&&this[x].isWebGL2;}},{key:"options",get:function get(){return this[g];}},{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:m,value:function value(){var L=this[x]||this[f];if(this[x]){var _this$canvas=this.canvas,w=_this$canvas.width,I=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[w,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,w=_this$canvas2.height,I=[// translation
|
|
35
|
+
1,0,0,0,1,0,-L/2,-w/2,1],A=[// scale
|
|
36
|
+
2/L,0,0,0,-2/w,0,0,0,1],W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),A,I);this.projectionMatrix=W,this[x]&&this[x].gl.viewport(0,0,L,w);}},{key:"createTexture",value:function createTexture(L,w){return(this[x]||this[f]).createTexture(L,w);}/* async */},{key:"loadTexture",value:function loadTexture(L){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$useImageBitmap=_ref3.useImageBitmap,w=_ref3$useImageBitmap===void 0?!1:_ref3$useImageBitmap;return(this[x]||this[f]).loadTexture(L,{useImageBitmap:w});}},{key:"createText",value:function createText(L){var _ref4=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref4$font=_ref4.font,w=_ref4$font===void 0?"16px arial":_ref4$font,_ref4$fillColor=_ref4.fillColor,I=_ref4$fillColor===void 0?null:_ref4$fillColor,_ref4$strokeColor=_ref4.strokeColor,A=_ref4$strokeColor===void 0?null:_ref4$strokeColor,_ref4$strokeWidth=_ref4.strokeWidth,W=_ref4$strokeWidth===void 0?1:_ref4$strokeWidth;if(this[x]){var z=p["default"].createText(L,{font:w,fillColor:I,strokeColor:A,strokeWidth:W});return{image:this.createTexture(z.image),rect:z.rect};}return{_img:{font:w,fillColor:I,strokeColor:A,strokeWidth:W,text:L}};}},{key:"createProgram",value:function createProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref5.vertex,w=_ref5.fragment,I=_ref5.options;if(this[x]){var A=this[x].compileSync(w,L);return A._attribOpts=I,A;}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?T:_ref6$vertex,_ref6$fragment=_ref6.fragment,w=_ref6$fragment===void 0?v:_ref6$fragment,I=_ref6.options;return this.createProgram({vertex:L,fragment:w,options:I});}},{key:"useProgram",value:function useProgram(L){var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[x]){var I=Object.assign({},L._attribOpts,w);return this[x].useProgram(L,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[x]||this[f]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$f;if(this[x]){var w=this[x].gl;w.clear(w.COLOR_BUFFER_BIT);}else(_this$f=this[f]).clear.apply(_this$f,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(L){var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,w=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,I=_ref7$program===void 0?null:_ref7$program;var A=this[x]||this[f],W=I||L.program;if(this[x]){var z=A.gl;if(w&&z.clear(z.COLOR_BUFFER_BIT),W)A.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,k=!!K.uniforms.u_texSampler,q=!!K.uniforms.u_filterFlag,U=!!K.uniforms.u_radialGradientVector,G=L.hasCloudColor,Z=L.hasCloudFilter,nt=!!K.uniforms.u_clipSampler;Object(y.applyCloudShader)(A,{hasTexture:k,hasFilter:q,hasGradient:U,hasCloudColor:G,hasCloudFilter:Z,hasClipPath:nt});}this[m](),A.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(z,L),E(A),L.afterRender&&L.afterRender(z,L);}else A.setTransform(this.globalTransformMatrix),A.drawMeshCloud(L,{clear:w,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(L){var _this14=this;var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref8$clear=_ref8.clear,w=_ref8$clear===void 0?!1:_ref8$clear,_ref8$program=_ref8.program,I=_ref8$program===void 0?null:_ref8$program;var A=this[x]||this[f];if(this[x]){var W=A.fbo,z=Object(a["default"])(this,L,I==null),K=A.gl;w&&K.clear(K.COLOR_BUFFER_BIT);var k=!Object(c.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator12=_createForOfIteratorHelper(z),_step12;try{var _loop=function _loop(){var q=_step12.value;_this14._drawCalls++;var U=I||q.program;if(q instanceof d["default"])_this14.drawMeshCloud(q,{clear:w,program:U});else{var _this14$canvas=_this14.canvas,G=_this14$canvas.width,Z=_this14$canvas.height;if(q.beforeRender&&q.beforeRender(K,q),q.pass.length&&((!_this14.fbo||_this14.fbo.width!==G||_this14.fbo.height!==Z)&&(_this14.fbo={width:G,height:Z,target:A.createFBO(),buffer:A.createFBO(),swap:function swap(){var _ref9=[this.buffer,this.target];this.target=_ref9[0];this.buffer=_ref9[1];}}),A.bindFBO(_this14.fbo.target)),!U&&q.filterCanvas){Object(y.applyShader)(A,{hasTexture:!0});var nt=_this14.filterContext;nt||(nt=p["default"].createCanvas(G,Z).getContext("2d"),_this14.filterContext=nt);var et=L[q.packIndex],tt=et.filter,J=L[q.packIndex+1],ht=L[q.packIndex-1];(!ht||!ht.filterCanvas||ht.filter!==tt)&&(!J||!J.filterCanvas||J.filter!==tt)?(k?(nt.save(),Object(o.drawMesh2D)(et,nt,!1),nt.restore(),Object(o.applyFilter)(nt,tt)):Object(o.drawMesh2D)(et,nt,!0),_this14[m](),R(A,nt,G,Z)):(k&&nt.save(),Object(o.drawMesh2D)(et,nt,!1),k&&nt.restore(),(!J||!J.filterCanvas||et.filter!==J.filter)&&(Object(o.applyFilter)(nt,tt),_this14[m](),R(A,nt,G,Z)));}else{if(U)A.program!==U&&_this14.useProgram(U,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _nt=!!q.uniforms.u_texSampler,_et=!!q.uniforms.u_filterFlag,_tt=!!q.uniforms.u_radialGradientVector,_J=!!q.uniforms.u_clipSampler;Object(y.applyShader)(A,{hasTexture:_nt,hasFilter:_et,hasGradient:_tt,hasClipPath:_J});}q.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[m](),A.setMeshData([q]),E(A);}if(q.pass.length){var _nt2=q.pass.length;q.pass.forEach(function(et,tt){et.blend=q.enableBlend,et.setTexture(A.fbo.texture),tt===_nt2-1?A.bindFBO(W):(_this14.fbo.swap(),A.bindFBO(_this14.fbo.target)),et.program?A.useProgram(et.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),A.useProgram(_this14.defaultPassProgram)),A.setMeshData([et.meshData]),K.clear(K.COLOR_BUFFER_BIT),E(A);});}q.afterRender&&q.afterRender(K,q);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else A.setTransform(this.globalTransformMatrix),A.drawMeshes(L,{clear:w});}},{key:"drawImage",value:function drawImage(L){for(var _len=arguments.length,w=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){w[_key-1]=arguments[_key];}var I=w.length;if(I<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(w.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(w.length+1," arguments provided."));var A=null,W=null;I===2?A=[w[0],w[1],L.width,L.height]:I===4?A=w:I===8&&(W=w.slice(0,4),A=w.slice(4));var z=this.createTexture(L),_this$canvas3=this.canvas,K=_this$canvas3.width,k=_this$canvas3.height,q=new s["default"]();q.rect(A[0],A[1],K,k);var U=new l["default"](q,{width:K,height:k});U.setTexture(z,{rect:A,srcRect:W}),this.drawMeshes([U]),this.deleteTexture(z);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[u]=[arguments.length<=0?undefined:arguments[0],arguments.length<=1?undefined:arguments[1],0,arguments.length<=2?undefined:arguments[2],arguments.length<=3?undefined:arguments[3],0,arguments.length<=4?undefined:arguments[4],arguments.length<=5?undefined:arguments[5],1],this;}},{key:"globalTransform",value:function globalTransform(){var w=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),w,L),this;}},{key:"globalTranslate",value:function globalTranslate(L,w){var I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[L,w]),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),w=_ref11[0],I=_ref11[1];var A=n.mat3.create();return A=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),A,[w,I]),A=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),A,L),A=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),A,[-w,-I]),this.globalTransform.apply(this,_toConsumableArray(A));}},{key:"globalScale",value:function globalScale(L){var w=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],A=_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,A]),W=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),W,[L,w]),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-A]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"globalSkew",value:function globalSkew(L){var w=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],A=_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,A]),W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,n.mat3.fromValues(1,Math.tan(w),Math.tan(L),1,0,0)),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-A]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,w,I){var A=this.globalTransformMatrix;I&&(A=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),A,I));var W=L*A[0]+w*A[2]+A[4],z=L*A[1]+w*A[3]+A[5];return[W,z];}}]);}();},/* 14 */ /***/function(h,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e["default"];},/* 15 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(16),n=t(17),i=t(18),a=t(19);t(1).glMatrix.setMatrixArrayType(Array);function o(P,T,v){return T in P?Object.defineProperty(P,T,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[T]=v,P;}var s={};function l(P){var T=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var v=[],x=P.length;for(var f=0;f<x;f++)f%T<2&&v.push(0.5*(P[f]+1));return v;}function d(P,T){var v=T._buffers;Object.values(v).forEach(function(x){P.deleteBuffer(x);}),T._buffers={};}function c(P,T,v){return P.activeTexture(P.TEXTURE0+v),Array.isArray(T._img)?P.bindTexture(P.TEXTURE_CUBE_MAP,T):P.bindTexture(P.TEXTURE_2D,T),T;}var p={"int":"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i","float":"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};var y=/*#__PURE__*/function(){function y(T){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,y);this.options=Object.assign({},y.defaultOptions,v),this.canvas=T;var x;this.options.webgl2&&(x=T.getContext("webgl2",this.options)),x==null&&(x=Object(e.setupWebGL)(T,this.options),this.aia_ext=x.getExtension("ANGLE_instanced_arrays")),this.gl=x,x.viewport(0,0,T.width,T.height),x.clearColor(0,0,0,0),x.blendFuncSeparate(x.SRC_ALPHA,x.ONE_MINUS_SRC_ALPHA,x.ONE,x.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(y,[{key:"program",get:function get(){var T=this.gl;return T.getParameter(T.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
|
|
37
|
+
// WebGLRenderingContext.uniformMatrix[234]fv()
|
|
38
|
+
},{key:"_declareUniform",value:function _declareUniform(T,v){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var f=this.gl,g=f.getUniformLocation(T,v);var u;var m=this;if(/^sampler/.test(x)){var M=T._samplerMap,E=T._bindTextures;Object.defineProperty(T.uniforms,v,{get:function get(){return u;},set:function set(R){u=R;var b=M[v]!=null?M[v]:E.length;E[b]=R,c(f,R,b),M[v]||(M[v]=b,f.uniform1i(g,b)),m.options.autoUpdate&&m.update();},configurable:!1,enumerable:!0});}else{var _M=x.indexOf("Matrix")===0,_E=!_M&&/v$/.test(x),R=f["uniform".concat(x)].bind(f);Object.defineProperty(T.uniforms,v,{get:function get(){return u;},set:function set(b){u=b,typeof b=="number"&&(b=[b]),_M?R(g,!1,b):_E?R(g,b):R.apply(void 0,[g].concat(_toConsumableArray(b))),m.options.autoUpdate&&m.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this15=this;var T=this.program;T.meshData.forEach(function(v,x){var f=v.positions,g=v.cells,u=v.instanceCount,m=v.cellsCount,M=v.attributes,E=v.uniforms,R=v.textureCoord,b=v.enableBlend,O=_this15.gl;var L=v.mode!=null?v.mode:O.TRIANGLES;typeof L=="string"&&(L=O[L]),b?O.enable(O.BLEND):O.disable(O.BLEND),O.bindBuffer(O.ARRAY_BUFFER,T._buffers.verticesBuffer),O.bufferData(O.ARRAY_BUFFER,f,O.STATIC_DRAW),g&&(O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,T._buffers.cellsBuffer),O.bufferData(O.ELEMENT_ARRAY_BUFFER,g,O.STATIC_DRAW));var w=[];M&&Object.values(M).forEach(function(_ref16){var A=_ref16.name,W=_ref16.data,z=_ref16.divisor;if(O.bindBuffer(O.ARRAY_BUFFER,T._buffers[A]),O.bufferData(O.ARRAY_BUFFER,W,O.STATIC_DRAW),z!=null){var K=O.getAttribLocation(T,A);K>=0&&(O.enableVertexAttribArray(K),w.push(K),O.vertexAttribDivisor?O.vertexAttribDivisor(K,z):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(K,z));}}),E&&Object.entries(E).forEach(function(_ref17){var _ref18=_slicedToArray(_ref17,2),A=_ref18[0],W=_ref18[1];_this15.uniforms[A]=W;});var I;if(!g){var A=T._dimension;I=f.length/A;}if(T._enableTextures&&T._buffers.texCoordBuffer){var _A2=R||l(f,T._dimension);O.bindBuffer(O.ARRAY_BUFFER,T._buffers.texCoordBuffer),O.bufferData(O.ARRAY_BUFFER,y.FLOAT(_A2),O.STATIC_DRAW);}u!=null?(g?O.drawElementsInstanced?O.drawElementsInstanced(L,m,O.UNSIGNED_SHORT,0,u):_this15.aia_ext&&_this15.aia_ext.drawElementsInstancedANGLE(L,m,O.UNSIGNED_SHORT,0,u):O.drawArraysInstanced?O.drawArraysInstanced(L,0,I,u):_this15.aia_ext.drawArraysInstancedANGLE(L,0,I,u),w.forEach(function(A){O.vertexAttribDivisor?O.vertexAttribDivisor(A,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(A,null);})):g?O.drawElements(L,m,O.UNSIGNED_SHORT,0):O.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 T=this.program;if(!T||!T.uniforms)throw Error("No avaliable program.");return T.uniforms;}},{key:"deleteProgram",value:function deleteProgram(T){var v=this.gl;this.program===T&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),v.useProgram(null));var x=this.programs.indexOf(T);x>=0&&this.programs.splice(x,1),d(v,T),v.deleteProgram(T);}/**
|
|
39
|
+
[{
|
|
40
|
+
positions: ...
|
|
41
|
+
cells: ...
|
|
42
|
+
textureCoord: ...
|
|
43
|
+
attributes: {name: {data:..., normalize: true}},
|
|
44
|
+
uniforms: ...
|
|
45
|
+
}]
|
|
46
|
+
*/},{key:"setMeshData",value:function setMeshData(T){var _this16=this;Array.isArray(T)||(T=[T]);var v=this.program;v.meshData=T.map(function(_ref19){var x=_ref19.mode,f=_ref19.positions,g=_ref19.instanceCount,u=_ref19.cells,m=_ref19.cellsCount,M=_ref19.attributes,E=_ref19.uniforms,R=_ref19.textureCoord,b=_ref19.enableBlend;var O={positions:y.FLOAT(f),uniforms:E,enableBlend:!!b,textureCoord:y.FLOAT(R)};if(u&&(O.cells=y.USHORT(u),O.cellsCount=m||O.cells.length),x!=null&&(O.mode=x),g!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");O.instanceCount=g;}if(M){var L={};Object.entries(M).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),w=_ref21[0],I=_ref21[1];if(!v._attribute[w])v._attribute[w]="ignored";else if(v._attribute[w]!=="ignored"){var _v$_attribute$w=v._attribute[w],A=_v$_attribute$w.name,W=_v$_attribute$w.type;var z=I.data||I;if(Array.isArray(z)&&(z=y[W](z)),L[w]={name:A,data:z},I.divisor!=null){if(!_this16.isWebGL2&&!_this16.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");L[w].divisor=I.divisor;}}}),O.attributes=L;}return O;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(T,v){var _this17=this;var x=/^\s*uniform\s+sampler/mg.test(T);T==null&&(T=i["default"]),v==null&&(v=x?a["default"]:n["default"]);var f=this.gl,g=Object(e.createProgram)(f,v,T);g.shaderText={vertexShader:v,fragmentShader:T},g._buffers={},g._attribute={},g.uniforms={},g._samplerMap={},g._bindTextures=[];var u=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var m=v.match(u);m&&(g._dimension=Number(m[1]));var M=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");m=v.match(M),m&&(g._texCoordSize=Number(m[1]));var E=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(m=v.match(E),m)for(var O=0;O<m.length;O++){var L=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,w=m[O].match(L);if(w&&w[3]!==this.options.vertexPosition&&w[3]!==this.options.vertexTextureCoord){var _w=_slicedToArray(w,4),I=_w[1],A=_w[2],W=_w[3];I==="mat"&&(A=Math.pow(A,2)),g._buffers[W]=f.createBuffer(),g._attribute[W]={name:W,type:I,size:Number(A)||1};}}var R=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;m=v.match(R)||[],m=m.concat(T.match(R)||[]),m.forEach(function(O){var L=O.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _L$slice=L.slice(1),_L$slice2=_slicedToArray(_L$slice,3),w=_L$slice2[0],I=_L$slice2[1],A=_L$slice2[2];w=p[w],A=!!A,w.indexOf("Matrix")!==0&&A&&(w+="v"),_this17._declareUniform(g,I,w);}),g._buffers.verticesBuffer=f.createBuffer(),g._buffers.cellsBuffer=f.createBuffer();var b=f.getAttribLocation(g,this.options.vertexTextureCoord);return g._enableTextures=b>=0,g._enableTextures&&(g._buffers.texCoordBuffer=f.createBuffer()),this.programs.push(g),g;}},{key:"useProgram",value:function useProgram(T){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var x=this.gl;x.useProgram(T);var f=T._dimension;x.bindBuffer(x.ARRAY_BUFFER,T._buffers.verticesBuffer);var g=x.getAttribLocation(T,this.options.vertexPosition);if(x.vertexAttribPointer(g,f,x.FLOAT,!1,0,0),x.enableVertexAttribArray(g),T._enableTextures){x.bindBuffer(x.ARRAY_BUFFER,T._buffers.texCoordBuffer);var u=x.getAttribLocation(T,this.options.vertexTextureCoord);x.vertexAttribPointer(u,T._texCoordSize||2,x.FLOAT,!1,0,0),x.enableVertexAttribArray(u);}if(Object.entries(T._attribute).forEach(function(_ref22){var _ref23=_slicedToArray(_ref22,2),u=_ref23[0],m=_ref23[1];if(m!=="ignored"){var M=m.size,E=v[u]||{},R=!!E.normalize;var b=E.type||"FLOAT";var O=E.key||u;b==="UBYTE"&&(b="UNSIGNED_BYTE"),b==="USHORT"&&(b="UNSIGNED_SHORT"),m.type=b,O&&O!==u&&(T._attribute[O]=m),x.bindBuffer(x.ARRAY_BUFFER,T._buffers[u]);var L=x.getAttribLocation(T,u);L>=0&&(x.vertexAttribPointer(L,M,x[b],R,0,0),x.enableVertexAttribArray(L));}}),!T.meshData){var _u2=[[-1,-1,0,1].slice(0,f),[1,-1,0,1].slice(0,f),[1,1,0,1].slice(0,f),[-1,1,0,1].slice(0,f)],m=[[0,1,3],[3,1,2]];this.setMeshData({positions:_u2,cells:m});}return T;}},{key:"compileSync",value:function compileSync(T,v){T=T||i["default"];var x={};function f(M){M=M.replace(/^\s*/mg,"");var E=[],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 w=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),x[I])E.push("/* included ".concat(I," */"));else if(x[I]=!0,w==="lib"){var A=f(s[I]);E.push(A);}else if(w==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}E.forEach(function(b){M=M.replace(/^#pragma\s+include\s+.*/m,b);});}return M;}var g=f(T),u=v?f(v):null;return this.createProgram(g,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(T,v){var x,f,_f2,g,u;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_f2=function _f4(){_f2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(M){var E,R,b,L,w,I,A,_A3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:M=M.replace(/^\s*/mg,"");E=[],R=M.match(/^#pragma\s+include\s+.*/mg);if(!R){_context11.next=32;break;}b=0;case 4:if(!(b<R.length)){_context11.next=31;break;}L=R[b].match(/(?:<|")(.*)(?:>|")/);if(!L){_context11.next=28;break;}w=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),x[I])){_context11.next=13;break;}E.push("/* included ".concat(I," */"));_context11.next=28;break;case 13:if(!(x[I]=!0,w==="lib")){_context11.next=20;break;}_context11.next=16;return f(s[I]);case 16:A=_context11.sent;E.push(A);_context11.next=28;break;case 20:if(!(w==="link")){_context11.next=28;break;}_context11.next=23;return y.fetchShader(I);case 23:_A3=_context11.sent;_context11.next=26;return f(_A3);case 26:_A3=_context11.sent;E.push(_A3);case 28:b++;_context11.next=4;break;case 31:E.forEach(function(b){M=M.replace(/^#pragma\s+include\s+.*/m,b);});case 32:return _context11.abrupt("return",M);case 33:case"end":return _context11.stop();}},_callee11);}));return _f2.apply(this,arguments);};f=function _f3(_x13){return _f2.apply(this,arguments);};T=T||i["default"];x={};_context12.next=6;return f(T);case 6:g=_context12.sent;if(!v){_context12.next=13;break;}_context12.next=10;return f(v);case 10:_context12.t0=_context12.sent;_context12.next=14;break;case 13:_context12.t0=null;case 14:u=_context12.t0;return _context12.abrupt("return",this.createProgram(g,u));case 16:case"end":return _context12.stop();}},_callee12,this);}));function compile(_x11,_x12){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(T){var v,_args13=arguments;return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:v=_args13.length>1&&_args13[1]!==undefined?_args13[1]:null;_context13.next=3;return y.fetchShader(T);case 3:T=_context13.sent;_context13.t0=v;if(!_context13.t0){_context13.next=9;break;}_context13.next=8;return y.fetchShader(v);case 8:v=_context13.sent;case 9:return _context13.abrupt("return",this.compile(T,v));case 10:case"end":return _context13.stop();}},_callee13,this);}));function load(_x14){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this18=this;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref24=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref24$wrapS=_ref24.wrapS,v=_ref24$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapS,_ref24$wrapT=_ref24.wrapT,x=_ref24$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapT,_ref24$minFilter=_ref24.minFilter,f=_ref24$minFilter===void 0?this.gl.LINEAR:_ref24$minFilter,_ref24$magFilter=_ref24.magFilter,g=_ref24$magFilter===void 0?this.gl.LINEAR:_ref24$magFilter;var u=this.gl,m=Array.isArray(T)?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(m,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,E=_this$canvas4.width,R=_this$canvas4.height;if(T){if(m===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,T[b]);else u.texImage2D(m,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,T);}else if(m===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,E,R,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(m,0,u.RGBA,E,R,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(m,u.TEXTURE_MIN_FILTER,f),u.texParameteri(m,u.TEXTURE_MAG_FILTER,g),u.texParameteri(m,u.TEXTURE_WRAP_S,v),u.texParameteri(m,u.TEXTURE_WRAP_T,x),m===u.TEXTURE_CUBE_MAP&&(T.width=T[0].width,T.height=T[0].height),u.bindTexture(m,null),M._img=T||{width:E,height:R},M["delete"]=function(){_this18.deleteTexture(M);},M;}},{key:"deleteTexture",value:function deleteTexture(T){var v=T._img;this.gl.deleteTexture(T),typeof v.close=="function"&&v.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(T){var _ref25,_ref25$useImageBitmap,v,x,_args14=arguments;return _regeneratorRuntime().wrap(function _callee14$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_ref25=_args14.length>1&&_args14[1]!==undefined?_args14[1]:{},_ref25$useImageBitmap=_ref25.useImageBitmap,v=_ref25$useImageBitmap===void 0?!0:_ref25$useImageBitmap;_context14.next=3;return y.loadImage(T,{useImageBitmap:v});case 3:x=_context14.sent;return _context14.abrupt("return",this.createTexture(x));case 5:case"end":return _context14.stop();}},_callee14,this);}));function loadTexture(_x15){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,T=_ref26$color===void 0?1:_ref26$color,_ref26$blend=_ref26.blend,v=_ref26$blend===void 0?!1:_ref26$blend,_ref26$depth=_ref26.depth,x=_ref26$depth===void 0?this.options.depth!==!1:_ref26$depth,_ref26$stencil=_ref26.stencil,f=_ref26$stencil===void 0?!!this.options.stencil:_ref26$stencil;var g=this.gl,u=g.createFramebuffer();g.bindFramebuffer(g.FRAMEBUFFER,u);var m=[];for(var R=0;R<T;R++){var b=this.createTexture();g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0+R,g.TEXTURE_2D,b,0/* level */),m.push(b);}u.textures=m,u.texture=m[0],u.blend=v;var _this$canvas5=this.canvas,M=_this$canvas5.width,E=_this$canvas5.height;return x&&!f&&(u.depthBuffer=g.createRenderbuffer(),g.bindRenderbuffer(g.RENDERBUFFER,u.depthBuffer),g.renderbufferStorage(g.RENDERBUFFER,g.DEPTH_COMPONENT16,M,E),g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,u.depthBuffer)),f&&!x&&(u.stencilBuffer=g.createRenderbuffer(),g.bindRenderbuffer(g.RENDERBUFFER,u.stencilBuffer),g.renderbufferStorage(g.RENDERBUFFER,g.STENCIL_INDEX8,M,E),g.framebufferRenderbuffer(g.FRAMEBUFFER,g.STENCIL_ATTACHMENT,g.RENDERBUFFER,u.stencilBuffer)),x&&f&&(u.depthStencilBuffer=g.createRenderbuffer(),g.bindRenderbuffer(g.RENDERBUFFER,u.depthStencilBuffer),g.renderbufferStorage(g.RENDERBUFFER,g.DEPTH_STENCIL,M,E),g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_STENCIL_ATTACHMENT,g.RENDERBUFFER,u.depthStencilBuffer)),g.bindFramebuffer(g.FRAMEBUFFER,null),u;}},{key:"bindFBO",value:function bindFBO(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=T;}},{key:"render",value:function render(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$clearBuffer=_ref27.clearBuffer,T=_ref27$clearBuffer===void 0?!0:_ref27$clearBuffer;this.startRender=!0;var v=this.gl;var x=this.program;x||(x=this.createProgram(),this.useProgram(x)),this.fbo&&v.bindFramebuffer(v.FRAMEBUFFER,this.fbo);var f=this.options.depth;f&&v.enable(v.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(f?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var g=this._renderFrameID;this._draw(),this.fbo&&v.bindFramebuffer(v.FRAMEBUFFER,null),this._renderFrameID===g&&(this._renderFrameID=null);}},{key:"update",value:function update(){this.startRender&&this._renderFrameID==null&&(this._renderFrameID=requestAnimationFrame(this.render.bind(this)));}}],[{key:"addLibs",value:function addLibs(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(s,T);}},{key:"FLOAT",value:function FLOAT(T,v){return Object(e.pointsToBuffer)(T,Float32Array,v);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(T,v){return Object(e.pointsToBuffer)(T,Uint8Array,v);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(T,v){return Object(e.pointsToBuffer)(T,Uint16Array,v);}},{key:"BYTE",value:function BYTE(T,v){return Object(e.pointsToBuffer)(T,Int8Array,v);}},{key:"SHORT",value:function SHORT(T,v){return Object(e.pointsToBuffer)(T,Int16Array,v);}}]);}();o(y,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(y,"UBYTE",y.UNSIGNED_BYTE),o(y,"USHORT",y.UNSIGNED_SHORT),o(y,"fetchShader",e.fetchShader),o(y,"loadImage",e.loadImage);},/* 16 */ /***/function(h,r,t){t.r(r),t.d(r,"setupWebGL",function(){return n;}),t.d(r,"createProgram",function(){return i;}),t.d(r,"pointsToBuffer",function(){return a;}),t.d(r,"loadImage",function(){return s;}),t.d(r,"fetchShader",function(){return d;}),t(1).glMatrix.setMatrixArrayType(Array);function e(c,p){var y=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var P=null;for(var T=0;T<y.length;++T){try{P=c.getContext(y[T],p);}catch(_unused){}if(P)break;}return P;}function n(c,p){var y=e(c,p);if(!y)throw new Error("Sorry, your browser doesn't support WebGL.");return y;}function i(c,p,y){var P=c.createShader(c.VERTEX_SHADER);if(c.shaderSource(P,p),c.compileShader(P),!c.getShaderParameter(P,c.COMPILE_STATUS)){var _x16="Vertex shader failed to compile. The error log is:".concat(c.getShaderInfoLog(P));throw new Error(_x16);}var T=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(T,y),c.compileShader(T),!c.getShaderParameter(T,c.COMPILE_STATUS)){var _x17="Fragment shader failed to compile. The error log is:".concat(c.getShaderInfoLog(T));throw new Error(_x17);}var v=c.createProgram();if(c.attachShader(v,P),c.attachShader(v,T),c.linkProgram(v),!c.getProgramParameter(v,c.LINK_STATUS)){var _x18="Shader program failed to link. The error log is:".concat(c.getProgramInfoLog(v));throw new Error(_x18);}return c.deleteShader(P),c.deleteShader(T),v;}function a(c){var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(y&&!(y instanceof p))throw new TypeError("Wrong buffer type.");if(c==null||c instanceof p)return c;if(c[0]==null||c[0].length==null)return y?(y.set(c,0),y):new p(c);var P=c[0].length,T=c.length;y||(y=new p(P*T));var v=0;for(var _x19=0;_x19<T;_x19++)for(var _f5=0;_f5<P;_f5++)y[v++]=c[_x19][_f5];return y;}var o={};function s(c){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$useImageBitmap=_ref28.useImageBitmap,p=_ref28$useImageBitmap===void 0?!0:_ref28$useImageBitmap,_ref28$alias=_ref28.alias,y=_ref28$alias===void 0?null:_ref28$alias;if(!o[c]){if(typeof Image=="function"){var P=new Image();typeof c=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(c)&&(P.crossOrigin="anonymous"),o[c]=new Promise(function(T){P.onload=function(){p&&typeof createImageBitmap=="function"?createImageBitmap(P,{imageOrientation:"flipY"}).then(function(v){o[c]=v,y&&(o[y]=v),T(v);}):(o[c]=P,y&&(o[y]=P),T(P));},P.src=c;}),y&&(o[y]=o[c]);}else if(typeof fetch=="function")return fetch(c,{method:"GET",mode:"cors",cache:"default"}).then(function(P){return P.blob();}).then(function(P){return createImageBitmap(P,{imageOrientation:"flipY"}).then(function(T){return o[c]=T,y&&(o[y]=T),T;});});}return o[c];}var l={};function d(_x20){return _d2.apply(this,arguments);}function _d2(){_d2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(c){var p,y;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!l[c]){_context15.next=2;break;}return _context15.abrupt("return",l[c]);case 2:_context15.next=4;return fetch(c);case 4:p=_context15.sent;if(!(p.status>=200&&p.status<300)){_context15.next=10;break;}_context15.next=8;return p.text();case 8:y=_context15.sent;return _context15.abrupt("return",(l[c]=y,y));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context15.stop();}},_callee15);}));return _d2.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,l){_classCallCheck(this,a);this.context=s.getContext("2d"),this.options=l,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 _callee16(s){var l;return _regeneratorRuntime().wrap(function _callee16$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:_context16.next=2;return e["default"].loadImage(s,{useImageBitmap:!1});case 2:l=_context16.sent;return _context16.abrupt("return",this.createTexture(l));case 4:case"end":return _context16.stop();}},_callee16,this);}));function loadTexture(_x21){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(s){return s;}},{key:"clear",value:function clear(s,l,d,c){var p=this.context;s=s||0,l=l||0,d=d||p.canvas.width-s,c=c||p.canvas.height-l,p.clearRect(s,l,d,c);}},{key:"drawMeshCloud",value:function drawMeshCloud(s){var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,l=_ref29$clear===void 0?!1:_ref29$clear;var d=[];for(var c=0;c<s.amount;c++){var p=s.getTransform(c);var y=s.getTextureFrame(c);y&&(y=y._img);var P=s.getFilter(c),_s$getCloudRGBA=s.getCloudRGBA(c),T=_s$getCloudRGBA.fill,v=_s$getCloudRGBA.stroke;d.push({mesh:s.mesh,_cloudOptions:[T,v,y,p,P]});}s.beforeRender&&s.beforeRender(this.context,s),this.drawMeshes(d,{clear:l,hook:!1}),s.afterRender&&s.afterRender(this.context,s);}},{key:"drawMeshes",value:function drawMeshes(s){var _this19=this;var _ref30=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref30$clear=_ref30.clear,l=_ref30$clear===void 0?!1:_ref30$clear,_ref30$hook=_ref30.hook,d=_ref30$hook===void 0?!0:_ref30$hook;var c=this.context;l&&c.clearRect(0,0,c.canvas.width,c.canvas.height);var p=null;var _c$canvas=c.canvas,y=_c$canvas.width,P=_c$canvas.height,T=s.length;s.forEach(function(v,x){var _v$_cloudOptions,_this19$filterBuffer;var f,g,u,m,M;d&&v.beforeRender&&v.beforeRender(c,v),v._cloudOptions&&((_v$_cloudOptions=_slicedToArray(v._cloudOptions,5),f=_v$_cloudOptions[0],g=_v$_cloudOptions[1],u=_v$_cloudOptions[2],m=_v$_cloudOptions[3],M=_v$_cloudOptions[4]),v=v.mesh);var E=v.filter;if(M&&(E=E?"".concat(E," ").concat(M):M),E&&!_this19.filterBuffer&&_this19.filterBuffer!==!1){var R=e["default"].createCanvas(y,P);R?_this19.filterBuffer=R.getContext("2d"):_this19.filterBuffer=!1;}p&&p!==E&&(Object(n.applyFilter)(_this19.filterBuffer,p),c.drawImage(_this19.filterBuffer.canvas,0,0,y,P),_this19.filterBuffer.clearRect(0,0,y,P),p=null),E&&_this19.filterBuffer?(_this19.filterBuffer.save(),(_this19$filterBuffer=_this19.filterBuffer).transform.apply(_this19$filterBuffer,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(v,_this19.filterBuffer,!1,f,g,u,m),_this19.filterBuffer.restore(),x===T-1?(Object(n.applyFilter)(_this19.filterBuffer,E),c.drawImage(_this19.filterBuffer.canvas,0,0,y,P),_this19.filterBuffer.clearRect(0,0,y,P)):p=E):(c.save(),c.transform.apply(c,_toConsumableArray(_this19[i])),Object(n.drawMesh2D)(v,c,!1,f,g,u,m),c.restore()),d&&v.afterRender&&v.afterRender(c,v);});}},{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(y,P){var T=y.style,v=y.variant,x=y.weight,f=y.stretch,g=y.size,u=y.pxLineHeight,m=y.family;return f==="normal"?"".concat(T," ").concat(v," ").concat(x," ").concat(g*P,"px/").concat(u*P,"px ").concat(m):"".concat(T," ").concat(v," ").concat(x," ").concat(f," ").concat(g*P,"px/").concat(u*P,"px ").concat(m);}function l(y,_ref31){var P=_ref31.font,T=_ref31.fillColor,v=_ref31.strokeColor,x=_ref31.strokeWidth,_ref31$ratio=_ref31.ratio,f=_ref31$ratio===void 0?1:_ref31$ratio,g=_ref31.textCanvas,_ref31$cachable=_ref31.cachable,u=_ref31$cachable===void 0?!1:_ref31$cachable;var m;if(u){m=[y,P,String(T),String(v),String(x)].join("###");var z=o[m];if(z)return z;}g||(g=c(1,1));var M=g.getContext("2d");M.save(),M.font=P;var _M$measureText=M.measureText(y),E=_M$measureText.width;M.restore();var R=Object(i["default"])(P),b=Math.max(R.pxLineHeight,R.pxHeight*1.13);/italic|oblique/.test(P)&&(E+=b*Math.tan(15*Math.PI/180)),!T&&!v&&(T="#000");var O=M.canvas,L=Math.ceil(E),w=Math.ceil(b);O.width=Math.round(L*f),O.height=Math.round(w*f),M.save(),M.font=s(R,f),M.textAlign="center",M.textBaseline="middle";var I=O.height*0.5+R.pxHeight*0.05*f,A=O.width*0.5;if(T){if(Array.isArray(T))T=Object(a["default"])(T);else if(T.vector){var _z;var _T=T,K=_T.vector,k=_T.colors;K.length===6?_z=M.createRadialGradient.apply(M,_toConsumableArray(K)):_z=M.createLinearGradient.apply(M,_toConsumableArray(K)),k.forEach(function(_ref32){var q=_ref32.offset,U=_ref32.color;_z.addColorStop(q,U);}),T=_z;}M.fillStyle=T,M.fillText(y,A,I);}if(v){if(M.lineWidth=x*f,Array.isArray(v))v=Object(a["default"])(v);else if(v.vector){var _z2;var _v=v,_K=_v.vector,_k=_v.colors;_K.length===6?_z2=M.createRadialGradient.apply(M,_toConsumableArray(_K)):_z2=M.createLinearGradient.apply(M,_toConsumableArray(_K)),_k.forEach(function(_ref33){var q=_ref33.offset,U=_ref33.color;_z2.addColorStop(q,U);}),v=_z2;}M.strokeStyle=v,M.strokeText(y,A,I);}M.restore();var W={image:g,rect:[0,0,L,w]};return u&&(o[m]=W),W;}var d=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var y=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);y&&(d=Number(y[1])<70);}function c(y,P){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var v=T.offscreen||!d&&T.offscreen!==!1;var x;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?x=e.createCanvas(y,P,T):v&&typeof OffscreenCanvas=="function"?x=new OffscreenCanvas(y,P):(x=document.createElement("canvas"),x.width=y,x.height=P),x;}var p={createCanvas:c,createText:l,loadImage:n["default"].loadImage};r["default"]=p;}.call(this,t(22));},/* 22 */ /***/function(h,r){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused2){(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 T;}),t(1).glMatrix.setMatrixArrayType(Array);function e(v,x){if(typeof v=="string"){var u=v.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);u?v={size:parseFloat(u[1]),unit:u[2]}:v={size:parseInt(v,10),unit:"px"};}var _v2=v,f=_v2.size,g=_v2.unit;if(g==="pt")f/=0.75;else if(g==="pc")f*=16;else if(g==="in")f*=96;else if(g==="cm")f*=96/2.54;else if(g==="mm")f*=96/25.4;else if(g==="em"||g==="rem"||g==="ex"){if(!x&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;x=e(_u3,16);}f*=x,g==="ex"&&(f/=2);}else if(g==="q")f*=96/25.4/4;else if(g==="vw"||g==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u4=g==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;f*=_u4/100;}}else if((g==="vmax"||g==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u5=document.documentElement.clientWidth,m=document.documentElement.clientHeight;g==="vmax"?f*=Math.max(_u5,m)/100:f*=Math.min(_u5,m)/100;}return f;}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|%",l="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",d=new RegExp("(".concat(n,") +"),"i"),c=new RegExp("(".concat(i,") +"),"i"),p=new RegExp("(".concat(a,") +"),"i"),y=new RegExp("(".concat(o,") +"),"i"),P=new RegExp("([\\d\\.]+)("+s+")(?:\\/([\\d\\.]+)("+s+"))? *((?:"+l+")( *, *(?:"+l+"))*)");function T(v,x){var f=P.exec(v);if(!f)return;var g=parseFloat(f[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(f[1]),unit:f[2],lineHeight:Number.isFinite(g)?g:void 0,lineHeightUnit:f[4],family:f[5].replace(/ *, */g,",")},m=v.substring(0,f.index),M=d.exec(m),E=c.exec(m),R=p.exec(m),b=y.exec(m);return M&&(u.weight=M[1]),E&&(u.style=E[1]),R&&(u.variant=R[1]),b&&(u.stretch=b[1]),u.pxHeight=e({size:u.size,unit:u.unit},x),u.pxLineHeight=e({size:u.lineHeight||u.size,unit:u.lineHeightUnit||u.unit},x),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 l;});var e=t(1),n=t(24),i=t(23),a=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(d,c){var p=d.canvas;d.save(),d.filter=c,d.drawImage(p,0,0,p.width,p.height),d.restore();}function s(d,c){var p=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;d=d.match(p).slice(1,5).map(Number),c=c.match(p).slice(1,5).map(Number);var y=[],P=c[3];for(var T=0;T<4;T++)y[T]=Object(a.mix)(d[T],c[T],P);return"rgba(".concat(y.join(),")");}function l(d,c){var p=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var y=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var P=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var T=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var v=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;c.save();var x=!1,f=!1;if(c.globalAlpha=d.getOpacity(),d._updateMatrix&&d.transformScale/d.contours.scale>1.5&&d.accurate(d.transformScale),d.lineWidth){var m=d.gradient&&d.gradient.stroke;if(m){var _m=m,M=_m.vector,E=_m.colors;if(M.length===6)m=c.createRadialGradient.apply(c,_toConsumableArray(M));else if(M.length===4)m=c.createLinearGradient.apply(c,_toConsumableArray(M));else if(M.length===3)m=c.createCircularGradient.apply(c,_toConsumableArray(M));else throw new TypeError("Invalid vector dimension.");E.forEach(function(_ref34){var R=_ref34.offset,b=_ref34.color;var O=Object(n["default"])(b);P&&(O=s(O,P)),m.addColorStop(R,O);}),c.strokeStyle=m,x=!0;}else d.strokeStyle&&(P?c.strokeStyle=s(d.strokeStyle,P):c.strokeStyle=d.strokeStyle,x=!0);}x&&(c.lineWidth=d.lineWidth,c.lineJoin=d.lineJoin,c.lineCap=d.lineCap,c.miterLimit=d.miterLimit,d.lineDash&&(c.setLineDash(d.lineDash),d.lineDashOffset&&(c.lineDashOffset=d.lineDashOffset)));var g=d.gradient&&d.gradient.fill;if(g){var _g2=g,_m2=_g2.vector,_M2=_g2.colors;if(_m2.length===6)g=c.createRadialGradient.apply(c,_toConsumableArray(_m2));else if(_m2.length===4)g=c.createLinearGradient.apply(c,_toConsumableArray(_m2));else if(_m2.length===3)g=c.createCircularGradient.apply(c,_toConsumableArray(_m2));else throw new TypeError("Invalid vector dimension.");_M2.forEach(function(_ref35){var E=_ref35.offset,R=_ref35.color;var b=Object(n["default"])(R);P&&(b=s(b,P)),g.addColorStop(E,b);}),c.fillStyle=g,f=!0;}else d.fillStyle&&(y?c.fillStyle=s(d.fillStyle,y):c.fillStyle=d.fillStyle,f=!0);if(v&&c.transform.apply(c,_toConsumableArray(v)),c.transform.apply(c,_toConsumableArray(d.transformMatrix)),d.clipPath){var _m3=d.clipPath,_M3=new Path2D(_m3);c.clip(_M3);}var u=d.contours.length;if(d.contours.forEach(function(m,M){var E=m.length,R=E>1&&e.vec2.equals(m[0],m[E-1]),b=M===u-1&&d.texture;if(m&&E>0){if(f||x||b){c.beginPath(),c.moveTo.apply(c,_toConsumableArray(m[0]));for(var O=1;O<E;O++)O===E-1&&R?c.closePath():c.lineTo.apply(c,_toConsumableArray(m[O]));}if(f&&c.fill(d.fillRule),b){c.save(),c.clip();var _d$texture=d.texture,_O=_d$texture.image,L=_d$texture.options;if(T&&(_O=T),L.repeat&&console.warn("Context 2D not supported image repeat yet."),_O.font){L.scale&&console.warn("Context 2D not supported text scale yet."),L.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _O2=_O,w=_O2.font,I=_O2.fillColor,A=_O2.strokeColor,W=_O2.strokeWidth,z=_O2.text;!I&&!A&&(I="#000"),Array.isArray(I)&&(I=Object(n["default"])(I)),Array.isArray(A)&&(A=Object(n["default"])(A)),c.font=w;var _c$measureText=c.measureText(z),K=_c$measureText.width,k=Object(i["default"])(w),q=Math.max(k.pxLineHeight,k.pxHeight*1.13);c.textAlign="center",c.textBaseline="middle";var U=L.rect,G=U[0]+q*0.5+k.pxHeight*0.06,Z=U[1]+K*0.5;U[2]!=null&&c.scale(U[2]/K,U[3]/q),I&&(c.fillStyle=I,c.fillText(z,Z,G)),A&&(c.lineWidth=W,c.strokeStyle=A,c.strokeText(z,Z,G));}else{var _w2=L.rect;var _I=L.srcRect;L.scale&&(_w2=[0,0,c.canvas.width,c.canvas.height]),L.rotated&&_w2&&(_w2=[-_w2[1],_w2[0],_w2[3],_w2[2]]),_I&&(_w2=_w2||[0,0,_I[2],_I[3]]),L.rotated&&(c.translate(0,_w2?_w2[2]:_O.width),c.rotate(-0.5*Math.PI)),_I?c.drawImage.apply(c,[_O].concat(_toConsumableArray(_I),_toConsumableArray(_w2))):_w2?c.drawImage.apply(c,[_O].concat(_toConsumableArray(_w2))):c.drawImage(_O,0,0);}c.restore();}x&&c.stroke();}}),c.restore(),p){var _m4=d.filter;_m4&&o(c,_m4);}}},/* 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],l=_a2[1];return[s*o[0]+l*o[2]+o[4],s*o[1]+l*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(l,d,c){var p=l.uniforms||{},y=d.uniforms||{};if(p.u_texSampler&&y.u_texSampler&&p.u_texSampler!==y.u_texSampler)return!1;var P=Object.keys(p),T=Object.keys(y),v=P.indexOf("u_texSampler"),x=T.indexOf("u_texSampler");if(v>=0&&P.splice(v,1),x>=0&&T.splice(x,1),P.length!==T.length)return!1;var f=P.every(function(g){var u=p[g],m=y[g];if(u===m)return!0;if(u.length&&m.length&&u.length===m.length){for(var M=0;M<u.length;M++)if(u[M]!==m[M])return!1;return!0;}return!1;});if(f){if(p.u_texSampler&&!y.u_texSampler)d.setTexture(p.u_texSampler,{hidden:!0});else if(!p.u_texSampler&&y.u_texSampler)for(var g=0;g<c.length;g++)c[g].setTexture(y.u_texSampler,{hidden:!0});}return f;}var a={};function o(l,d){if(l.length){var c=Object(e["default"])(l,a);return c.enableBlend=d,l[0].filterCanvas&&(c.filterCanvas=!0),c.packIndex=l[0].packIndex,c.packLength=l.length,c.beforeRender=l[0].beforeRender,c.pass=l[0].pass,c.afterRender=l[l.length-1].afterRender,l.length=0,c;}}function s(l,d){var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(){var p,y,P,T,v,_x22,_f6,u,g,_u6,m;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:p=[],y=l.options.bufferSize;P=0,T=!1;v=0;case 3:if(!(v<d.length)){_context17.next=47;break;}_x22=d[v];if(!(_x22 instanceof n["default"])){_context17.next=16;break;}_context17.t0=p.length;if(!_context17.t0){_context17.next=10;break;}_context17.next=10;return o(p,T);case 10:P=0;T=!1;_context17.next=14;return _x22;case 14:_context17.next=44;break;case 16:_f6=_x22.meshData;if(_f6.clipPath&&!_f6.uniforms.u_clipSampler){u=l.createTexture(_f6.clipPath);_f6.uniforms.u_clipSampler=u;}g=0;if(!((!c||!_x22.canIgnore())&&_f6&&_f6.positions.length)){_context17.next=40;break;}_x22.packIndex=v;_u6=_x22.filterCanvas;if(!(g=_f6.positions.length,_u6||P+g>y)){_context17.next=31;break;}_context17.t1=p.length;if(!_context17.t1){_context17.next=27;break;}_context17.next=27;return o(p,T);case 27:P=0;T=!1;_context17.next=39;break;case 31:if(!P){_context17.next=39;break;}m=p[p.length-1];_context17.t2=m&&(m.filterCanvas||m.afterRender||_x22.beforeRender||m.pass.length||_x22.pass.length||m.program!==_x22.program||!i(m,_x22,p));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(p,T);case 37:P=0;T=!1;case 39:p.push(_x22),T=T||_x22.enableBlend,P+=g;case 40:_context17.t3=v===d.length-1&&p.length;if(!_context17.t3){_context17.next=44;break;}_context17.next=44;return o(p,T);case 44:v++;_context17.next=3;break;case 47:case"end":return _context17.stop();}},_callee17);})();}},/* 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,l=0,d=0,c=0,p=0,y=0,P=0;var T=a[0].program;for(var v=0;v<a.length;v++){var _x23=a[v].meshData;if(_x23){P+=_x23.positions.length;var _f7=_x23.positions[0].length;s+=_x23.positions.length*_f7,l+=_x23.cells.length*3,y+=_x23.attributes.a_color.length*4;var g=_x23.textureCoord;g&&(d+=g.length*g[0].length);var u=_x23.attributes.a_sourceRect;u&&(c+=u.length*4);var m=_x23.attributes.a_clipUV;m&&(p+=m.length*2);}}if((!o.positions||o.positions.length<s)&&(o.positions=new Float32Array(s)),(!o.cells||o.cells.length<l)&&(o.cells=new Uint16Array(l)),d&&(!o.textureCoord||o.textureCoord.length<d)&&(o.textureCoord=new Float32Array(d)),(!o.a_color||o.a_color.length<y)&&(o.a_color=new Uint8Array(y)),c&&(!o.a_sourceRect||o.a_sourceRect.length<c)&&(o.a_sourceRect=new Float32Array(c)),p&&(!o.a_clipUV||o.a_clipUV.length<p)&&(o.a_clipUV=new Float32Array(p)),T){var _v3=Object.entries(T._attribute),_x24=T._attribOpts||{};for(var _f8=0;_f8<_v3.length;_f8++){var _v3$_f=_slicedToArray(_v3[_f8],2),_g3=_v3$_f[0],_u7=_v3$_f[1];if(_g3!=="a_color"&&_g3!=="a_sourceRect"&&_u7!=="ignored"){var _m5=_x24[_g3]?_x24[_g3].type:"FLOAT",M=e[_m5],E=_u7.size*P;(!o[_g3]||o[_g3].length<E)&&(o[_g3]=new M(E));}}}return o;}function i(a,o){var s=[],l=[],d=[],c=[],p=[],y=[],P=0,T=0;var v=a[0]?a[0].uniforms||{}:{},x=a[0]?a[0].program:null;o&&(n(a,o),l=o.cells,s=o.positions,d=o.textureCoord,c=o.a_color,p=o.a_sourceRect,y=o.a_clipUV);var f=!1,g=!1;var u={};for(var M=0;M<a.length;M++){var E=a[M];if(E){var _s2,_c2,_p2,_y,_d3;if(E.meshData&&(E=E.meshData),o){var b=E.positions;for(var O=0;O<b.length;O++){var L=b[O],w=3*(P+O);for(var I=0;I<L.length;I++)s[w+I]=L[I];}}else(_s2=s).push.apply(_s2,_toConsumableArray(E.positions));var R=E.cells;for(var _b2=0;_b2<R.length;_b2++){var _O3=R[_b2];if(o){var _L=3*(T+_b2);l[_L]=_O3[0]+P,l[_L+1]=_O3[1]+P,l[_L+2]=_O3[2]+P;}else l.push([_O3[0]+P,_O3[1]+P,_O3[2]+P]);}if(o){var _b3=E.attributes.a_color;for(var _O4=0;_O4<_b3.length;_O4++){var _L2=_b3[_O4],_w3=4*(P+_O4);c[_w3]=_L2[0],c[_w3+1]=_L2[1],c[_w3+2]=_L2[2],c[_w3+3]=_L2[3];}}else(_c2=c).push.apply(_c2,_toConsumableArray(E.attributes.a_color));if(E.attributes.a_sourceRect)if(f=!0,o){var _b4=E.attributes.a_sourceRect;for(var _O5=0;_O5<_b4.length;_O5++){var _L3=_b4[_O5],_w4=4*(P+_O5);p[_w4]=_L3[0],p[_w4+1]=_L3[1],p[_w4+2]=_L3[2],p[_w4+3]=_L3[3];}}else(_p2=p).push.apply(_p2,_toConsumableArray(E.attributes.a_sourceRect));if(E.attributes.a_clipUV)if(g=!0,o){var _b5=E.attributes.a_clipUV;for(var _O6=0;_O6<_b5.length;_O6++){var _L4=_b5[_O6],_w5=2*(P+_O6);y[_w5]=_L4[0],y[_w5+1]=_L4[1];}}else(_y=y).push.apply(_y,_toConsumableArray(E.attributes.a_clipUV));if(E.textureCoord)if(o){var _b6=E.textureCoord;for(var _O7=0;_O7<_b6.length;_O7++){var _L5=_b6[_O7],_w6=3*(P+_O7);for(var _I2=0;_I2<_L5.length;_I2++)d[_w6+_I2]=_L5[_I2];}}else(_d3=d).push.apply(_d3,_toConsumableArray(E.textureCoord));if(x){var _b7=Object.entries(x._attribute);for(var _O8=0;_O8<_b7.length;_O8++){var _u$_L;var _b7$_O=_slicedToArray(_b7[_O8],2),_L6=_b7$_O[0],_w7=_b7$_O[1];if(_L6!=="a_color"&&_L6!=="a_sourceRect"&&_w7!=="ignored")if(u[_L6]=[],o){u[_L6]=o[_L6];var _I3=E.attributes[_L6],A=_I3[0].length;for(var W=0;W<_I3.length;W++){var z=_I3[W],K=A*(P+W);for(var k=0;k<z.length;k++)u[_L6][K+k]=z[k];}}else(_u$_L=u[_L6]).push.apply(_u$_L,_toConsumableArray(E.attributes[_L6]));}}P+=E.positions.length,T+=E.cells.length;}}u.a_color=c,f&&p&&p.length>0&&(u.a_sourceRect=p);var m={positions:s,cells:l,attributes:u,uniforms:v,cellsCount:T*3,program:x};return d&&d.length&&(m.textureCoord=d),g&&y.length>0&&(u.a_clipUV=y),m;}},/* 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,m){var M=Object.keys(u);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(u);m&&(E=E.filter(function(R){return Object.getOwnPropertyDescriptor(u,R).enumerable;})),M.push.apply(M,E);}return M;}function s(u){for(var m=1;m<arguments.length;m++){var M=arguments[m]!=null?arguments[m]:{};m%2?o(Object(M),!0).forEach(function(E){l(u,E,M[E]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(M)):o(Object(M)).forEach(function(E){Object.defineProperty(u,E,Object.getOwnPropertyDescriptor(M,E));});}return u;}function l(u,m,M){return m in u?Object.defineProperty(u,m,{value:M,enumerable:!0,configurable:!0,writable:!0}):u[m]=M,u;}var d=Symbol("mesh"),c=Symbol("count"),p=Symbol("blend"),y=Symbol("filter"),P=Symbol("textures"),T=Symbol("textureOptions"),v=Symbol("cloudColor"),x=Symbol("cloudFilter"),f=Symbol("buffer");function g(u){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var M=new Float32Array(3*u),E=new Float32Array(3*u),R=new Float32Array(4*u),b=new Float32Array(4*u),O=new Float32Array(4*u),L=new Float32Array(4*u),w=new Float32Array(4*u),I=new Uint8Array(u),A=new Uint8Array(4*u),W=new Uint8Array(4*u);return m&&(M.set(m.transform0,0),E.set(m.transform1,0),R.set(m.color0,0),b.set(m.color1,0),O.set(m.color2,0),L.set(m.color3,0),w.set(m.color4,0),I.set(m.frameIndex,0),A.set(m.fillColor,0),W.set(m.strokeColor,0)),{bufferSize:u,transform0:M,transform1:E,color0:R,color1:b,color2:O,color3:L,color4:w,frameIndex:I,fillColor:A,strokeColor:W};}r["default"]=/*#__PURE__*/function(){function _class(u){var m=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,m),this[c]=m,this[d]=u,this[f]=g(M),this[P]=[],this[y]=[],this[v]=!1,this[x]=!1,this[p]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var m=this[c];for(var M=u;M<m;M++)this[f].transform0.set([1,0,0],M*3),this[f].transform1.set([0,1,0],M*3),this[f].frameIndex.set([-1],M),this[f].fillColor.set([0,0,0,0],M*4),this[f].strokeColor.set([0,0,0,0],M*4),this.setColorTransform(M,null);}},{key:"bufferSize",get:function get(){return this[f].bufferSize;}},{key:"mesh",get:function get(){return this[d];},set:function set(u){this[d]=u,this[P]&&this.setTextureFrames(this[P],this[T]);}},{key:"hasCloudColor",get:function get(){return this[v];}},{key:"hasCloudFilter",get:function get(){return this[x];}},{key:"_getFilter",value:function _getFilter(u){return this[y][u]=this[y][u]||[],this[y][u];}},{key:"getFilter",value:function getFilter(u){return this._getFilter(u).join(" ");}},{key:"enableBlend",get:function get(){return this[d].enableBlend||this[p];}},{key:"canIgnore",value:function canIgnore(){return this[d].canIgnore();}},{key:"delete",value:function _delete(u){if(u>=this[c]||u<0)throw new Error("Out of range.");var _this$f2=this[f],m=_this$f2.transform0,M=_this$f2.transform1,E=_this$f2.color0,R=_this$f2.color1,b=_this$f2.color2,O=_this$f2.color3,L=_this$f2.color4,w=_this$f2.frameIndex,I=_this$f2.fillColor,A=_this$f2.strokeColor;m.set(m.subarray(3*(u+1)),3*u),M.set(M.subarray(3*(u+1)),3*u),E.set(E.subarray(4*(u+1)),4*u),R.set(R.subarray(4*(u+1)),4*u),b.set(b.subarray(4*(u+1)),4*u),O.set(O.subarray(4*(u+1)),4*u),L.set(L.subarray(4*(u+1)),4*u),w.set(w.subarray(u+1),u),I.set(I.subarray(4*(u+1)),4*u),A.set(A.subarray(4*(u+1)),4*u);for(var W in this[y])W===u?delete this[y][W]:W>u&&(this[y][W-1]=this[y][W],delete this[y][W]);this[c]--;}},{key:"setColorTransform",value:function setColorTransform(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$f3=this[f],M=_this$f3.color0,E=_this$f3.color1,R=_this$f3.color2,b=_this$f3.color3,O=_this$f3.color4;return m!=null?(M.set([m[0],m[5],m[10],m[15]],u),E.set([m[1],m[6],m[11],m[16]],u),R.set([m[2],m[7],m[12],m[17]],u),b.set([m[3],m[8],m[13],m[18]],u),O.set([m[4],m[9],m[14],m[19]],u),this[p]=this[p]||m[18]<1,this[x]=!0):(M.set([1,0,0,0],u),E.set([0,1,0,0],u),R.set([0,0,1,0],u),b.set([0,0,0,1],u),O.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$f4=this[f],m=_this$f4.color0,M=_this$f4.color1,E=_this$f4.color2,R=_this$f4.color3,b=_this$f4.color4;return[m[u],M[u],E[u],R[u],b[u],m[u+1],M[u+1],E[u+1],R[u+1],b[u+1],m[u+2],M[u+2],E[u+2],R[u+2],b[u+2],m[u+3],M[u+3],E[u+3],R[u+3],b[u+3]];}},{key:"transformColor",value:function transformColor(u,m){var M=this.getColorTransform(u);return M=Object(n.multiply)(M,m),this.setColorTransform(u,M),this;}},{key:"setFillColor",value:function setFillColor(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof m=="string"&&(m=Object(a["default"])(m)),m[3]>0&&(this[v]=!0),this[f].fillColor.set(m.map(function(M){return Math.round(255*M);}),4*u);}},{key:"setStrokeColor",value:function setStrokeColor(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof m=="string"&&(m=Object(a["default"])(m)),m[3]>0&&(this[v]=!0),this[f].strokeColor.set(m.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$f5=this[f],m=_this$f5.fillColor,M=_this$f5.strokeColor,E=[m[u],m[u+1],m[u+2],m[u+3]],R=[M[u],M[u+1],M[u+2],M[u+3]];return E[3]/=255,R[3]/=255,{fill:"rgba(".concat(E.join(),")"),stroke:"rgba(".concat(R.join(),")")};}},{key:"grayscale",value:function grayscale(u,m){this.transformColor(u,Object(n.grayscale)(m)),this._getFilter(u).push("grayscale(".concat(100*m,"%)"));}},{key:"brightness",value:function brightness(u,m){this.transformColor(u,Object(n.brightness)(m)),this._getFilter(u).push("brightness(".concat(100*m,"%)"));}},{key:"saturate",value:function saturate(u,m){this.transformColor(u,Object(n.saturate)(m)),this._getFilter(u).push("saturate(".concat(100*m,"%)"));}},{key:"contrast",value:function contrast(u,m){this.transformColor(u,Object(n.contrast)(m)),this._getFilter(u).push("contrast(".concat(100*m,"%)"));}},{key:"invert",value:function invert(u,m){this.transformColor(u,Object(n.invert)(m)),this._getFilter(u).push("invert(".concat(100*m,"%)"));}},{key:"sepia",value:function sepia(u,m){this.transformColor(u,Object(n.sepia)(m)),this._getFilter(u).push("sepia(".concat(100*m,"%)"));}},{key:"opacity",value:function opacity(u,m){this.transformColor(u,Object(n.opacity)(m)),this._getFilter(u).push("opacity(".concat(100*m,"%)"));}},{key:"hueRotate",value:function hueRotate(u,m){this.transformColor(u,Object(n.hueRotate)(m)),this._getFilter(u).push("hue-rotate(".concat(m,"deg)"));}},{key:"setTransform",value:function setTransform(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=3,m==null&&(m=[1,0,0,1,0,0]);var _this$f6=this[f],M=_this$f6.transform0,E=_this$f6.transform1;return M.set([m[0],m[2],m[4]],u),E.set([m[1],m[3],m[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$f7=this[f],m=_this$f7.transform0,M=_this$f7.transform1;return[m[u],M[u],m[u+1],M[u+1],m[u+2],M[u+2]];}},{key:"getTextureFrame",value:function getTextureFrame(u){return this[P][this[f].frameIndex[u]];}},{key:"setTextureFrames",value:function setTextureFrames(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(u.length>12)throw new Error("Max frames exceed. Allow 12 frames.");u.length&&this[d].setTexture(u[0],m),this[P]=u,this[T]=m;}},{key:"setFrameIndex",value:function setFrameIndex(u,m){if(u>=this[c]||u<0)throw new Error("Out of range.");var M=this[P].length;if(M<=0)throw new Error("No frames");this[f].frameIndex[u]=m%M;}},{key:"amount",get:function get(){return this[c];},set:function set(u){var m=this[c];u!==m&&(u>this[f].bufferSize&&(this[f]=g(Math.max(u,this[f].bufferSize+1e3),this[f])),this[c]=u,u>m&&this.initBuffer(m));}},{key:"meshData",get:function get(){var _this$d$meshData=this[d].meshData,u=_this$d$meshData.attributes,m=_this$d$meshData.cells,M=_this$d$meshData.positions,E=_this$d$meshData.textureCoord,R=_this$d$meshData.uniforms,b=this[P],O={attributes:s({},u),cells:m,positions:M,textureCoord:E,uniforms:s({},R),instanceCount:this[c],enableBlend:this.enableBlend};b.length&&b.forEach(function(G,Z){O.uniforms["u_texFrame".concat(Z)]=G;});var _this$f8=this[f],L=_this$f8.transform0,w=_this$f8.transform1,I=_this$f8.color0,A=_this$f8.color1,W=_this$f8.color2,z=_this$f8.color3,K=_this$f8.color4,k=_this$f8.fillColor,q=_this$f8.strokeColor,U=_this$f8.frameIndex;return this[d].uniforms.u_texSampler&&(O.attributes.a_frameIndex={data:U,divisor:1}),O.attributes.a_transform0={data:L,divisor:1},O.attributes.a_transform1={data:w,divisor:1},O.attributes.a_colorCloud0={data:I,divisor:1},O.attributes.a_colorCloud1={data:A,divisor:1},O.attributes.a_colorCloud2={data:W,divisor:1},O.attributes.a_colorCloud3={data:z,divisor:1},O.attributes.a_colorCloud4={data:K,divisor:1},this.hasCloudColor&&(O.attributes.a_fillCloudColor={data:k,divisor:1},O.attributes.a_strokeCloudColor={data:q,divisor:1}),O;}},{key:"setProgram",value:function setProgram(u){this[d].setProgram(u);}},{key:"program",get:function get(){return this[d].program;}},{key:"transform",value:function transform(u,m){var M=this.getTransform(u);return m=e.mat2d.multiply(Array.of(0,0,0,0,0,0),M,m),this.setTransform(u,m),this;}},{key:"translate",value:function translate(u,_ref38){var _ref39=_slicedToArray(_ref38,2),m=_ref39[0],M=_ref39[1];var E=e.mat2d.create();return E=e.mat2d.translate(Array.of(0,0,0,0,0,0),E,[m,M]),this.transform(u,E);}},{key:"rotate",value:function rotate(u,m){var _ref40=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref41=_slicedToArray(_ref40,2),M=_ref41[0],E=_ref41[1];var R=e.mat2d.create();return R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[M,E]),R=e.mat2d.rotate(Array.of(0,0,0,0,0,0),R,m),R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[-M,-E]),this.transform(u,R);}},{key:"scale",value:function scale(u,_ref42){var _ref43=_slicedToArray(_ref42,2),m=_ref43[0],_ref43$=_ref43[1],M=_ref43$===void 0?m:_ref43$;var _ref44=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref45=_slicedToArray(_ref44,2),E=_ref45[0],R=_ref45[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[E,R]),b=e.mat2d.scale(Array.of(0,0,0,0,0,0),b,[m,M]),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-E,-R]),this.transform(u,b);}},{key:"skew",value:function skew(u,_ref46){var _ref47=_slicedToArray(_ref46,2),m=_ref47[0],_ref47$=_ref47[1],M=_ref47$===void 0?m:_ref47$;var _ref48=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref49=_slicedToArray(_ref48,2),E=_ref49[0],R=_ref49[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[E,R]),b=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,e.mat2d.fromValues(1,Math.tan(M),Math.tan(m),1,0,0)),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-E,-R]),this.transform(u,b);}},{key:"isPointCollision",value:function isPointCollision(u,_ref50){var _this$d;var _ref51=_slicedToArray(_ref50,2),m=_ref51[0],M=_ref51[1];var E=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var R=this.getTransform(u),b=Object(i.transformPoint)([m,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),R));return(_this$d=this[d]).isPointCollision.apply(_this$d,_toConsumableArray(b).concat([E]));}},{key:"isPointInFill",value:function isPointInFill(u,_ref52){var _ref53=_slicedToArray(_ref52,2),m=_ref53[0],M=_ref53[1];return this.isPointCollision(u,[m,M],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(u,_ref54){var _ref55=_slicedToArray(_ref54,2),m=_ref55[0],M=_ref55[1];return this.isPointCollision(u,[m,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 l;}),t.d(r,"sepia",function(){return d;}),t.d(r,"opacity",function(){return c;}),t.d(r,"hueRotate",function(){return p;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(y,P){var T=[],v=y[0],x=y[1],f=y[2],g=y[3],u=y[4],m=y[5],M=y[6],E=y[7],R=y[8],b=y[9],O=y[10],L=y[11],w=y[12],I=y[13],A=y[14],W=y[15],z=y[16],K=y[17],k=y[18],q=y[19];var U=P[0],G=P[1],Z=P[2],nt=P[3],et=P[4];return T[0]=U*v+G*m+Z*O+nt*W,T[1]=U*x+G*M+Z*L+nt*z,T[2]=U*f+G*E+Z*w+nt*K,T[3]=U*g+G*R+Z*I+nt*k,T[4]=U*u+G*b+Z*A+nt*q+et,U=P[5],G=P[6],Z=P[7],nt=P[8],et=P[9],T[5]=U*v+G*m+Z*O+nt*W,T[6]=U*x+G*M+Z*L+nt*z,T[7]=U*f+G*E+Z*w+nt*K,T[8]=U*g+G*R+Z*I+nt*k,T[9]=U*u+G*b+Z*A+nt*q+et,U=P[10],G=P[11],Z=P[12],nt=P[13],et=P[14],T[10]=U*v+G*m+Z*O+nt*W,T[11]=U*x+G*M+Z*L+nt*z,T[12]=U*f+G*E+Z*w+nt*K,T[13]=U*g+G*R+Z*I+nt*k,T[14]=U*u+G*b+Z*A+nt*q+et,U=P[15],G=P[16],Z=P[17],nt=P[18],et=P[19],T[15]=U*v+G*m+Z*O+nt*W,T[16]=U*x+G*M+Z*L+nt*z,T[17]=U*f+G*E+Z*w+nt*K,T[18]=U*g+G*R+Z*I+nt*k,T[19]=U*u+G*b+Z*A+nt*q+et,T;}function i(y){y=Object(e.clamp)(0,1,y);var P=0.2126*y,T=0.7152*y,v=0.0722*y;return[P+1-y,T,v,0,0,P,T+1-y,v,0,0,P,T,v+1-y,0,0,0,0,0,1,0];}function a(y){return[y,0,0,0,0,0,y,0,0,0,0,0,y,0,0,0,0,0,1,0];}function o(y){var P=0.2126*(1-y),T=0.7152*(1-y),v=0.0722*(1-y);return[P+y,T,v,0,0,P,T+y,v,0,0,P,T,v+y,0,0,0,0,0,1,0];}function s(y){var P=0.5*(1-y);return[y,0,0,0,P,0,y,0,0,P,0,0,y,0,P,0,0,0,1,0];}function l(y){var P=1-2*y;return[P,0,0,0,y,0,P,0,0,y,0,0,P,0,y,0,0,0,1,0];}function d(y){return[1-0.607*y,0.769*y,0.189*y,0,0,0.349*y,1-0.314*y,0.168*y,0,0,0.272*y,0.534*y,1-0.869*y,0,0,0,0,0,1,0];}function c(y){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,y,0];}function p(y){var P=y/180*Math.PI,T=Math.cos(P),v=Math.sin(P),x=0.2126,f=0.7152,g=0.0722;return[x+T*(1-x)+v*-x,f+T*-f+v*-f,g+T*-g+v*(1-g),0,0,x+T*-x+v*0.143,f+T*(1-f)+v*0.14,g+T*-g+v*-0.283,0,0,x+T*-x+v*-(1-x),f+T*-f+v*f,g+T*(1-g)+v*g,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,l=e(o);return l.space?(s=Array(3),s[0]=i(l.values[0],0,255),s[1]=i(l.values[1],0,255),s[2]=i(l.values[2],0,255),l.space[0]==="h"&&(s=n.rgb(s)),s.push(i(l.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(l){var d,c=[],p=1,y;if(typeof l=="string"){if(n[l])c=n[l].slice(),y="rgb";else if(l==="transparent")p=0,y="rgb",c=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(l)){var P=l.slice(1),T=P.length,v=T<=4;p=1,v?(c=[parseInt(P[0]+P[0],16),parseInt(P[1]+P[1],16),parseInt(P[2]+P[2],16)],T===4&&(p=parseInt(P[3]+P[3],16)/255)):(c=[parseInt(P[0]+P[1],16),parseInt(P[2]+P[3],16),parseInt(P[4]+P[5],16)],T===8&&(p=parseInt(P[6]+P[7],16)/255)),c[0]||(c[0]=0),c[1]||(c[1]=0),c[2]||(c[2]=0),y="rgb";}else if(d=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(l)){var x=d[1],f=x==="rgb",P=x.replace(/a$/,"");y=P;var T=P==="cmyk"?4:P==="gray"?1:3;c=d[2].trim().split(/\s*,\s*/).map(function(M,E){if(/%$/.test(M))return E===T?parseFloat(M)/100:P==="rgb"?parseFloat(M)*255/100:parseFloat(M);if(P[E]==="h"){if(/deg$/.test(M))return parseFloat(M);if(o[M]!==void 0)return o[M];}return parseFloat(M);}),x===P&&c.push(1),p=f||c[T]===void 0?1:c[T],c=c.slice(0,T);}else l.length>10&&/[0-9](?:\s|\/)/.test(l)&&(c=l.match(/([0-9]+)/g).map(function(u){return parseFloat(u);}),y=l.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(l))y="rgb",c=[l>>>16,(l&65280)>>>8,l&255];else if(i(l)){var g=a(l.r,l.red,l.R,null);g!==null?(y="rgb",c=[g,a(l.g,l.green,l.G),a(l.b,l.blue,l.B)]):(y="hsl",c=[a(l.h,l.hue,l.H),a(l.s,l.saturation,l.S),a(l.l,l.lightness,l.L,l.b,l.brightness)]),p=a(l.a,l.alpha,l.opacity,1),l.opacity!=null&&(p/=100);}else(Array.isArray(l)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(l))&&(c=[l[0],l[1],l[2]],y="rgb",p=l.length===4?l[3]:1);return{space:y,values:c,alpha:p};}}).call(this,t(22));},/* 34 */ /***/function(h,r,t){h.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};},/* 35 */ /***/function(h,r,t){var e=Object.prototype.toString;h.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 */ /***/function(h,r){h.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 */ /***/function(h,r,t){var e=t(38);h.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var i=n[0]/360,a=n[1]/100,o=n[2]/100,s,l,d,c,p;if(a===0)return p=o*255,[p,p,p];o<0.5?l=o*(1+a):l=o+a-o*a,s=2*o-l,c=[0,0,0];for(var y=0;y<3;y++)d=i+1/3*-(y-1),d<0?d++:d>1&&d--,6*d<1?p=s+(l-s)*6*d:2*d<1?p=l:3*d<2?p=s+(l-s)*(2/3-d)*6:p=s,c[y]=p*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),l=Math.max(i,a,o),d=l-s,c,p,y;return l===s?c=0:i===l?c=(a-o)/d:a===l?c=2+(o-i)/d:o===l&&(c=4+(i-a)/d),c=Math.min(c*60,360),c<0&&(c+=360),y=(s+l)/2,l===s?p=0:y<=0.5?p=d/(l+s):p=d/(2-l-s),[c,p*100,y*100];};},/* 38 */ /***/function(h,r,t){h.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 */ /***/function(h,r){h.exports=t;function t(e,n,i){return n<i?e<n?n:e>i?i:e:e<i?i:e>n?n:e;}},/* 40 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return g;});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),l=t(44),d=t(46),c=/* @__PURE__ */t.n(d),p=t(53),y=t(55);t(1).glMatrix.setMatrixArrayType(Array);var P=Symbol("contours"),T=Symbol("path"),v=Symbol("simplify"),x=Symbol("scale"),f=2*Math.PI;var g=/*#__PURE__*/function(){function g(){var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,g);typeof m=="string"&&(m={path:m}),m.path?this[T]=n()(m.path):this[T]=[],this[P]=null,this[v]=m.simplify!=null?m.simplify:0,this[x]=m.scale!=null?m.scale:2;}return _createClass(g,[{key:"contours",get:function get(){var m=null;if(!this[P]&&this[T]){var M=Object(l["default"])(s()(this[T]));this[P]=c()(M,this[x],this[v]),this[P].path=M,this[P].simplify=this[v],this[P].scale=this[x];}return this[P]&&(m=this[P].map(function(M){return _toConsumableArray(M);}),m.path=this[P].path,m.simplify=this[P].simplify,m.scale=this[P].scale),m;}},{key:"path",get:function get(){return this[T];}},{key:"simplify",get:function get(){return this[v];}},{key:"boundingBox",get:function get(){var m=this.contours;if(m&&m.length){var M=m.reduce(function(E,R){return[].concat(_toConsumableArray(E),_toConsumableArray(R));});return a()(M);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var m=this.boundingBox;return m?[0.5*(m[0][0]+m[1][0]),0.5*(m[0][1]+m[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$T;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var E=Object(l["default"])(s()(this[T])).map(function(_ref56){var _ref57=_toArray(_ref56),R=_ref57[0],b=_ref57.slice(1);var O=[R];for(var L=0;L<b.length;L+=2){var w=b[L]-m,I=b[L+1]-M;O.push(w,I);}return O;});return this.beginPath(),(_this$T=this[T]).push.apply(_this$T,_toConsumableArray(E)),this;}},{key:"getPointAtLength",value:function getPointAtLength(m){return this.contours?Object(p.getPointAtLength)(this[P],m):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(p.getTotalLength)(this[P]):0;}},{key:"addPath",value:function addPath(m){var _this$T2;this[P]=null,typeof m=="string"&&(m=n()(m)),(_this$T2=this[T]).push.apply(_this$T2,_toConsumableArray(m));}},{key:"beginPath",value:function beginPath(){this[T]=[],this[P]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(m,M,E,R,b,O,L){var w=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(O+=b,L+=b,E<=0||R<=0||L===O)return;L<O&&(L=O+f+(L-O)%f),L-O>f&&(L=O+f);var I=L-O;I>=f&&(L-=1e-3);var A=this[T].length>0&&I<f?"L":"M";var W=Object(y.getPoint)(m,M,E,R,O),z=Object(y.getPoint)(m,M,E,R,L),K=+!w;var k=I>Math.PI?1:0;w&&(k=1-k),A+=W.join(" "),A+="A".concat(E," ").concat(R," 0 ").concat(k," ").concat(K," ").concat(z.join(" ")),I>=f&&(A+="Z"),this.addPath(A);}},{key:"arc",value:function arc(m,M,E,R,b){var O=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(m,M,E,E,0,R,b,O);}},{key:"arcTo",value:function arcTo(m,M,E,R,b,O,L){this[P]=null,this[T].push(["A",m,M,E,R,b,O,L]);}},{key:"moveTo",value:function moveTo(m,M){this[P]=null,this[T].push(["M",m,M]);}},{key:"lineTo",value:function lineTo(m,M){this[P]=null,this[T].push(["L",m,M]);}},{key:"bezierCurveTo",value:function bezierCurveTo(m,M,E,R,b,O){this[P]=null,this[T].push(["C",m,M,E,R,b,O]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(m,M,E,R){this[P]=null,this[T].push(["Q",m,M,E,R]);}},{key:"rect",value:function rect(m,M,E,R){var b="M".concat(m," ").concat(M,"L").concat(m+E," ").concat(M,"L").concat(m+E," ").concat(M+R,"L").concat(m," ").concat(M+R,"Z");this.addPath(b);}},{key:"closePath",value:function closePath(){this[P]=null;var m=[];var M=this[T].length;M>0&&(m=this[T][M-1]),m[0]!=="Z"&&m[0]!=="z"&&this[T].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(l,d,c){var p=d.toLowerCase();for(c=a(c),p=="m"&&c.length>2&&(s.push([d].concat(c.splice(0,2))),p="l",d=d=="m"?"l":"L");;){if(c.length==t[p])return c.unshift(d),s.push(c);if(c.length<t[p])throw new Error("malformed path data");s.push([d].concat(c.splice(0,t[p])));}}),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(),l=1;l<i;++l)for(var d=n[l],c=0;c<a;++c){var p=d[c];o[c]=Math.min(o[c],p),s[c]=Math.max(s[c],p);}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 l=s[0],d=l.toUpperCase();if(l!=d)switch(s[0]=d,l){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(d){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,l=[],d=0,c=0,p=0,y=0,P=null,T=null,v=0,x=0,f=0,g=o.length;f<g;f++){var u=o[f],m=u[0];switch(m){case"M":p=u[1],y=u[2];break;case"A":var M=Object(e["default"])(v,x,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!M.length)continue;M=M.map(function(L){var _L7=_slicedToArray(L,8),w=_L7[0],I=_L7[1],A=_L7[2],W=_L7[3],z=_L7[4],K=_L7[5],k=_L7[6],q=_L7[7];return{x1:A,y1:W,x2:z,y2:K,x:k,y:q};});for(var E=0,R;E<M.length;E++)R=M[E],u=["C",R.x1,R.y1,R.x2,R.y2,R.x,R.y],E<M.length-1&&l.push(u);break;case"S":var b=v,O=x;(s=="C"||s=="S")&&(b+=b-d,O+=O-c),u=["C",b,O,u[1],u[2],u[3],u[4]];break;case"T":s=="Q"||s=="T"?(P=v*2-P,T=x*2-T):(P=v,T=x),u=a(v,x,P,T,u[1],u[2]);break;case"Q":P=u[1],T=u[2],u=a(v,x,u[1],u[2],u[3],u[4]);break;case"L":u=i(v,x,u[1],u[2]);break;case"H":u=i(v,x,u[1],x);break;case"V":u=i(v,x,v,u[1]);break;case"Z":u=i(v,x,p,y);break;}s=m,v=u[u.length-2],x=u[u.length-1],u.length>4?(d=u[u.length-4],c=u[u.length-3]):(d=v,c=x),l.push(u);}return l;}function i(o,s,l,d){return["C",o,s,l,d,l,d];}function a(o,s,l,d,c,p){return["C",o/3+2/3*l,s/3+2/3*d,c/3+2/3*l,p/3+2/3*d,c,p];}},/* 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,l,d,c){var p=s*c-l*d<0?-1:1;var y=s*d+l*c;return y>1&&(y=1),y<-1&&(y=-1),p*Math.acos(y);}function i(s,l,d,c,p,y,P,T,v,x){var f=x*(s-d)/2+v*(l-c)/2,g=-v*(s-d)/2+x*(l-c)/2,u=P*P,m=T*T,M=f*f,E=g*g;var R=u*m-u*E-m*M;R<0&&(R=0),R/=u*E+m*M,R=Math.sqrt(R)*(p===y?-1:1);var b=R*P/T*g,O=R*-T/P*f,L=x*b-v*O+(s+d)/2,w=v*b+x*O+(l+c)/2,I=(f-b)/P,A=(g-O)/T,W=(-f-b)/P,z=(-g-O)/T,K=n(1,0,I,A);var k=n(I,A,W,z);return y===0&&k>0&&(k-=e),y===1&&k<0&&(k+=e),[L,w,K,k];}function a(s,l){var d=1.3333333333333333*Math.tan(l/4),c=Math.cos(s),p=Math.sin(s),y=Math.cos(s+l),P=Math.sin(s+l);return[c,p,c-p*d,p+c*d,y+P*d,P-y*d,y,P];}function o(s,l,d,c,p,y,P,T,v){var x=Math.sin(v*e/360),f=Math.cos(v*e/360),g=f*(s-d)/2+x*(l-c)/2,u=-x*(s-d)/2+f*(l-c)/2;if(g===0&&u===0)return[];if(P===0||T===0)return[];P=Math.abs(P),T=Math.abs(T);var m=g*g/(P*P)+u*u/(T*T);m>1&&(P*=Math.sqrt(m),T*=Math.sqrt(m));var M=i(s,l,d,c,p,y,P,T,x,f),E=[];var R=M[2],b=M[3];var O=Math.max(Math.ceil(Math.abs(b)/(e/4)),1);b/=O;for(var L=0;L<O;L++)E.push(a(R,b)),R+=b;return E.map(function(L){for(var w=0;w<L.length;w+=2){var I=L[w+0],A=L[w+1];I*=P,A*=T;var W=f*I-x*A,z=x*I+f*A;L[w+0]=W+M[0],L[w+1]=z+M[1];}return L;});}},/* 46 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(47),_t2=t(49),n=_t2.copy,i=t(50);function a(c,p,y){return c[0]=p,c[1]=y,c;}var o=[0,0],s=[0,0],l=[0,0];function d(c,p,y,P){e(y,a(o,P[1],P[2]),a(s,P[3],P[4]),a(l,P[5],P[6]),p,c);}h.exports=function(p,y,P){var T=[],v=[],x=[0,0];return p.forEach(function(f,g,u){if(f[0]==="M")n(x,f.slice(1)),v.length>0&&(T.push(v),v=[]);else if(f[0]==="C")d(v,y,x,f),a(x,f[5],f[6]);else throw new Error("illegal type in SVG: "+f[0]);}),v.length>0&&T.push(v),T.map(function(f){return i(f,P||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,l=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,d=i.angleTolerance||0,c=i.cuspLimit||0;return function(T,v,x,f,g,u){u||(u=[]),g=typeof g=="number"?g:1;var m=s/g;return m*=m,p(T,v,x,f,u,m),u;};function p(P,T,v,x,f,g){f.push(t(P));var u=P[0],m=P[1],M=T[0],E=T[1],R=v[0],b=v[1],O=x[0],L=x[1];y(u,m,M,E,R,b,O,L,f,g,0),f.push(t(x));}function y(P,T,v,x,f,g,u,m,M,E,R){if(!(R>a)){var b=Math.PI,O=(P+v)/2,L=(T+x)/2,w=(v+f)/2,I=(x+g)/2,A=(f+u)/2,W=(g+m)/2,z=(O+w)/2,K=(L+I)/2,k=(w+A)/2,q=(I+W)/2,U=(z+k)/2,G=(K+q)/2;if(R>0){var Z=u-P,nt=m-T,et=Math.abs((v-u)*nt-(x-m)*Z),tt=Math.abs((f-u)*nt-(g-m)*Z),J,ht;if(et>o&&tt>o){if((et+tt)*(et+tt)<=E*(Z*Z+nt*nt)){if(d<l){M.push(e(U,G));return;}var dt=Math.atan2(g-x,f-v);if(J=Math.abs(dt-Math.atan2(x-T,v-P)),ht=Math.abs(Math.atan2(m-g,u-f)-dt),J>=b&&(J=2*b-J),ht>=b&&(ht=2*b-ht),J+ht<d){M.push(e(U,G));return;}if(c!==0){if(J>c){M.push(e(v,x));return;}if(ht>c){M.push(e(f,g));return;}}}}else if(et>o){if(et*et<=E*(Z*Z+nt*nt)){if(d<l){M.push(e(U,G));return;}if(J=Math.abs(Math.atan2(g-x,f-v)-Math.atan2(x-T,v-P)),J>=b&&(J=2*b-J),J<d){M.push(e(v,x)),M.push(e(f,g));return;}if(c!==0&&J>c){M.push(e(v,x));return;}}}else if(tt>o){if(tt*tt<=E*(Z*Z+nt*nt)){if(d<l){M.push(e(U,G));return;}if(J=Math.abs(Math.atan2(m-g,u-f)-Math.atan2(g-x,f-v)),J>=b&&(J=2*b-J),J<d){M.push(e(v,x)),M.push(e(f,g));return;}if(c!==0&&J>c){M.push(e(f,g));return;}}}else if(Z=U-(P+u)/2,nt=G-(T+m)/2,Z*Z+nt*nt<=E){M.push(e(U,G));return;}}y(P,T,O,L,z,K,U,G,M,E,R+1),y(U,G,k,q,A,W,u,m,M,E,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 l;}),t.d(r,"cross",function(){return d;}),t.d(r,"sub",function(){return c;}),t.d(r,"add",function(){return p;}),t.d(r,"computeMiter",function(){return v;}),t.d(r,"normal",function(){return x;}),t.d(r,"direction",function(){return f;});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(g){return[g[0],g[1]];}function i(){return[0,0];}var a=e.vec2.copy,o=e.vec2.scaleAndAdd,s=e.vec2.dot,l=e.vec2.rotate,d=e.vec2.cross,c=e.vec2.sub,p=e.vec2.add,y=e.vec2.normalize,P=e.vec2.set,T=i();function v(g,u,m,M,E){p(g,m,M),y(g,g),P(u,-g[1],g[0]),P(T,-m[1],m[0]);var R=E/s(u,T);return Math.abs(R);}function x(g,u){return P(g,-u[1],u[0]),g;}function f(g,u,m){return c(g,u,m),y(g,g),g;}},/* 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],l,d=1,c=n.length;d<c;d++)l=n[d],t(l,o)>a&&(s.push(l),o=l);return o!==l&&s.push(l),s;};},/* 52 */ /***/function(h,r){function t(n,i,a){var o=i[0],s=i[1],l=a[0]-o,d=a[1]-s;if(l!==0||d!==0){var c=((n[0]-o)*l+(n[1]-s)*d)/(l*l+d*d);c>1?(o=a[0],s=a[1]):c>0&&(o+=l*c,s+=d*c);}return l=n[0]-o,d=n[1]-s,l*l+d*d;}function e(n,i,a,o,s){for(var l=o,d,c=i+1;c<a;c++){var p=t(n[c],n[i],n[a]);p>l&&(d=c,l=p);}l>o&&(d-i>1&&e(n,i,d,o,s),s.push(n[d]),a-d>1&&e(n,d,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,l=[i[0]];return e(i,0,s,o,l),l.push(i[s]),l;};},/* 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 l=0;return s.forEach(function(d){var c=d[0];for(var p=1;p<d.length;p++){var y=d[p];l+=Object(e.distance)(c,y),c=y;}}),s.totalLength=l,l;}function i(s,l){var d=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(l=Number(l),!Number.isFinite(l))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(l<=0)throw new TypeError("Length must > 0");var c=n(s);if(l>=c){var y=s[s.length-1],P=y[y.length-2],T=y[y.length-1],v=Math.atan2(T[1]-P[1],T[0]-P[0]);return{current:s.map(function(x){return _toConsumableArray(x);}),point:{x:T[0],y:T[1],angle:v}};}var p=[];for(var _y2=0;_y2<s.length;_y2++){p[_y2]=[];var _P=s[_y2];var _T2=_P[0];for(var _v4=1;_v4<_P.length;_v4++){var _x25=_P[_v4],_f9=Object(e.distance)(_T2,_x25);if(l<_f9){var g=l/_f9,u=Math.atan2(_x25[1]-_T2[1],_x25[0]-_T2[0]),m={x:_T2[0]*(1-g)+_x25[0]*g,y:_T2[1]*(1-g)+_x25[1]*g,angle:u};if(p[_y2].push(_T2),l>0&&p[_y2].push([m.x,m.y]),!d)return{current:p,point:m};var M=[],E=_y2;for(;_y2<s.length;_y2++){for(M[_y2-E]=[],_y2===E&&M[0].push([m.x,m.y]);_v4<_P.length;_v4++)M[_y2-E].push(_P[_v4]);_v4=0;}return{current:p,point:m,rest:M};}l-=_f9,p[_y2].push(_T2),_T2=_x25;}}}function a(s,l){if(l=Number(l),!Number.isFinite(l))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(l<=0){var d=s[0][0],c=s[0][1],p=Math.atan2(c[1]-d[1],c[0]-d[0]);return{x:d[0],y:d[1],angle:p};}return i(s,l,!1).point;}function o(s,l,d){var c=0,p=l[0],y=s;var P=[],T=l.length;if(d>0){do d-=l[c%T],c++;while(d>0);d<0&&(p=-d,c--);}else if(d<0){c=-1;do d+=l[c%T+T-1],c--;while(d<0);d>=0&&(c++,p=l[c%T+T-1]-d);}do{var v=i(y,p);y=v.rest,++c%2&&P.push.apply(P,_toConsumableArray(v.current));var _x26=c%T;_x26<0&&(_x26+=T),p=l[_x26];}while(y);return P;}},/* 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,l,d){var _ref59=_slicedToArray(_ref58,3),i=_ref59[0],a=_ref59[1],o=_ref59[2];return i=i*2/s-1,a=1-a*2/l,Number.isFinite(d)?(o=o*2/d-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],l=_ref63[1],_ref63$=_ref63[2],d=_ref63$===void 0?0:_ref63$;return Math.hypot(s-i,l-a,d-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,l){l%=e,l<0&&(l+=e);var d=Math.tan(l);if(Math.abs(d)<1e5){var c=a-d*i,p=1/Math.pow(o,2)+Math.pow(d,2)/Math.pow(s,2);var y=-1;(l<=Math.PI/2||l>3*Math.PI/2)&&(y=1);var P=y*Math.sqrt(1/p)+i,T=d*P+c;return[P,T];}return l<Math.PI?[i,a+s]:[i,a-s];}},/* 56 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return Y;});var e=t(1),n=t(42),i=/* @__PURE__ */t.n(n),a=t(57),o=t(28),s=t(24),l=t(30),d=t(59),c=t(53),p=t(60),y=/* @__PURE__ */t.n(p),P=t(46),T=/* @__PURE__ */t.n(P),v=t(31),x=t(40),f=t(21);t(1).glMatrix.setMatrixArrayType(Array);function g(X,N){if(X==null)return{};var $=u(X,N),S,C;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(X);for(C=0;C<D.length;C++)S=D[C],!(N.indexOf(S)>=0)&&Object.prototype.propertyIsEnumerable.call(X,S)&&($[S]=X[S]);}return $;}function u(X,N){if(X==null)return{};var $={},S=Object.keys(X),C,D;for(D=0;D<S.length;D++)C=S[D],!(N.indexOf(C)>=0)&&($[C]=X[C]);return $;}var m=Symbol("mesh"),M=Symbol("contours"),E=Symbol("stroke"),R=Symbol("fill"),b=Symbol("strokeColor"),O=Symbol("fillColor"),L=Symbol("transform"),w=Symbol("invertTransform"),I=Symbol("uniforms"),A=Symbol("texOptions"),W=Symbol("blend"),z=Symbol("applyTexture"),K=Symbol("applyTransform"),k=Symbol("applyGradientTransform"),q=Symbol("applyProgram"),U=Symbol("gradient"),G=Symbol("filter"),Z=Symbol("opacity"),nt=Symbol("program"),et=Symbol("attributes"),tt=Symbol("pass"),J=Symbol("clipContext"),ht=Symbol("applyClipPath");function dt(X,N){var $=X[1][0]-X[0][0],S=X[1][1]-X[0][1],C=[];for(var D=0;D<N.length;D++){var j=N[D],H=[(j[0]-X[0][0])/$,1-(j[1]-X[0][1])/S];C.push(H);}return C;}function B(_ref64,_ref65,_ref66){var _ref67=_slicedToArray(_ref64,2),X=_ref67[0],N=_ref67[1];var _ref68=_slicedToArray(_ref65,4),$=_ref68[0],S=_ref68[1],C=_ref68[2],D=_ref68[3];var j=_ref66.scale;return j||(X/=C,N=1-N/D,X-=$,N+=S),[X,N,0];}function F(X,N,$){var S=T()(X,N,$);return S.path=X,S.simplify=$,S.scale=N,S;}var Y=/*#__PURE__*/function(){function Y(N){_classCallCheck(this,Y);this[E]=null,this[R]=null,this[L]=[1,0,0,1,0,0],this[Z]=1,this[I]={},this[G]=[],this[W]=null,this[A]={},this.contours=N.contours,this[nt]=null,this[et]={},this[tt]=[];}return _createClass(Y,[{key:"contours",get:function get(){return this[M];},set:function set(N){this[m]=null,this[M]=N;var $=N.scale;this.transformScale/$>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[nt]=N,this[m]&&this[q](N);}},{key:"program",get:function get(){return this[nt];}},{key:"setAttribute",value:function setAttribute(N,$){$==null?delete this[et][N]:this[et][N]=$;}},{key:"getOpacity",value:function getOpacity(){return this[Z];}},{key:"setOpacity",value:function setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[m]&&this[m].positions.forEach(function($){$[2]=1/$[2]>0?N:-N;}),this[Z]=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[m]&&delete this[m].attributes.a_clipUV,N&&this[m]&&this[ht]();}},{key:ht,value:function value(){if(this.clipPath){this[J]||(this[J]=f["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),N=_this$boundingBox$[0],$=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),S=_this$boundingBox$2[0],C=_this$boundingBox$2[1];S&&C&&(this[J].width=S-N,this[J].height=C-$);var D=this[J].getContext("2d"),j=new Path2D(this.clipPath);D.clearRect(0,0,this[J].width,this[J].height),D.save(),D.translate(-N,-$),D.fillStyle="white",D.fill(j),D.restore(),this[m].clipPath=this[J];var H=dt(this.boundingBox,this[m].position0);this[m].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];},set:function set(N){this[W]=N,this[m]&&(this[m].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[m]&&this[m].boundingBox)return this[m].boundingBox;var N=this.meshData;if(N){var $=N.position0;if($.length)N.boundingBox=i()($);else return[[0,0],[0,0]];return N.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var N=this.boundingBox;return N?[0.5*(N[0][0]+N[1][0]),0.5*(N[0][1]+N[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[R]?this[R].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[E]?this[E].lineWidth:0;}},{key:"lineCap",get:function get(){return this[E]?this[E].lineCap:"";}},{key:"lineJoin",get:function get(){return this[E]?this[E].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[E]?this[E].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[E]?this[E].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[E]?this[E].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[O]&&this[O][3]!==0?Object(s["default"])(this[O]):"";}},{key:"gradient",get:function get(){return this[U];}},{key:"texture",get:function get(){return this[I].u_texSampler?{image:this[I].u_texSampler._img,options:this[A]}:null;}},{key:"enableBlend",get:function get(){return this[W]===!0||this[W]===!1?this[W]:this[Z]<1||this[b]!=null&&this[b][3]<1||this[O]!=null&&this[O][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[G].join(" ");}},{key:"transformMatrix",get:function get(){return this[L];}},{key:"invertMatrix",get:function get(){if(!this[w]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[w]=N;}return this[w];}},{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[tt];}},{key:q,value:function value(N){var $=this[et],S=this[m].position0,C=Object.entries(N._attribute);for(var D=0;D<C.length;D++){var _C$D=_slicedToArray(C[D],2),j=_C$D[0],H=_C$D[1];if(j!=="a_color"&&j!=="a_sourceRect"&&H!=="ignored"){var V=$[j];if(j==="uv"&&!V){var Q=this[m].boundingBox||i()(S);this[m].attributes[j]=dt(Q,S);}else{this[m].attributes[j]=[];for(var _Q=0;_Q<S.length;_Q++){var it=S[_Q];this[m].attributes[j].push(V?V(it,D,S):Array(H.size).fill(0));}}}}}// {stroke, fill}
|
|
47
|
+
},{key:"meshData",get:function get(){var _this20=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[m]){!this[R]&&!this[E]&&this.setFill();var N=this[M],$={};if(N&&N.length){if(this[R])try{var D=y()(N,this[R]);D.positions=D.positions.map(function(j){return j.push(_this20[Z]),j;}),D.attributes={a_color:Array.from({length:D.positions.length}).map(function(){return _this20[O].map(function(j){return Math.round(255*j);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
|
|
48
|
+
},$.fill=D;}catch(_unused3){}if(this[E]){var _D=this[E].lineDash;var j=N;if(_D){var V=this[E].lineDashOffset;j=Object(c.getDashContours)(N,_D,V);}var H=j.map(function(V,Q){var it=V.length>1&&e.vec2.equals(V[0],V[V.length-1]),st=_this20[E].build(V,it);return y()([st]);});H.forEach(function(V){V.positions=V.positions.map(function(Q){return Q.push(-_this20[Z]),Q;}),V.attributes={a_color:Array.from({length:V.positions.length}).map(function(){return _this20[b].map(function(Q){return Math.round(255*Q);});})};}),$.stroke=Object(o["default"])(H);}}var S=Object(o["default"])([$.fill,$.stroke]);S.fillPointCount=$.fill?$.fill.positions.length:0,S.enableBlend=this.enableBlend,S.position0=S.positions.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),D=_ref70[0],j=_ref70[1],H=_ref70[2];return[D,j,H];}),S.uniforms=this[I],this[m]=S,this[I].u_texSampler&&this[z](S,this[A]);var C=this[L];Object(d.isUnitTransform)(C)||(this[K](S,C),this[I].u_radialGradientVector&&this[k]()),this.clipPath&&this[ht](),this[nt]&&this[q](this[nt]);}return this._updateMatrix&&(this[m].matrix=this[L],this[K](this[m],this[L]),this[I].u_radialGradientVector&&this[k]()),this[m];}},{key:K,value:function value(N,$){var S=N.positions,C=N.position0;for(var D=0;D<S.length;D++){var _C$D2=_slicedToArray(C[D],2),j=_C$D2[0],H=_C$D2[1],V=S[D];V[0]=j*$[0]+H*$[2]+$[4],V[1]=j*$[1]+H*$[3]+$[5];}this._updateMatrix=!1;}},{key:k,value:function value(){var N=this[L],$=_toConsumableArray(this._radialGradientVector);if($){var _$=_slicedToArray($,5),S=_$[0],C=_$[1],D=_$[3],j=_$[4];$[0]=S*N[0]+C*N[2]+N[4],$[1]=S*N[1]+C*N[3]+N[5],$[3]=D*N[0]+j*N[2]+N[4],$[4]=D*N[1]+j*N[3]+N[5],this[I].u_radialGradientVector=$;}}},{key:z,value:function value(N,$){function S(Q,it){return Q==null&&it==null?!0:Q==null||it==null?!1:Q[0]===it[0]&&Q[1]===it[1]&&Q[2]===it[2]&&Q[3]===it[3];}var C=this[I].u_texSampler;if(!C)return;var _C$_img=C._img,D=_C$_img.width,j=_C$_img.height,H=$.srcRect;var V=$.rect||[0,0];if($.rotated&&(V=[-V[1],V[0],V[3],V[2]]),V[2]==null&&(V[2]=H?H[2]:D),V[3]==null&&(V[3]=H?H[3]:j),$.hidden)N.textureCoord=N.positions.map(function(){return[-1,-1,-1];});else if(!N.textureCoord||!S(this[A].rect,$.rect)||this[A].hidden!==$.hidden||this[A].rotated!==$.rotated){var Q=null;$.rotated&&(Q=e.mat2d.rotate(Array.of(0,0,0,0,0,0),e.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),Q=e.mat2d.translate(Array.of(0,0,0,0,0,0),Q,[0,-V[2]])),N.textureCoord=N.position0.map(function(_ref71){var _ref72=_slicedToArray(_ref71,3),it=_ref72[0],st=_ref72[1],ct=_ref72[2];if(1/ct>0){if($.rotated){var at=it*Q[0]+st*Q[2]+Q[4],ot=it*Q[1]+st*Q[3]+Q[5];it=at;st=ot;}var gt=B([it,st],[V[0]/V[2],V[1]/V[3],V[2],V[3]],$);return $.repeat&&(gt[2]=1),gt;}return[-1,-1,-1];});}if(H){var _Q2=[H[0]/D,H[1]/j,H[2]/D,H[3]/j];N.attributes.a_sourceRect=N.positions.map(function(){return[].concat(_Q2);});}else N.attributes.a_sourceRect=N.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(N){if(!this.contours)return;if(this.contours.path){var S=this.contours.simplify,C=F(this.contours.path,2*N,S);this[m]=null,this[M]=C;}}},{key:"canIgnore",value:function canIgnore(){var N=this[E]==null||this[E].lineWidth===0||this[b][3]===0,$=this[R]==null||this[O][3]===0,S=this[I].u_radialGradientVector==null,C=this[I].u_texSampler==null;return this[Z]===0||this[nt]==null&&N&&$&&S&&C&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
|
|
49
|
+
// cap: 'butt' or 'square'
|
|
50
|
+
// lineDash: null
|
|
51
|
+
// lineDashOffset: 0
|
|
52
|
+
},{key:"setStroke",value:function setStroke(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$thickness=_ref73.thickness,N=_ref73$thickness===void 0?1:_ref73$thickness,_ref73$cap=_ref73.cap,$=_ref73$cap===void 0?"butt":_ref73$cap,_ref73$join=_ref73.join,S=_ref73$join===void 0?"miter":_ref73$join,_ref73$miterLimit=_ref73.miterLimit,C=_ref73$miterLimit===void 0?10:_ref73$miterLimit,_ref73$color=_ref73.color,D=_ref73$color===void 0?[0,0,0,0]:_ref73$color,_ref73$lineDash=_ref73.lineDash,j=_ref73$lineDash===void 0?null:_ref73$lineDash,_ref73$lineDashOffset=_ref73.lineDashOffset,H=_ref73$lineDashOffset===void 0?0:_ref73$lineDashOffset,_ref73$roundSegments=_ref73.roundSegments,V=_ref73$roundSegments===void 0?20:_ref73$roundSegments;return this[m]=null,this[E]=new a["default"]({lineWidth:N,lineCap:$,lineJoin:S,miterLimit:C,roundSegments:V}),typeof D=="string"&&(D=Object(v["default"])(D)),this[b]=D,this[E].lineDash=j,this[E].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,$=_ref74$color===void 0?[0,0,0,0]:_ref74$color;return this[m]=null,this[R]={rule:N},typeof $=="string"&&($=Object(v["default"])($)),this[O]=$,this;}/**
|
|
53
|
+
options: {
|
|
54
|
+
scale: false,
|
|
55
|
+
repeat: false,
|
|
56
|
+
rotated: false,
|
|
57
|
+
rect: [10, 10],
|
|
58
|
+
srcRect: [...],
|
|
59
|
+
hidden: false,
|
|
60
|
+
}
|
|
61
|
+
*/},{key:"setTexture",value:function setTexture(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(N&&N.image){var _N=N,S=_N.image,C=_N.rect;if(N=S,$.rect)for(var D=0;D<$.rect.length;D++)C[D]=$.rect[D];$.rect=C;}return this[R]||this.setFill(),this.setUniforms({u_texSampler:N}),this[m]&&this[z](this[m],$),this[A]=$,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref75.vector,$=_ref75.colors,_ref75$type=_ref75.type,S=_ref75$type===void 0?"fill":_ref75$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref76.vector,$=_ref76.colors,_ref76$type=_ref76.type,S=_ref76$type===void 0?"fill":_ref76$type;if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref77.vector,$=_ref77.colors,_ref77$type=_ref77.type,S=_ref77$type===void 0?"fill":_ref77$type;if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:$,type:S});}/**
|
|
62
|
+
vector: [x0, y0, r0, x1, y1, r1],
|
|
63
|
+
colors: [{offset:0, color}, {offset:1, color}, ...],
|
|
64
|
+
*/},{key:"setGradient",value:function setGradient(){var _ref78=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref78.vector,$=_ref78.colors,_ref78$type=_ref78.type,S=_ref78$type===void 0?"fill":_ref78$type;$=$.map(function(_ref79){var j=_ref79.offset,H=_ref79.color;return typeof H=="string"&&(H=Object(v["default"])(H)),{offset:j,color:H};}),this[U]=this[U]||{},this[U][S]={vector:N,colors:$},$.sort(function(j,H){return j.offset-H.offset;});var C=[];$.forEach(function(_ref80){var j=_ref80.offset,H=_ref80.color;C.push.apply(C,[j].concat(_toConsumableArray(H)));});var D;if(N.length===4?D=[N[0],N[1],0,N[2],N[3],0]:D=_toConsumableArray(N),C.length<40&&C.push(-1),C.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=D,this[I].u_colorSteps=C,S==="fill"?this[I].u_gradientType=1:this[I].u_gradientType=0,this[k](),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 $=this[L];for(var _len3=arguments.length,N=new Array(_len3),_key3=0;_key3<_len3;_key3++){N[_key3]=arguments[_key3];}return e.mat2d.equals(N,$)||(this[L]=N,delete this[w],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var $=this[L];for(var _len4=arguments.length,N=new Array(_len4),_key4=0;_key4<_len4;_key4++){N[_key4]=arguments[_key4];}return this[L]=e.mat2d.multiply(Array.of(0,0,0,0,0,0),$,N),delete this[w],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(N,$){var S=e.mat2d.create();return S=e.mat2d.translate(Array.of(0,0,0,0,0,0),S,[N,$]),this.transform.apply(this,_toConsumableArray(S));}},{key:"rotate",value:function rotate(N){var _ref81=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref82=_slicedToArray(_ref81,2),$=_ref82[0],S=_ref82[1];var C=e.mat2d.create();return C=e.mat2d.translate(Array.of(0,0,0,0,0,0),C,[$,S]),C=e.mat2d.rotate(Array.of(0,0,0,0,0,0),C,N),C=e.mat2d.translate(Array.of(0,0,0,0,0,0),C,[-$,-S]),this.transform.apply(this,_toConsumableArray(C));}},{key:"scale",value:function scale(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref83=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref84=_slicedToArray(_ref83,2),S=_ref84[0],C=_ref84[1];var D=e.mat2d.create();return D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[S,C]),D=e.mat2d.scale(Array.of(0,0,0,0,0,0),D,[N,$]),D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-S,-C]),this.transform.apply(this,_toConsumableArray(D));}},{key:"skew",value:function skew(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref85=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref86=_slicedToArray(_ref85,2),S=_ref86[0],C=_ref86[1];var D=e.mat2d.create();return D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[S,C]),D=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,e.mat2d.fromValues(1,Math.tan($),Math.tan(N),1,0,0)),D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-S,-C]),this.transform.apply(this,_toConsumableArray(D));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[G].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,N=new Array(_len5),_key5=0;_key5<_len5;_key5++){N[_key5]=arguments[_key5];}return N[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:N}),this;}// apply linear color transform
|
|
65
|
+
},{key:"transformColor",value:function transformColor(){var $=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,N=new Array(_len6),_key6=0;_key6<_len6;_key6++){N[_key6]=arguments[_key6];}return $?$=Object(l.multiply)($,N):$=N,this.setColorTransform.apply(this,_toConsumableArray($)),this;}},{key:"blur",value:function blur(N){return this[G].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("brightness(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.brightness)(N)));}},{key:"contrast",value:function contrast(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var C=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(C)&&(C=Object(s["default"])(C)),this[G].push("drop-shadow(".concat(N,"px ").concat($,"px ").concat(S,"px ").concat(C,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("grayscale(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.grayscale)(N)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
|
|
66
|
+
},{key:"hueRotate",value:function hueRotate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[G].push("hue-rotate(".concat(N,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(l.hueRotate)(N)));}},{key:"invert",value:function invert(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("invert(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.invert)(N)));}},{key:"opacity",value:function opacity(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("opacity(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.opacity)(N)));}},{key:"saturate",value:function saturate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("saturate(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.saturate)(N)));}},{key:"sepia",value:function sepia(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(l.sepia)(N)));}},{key:"url",value:function url(N){return this[G].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var C=this.meshData,D=C.positions,j=C.cells,H=this.invertMatrix,V=H[0]*N+H[2]*$+H[4],Q=H[1]*N+H[3]*$+H[5],it=this.boundingBox;if(V<it[0][0]||V>it[1][0]||Q<it[0][1]||Q>it[1][1])return!1;function st(_ref87,_ref88,_ref89){var _ref90=_slicedToArray(_ref87,2),ct=_ref90[0],gt=_ref90[1];var _ref91=_slicedToArray(_ref88,2),at=_ref91[0],ot=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ft=_ref92[0],mt=_ref92[1];var yt=ft-at,pt=mt-ot,Tt=((ct-at)*yt+(gt-ot)*pt)/(Math.pow(yt,2)+Math.pow(pt,2));return Tt>=0&&Tt<=1;}for(var ct=0;ct<j.length;ct++){var gt=j[ct];if(S==="fill"&>[0]>=C.fillPointCount)break;if(S==="stroke"&>[0]<C.fillPointCount)continue;var _gt$map=gt.map(function(Et){return D[Et];}),_gt$map2=_slicedToArray(_gt$map,3),_gt$map2$=_slicedToArray(_gt$map2[0],2),at=_gt$map2$[0],ot=_gt$map2$[1],_gt$map2$2=_slicedToArray(_gt$map2[1],2),ft=_gt$map2$2[0],mt=_gt$map2$2[1],_gt$map2$3=_slicedToArray(_gt$map2[2],2),yt=_gt$map2$3[0],pt=_gt$map2$3[1],Tt=Math.sign((N-at)*(mt-ot)-(ft-at)*($-ot));if(Tt===0&&st([N,$],[at,ot],[ft,mt]))return!0;var It=Math.sign((N-ft)*(pt-mt)-(yt-ft)*($-mt));if(It===0&&st([N,$],[ft,mt],[yt,pt]))return!0;var Ot=Math.sign((N-yt)*(ot-pt)-(at-yt)*($-pt));if(Ot===0&&st([N,$],[yt,pt],[at,ot])||Tt===1&&It===1&&Ot===1||Tt===-1&&It===-1&&Ot===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(N,$){return this.isPointCollision(N,$,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(N,$){return this.isPointCollision(N,$,"stroke");}},{key:"addPass",value:function addPass(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var S=$.width,C=$.height,D=g($,["width","height"]);var j=new x["default"]();j.rect(0,0,S,C);var H=new Y(j,{width:S,height:C});H.setUniforms(D),H.setProgram(N),this[tt].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 d;});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)(),l=1e20;var d=/*#__PURE__*/function(){function d(){var _ref93=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref93$lineWidth=_ref93.lineWidth,T=_ref93$lineWidth===void 0?1:_ref93$lineWidth,_ref93$lineJoin=_ref93.lineJoin,v=_ref93$lineJoin===void 0?"miter":_ref93$lineJoin,_ref93$miterLimit=_ref93.miterLimit,x=_ref93$miterLimit===void 0?10:_ref93$miterLimit,_ref93$lineCap=_ref93.lineCap,f=_ref93$lineCap===void 0?"butt":_ref93$lineCap,_ref93$roundSegments=_ref93.roundSegments,g=_ref93$roundSegments===void 0?20:_ref93$roundSegments;_classCallCheck(this,d);this.lineWidth=T,this.lineJoin=v,this.miterLimit=x,this.lineCap=f,this.roundSegments=g,this._normal=null;}return _createClass(d,[{key:"build",value:function build(T){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var x=T.length;if(T=_toConsumableArray(T),x<2)return T;v&&((T[0][0]!==T[x-1][0]||T[0][1]!==T[x-1][1])&&T.push(_toConsumableArray(T[0])),T.push(_toConsumableArray(T[1]))),x=T.length,this._normal=null;var f={left:[],right:[]},g=this.lineWidth/2,u=this.lineCap;if(!v&&u==="square"){Object(e.direction)(i,T[0],T[1]),Object(e.scaleAndAdd)(T[0],T[0],i,g);var M=T.length-1;Object(e.direction)(i,T[M],T[M-1]),Object(e.scaleAndAdd)(T[M],T[M],i,g);}for(var _M4=1;_M4<x;_M4++){var E=T[_M4-1],R=T[_M4],b=T[_M4+1];this._seg(f,E,R,b,g,v);}return!v&&u==="round"&&y(f,this.roundSegments),[].concat(_toConsumableArray(f.left),_toConsumableArray(f.right.reverse()));}},{key:"_seg",value:function _seg(T,v,x,f,g,u){var m=this.lineJoin==="bevel",M=this.lineJoin==="round";if(Object(e.direction)(i,x,v),this._normal||(this._normal=Object(e.create)(),Object(e.normal)(this._normal,i)),T.left.length||p(T,v,this._normal,g),!f)Object(e.normal)(this._normal,i),u?p(T,v,this._normal,g):p(T,x,this._normal,g);else{Object(e.direction)(a,f,x);var E=Object(e.computeMiter)(o,s,i,a,g);E=Math.min(E,l);var R=Object(e.dot)(o,this._normal)<0?-1:1;var b=m||M;if(!b&&this.lineJoin==="miter"&&E/g>this.miterLimit&&(b=!0),b){Object(e.scaleAndAdd)(n,x,this._normal,-g*R),c(T,n,R);var O=1/0;v&&(O=Math.min(O,Math.hypot(x[0]-v[0],x[1]-v[1]))),f&&(O=Math.min(O,Math.hypot(f[0]-x[0],f[1]-x[1])));var L=Math.max(g,Math.min(E,O));if(Object(e.scaleAndAdd)(n,x,s,L*R),c(T,n,-R),f)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,x,n,-g*R),M){var w=Object(e.clone)(n),I=R>0?T.left[T.left.length-1]:T.right[T.right.length-1],A=Object(e.clone)(x),W=Object(e.sub)(Object(e.create)(),I,A),z=Object(e.sub)(Object(e.create)(),w,A),K=Math.PI/this.roundSegments;for(var k=0;k<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],R*K),Math.sign(Object(e.cross)(n,W,z)[2])===R);k++)Object(e.add)(n,W,A),c(T,n,R);c(T,w,R);}else c(T,n,R);}else p(T,x,s,E),Object(e.copy)(this._normal,s);}}}]);}();function c(P,T,v){v>0?P.left.push(Object(e.clone)(T)):P.right.push(Object(e.clone)(T));}function p(P,T,v,x){var f=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,T,v,-x),c(P,n,-f),Object(e.scaleAndAdd)(n,T,v,x),c(P,n,f);}function y(_ref94,v){var P=_ref94.left,T=_ref94.right;var x=Object(e.create)(),f=Object(e.create)();var g=P[0],u=T[0],m=[0.5*(g[0]+u[0]),0.5*(g[1]+u[1])];Object(e.sub)(f,g,m);for(var M=1;M<=v;M++){var E=-1*Math.PI*M/v;Object(e.rotate)(x,f,[0,0],E),Object(e.add)(n,m,x),P.unshift(Object(e.clone)(n));}g=T[T.length-1],u=P[P.length-1],m=[0.5*(g[0]+u[0]),0.5*(g[1]+u[1])],Object(e.sub)(f,g,m);for(var _M5=1;_M5<=v;_M5++){var _E2=-1*Math.PI*_M5/v;Object(e.rotate)(x,f,[0,0],_E2),Object(e.add)(n,m,x),T.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(v){return v.length>2;}),i.length===0)return{positions:[],cells:[]};typeof a.vertexSize!="number"&&(a.vertexSize=i[0][0].length),i=i.map(function(v){return v.reduce(function(x,f){return x.concat(f);});});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)),l=[],d=0;d<s.vertices.length;d+=a.vertexSize){var c=s.vertices.slice(d,d+a.vertexSize);l.push(c);}var p=[];for(d=0;d<s.elements.length;d+=3){var y=s.elements[d],P=s.elements[d+1],T=s.elements[d+2];p.push([y,P,T]);}return{positions:l,cells:p};};},/* 61 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e={},n={};h.exports=e,e.WINDING_ODD=0,e.WINDING_NONZERO=1,e.WINDING_POSITIVE=2,e.WINDING_NEGATIVE=3,e.WINDING_ABS_GEQ_TWO=4,e.POLYGONS=0,e.CONNECTED_POLYGONS=1,e.BOUNDARY_CONTOURS=2,e.tesselate=function(f){for(var g=f.debug||!1,u=new x(),m=0;m<f.contours.length;m++)u.addContour(f.vertexSize||2,f.contours[m]);return u.tesselate(f.windingRule||e.WINDING_ODD,f.elementType||e.POLYGONS,f.polySize||3,f.vertexSize||2,f.normal||[0,0,1]),{vertices:u.vertices,vertexIndices:u.vertexIndices,vertexCount:u.vertexCount,elements:u.elements,elementCount:u.elementCount,mesh:g?u.mesh:void 0};};var i=function i(f){if(!f)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(f){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=f;}s.prototype={get Rface(){return this.Sym.Lface;},set Rface(f){this.Sym.Lface=f;},get Dst(){return this.Sym.Org;},set Dst(f){this.Sym.Org=f;},get Oprev(){return this.Sym.Lnext;},set Oprev(f){this.Sym.Lnext=f;},get Lprev(){return this.Onext.Sym;},set Lprev(f){this.Onext.Sym=f;},get Dprev(){return this.Lnext.Sym;},set Dprev(f){this.Lnext.Sym=f;},get Rprev(){return this.Sym.Onext;},set Rprev(f){this.Sym.Onext=f;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(f){this.Sym.Onext.Sym=f;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(f){this.Sym.Lnext.Sym=f;}/* 3 pointers */};function l(){var f=new a(),g=new o(),u=new s(0),m=new s(1);f.next=f.prev=f,f.anEdge=null,g.next=g.prev=g,g.anEdge=null,g.trail=null,g.marked=!1,g.inside=!1,u.next=u,u.Sym=m,u.Onext=null,u.Lnext=null,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,m.next=m,m.Sym=u,m.Onext=null,m.Lnext=null,m.Org=null,m.Lface=null,m.winding=0,m.activeRegion=null,this.vHead=f,this.fHead=g,this.eHead=u,this.eHeadSym=m;}l.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
|
|
67
|
+
* No vertex or face structures are allocated, but these must be assigned
|
|
68
|
+
* before the current edge operation is completed.
|
|
69
|
+
*/ //static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
|
|
70
|
+
makeEdge_:function makeEdge_(f){var g=new s(0),u=new s(1);f.Sym.side<f.side&&(f=f.Sym);var m=f.Sym.next;return u.next=m,m.Sym.next=g,g.next=f,f.Sym.next=u,g.Sym=u,g.Onext=g,g.Lnext=u,g.Org=null,g.Lface=null,g.winding=0,g.activeRegion=null,u.Sym=g,u.Onext=u,u.Lnext=g,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,g;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
|
|
71
|
+
* CS348a notes (see mesh.h). Basically it modifies the mesh so that
|
|
72
|
+
* a->Onext and b->Onext are exchanged. This can have various effects
|
|
73
|
+
* depending on whether a and b belong to different face or vertex rings.
|
|
74
|
+
* For more explanation see tessMeshSplice() below.
|
|
75
|
+
*/ // static void Splice( TESShalfEdge *a, TESShalfEdge *b )
|
|
76
|
+
splice_:function splice_(f,g){var u=f.Onext,m=g.Onext;u.Sym.Lnext=g,m.Sym.Lnext=f,f.Onext=m,g.Onext=u;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
|
|
77
|
+
* origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
|
|
78
|
+
* a place to insert the new vertex in the global vertex list. We insert
|
|
79
|
+
* the new vertex *before* vNext so that algorithms which walk the vertex
|
|
80
|
+
* list will not see the newly created vertices.
|
|
81
|
+
*/ //static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
|
|
82
|
+
makeVertex_:function makeVertex_(f,g,u){var m=f;i(m!==null);var M=u.prev;m.prev=M,M.next=m,m.next=u,u.prev=m,m.anEdge=g;var E=g;do E.Org=m,E=E.Onext;while(E!==g);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
|
|
83
|
+
* face of all edges in the face loop to which eOrig belongs. "fNext" gives
|
|
84
|
+
* a place to insert the new face in the global face list. We insert
|
|
85
|
+
* the new face *before* fNext so that algorithms which walk the face
|
|
86
|
+
* list will not see the newly created faces.
|
|
87
|
+
*/ // static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
|
|
88
|
+
makeFace_:function makeFace_(f,g,u){var m=f;i(m!==null);var M=u.prev;m.prev=M,M.next=m,m.next=u,u.prev=m,m.anEdge=g,m.trail=null,m.marked=!1,m.inside=u.inside;var E=g;do E.Lface=m,E=E.Lnext;while(E!==g);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
|
|
89
|
+
* and removes from the global edge list.
|
|
90
|
+
*/ //static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
91
|
+
killEdge_:function killEdge_(f){f.Sym.side<f.side&&(f=f.Sym);var g=f.next,u=f.Sym.next;g.Sym.next=u,u.Sym.next=g;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
|
|
92
|
+
* vertex list. It updates the vertex loop to point to a given new vertex.
|
|
93
|
+
*/ //static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
|
|
94
|
+
killVertex_:function killVertex_(f,g){var u=f.anEdge,m=u;do m.Org=g,m=m.Onext;while(m!==u);var M=f.prev,E=f.next;E.prev=M,M.next=E;},/* KillFace( fDel ) destroys a face and removes it from the global face
|
|
95
|
+
* list. It updates the face loop to point to a given new face.
|
|
96
|
+
*/ //static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
|
|
97
|
+
killFace_:function killFace_(f,g){var u=f.anEdge,m=u;do m.Lface=g,m=m.Lnext;while(m!==u);var M=f.prev,E=f.next;E.prev=M,M.next=E;},/****************** Basic Edge Operations **********************/ /* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
|
|
98
|
+
* The loop consists of the two new half-edges.
|
|
99
|
+
*/ //TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
|
|
100
|
+
makeEdge:function makeEdge(){var f=new a(),g=new a(),u=new o(),m=this.makeEdge_(this.eHead);return this.makeVertex_(f,m,this.vHead),this.makeVertex_(g,m.Sym,this.vHead),this.makeFace_(u,m,this.fHead),m;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
|
|
101
|
+
* mesh connectivity and topology. It changes the mesh so that
|
|
102
|
+
* eOrg->Onext <- OLD( eDst->Onext )
|
|
103
|
+
* eDst->Onext <- OLD( eOrg->Onext )
|
|
104
|
+
* where OLD(...) means the value before the meshSplice operation.
|
|
105
|
+
*
|
|
106
|
+
* This can have two effects on the vertex structure:
|
|
107
|
+
* - if eOrg->Org != eDst->Org, the two vertices are merged together
|
|
108
|
+
* - if eOrg->Org == eDst->Org, the origin is split into two vertices
|
|
109
|
+
* In both cases, eDst->Org is changed and eOrg->Org is untouched.
|
|
110
|
+
*
|
|
111
|
+
* Similarly (and independently) for the face structure,
|
|
112
|
+
* - if eOrg->Lface == eDst->Lface, one loop is split into two
|
|
113
|
+
* - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
|
|
114
|
+
* In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
|
|
115
|
+
*
|
|
116
|
+
* Some special cases:
|
|
117
|
+
* If eDst == eOrg, the operation has no effect.
|
|
118
|
+
* If eDst == eOrg->Lnext, the new face will have a single edge.
|
|
119
|
+
* If eDst == eOrg->Lprev, the old face will have a single edge.
|
|
120
|
+
* If eDst == eOrg->Onext, the new vertex will have a single edge.
|
|
121
|
+
* If eDst == eOrg->Oprev, the old vertex will have a single edge.
|
|
122
|
+
*/ //int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
|
|
123
|
+
splice:function splice(f,g){var u=!1,m=!1;if(f!==g){if(g.Org!==f.Org&&(m=!0,this.killVertex_(g.Org,f.Org)),g.Lface!==f.Lface&&(u=!0,this.killFace_(g.Lface,f.Lface)),this.splice_(g,f),!m){var M=new a();this.makeVertex_(M,g,f.Org),f.Org.anEdge=f;}if(!u){var E=new o();this.makeFace_(E,g,f.Lface),f.Lface.anEdge=f;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
|
|
124
|
+
* if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
|
|
125
|
+
* eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
|
|
126
|
+
* the newly created loop will contain eDel->Dst. If the deletion of eDel
|
|
127
|
+
* would create isolated vertices, those are deleted as well.
|
|
128
|
+
*
|
|
129
|
+
* This function could be implemented as two calls to tessMeshSplice
|
|
130
|
+
* plus a few calls to memFree, but this would allocate and delete
|
|
131
|
+
* unnecessary vertices and faces.
|
|
132
|
+
*/ //int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
133
|
+
"delete":function _delete(f){var g=f.Sym,u=!1;if(f.Lface!==f.Rface&&(u=!0,this.killFace_(f.Lface,f.Rface)),f.Onext===f)this.killVertex_(f.Org,null);else if(f.Rface.anEdge=f.Oprev,f.Org.anEdge=f.Onext,this.splice_(f,f.Oprev),!u){var m=new o();this.makeFace_(m,f,f.Lface);}g.Onext===g?(this.killVertex_(g.Org,null),this.killFace_(g.Lface,null)):(f.Lface.anEdge=g.Oprev,g.Org.anEdge=g.Onext,this.splice_(g,g.Oprev)),this.killEdge_(f);},/******************** Other Edge Operations **********************/ /* All these routines can be implemented with the basic edge
|
|
134
|
+
* operations above. They are provided for convenience and efficiency.
|
|
135
|
+
*/ /* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
|
|
136
|
+
* eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
|
|
137
|
+
* eOrg and eNew will have the same left face.
|
|
138
|
+
*/ // TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
139
|
+
addEdgeVertex:function addEdgeVertex(f){var g=this.makeEdge_(f),u=g.Sym;this.splice_(g,f.Lnext),g.Org=f.Dst;var m=new a();return this.makeVertex_(m,u,g.Org),g.Lface=u.Lface=f.Lface,g;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
|
|
140
|
+
* such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
|
|
141
|
+
* eOrg and eNew will have the same left face.
|
|
142
|
+
*/ // TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
143
|
+
splitEdge:function splitEdge(f,g){var u=this.addEdgeVertex(f),m=u.Sym;return this.splice_(f.Sym,f.Sym.Oprev),this.splice_(f.Sym,m),f.Dst=m.Org,m.Dst.anEdge=m.Sym,m.Rface=f.Rface,m.winding=f.winding,m.Sym.winding=f.Sym.winding,m;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
|
|
144
|
+
* to eDst->Org, and returns the corresponding half-edge eNew.
|
|
145
|
+
* If eOrg->Lface == eDst->Lface, this splits one loop into two,
|
|
146
|
+
* and the newly created loop is eNew->Lface. Otherwise, two disjoint
|
|
147
|
+
* loops are merged into one, and the loop eDst->Lface is destroyed.
|
|
148
|
+
*
|
|
149
|
+
* If (eOrg == eDst), the new face will have only two edges.
|
|
150
|
+
* If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
|
|
151
|
+
* If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
|
|
152
|
+
*/ // TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
|
|
153
|
+
connect:function connect(f,g){var u=!1,m=this.makeEdge_(f),M=m.Sym;if(g.Lface!==f.Lface&&(u=!0,this.killFace_(g.Lface,f.Lface)),this.splice_(m,f.Lnext),this.splice_(M,g),m.Org=f.Dst,M.Org=g.Org,m.Lface=M.Lface=f.Lface,f.Lface.anEdge=M,!u){var E=new o();this.makeFace_(E,m,f.Lface);}return m;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
|
|
154
|
+
* global face list. All edges of fZap will have a NULL pointer as their
|
|
155
|
+
* left face. Any edges which also have a NULL pointer as their right face
|
|
156
|
+
* are deleted entirely (along with any isolated vertices this produces).
|
|
157
|
+
* An entire mesh can be deleted by zapping its faces, one at a time,
|
|
158
|
+
* in any order. Zapped faces cannot be used in further mesh operations!
|
|
159
|
+
*/zapFace:function zapFace(f){var g=f.anEdge,u,m,M,E,R;m=g.Lnext;do u=m,m=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!=g);E=f.prev,R=f.next,R.prev=E,E.next=R;},countFaceVerts_:function countFaceVerts_(f){var g=f.anEdge,u=0;do u++,g=g.Lnext;while(g!==f.anEdge);return u;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
|
|
160
|
+
mergeConvexFaces:function mergeConvexFaces(f){var g,u,m,M,E,R,b;for(g=this.fHead.next;g!==this.fHead;g=g.next)if(g.inside)for(u=g.anEdge,E=u.Org;m=u.Lnext,M=u.Sym,M&&M.Lface&&M.Lface.inside&&(R=this.countFaceVerts_(g),b=this.countFaceVerts_(M.Lface),R+b-2<=f&&n.vertCCW(u.Lprev.Org,u.Org,M.Lnext.Lnext.Org)&&n.vertCCW(M.Lprev.Org,M.Org,u.Lnext.Lnext.Org)&&(m=M.Lnext,this["delete"](M),u=null,M=null)),!(u&&u.Lnext.Org===E);)u=m;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
|
|
161
|
+
*/check:function check(){var f=this.fHead,g=this.vHead,u=this.eHead,m,M,E,R,b,O;for(M=f,M=f;(m=M.next)!==f;M=m){i(m.prev===M),b=m.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===m),b=b.Lnext;while(b!==m.anEdge);}for(i(m.prev===M&&m.anEdge===null),R=g,R=g;(E=R.next)!==g;R=E){i(E.prev===R),b=E.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===E),b=b.Onext;while(b!==E.anEdge);}for(i(E.prev===R&&E.anEdge===null),O=u,O=u;(b=O.next)!==u;O=b)i(b.Sym.next===O.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===O.Sym&&b.Sym===this.eHeadSym&&b.Sym.Sym===b&&b.Org===null&&b.Dst===null&&b.Lface===null&&b.Rface===null);}},n.vertEq=function(f,g){return f.s===g.s&&f.t===g.t;},n.vertLeq=function(f,g){return f.s<g.s||f.s===g.s&&f.t<=g.t;},n.transLeq=function(f,g){return f.t<g.t||f.t===g.t&&f.s<=g.s;},n.edgeGoesLeft=function(f){return n.vertLeq(f.Dst,f.Org);},n.edgeGoesRight=function(f){return n.vertLeq(f.Org,f.Dst);},n.vertL1dist=function(f,g){return Math.abs(f.s-g.s)+Math.abs(f.t-g.t);},n.edgeEval=function(f,g,u){i(n.vertLeq(f,g)&&n.vertLeq(g,u));var m=g.s-f.s,M=u.s-g.s;return m+M>0?m<M?g.t-f.t+(f.t-u.t)*(m/(m+M)):g.t-u.t+(u.t-f.t)*(M/(m+M)):0;},n.edgeSign=function(f,g,u){i(n.vertLeq(f,g)&&n.vertLeq(g,u));var m=g.s-f.s,M=u.s-g.s;return m+M>0?(g.t-u.t)*m+(g.t-f.t)*M:0;},n.transEval=function(f,g,u){i(n.transLeq(f,g)&&n.transLeq(g,u));var m=g.t-f.t,M=u.t-g.t;return m+M>0?m<M?g.s-f.s+(f.s-u.s)*(m/(m+M)):g.s-u.s+(u.s-f.s)*(M/(m+M)):0;},n.transSign=function(f,g,u){i(n.transLeq(f,g)&&n.transLeq(g,u));var m=g.t-f.t,M=u.t-g.t;return m+M>0?(g.s-u.s)*m+(g.s-f.s)*M:0;},n.vertCCW=function(f,g,u){return f.s*(g.t-u.t)+g.s*(u.t-f.t)+u.s*(f.t-g.t)>=0;},n.interpolate=function(f,g,u,m){return f=f<0?0:f,u=u<0?0:u,f<=u?u===0?(g+m)/2:g+(m-g)*(f/(f+u)):m+(g-m)*(u/(f+u));},n.intersect=function(f,g,u,m,M){var E,R,b;n.vertLeq(f,g)||(b=f,f=g,g=b),n.vertLeq(u,m)||(b=u,u=m,m=b),n.vertLeq(f,u)||(b=f,f=u,u=b,b=g,g=m,m=b),n.vertLeq(u,g)?n.vertLeq(g,m)?(E=n.edgeEval(f,u,g),R=n.edgeEval(u,g,m),E+R<0&&(E=-E,R=-R),M.s=n.interpolate(E,u.s,R,g.s)):(E=n.edgeSign(f,u,g),R=-n.edgeSign(f,m,g),E+R<0&&(E=-E,R=-R),M.s=n.interpolate(E,u.s,R,m.s)):M.s=(u.s+g.s)/2,n.transLeq(f,g)||(b=f,f=g,g=b),n.transLeq(u,m)||(b=u,u=m,m=b),n.transLeq(f,u)||(b=f,f=u,u=b,b=g,g=m,m=b),n.transLeq(u,g)?n.transLeq(g,m)?(E=n.transEval(f,u,g),R=n.transEval(u,g,m),E+R<0&&(E=-E,R=-R),M.t=n.interpolate(E,u.t,R,g.t)):(E=n.transSign(f,u,g),R=-n.transSign(f,m,g),E+R<0&&(E=-E,R=-R),M.t=n.interpolate(E,u.t,R,m.t)):M.t=(u.t+g.t)/2;};function d(){this.key=null,this.next=null,this.prev=null;}function c(f,g){this.head=new d(),this.head.next=this.head,this.head.prev=this.head,this.frame=f,this.leq=g;}c.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(f){return this.insertBefore(this.head,f);},search:function search(f){var g=this.head;do g=g.next;while(g.key!==null&&!this.leq(this.frame,f,g.key));return g;},insertBefore:function insertBefore(f,g){do f=f.prev;while(f.key!==null&&!this.leq(this.frame,f.key,g));var u=new d();return u.key=g,u.next=f.next,f.next.prev=u,u.prev=f,f.next=u,u;},"delete":function _delete(f){f.next.prev=f.prev,f.prev.next=f.next;}};function p(){this.handle=null;}function y(){this.key=null,this.node=null;}function P(f,g){this.size=0,this.max=f,this.nodes=[],this.nodes.length=f+1;var u;for(u=0;u<this.nodes.length;u++)this.nodes[u]=new p();for(this.handles=[],this.handles.length=f+1,u=0;u<this.handles.length;u++)this.handles[u]=new y();this.initialized=!1,this.freeList=0,this.leq=g,this.nodes[1].handle=1,this.handles[1].key=null;}P.prototype={floatDown_:function floatDown_(f){var g=this.nodes,u=this.handles,m,M,E;for(m=g[f].handle;;){if(E=f<<1,E<this.size&&this.leq(u[g[E+1].handle].key,u[g[E].handle].key)&&++E,i(E<=this.max),M=g[E].handle,E>this.size||this.leq(u[m].key,u[M].key)){g[f].handle=m,u[m].node=f;break;}g[f].handle=M,u[M].node=f,f=E;}},floatUp_:function floatUp_(f){var g=this.nodes,u=this.handles,m,M,E;for(m=g[f].handle;;){if(E=f>>1,M=g[E].handle,E===0||this.leq(u[M].key,u[m].key)){g[f].handle=m,u[m].node=f;break;}g[f].handle=M,u[M].node=f,f=E;}},init:function init(){for(var f=this.size;f>=1;--f)this.floatDown_(f);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 )
|
|
162
|
+
insert:function insert(f){var g,u;if(g=++this.size,g*2>this.max){this.max*=2;var m,M;for(M=this.nodes.length,this.nodes.length=this.max+1,m=M;m<this.nodes.length;m++)this.nodes[m]=new p();for(M=this.handles.length,this.handles.length=this.max+1,m=M;m<this.handles.length;m++)this.handles[m]=new y();}return this.freeList===0?u=g:(u=this.freeList,this.freeList=this.handles[u].node),this.nodes[g].handle=u,this.handles[u].node=g,this.handles[u].key=f,this.initialized&&this.floatUp_(g),u;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
|
|
163
|
+
extractMin:function extractMin(){var f=this.nodes,g=this.handles,u=f[1].handle,m=g[u].key;return this.size>0&&(f[1].handle=f[this.size].handle,g[f[1].handle].node=1,g[u].key=null,g[u].node=this.freeList,this.freeList=u,--this.size,this.size>0&&this.floatDown_(1)),m;},"delete":function _delete(f){var g=this.nodes,u=this.handles,m;i(f>=1&&f<=this.max&&u[f].key!==null),m=u[f].node,g[m].handle=g[this.size].handle,u[g[m].handle].node=m,--this.size,m<=this.size&&(m<=1||this.leq(u[g[m>>1].handle].key,u[g[m].handle].key)?this.floatDown_(m):this.floatUp_(m)),u[f].key=null,u[f].node=this.freeList,this.freeList=f;}};function T(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var v={};v.regionBelow=function(f){return f.nodeUp.prev.key;},v.regionAbove=function(f){return f.nodeUp.next.key;},v.debugEvent=function(f){},v.addWinding=function(f,g){f.winding+=g.winding,f.Sym.winding+=g.Sym.winding;},v.edgeLeq=function(f,g,u){var m=f.event,R,b,M=g.eUp,E=u.eUp;if(M.Dst===m)return E.Dst===m?n.vertLeq(M.Org,E.Org)?n.edgeSign(E.Dst,M.Org,E.Org)<=0:n.edgeSign(M.Dst,E.Org,M.Org)>=0:n.edgeSign(E.Dst,m,E.Org)<=0;if(E.Dst===m)return n.edgeSign(M.Dst,m,M.Org)>=0;var R=n.edgeEval(M.Dst,m,M.Org),b=n.edgeEval(E.Dst,m,E.Org);return R>=b;},v.deleteRegion=function(f,g){g.fixUpperEdge&&i(g.eUp.winding===0),g.eUp.activeRegion=null,f.dict["delete"](g.nodeUp);},v.fixUpperEdge=function(f,g,u){i(g.fixUpperEdge),f.mesh["delete"](g.eUp),g.fixUpperEdge=!1,g.eUp=u,u.activeRegion=g;},v.topLeftRegion=function(f,g){var u=g.eUp.Org,m;do g=v.regionAbove(g);while(g.eUp.Org===u);if(g.fixUpperEdge){if(m=f.mesh.connect(v.regionBelow(g).eUp.Sym,g.eUp.Lnext),m===null)return null;v.fixUpperEdge(f,g,m),g=v.regionAbove(g);}return g;},v.topRightRegion=function(f){var g=f.eUp.Dst;do f=v.regionAbove(f);while(f.eUp.Dst===g);return f;},v.addRegionBelow=function(f,g,u){var m=new T();return m.eUp=u,m.nodeUp=f.dict.insertBefore(g.nodeUp,m),m.fixUpperEdge=!1,m.sentinel=!1,m.dirty=!1,u.activeRegion=m,m;},v.isWindingInside=function(f,g){switch(f.windingRule){case e.WINDING_ODD:return(g&1)!==0;case e.WINDING_NONZERO:return g!==0;case e.WINDING_POSITIVE:return g>0;case e.WINDING_NEGATIVE:return g<0;case e.WINDING_ABS_GEQ_TWO:return g>=2||g<=-2;}return i(!1),!1;},v.computeWinding=function(f,g){g.windingNumber=v.regionAbove(g).windingNumber+g.eUp.winding,g.inside=v.isWindingInside(f,g.windingNumber);},v.finishRegion=function(f,g){var u=g.eUp,m=u.Lface;m.inside=g.inside,m.anEdge=u,v.deleteRegion(f,g);},v.finishLeftRegions=function(f,g,u){for(var m,R,M=null,E=g,R=g.eUp;E!==u;){if(E.fixUpperEdge=!1,M=v.regionBelow(E),m=M.eUp,m.Org!=R.Org){if(!M.fixUpperEdge){v.finishRegion(f,E);break;}m=f.mesh.connect(R.Lprev,m.Sym),v.fixUpperEdge(f,M,m);}R.Onext!==m&&(f.mesh.splice(m.Oprev,m),f.mesh.splice(R,m)),v.finishRegion(f,E),R=M.eUp,E=M;}return R;},v.addRightEdges=function(f,g,u,m,M,E){var R,b,O,L,w=!0;O=u;do i(n.vertLeq(O.Org,O.Dst)),v.addRegionBelow(f,g,O.Sym),O=O.Onext;while(O!==m);for(M===null&&(M=v.regionBelow(g).eUp.Rprev),b=g,L=M;R=v.regionBelow(b),O=R.eUp.Sym,O.Org===L.Org;)O.Onext!==L&&(f.mesh.splice(O.Oprev,O),f.mesh.splice(L.Oprev,O)),R.windingNumber=b.windingNumber-O.winding,R.inside=v.isWindingInside(f,R.windingNumber),b.dirty=!0,!w&&v.checkForRightSplice(f,b)&&(v.addWinding(O,L),v.deleteRegion(f,b),f.mesh["delete"](L)),w=!1,b=R,L=O;b.dirty=!0,i(b.windingNumber-O.winding===R.windingNumber),E&&v.walkDirtyRegions(f,b);},v.spliceMergeVertices=function(f,g,u){f.mesh.splice(g,u);},v.vertexWeights=function(f,g,u){var m=n.vertL1dist(g,f),M=n.vertL1dist(u,f),E=0.5*M/(m+M),R=0.5*m/(m+M);f.coords[0]+=E*g.coords[0]+R*u.coords[0],f.coords[1]+=E*g.coords[1]+R*u.coords[1],f.coords[2]+=E*g.coords[2]+R*u.coords[2];},v.getIntersectData=function(f,g,u,m,M,E){g.coords[0]=g.coords[1]=g.coords[2]=0,g.idx=-1,v.vertexWeights(g,u,m),v.vertexWeights(g,M,E);},v.checkForRightSplice=function(f,g){var u=v.regionBelow(g),m=g.eUp,M=u.eUp;if(n.vertLeq(m.Org,M.Org)){if(n.edgeSign(M.Dst,m.Org,M.Org)>0)return!1;n.vertEq(m.Org,M.Org)?m.Org!==M.Org&&(f.pq["delete"](m.Org.pqHandle),v.spliceMergeVertices(f,M.Oprev,m)):(f.mesh.splitEdge(M.Sym),f.mesh.splice(m,M.Oprev),g.dirty=u.dirty=!0);}else{if(n.edgeSign(m.Dst,M.Org,m.Org)<0)return!1;v.regionAbove(g).dirty=g.dirty=!0,f.mesh.splitEdge(m.Sym),f.mesh.splice(M.Oprev,m);}return!0;},v.checkForLeftSplice=function(f,g){var u=v.regionBelow(g),m=g.eUp,M=u.eUp,E;if(i(!n.vertEq(m.Dst,M.Dst)),n.vertLeq(m.Dst,M.Dst)){if(n.edgeSign(m.Dst,M.Dst,m.Org)<0)return!1;v.regionAbove(g).dirty=g.dirty=!0,E=f.mesh.splitEdge(m),f.mesh.splice(M.Sym,E),E.Lface.inside=g.inside;}else{if(n.edgeSign(M.Dst,m.Dst,M.Org)>0)return!1;g.dirty=u.dirty=!0,E=f.mesh.splitEdge(M),f.mesh.splice(m.Lnext,M.Sym),E.Rface.inside=g.inside;}return!0;},v.checkForIntersect=function(f,g){var u=v.regionBelow(g),m=g.eUp,M=u.eUp,E=m.Org,R=M.Org,b=m.Dst,O=M.Dst,L,w,I=new a(),A,W;if(i(!n.vertEq(O,b)),i(n.edgeSign(b,f.event,E)<=0),i(n.edgeSign(O,f.event,R)>=0),i(E!==f.event&&R!==f.event),i(!g.fixUpperEdge&&!u.fixUpperEdge),E===R||(L=Math.min(E.t,b.t),w=Math.max(R.t,O.t),L>w))return!1;if(n.vertLeq(E,R)){if(n.edgeSign(O,E,R)>0)return!1;}else if(n.edgeSign(b,R,E)<0)return!1;return v.debugEvent(f),n.intersect(b,E,O,R,I),i(Math.min(E.t,b.t)<=I.t),i(I.t<=Math.max(R.t,O.t)),i(Math.min(O.s,b.s)<=I.s),i(I.s<=Math.max(R.s,E.s)),n.vertLeq(I,f.event)&&(I.s=f.event.s,I.t=f.event.t),A=n.vertLeq(E,R)?E:R,n.vertLeq(A,I)&&(I.s=A.s,I.t=A.t),n.vertEq(I,E)||n.vertEq(I,R)?(v.checkForRightSplice(f,g),!1):!n.vertEq(b,f.event)&&n.edgeSign(b,f.event,I)>=0||!n.vertEq(O,f.event)&&n.edgeSign(O,f.event,I)<=0?O===f.event?(f.mesh.splitEdge(m.Sym),f.mesh.splice(M.Sym,m),g=v.topLeftRegion(f,g),m=v.regionBelow(g).eUp,v.finishLeftRegions(f,v.regionBelow(g),u),v.addRightEdges(f,g,m.Oprev,m,m,!0),!0):b===f.event?(f.mesh.splitEdge(M.Sym),f.mesh.splice(m.Lnext,M.Oprev),u=g,g=v.topRightRegion(g),W=v.regionBelow(g).eUp.Rprev,u.eUp=M.Oprev,M=v.finishLeftRegions(f,u,null),v.addRightEdges(f,g,M.Onext,m.Rprev,W,!0),!0):(n.edgeSign(b,f.event,I)>=0&&(v.regionAbove(g).dirty=g.dirty=!0,f.mesh.splitEdge(m.Sym),m.Org.s=f.event.s,m.Org.t=f.event.t),n.edgeSign(O,f.event,I)<=0&&(g.dirty=u.dirty=!0,f.mesh.splitEdge(M.Sym),M.Org.s=f.event.s,M.Org.t=f.event.t),!1):(f.mesh.splitEdge(m.Sym),f.mesh.splitEdge(M.Sym),f.mesh.splice(M.Oprev,m),m.Org.s=I.s,m.Org.t=I.t,m.Org.pqHandle=f.pq.insert(m.Org),v.getIntersectData(f,m.Org,E,b,R,O),v.regionAbove(g).dirty=g.dirty=u.dirty=!0,!1);},v.walkDirtyRegions=function(f,g){for(var u=v.regionBelow(g),m,M;;){for(;u.dirty;)g=u,u=v.regionBelow(u);if(!g.dirty&&(u=g,g=v.regionAbove(g),g===null||!g.dirty))return;if(g.dirty=!1,m=g.eUp,M=u.eUp,m.Dst!==M.Dst&&v.checkForLeftSplice(f,g)&&(u.fixUpperEdge?(v.deleteRegion(f,u),f.mesh["delete"](M),u=v.regionBelow(g),M=u.eUp):g.fixUpperEdge&&(v.deleteRegion(f,g),f.mesh["delete"](m),g=v.regionAbove(u),m=g.eUp)),m.Org!==M.Org)if(m.Dst!==M.Dst&&!g.fixUpperEdge&&!u.fixUpperEdge&&(m.Dst===f.event||M.Dst===f.event)){if(v.checkForIntersect(f,g))return;}else v.checkForRightSplice(f,g);m.Org===M.Org&&m.Dst===M.Dst&&(v.addWinding(M,m),v.deleteRegion(f,g),f.mesh["delete"](m),g=v.regionAbove(u));}},v.connectRightVertex=function(f,g,u){var m,M=u.Onext,E=v.regionBelow(g),R=g.eUp,b=E.eUp,O=!1;if(R.Dst!==b.Dst&&v.checkForIntersect(f,g),n.vertEq(R.Org,f.event)&&(f.mesh.splice(M.Oprev,R),g=v.topLeftRegion(f,g),M=v.regionBelow(g).eUp,v.finishLeftRegions(f,v.regionBelow(g),E),O=!0),n.vertEq(b.Org,f.event)&&(f.mesh.splice(u,b.Oprev),u=v.finishLeftRegions(f,E,null),O=!0),O){v.addRightEdges(f,g,u.Onext,M,M,!0);return;}n.vertLeq(b.Org,R.Org)?m=b.Oprev:m=R,m=f.mesh.connect(u.Lprev,m),v.addRightEdges(f,g,m,m.Onext,m.Onext,!1),m.Sym.activeRegion.fixUpperEdge=!0,v.walkDirtyRegions(f,g);},v.connectLeftDegenerate=function(f,g,u){var m,M,E,R,b;if(m=g.eUp,n.vertEq(m.Org,u)){i(!1/*TOLERANCE_NONZERO*/),v.spliceMergeVertices(f,m,u.anEdge);return;}if(!n.vertEq(m.Dst,u)){f.mesh.splitEdge(m.Sym),g.fixUpperEdge&&(f.mesh["delete"](m.Onext),g.fixUpperEdge=!1),f.mesh.splice(u.anEdge,m),v.sweepEvent(f,u);return;}i(!1/*TOLERANCE_NONZERO*/),g=v.topRightRegion(g),b=v.regionBelow(g),E=b.eUp.Sym,M=R=E.Onext,b.fixUpperEdge&&(i(M!==E),v.deleteRegion(f,b),f.mesh["delete"](E),E=M.Oprev),f.mesh.splice(u.anEdge,E),n.edgeGoesLeft(M)||(M=null),v.addRightEdges(f,g,E.Onext,R,M,!0);},v.connectLeftVertex=function(f,g){var u,m,M,E,R,b,O=new T();if(O.eUp=g.anEdge.Sym,u=f.dict.search(O).key,m=v.regionBelow(u),!!m){if(E=u.eUp,R=m.eUp,n.edgeSign(E.Dst,g,E.Org)===0){v.connectLeftDegenerate(f,u,g);return;}if(M=n.vertLeq(R.Dst,E.Dst)?u:m,u.inside||M.fixUpperEdge){if(M===u)b=f.mesh.connect(g.anEdge.Sym,E.Lnext);else{var L=f.mesh.connect(R.Dnext,g.anEdge);b=L.Sym;}M.fixUpperEdge?v.fixUpperEdge(f,M,b):v.computeWinding(f,v.addRegionBelow(f,u,b)),v.sweepEvent(f,g);}else v.addRightEdges(f,u,g.anEdge,g.anEdge,null,!0);}},v.sweepEvent=function(f,g){f.event=g,v.debugEvent(f);for(var u=g.anEdge;u.activeRegion===null;)if(u=u.Onext,u===g.anEdge){v.connectLeftVertex(f,g);return;}var m=v.topLeftRegion(f,u.activeRegion);i(m!==null);var M=v.regionBelow(m),E=M.eUp,R=v.finishLeftRegions(f,M,null);R.Onext===E?v.connectRightVertex(f,m,R):v.addRightEdges(f,m,R.Onext,E,E,!0);},v.addSentinel=function(f,g,u,m){var M=new T(),E=f.mesh.makeEdge();E.Org.s=u,E.Org.t=m,E.Dst.s=g,E.Dst.t=m,f.event=E.Dst,M.eUp=E,M.windingNumber=0,M.inside=!1,M.fixUpperEdge=!1,M.sentinel=!0,M.dirty=!1,M.nodeUp=f.dict.insert(M);},v.initEdgeDict=function(f){f.dict=new c(f,v.edgeLeq);var g=f.bmax[0]-f.bmin[0],u=f.bmax[1]-f.bmin[1],m=f.bmin[0]-g,M=f.bmax[0]+g,E=f.bmin[1]-u,R=f.bmax[1]+u;v.addSentinel(f,m,M,E),v.addSentinel(f,m,M,R);},v.doneEdgeDict=function(f){for(var g,u=0;(g=f.dict.min().key)!==null;)g.sentinel||(i(g.fixUpperEdge),i(++u===1)),i(g.windingNumber===0),v.deleteRegion(f,g);},v.removeDegenerateEdges=function(f){var g,u,m,M=f.mesh.eHead;for(g=M.next;g!==M;g=u)u=g.next,m=g.Lnext,n.vertEq(g.Org,g.Dst)&&g.Lnext.Lnext!==g&&(v.spliceMergeVertices(f,m,g),f.mesh["delete"](g),g=m,m=g.Lnext),m.Lnext===g&&(m!==g&&((m===u||m===u.Sym)&&(u=u.next),f.mesh["delete"](m)),(g===u||g===u.Sym)&&(u=u.next),f.mesh["delete"](g));},v.initPriorityQ=function(f){var g,u,m,M=0;for(m=f.mesh.vHead,u=m.next;u!==m;u=u.next)M++;for(M+=8,g=f.pq=new P(M,n.vertLeq),m=f.mesh.vHead,u=m.next;u!==m;u=u.next)u.pqHandle=g.insert(u);return u!==m?!1:(g.init(),!0);},v.donePriorityQ=function(f){f.pq=null;},v.removeDegenerateFaces=function(f,g){var u,m,M;for(u=g.fHead.next;u!==g.fHead;u=m)m=u.next,M=u.anEdge,i(M.Lnext!==M),M.Lnext.Lnext===M&&(v.addWinding(M.Onext,M),f.mesh["delete"](M));return!0;},v.computeInterior=function(f){var g,u;if(v.removeDegenerateEdges(f),!v.initPriorityQ(f))return!1;for(v.initEdgeDict(f);(g=f.pq.extractMin())!==null;){for(;u=f.pq.min(),!(u===null||!n.vertEq(u,g));)u=f.pq.extractMin(),v.spliceMergeVertices(f,g.anEdge,u.anEdge);v.sweepEvent(f,g);}return f.event=f.dict.min().key.eUp.Org,v.debugEvent(f),v.doneEdgeDict(f),v.donePriorityQ(f),v.removeDegenerateFaces(f,f.mesh)?(f.mesh.check(),!0):!1;};function x(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=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;}x.prototype={dot_:function dot_(f,g){return f[0]*g[0]+f[1]*g[1]+f[2]*g[2];},normalize_:function normalize_(f){var g=f[0]*f[0]+f[1]*f[1]+f[2]*f[2];i(g>0),g=Math.sqrt(g),f[0]/=g,f[1]/=g,f[2]/=g;},longAxis_:function longAxis_(f){var g=0;return Math.abs(f[1])>Math.abs(f[0])&&(g=1),Math.abs(f[2])>Math.abs(f[g])&&(g=2),g;},computeNormal_:function computeNormal_(f){var g,u,m,M,E,R,b=[0,0,0],O=[0,0,0],L=[0,0,0],w=[0,0,0],I=[0,0,0],A=[null,null,null],W=[null,null,null],z=this.mesh.vHead,K;for(g=z.next,K=0;K<3;++K)M=g.coords[K],O[K]=M,W[K]=g,b[K]=M,A[K]=g;for(g=z.next;g!==z;g=g.next)for(K=0;K<3;++K)M=g.coords[K],M<O[K]&&(O[K]=M,W[K]=g),M>b[K]&&(b[K]=M,A[K]=g);if(K=0,b[1]-O[1]>b[0]-O[0]&&(K=1),b[2]-O[2]>b[K]-O[K]&&(K=2),O[K]>=b[K]){f[0]=0,f[1]=0,f[2]=1;return;}for(R=0,u=W[K],m=A[K],L[0]=u.coords[0]-m.coords[0],L[1]=u.coords[1]-m.coords[1],L[2]=u.coords[2]-m.coords[2],g=z.next;g!==z;g=g.next)w[0]=g.coords[0]-m.coords[0],w[1]=g.coords[1]-m.coords[1],w[2]=g.coords[2]-m.coords[2],I[0]=L[1]*w[2]-L[2]*w[1],I[1]=L[2]*w[0]-L[0]*w[2],I[2]=L[0]*w[1]-L[1]*w[0],E=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],E>R&&(R=E,f[0]=I[0],f[1]=I[1],f[2]=I[2]);R<=0&&(f[0]=f[1]=f[2]=0,f[this.longAxis_(L)]=1);},checkOrientation_:function checkOrientation_(){var f,g,u=this.mesh.fHead,m,M=this.mesh.vHead,E;for(f=0,g=u.next;g!==u;g=g.next)if(E=g.anEdge,!(E.winding<=0))do f+=(E.Org.s-E.Dst.s)*(E.Org.t+E.Dst.t),E=E.Lnext;while(E!==g.anEdge);if(f<0){for(m=M.next;m!==M;m=m.next)m.t=-m.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
|
|
164
|
+
#include <stdlib.h>
|
|
165
|
+
extern int RandomSweep;
|
|
166
|
+
#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
|
|
167
|
+
#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
|
|
168
|
+
#else
|
|
169
|
+
#if defined(SLANTED_SWEEP) */ /* The "feature merging" is not intended to be complete. There are
|
|
170
|
+
* special cases where edges are nearly parallel to the sweep line
|
|
171
|
+
* which are not implemented. The algorithm should still behave
|
|
172
|
+
* robustly (ie. produce a reasonable tesselation) in the presence
|
|
173
|
+
* of such edges, however it may miss features which could have been
|
|
174
|
+
* merged. We could minimize this effect by choosing the sweep line
|
|
175
|
+
* direction to be something unusual (ie. not parallel to one of the
|
|
176
|
+
* coordinate axes).
|
|
177
|
+
*/ /* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
|
|
178
|
+
#define S_UNIT_Y (TESSreal)0.86052074622010633
|
|
179
|
+
#else
|
|
180
|
+
#define S_UNIT_X (TESSreal)1.0
|
|
181
|
+
#define S_UNIT_Y (TESSreal)0.0
|
|
182
|
+
#endif
|
|
183
|
+
#endif*/ /* Determine the polygon normal and project vertices onto the plane
|
|
184
|
+
* of the polygon.
|
|
185
|
+
*/projectPolygon_:function projectPolygon_(){var f,g=this.mesh.vHead,u=[0,0,0],m,M,E,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),m=this.sUnit,M=this.tUnit,E=this.longAxis_(u),m[E]=0,m[(E+1)%3]=1,m[(E+2)%3]=0,M[E]=0,M[(E+1)%3]=0,M[(E+2)%3]=u[E]>0?1:-1,f=g.next;f!==g;f=f.next)f.s=this.dot_(f.coords,m),f.t=this.dot_(f.coords,M);for(b&&this.checkOrientation_(),R=!0,f=g.next;f!==g;f=f.next)R?(this.bmin[0]=this.bmax[0]=f.s,this.bmin[1]=this.bmax[1]=f.t,R=!1):(f.s<this.bmin[0]&&(this.bmin[0]=f.s),f.s>this.bmax[0]&&(this.bmax[0]=f.s),f.t<this.bmin[1]&&(this.bmin[1]=f.t),f.t>this.bmax[1]&&(this.bmax[1]=f.t));},addWinding_:function addWinding_(f,g){f.winding+=g.winding,f.Sym.winding+=g.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
|
|
186
|
+
* (what else would it do??) The region must consist of a single
|
|
187
|
+
* loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
|
|
188
|
+
* case means that any vertical line intersects the interior of the
|
|
189
|
+
* region in a single interval.
|
|
190
|
+
*
|
|
191
|
+
* Tessellation consists of adding interior edges (actually pairs of
|
|
192
|
+
* half-edges), to split the region into non-overlapping triangles.
|
|
193
|
+
*
|
|
194
|
+
* The basic idea is explained in Preparata and Shamos (which I don''t
|
|
195
|
+
* have handy right now), although their implementation is more
|
|
196
|
+
* complicated than this one. The are two edge chains, an upper chain
|
|
197
|
+
* and a lower chain. We process all vertices from both chains in order,
|
|
198
|
+
* from right to left.
|
|
199
|
+
*
|
|
200
|
+
* The algorithm ensures that the following invariant holds after each
|
|
201
|
+
* vertex is processed: the untessellated region consists of two
|
|
202
|
+
* chains, where one chain (say the upper) is a single edge, and
|
|
203
|
+
* the other chain is concave. The left vertex of the single edge
|
|
204
|
+
* is always to the left of all vertices in the concave chain.
|
|
205
|
+
*
|
|
206
|
+
* Each step consists of adding the rightmost unprocessed vertex to one
|
|
207
|
+
* of the two chains, and forming a fan of triangles from the rightmost
|
|
208
|
+
* of two chain endpoints. Determining whether we can add each triangle
|
|
209
|
+
* to the fan is a simple orientation test. By making the fan as large
|
|
210
|
+
* as possible, we restore the invariant (check it yourself).
|
|
211
|
+
*/ // int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
|
|
212
|
+
tessellateMonoRegion_:function tessellateMonoRegion_(f,g){var u,m;for(u=g.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(m=u.Lprev;u.Lnext!==m;)if(n.vertLeq(u.Dst,m.Org)){for(;m.Lnext!==u&&(n.edgeGoesLeft(m.Lnext)||n.edgeSign(m.Org,m.Dst,m.Lnext.Dst)<=0);){var M=f.connect(m.Lnext,m);m=M.Sym;}m=m.Lprev;}else{for(;m.Lnext!==u&&(n.edgeGoesRight(u.Lprev)||n.edgeSign(u.Dst,u.Org,u.Lprev.Org)>=0);){var M=f.connect(u,u.Lprev);u=M.Sym;}u=u.Lnext;}for(i(m.Lnext!==u);m.Lnext.Lnext!==u;){var M=f.connect(m.Lnext,m);m=M.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
|
|
213
|
+
* the mesh which is marked "inside" the polygon. Each such region
|
|
214
|
+
* must be monotone.
|
|
215
|
+
*/ //int tessMeshTessellateInterior( TESSmesh *mesh )
|
|
216
|
+
tessellateInterior_:function tessellateInterior_(f){var g,u;for(g=f.fHead.next;g!==f.fHead;g=u)if(u=g.next,g.inside&&!this.tessellateMonoRegion_(f,g))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
|
|
217
|
+
* which are not marked "inside" the polygon. Since further mesh operations
|
|
218
|
+
* on NULL faces are not allowed, the main purpose is to clean up the
|
|
219
|
+
* mesh so that exterior loops are not represented in the data structure.
|
|
220
|
+
*/ //void tessMeshDiscardExterior( TESSmesh *mesh )
|
|
221
|
+
discardExterior_:function discardExterior_(f){var g,u;for(g=f.fHead.next;g!==f.fHead;g=u)u=g.next,g.inside||f.zapFace(g);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
|
|
222
|
+
* winding numbers on all edges so that regions marked "inside" the
|
|
223
|
+
* polygon have a winding number of "value", and regions outside
|
|
224
|
+
* have a winding number of 0.
|
|
225
|
+
*
|
|
226
|
+
* If keepOnlyBoundary is TRUE, it also deletes all edges which do not
|
|
227
|
+
* separate an interior region from an exterior one.
|
|
228
|
+
*/ // int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
|
|
229
|
+
setWindingNumber_:function setWindingNumber_(f,g,u){var m,M;for(m=f.eHead.next;m!==f.eHead;m=M)M=m.next,m.Rface.inside!==m.Lface.inside?m.winding=m.Lface.inside?g:-g:u?f["delete"](m):m.winding=0;},getNeighbourFace_:function getNeighbourFace_(f){return!f.Rface||!f.Rface.inside?-1:f.Rface.n;},outputPolymesh_:function outputPolymesh_(f,g,u,m){var M,E,R,b=0,O=0,L,w;for(u>3&&f.mergeConvexFaces(u),M=f.vHead.next;M!==f.vHead;M=M.next)M.n=-1;for(E=f.fHead.next;E!==f.fHead;E=E.next)if(E.n=-1,!!E.inside){R=E.anEdge,L=0;do M=R.Org,M.n===-1&&(M.n=O,O++),L++,R=R.Lnext;while(R!==E.anEdge);i(L<=u),E.n=b,++b;}for(this.elementCount=b,g===e.CONNECTED_POLYGONS&&(b*=2),this.elements=[],this.elements.length=b*u,this.vertexCount=O,this.vertices=[],this.vertices.length=O*m,this.vertexIndices=[],this.vertexIndices.length=O,M=f.vHead.next;M!==f.vHead;M=M.next)if(M.n!==-1){var I=M.n*m;this.vertices[I+0]=M.coords[0],this.vertices[I+1]=M.coords[1],m>2&&(this.vertices[I+2]=M.coords[2]),this.vertexIndices[M.n]=M.idx;}var A=0;for(E=f.fHead.next;E!==f.fHead;E=E.next)if(E.inside){R=E.anEdge,L=0;do M=R.Org,this.elements[A++]=M.n,L++,R=R.Lnext;while(R!==E.anEdge);for(w=L;w<u;++w)this.elements[A++]=-1;if(g===e.CONNECTED_POLYGONS){R=E.anEdge;do this.elements[A++]=this.getNeighbourFace_(R),R=R.Lnext;while(R!==E.anEdge);for(w=L;w<u;++w)this.elements[A++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
|
|
230
|
+
outputContours_:function outputContours_(f,g){var u,m,M,E=0,R=0;for(this.vertexCount=0,this.elementCount=0,u=f.fHead.next;u!==f.fHead;u=u.next)if(u.inside){M=m=u.anEdge;do this.vertexCount++,m=m.Lnext;while(m!==M);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*g,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var b=0,O=0,L=0;for(E=0,u=f.fHead.next;u!==f.fHead;u=u.next)if(u.inside){R=0,M=m=u.anEdge;do this.vertices[b++]=m.Org.coords[0],this.vertices[b++]=m.Org.coords[1],g>2&&(this.vertices[b++]=m.Org.coords[2]),this.vertexIndices[O++]=m.Org.idx,R++,m=m.Lnext;while(m!==M);this.elements[L++]=E,this.elements[L++]=R,E+=R;}},addContour:function addContour(f,g){var u,m;for(this.mesh===null&&(this.mesh=new l()),f<2&&(f=2),f>3&&(f=3),u=null,m=0;m<g.length;m+=f)u===null?(u=this.mesh.makeEdge(),this.mesh.splice(u,u.Sym)):(this.mesh.splitEdge(u),u=u.Lnext),u.Org.coords[0]=g[m+0],u.Org.coords[1]=g[m+1],f>2?u.Org.coords[2]=g[m+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 )
|
|
231
|
+
tesselate:function tesselate(f,g,u,m,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=f,m<2&&(m=2),m>3&&(m=3),!this.mesh)return!1;this.projectPolygon_(),v.computeInterior(this);var E=this.mesh;return g===e.BOUNDARY_CONTOURS?this.setWindingNumber_(E,1,!0):this.tessellateInterior_(E),E.check(),g===e.BOUNDARY_CONTOURS?this.outputContours_(E,m):this.outputPolymesh_(E,g,u,m),!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 l;}),t.d(r,"createCloudShaders",function(){return c;}),t.d(r,"applyCloudShader",function(){return p;});var e=t(64),n=t(65),i=t(66),a=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function s(y){y[o]=[];for(var P=0;P<16;P++){var T=[],v=!!(P&1),_x27=!!(P&2),_f10=!!(P&4),g=!!(P&8);v&&T.push("#define TEXTURE 1"),_x27&&T.push("#define FILTER 1"),_f10&&T.push("#define GRADIENT 1"),g&&T.push("#define CLIPPATH 1");var u="".concat(T.join("\n"),"\n"),m=[];v&&m.push("uniform sampler2D u_texSampler;"),g&&m.push("uniform sampler2D u_clipSampler;"),y[o][P]=[u+m.join("\n")+n["default"],u+e["default"]];}}function l(y){var _ref95=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,P=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,T=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,v=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasClipPath=_ref95.hasClipPath,x=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var f=P|T<<1|v<<2|x<<3;var g=y[o][f];Array.isArray(g)&&(g=y.createProgram.apply(y,_toConsumableArray(g)),y[o][f]=g),y.program!==g&&y.useProgram(g,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var d=[];function c(y){for(var P=0;P<64;P++){var T=[],v=!!(P&1),_x28=!!(P&2),_f11=!!(P&4),g=!!(P&8),u=!!(P&16),m=!!(P&32);v&&T.push("#define TEXTURE 1"),_x28&&T.push("#define FILTER 1"),_f11&&T.push("#define GRADIENT 1"),g&&T.push("#define CLOUDCOLOR 1"),u&&T.push("#define CLOUDFILTER 1"),m&&T.push("#define CLIPPATH 1");var M="".concat(T.join("\n"),"\n"),E=[];if(v){E.push("uniform sampler2D u_texSampler;");for(var R=0;R<12;R++)E.push("uniform sampler2D u_texFrame".concat(R,";"));}m&&E.push("uniform sampler2D u_clipSampler;"),d[P]=[M+E.join("\n")+a["default"],M+i["default"]];}}function p(y){var _ref96=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref96$hasTexture=_ref96.hasTexture,P=_ref96$hasTexture===void 0?!1:_ref96$hasTexture,_ref96$hasFilter=_ref96.hasFilter,T=_ref96$hasFilter===void 0?!1:_ref96$hasFilter,_ref96$hasGradient=_ref96.hasGradient,v=_ref96$hasGradient===void 0?!1:_ref96$hasGradient,_ref96$hasCloudColor=_ref96.hasCloudColor,x=_ref96$hasCloudColor===void 0?!1:_ref96$hasCloudColor,_ref96$hasCloudFilter=_ref96.hasCloudFilter,f=_ref96$hasCloudFilter===void 0?!1:_ref96$hasCloudFilter,_ref96$hasClipPath=_ref96.hasClipPath,g=_ref96$hasClipPath===void 0?!1:_ref96$hasClipPath;var u=P|T<<1|v<<2|x<<3|f<<4|g<<5;var m=d[u];Array.isArray(m)&&(m=y.createProgram.apply(y,_toConsumableArray(m)),d[u]=m),y.program!==m&&y.useProgram(m,{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],l=_e$hrtime2[1];return s*1e3+l*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(_unused4){e=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=a;}catch(_unused5){n=a;}})();function o(x){if(e===setTimeout)return setTimeout(x,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(x,0);try{return e(x,0);}catch(_unused6){try{return e.call(null,x,0);}catch(_unused7){return e.call(this,x,0);}}}function s(x){if(n===clearTimeout)return clearTimeout(x);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(x);try{return n(x);}catch(_unused8){try{return n.call(null,x);}catch(_unused9){return n.call(this,x);}}}var l=[],d=!1,c,p=-1;function y(){!d||!c||(d=!1,c.length?l=c.concat(l):p=-1,l.length&&P());}function P(){if(!d){var x=o(y);d=!0;for(var f=l.length;f;){for(c=l,l=[];++p<f;)c&&c[p].run();p=-1,f=l.length;}c=null,d=!1,s(x);}}t.nextTick=function(x){var f=new Array(arguments.length-1);if(arguments.length>1)for(var g=1;g<arguments.length;g++)f[g-1]=arguments[g];l.push(new T(x,f)),l.length===1&&!d&&o(P);};function T(x,f){this.fun=x,this.array=f;}T.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function v(){}t.on=v,t.addListener=v,t.once=v,t.off=v,t.removeListener=v,t.removeAllListeners=v,t.emit=v,t.prependListener=v,t.prependOnceListener=v,t.listeners=function(x){return[];},t.binding=function(x){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(x){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 */ /***/function(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),l=t(216);t(1).glMatrix.setMatrixArrayType(Array);function d(b,O){var L=Object.keys(b);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(b);O&&(w=w.filter(function(I){return Object.getOwnPropertyDescriptor(b,I).enumerable;})),L.push.apply(L,w);}return L;}function c(b){for(var O=1;O<arguments.length;O++){var L=arguments[O]!=null?arguments[O]:{};O%2?d(Object(L),!0).forEach(function(w){p(b,w,L[w]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(L)):d(Object(L)).forEach(function(w){Object.defineProperty(b,w,Object.getOwnPropertyDescriptor(L,w));});}return b;}function p(b,O,L){return O in b?Object.defineProperty(b,O,{value:L,enumerable:!0,configurable:!0,writable:!0}):b[O]=L,b;}var y=Symbol["for"]("spritejs_changedAttrs"),P=Symbol["for"]("spritejs_attributes"),T=Symbol("resolution"),v=Symbol("animations"),x=Symbol("eventListeners"),f=Symbol("captureEventListeners"),g=Symbol("filters"),u=Symbol("display"),m=Symbol("program"),M=Symbol("shaderAttrs"),E=Symbol("uniforms");var R=/*#__PURE__*/function(){function R(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,R);this.attributes=new this.constructor.Attr(this),this[T]={width:300,height:150},Object.assign(this.attributes,O),this[v]=/* @__PURE__ */new Set(),this[x]={},this[f]={};}return _createClass(R,[{key:"ancestors",get:function get(){var O=this.parent;var L=[];for(;O;)L.push(O),O=O.parent;return L;}},{key:"animations",get:function get(){return this[v];}},{key:"filters",get:function get(){return this[g]||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 O=this.transformMatrix,_this$attributes=this.attributes,L=_this$attributes.x,w=_this$attributes.y;return O[4]+=L,O[5]+=w,O;}},{key:"opacity",get:function get(){var O=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(O*=this.parent.opacity),O;}},{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[m];}/* 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 O=this.localMatrix;var L=this.parent;if(L){var w=L.__cacheRenderMatrix||L.renderMatrix;w&&(O=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,O));}return O;}},{key:"worldScaling",get:function get(){var O=this.renderMatrix;return[Math.hypot(O[0],O[1]),Math.hypot(O[2],O[3])];}},{key:"worldRotation",get:function get(){var O=this.renderMatrix;return Math.atan2(O[1],O[3]);}},{key:"worldPosition",get:function get(){var O=this.renderMatrix;return[O[4],O[5]];}},{key:"uniforms",get:function get(){return this[E];}/* get zOrder defined by connect method */ /* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(O){this.attributes.className=O;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(O){this.attributes.id=O;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(O){this.attributes.name=O;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(O){this.attributes.zIndex=O;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[M]||{};}},{key:"activateAnimations",value:function activateAnimations(){var O=this.layer;if(O){var L=this[v];L.forEach(function(I){I.baseTimeline=O.timeline,I.play(),I.finished.then(function(){L["delete"](I);});});var w=this.children;w&&w.forEach(function(I){I.activateAnimations&&I.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(O,L){var w=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};O==="mousewheel"&&(O="wheel"),typeof w=="boolean"&&(w={capture:w});var _w8=w,I=_w8.capture,A=_w8.once,W=I?f:x;return this[W][O]=this[W][O]||[],this[W][O].push({listener:L,once:A}),this;}},{key:"animate",value:function animate(O,L){var _this21=this;var w=new i["default"](this,O,L);return this.effects&&w.applyEffects(this.effects),this.layer&&(w.baseTimeline=this.layer.timeline,w.play(),w.finished.then(function(){_this21[v]["delete"](w);})),this[v].add(w),w;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,O=new Array(_len7),_key7=0;_key7<_len7;_key7++){O[_key7]=arguments[_key7];}if(O.length===0)return this.attributes[P];if(O.length>1){var L=O[0],w=O[1];return typeof w=="function"&&(w=w(this.attr(L))),this.setAttribute(L,w),this;}return typeof O[0]=="string"?this.getAttribute(O[0]):(Object.assign(this.attributes,O[0]),this);}},{key:"cloneNode",value:function cloneNode(){var O=new this.constructor(),L=this.attributes[y];return O.attr(L),O;}},{key:"connect",value:function connect(O,L){Object.defineProperty(this,"parent",{value:O,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:L,writable:!1,configurable:!0}),O.timeline&&this.activateAnimations(),this.setResolution(O.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:O,zOrder:L}});}},{key:"contains",value:function contains(O){for(;O&&this!==O;)O=O.parent;return!!O;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[v].forEach(function(L){return L.cancel();});var O=this.children;O&&O.forEach(function(L){L.deactivateAnimations&&L.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var O=this.parent,L=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:O,zOrder:L}}),O&&O.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(O){var _this22=this;O instanceof o["default"]||(O=new o["default"](O)),O.target=this;var L=O.type;L==="mousewheel"&&(L="wheel");var w=[this];var I=this.parent;for(;O.bubbles&&I;)w.push(I),I=I.parent;for(var A=w.length-1;A>=0;A--){var W=w[A],z=W[f]&&W[f][L];if(z&&z.length&&(O.currentTarget=W,z.forEach(function(_ref97){var K=_ref97.listener,k=_ref97.once;K.call(_this22,O),k&&w.removeEventListener(K);}),delete O.currentTarget),!O.bubbles&&O.cancelBubble)break;}if(!O.cancelBubble)for(var _A4=0;_A4<w.length;_A4++){var _W=w[_A4],_z3=_W[x]&&_W[x][L];if(_z3&&_z3.length&&(O.currentTarget=_W,_z3.forEach(function(_ref98){var K=_ref98.listener,k=_ref98.once;K.call(_this22,O),k&&w.removeEventListener(K);}),delete O.currentTarget),!O.bubbles||O.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(O){var L=O.layerX,w=O.layerY;return this.isPointCollision(L,w)?(this.dispatchEvent(O),!0):!1;}},{key:"draw",value:function draw(){var _this23=this;var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var L=this.mesh;if(L){if(Object(s.applyFilters)(L,this.filters),O.push(L),this[m]){L.setProgram(this[m]);var w=this[M];w&&Object.entries(w).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),A=_ref100[0],W=_ref100[1];L.setAttribute(A,W);});var I=this[E];if(this[E]){var A={};Object.entries(I).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],z=_ref102[1];typeof z=="function"&&(z=z(_this23,W)),A[W]=z;}),L.setUniforms(A);}}Object(l["default"])(this,L);}return O;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(O){return this.attributes[O];}},{key:"getListeners",value:function getListeners(O){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?f:x][O]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(O===0)return this;var L=this.parent.children,w=L.indexOf(this);return L[w+O];}},{key:"getWorldPosition",value:function getWorldPosition(O,L){var w=this.renderMatrix,I=O*w[0]+L*w[2]+w[4],A=O*w[1]+L*w[3]+w[5];return[I,A];}},{key:"getOffsetPosition",value:function getOffsetPosition(O,L){var w=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=O*w[0]+L*w[2]+w[4],A=O*w[1]+L*w[3]+w[5];return[I,A];}},{key:"getResolution",value:function getResolution(){return c({},this[T]);}},{key:"isPointCollision",value:function isPointCollision(O,L){if(!this.mesh)return!1;var w=this.attributes.pointerEvents;if(w==="none"||w!=="all"&&!this.isVisible)return!1;var I="both";return w==="visibleFill"&&(I="fill"),w==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(O,L,I);}},{key:"onPropertyChange",value:function onPropertyChange(O,L,w){O!=="id"&&O!=="name"&&O!=="className"&&O!=="pointerEvents"&&O!=="passEvents"&&this.forceUpdate(),O==="filter"&&(this[g]=Object(s.parseFilterString)(L)),O==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(O,L){O==="attrs"&&this.attr(L),this.attributes[O]=L;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
|
|
232
|
+
},{key:"setProgram",value:function setProgram(O){this[m]=O,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(O,L){this[M]=this[M]||{},this[M][O]=L,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(O){this[E]=this[E]||{},Object.assign(this[E],O),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref104){var O=_ref104.width,L=_ref104.height;var _this$T3=this[T],w=_this$T3.width,I=_this$T3.height;(w!==O||I!==L)&&(this[T]={width:O,height:L},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:O,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(O){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof L=="boolean"&&(L={capture:L});var I=L.capture?f:x;return this[I][O]&&(this[I][O]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(O){this.setAttribute(O,null);}},{key:"removeEventListener",value:function removeEventListener(O,L){var w=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof w=="boolean"&&(w={capture:w});var A=w.capture?f:x;if(this[A][O]){var W=this[A][O];if(W)for(var z=0;z<W.length;z++){var K=W[z].listener;if(K===L){this[A][O].splice(z,1);break;}}}return this;}},{key:"transition",value:function transition(O){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var w=this,I=Symbol("animation");L=L||"linear";var A=0;return _typeof(O)=="object"&&(A=O.delay||0,O=O.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},I,null),"cancel",function cancel(){var W=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var z=this[I];z&&z.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 z=W.timing.direction;W.timing.direction=z==="reverse"?"normal":"reverse",W.play();}return W.finished;}),"attr",function attr(W,z){return this.end(),typeof W=="string"&&(W=_defineProperty({},W,z)),Object.entries(W).forEach(function(_ref105){var _ref106=_slicedToArray(_ref105,2),K=_ref106[0],k=_ref106[1];typeof k=="function"&&(W[K]=k(w.attr(K)));}),this[I]=w.animate([W],{duration:O*1e3,delay:A*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();p(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"),l=Symbol["for"]("spritejs_getAttribute"),d=Symbol["for"]("spritejs_attributes"),c=Symbol["for"]("spritejs_changedAttrs"),p=Symbol("subject"),y=Symbol("attr"),P=Symbol("default"),T=Symbol("alias");function v(b,_ref108){var _ref109=_slicedToArray(_ref108,2),O=_ref109[0],L=_ref109[1];var w=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(b).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),I=_ref111[0],A=_ref111[1];if((O||L)&&(w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[O,L])),I==="matrix")w=e.mat2d.multiply(w,w,A);else if(I==="offsetTranslate")w[4]+=A[0],w[5]+=A[1];else if(I==="offsetRotate")w=e.mat2d.rotate(Array.of(0,0,0,0,0,0),w,A);else if(I==="skew"){var _A5=_slicedToArray(A,2),W=_A5[0],z=_A5[1];w=e.mat2d.multiply(w,w,e.mat2d.fromValues(1,Math.tan(z),Math.tan(W),1,0,0));}else e.mat2d[I](w,w,A);(O||L)&&(w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-O,-L]));}),w;}var x=Symbol("transformMatrix"),f=Symbol("transforms"),g=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),m=Symbol("offsetFigure");function M(b,O,L){var w=b[y][O];if(b[s](O,L,!1)||b[u]!==O){var A=b[f];A.has(O)&&A["delete"](O),L&&(O==="rotate"&&(L=Math.PI*L/180),O==="scale"&&(L=L.map(function(W){return Math.abs(W)>1e-5?W:1/W>0?1e-5:-1e-5;})),A.set(O,L)),b[x]=null,b[p].onPropertyChange(O,L,w,b);}}function E(b){var O=b[m],L=b.offsetDistance*O.getTotalLength(),w=O.getPointAtLength(L);if(w){var I=b[f];var A=b.offsetRotate;A==="auto"?A=w.angle:A==="reverse"?A=Math.PI+w.angle:A=Math.PI*A/180,I.set("offsetRotate",A),I.set("offsetTranslate",[w.x,w.y]),b[x]=null;}}var R=/*#__PURE__*/function(){function R(O){var _this24=this;_classCallCheck(this,R);this[p]=O,this[y]={},this[x]=e.mat2d.fromValues(1,0,0,1,0,0),this[f]=/* @__PURE__ */new Map(),this[P]={},this[T]=[],Object.defineProperty(O,"transformMatrix",{get:function get(){return _this24[x]||(_this24[x]=v(_this24[f],_this24.transformOrigin)),_toConsumableArray(_this24[x]);}}),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
|
|
233
|
+
filter:"none",display:""}),this[o]("class","pos"),this[g]=/* @__PURE__ */new Set(),this[m]=new n.Figure2D({scale:5,simplify:0});}return _createClass(R,[{key:c,get:function get(){var _this25=this;var O={};return _toConsumableArray(this[g]).forEach(function(L){O[L]=_this25[y][L];}),O;}},{key:d,get:function get(){var O=Object.assign({},this[y]);for(var L=0;L<this[T].length;L++){var w=this[T][L];O[w]=this[w];}return O;}},{key:a,value:function value(O){Object.assign(this[P],O),Object.assign(this[y],O);}},{key:o,value:function value(){var _this$T4;(_this$T4=this[T]).push.apply(_this$T4,arguments);}},{key:s,value:function value(O,L){var w=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[y][O],A=this[p];return L==null&&(L=this[P][O]),Object(i.compareValue)(I,L)?!1:(this[y][O]=L,this[g].has(O)&&this[g]["delete"](O),this[g].add(O),this[u]=O,w&&A.onPropertyChange(O,L,I,this),!0);}},{key:l,value:function value(O){return this[y][O];}},{key:"id",get:function get(){return this[l]("id");},set:function set(O){this[s]("id",O);}},{key:"name",get:function get(){return this[l]("name");},set:function set(O){this[s]("name",O);}},{key:"className",get:function get(){return this[l]("className");},set:function set(O){this[s]("className",O);}},{key:"class",get:function get(){return this.className;},set:function set(O){this.className=O;}},{key:"x",get:function get(){return this[l]("x");},set:function set(O){this[s]("x",Object(i.toNumber)(O));}},{key:"y",get:function get(){return this[l]("y");},set:function set(O){this[s]("y",Object(i.toNumber)(O));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(O){O=Object(i.toArray)(O),Array.isArray(O)||(O=[O,O]),this.x=O[0],this.y=O[1];}},{key:"transform",get:function get(){return this[l]("transform");},set:function set(O){var L=null;if(Array.isArray(O)&&(L=O,O="matrix(".concat(O.map(i.toNumber).join(),")")),typeof O=="string")O=O.replace(/\s*,\s*/g,",");else if(O!=null)throw new TypeError("Invalid transform value.");var w=this[y].transform;if(this[s]("transform",O,!1)){var I=this[f];if(I.has("matrix")&&I["delete"]("matrix"),L)I.set("matrix",L);else if(O){var A=O.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(A){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var z=0;z<A.length;z++){var k=A[z].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(k){var _k2=_slicedToArray(k,3),q=_k2[1],U=_k2[2];q==="rotate"?U=Math.PI*parseFloat(U)/180:U=U.trim().split(/[\s,]+/).map(function(G){return Object(i.toNumber)(G);}),q==="matrix"?W=e.mat2d.multiply(W,W,U):q==="skew"?W=e.mat2d.multiply(W,W,e.mat2d.fromValues(1,Math.tan(U[1]),Math.tan(U[0]),1,0,0)):e.mat2d[q](W,W,U),I.set("matrix",W);}}}else throw new TypeError("Invalid transform value.");}this[x]=null,this[p].onPropertyChange("transform",O,w,this);}}},{key:"transformOrigin",get:function get(){return this[l]("transformOrigin");},set:function set(O){O=Object(i.toArray)(O,!0),O!=null&&!Array.isArray(O)&&(O=[O,O]),this[s]("transformOrigin",O)&&(this[x]=null);}},{key:"rotate",get:function get(){return this[l]("rotate");},set:function set(O){M(this,"rotate",O);}},{key:"translate",get:function get(){return this[l]("translate");},set:function set(O){O=Object(i.toArray)(O,!0),O!=null&&!Array.isArray(O)&&(O=[O,O]),M(this,"translate",O);}},{key:"scale",get:function get(){return this[l]("scale");},set:function set(O){O=Object(i.toArray)(O,!0),O!=null&&!Array.isArray(O)&&(O=[O,O]),M(this,"scale",O);}},{key:"skew",get:function get(){return this[l]("skew");},set:function set(O){O=Object(i.toArray)(O,!0),O!=null&&!Array.isArray(O)&&(O=[O,O]),M(this,"skew",O);}},{key:"opacity",get:function get(){return this[l]("opacity");},set:function set(O){O!=null&&(O=Number(O)),this[s]("opacity",O);}},{key:"zIndex",get:function get(){return this[l]("zIndex");},set:function set(O){O!=null&&(O=Number(O)),this[s]("zIndex",O);}},{key:"offsetPath",get:function get(){return this[l]("offsetPath");},set:function set(O){this[s]("offsetPath",O)&&(this[m].beginPath(),O!=null&&this[m].addPath(O),E(this));}},{key:"offsetDistance",get:function get(){return this[l]("offsetDistance");},set:function set(O){this[s]("offsetDistance",Object(i.toNumber)(O))&&E(this);}},{key:"offsetRotate",get:function get(){return this[l]("offsetRotate");},set:function set(O){this[s]("offsetRotate",O),E(this);}},{key:"pointerEvents",get:function get(){return this[l]("pointerEvents");},set:function set(O){if(O!=null&&O!=="none"&&O!=="visible"&&O!=="visibleFill"&&O!=="visibleStroke"&&O!=="all")throw new TypeError("Invalid pointerEvents type.");this[s]("pointerEvents",O);}},{key:"filter",get:function get(){return this[l]("filter");},set:function set(O){this[s]("filter",O);}},{key:"display",get:function get(){return this[l]("display");},set:function set(O){this[s]("display",O);}/* istanbul ignore next */},{key:"offset",set:function set(O){}}],[{key:"setDefault",value:function setDefault(O){for(var _len8=arguments.length,L=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){L[_key8-1]=arguments[_key8];}return O[a].apply(O,L);}},{key:"declareAlias",value:function declareAlias(O){for(var _len9=arguments.length,L=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){L[_key9-1]=arguments[_key9];}return O[o].apply(O,L);}},{key:"setAttribute",value:function setAttribute(O){for(var _len10=arguments.length,L=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){L[_key10-1]=arguments[_key10];}return O[s].apply(O,L);}},{key:"getAttribute",value:function getAttribute(O){for(var _len11=arguments.length,L=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){L[_key11-1]=arguments[_key11];}return O[l].apply(O,L);}},{key:"getAttributes",value:function getAttributes(O){return O[d];}},{key:"getChangedAttributes",value:function getChangedAttributes(O){return O[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,l){var d=s.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);d?s={size:parseFloat(d[1]),unit:d[2]}:s={size:parseFloat(s),unit:"px"};var _s3=s,c=_s3.size,p=_s3.unit;if(p==="pt")c/=0.75;else if(p==="pc")c*=16;else if(p==="in")c*=96;else if(p==="cm")c*=96/2.54;else if(p==="mm")c*=96/25.4;else if(p==="em"||p==="rem"||p==="ex"){if(!l&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var y=getComputedStyle(document.documentElement).fontSize;y?l=e(y,16):l=16;}c*=l,p==="ex"&&(c/=2);}else if(p==="q")c*=96/25.4/4;else if(p==="vw"||p==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y3=p==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;c*=_y3/100;}}else if((p==="vmax"||p==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y4=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;p==="vmax"?c*=Math.max(_y4,P)/100:c*=Math.min(_y4,P)/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 l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return s===""?null:(typeof s=="string"&&(s=s.split(/[\s,]+/g)),Array.isArray(s)&&(l&&(s=s.map(i)),s.length===1)?s[0]:s);}function o(s,l){if(Array.isArray(s)&&Array.isArray(l)){if(s.length!==l.length)return!1;for(var d=0;d<s.length;d++)if(s[d]!==l[d])return!1;return!0;}return s==null&&l==null||s===l;}},/* 73 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(74),n=t(32),i=/* @__PURE__ */t.n(n),a=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(){return s=Object.assign||function(y){for(var P=1;P<arguments.length;P++){var T=arguments[P];for(var v in T)Object.prototype.hasOwnProperty.call(T,v)&&(y[v]=T[v]);}return y;},s.apply(this,arguments);}function l(y){if(typeof y=="string"){if(y=y.trim(),/^[0-9.]+%$/.test(y))return parseFloat(y)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(y))return Object(o.sizeToPixel)(y);}return y;}function d(y,P,T,v,x){return typeof y=="string"&&(y=i()(y)),typeof P=="string"&&(P=i()(P)),e.Effects["default"](y,P,T,v,x);}function c(y,P,T,v,x){return e.Effects["default"](y,P,T,v,x);}e.Effects["default"]=function(y,P,T,v,x){return Array.isArray(y)&&Array.isArray(P)?y.map(function(f,g){return f+(T-v)/(x-v)*(P[g]-f);}):typeof y=="number"&&typeof P=="number"?y+(T-v)/(x-v)*(P-y):T-v>x-T?P:y;},e.Effects.fillColor=d,e.Effects.strokeColor=d,e.Effects.bgcolor=d,e.Effects.borderColor=d,e.Effects.text=c;var p=/*#__PURE__*/function(_e$Animator){function p(P,T,v){var _this26;_classCallCheck(this,p);var x=P.attr();Object.entries(x).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),f=_ref113[0],g=_ref113[1];x[f]=e.Effects[f]?g:l(g);}),T=T.map(function(f){var g=s({},f);var u={};return Object.entries(g).forEach(function(_ref114){var _ref115=_slicedToArray(_ref114,2),m=_ref115[0],M=_ref115[1];u[m]=e.Effects[m]?M:l(M);}),u;}),_this26=_callSuper(this,p,[x,T,v]),_this26.target=P,_this26.setter=function(f,g){g.attr(f);};return _this26;}_inherits(p,_e$Animator);return _createClass(p,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(p,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this27=this;return _superPropGet(p,"finished",this,1).then(function(){var P=_this27;return new Promise(function(T){function v(){P.setter(P.frame,P.target);var x=P.playState;x==="finished"||x==="idle"?(Object(a.cancelAnimationFrame)(P.requestId),T()):Object(a.requestAnimationFrame)(v);}v();});});}},{key:"finish",value:function finish(){_superPropGet(p,"finish",this,3)([]),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(p,"play",this,3)([]),this.setter(this.frame,this.target);var P=this;this.ready.then(function(){P.setter(P.frame,P.target),P.requestId=Object(a.requestAnimationFrame)(function T(){var v=P.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&v.layer&&v.layer.canvas&&!document.documentElement.contains(v.layer.canvas)){P.cancel();return;}var x=P.playState;P.setter(P.frame,P.target),x!=="idle"&&(x==="running"?P.requestId=Object(a.requestAnimationFrame)(T):(x==="paused"||x==="pending"&&P.timeline.currentTime<0)&&P.ready.then(function(){P.setter(P.frame,P.target),P.requestId=Object(a.requestAnimationFrame)(T);}));});});}},{key:"cancel",value:function cancel(){var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(a.cancelAnimationFrame)(this.requestId),P?(this.setter(this.frame,this.target),_superPropGet(p,"cancel",this,3)([])):(_superPropGet(p,"cancel",this,3)([]),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=d(e),i=t(187),a=d(i),o=t(188),s=t(190),l=d(s);function d(c){return c&&c.__esModule?c:{"default":c};}r.Animator=l["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=f(e),i=t(133),a=f(i),o=t(141),s=f(o),l=t(164),d=f(l),c=t(170),p=f(c),y=t(171),P=f(y),T=t(175),v=f(T),x=t(186);function f(w){return w&&w.__esModule?w:{"default":w};}var g=(0,x.createNowTime)(),u={originTime:0,playbackRate:1},m=(0,v["default"])("timeMark"),M=(0,v["default"])("playbackRate"),E=(0,v["default"])("timers"),R=(0,v["default"])("originTime"),b=(0,v["default"])("setTimer"),O=(0,v["default"])("parent"),L=function(){function w(I,A){(0,p["default"])(this,w),I instanceof w&&(A=I,I={}),I=(0,d["default"])({},u,I),A&&(this[O]=A);var W=I.nowtime||g;if(A)Object.defineProperty(this,"globalTime",{get:function get(){return A.currentTime;}});else{var z=W();Object.defineProperty(this,"globalTime",{get:function get(){return W()-z;}});}this[m]=[{globalTime:this.globalTime,localTime:-I.originTime,entropy:-I.originTime,playbackRate:I.playbackRate,globalEntropy:0}],this[O]&&(this[m][0].globalEntropy=this[O].entropy),this[R]=I.originTime,this[M]=I.playbackRate,this[E]=new s["default"]();}return(0,P["default"])(w,[{key:"markTime",value:function value(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=A.time,z=W===void 0?this.currentTime:W,K=A.entropy,k=K===void 0?this.entropy:K,q=A.playbackRate,U=q===void 0?this.playbackRate:q,G={globalTime:this.globalTime,localTime:z,entropy:k,playbackRate:U,globalEntropy:this.globalEntropy};this[m].push(G);}},{key:"fork",value:function value(A){return new w(A,this);}},{key:"seekGlobalTime",value:function value(A){var W=this.seekTimeMark(A),z=this[m][W],K=z.entropy,k=z.playbackRate,q=z.globalTime;return q+(A-K)/Math.abs(k);}},{key:"seekLocalTime",value:function value(A){var W=this.seekTimeMark(A),z=this[m][W],K=z.localTime,k=z.entropy,q=z.playbackRate;return q>0?K+(A-k):K-(A-k);}},{key:"seekTimeMark",value:function value(A){var W=this[m],z=0,K=W.length-1;if(A<=W[z].entropy)return z;if(A>=W[K].entropy)return K;for(var k=Math.floor((z+K)/2);k>z&&k<K;){if(A===W[k].entropy)return k;A<W[k].entropy?K=k:A>W[k].entropy&&(z=k),k=Math.floor((z+K)/2);}return z;}},{key:"updateTimers",value:function value(){var A=this,W=[].concat((0,a["default"])(this[E]));W.forEach(function(z){var K=(0,n["default"])(z,2),k=K[0],q=K[1];A[b](q.handler,q.time,k);});}},{key:"clearTimeout",value:function(I){function A(W){return I.apply(this,arguments);}return A.toString=function(){return I.toString();},A;}(function(I){var A=this[E].get(I);A&&A.timerID!=null&&(this[O]?this[O].clearTimeout(A.timerID):clearTimeout(A.timerID)),this[E]["delete"](I);})},{key:"clearInterval",value:function value(A){return this.clearTimeout(A);}},{key:"clear",value:function value(){var A=this,W=this[E];[].concat((0,a["default"])(W.keys())).forEach(function(z){A.clearTimeout(z);});}/*
|
|
234
|
+
setTimeout(func, {delay: 100, isEntropy: true})
|
|
235
|
+
setTimeout(func, {entropy: 100})
|
|
236
|
+
setTimeout(func, 100})
|
|
237
|
+
*/},{key:"setTimeout",value:function value(A){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](A,W);}},{key:"setInterval",value:function value(A){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},z=this,K=this[b](function k(){z[b](k,W,K),A();},W);return K;}},{key:b,value:function value(A,W){var z=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,v["default"])("timerID");W=(0,x.formatDelay)(W);var k=this[E].get(K),q=void 0,U=null,G=void 0,Z=void 0;k?(this.clearTimeout(K),W.isEntropy?q=(W.delay-(this.entropy-k.startEntropy))/Math.abs(this.playbackRate):q=(W.delay-(this.currentTime-k.startTime))/this.playbackRate,G=k.startTime,Z=k.startEntropy):(q=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),G=this.currentTime,Z=this.entropy);var nt=this[O],et=nt?nt.setTimeout.bind(nt):setTimeout,tt=W.heading;return!nt&&tt===!1&&q<0&&(q=1/0),(isFinite(q)||nt)&&(q=Math.ceil(q),et!==setTimeout&&(q={delay:q,heading:tt}),U=et(function(){z[E]["delete"](K),A();},q)),this[E].set(K,{timerID:U,handler:A,time:W,startTime:G,startEntropy:Z}),K;}},{key:"parent",get:function get(){return this[O];}},{key:"lastTimeMark",get:function get(){return this[m][this[m].length-1];}},{key:"currentTime",get:function get(){var A=this.lastTimeMark,W=A.localTime,z=A.globalTime;return W+(this.globalTime-z)*this.playbackRate;},set:function set(A){var W=this,z=this.currentTime,K=A,k=this[E];this.markTime({time:A}),[].concat((0,a["default"])(k)).forEach(function(q){var U=(0,n["default"])(q,2),G=U[0],Z=U[1];if(k.has(G)){var nt=Z.time,et=nt.isEntropy,tt=nt.delay,J=nt.heading,ht=Z.handler,dt=Z.startTime;if(et)tt===0&&(ht(),W.clearTimeout(G));else{var B=dt+tt;(tt===0||J!==!1&&(K-z)*tt<=0||z<=B&&B<=K||z>=B&&B>=K)&&(ht(),W.clearTimeout(G));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
|
|
238
|
+
// If current playbackRate is negative, the currentTime should go backwards
|
|
239
|
+
// while the entropy remain to go forwards.
|
|
240
|
+
// Both of the initial values is set to -originTime
|
|
241
|
+
},{key:"entropy",get:function get(){var A=this.lastTimeMark,W=A.entropy,z=A.globalEntropy;return W+Math.abs((this.globalEntropy-z)*this.playbackRate);},// get globalTime() {
|
|
242
|
+
// if(this[_parent]) {
|
|
243
|
+
// return this[_parent].currentTime;
|
|
244
|
+
// }
|
|
245
|
+
// return nowtime();
|
|
246
|
+
// }
|
|
247
|
+
// change entropy will NOT cause currentTime changing but may influence the pass
|
|
248
|
+
// and the future of the timeline. (It may change the result of seek***Time)
|
|
249
|
+
// While entropy is set, all the marks behind will be droped
|
|
250
|
+
set:function set(A){if(this.entropy>A){var W=this.seekTimeMark(A);this[m].length=W+1;}this.markTime({entropy:A}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[O]?this[O].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[M];},set:function set(A){A!==this.playbackRate&&(this.markTime({playbackRate:A}),this[M]=A,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var A=this.parent;A;){if(A.playbackRate===0)return!0;A=A.parent;}return!1;}}]),w;}();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(l,d){var c=[],p=!0,y=!1,P=void 0;try{for(var T=(0,a["default"])(l),v;!(p=(v=T.next()).done)&&(c.push(v.value),!(d&&c.length===d));p=!0);}catch(x){y=!0,P=x;}finally{try{!p&&T["return"]&&T["return"]();}finally{if(y)throw P;}}return c;}return function(l,d){if(Array.isArray(l))return l;if((0,n["default"])(Object(l)))return s(l,d);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 l=o[s],d=e[l],c=d&&d.prototype;c&&!c[a]&&n(c,a,l),i[l]=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,l=this._i++;return!o||l>=o.length?(this._t=void 0,n(1)):s=="keys"?n(0,l):s=="values"?n(0,o[l]):n(0,[l,o[l]]);},"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),l=t(121),d=t(123),c=t(122)("iterator"),p=!([].keys&&"next"in[].keys()),y="@@iterator",P="keys",T="values",v=function v(){return this;};h.exports=function(x,f,g,u,m,M,E){s(g,f,u);var R=function R(U){if(!p&&U in w)return w[U];switch(U){case P:return function(){return new g(this,U);};case T:return function(){return new g(this,U);};}return function(){return new g(this,U);};},b=f+" Iterator",O=m==T,L=!1,w=x.prototype,I=w[c]||w[y]||m&&w[m],A=I||R(m),W=m?O?R("entries"):A:void 0,z=f=="Array"&&w.entries||I,K,k,q;if(z&&(q=d(z.call(new x())),q!==Object.prototype&&q.next&&(l(q,b,!0),!e&&typeof q[c]!="function"&&a(q,c,v))),O&&I&&I.name!==T&&(L=!0,A=function A(){return I.call(this);}),(!e||E)&&(p||L||!w[c])&&a(w,c,A),o[f]=A,o[b]=v,m)if(K={values:O?A:R(T),keys:M?A:R(P),entries:W},E)for(k in K)k in w||i(w,k,K[k]);else n(n.P+n.F*(p||L),f,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",_l2=function l(d,c,p){var y=d&_l2.F,P=d&_l2.G,T=d&_l2.S,v=d&_l2.P,x=d&_l2.B,f=d&_l2.W,g=P?n:n[c]||(n[c]={}),u=g[s],m=P?e:T?e[c]:(e[c]||{})[s],M,E,R;P&&(p=c);for(M in p)E=!y&&m&&m[M]!==void 0,!(E&&o(g,M))&&(R=E?m[M]:p[M],g[M]=P&&typeof m[M]!="function"?p[M]:x&&E?i(R,e):f&&m[M]==R?function(b){var O=function O(L,w,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,w);}return new b(L,w,I);}return b.apply(this,arguments);};return O[s]=b[s],O;}(R):v&&typeof R=="function"?i(Function.call,R):R,v&&((g.virtual||(g.virtual={}))[M]=R,d&_l2.R&&u&&!u[M]&&a(u,M,R)));};_l2.F=1,_l2.G=2,_l2.S=4,_l2.P=8,_l2.B=16,_l2.W=32,_l2.U=64,_l2.R=128,h.exports=_l2;},/* 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,l){return n.call(i,o,s,l);};}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,l,d){if(e(s),l=i(l,!0),e(d),n)try{return a(s,l,d);}catch(_unused10){}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(s[l]=d.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(_unused11){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,l){o.prototype=e(a,{next:n(1,l)}),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",_l3=function l(){var d=t(102)("iframe"),c=i.length,p="<",y=">",P;for(d.style.display="none",t(120).appendChild(d),d.src="javascript:",P=d.contentWindow.document,P.open(),P.write(p+"script"+y+"document.F=Object"+p+"/script"+y),P.close(),_l3=P.F;c--;)delete _l3[s][i[c]];return _l3();};h.exports=Object.create||function(c,p){var y;return c!==null?(o[s]=e(c),y=new o(),o[s]=null,y[a]=c):y=_l3(),p===void 0?y:n(y,p);};},/* 109 */ /***/function(h,r,t){var e=t(96),n=t(97),i=t(110);h.exports=t(100)?Object.defineProperties:function(o,s){n(o);for(var l=i(s),d=l.length,c=0,p;d>c;)e.f(o,p=l[c++],s[p]);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 l=n(o),d=0,c=[],p;for(p in l)p!=a&&e(l,p)&&c.push(p);for(;s.length>d;)e(l,p=s[d++])&&(~i(c,p)||c.push(p));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,l){var d=e(o),c=n(d.length),p=i(l,c),y;if(a&&s!=s){for(;c>p;)if(y=d[p++],y!=y)return!0;}else for(;c>p;p++)if((a||p in d)&&d[p]===s)return a||p||0;return!a&&-1;};};},/* 113 */ /***/function(h,r,t){var e=t(114),n=Math.min;h.exports=function(i){return i>0?n(e(i),9007199254740991):0;};},/* 114 */ /***/function(h,r){var t=Math.ceil,e=Math.floor;h.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n);};},/* 115 */ /***/function(h,r,t){var e=t(114),n=Math.max,i=Math.min;h.exports=function(a,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)),l=e(o),d=s.length,c,p;return l<0||l>=d?i?"":void 0:(c=s.charCodeAt(l),c<55296||c>56319||l+1===d||(p=s.charCodeAt(l+1))<56320||p>57343?i?s.charAt(l):c:i?s.slice(l,l+2):(c-55296<<10)+(p-56320)+65536);};};},/* 127 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).isIterable=function(a){var 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(_unused12){}};h.exports=function(o){var s,l,d;return o===void 0?"Undefined":o===null?"Null":typeof(l=a(s=Object(o),n))=="string"?l:i?e(s):(d=e(s))=="Object"&&typeof s.callee=="function"?"Arguments":d;};},/* 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),l=t(139),d=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)
|
|
251
|
+
from:function from(p){var y=i(p),P=typeof this=="function"?this:Array,T=arguments.length,v=T>1?arguments[1]:void 0,x=v!==void 0,f=0,g=d(y),u,m,M,E;if(x&&(v=e(v,T>2?arguments[2]:void 0,2)),g!=null&&!(P==Array&&o(g)))for(E=g.call(y),m=new P();!(M=E.next()).done;f++)l(m,f,x?a(E,v,[M.value,f],!0):M.value);else for(u=s(y.length),m=new P(u);u>f;f++)l(m,f,x?v(y[f],f):y[f]);return m.length=f,m;}});},/* 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(l){var s=n["return"];throw s!==void 0&&e(s.call(n)),l;}};},/* 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(_unused13){}h.exports=function(a,o){if(!o&&!n)return!1;var s=!1;try{var l=[7],d=l[e]();d.next=function(){return{done:s=!0};},l[e]=function(){return d;},a(l);}catch(_unused14){}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)
|
|
252
|
+
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)
|
|
253
|
+
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),l=t(88),d=t(82),c=t(149),p=t(100),y=t(150).fastKey,P=t(151),T=p?"_s":"size",v=function v(x,f){var g=y(f),u;if(g!=="F")return x._i[g];for(u=x._f;u;u=u.n)if(u.k==f)return u;};h.exports={getConstructor:function getConstructor(x,f,g,u){var m=x(function(M,E){o(M,m,f,"_i"),M._t=f,M._i=n(null),M._f=void 0,M._l=void 0,M[T]=0,E!=null&&s(E,g,M[u],M);});return i(m.prototype,{// 23.1.3.1 Map.prototype.clear()
|
|
254
|
+
// 23.2.3.2 Set.prototype.clear()
|
|
255
|
+
clear:function clear(){for(var E=P(this,f),R=E._i,b=E._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete R[b.i];E._f=E._l=void 0,E[T]=0;},// 23.1.3.3 Map.prototype.delete(key)
|
|
256
|
+
// 23.2.3.4 Set.prototype.delete(value)
|
|
257
|
+
"delete":function _delete(M){var E=P(this,f),R=v(E,M);if(R){var b=R.n,O=R.p;delete E._i[R.i],R.r=!0,O&&(O.n=b),b&&(b.p=O),E._f==R&&(E._f=b),E._l==R&&(E._l=O),E[T]--;}return!!R;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
|
|
258
|
+
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
|
|
259
|
+
forEach:function forEach(E){P(this,f);for(var R=a(E,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)
|
|
260
|
+
// 23.2.3.7 Set.prototype.has(value)
|
|
261
|
+
has:function has(E){return!!v(P(this,f),E);}}),p&&e(m.prototype,"size",{get:function get(){return P(this,f)[T];}}),m;},def:function def(x,f,g){var u=v(x,f),m,M;return u?u.v=g:(x._l=u={i:M=y(f,!0),// <- index
|
|
262
|
+
k:f,// <- key
|
|
263
|
+
v:g,// <- value
|
|
264
|
+
p:m=x._l,// <- previous entry
|
|
265
|
+
n:void 0,// <- next entry
|
|
266
|
+
r:!1// <- removed
|
|
267
|
+
},x._f||(x._f=u),m&&(m.n=u),x[T]++,M!=="F"&&(x._i[M]=u)),x;},getEntry:v,setStrong:function setStrong(x,f,g){l(x,f,function(u,m){this._t=P(u,f),this._k=m,this._l=void 0;},function(){for(var u=this,m=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,d(1)):m=="keys"?d(0,M.k):m=="values"?d(0,M.v):d(0,[M.k,M.v]);},g?"entries":"values",!g,!0),c(f);}};},/* 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),l={},d={},c=h.exports=function(p,y,P,T,v){var x=v?function(){return p;}:s(p),f=e(P,T,y?2:1),g=0,u,m,M,E;if(typeof x!="function")throw TypeError(p+" is not iterable!");if(i(x)){for(u=o(p.length);u>g;g++)if(E=y?f(a(m=p[g])[0],m[1]):f(p[g]),E===l||E===d)return E;}else for(M=x.call(p);!(m=M.next()).done;)if(E=n(M,f,m.value,y),E===l||E===d)return E;};c.BREAK=l,c.RETURN=d;},/* 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 l=typeof n[s]=="function"?n[s]:e[s];a&&l&&!l[o]&&i.f(l,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;},l=!t(101)(function(){return s(Object.preventExtensions({}));}),d=function d(T){a(T,e,{value:{i:"O"+ ++o,// object ID
|
|
268
|
+
w:{}// weak collections IDs
|
|
269
|
+
}});},c=function c(T,v){if(!n(T))return _typeof(T)=="symbol"?T:(typeof T=="string"?"S":"P")+T;if(!i(T,e)){if(!s(T))return"F";if(!v)return"E";d(T);}return T[e].i;},p=function p(T,v){if(!i(T,e)){if(!s(T))return!0;if(!v)return!1;d(T);}return T[e].w;},y=function y(T){return l&&P.NEED&&s(T)&&!i(T,e)&&d(T),T;},P=h.exports={KEY:e,NEED:!1,fastKey:c,getWeak:p,onFreeze:y};},/* 151 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 */ /***/function(h,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),o=t(95),s=t(146),l=t(148),d=t(147),c=t(98),p=t(121),y=t(96).f,P=t(153)(0),T=t(100);h.exports=function(v,x,f,g,u,m){var M=e[v],E=M,R=u?"set":"add",b=E&&E.prototype,O={};return!T||typeof E!="function"||!(m||b.forEach&&!a(function(){new E().entries().next();}))?(E=g.getConstructor(x,v,u,R),s(E.prototype,f),i.NEED=!0):(E=x(function(L,w){d(L,E,v,"_c"),L._c=new M(),w!=null&&l(w,u,L[R],L);}),P("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(L){var w=L=="add"||L=="set";L in b&&!(m&&L=="clear")&&o(E.prototype,L,function(I,A){if(d(this,E,L),!w&&m&&!c(I))return L=="get"?void 0:!1;var W=this._c[L](I===0?0:I,A);return w?this:W;});}),m||y(E.prototype,"size",{get:function get(){return this._c.size;}})),p(E,v),O[v]=E,n(n.G+n.W+n.F,O),m||g.setStrong(E,v,u),E;};},/* 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,l){var d=s==1,c=s==2,p=s==3,y=s==4,P=s==6,T=s==5||P,v=l||o;return function(x,f,g){for(var u=i(x),m=n(u),M=e(f,g,3),E=a(m.length),R=0,b=d?v(x,E):c?v(x,0):void 0,O,L;E>R;R++)if((T||R in m)&&(O=m[R],L=M(O,R,u),s)){if(d)b[R]=L;else if(L)switch(s){case 3:return!0;case 5:return O;case 6:return R;case 2:b.push(O);}else if(y)return!1;}return P?-1:p||y?y:b;};};},/* 154 */ /***/function(h,r,t){var e=t(155);h.exports=function(n,i){return new(e(n))(i);};},/* 155 */ /***/function(h,r,t){var e=t(98),n=t(156),i=t(122)("species");h.exports=function(a){var 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(l){var d=arguments[1],c,p,y,P;return n(this),c=d!==void 0,c&&n(d),l==null?new this():(p=[],c?(y=0,P=i(d,arguments[2],2),a(l,!1,function(T){p.push(P(T,y++));})):a(l,!1,p.push,p),new this(p));}});};},/* 164 */ /***/function(h,r,t){h.exports={"default":t(165),__esModule:!0};},/* 165 */ /***/function(h,r,t){t(166),h.exports=t(92).Object.assign;},/* 166 */ /***/function(h,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)});},/* 167 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),o=t(124),s=t(85),l=Object.assign;h.exports=!l||t(101)(function(){var d={},c={},p=Symbol(),y="abcdefghijklmnopqrst";return d[p]=7,y.split("").forEach(function(P){c[P]=P;}),l({},d)[p]!=7||Object.keys(l({},c)).join("")!=y;})?function(c,p){for(var y=o(c),P=arguments.length,T=1,v=i.f,x=a.f;P>T;)for(var f=s(arguments[T++]),g=v?n(f).concat(v(f)):n(f),u=g.length,m=0,M;u>m;)M=g[m++],(!e||x.call(f,M))&&(y[M]=f[M]);return y;}:l;},/* 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 l=0;l<s.length;l++){var d=s[l];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),(0,n["default"])(o,d.key,d);}}return function(o,s,l){return s&&a(o.prototype,s),l&&a(o,l),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,l=t(101),d=t(117),c=t(121),p=t(118),y=t(122),P=t(178),T=t(179),v=t(180),x=t(156),f=t(97),g=t(98),u=t(124),m=t(84),M=t(103),E=t(104),R=t(108),b=t(181),O=t(183),L=t(168),w=t(96),I=t(110),A=O.f,W=w.f,z=b.f,_K2=e.Symbol,k=e.JSON,q=k&&k.stringify,U="prototype",G=y("_hidden"),Z=y("toPrimitive"),nt={}.propertyIsEnumerable,et=d("symbol-registry"),tt=d("symbols"),J=d("op-symbols"),ht=Object[U],dt=typeof _K2=="function"&&!!L.f,B=e.QObject,F=!B||!B[U]||!B[U].findChild,Y=i&&l(function(){return R(W({},"a",{get:function get(){return W(this,"a",{value:7}).a;}})).a!=7;})?function(at,ot,ft){var mt=A(ht,ot);mt&&delete ht[ot],W(at,ot,ft),mt&&at!==ht&&W(ht,ot,mt);}:W,X=function X(at){var ot=tt[at]=R(_K2[U]);return ot._k=at,ot;},N=dt&&_typeof(_K2.iterator)=="symbol"?function(at){return _typeof(at)=="symbol";}:function(at){return at instanceof _K2;},_$2=function $(ot,ft,mt){return ot===ht&&_$2(J,ft,mt),f(ot),ft=M(ft,!0),f(mt),n(tt,ft)?(mt.enumerable?(n(ot,G)&&ot[G][ft]&&(ot[G][ft]=!1),mt=R(mt,{enumerable:E(0,!1)})):(n(ot,G)||W(ot,G,E(1,{})),ot[G][ft]=!0),Y(ot,ft,mt)):W(ot,ft,mt);},S=function S(ot,ft){f(ot);for(var mt=v(ft=m(ft)),yt=0,pt=mt.length,Tt;pt>yt;)_$2(ot,Tt=mt[yt++],ft[Tt]);return ot;},C=function C(ot,ft){return ft===void 0?R(ot):S(R(ot),ft);},D=function D(ot){var ft=nt.call(this,ot=M(ot,!0));return this===ht&&n(tt,ot)&&!n(J,ot)?!1:ft||!n(this,ot)||!n(tt,ot)||n(this,G)&&this[G][ot]?ft:!0;},j=function j(ot,ft){if(ot=m(ot),ft=M(ft,!0),!(ot===ht&&n(tt,ft)&&!n(J,ft))){var mt=A(ot,ft);return mt&&n(tt,ft)&&!(n(ot,G)&&ot[G][ft])&&(mt.enumerable=!0),mt;}},H=function H(ot){for(var ft=z(m(ot)),mt=[],yt=0,pt;ft.length>yt;)!n(tt,pt=ft[yt++])&&pt!=G&&pt!=s&&mt.push(pt);return mt;},V=function V(ot){for(var ft=ot===ht,mt=z(ft?J:m(ot)),yt=[],pt=0,Tt;mt.length>pt;)n(tt,Tt=mt[pt++])&&(!ft||n(ht,Tt))&&yt.push(tt[Tt]);return yt;};dt||(_K2=function K(){if(this instanceof _K2)throw TypeError("Symbol is not a constructor!");var ot=p(arguments.length>0?arguments[0]:void 0),_ft=function ft(mt){this===ht&&_ft.call(J,mt),n(this,G)&&n(this[G],ot)&&(this[G][ot]=!1),Y(this,ot,E(1,mt));};return i&&F&&Y(ht,ot,{configurable:!0,set:_ft}),X(ot);},o(_K2[U],"toString",function(){return this._k;}),O.f=j,w.f=_$2,t(182).f=b.f=H,t(169).f=D,L.f=V,i&&!t(89)&&o(ht,"propertyIsEnumerable",D,!0),P.f=function(at){return X(y(at));}),a(a.G+a.W+a.F*!dt,{Symbol:_K2});for(var Q=// 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
|
|
270
|
+
"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;Q.length>it;)y(Q[it++]);for(var st=I(y.store),ct=0;st.length>ct;)T(st[ct++]);a(a.S+a.F*!dt,"Symbol",{// 19.4.2.1 Symbol.for(key)
|
|
271
|
+
"for":function _for(at){return n(et,at+="")?et[at]:et[at]=_K2(at);},// 19.4.2.5 Symbol.keyFor(sym)
|
|
272
|
+
keyFor:function keyFor(ot){if(!N(ot))throw TypeError(ot+" is not a symbol!");for(var ft in et)if(et[ft]===ot)return ft;},useSetter:function useSetter(){F=!0;},useSimple:function useSimple(){F=!1;}}),a(a.S+a.F*!dt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
|
|
273
|
+
create:C,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
|
|
274
|
+
defineProperty:_$2,// 19.1.2.3 Object.defineProperties(O, Properties)
|
|
275
|
+
defineProperties:S,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
|
276
|
+
getOwnPropertyDescriptor:j,// 19.1.2.7 Object.getOwnPropertyNames(O)
|
|
277
|
+
getOwnPropertyNames:H,// 19.1.2.8 Object.getOwnPropertySymbols(O)
|
|
278
|
+
getOwnPropertySymbols:V});var gt=l(function(){L.f(1);});a(a.S+a.F*gt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(ot){return L.f(u(ot));}}),k&&a(a.S+a.F*(!dt||l(function(){var at=_K2();return q([at])!="[null]"||q({a:at})!="{}"||q(Object(at))!="{}";})),"JSON",{stringify:function stringify(ot){for(var ft=[ot],mt=1,yt,pt;arguments.length>mt;)ft.push(arguments[mt++]);if(pt=yt=ft[1],!(!g(yt)&&ot===void 0||N(ot)))return x(yt)||(yt=function yt(Tt,It){if(typeof pt=="function"&&(It=pt.call(this,Tt,It)),!N(It))return It;}),ft[1]=yt,q.apply(k,ft);}}),_K2[U][Z]||t(95)(_K2[U],Z,_K2[U].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 l=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});s.charAt(0)!="_"&&!(s in l)&&o(l,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 l=s(a),d=i.f,c=0,p;l.length>c;)d.call(a,p=l[c++])&&o.push(p);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(_unused15){return a.slice();}};h.exports.f=function(l){return a&&i.call(l)=="[object Window]"?o(l):n(e(l));};},/* 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),l=Object.getOwnPropertyDescriptor;r.f=t(100)?l:function(c,p){if(c=i(c),p=a(p,!0),s)try{return l(c,p);}catch(_unused16){}if(o(c,p))return n(!e.f.call(c,p),c[p]);};},/* 184 */ /***/function(h,r,t){t(179)("asyncIterator");},/* 185 */ /***/function(h,r,t){t(179)("observable");},/* 186 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.createNowTime=e,r.formatDelay=n;function e(){var i=null;return Date.now?i=Date.now:i=function i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={// s - startFrame, e - endFrame
|
|
279
|
+
"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=l(e),i=t(133),a=l(i),o=t(141),s=l(o);function l(x){return x&&x.__esModule?x:{"default":x};}var d=t(189),c=new s["default"]();function p(){for(var x=arguments.length,f=Array(x),g=0;g<x;g++)f[g]=arguments[g];var u=c.get(f);return u||(u=d.apply(void 0,f),c.set(f,u),u);}function y(x){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(g,u){for(var m=1;m<u.length;m++){var M=u[m].offset;if(g<=M){var E=u[m-1].offset,R=M,b=(g-E)/(R-E),O=1/x,L=b/O;return f==="end"?L=Math.floor(L):L=Math.ceil(L),O*L*(R-E)+E;}}return 0;};}function P(x){var f=/^cubic-bezier\((.*)\)/,g=x.match(f);if(g){var u=g[1].trim();return u=u.split(",").map(function(O){return parseFloat(O.trim());}),p.apply(void 0,(0,a["default"])(u));}if(f=/^steps\((.*)\)/,g=x.match(f),g){var m=g[1].trim();m=m.split(",").map(function(O){return O.trim();});var M=m,E=(0,n["default"])(M,2),R=E[0],b=E[1];return y(parseInt(R,10),b);}return x;}var T={linear:function linear(f){return f;},ease:p(0.25,0.1,0.25,1),"ease-in":p(0.42,0,1,1),"ease-out":p(0,0,0.58,1),"ease-in-out":p(0.42,0,0.58,1),// 'step-start': function(p, frames){
|
|
280
|
+
// let ret = 0
|
|
281
|
+
// for(let i = 0; i < frames.length; i++){
|
|
282
|
+
// const {offset} = frames[i]
|
|
283
|
+
// ret = offset
|
|
284
|
+
// if(p < offset){
|
|
285
|
+
// break
|
|
286
|
+
// }
|
|
287
|
+
// }
|
|
288
|
+
// return ret
|
|
289
|
+
// },
|
|
290
|
+
// 'step-end': function(p, frames){
|
|
291
|
+
// let ret = 0
|
|
292
|
+
// for(let i = 0; i < frames.length; i++){
|
|
293
|
+
// const {offset} = frames[i]
|
|
294
|
+
// if(p < offset){
|
|
295
|
+
// break
|
|
296
|
+
// }
|
|
297
|
+
// ret = offset
|
|
298
|
+
// }
|
|
299
|
+
// return ret
|
|
300
|
+
// }
|
|
301
|
+
"step-start":y(1,"start"),"step-end":y(1,"end")};function v(x){return typeof x=="string"?T[x]?x=T[x]:x=P(x):x.type==="cubic-bezier"?x=p.apply(void 0,(0,a["default"])(x.value)):x.type==="steps"&&(x=y(x.step,x.pos)),x;}r.Easings=T,r.parseEasing=v;},/* 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 l(x,f){return 1-3*f+3*x;}function d(x,f){return 3*f-6*x;}function c(x){return 3*x;}function p(x,f,g){return((l(f,g)*x+d(f,g))*x+c(f))*x;}function y(x,f,g){return 3*l(f,g)*x*x+2*d(f,g)*x+c(f);}function P(x,f,g,u,m){var M,E,R=0;do E=f+(g-f)/2,M=p(E,u,m)-x,M>0?g=E:f=E;while(Math.abs(M)>n&&++R<i);return E;}function T(x,f,g,u){for(var m=0;m<t;++m){var M=y(f,g,u);if(M===0)return f;var E=p(f,g,u)-x;f-=E/M;}return f;}function v(x){return x;}h.exports=function(f,g,u,m){if(!(0<=f&&f<=1&&0<=u&&u<=1))throw new Error("bezier x values must be in [0, 1] range");if(f===g&&u===m)return v;for(var M=s?new Float32Array(a):new Array(a),E=0;E<a;++E)M[E]=p(E*o,f,u);function R(b){for(var O=0,L=1,w=a-1;L!==w&&M[L]<=b;++L)O+=o;--L;var I=(b-M[L])/(M[L+1]-M[L]),A=O+I*o,W=y(A,f,u);return W>=e?T(b,A,f,u):W===0?A:P(b,O,O+o,f,u);}return function(O){return O===0?0:O===1?1:p(R(O),g,m);};};},/* 190 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=g(e),i=t(204),a=g(i),o=t(164),s=g(o),l=t(170),d=g(l),c=t(171),p=g(c),y=t(175),P=g(y),T=t(75),v=g(T),x=t(208),f=t(188);function g(W){return W&&W.__esModule?W:{"default":W};}var u=(0,P["default"])("timing"),m=(0,P["default"])("keyframes"),M=(0,P["default"])("initState"),E=(0,P["default"])("readyDefer"),R=(0,P["default"])("finishedDefer"),b=(0,P["default"])("effects"),O=(0,P["default"])("activeReadyTimer"),L=(0,P["default"])("activeFinishTimer"),w=(0,P["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},A=function(){function W(z,K,k){var q=this;if((0,d["default"])(this,W),Array.isArray(z)){var U=[z[0],z,K];z=U[0],K=U[1],k=U[2];}typeof k=="number"&&(k={duration:k}),this[u]=(0,s["default"])({},I,k),this[u].easing=(0,f.parseEasing)(this[u].easing),this[m]=(0,x.calculateFramesOffset)(K);var G=this[m][this[m].length-1];this[M]={},(0,a["default"])(G).forEach(function(Z){Object.prototype.hasOwnProperty.call(z,Z)&&Z!=="easing"&&Z!=="offset"&&(q[M][Z]=z[Z]);}),this[m]=this[m].map(function(Z){return(0,s["default"])({},q[M],Z);}),this[m][0].offset!==0&&this[m].unshift((0,s["default"])({},this[M],{offset:0})),G.offset<1&&this[m].push((0,s["default"])({},G,{offset:1})),this[b]={},this.timeline=null;}return(0,p["default"])(W,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:O,value:function value(){var K=this;this[E]&&!this[E].timerID&&(this.timeline.currentTime<0?this[E].timerID=this.timeline.setTimeout(function(){K[E].resolve(),delete K[E];},{delay:-this.timeline.currentTime,heading:!1}):this[E].timerID=this.timeline.setTimeout(function(){K[E].resolve(),delete K[E];},{delay:0,isEntropy:!0}));}},{key:L,value:function value(){var K=this,k=this[u],q=k.duration,U=k.iterations,G=k.endDelay,Z=Math.ceil(q*U+G-this.timeline.currentTime)+1;this[R]&&!this[R].timerID&&(this[R].timerID=this.timeline.setTimeout(function(){K[R].resolve(),K[w](E),K[w](R);},{delay:Z,heading:!1}),this[R].reverseTimerID=this.timeline.setTimeout(function(){K[R].resolve(),K[w](E),K[w](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],k=K.delay,q=K.playbackRate,U=K.timeline;this.timeline=new v["default"]({originTime:k,playbackRate:q},U),this[O](),this[L]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[O]());}},{key:w,value:function value(K){var k=this[K],q=this.timeline;k&&q&&(q.clearTimeout(k.timerID),k.reverseTimerID&&q.clearTimeout(k.reverseTimerID)),delete this[K];}},{key:"cancel",value:function value(){this[w](E),this[w](R),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[w](E),this[w](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,k=this[u],q=k.iterations,U=k.duration,G=k.endDelay,Z="running";if(K==null)Z="idle";else if(K.paused)Z="paused";else if(K.currentTime<0)Z="pending";else{var nt=K.currentTime-q*U;nt>0&&nt<G?Z="pending":nt>=G&&(Z="finished");}return Z;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var K=this[u],k=K.duration,q=K.iterations,U=this.timeline,G=this.playState,Z=void 0;if(G==="idle")Z=0;else if(G==="paused"&&U.currentTime<0)Z=0;else if(G==="pending"){if(U.currentTime<0)Z=0;else{var nt=U.seekLocalTime(q*k);Z=(0,x.periodicity)(nt,k)[1]/k;}}else(G==="running"||G==="paused")&&(Z=(0,x.periodicity)(U.currentTime,k)[1]/k);return G==="finished"&&(Z=(0,x.periodicity)(q,1)[1]),Z;}},{key:"frame",get:function get(){var K=this.playState,k=this[M],q=this[u].fill;if(K==="idle")return k;var U=this.timeline.currentTime,G=this[m].slice(0),Z=(0,x.getProgress)(this.timeline,this[u],this.progress),nt=Z.p,et=Z.inverted,tt=k;return U<0&&K==="pending"?(q==="backwards"||q==="both")&&(tt=et?G[G.length-1]:G[0]):(K!=="pending"&&K!=="finished"||q==="forwards"||q==="both")&&(tt=(0,x.getCurrentFrame)(this[u],G,this[b],nt)),tt;}},{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[E]?this[E].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[E]=(0,x.defer)(),this.timeline&&this[O](),this[E]?this[E].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[R]||(this[R]=(0,x.defer)(),this.timeline&&this[L]()),this[R].promise);}}]),W;}();r["default"]=A;},/* 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),l=t(94),d=t(147),c=t(148),p=t(194),y=t(195).set,P=t(197)(),T=t(198),v=t(199),x=t(200),f=t(201),g="Promise",u=n.TypeError,m=n.process,M=m&&m.versions,E=M&&M.v8||"",_R=n[g],b=a(m)=="process",O=function O(){},L,w,I,A,W=w=T.f,z=!!function(){try{var et=_R.resolve(1),tt=(et.constructor={})[t(122)("species")]=function(J){J(O,O);};return(b||typeof PromiseRejectionEvent=="function")&&et.then(O)instanceof tt&&E.indexOf("6.6")!==0&&x.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),K=function K(et){var tt;return s(et)&&typeof(tt=et.then)=="function"?tt:!1;},k=function k(et,tt){if(!et._n){et._n=!0;var J=et._c;P(function(){for(var ht=et._v,dt=et._s==1,B=0,F=function F(Y){var X=dt?Y.ok:Y.fail,N=Y.resolve,$=Y.reject,S=Y.domain,C,D,j;try{X?(dt||(et._h==2&&G(et),et._h=1),X===!0?C=ht:(S&&S.enter(),C=X(ht),S&&(S.exit(),j=!0)),C===Y.promise?$(u("Promise-chain cycle")):(D=K(C))?D.call(C,N,$):N(C)):$(ht);}catch(H){S&&!j&&S.exit(),$(H);}};J.length>B;)F(J[B++]);et._c=[],et._n=!1,tt&&!et._h&&q(et);});}},q=function q(et){y.call(n,function(){var tt=et._v,J=U(et),ht,dt,B;if(J&&(ht=v(function(){b?m.emit("unhandledRejection",tt,et):(dt=n.onunhandledrejection)?dt({promise:et,reason:tt}):(B=n.console)&&B.error&&B.error("Unhandled promise rejection",tt);}),et._h=b||U(et)?2:1),et._a=void 0,J&&ht.e)throw ht.v;});},U=function U(et){return et._h!==1&&(et._a||et._c).length===0;},G=function G(et){y.call(n,function(){var tt;b?m.emit("rejectionHandled",et):(tt=n.onrejectionhandled)&&tt({promise:et,reason:et._v});});},Z=function Z(et){var tt=this;tt._d||(tt._d=!0,tt=tt._w||tt,tt._v=et,tt._s=2,tt._a||(tt._a=tt._c.slice()),k(tt,!0));},_nt3=function nt(et){var tt=this,J;if(!tt._d){tt._d=!0,tt=tt._w||tt;try{if(tt===et)throw u("Promise can't be resolved itself");(J=K(et))?P(function(){var ht={_w:tt,_d:!1};try{J.call(et,i(_nt3,ht,1),i(Z,ht,1));}catch(dt){Z.call(ht,dt);}}):(tt._v=et,tt._s=1,k(tt,!1));}catch(ht){Z.call({_w:tt,_d:!1},ht);}}};z||(_R=function R(tt){d(this,_R,g,"_h"),l(tt),L.call(this);try{tt(i(_nt3,this,1),i(Z,this,1));}catch(J){Z.call(this,J);}},L=function L(tt){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)
|
|
302
|
+
then:function then(tt,J){var ht=W(p(this,_R));return ht.ok=typeof tt=="function"?tt:!0,ht.fail=typeof J=="function"&&J,ht.domain=b?m.domain:void 0,this._c.push(ht),this._a&&this._a.push(ht),this._s&&k(this,!1),ht.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
|
|
303
|
+
"catch":function _catch(et){return this.then(void 0,et);}}),I=function I(){var et=new L();this.promise=et,this.resolve=i(_nt3,et,1),this.reject=i(Z,et,1);},T.f=W=function W(et){return et===_R||et===A?new I(et):w(et);}),o(o.G+o.W+o.F*!z,{Promise:_R}),t(121)(_R,g),t(149)(g),A=t(92)[g],o(o.S+o.F*!z,g,{// 25.4.4.5 Promise.reject(r)
|
|
304
|
+
reject:function reject(tt){var J=W(this),ht=J.reject;return ht(tt),J.promise;}}),o(o.S+o.F*(e||!z),g,{// 25.4.4.6 Promise.resolve(x)
|
|
305
|
+
resolve:function resolve(tt){return f(e&&this===A?_R:this,tt);}}),o(o.S+o.F*!(z&&t(140)(function(et){_R.all(et)["catch"](O);})),g,{// 25.4.4.1 Promise.all(iterable)
|
|
306
|
+
all:function all(tt){var J=this,ht=W(J),dt=ht.resolve,B=ht.reject,F=v(function(){var Y=[],X=0,N=1;c(tt,!1,function($){var S=X++,C=!1;Y.push(void 0),N++,J.resolve($).then(function(D){C||(C=!0,Y[S]=D,--N||dt(Y));},B);}),--N||dt(Y);});return F.e&&B(F.v),ht.promise;},// 25.4.4.4 Promise.race(iterable)
|
|
307
|
+
race:function race(tt){var J=this,ht=W(J),dt=ht.reject,B=v(function(){c(tt,!1,function(F){J.resolve(F).then(ht.resolve,dt);});});return B.e&&dt(B.v),ht.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,l;return s===void 0||(l=e(s)[i])==null?o:n(l);};},/* 195 */ /***/function(h,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),o=t(91),s=o.process,l=o.setImmediate,d=o.clearImmediate,c=o.MessageChannel,p=o.Dispatch,y=0,P={},T="onreadystatechange",v,x,f,g=function g(){var m=+this;if(P.hasOwnProperty(m)){var M=P[m];delete P[m],M();}},u=function u(m){g.call(m.data);};(!l||!d)&&(l=function l(M){for(var E=[],R=1;arguments.length>R;)E.push(arguments[R++]);return P[++y]=function(){n(typeof M=="function"?M:Function(M),E);},v(y),y;},d=function d(M){delete P[M];},t(86)(s)=="process"?v=function v(m){s.nextTick(e(g,m,1));}:p&&p.now?v=function v(m){p.now(e(g,m,1));}:c?(x=new c(),f=x.port2,x.port1.onmessage=u,v=e(f.postMessage,f,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(v=function v(m){o.postMessage(m+"","*");},o.addEventListener("message",u,!1)):T in a("script")?v=function v(m){i.appendChild(a("script"))[T]=function(){i.removeChild(this),g.call(m);};}:v=function v(m){setTimeout(e(g,m,1),0);}),h.exports={set:l,clear:d};},/* 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 l,d,c,p=function p(){var v,x;for(s&&(v=a.domain)&&v.exit();l;){x=l.fn,l=l.next;try{x();}catch(f){throw l?c():d=void 0,f;}}d=void 0,v&&v.enter();};if(s)c=function c(){a.nextTick(p);};else if(i&&!(e.navigator&&e.navigator.standalone)){var y=!0,P=document.createTextNode("");new i(p).observe(P,{characterData:!0}),c=function c(){P.data=y=!y;};}else if(o&&o.resolve){var T=o.resolve(void 0);c=function c(){T.then(p);};}else c=function c(){n.call(e,p);};return function(v){var x={fn:v,next:void 0};d&&(d.next=x),l||(l=x,c()),d=x;};};},/* 198 */ /***/function(h,r,t){var e=t(94);function n(i){var a,o;this.promise=new i(function(s,l){if(a!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");a=s,o=l;}),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),l=s.resolve;return l(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 l=a(this,n.Promise||i.Promise),d=typeof s=="function";return this.then(d?function(c){return o(l,s()).then(function(){return c;});}:s,d?function(c){return o(l,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],l={};l[a]=o(s),e(e.S+e.F*i(function(){s(1);}),"Object",l);};},/* 208 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=P(e),i=t(209),a=P(i),o=t(164),s=P(o),l=t(191),d=P(l);r.defer=T,r.periodicity=v,r.calculateFramesOffset=x,r.getProgress=f,r.getCurrentFrame=u;var c=t(188),p=t(187),y=P(p);function P(m){return m&&m.__esModule?m:{"default":m};}function T(){var m={};return m.promise=new d["default"](function(M,E){m.resolve=M,m.reject=E;}),m;}function v(m,M){var E=Math.floor(m/M),R=m-E*M;return R===0&&E>0&&(R=M,E--),[E,R];}function x(m){m=m.slice(0);var M=m[0],E=m[m.length-1];E.offset=E.offset||1,M.offset=M.offset||0;for(var R=0,b=-1,O=0;O<m.length;O++){var L=m[O];if(L.offset!=null){var w=O-b;if(w>1)for(var I=(L.offset-R)/w,A=0;A<w-1;A++)m[b+A+1].offset=R+I*(A+1);R=L.offset,b=O;}if(L.easing!=null&&(L.easing=(0,c.parseEasing)(L.easing)),O>0){var W=m[O].easing!=null;m[O]=(0,s["default"])({},m[O-1],m[O]),W||delete m[O].easing;}}return m;}function f(m,M,E){var R=m.currentTime,b=M.direction,O=M.duration,L=!1;if(b==="reverse")E=1-E,L=!0;else if(b==="alternate"||b==="alternate-reverse"){var w=Math.floor(R/O);E===1&&w--,w%2^b==="alternate-reverse"&&(E=1-E,L=!0);}return{p:E,inverted:L};}function g(m,M,E,R){var b={};return(0,a["default"])(M).forEach(function(O){var L=(0,n["default"])(O,2),w=L[0],I=L[1];if(w!=="offset"&&w!=="easing"){var A=E[w]||E["default"],W=A(m[w],I,R,m.offset,M.offset);W!=null&&(b[w]=W);}}),b;}function u(m,M,E,R){var b=m.easing,O=m.effect;O||(E=(0,s["default"])({},y["default"],E));var L={};R=b(R,M);for(var w=1;w<M.length;w++){var I=M[w],A=I.offset;if(A>=R||w===M.length-1){var W=M[w-1],z=W.offset,K=W.easing,k=R;if(K){var q=A-z;k=K((R-z)/q)*q+z;}O?L=O(W,I,k,z,A):L=g(W,I,E,k);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 l=i(s),d=n(l),c=d.length,p=0,y=[],P;c>p;)P=d[p++],(!e||a.call(l,P))&&y.push(o?[P,l[P]]:l[P]);return y;};};},/* 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 l=e.get(a);if(!l)throw new TypeError("Invalid node: ".concat(a));var d=new l(o);return s.forEach(function(c){d.appendChild(c);}),d;}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(l){var _ref116=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref116$bubbles=_ref116.bubbles,d=_ref116$bubbles===void 0?null:_ref116$bubbles;_classCallCheck(this,o);if(typeof l=="string"?(this[e]=l,this[n]=!!d):(this[e]=l.type,this[i]=l,this[n]=d!=null?!!d:!!l.bubbles,l.detail&&(this[a]=l.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(l){this[i]=l;}},{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),l=[];return s&&s.forEach(function(d){var c=d.match(o);if(!c)throw new TypeError("Invalid fitler string.");var _c3=_slicedToArray(c,3),p=_c3[1],y=_c3[2];p=p.toLowerCase(),y=y.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(P,T){var v;return p==="url"||p==="drop-shadow"&&T===3?v=P:v=Object(e.toNumber)(P),/%$/.test(P)&&(v/=100),v;}),l.push({type:p,args:y});}),l;}function i(a,o){a.clearFilter(),o&&o.forEach(function(_ref117){var s=_ref117.type,l=_ref117.args;var d=s;d==="drop-shadow"?d="dropShadow":d==="hue-rotate"&&(d="hueRotate"),a[d].apply(a,_toConsumableArray(l));});}},/* 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 l;});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 l=/*#__PURE__*/function(_i$default){function l(c){var _this28;var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,l);_this28=_callSuper(this,l),_this28.meshNode=c,c.connect(_assertThisInitialized(_this28)),_this28[o]=p,_this28[s]=null;return _this28;}_inherits(l,_i$default);return _createClass(l,[{key:"meshCloud",get:function get(){var c=this.meshNode,p=this[o];return!this[s]&&c.mesh&&(this[s]=new e.MeshCloud(c.mesh,p)),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,p){this.meshCloud&&(this.meshCloud.brightness(c,p),this.forceUpdate());}},{key:"contrast",value:function contrast(c,p){this.meshCloud&&(this.meshCloud.contrast(c,p),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 _this29=this;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(l,"draw",this,3)([c]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var p=this.shaderAttrs;p&&Object.entries(p).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),P=_ref119[0],T=_ref119[1];_this29.meshCloud.mesh.setAttribute(P,T);});var y=this.uniforms;if(this.uniforms){var P={};Object.entries(y).forEach(function(_ref120){var _ref121=_slicedToArray(_ref120,2),T=_ref121[0],v=_ref121[1];typeof v=="function"&&(v=v(_this29,T)),P[T]=v;}),this.meshCloud.mesh.setUniforms(P);}}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,p){this.meshCloud&&(this.meshCloud.grayscale(c,p),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(c,p){this.meshCloud&&(this.meshCloud.hueRotate(c,p),this.forceUpdate());}},{key:"invert",value:function invert(c,p){this.meshCloud&&(this.meshCloud.invert(c,p),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(c,p){if(!this.meshCloud)return!1;var y=this.attributes.pointerEvents;if(y==="none"||y!=="all"&&!this.isVisible)return!1;var P="both";y==="visibleFill"&&(P="fill"),y==="visibleStroke"&&(P="stroke");for(var T=0;T<this[o];T++)if(!this.meshCloud.isPointCollision(T,[c,p],P))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(c,p){this.meshCloud&&(this.meshCloud.opacity(c,p),this.forceUpdate());}},{key:"rotate",value:function rotate(c,p){var _ref122=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref123=_slicedToArray(_ref122,2),y=_ref123[0],P=_ref123[1];var T=Math.PI*p/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,v=_this$meshNode$attrib.x,_x29=_this$meshNode$attrib.y;this.meshCloud.rotate(c,T,[y+v,P+_x29]),this.forceUpdate();}}},{key:"saturate",value:function saturate(c,p){this.meshCloud&&(this.meshCloud.saturate(c,p),this.forceUpdate());}},{key:"scale",value:function scale(c,_ref124){var _ref125=_slicedToArray(_ref124,2),p=_ref125[0],_ref125$=_ref125[1],y=_ref125$===void 0?p:_ref125$;var _ref126=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref127=_slicedToArray(_ref126,2),P=_ref127[0],T=_ref127[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,v=_this$meshNode$attrib2.x,_x30=_this$meshNode$attrib2.y,_f12=1e-5;Math.abs(p)<_f12&&(p=1/p>0?_f12:-_f12),Math.abs(y)<_f12&&(y=1/y>0?_f12:-_f12),this.meshCloud.scale(c,[p,y],[P+v,T+_x30]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(c,p){this.meshCloud&&(this.meshCloud.setColorTransform(c,p),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(c,p){this.meshCloud&&(Array.isArray(p)&&(p=_toConsumableArray(p),p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setFillColor(c,p),this.forceUpdate());}},{key:"sepia",value:function sepia(c,p){this.meshCloud&&(this.meshCloud.sepia(c,p),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref128){var c=_ref128.width,p=_ref128.height;_superPropGet(l,"setResolution",this,3)([{width:c,height:p}]),this.meshNode.setResolution({width:c,height:p});}},{key:"setStrokeColor",value:function setStrokeColor(c,p){this.meshCloud&&(Array.isArray(p)&&(p=_toConsumableArray(p),p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setStrokeColor(c,p),this.forceUpdate());}},{key:"setTransform",value:function setTransform(c,p){this.meshCloud&&(this.meshCloud.setTransform(c,p),this.forceUpdate());}},{key:"skew",value:function skew(c,_ref129){var _ref130=_slicedToArray(_ref129,2),p=_ref130[0],_ref130$=_ref130[1],y=_ref130$===void 0?p:_ref130$;var _ref131=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref132=_slicedToArray(_ref131,2),P=_ref132[0],T=_ref132[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,v=_this$meshNode$attrib3.x,_x31=_this$meshNode$attrib3.y;this.meshCloud.skew(c,[p,y],[P+v,T+_x31]),this.forceUpdate();}}},{key:"transform",value:function transform(c,p){this.meshCloud&&(this.meshCloud.transform(c,p),this.forceUpdate());}},{key:"transformColor",value:function transformColor(c,p){this.meshCloud&&(this.meshCloud.transformColor(c,p),this.forceUpdate());}},{key:"translate",value:function translate(c,_ref133){var _ref134=_slicedToArray(_ref133,2),p=_ref134[0],y=_ref134[1];this.meshCloud&&(this.meshCloud.translate(c,[p,y]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[s]&&(this[s].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);a["default"].registerNode(l,"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 l;}),t.d(r,"deleteTexture",function(){return d;}),t.d(r,"drawTexture",function(){return p;}),t.d(r,"loadFrames",function(){return y;});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function a(P,T){if(i[P])return i[P];var v=e.ENV.loadImage(P,{alias:T,useImageBitmap:!1});return v!==null&&v!==void 0?v:P;}function o(_x32,_x33,_x34){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(P,T,v){var x,_P$attributes,_f13,g,u,m;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:x=T;typeof T=="string"&&(x=a(T));_context18.t0=x&&typeof x.then=="function";if(!_context18.t0){_context18.next=7;break;}_context18.next=6;return x;case 6:x=_context18.sent;case 7:if(!(T===P.attributes.texture)){_context18.next=11;break;}x&&x.image&&(x.sourceRect&&(P.attributes.sourceRect=x.sourceRect),P.textureImageRotated=!!x.rotated,x=x.image);_P$attributes=P.attributes,_f13=_P$attributes.width,g=_P$attributes.height,u=_P$attributes.textureRect,m=P.textureImage;P.textureImage=x,v&&m!==x&&!u&&(_f13==null||g==null)&&P.updateContours(),P.forceUpdate();case 11:return _context18.abrupt("return",x);case 12:case"end":return _context18.stop();}},_callee18);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function l(P,T){if(T[s]=T[s]||/* @__PURE__ */new Map(),T[s].has(P))return T[s].get(P);var v=T.createTexture(P);return!/^blob:/.test(P.src)&&typeof P.getContext!="function"&&T[s].set(P,v),v;}function d(P,T){if(T[s]&&T[s].has(P)){var v=T[s].get(P);return T.deleteTexture(v),T[s]["delete"](P),!0;}return!1;}var c=Symbol("textureContext");function p(P,T){var v=P.textureImage instanceof String?String(P.textureImage):P.textureImage,x=P.textureImageRotated,f=T.texture,g=P.renderer;if(v){var u=P.originalContentRect;var m=P.attributes.textureRect;var M=P.attributes.textureRepeat,E=P.attributes.sourceRect;if(!f||P[c]&&P[c]!==g||f.image!==v||f.options.repeat!==M||!Object(n.compareValue)(f.options.rect,m)||!Object(n.compareValue)(f.options.srcRect,E)){var R=l(v,g);m?(m[0]+=u[0],m[1]+=u[1]):m=u;var b=null;f&&!g[s].has(f.image)&&(!f.options||!f.options.hidden)&&(b=T.uniforms.u_texSampler),T.setTexture(R,{rect:m,repeat:M,srcRect:E,rotated:x}),b&&b["delete"]&&b["delete"](),P[c]=g;}}else if(f){var _u8=null;!g[s].has(f.image)&&(!f.options||!f.options.hidden)&&(_u8=T.uniforms.u_texSampler),T.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function y(_x35,_x36){return _y5.apply(this,arguments);}function _y5(){_y5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(P,T){var v,x;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_context19.t0=typeof T=="string";if(!_context19.t0){_context19.next=7;break;}_context19.next=4;return fetch(T,{method:"GET",mode:"cors",cache:"default"});case 4:_context19.next=6;return _context19.sent.json();case 6:T=_context19.sent;case 7:_context19.next=9;return a(P);case 9:v=_context19.sent;x=T.frames;return _context19.abrupt("return",(Object.entries(x).forEach(function(_ref135){var _ref136=_slicedToArray(_ref135,2),f=_ref136[0],g=_ref136[1];var _g$frame=g.frame,u=_g$frame.x,m=_g$frame.y,M=_g$frame.w,E=_g$frame.h;var R=[u,m,M,E];var b=g.rotated;b&&(R=[R[0],R[1],R[3],R[2]]),i[f]={image:v,sourceRect:R,rotated:b};}),v));case 12:case"end":return _context19.stop();}},_callee19);}));return _y5.apply(this,arguments);}},/* 219 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(1),n=t(12),i=t(70),a=t(220),o=t(221),s=t(222),l=t(213),d=t(223);t(1).glMatrix.setMatrixArrayType(Array);function c(P,T,v){return T in P?Object.defineProperty(P,T,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[T]=v,P;}var p=Symbol("mesh");var y=/*#__PURE__*/function(_i$default2){function y(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);return _callSuper(this,y,[T]);}_inherits(y,_i$default2);return _createClass(y,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,T=_this$attributes2.paddingTop,v=_this$attributes2.paddingRight,x=_this$attributes2.paddingBottom,f=_this$attributes2.paddingLeft,g=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),u=_this$contentSize[0],m=_this$contentSize[1];return[f+u+v+g,T+m+x+g];}// content + padding
|
|
308
|
+
},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,T=_this$attributes3.paddingTop,v=_this$attributes3.paddingRight,x=_this$attributes3.paddingBottom,f=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),g=_this$contentSize2[0],u=_this$contentSize2[1];return[f+g+v,T+u+x];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,T=_this$attributes4.width,v=_this$attributes4.height,x=_this$attributes4.boxSizing,f=_this$attributes4.paddingTop,g=_this$attributes4.paddingRight,u=_this$attributes4.paddingBottom,m=_this$attributes4.paddingLeft;if(T=T||0,v=v||0,x==="border-box"){var M=2*this.attributes.borderWidth;T-=M+g+m,v-=M+f+u,T=Math.max(0,T),v=Math.max(0,v);}return[T,v];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),T=_this$borderSize[0],v=_this$borderSize[1];return T>0&&v>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var T=this.clientBox;if(T){var _v5;var v=this[p];if(v)v.box!==T&&(v.contours=T.contours,v.box=T);else{v=new n.Mesh2D(T),v.box=T;var _f14=this.attributes.bgcolor;if(Object(o.setFillColor)(v,{color:_f14}),this.hasBorder){var _this$attributes5=this.attributes,u=_this$attributes5.borderColor,m=_this$attributes5.borderWidth,M=_this$attributes5.borderDash,E=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(v,{color:u,lineWidth:m,lineDash:M,lineDashOffset:E});}this[p]=v;var g=this.attributes.clipPath;g&&this[p].setClipPath(g);}var _x37=this.opacity;return v.getOpacity()!==_x37&&v.setOpacity(_x37),(_v5=v).setTransform.apply(_v5,_toConsumableArray(this.renderMatrix)),v;}return null;}// content + padding + border
|
|
309
|
+
},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,T=_this$attributes6.paddingTop,v=_this$attributes6.paddingRight,x=_this$attributes6.paddingBottom,f=_this$attributes6.paddingLeft,g=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),u=_this$contentSize3[0],m=_this$contentSize3[1],M=2*g;return[f+u+v+M,T+m+x+M];}},{key:"originalClientRect",get:function get(){if(this.mesh){var T=this.mesh.boundingBox;return[T[0][0],T[0][1],T[1][0]-T[0][0],T[1][1]-T[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),T=_this$originalClientR[0],v=_this$originalClientR[1],x=_this$originalClientR[2],f=_this$originalClientR[3],g=this.attributes.padding;return[T+g[0],v+g[1],x-g[0]-g[2],f-g[1]-g[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var T=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(T=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,T));var v=null;if(this.mesh){v=_toConsumableArray(this.mesh.boundingBox);var _x38=this.attributes.borderWidth;_x38&&(v[0]=[v[0][0]-_x38,v[0][1]-_x38],v[1]=[v[1][0]+_x38,v[1][1]+_x38]);}return Object(d["default"])(v,T);}// transformPoint(x, y) {
|
|
310
|
+
// const m = mat2d.invert(this.renderMatrix);
|
|
311
|
+
// const newX = x * m[0] + y * m[2] + m[4];
|
|
312
|
+
// const newY = x * m[1] + y * m[3] + m[5];
|
|
313
|
+
// return [newX, newY];
|
|
314
|
+
// }
|
|
315
|
+
/* override */},{key:"onPropertyChange",value:function onPropertyChange(T,v,x){if(_superPropGet(y,"onPropertyChange",this,3)([T,v,x]),(T==="anchorX"||T==="anchorY"||T==="boxSizing"||T==="width"||T==="height"||T==="borderWidth"||T==="paddingLeft"||T==="paddingRight"||T==="paddingTop"||T==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(T))&&this.updateContours(),this[p]&&T==="clipPath"&&this[p].setClipPath(v),this[p]&&T==="bgcolor"&&Object(o.setFillColor)(this[p],{color:v}),this[p]&&(T==="borderColor"||T==="borderWidth"||T==="borderDash"||T==="borderDashOffset")){var _this$attributes7=this.attributes,_f15=_this$attributes7.borderColor,g=_this$attributes7.borderWidth,u=_this$attributes7.borderDash,m=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[p],{color:_f15,lineWidth:g,lineDash:g?u:0,lineDashOffset:m});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,T=_this$attributes8.anchorX,v=_this$attributes8.anchorY,x=_this$attributes8.borderWidth,f=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),g=_this$borderSize2[0],u=_this$borderSize2[1],m=this.offsetSize,M=0.5*x,E=-T*m[0]+M,R=-v*m[1]+M;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[E,R,g,u],f);}}]);}(i["default"]);c(y,"Attr",a["default"]),l["default"].registerNode(y,"block");},/* 220 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return d;});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"),l=Symbol["for"]("spritejs_declareAlias");var d=/*#__PURE__*/function(_e$default){function d(p){var _this30;_classCallCheck(this,d);_this30=_callSuper(this,d,[p]),_this30[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}),_this30[l]("anchor","size","border","borderRadius","padding");return _this30;}_inherits(d,_e$default);return _createClass(d,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(p){this[a]("anchorX",Object(n.toNumber)(p));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(p){this[a]("anchorY",Object(n.toNumber)(p));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.anchorX=p[0],this.anchorY=p[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(p){this[a]("width",Object(n.toNumber)(p));}},{key:"height",get:function get(){return this[o]("height");},set:function set(p){this[a]("height",Object(n.toNumber)(p));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(p){this[a]("borderWidth",Object(n.toNumber)(p));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(p){this[a]("borderColor",Object(i.parseColor)(p));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p]),this.borderWidth=p[0],p[1]!=null&&(this.borderColor=p[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(p){p=Object(n.toArray)(p,!0),p!=null&&!Array.isArray(p)&&(p=[p]),this[a]("borderDash",p?p.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(p){this[a]("borderDashOffset",Object(n.toNumber)(p));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopLeftRadius",p.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopRightRadius",p.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomRightRadius",p.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomLeftRadius",p.map(n.toNumber));}},{key:"borderRadius",get:function get(){return[].concat(_toConsumableArray(this.borderTopLeftRadius),_toConsumableArray(this.borderTopRightRadius),_toConsumableArray(this.borderBottomRightRadius),_toConsumableArray(this.borderBottomLeftRadius));},set:function set(p){if(p=Object(n.toArray)(p),!Array.isArray(p))p=Array(8).fill(p);else if(p.length===2)p=[p[0],p[1],p[0],p[1],p[0],p[1],p[0],p[1]];else if(p.length===4)p=[p[0],p[1],p[2],p[3],p[0],p[1],p[2],p[3]];else if(p.length===6)p=[p[0],p[1],p[2],p[3],p[4],p[5],p[2],p[3]];else if(p.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[p[0],p[1]],this.borderTopRightRadius=[p[2],p[3]],this.borderBottomRightRadius=[p[4],p[5]],this.borderBottomLeftRadius=[p[6],p[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(p){this[a]("bgcolor",Object(i.parseColor)(p));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(p){this[a]("paddingTop",Object(n.toNumber)(p));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(p){this[a]("paddingRight",Object(n.toNumber)(p));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(p){this[a]("paddingBottom",Object(n.toNumber)(p));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(p){this[a]("paddingLeft",Object(n.toNumber)(p));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)?p.length===2?p=[p[0],p[1],p[0],p[1]]:p.length===3&&(p=[p[0],p[1],p[2],p[1]]):p=[p,p,p,p],this.paddingTop=p[0],this.paddingRight=p[1],this.paddingBottom=p[2],this.paddingLeft=p[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(p){this[a]("clipPath",p);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(p){if(p!=null&&p!=="border-box"&&p!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",p);}}]);}(e["default"]);},/* 221 */ /***/function(h,r,t){t.r(r),t.d(r,"Gradient",function(){return i;}),t.d(r,"isTransparent",function(){return a;}),t.d(r,"parseColor",function(){return o;}),t.d(r,"setFillColor",function(){return l;}),t.d(r,"setStrokeColor",function(){return d;}),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 y=_ref137.vector,P=_ref137.colors;_classCallCheck(this,i);if(!Array.isArray(y)||y.length!==4&&y.length!==6&&y.length!==3)throw new TypeError("Invalid gradient");this.vector=y,this.colors=P.map(function(_ref138){var T=_ref138.offset,v=_ref138.color;return{offset:T,color:o(v)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(p){return p instanceof i?!1:p==null?!0:n()(p)[3]===0;}function o(p){if(p==null||(p||(p="transparent"),p instanceof i))return p;var y=n()(p);if(!y||!y.length)throw new TypeError("Invalid color value.");return"rgba(".concat(y.join(),")");}function s(p,y,P){var T=p.boundingBox[0];if(P.vector){var v=P.vector,_x39=P.colors;v.length===4?(v=[v[0]+T[0],v[1]+T[1],v[2]+T[0],v[3]+T[1]],p.setLinearGradient({vector:v,colors:_x39,type:y})):v.length===3?(v=[v[0]+T[0],v[1]+T[1],v[2]],p.setCircularGradient({vector:v,colors:_x39,type:y})):(v=[v[0]+T[0],v[1]+T[1],v[2],v[3]+T[0],v[4]+T[1],v[5]],p.setRadialGradient({vector:v,colors:_x39,type:y}));}else p.gradient&&p.gradient[y]&&(delete p.gradient[y],delete p.uniforms.u_radialGradientVector);}function l(p,_ref139){var y=_ref139.color,_ref139$rule=_ref139.rule,P=_ref139$rule===void 0?"nonzero":_ref139$rule;return s(p,"fill",y),y.vector||p.setFill({color:y,rule:P}),p;}function d(p,_ref140){var y=_ref140.color,P=_ref140.lineWidth,T=_ref140.lineCap,v=_ref140.lineJoin,x=_ref140.lineDash,f=_ref140.lineDashOffset,g=_ref140.miterLimit,u=_ref140.roundSegments;s(p,"stroke",y),y.vector&&(y=[0,0,0,1]),p.setStroke({color:y,thickness:P,cap:T,join:v,miterLimit:g,lineDash:x,lineDashOffset:f,roundSegments:u});}var c=/*#__PURE__*/function(_Array){function c(){var _y6,_y7,_n2,_n3;var _this31;var y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var v=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,c);return _possibleConstructorReturn(_this31,(Array.isArray(y)&&(_y6=y,_y7=_slicedToArray(_y6,4),y=_y7[0],P=_y7[1],T=_y7[2],v=_y7[3],_y6),typeof y=="string"&&((_n2=n()(y),_n3=_slicedToArray(_n2,4),y=_n3[0],P=_n3[1],T=_n3[2],v=_n3[3]),y/=255,P/=255,T/=255),_this31=_callSuper(this,c,[y,P,T,v]),_assertThisInitialized(_this31)));}_inherits(c,_Array);return _createClass(c,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(y){this[0]=y/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(y){this[1]=y/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(y){this[2]=y/255;}},{key:"a",get:function get(){return this[3];},set:function set(y){this[3]=y;}},{key:"hex",get:function get(){var y="0".concat(this.r.toString(16)).slice(-2),P="0".concat(this.g.toString(16)).slice(-2),T="0".concat(this.b.toString(16)).slice(-2);var v;return this.a<1&&(v=Math.round(this[3]*255),v="0".concat(v.toString(16)).slice(-2)),"#".concat(y).concat(P).concat(T).concat(v||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(y){return typeof y=="string"&&(y=n()(y),y[0]/=255,y[1]/=255,y[2]/=255),this[0]=y[0],this[1]=y[1],this[2]=y[2],this[3]=y[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 */ /***/function(h,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,o,s,l){var d=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var c=0.5522848,p=s/2*c,y=l/2*c,P=a+s,T=o+l,v=a+s/2,x=o+l/2;d==="leftTop"?(i.moveTo(a,x),i.bezierCurveTo(a,x-y,v-p,o,v,o)):d==="rightTop"?i.bezierCurveTo(v+p,o,P,x-y,P,x):d==="rightBottom"?i.bezierCurveTo(P,x+y,v+p,T,v,T):d==="leftBottom"&&i.bezierCurveTo(v-p,T,a,x+y,a,x);}function n(i,_ref141,d){var _ref142=_slicedToArray(_ref141,4),a=_ref142[0],o=_ref142[1],s=_ref142[2],l=_ref142[3];if(!d||Array.isArray(d)&&d.every(function(c){return c===0;}))i.beginPath(),i.rect(a,o,s,l);else{typeof d=="number"&&(d=Array(8).fill(d));var _d$map=d.map(function(g,u){return u%2?Math.min(g,l/2):Math.min(g,s/2);}),_d$map2=_slicedToArray(_d$map,8),c=_d$map2[0],p=_d$map2[1],y=_d$map2[2],P=_d$map2[3],T=_d$map2[4],v=_d$map2[5],_x40=_d$map2[6],_f16=_d$map2[7];i.beginPath(),i.moveTo(a,o+p),e(i,a,o,c*2,p*2,"leftTop"),i.lineTo(a+s-y,o),e(i,a+s-y*2,o,y*2,P*2,"rightTop"),i.lineTo(a+s,o+l-v),e(i,a+s-T*2,o+l-v*2,T*2,v*2,"rightBottom"),i.lineTo(a+_x40,o+l),e(i,a,o+l-_f16*2,_x40*2,_f16*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 _e2=_slicedToArray(e,2),_e2$=_slicedToArray(_e2[0],2),i=_e2$[0],a=_e2$[1],_e2$2=_slicedToArray(_e2[1],2),o=_e2$2[0],s=_e2$2[1],l=i*n[0]+a*n[2]+n[4],d=i*n[1]+a*n[3]+n[5],c=o*n[0]+a*n[2]+n[4],p=o*n[1]+a*n[3]+n[5],y=o*n[0]+s*n[2]+n[4],P=o*n[1]+s*n[3]+n[5],T=i*n[0]+s*n[2]+n[4],v=i*n[1]+s*n[3]+n[5],x=Math.min(l,c,y,T),f=Math.min(d,p,P,v),g=Math.max(l,c,y,T),u=Math.max(d,p,P,v);return{x:x,y:f,width:g-x,height:u-f,left:x,top:f,right:g,bottom:u};};},/* 224 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(218),n=t(219),i=t(225),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(d,c,p){return c in d?Object.defineProperty(d,c,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[c]=p,d;}var s=Symbol("textureTask");var l=/*#__PURE__*/function(_n$default){function l(){var _this32;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,l);typeof c=="string"&&(c={texture:c}),_this32=_callSuper(this,l,[c]);return _this32;}/* override */_inherits(l,_n$default);return _createClass(l,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(l,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),c=_superPropGet3[0],p=_superPropGet3[1];var _this$attributes9=this.attributes,y=_this$attributes9.width,P=_this$attributes9.height;if(y==null||P==null){var T=this.textureImage,v=this.attributes.textureRect,_x41=this.attributes.sourceRect;if(v)y==null&&(c=v[0]+v[2]),P==null&&(p=v[1]+v[3]);else if(_x41){var _f17=this.layer?this.layer.displayRatio:1;y==null&&(c=_x41[2]/_f17),P==null&&(p=_x41[3]/_f17);}else if(T){var _f18=this.layer?this.layer.displayRatio:1;y==null&&(c=T.width/_f18),P==null&&(p=T.height/_f18);}}return[c,p];}},{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]:[];_superPropGet(l,"draw",this,3)([c]);var p=this.mesh;return p&&Object(e.drawTexture)(this,p),c;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(c,p,y){if(_superPropGet(l,"onPropertyChange",this,3)([c,p,y]),c==="texture"&&(this[s]=Object(e.applyTexture)(this,p,!0)),c==="textureRect"){var _this$attributes10=this.attributes,P=_this$attributes10.width,T=_this$attributes10.height;(P==null||T==null)&&this.updateContours();}}}]);}(n["default"]);o(l,"Attr",i["default"]),a["default"].registerNode(l,"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(l){var _this33;_classCallCheck(this,o);_this33=_callSuper(this,o,[l]),_this33[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this33;}_inherits(o,_e$default2);return _createClass(o,[{key:"texture",get:function get(){return this[a]("texture");},set:function set(l){this[i]("texture",l);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(l){this[i]("textureRect",l);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(l){this[i]("sourceRect",l);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(l){this[i]("textureRepeat",!!l);}}]);}(e["default"]);},/* 226 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return P;});var e=t(12),n=t(227),i=/* @__PURE__ */t.n(n),a=t(70),o=t(228),s=t(221),l=t(218),d=t(213),c=t(223);t(1).glMatrix.setMatrixArrayType(Array);function p(T,v,x){return v in T?Object.defineProperty(T,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[v]=x,T;}var y=Symbol("mesh");var P=/*#__PURE__*/function(_a$default){function P(){var _this34;var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof v=="string"&&(v={d:v}),_this34=_callSuper(this,P,[v]),_this34.effects={d:function d(x,f,g,u,m){var _i$a;var M=(g-u)/(m-u);if(M<=0)return x;if(M>=1)return f;var E=i.a._preprocessing(i.a.path2shapes(x),i.a.path2shapes(f)),R=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(E).concat([M]))[0];return R.reduce(function(O,L){return"".concat(O).concat(L.slice(2).join(" ")," ");},"M".concat(R[0][0]," ").concat(R[0][1],"C")).trim();}};return _this34;}/* override */_inherits(P,_a$default);return _createClass(P,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var v=this.path;if(v){var _x43;var _x42=this[y];if(_x42)_x42.path!==v&&(_x42.contours=v.contours,_x42.path=v);else{_x42=new e.Mesh2D(this.path),_x42.path=v;var g=this.attributes.fillColor,u=this.attributes.fillRule;g&&Object(s.setFillColor)(_x42,{color:g,rule:u});var m=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&m>0){var _this$attributes11=this.attributes,R=_this$attributes11.lineCap,b=_this$attributes11.lineJoin,O=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,w=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_x42,{color:M,lineWidth:m,lineCap:R,lineJoin:b,miterLimit:O,lineDash:L,lineDashOffset:w,roundSegments:I});}this[y]=_x42;var E=this.attributes.clipPath;E&&this[y].setClipPath(E);}var _f19=this.opacity;return _x42.getOpacity()!==_f19&&_x42.setOpacity(_f19),(_x43=_x42).setTransform.apply(_x43,_toConsumableArray(this.renderMatrix)),_x42;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var v=this.path.boundingBox;return[v[0][0],v[0][1],v[1][0]-v[0][0],v[1][1]-v[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var v=this.mesh.boundingBox;return[v[0][0],v[0][1],v[1][0]-v[0][0],v[1][1]-v[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(v){this.attributes.d=v;}},{key:"draw",value:function draw(){var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(P,"draw",this,3)([v]);var x=this.mesh;return x&&Object(l.drawTexture)(this,x),v;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var v=null;return this.mesh&&(v=this.mesh.boundingBox),Object(c["default"])(v,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(v){if(this.mesh){var _x44=this.mesh.getPointAtLength(v);if(_x44)return[_x44.x,_x44.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,x,f){if(_superPropGet(P,"onPropertyChange",this,3)([v,x,f]),(v==="d"||v==="normalize")&&this.updateContours(),this[y]&&(v==="fillColor"||v==="fillRule")){var _this$attributes12=this.attributes,g=_this$attributes12.fillColor,u=_this$attributes12.fillRule;Object(s.setFillColor)(this[y],{color:g,rule:u});}if(this[y]&&(v==="strokeColor"||v==="lineWidth"||v==="lineCap"||v==="lineJoin"||v==="lineDash"||v==="lineDashOffset"||v==="roundSegments")){var _this$attributes13=this.attributes,_g4=_this$attributes13.strokeColor,_u9=_this$attributes13.lineWidth;if(_g4&&_u9>0){var _this$attributes14=this.attributes,m=_this$attributes14.lineCap,M=_this$attributes14.lineJoin,E=_this$attributes14.lineDash,R=_this$attributes14.lineDashOffset,b=_this$attributes14.miterLimit,O=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[y],{color:_g4,lineCap:m,lineJoin:M,lineWidth:_u9,lineDash:E,lineDashOffset:R,miterLimit:b,roundSegments:O});}}this[y]&&v==="clipPath"&&this[y].setClipPath(x),v==="texture"&&Object(l.applyTexture)(this,x);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);p(P,"Attr",o["default"]),d["default"].registerNode(P,"path");},/* 227 */ /***/function(h,r,t){(function(e,n){h.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function L(w,I){var A=[],W=!0,z=!1,K=void 0;try{for(var k=w[Symbol.iterator](),q;!(W=(q=k.next()).done)&&(A.push(q.value),!(I&&A.length===I));W=!0);}catch(U){z=!0,K=U;}finally{try{!W&&k["return"]&&k["return"]();}finally{if(z)throw K;}}return A;}return function(w,I){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return L(w,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(w,I,A,W,z,K,k){var q=w.x,U=w.y;q*=I,U*=A;var G=W*q-z*U,Z=z*q+W*U;return{x:G+K,y:Z+k};},a=function a(w,I){var A=1.3333333333333333*Math.tan(I/4),W=Math.cos(w),z=Math.sin(w),K=Math.cos(w+I),k=Math.sin(w+I);return[{x:W-z*A,y:z+W*A},{x:K+k*A,y:k-K*A},{x:K,y:k}];},o=function o(w,I,A,W){var z=w*W-I*A<0?-1:1,K=Math.sqrt(w*w+I*I),k=Math.sqrt(w*w+I*I),q=w*A+I*W,U=q/(K*k);return U>1&&(U=1),U<-1&&(U=-1),z*Math.acos(U);},s=function s(w,I,A,W,z,K,k,q,U,G,Z,nt){var et=Math.pow(z,2),tt=Math.pow(K,2),J=Math.pow(Z,2),ht=Math.pow(nt,2),dt=et*tt-et*ht-tt*J;dt<0&&(dt=0),dt/=et*ht+tt*J,dt=Math.sqrt(dt)*(k===q?-1:1);var B=dt*z/K*nt,F=dt*-K/z*Z,Y=G*B-U*F+(w+A)/2,X=U*B+G*F+(I+W)/2,N=(Z-B)/z,$=(nt-F)/K,S=(-Z-B)/z,C=(-nt-F)/K,D=o(1,0,N,$),j=o(N,$,S,C);return q===0&&j>0&&(j-=n),q===1&&j<0&&(j+=n),[Y,X,D,j];},l=function l(w){var I=w.px,A=w.py,W=w.cx,z=w.cy,K=w.rx,k=w.ry,q=w.xAxisRotation,U=q===void 0?0:q,G=w.largeArcFlag,Z=G===void 0?0:G,nt=w.sweepFlag,et=nt===void 0?0:nt,tt=[];if(K===0||k===0)return[];var J=Math.sin(U*n/360),ht=Math.cos(U*n/360),dt=ht*(I-W)/2+J*(A-z)/2,B=-J*(I-W)/2+ht*(A-z)/2;if(dt===0&&B===0)return[];K=Math.abs(K),k=Math.abs(k);var F=Math.pow(dt,2)/Math.pow(K,2)+Math.pow(B,2)/Math.pow(k,2);F>1&&(K*=Math.sqrt(F),k*=Math.sqrt(F));var Y=s(I,A,W,z,K,k,Z,et,J,ht,dt,B),X=e(Y,4),N=X[0],$=X[1],S=X[2],C=X[3],D=Math.max(Math.ceil(Math.abs(C)/(n/4)),1);C/=D;for(var j=0;j<D;j++)tt.push(a(S,C)),S+=C;return tt.map(function(H){var V=i(H[0],K,k,ht,J,N,$),Q=V.x,it=V.y,st=i(H[1],K,k,ht,J,N,$),ct=st.x,gt=st.y,at=i(H[2],K,k,ht,J,N,$),ot=at.x,ft=at.y;return{x1:Q,y1:it,x2:ct,y2:gt,x:ot,y:ft};});},d={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
|
|
316
|
+
* segment pattern
|
|
317
|
+
* @type {RegExp}
|
|
318
|
+
*/},c=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function p(L){var w=[];return L.replace(c,function(I,A,W){var z=A.toLowerCase();for(W=P(W),z=="m"&&W.length>2&&(w.push([A].concat(W.splice(0,2))),z="l",A=A=="m"?"l":"L");;){if(W.length==d[z])return W.unshift(A),w.push(W);if(W.length<d[z])throw new Error("malformed path data");w.push([A].concat(W.splice(0,d[z])));}}),w;}var y=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function P(L){var w=L.match(y);return w?w.map(Number):[];}function T(L){var w=L[0][0],I=L[0][1],A=w,W=I;return L.forEach(function(z){var K=z[0],k=z[2],q=z[4],U=z[6],G=z[1],Z=z[3],nt=z[5],et=z[7];w=Math.min(w,K,k,q,U),I=Math.min(I,G,Z,nt,et),A=Math.max(A,K,k,q,U),W=Math.max(W,G,Z,nt,et);}),[w,I,A,W];}function v(L,w){return Math.sqrt(Math.pow(L[0]-w[0],2)+Math.pow(L[1]-w[1],2))+Math.sqrt(Math.pow(L[2]-w[2],2)+Math.pow(L[3]-w[3],2));}function x(L,w){var I=L[0],A=L[2],W=L[4],z=L[6],K=L[1],k=L[3],q=L[5],U=L[7],G=w[0],Z=w[2],nt=w[4],et=w[6],tt=w[1],J=w[3],ht=w[5],dt=w[7];return Math.sqrt(Math.pow(G-I,2)+Math.pow(tt-K,2))+Math.sqrt(Math.pow(Z-A,2)+Math.pow(J-k,2))+Math.sqrt(Math.pow(nt-W,2)+Math.pow(ht-q,2))+Math.sqrt(Math.pow(et-z,2)+Math.pow(dt-U,2));}function f(L,w){var I=u(L.length),A=[];I.forEach(function(z){var K=0,k=0;z.forEach(function(q){K+=x(L[q],w[k++]);}),A.push({index:z,distance:K});}),A.sort(function(z,K){return z.distance-K.distance;});var W=[];return A[0].index.forEach(function(z){W.push(L[z]);}),W;}function g(L,w){var I=m(L.length),A=[];I.forEach(function(z){var K=0;z.forEach(function(k){K+=v(T(L[k]),T(w[k]));}),A.push({index:z,distance:K});}),A.sort(function(z,K){return z.distance-K.distance;});var W=[];return A[0].index.forEach(function(z){W.push(L[z]);}),W;}function u(L){for(var w=[],I=0;I<L;I++){for(var A=[],W=0;W<L;W++){var z=W+I;z>L-1&&(z-=L),A[z]=W;}w.push(A);}return w;}function m(L){for(var w=[],I=0;I<L;I++)w.push(I);return M(w);}function M(L){var w=[],I=[];function A(W){var z,K;for(z=0;z<W.length;z++)K=W.splice(z,1)[0],I.push(K),W.length==0&&w.push(I.slice()),A(W),W.splice(z,0,K),I.pop();return w;}return A(L);}var E={};E.parser=p,E.lerpCurve=function(L,w,I){return E.lerpPoints(L[0],L[1],w[0],w[1],I).concat(E.lerpPoints(L[2],L[3],w[2],w[3],I)).concat(E.lerpPoints(L[4],L[5],w[4],w[5],I)).concat(E.lerpPoints(L[6],L[7],w[6],w[7],I));},E.lerpPoints=function(L,w,I,A,W){return[L+(I-L)*W,w+(A-w)*W];},E.q2b=function(L,w,I,A,W,z){return[L,w,(L+2*I)/3,(w+2*A)/3,(W+2*I)/3,(z+2*A)/3,W,z];},E.path2shapes=function(L){for(var w=E.parser(L),I=0,A=0,W=0,z=w.length,K=[],k=null,q=void 0,U=void 0,G=void 0,Z=void 0,nt=void 0,et=void 0,tt=void 0;W<z;W++){var J=w[W],ht=J[0],dt=w[W-1];switch(ht){case"m":nt=K.length,K[nt]=[],k=K[nt],I=I+J[1],A=A+J[2];break;case"M":nt=K.length,K[nt]=[],k=K[nt],I=J[1],A=J[2];break;case"l":k.push([I,A,I,A,I,A,I+J[1],A+J[2]]),I+=J[1],A+=J[2];break;case"L":k.push([I,A,J[1],J[2],J[1],J[2],J[1],J[2]]),I=J[1],A=J[2];break;case"h":k.push([I,A,I,A,I,A,I+J[1],A]),I+=J[1];break;case"H":k.push([I,A,J[1],A,J[1],A,J[1],A]),I=J[1];break;case"v":k.push([I,A,I,A,I,A,I,A+J[1]]),A+=J[1];break;case"V":k.push([I,A,I,J[1],I,J[1],I,J[1]]),A=J[1];break;case"C":k.push([I,A,J[1],J[2],J[3],J[4],J[5],J[6]]),I=J[5],A=J[6];break;case"S":dt[0]==="C"||dt[0]==="c"?k.push([I,A,I+dt[5]-dt[3],A+dt[6]-dt[4],J[1],J[2],J[3],J[4]]):(dt[0]==="S"||dt[0]==="s")&&k.push([I,A,I+dt[3]-dt[1],A+dt[4]-dt[2],J[1],J[2],J[3],J[4]]),I=J[3],A=J[4];break;case"c":k.push([I,A,I+J[1],A+J[2],I+J[3],A+J[4],I+J[5],A+J[6]]),I=I+J[5],A=A+J[6];break;case"s":dt[0]==="C"||dt[0]==="c"?k.push([I,A,I+dt[5]-dt[3],A+dt[6]-dt[4],I+J[1],A+J[2],I+J[3],A+J[4]]):(dt[0]==="S"||dt[0]==="s")&&k.push([I,A,I+dt[3]-dt[1],A+dt[4]-dt[2],I+J[1],A+J[2],I+J[3],A+J[4]]),I=I+J[3],A=A+J[4];break;case"a":et=l({rx:J[1],ry:J[2],px:I,py:A,xAxisRotation:J[3],largeArcFlag:J[4],sweepFlag:J[5],cx:I+J[6],cy:A+J[7]}),tt=et[et.length-1],et.forEach(function(B,F){F===0?k.push([I,A,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):k.push([et[F-1].x,et[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),I=tt.x,A=tt.y;break;case"A":et=l({rx:J[1],ry:J[2],px:I,py:A,xAxisRotation:J[3],largeArcFlag:J[4],sweepFlag:J[5],cx:J[6],cy:J[7]}),tt=et[et.length-1],et.forEach(function(B,F){F===0?k.push([I,A,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):k.push([et[F-1].x,et[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),I=tt.x,A=tt.y;break;case"Q":k.push(E.q2b(I,A,J[1],J[2],J[3],J[4])),I=J[3],A=J[4];break;case"q":k.push(E.q2b(I,A,I+J[1],A+J[2],J[3]+I,J[4]+A)),I+=J[3],A+=J[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?(G=I+dt[3]-dt[1],Z=A+dt[4]-dt[2],k.push(E.q2b(I,A,G,Z,J[1],J[2]))):(dt[0]==="T"||dt[0]==="t")&&(k.push(E.q2b(I,A,I+I-G,A+A-Z,J[1],J[2])),G=I+I-G,Z=A+A-Z),I=J[1],A=J[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?(G=I+dt[3]-dt[1],Z=A+dt[4]-dt[2],k.push(E.q2b(I,A,G,Z,I+J[1],A+J[2]))):(dt[0]==="T"||dt[0]==="t")&&(k.push(E.q2b(I,A,I+I-G,A+A-Z,I+J[1],A+J[2])),G=I+I-G,Z=A+A-Z),I+=J[1],A+=J[2];break;case"Z":q=k[0][0],U=k[0][1],k.push([I,A,q,U,q,U,q,U]);break;case"z":q=k[0][0],U=k[0][1],k.push([I,A,q,U,q,U,q,U]);break;}}return K;},E._upCurves=function(L,w){for(var I=0,A=0,W=L.length;I<w;I++)L.push(L[A].slice(0)),A++,A>W-1&&(A-=W);};function R(L,w,I,A,W,z,K,k,q){return{left:b(L,w,I,A,W,z,K,k,q),right:b(K,k,W,z,I,A,L,w,1-q,!0)};}function b(L,w,I,A,W,z,K,k,q,U){var G=(I-L)*q+L,Z=(A-w)*q+w,nt=(W-I)*q+I,et=(z-A)*q+A,tt=(K-W)*q+W,J=(k-z)*q+z,ht=(nt-G)*q+G,dt=(et-Z)*q+Z,B=(tt-nt)*q+nt,F=(J-et)*q+et,Y=(B-ht)*q+ht,X=(F-dt)*q+dt;return U?[Y,X,ht,dt,G,Z,L,w]:[L,w,G,Z,ht,dt,Y,X];}E._splitCurves=function(L,w){for(var I=0,A=0;I<w;I++){var W=L[A],z=R(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],0.5);L.splice(A,1),L.splice(A,0,z.left,z.right),A+=2,A>=L.length-1&&(A=0);}};function O(L,w){for(var I=function I(z){var K=L[L.length-1],k=[];K.forEach(function(q){k.push(q.slice(0));}),L.push(k);},A=0;A<w;A++)I();}return E.lerp=function(L,w,I){return E._lerp(E.path2shapes(L),E.path2shapes(w),I);},E.MIM_CURVES_COUNT=100,E._preprocessing=function(L,w){var I=L.length,A=w.length,W=JSON.parse(JSON.stringify(L)),z=JSON.parse(JSON.stringify(w));return I>A?O(z,I-A):I<A&&O(W,A-I),W=g(W,z),W.forEach(function(K,k){var q=K.length,U=z[k].length;q>U?q<E.MIM_CURVES_COUNT?(E._splitCurves(K,E.MIM_CURVES_COUNT-q),E._splitCurves(z[k],E.MIM_CURVES_COUNT-U)):E._splitCurves(z[k],q-U):q<U&&(U<E.MIM_CURVES_COUNT?(E._splitCurves(K,E.MIM_CURVES_COUNT-q),E._splitCurves(z[k],E.MIM_CURVES_COUNT-U)):E._splitCurves(K,U-q));}),W.forEach(function(K,k){W[k]=f(K,z[k]);}),[W,z];},E._lerp=function(L,w,I){var A=[];return L.forEach(function(W,z){var K=[];W.forEach(function(k,q){K.push(E.lerpCurve(k,w[z][q],I));}),A.push(K);}),A;},E.animate=function(L){var w=E.path2shapes(L.from),I=E.path2shapes(L.to),A=E._preprocessing(w,I),W=/* @__PURE__ */new Date(),z=L.end||function(){},K=L.progress||function(){},k=L.begin||function(){},q=L.easing||function(et){return et;},U=null,G=null,Z=L.time;k(w);var nt=function et(){var tt=/* @__PURE__ */new Date()-W;if(tt>=Z){G=I,K(G,1),z(G),cancelAnimationFrame(U);return;}var J=q(tt/Z);G=E._lerp(A[0],A[1],J),K(G,J),U=requestAnimationFrame(et);};nt();},E;});},/* 228 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});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 l=/*#__PURE__*/function(_e$default3){function l(c){var _this35;_classCallCheck(this,l);_this35=_callSuper(this,l,[c]),_this35[a]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
|
|
319
|
+
lineCap:"butt",// 'butt' or 'square' or 'round'
|
|
320
|
+
roundSegments:20,// default roundSegment if lineJoin or lineCap is round
|
|
321
|
+
lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this35;}_inherits(l,_e$default3);return _createClass(l,[{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,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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,l=_this$attributes15.width,d=_this$attributes15.height;return l>0&&d>0&&_superPropGet(o,"isVisible",this,1);}}]);}(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 d;});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 l(c){var p=c.width,y=c.height;return"M0 0L".concat(p," 0L").concat(p," ").concat(y,"L0 ").concat(y,"Z");}var d=/*#__PURE__*/function(_e$default5){function d(p){var _this36;_classCallCheck(this,d);_this36=_callSuper(this,d,[p]),_this36[i]({width:0,height:0/* size */}),_this36[s]("size");return _this36;}// readonly
|
|
322
|
+
_inherits(d,_e$default5);return _createClass(d,[{key:"d",get:function get(){return this[o]("d");},set:function set(p){}// eslint-disable-line no-empty-function
|
|
323
|
+
},{key:"width",get:function get(){return this[o]("width");},set:function set(p){if(p=Object(n.toNumber)(p),this[a]("width",p)){var y=l(this);this[a]("d",y);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(p){if(p=Object(n.toNumber)(p),this[a]("height",p)){var y=l(this);this[a]("d",y);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1];}}]);}(e["default"]);},/* 231 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(s,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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 l=this.attributes.sides;return l[0]>0&&l[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(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,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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 l=this.attributes.points;return l.length>0&&_superPropGet(o,"isVisible",this,1);}}]);}(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"),l=Symbol["for"]("spritejs_declareAlias");function d(p){var y=p.points,P=p.smooth,T=p.smoothRange,v=p.close,x=[];for(var g=0;g<y.length;g+=2)x.push([y[g],y[g+1]]);var f="";return P?f=Object(i.makeSmoothCurveLine)(x,T):x.length&&(f="M".concat(x.map(function(g){return g.join(" ");}).join("L"))),f&&v&&(f+="Z"),f;}var c=/*#__PURE__*/function(_e$default8){function c(y){var _this37;_classCallCheck(this,c);_this37=_callSuper(this,c,[y]),_this37[a]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
|
|
324
|
+
/* close */}),_this37[l]("close");return _this37;}// readonly
|
|
325
|
+
_inherits(c,_e$default8);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
326
|
+
},{key:"close",get:function get(){return this.closeType!=="none";},set:function set(y){y=y?"normal":"none",this.closeType=y;}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",y)){var P=d(this);this[o]("d",P);}}},{key:"smooth",get:function get(){return this[s]("smooth");},set:function set(y){if(this[o]("smooth",y)){var P=d(this);this[o]("d",P);}}},{key:"smoothRange",get:function get(){return this[s]("smoothRange");},set:function set(y){if(y&&!Array.isArray(y)&&(y=[y]),this[o]("smoothRange",y)&&this.smooth){var P=d(this);this[o]("d",P);}}},{key:"points",get:function get(){return this[s]("points");},set:function set(y){if(y=Object(n.toArray)(y),Array.isArray(y)&&(y=y.reduce(function(P,T){return Array.isArray(T)?[].concat(_toConsumableArray(P),_toConsumableArray(T.map(function(v){return Object(n.toNumber)(v);}))):[].concat(_toConsumableArray(P),[Object(n.toNumber)(T)]);},[])),this[o]("points",y)){var P=d(this);this[o]("d",P);}}}]);}(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(l){var d=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var p,y,P,T;if((n[l].x===n[l+1].x||n[l].y===n[l+1].y)&&(d=0,c=0),l<1?(p=n[0].x+(n[1].x-n[0].x)*d,y=n[0].y+(n[1].y-n[0].y)*d):(p=n[l].x+(n[l+1].x-n[l-1].x)*d,y=n[l].y+(n[l+1].y-n[l-1].y)*d),l>n.length-3){var v=n.length-1;P=n[v].x-(n[v].x-n[v-1].x)*c,T=n[v].y-(n[v].y-n[v-1].y)*c;}else P=n[l+1].x-(n[l+2].x-n[l].x)*c,T=n[l+1].y-(n[l+2].y-n[l].y)*c;return[{x:p,y:y},{x:P,y:T}];}n=n.map(function(_ref143){var _ref144=_slicedToArray(_ref143,2),l=_ref144[0],d=_ref144[1];return{x:l,y:d};});var o="",s=0;return n.forEach(function(l,d){if(d===0)o+="M".concat(l.x," ").concat(l.y);else{for(;d>i[s];)s++;if(s%2){var _a3=a(d-1),_a4=_slicedToArray(_a3,2),c=_a4[0],p=_a4[1];o+="C".concat([c.x,c.y,p.x,p.y,l.x,l.y].join(" "));}else o+="L".concat(l.x," ").concat(l.y);}}),o;}},/* 235 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});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(d){var _d$sides=_slicedToArray(d.sides,2),c=_d$sides[0],p=_d$sides[1];var y=d.angle%360;return y<0&&(y+=360),y=Math.PI*y/180,[0,0,c,0,p*Math.cos(y),p*Math.sin(y)];}var l=/*#__PURE__*/function(_e$default9){function l(c){var _this38;_classCallCheck(this,l);_this38=_callSuper(this,l,[c]),_this38[i]({sides:[0,0],angle:60,closeType:"normal"});return _this38;}// readonly
|
|
327
|
+
_inherits(l,_e$default9);return _createClass(l,[{key:"points",get:function get(){return _superPropGet(l,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function
|
|
328
|
+
},{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 p=s(this);_superPropSet(l,"points",p,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}}]);}(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,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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 l=this.attributes.sides;return l[0]>0&&l[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(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 l;});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(d){var _d$sides2=_slicedToArray(d.sides,2),c=_d$sides2[0],p=_d$sides2[1];var y=d.angle%360;y<0&&(y+=360),y=Math.PI*y/180;var P=p*Math.cos(y),T=p*Math.sin(y);return[0,0,c,0,P+c,T,P,T];}var l=/*#__PURE__*/function(_e$default11){function l(c){var _this39;_classCallCheck(this,l);_this39=_callSuper(this,l,[c]),_this39[i]({sides:[0,0],angle:90,closeType:"normal"});return _this39;}// readonly
|
|
329
|
+
_inherits(l,_e$default11);return _createClass(l,[{key:"points",get:function get(){return _superPropGet(l,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function
|
|
330
|
+
},{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 p=s(this);_superPropSet(l,"points",p,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}}]);}(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,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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 l;});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(d){var c=d.edges,p=d.radius,y=d.offsetAngle,P=Math.PI*y/180-0.5*Math.PI;if(c<3||p<=0)return[];var T=[];for(var v=0;v<c;v++){var _x45=v*2*Math.PI/c+P,_f20=p*Math.cos(_x45),g=p*Math.sin(_x45);T.push(_f20,g);}return T;}var l=/*#__PURE__*/function(_e$default13){function l(c){var _this40;_classCallCheck(this,l);_this40=_callSuper(this,l,[c]),_this40[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this40;}// readonly
|
|
331
|
+
_inherits(l,_e$default13);return _createClass(l,[{key:"points",get:function get(){return _superPropGet(l,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function
|
|
332
|
+
},{key:"edges",get:function get(){return this[o]("edges");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("edges",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("radius",c)){var p=s(this);_superPropSet(l,"points",p,this,1,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 p=s(this);_superPropSet(l,"points",p,this,1,1);}}}]);}(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,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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 l;});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(d){var c=d.angles,p=d.innerRadius,y=d.outerRadius,P=d.offsetAngle,T=Math.PI*P/180-0.5*Math.PI;if(c<3||p<=0||y<=0)return[];var v=[];for(var _x46=0;_x46<c*2;_x46++){var _f21=_x46*Math.PI/c+T,g=_x46%2?p:y,u=g*Math.cos(_f21),m=g*Math.sin(_f21);v.push(u,m);}return v;}var l=/*#__PURE__*/function(_e$default15){function l(c){var _this41;_classCallCheck(this,l);_this41=_callSuper(this,l,[c]),_this41[i]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this41;}// readonly
|
|
333
|
+
_inherits(l,_e$default15);return _createClass(l,[{key:"points",get:function get(){return _superPropGet(l,"points",this,1);},set:function set(c){}// eslint-disable-line no-empty-function
|
|
334
|
+
},{key:"angles",get:function get(){return this[o]("angles");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angles",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("innerRadius",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("outerRadius",c)){var p=s(this);_superPropSet(l,"points",p,this,1,1);}}},{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 p=s(this);_superPropSet(l,"points",p,this,1,1);}}}]);}(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,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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,l=_this$attributes16.radiusX,d=_this$attributes16.radiusY,c=_this$attributes16.startAngle,p=_this$attributes16.endAngle;return l>0&&d>0&&c!==p&&_superPropGet(o,"isVisible",this,1);}}]);}(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"),l=Symbol["for"]("spritejs_declareAlias");function d(p){var y=p.radiusX,P=p.radiusY,T=p.startAngle,v=p.endAngle,x=p.direction,f=p.closeType,g=x==="anitclockwise",u=new e.Figure2D();return f==="sector"&&u.moveTo(0,0),u.ellipse(0,0,y,P,0,Math.PI*T/180,Math.PI*v/180,g),f!=="none"&&u.closePath(),u.path.reduce(function(E,R){return E+R.join(" ");},"");}var c=/*#__PURE__*/function(_n$default2){function c(y){var _this42;_classCallCheck(this,c);_this42=_callSuper(this,c,[y]),_this42[a]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
|
|
335
|
+
closeType:"none"// none | sector | normal
|
|
336
|
+
}),_this42[l]("radius","angle");return _this42;}// readonly
|
|
337
|
+
_inherits(c,_n$default2);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
338
|
+
},{key:"radiusX",get:function get(){return this[s]("radiusX");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusX",y)){var P=d(this);this[o]("d",P);}}},{key:"radiusY",get:function get(){return this[s]("radiusY");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("radiusY",y)){var P=d(this);this[o]("d",P);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.radiusX=y[0],this.radiusY=y[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}},{key:"direction",get:function get(){return this[s]("direction");},set:function set(y){if(y!=null&&y!=="clockwise"&&y!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",y);}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("startAngle",y)){var P=d(this);this[o]("d",P);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var P=d(this);this[o]("d",P);}}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="sector"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",y)){var P=d(this);this[o]("d",P);}}}]);}(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,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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 _superPropGet(i,"radiusX",this,1);},set:function set(o){o=Object(n.toNumber)(o),_superPropSet(i,"radiusX",o,this,1,1),_superPropSet(i,"radiusY",o,this,1,1);}}]);}(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,l,d){return l in s?Object.defineProperty(s,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[l]=d,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,l=_this$attributes17.innerRadius,d=_this$attributes17.outerRadius,c=_this$attributes17.startAngle,p=_this$attributes17.endAngle;return(l>0||d>0)&&c!==p&&_superPropGet(o,"isVisible",this,1);}}]);}(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"),l=Symbol["for"]("spritejs_declareAlias");function d(p){var _ref145;var y=p.innerRadius,P=p.outerRadius,T=p.startAngle,v=p.endAngle;var x=new e.Figure2D();if(T=Math.PI*T/180,v=Math.PI*v/180,y>P&&(_ref145=[P,y],y=_ref145[0],P=_ref145[1],_ref145),y<=0&&x.moveTo(0,0),x.arc(0,0,P,T,v,!1),y>0){var u=Math.PI*2;v<T&&(v=T+u+(v-T)%u),v-T>=u&&(v=T+u-1e-6),x.arc(0,0,y,v,T,!0);}return x.closePath(),x.path.reduce(function(u,m){return u+m.join(" ");},"");}var c=/*#__PURE__*/function(_n$default3){function c(y){var _this43;_classCallCheck(this,c);_this43=_callSuper(this,c,[y]),_this43[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this43[l]("radius","angle");return _this43;}// readonly
|
|
339
|
+
_inherits(c,_n$default3);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
340
|
+
},{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("innerRadius",y)){var P=d(this);this[o]("d",P);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("outerRadius",y)){var P=d(this);this[o]("d",P);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.innerRadius=y[0],this.outerRadius=y[1];}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("startAngle",y)){var P=d(this);this[o]("d",P);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[o]("endAngle",y)){var P=d(this);this[o]("d",P);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}}]);}(n["default"]);},/* 248 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return P;});var e=t(12),n=t(218),i=t(219),a=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(T,v,x){return v in T?Object.defineProperty(T,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[v]=x,T;}var l=Symbol("textImage"),d=Symbol("textImageTask"),c=Symbol("textureContext"),p=Symbol("updateTextureRect"),y=Symbol("textCanvas");var P=/*#__PURE__*/function(_i$default3){function P(){var _this44;var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof v=="string"&&(v={text:v}),_this44=_callSuper(this,P,[v]);return _this44;}/* override */_inherits(P,_i$default3);return _createClass(P,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(P,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),v=_superPropGet5[0],x=_superPropGet5[1];var _this$attributes18=this.attributes,f=_this$attributes18.width,g=_this$attributes18.height;if(f==null||g==null){var u=this[l];u&&(f==null&&(v=u.rect[2]),g==null&&(x=u.rect[3]));}return[v,x];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(v){this.attributes.text=v;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(v){this.attributes.text=v;}},{key:"textImage",get:function get(){return this[l]||{};}},{key:"textImageReady",get:function get(){return this[d]||Promise.resolve();}/* override */},{key:"draw",value:function draw(v){_superPropGet(P,"draw",this,3)([v]);var x=this.mesh;if(x){var _f22=this[l];if(_f22){var g=x.texture;if(!g||this[c]&&this[c]!==this.renderer||_f22.needsUpdate?(_f22.needsUpdate=!1,Object(n.deleteTexture)(_f22.image,this.renderer),g=Object(n.createTexture)(_f22.image,this.renderer),this[p]=!0):g=x.uniforms.u_texSampler,this[p]){var _f22$rect$slice=_f22.rect.slice(2),_f22$rect$slice2=_slicedToArray(_f22$rect$slice,2),u=_f22$rect$slice2[0],m=_f22$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),M=_this$contentSize4[0],E=_this$contentSize4[1],R=this.attributes.textAlign,b=this.attributes.verticalAlign;var O=0;R==="center"?O=(M-u)/2:(R==="right"||R==="end")&&(O=M-u);var L=this.attributes.fontSize,w=this.attributes.lineHeight;var I=0;b==="top"?I=(L-w)/2:b==="bottom"&&(I=(w-L)/2);var _this$attributes19=this.attributes,A=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,z=this.attributes.borderWidth;O+=A+z,I+=W+z;var _this$attributes20=this.attributes,K=_this$attributes20.anchorX,k=_this$attributes20.anchorY;O-=this.offsetSize[0]*K,I-=this.offsetSize[1]*k,x.setTexture(g,{rect:[O,I,u,m]}),this[p]=!1,this[c]=this.renderer;}}}return v;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,x,f){v==="text"||v==="fontSize"||v==="fontFamily"||v==="fontStyle"||v==="fontVariant"||v==="fontWeight"||v==="fontStretch"||v==="lineHeight"||v==="strokeColor"||v==="fillColor"||v==="strokeWidth"?this.updateText():((v==="textAlign"||v==="verticalAlign")&&(this[p]=!0),_superPropGet(P,"onPropertyChange",this,3)([v,x,f]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(P,"updateContours",this,3)([]),this[p]=!0;}},{key:"updateText",value:function updateText(){var _this45=this;this[d]||(this[d]=Promise.resolve().then(function(){_this45[d]=null;var _this45$attributes=_this45.attributes,v=_this45$attributes.text,x=_this45$attributes.font,f=_this45$attributes.fillColor,g=_this45$attributes.strokeColor,u=_this45$attributes.strokeWidth,m=_this45.layer?_this45.layer.displayRatio:1;return _this45[y]=_this45[y]||e.ENV.createCanvas(1,1),_this45[l]=e.ENV.createText(v,{font:x,fillColor:f,strokeColor:g,strokeWidth:u,parseFont:e.parseFont,ratio:m,textCanvas:_this45[y]}),_this45[l].needsUpdate=!0,_this45.updateContours(),_this45.forceUpdate(),_this45[l];}));}}]);}(i["default"]);s(P,"Attr",a["default"]),o["default"].registerNode(P,"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"),l=Symbol["for"]("spritejs_getAttribute"),d=Symbol["for"]("spritejs_declareAlias");var c=/*#__PURE__*/function(_a$default2){function c(y){var _this46;_classCallCheck(this,c);_this46=_callSuper(this,c,[y]),_this46[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"}),_this46[d]("font");return _this46;}_inherits(c,_a$default2);return _createClass(c,[{key:"text",get:function get(){return this[l]("text")||" ";},set:function set(y){this[s]("text",y);}},{key:"fontSize",get:function get(){return this[l]("fontSize");},set:function set(y){this[s]("fontSize",Object(n.toNumber)(y));}},{key:"fontFamily",get:function get(){return this[l]("fontFamily");},set:function set(y){this[s]("fontFamily",y);}},{key:"fontStyle",get:function get(){return this[l]("fontStyle");},set:function set(y){this[s]("fontStyle",y);}},{key:"fontVariant",get:function get(){return this[l]("fontVariant");},set:function set(y){this[s]("fontVariant",y);}},{key:"fontWeight",get:function get(){return this[l]("fontWeight");},set:function set(y){this[s]("fontWeight",y);}},{key:"fontStretch",get:function get(){return this[l]("fontStretch");},set:function set(y){this[s]("fontStretch",y);}},{key:"lineHeight",get:function get(){return this[l]("lineHeight")||this.fontSize;},set:function set(y){this[s]("lineHeight",Object(n.toNumber)(y));}},{key:"textAlign",get:function get(){return this[l]("textAlign");},set:function set(y){this[s]("textAlign",y);}},{key:"strokeColor",get:function get(){return this[l]("strokeColor");},set:function set(y){this[s]("strokeColor",Object(i.parseColor)(y));}},{key:"strokeWidth",get:function get(){return this[l]("strokeWidth");},set:function set(y){this[s]("strokeWidth",Object(n.toNumber)(y));}},{key:"verticalAlign",get:function get(){return this[l]("verticalAlign");},set:function set(y){this[s]("verticalAlign",y);}},{key:"fillColor",get:function get(){return this[l]("fillColor");},set:function set(y){this[s]("fillColor",Object(i.parseColor)(y));}},{key:"font",get:function get(){var y=this.fontStyle,P=this.fontVariant,T=this.fontWeight,v=this.fontStretch,x=this.fontSize,f=this.lineHeight,g=this.fontFamily;return"".concat(y," ").concat(P," ").concat(T," ").concat(v," ").concat(x,"px/").concat(f,"px ").concat(g);},set:function set(y){if(y==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var P=Object(e.parseFont)(y);this.fontStyle=P.style,this.fontVariant=P.variant,this.fontWeight=P.weight,this.fontStretch=P.stretch,this.fontSize=Object(n.toNumber)("".concat(P.size).concat(P.unit)),P.lineHeight&&(this.lineHeight=P.pxLineHeight),this.fontFamily=P.family;}}}]);}(a["default"]);},/* 250 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(12),n=t(219),i=t(251),a=t(213),o=t(252);t(1).glMatrix.setMatrixArrayType(Array);function s(P,T,v){return T in P?Object.defineProperty(P,T,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[T]=v,P;}var l=Symbol("zOrder"),d=Symbol("ordered"),c=Symbol("children"),p=Symbol("sealed");var y=/*#__PURE__*/function(_n$default4){function y(){var _this47;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);_this47=_callSuper(this,y,[T]),_this47[c]=[],_this47[d]=null,_this47[l]=0;return _this47;}_inherits(y,_n$default4);return _createClass(y,[{key:"childNodes",get:function get(){return this[c];}},{key:"children",get:function get(){return this[c];}},{key:"orderedChildren",get:function get(){return this[d]||(this[d]=_toConsumableArray(this[c]),this[d].sort(function(T,v){return T.zIndex-v.zIndex||T.zOrder-v.zOrder;})),this[d];}},{key:"append",value:function append(){var _this48=this;for(var _len12=arguments.length,T=new Array(_len12),_key12=0;_key12<_len12;_key12++){T[_key12]=arguments[_key12];}return T.map(function(v){return _this48.appendChild(v);});}},{key:"appendChild",value:function appendChild(T){return T.remove(),this[c].push(T),T.connect(this,this[l]++),this[d]&&(this[d].length&&T.zIndex<this[d][this[d].length-1].zIndex?this.reorder():this[d].push(T)),T;}/* override */ // get isVisible() {
|
|
341
|
+
// return this.attributes.opacity > 0 && this[_children].length > 0;
|
|
342
|
+
// }
|
|
343
|
+
/* override */},{key:"cloneNode",value:function cloneNode(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var v=_superPropGet(y,"cloneNode",this,3)([]);return T&&this[c].forEach(function(x){var f=x.cloneNode(T);v.appendChild(f);}),v;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(T){var v=this.orderedChildren;for(var _x47=v.length-1;_x47>=0;_x47--)if(v[_x47].dispatchPointerEvent(T))return!0;return _superPropGet(y,"dispatchPointerEvent",this,3)([T]);}/* override */},{key:"draw",value:function draw(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(y,"draw",this,3)([T]),!this[p]&&this.attributes.display!=="none"){var v=this.orderedChildren;for(var _x48=0;_x48<v.length;_x48++)v[_x48].draw(T);}return this.__cacheRenderMatrix=null,T;}},{key:"getElementById",value:function getElementById(T){return Object(o.querySelector)("#".concat(T),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(T){return Object(o.querySelectorAll)(".".concat(T),this);}},{key:"getElementsByName",value:function getElementsByName(T){return Object(o.querySelectorAll)("[name=\"".concat(T,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(T){return Object(o.querySelectorAll)(T,this);}},{key:"insertBefore",value:function insertBefore(T,v){if(v==null)return this.appendChild(T);T.remove();var x=this[c].indexOf(v);if(x<0)throw new Error("Invalid reference node.");var f=v.zOrder;for(var g=x;g<this[c].length;g++){var u=this[c][g].zOrder,m=this[c][g];delete m.zOrder,Object.defineProperty(m,"zOrder",{value:u+1,writable:!1,configurable:!0});}if(this[c].splice(x,0,T),T.connect(this,f),this[d])if(T.zIndex!==v.zIndex)this.reorder();else{var _g5=this[d].indexOf(v);this[d].splice(_g5,0,T);}return T;}},{key:"querySelector",value:function querySelector(T){return Object(o.querySelector)(T,this);}},{key:"querySelectorAll",value:function querySelectorAll(T){return Object(o.querySelectorAll)(T,this);}},{key:"replaceChild",value:function replaceChild(T,v){T.remove();var x=this[c].indexOf(v);if(x<0)throw new Error("Invalid reference node.");if(this[c][x]=T,T.connect(this,v.zOrder),this[d])if(T.zIndex!==v.zIndex)this.reorder();else{var _f23=this[d].indexOf(v);this[d][_f23]=T;}return v.disconnect(this),T;}},{key:"removeAllChildren",value:function removeAllChildren(){var T=this[c];for(var v=T.length-1;v>=0;v--)T[v].remove();}},{key:"removeChild",value:function removeChild(T){var v=this[c].indexOf(T);if(v>=0){if(this[c].splice(v,1),this[d]){var _x49=this[d].indexOf(T);this[d].splice(_x49,1);}return T.disconnect(this),T;}return null;}},{key:"reorder",value:function reorder(){this[d]=null;}},{key:"seal",value:function seal(){function T(g,u){var m=[];for(var M=0;M<g.length;M++){var E=_toConsumableArray(g[M]);for(var R=1;R<E.length;R+=2){var b=E[R],O=E[R+1];E[R]=b*u[0]+O*u[2]+u[4],E[R+1]=b*u[1]+O*u[3]+u[5];}m.push(E);}return m;}var v=this.orderedChildren,x=new e.Figure2D(),f=this.localMatrix;for(var g=0;g<v.length;g++){var u=v[g];if(u instanceof y&&(u=u.seal()),u.clientBox){var m=u.clientBox.contours.path;m=T(m,u.localMatrix),x.addPath(m);}if(u.path){var _m6=u.path.contours.path;_m6=T(_m6,u.localMatrix),x.addPath(_m6);}}return this[p]=!0,this.clientBox=x,{clientBox:x,localMatrix:f};}/* override */},{key:"setResolution",value:function setResolution(_ref146){var T=_ref146.width,v=_ref146.height;_superPropGet(y,"setResolution",this,3)([{width:T,height:v}]),this[c].forEach(function(x){x.setResolution({width:T,height:v});});}/* override */},{key:"updateContours",value:function updateContours(){this[p]||_superPropGet(y,"updateContours",this,3)([]);}}]);}(n["default"]);s(y,"Attr",i["default"]),a["default"].registerNode(y,"group");},/* 251 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_e$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_e$default20);return _createClass(n);}(e["default"]);},/* 252 */ /***/function(h,r,t){t.r(r),t.d(r,"querySelectorAll",function(){return p;}),t.d(r,"querySelector",function(){return y;}),t.d(r,"isMatched",function(){return P;}),t.d(r,"compile",function(){return T;});var e=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var i=t(253);function a(v){return v.nodeType===1||n["default"].isSpriteNode(v.nodeName);}function o(v){return Array.from(v.childNodes||[]);}function s(v){return n["default"].isSpriteNode(v.nodeName)?v.parent||v.canvas||v.container:v.parentElement;}function l(v){var x=v.length,f,g,u;for(;--x>-1;){for(f=g=v[x],v[x]=null,u=!0;g;){if(v.indexOf(g)>-1){u=!1,v.splice(x,1);break;}g=s(g);}u&&(v[x]=f);}return v;}var d={isTag:a,existsOne:function existsOne(v,x){return x.some(function(f){return a(f)?v(f)||d.existsOne(v,o(f)):!1;});},getSiblings:function getSiblings(v){var x=s(v);return x&&o(x);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(v,x){if(v.nodeType===1&&x==="class"||x==="id")return v[x];if(this.hasAttrib(v,x)){var _f24=v.attributes[x];return Array.isArray(_f24)&&(_f24="[".concat(_f24.join(),"]")),String(_f24);}},hasAttrib:function hasAttrib(v,x){return v.attributes[x]!=null;},removeSubsets:l,getName:function getName(v){return v.tagName?v.tagName.toLowerCase():null;},findOne:function v(x,f){var g=null;for(var u=0,m=f.length;u<m&&!g;u++)if(x(f[u]))g=f[u];else{var M=o(f[u]);M&&M.length>0&&(g=v(x,M));}return g;},findAll:function v(x,f){var g=[];for(var u=0,m=f.length;u<m;u++){if(!a(f[u]))continue;x(f[u])&&g.push(f[u]);var M=o(f[u]);M&&(g=g.concat(v(x,M)));}return g;},getText:function v(x){return Array.isArray(x)?x.map(v).join(""):a(x)?v(o(x)):x.nodeType===3?x.nodeValue:n["default"].isSpriteNode(x.nodeName)?x.text:"";}};function c(v){if(typeof v!="string")return v;var x=v.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return x&&(x=x.map(function(f){var g=f.slice(1,-1).split("="),u=Object(e.parseColor)(g[1].replace(/['"]/g,""));return[f,"[".concat(g[0],"=\"").concat(u,"\"]")];}),x.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),f=_ref148[0],g=_ref148[1];v=v.replace(f,g);})),x=v.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),x&&(x=x.map(function(f){var g=f.slice(1,-1).split("="),u=g[1].slice(2,-2).split(/,/g).map(function(m){return m.trim();});return[f,"[".concat(g[0],"=\"[").concat(u,"]\"]")];}),x.forEach(function(_ref149){var _ref150=_slicedToArray(_ref149,2),f=_ref150[0],g=_ref150[1];v=v.replace(f,g);})),v;}function p(v,x){return i.selectAll(c(v),x,{adapter:d});}function y(v,x){return i.selectOne(c(v),x,{adapter:d});}function P(v,x){return i.is(v,c(x),{adapter:d});}function T(v){return i.compile(c(v),{adapter:d});}},/* 253 */ /***/function(h,r,t){h.exports=T;var e=t(254),n=t(273).falseFunc,i=t(274);function a(v){return function(f,g,u){return g=g||{},g.adapter=g.adapter||e,v(f,g,u);};}var o=a(i),s=a(i.compileUnsafe);function l(v){return function(f,g,u){return u=u||{},u.adapter=u.adapter||e,typeof f!="function"&&(f=s(f,u,g)),f.shouldTestNextSiblings&&(g=c(u&&u.context||g,u.adapter)),Array.isArray(g)?g=u.adapter.removeSubsets(g):g=u.adapter.getChildren(g),v(f,g,u);};}function d(v,x){var f=x.getSiblings(v);if(!Array.isArray(f))return[];for(f=f.slice(0);f.shift()!==v;);return f;}function c(v,x){Array.isArray(v)||(v=[v]);for(var f=v.slice(0),g=0,u=v.length;g<u;g++){var m=d(f[g],x);f.push.apply(f,m);}return f;}var p=l(function(x,f,g){return x===n||!f||f.length===0?[]:g.adapter.findAll(x,f);}),y=l(function(x,f,g){return x===n||!f||f.length===0?null:g.adapter.findOne(x,f);});function P(v,x,f){return f=f||{},f.adapter=f.adapter||e,(typeof x=="function"?x:o(x,f))(v);}function T(v,x,f){return p(v,x,f);}T.compile=o,T.filters=i.Pseudos.filters,T.pseudos=i.Pseudos.pseudos,T.selectAll=p,T.selectOne=y,T.is=P,T.parse=o,T.iterate=p,T._compileUnsafe=s,T._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,l){return s.children?s.children.map(function(d){return n(d,l);}).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
|
|
344
|
+
Directive:"directive",//<? ... ?>
|
|
345
|
+
Comment:"comment",//<!-- ... -->
|
|
346
|
+
Script:"script",//<script> tags
|
|
347
|
+
Style:"style",//<style> tags
|
|
348
|
+
Tag:"tag",//Any tag
|
|
349
|
+
CDATA:"cdata",//<![CDATA[ ... ]]>
|
|
350
|
+
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(v,x){if(v){var f="",g;for(var u in v)g=v[u],f&&(f+=" "),x.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),f+=u,(g!==null&&g!==""||x.xmlMode)&&(f+='="'+(x.decodeEntities?n.encodeXML(g):g.replace(/\"/g,"""))+'"');return f;}}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},l=h.exports=function(v,x){!Array.isArray(v)&&!v.cheerio&&(v=[v]),x=x||{};for(var f="",g=0;g<v.length;g++){var u=v[g];u.type==="root"?f+=l(u.children,x):e.isTag(u)?f+=c(u,x):u.type===e.Directive?f+=p(u):u.type===e.Comment?f+=T(u):u.type===e.CDATA?f+=P(u):f+=y(u,x);}return f;},d=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function c(v,x){x.xmlMode==="foreign"&&(v.name=i.elementNames[v.name]||v.name,v.parent&&d.indexOf(v.parent.name)>=0&&(x=Object.assign({},x,{xmlMode:!1}))),!x.xmlMode&&["svg","math"].indexOf(v.name)>=0&&(x=Object.assign({},x,{xmlMode:"foreign"}));var f="<"+v.name,g=o(v.attribs,x);return g&&(f+=" "+g),x.xmlMode&&(!v.children||v.children.length===0)?f+="/>":(f+=">",v.children&&(f+=l(v.children,x)),(!s[v.name]||x.xmlMode)&&(f+="</"+v.name+">")),f;}function p(v){return"<"+v.data+">";}function y(v,x){var f=v.data||"";return x.decodeEntities&&!(v.parent&&v.parent.name in a)&&(f=n.encodeXML(f)),f;}function P(v){return"<![CDATA["+v.children[0].data+"]]>";}function T(v){return"<!--"+v.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(d,c){return(!c||c<=0?e.decodeXML:e.decodeHTML)(d);}r.decode=i;function a(d,c){return(!c||c<=0?e.decodeXML:e.decodeHTMLStrict)(d);}r.decodeStrict=a;function o(d,c){return(!c||c<=0?n.encodeXML:n.encodeHTML)(d);}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 l=t(260);Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function get(){return l.decodeXML;}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function get(){return l.decodeHTML;}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function get(){return l.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function get(){return l.decodeHTML;}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function get(){return l.decodeHTML;}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function get(){return l.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function get(){return l.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function get(){return l.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 p=Object.keys(c).join("|"),y=d(c);p+="|#[xX][\\da-fA-F]+|#\\d+";var P=new RegExp("&(?:"+p+");","g");return function(T){return String(T).replace(P,y);};}var l=function l(c,p){return c<p?1:-1;};r.decodeHTML=function(){for(var c=Object.keys(i["default"]).sort(l),p=Object.keys(n["default"]).sort(l),y=0,P=0;y<p.length;y++)c[P]===p[y]?(p[y]+=";?",P++):p[y]+=";";var T=new RegExp("&(?:"+p.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),v=d(n["default"]);function x(f){return f.substr(-1)!==";"&&(f+=";"),v(f);}return function(f){return String(f).replace(T,x);};}();function d(c){return function(y){if(y.charAt(1)==="#"){var P=y.charAt(2);return P==="X"||P==="x"?o["default"](parseInt(y.substr(3),16)):o["default"](parseInt(y.substr(2),10));}return c[y.slice(1,-1)];};}},/* 261 */ /***/function(h){h.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"","zwnj":""}');},/* 262 */ /***/function(h){h.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}');},/* 263 */ /***/function(h){h.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 */ /***/function(h,r,t){var e=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{"default":a};};Object.defineProperty(r,"__esModule",{value:!0});var n=e(t(265));function i(a){if(a>=55296&&a<=57343||a>1114111)return"�";a in n["default"]&&(a=n["default"][a]);var 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(x){return x&&x.__esModule?x:{"default":x};};Object.defineProperty(r,"__esModule",{value:!0}),r.escape=r.encodeHTML=r.encodeXML=void 0;var n=e(t(263)),i=d(n["default"]),a=c(i);r.encodeXML=P(i,a);var o=e(t(261)),s=d(o["default"]),l=c(s);r.encodeHTML=P(s,l);function d(x){return Object.keys(x).sort().reduce(function(f,g){return f[x[g]]="&"+g+";",f;},{});}function c(x){for(var f=[],g=[],u=0,m=Object.keys(x);u<m.length;u++){var M=m[u];M.length===1?f.push("\\"+M):g.push(M);}f.sort();for(var E=0;E<f.length-1;E++){for(var R=E;R<f.length-1&&f[R].charCodeAt(1)+1===f[R+1].charCodeAt(1);)R+=1;var b=1+R-E;b<3||f.splice(E,b,f[E]+"-"+f[R]);}return g.unshift("["+f.join("")+"]"),new RegExp(g.join("|"),"g");}var p=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function y(x){return"&#x"+x.codePointAt(0).toString(16).toUpperCase()+";";}function P(x,f){return function(g){return g.replace(f,function(u){return x[u];}).replace(p,y);};}var T=c(i);function v(x){return x.replace(T,y).replace(p,y);}r.escape=v;},/* 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:l};function n(d,c,p,y){return Array.isArray(c)||(c=[c]),(typeof y!="number"||!isFinite(y))&&(y=1/0),i(d,c,p!==!1,y);}function i(d,c,p,y){for(var P=[],T,v=0,x=c.length;v<x&&!(d(c[v])&&(P.push(c[v]),--y<=0)||(T=c[v].children,p&&T&&T.length>0&&(T=i(d,T,p,y),P=P.concat(T),y-=T.length,y<=0)));v++);return P;}function a(d,c){for(var p=0,y=c.length;p<y;p++)if(d(c[p]))return c[p];return null;}function o(d,c){for(var p=null,y=0,P=c.length;y<P&&!p;y++)if(e(c[y]))d(c[y])?p=c[y]:c[y].children.length>0&&(p=o(d,c[y].children));else continue;return p;}function s(d,c){for(var p=0,y=c.length;p<y;p++)if(e(c[p])&&(d(c[p])||c[p].children.length>0&&s(d,c[p].children)))return!0;return!1;}function l(d,c){for(var p=[],y=c.slice();y.length;){var P=y.shift();e(P)&&(P.children&&P.children.length>0&&y.unshift.apply(y,P.children),d(P)&&p.push(P));}return p;}},/* 271 */ /***/function(h,r,t){var e=t(256),n=r.isTag=e.isTag;r.testElement=function(s,l){for(var d in s)if(s.hasOwnProperty(d)){if(d==="tag_name"){if(!n(l)||!s.tag_name(l.name))return!1;}else if(d==="tag_type"){if(!s.tag_type(l.type))return!1;}else if(d==="tag_contains"){if(n(l)||!s.tag_contains(l.data))return!1;}else if(!l.attribs||!s[d](l.attribs[d]))return!1;}return!0;};var i={tag_name:function tag_name(s){return typeof s=="function"?function(l){return n(l)&&s(l.name);}:s==="*"?n:function(l){return n(l)&&l.name===s;};},tag_type:function tag_type(s){return typeof s=="function"?function(l){return s(l.type);}:function(l){return l.type===s;};},tag_contains:function tag_contains(s){return typeof s=="function"?function(l){return!n(l)&&s(l.data);}:function(l){return!n(l)&&l.data===s;};}};function a(s,l){return typeof l=="function"?function(d){return d.attribs&&l(d.attribs[s]);}:function(d){return d.attribs&&d.attribs[s]===l;};}function o(s,l){return function(d){return s(d)||l(d);};}r.getElements=function(s,l,d,c){var p=Object.keys(s).map(function(y){var P=s[y];return y in i?i[y](P):a(y,P);});return p.length===0?[]:this.filter(p.reduce(o),l,d,c);},r.getElementById=function(s,l,d){return Array.isArray(l)||(l=[l]),this.findOne(a("id",s),l,d!==!1);},r.getElementsByTagName=function(s,l,d,c){return this.filter(i.tag_name(s),l,d,c);},r.getElementsByTagType=function(s,l,d,c){return this.filter(i.tag_type(s),l,d,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,l,d,c,p,y;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(y=0;a[y]===o[y];)y++;return y===0?t.DISCONNECTED:(l=a[y-1],d=l.children,c=a[y],p=o[y],d.indexOf(c)>d.indexOf(p)?l===i?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:l===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,l){var d=e(s,l);return d&t.PRECEDING?-1:d&t.FOLLOWING?1:0;}),n;};},/* 273 */ /***/function(h,r){h.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 */ /***/function(h,r,t){h.exports=p;var e=t(275).parse,n=t(273),i=t(278),a=t(279),o=t(280),s=t(282),l=n.trueFunc,d=n.falseFunc,c=s.filters;function p(O,L,w){var I=P(O,L,w);return y(I,L);}function y(O,L){var w=L.adapter;return function(A){return w.isTag(A)&&O(A);};}function P(O,L,w){var I=e(O,L);return m(I,L,w);}function T(O){return O.type==="pseudo"&&(O.name==="scope"||Array.isArray(O.data)&&O.data.some(function(L){return L.some(T);}));}var v={type:"descendant"},x={type:"_flexibleDescendant"},f={type:"pseudo",name:"scope"},g={};function u(O,L,w){var I=L.adapter,A=!!w&&!!w.length&&w.every(function(W){return W===g||!!I.getParent(W);});O.forEach(function(W){if(!(W.length>0&&M(W[0])&&W[0].type!=="descendant"))if(A&&!(Array.isArray(W)?W.some(T):T(W)))W.unshift(v);else return;W.unshift(f);});}function m(O,L,w){O=O.filter(function(z){return z.length>0;}),O.forEach(i);var I=Array.isArray(w);w=L&&L.context||w,w&&!I&&(w=[w]),u(O,L,w);var A=!1,W=O.map(function(z){if(z[0]&&z[1]&&z[0].name==="scope"){var K=z[1].type;I&&K==="descendant"?z[1]=x:(K==="adjacent"||K==="sibling")&&(A=!0);}return E(z,L,w);}).reduce(R,d);return W.shouldTestNextSiblings=A,W;}function M(O){return a[O.type]<0;}function E(O,L,w){return O.reduce(function(I,A){if(I===d)return I;if(!(A.type in o))throw new Error("Rule type "+A.type+" is not supported by css-select");return o[A.type](I,A,L,w);},L&&L.rootFunc||l);}function R(O,L){return L===d||O===l?O:O===d||L===l?L:function(I){return O(I)||L(I);};}function b(O){return O.some(M);}c.not=function(O,L,w,I){var A={xmlMode:!!(w&&w.xmlMode),strict:!!(w&&w.strict),adapter:w.adapter};if(A.strict&&(L.length>1||L.some(b)))throw new Error("complex selectors in :not aren't allowed in strict mode");var W=m(L,A,I);return W===d?O:W===l?d:function(K){return!W(K)&&O(K);};},c.has=function(O,L,w){var I=w.adapter,A={xmlMode:!!(w&&w.xmlMode),strict:!!(w&&w.strict),adapter:I},W=L.some(b)?[g]:null,z=m(L,A,W);return z===d?d:z===l?function(k){return I.getChildren(k).some(I.isTag)&&O(k);}:(z=y(z,w),W?function(k){return O(k)&&(W[0]=k,I.existsOne(z,I.getChildren(k)));}:function(k){return O(k)&&I.existsOne(z,I.getChildren(k));});},c.matches=function(O,L,w,I){var A={xmlMode:!!(w&&w.xmlMode),strict:!!(w&&w.strict),rootFunc:O,adapter:w.adapter};return m(L,A,I);},p.compileToken=m,p.compileUnsafe=P,p.Pseudos=s;},/* 275 */ /***/function(h,r,t){var e=this&&this.__createBinding||(Object.create?function(o,s,l,d){d===void 0&&(d=l),Object.defineProperty(o,d,{enumerable:!0,get:function get(){return s[l];}});}:function(o,s,l,d){d===void 0&&(d=l),o[d]=s[l];}),n=this&&this.__exportStar||function(o,s){for(var l in o)l!=="default"&&!s.hasOwnProperty(l)&&e(s,o,l);};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"]=T;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"]},l=/* @__PURE__ */new Set(["has","not","matches"]),d=/* @__PURE__ */new Set(["contains","icontains"]),c=/* @__PURE__ */new Set(['"',"'"]);function p(f,g,u){var m=parseInt(g,16)-65536;return m!==m||u?g:m<0?// BMP codepoint
|
|
351
|
+
String.fromCharCode(m+65536):// Supplemental Plane codepoint (surrogate pair)
|
|
352
|
+
String.fromCharCode(m>>10|55296,m&1023|56320);}function y(f){return f.replace(n,p);}function P(f){return f===" "||f==="\n"||f===" "||f==="\f"||f==="\r";}function T(f,g){var u=[];if(f=v(u,""+f,g),f!=="")throw new Error("Unmatched selector: "+f);return u;}function v(f,g,u){var m=[],M=!1;function E(){var Z=g.match(e);if(!Z)throw new Error("Expected name, found "+g);var nt=Z[0];return g=g.substr(nt.length),y(nt);}function R(Z){for(;P(g.charAt(Z));)Z++;g=g.substr(Z);}function b(Z){for(var nt=0;g.charAt(--Z)==="\\";)nt++;return(nt&1)===1;}for(R(0);g!=="";){var O=g.charAt(0);if(P(O))M=!0,R(1);else if(O in o)m.push({type:o[O]}),M=!1,R(1);else if(O===","){if(m.length===0)throw new Error("Empty sub-selector");f.push(m),m=[],M=!1,R(1);}else if(M&&(m.length>0&&m.push({type:"descendant"}),M=!1),O==="*")g=g.substr(1),m.push({type:"universal"});else if(O in s){var L=s[O],w=L[0],I=L[1];g=g.substr(1),m.push({type:"attribute",name:w,action:I,value:E(),ignoreCase:!1});}else if(O==="["){g=g.substr(1);var A=g.match(i);if(!A)throw new Error("Malformed attribute selector: "+g);g=g.substr(A[0].length);var W=y(A[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),m.push({type:"attribute",name:W,action:a[A[2]],value:y(A[4]||A[5]||""),ignoreCase:!!A[6]});}else if(O===":"){if(g.charAt(1)===":"){g=g.substr(2),m.push({type:"pseudo-element",name:E().toLowerCase()});continue;}g=g.substr(1);var z=E().toLowerCase(),A=null;if(g.charAt(0)==="(")if(l.has(z)){var K=g.charAt(1),k=c.has(K);if(g=g.substr(k?2:1),A=[],g=v(A,g,u),k){if(g.charAt(0)!==K)throw new Error("Unmatched quotes in :"+z);g=g.substr(1);}if(g.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+z+" ("+g+")");g=g.substr(1);}else{for(var q=1,U=1;U>0&&q<g.length;q++)g.charAt(q)==="("&&!b(q)?U++:g.charAt(q)===")"&&!b(q)&&U--;if(U)throw new Error("Parenthesis not matched");if(A=g.substr(1,q-2),g=g.substr(q),d.has(z)){var K=A.charAt(0);K===A.slice(-1)&&c.has(K)&&(A=A.slice(1,-1)),A=y(A);}}m.push({type:"pseudo",name:z,data:A});}else if(e.test(g)){var G=E();(!u||("lowerCaseTags"in u?u.lowerCaseTags:!u.xmlMode))&&(G=G.toLowerCase()),m.push({type:"tag",name:G});}else return m.length&&m[m.length-1].type==="descendant"&&m.pop(),x(f,m),g;}return x(f,m),g;}function x(f,g){if(f.length>0&&g.length===0)throw new Error("Empty sub-selector");f.push(g);}},/* 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),l=1;l<o.length;l++){var d=s[l];if(!(d<0))for(var c=l-1;c>=0&&d<s[c];c--){var p=o[c+1];o[c+1]=o[c],o[c]=p,s[c+1]=s[c],s[c]=d;}}}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 l=0;l<o.data.length;l++)if(o.data[l].length===1){var d=a(o.data[l][0]);if(d===0){s=0;break;}d>s&&(s=d);}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
|
|
353
|
+
tag:function tag(i,a,o){var s=a.name,l=o.adapter;return function(c){return l.getName(c)===s&&i(c);};},//traversal
|
|
354
|
+
descendant:function descendant(i,a,o){var s=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,l=o.adapter;return function(c){for(var p=!1;!p&&(c=l.getParent(c));)(!s||!s.has(c))&&(p=i(c),!p&&s&&s.add(c));return p;};},_flexibleDescendant:function _flexibleDescendant(i,a,o){var s=o.adapter;return function(d){for(var c=i(d);!c&&(d=s.getParent(d));)c=i(d);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(l);};function l(d){return s.isTag(d)&&i(d);}},child:function child(i,a,o){var s=o.adapter;return function(d){var c=s.getParent(d);return!!c&&i(c);};},sibling:function sibling(i,a,o){var s=o.adapter;return function(d){for(var c=s.getSiblings(d),p=0;p<c.length;p++)if(s.isTag(c[p])){if(c[p]===d)break;if(i(c[p]))return!0;}return!1;};},adjacent:function adjacent(i,a,o){var s=o.adapter;return function(d){for(var c=s.getSiblings(d),p,y=0;y<c.length;y++)if(s.isTag(c[y])){if(c[y]===d)break;p=c[y];}return!!p&&i(p);};},universal:function universal(i){return i;}};},/* 281 */ /***/function(h,r,t){var e=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function equals(a,o,s){var l=o.name,d=o.value,c=s.adapter;return o.ignoreCase?(d=d.toLowerCase(),function(y){var P=c.getAttributeValue(y,l);return P!=null&&P.toLowerCase()===d&&a(y);}):function(y){return c.getAttributeValue(y,l)===d&&a(y);};},hyphen:function hyphen(a,o,s){var l=o.name,d=o.value,c=d.length,p=s.adapter;return o.ignoreCase?(d=d.toLowerCase(),function(P){var T=p.getAttributeValue(P,l);return T!=null&&(T.length===c||T.charAt(c)==="-")&&T.substr(0,c).toLowerCase()===d&&a(P);}):function(P){var T=p.getAttributeValue(P,l);return T!=null&&T.substr(0,c)===d&&(T.length===c||T.charAt(c)==="-")&&a(P);};},element:function element(a,o,s){var l=o.name,d=o.value,c=s.adapter;if(/\s/.test(d))return e;d=d.replace(n,"\\$&");var p="(?:^|\\s)"+d+"(?:$|\\s)",y=o.ignoreCase?"i":"",P=new RegExp(p,y);return function(v){var x=c.getAttributeValue(v,l);return x!=null&&P.test(x)&&a(v);};},exists:function exists(a,o,s){var l=o.name,d=s.adapter;return function(p){return d.hasAttrib(p,l)&&a(p);};},start:function start(a,o,s){var l=o.name,d=o.value,c=d.length,p=s.adapter;return c===0?e:o.ignoreCase?(d=d.toLowerCase(),function(P){var T=p.getAttributeValue(P,l);return T!=null&&T.substr(0,c).toLowerCase()===d&&a(P);}):function(P){var T=p.getAttributeValue(P,l);return T!=null&&T.substr(0,c)===d&&a(P);};},end:function end(a,o,s){var l=o.name,d=o.value,c=-d.length,p=s.adapter;return c===0?e:o.ignoreCase?(d=d.toLowerCase(),function(P){var T=p.getAttributeValue(P,l);return T!=null&&T.substr(c).toLowerCase()===d&&a(P);}):function(P){var T=p.getAttributeValue(P,l);return T!=null&&T.substr(c)===d&&a(P);};},any:function any(a,o,s){var l=o.name,d=o.value,c=s.adapter;if(d==="")return e;if(o.ignoreCase){var p=new RegExp(d.replace(n,"\\$&"),"i");return function(P){var T=c.getAttributeValue(P,l);return T!=null&&p.test(T)&&a(P);};}return function(P){var T=c.getAttributeValue(P,l);return T!=null&&T.indexOf(d)>=0&&a(P);};},not:function not(a,o,s){var l=o.name,d=o.value,c=s.adapter;return d===""?function(y){return!!c.getAttributeValue(y,l)&&a(y);}:o.ignoreCase?(d=d.toLowerCase(),function(y){var P=c.getAttributeValue(y,l);return P!=null&&P.toLowerCase()!==d&&a(y);}):function(y){return c.getAttributeValue(y,l)!==d&&a(y);};}};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 l(x,f){var g={name:x,value:f};return function(m,M,E){return s(m,g,E);};}function d(x,f){return function(g){return!!f.getParent(g)&&x(g);};}var c={contains:function contains(x,f,g){var u=g.adapter;return function(M){return x(M)&&u.getText(M).indexOf(f)>=0;};},icontains:function icontains(x,f,g){var u=f.toLowerCase(),m=g.adapter;return function(E){return x(E)&&m.getText(E).toLowerCase().indexOf(u)>=0;};},//location specific methods
|
|
355
|
+
"nth-child":function nthChild(x,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(x,m):function(E){for(var R=m.getSiblings(E),b=0,O=0;b<R.length;b++)if(m.isTag(R[b])){if(R[b]===E)break;O++;}return u(O)&&x(E);};},"nth-last-child":function nthLastChild(x,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(x,m):function(E){for(var R=m.getSiblings(E),b=0,O=R.length-1;O>=0;O--)if(m.isTag(R[O])){if(R[O]===E)break;b++;}return u(b)&&x(E);};},"nth-of-type":function nthOfType(x,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(x,m):function(E){for(var R=m.getSiblings(E),b=0,O=0;O<R.length;O++)if(m.isTag(R[O])){if(R[O]===E)break;m.getName(R[O])===m.getName(E)&&b++;}return u(b)&&x(E);};},"nth-last-of-type":function nthLastOfType(x,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(x,m):function(E){for(var R=m.getSiblings(E),b=0,O=R.length-1;O>=0;O--)if(m.isTag(R[O])){if(R[O]===E)break;m.getName(R[O])===m.getName(E)&&b++;}return u(b)&&x(E);};},//TODO determine the actual root element
|
|
356
|
+
root:function root(x,f,g){var u=g.adapter;return function(m){return!u.getParent(m)&&x(m);};},scope:function scope(x,f,g,u){var m=g.adapter;if(!u||u.length===0)return c.root(x,f,g);function M(E,R){return typeof m.equals=="function"?m.equals(E,R):E===R;}return u.length===1?function(E){return M(u[0],E)&&x(E);}:function(E){return u.indexOf(E)>=0&&x(E);};},//jQuery extensions (others follow as pseudos)
|
|
357
|
+
checkbox:l("type","checkbox"),file:l("type","file"),password:l("type","password"),radio:l("type","radio"),reset:l("type","reset"),image:l("type","image"),submit:l("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
|
|
358
|
+
hover:function hover(x,f,g){var u=g.adapter;return typeof u.isHovered=="function"?function(M){return x(M)&&u.isHovered(M);}:o;},visited:function visited(x,f,g){var u=g.adapter;return typeof u.isVisited=="function"?function(M){return x(M)&&u.isVisited(M);}:o;},active:function active(x,f,g){var u=g.adapter;return typeof u.isActive=="function"?function(M){return x(M)&&u.isActive(M);}:o;}};function p(x,f){for(var g=0;x&&g<x.length;g++)if(f.isTag(x[g]))return x[g];}var y={empty:function empty(x,f){return!f.getChildren(x).some(function(g){return f.isTag(g)||g.type==="text";});},"first-child":function firstChild(x,f){return p(f.getSiblings(x),f)===x;},"last-child":function lastChild(x,f){for(var g=f.getSiblings(x),u=g.length-1;u>=0;u--){if(g[u]===x)return!0;if(f.isTag(g[u]))break;}return!1;},"first-of-type":function firstOfType(x,f){for(var g=f.getSiblings(x),u=0;u<g.length;u++)if(f.isTag(g[u])){if(g[u]===x)return!0;if(f.getName(g[u])===f.getName(x))break;}return!1;},"last-of-type":function lastOfType(x,f){for(var g=f.getSiblings(x),u=g.length-1;u>=0;u--)if(f.isTag(g[u])){if(g[u]===x)return!0;if(f.getName(g[u])===f.getName(x))break;}return!1;},"only-of-type":function onlyOfType(x,f){for(var g=f.getSiblings(x),u=0,m=g.length;u<m;u++)if(f.isTag(g[u])){if(g[u]===x)continue;if(f.getName(g[u])===f.getName(x))return!1;}return!0;},"only-child":function onlyChild(x,f){for(var g=f.getSiblings(x),u=0;u<g.length;u++)if(f.isTag(g[u])&&g[u]!==x)return!1;return!0;},//:matches(a, area, link)[href]
|
|
359
|
+
link:function link(x,f){return f.hasAttrib(x,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
|
|
360
|
+
//forms
|
|
361
|
+
//to consider: :target
|
|
362
|
+
//:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
|
|
363
|
+
selected:function selected(x,f){if(f.hasAttrib(x,"selected"))return!0;if(f.getName(x)!=="option")return!1;var g=f.getParent(x);if(!g||f.getName(g)!=="select"||f.hasAttrib(g,"multiple"))return!1;for(var u=f.getChildren(g),m=!1,M=0;M<u.length;M++)if(f.isTag(u[M]))if(u[M]===x)m=!0;else if(m){if(f.hasAttrib(u[M],"selected"))return!1;}else return!1;return m;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
|
|
364
|
+
//:matches(
|
|
365
|
+
// :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
|
|
366
|
+
// optgroup[disabled] > option),
|
|
367
|
+
// fieldset[disabled] * //TODO not child of first <legend>
|
|
368
|
+
//)
|
|
369
|
+
disabled:function disabled(x,f){return f.hasAttrib(x,"disabled");},enabled:function enabled(x,f){return!f.hasAttrib(x,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
|
|
370
|
+
checked:function checked(x,f){return f.hasAttrib(x,"checked")||y.selected(x,f);},//:matches(input, select, textarea)[required]
|
|
371
|
+
required:function required(x,f){return f.hasAttrib(x,"required");},//:matches(input, select, textarea):not([required])
|
|
372
|
+
optional:function optional(x,f){return!f.hasAttrib(x,"required");},//jQuery extensions
|
|
373
|
+
//:not(:empty)
|
|
374
|
+
parent:function parent(x,f){return!y.empty(x,f);},//:matches(h1, h2, h3, h4, h5, h6)
|
|
375
|
+
header:P(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
|
|
376
|
+
button:function button(x,f){var g=f.getName(x);return g==="button"||g==="input"&&f.getAttributeValue(x,"type")==="button";},//:matches(input, textarea, select, button)
|
|
377
|
+
input:P(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
|
|
378
|
+
text:function text(x,f){var g;return f.getName(x)==="input"&&(!(g=f.getAttributeValue(x,"type"))||g.toLowerCase()==="text");}};function P(x){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var f=new Set(x);return function(g,u){return f.has(u.getName(g));};}return function(g,u){return x.indexOf(u.getName(g))>=0;};}function T(x,f,g){if(g===null){if(x.length>2&&f!=="scope")throw new Error("pseudo-selector :"+f+" requires an argument");}else if(x.length===2)throw new Error("pseudo-selector :"+f+" doesn't have any arguments");}var v=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;h.exports={compile:function compile(x,f,g,u){var m=f.name,M=f.data,E=g.adapter;if(g&&g.strict&&!v.test(m))throw new Error(":"+m+" isn't part of CSS3");if(typeof c[m]=="function")return c[m](x,M,g,u);if(typeof y[m]=="function"){var R=y[m];return T(R,m,M),R===o?R:x===a?function(O){return R(O,E,M);}:function(O){return R(O,E,M)&&x(O);};}else throw new Error("unmatched pseudo-class :"+m);},filters:c,pseudos:y};},/* 283 */ /***/function(h,r,t){var e=t(284),n=t(285);h.exports=function(a){return n(e(a));},h.exports.parse=e,h.exports.compile=n;},/* 284 */ /***/function(h,r){h.exports=e;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function e(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var i=n.match(t);if(!i)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var a;return i[1]?(a=parseInt(i[1],10),isNaN(a)&&(i[1].charAt(0)==="-"?a=-1:a=1)):a=0,[a,i[3]?parseInt((i[2]||"")+i[3],10):0];}},/* 285 */ /***/function(h,r,t){h.exports=a;var e=t(273),n=e.trueFunc,i=e.falseFunc;function a(o){var s=o[0],l=o[1]-1;if(l<0&&s<=0)return i;if(s===-1)return function(c){return c<=l;};if(s===0)return function(c){return c===l;};if(s===1)return l<0?n:function(c){return c>=l;};var d=l%s;return d<0&&(d+=s),s>1?function(c){return c>=l&&c%s===d;}:(s*=-1,function(c){return c<=l&&c%s===d;});}},/* 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),l=t(218);t(1).glMatrix.setMatrixArrayType(Array);function d(E,R){if(E==null)return{};var b=c(E,R),O,L;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(E);for(L=0;L<w.length;L++)O=w[L],!(R.indexOf(O)>=0)&&Object.prototype.propertyIsEnumerable.call(E,O)&&(b[O]=E[O]);}return b;}function c(E,R){if(E==null)return{};var b={},O=Object.keys(E),L,w;for(w=0;w<O.length;w++)L=O[w],!(R.indexOf(L)>=0)&&(b[L]=E[L]);return b;}var p={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
|
|
379
|
+
},y=Symbol("autoRender"),P=Symbol("renderer"),T=Symbol("timeline"),v=Symbol("prepareRender"),x=Symbol("tickRender"),f=Symbol("pass"),g=Symbol("fbo"),u=Symbol("tickers"),m=Symbol("layerTransformInvert");var M=/*#__PURE__*/function(_o$default){function M(){var _this49;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this49=_callSuper(this,M),!R.canvas){var _this49$getResolution=_this49.getResolution(),w=_this49$getResolution.width,I=_this49$getResolution.height,A=e.ENV.createCanvas(w,I,{offscreen:!!R.offscreen,id:R.id,extra:R.extra});A.style&&(A.style.position="absolute"),A.dataset&&(A.dataset.layerId=R.id),A.contextType&&(R.contextType=A.contextType),R.canvas=A;}var b=R.canvas,O=Object.assign({},p,R);_this49[y]=O.autoRender,delete R.autoRender;var L=O.Renderer||e.Renderer;_this49[P]=new L(b,O),_this49.options=R,_this49.id=R.id,_this49[f]=[],_this49.setResolution(b),_this49.canvas=b,_this49[T]=new n.Timeline(),_this49.__mouseCapturedTarget=null,_this49[m]=null;return _assertThisInitialized(_this49);}_inherits(M,_o$default);return _createClass(M,[{key:"autoRender",get:function get(){return this[y];}},{key:"displayRatio",get:function get(){return this.parent&&this.parent.options?this.parent.options.displayRatio:1;}},{key:"height",get:function get(){var _this$getResolution=this.getResolution(),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[f];}},{key:"prepareRender",get:function get(){return this[v]?this[v]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[P];}},{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[T];}},{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[m])return this[m];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[m]=i.mat2d.invert(Array.of(0,0,0,0,0,0),R),this[m]);}},{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) {
|
|
380
|
+
// return true;
|
|
381
|
+
// }
|
|
382
|
+
},{key:"addPass",value:function addPass(){var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},R=_ref151.vertex,b=_ref151.fragment,O=_ref151.options,L=_ref151.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),w=_this$getResolution3.width,I=_this$getResolution3.height,A=this.renderer.createPassProgram({vertex:R,fragment:b,options:O}),W=new e.Figure2D();W.rect(0,0,w/this.displayRatio,I/this.displayRatio);var z=new e.Mesh2D(W);return z.setUniforms(L),z.setProgram(A),this[f].push(z),this.forceUpdate(),z;}return null;}// delete unused texture to release memory.
|
|
383
|
+
},{key:"deleteTexture",value:function deleteTexture(R){return Object(l.deleteTexture)(R,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(R){var b=R.type;if(b==="mousedown"||b==="mouseup"||b==="mousemove"){var A=this.__mouseCapturedTarget;if(A){if(A.layer===this)return A.dispatchEvent(R),!0;this.__mouseCapturedTarget=null;}}var O,L;var w=this.layerTransformInvert;if(w){O=R.x,L=R.y;var _A6=w,W=_A6[0]*O+_A6[2]*L+_A6[4],z=_A6[1]*O+_A6[3]*L+_A6[5];delete R.x,delete R.y,delete R.layerX,delete R.layerY,Object.defineProperties(R,{layerX:{value:W,configurable:!0},layerY:{value:z,configurable:!0},x:{value:W,configurable:!0},y:{value:z,configurable:!0}});}var I=_superPropGet(M,"dispatchPointerEvent",this,3)([R]);return w&&Object.defineProperties(R,{layerX:{value:O,configurable:!0},layerY:{value:L,configurable:!0},x:{value:O,configurable:!0},y:{value:L,configurable:!0}}),I;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this50=this;if(!this[v])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var R=null;var b=new Promise(function(O){R=O;});b._resolve=R,this[v]=b;}else{var _R2=null,_b8=null;var O=new Promise(function(L){_R2=L,_this50[y]&&(_b8=Object(a.requestAnimationFrame)(function(){delete O._requestID,_this50.render();}));});O._resolve=_R2,O._requestID=_b8,this[v]=O;}}},{key:"getFBO",value:function getFBO(){var R=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),b=_this$getResolution4.width,O=_this$getResolution4.height;return R&&(!this[g]||this[g].width!==b||this[g].height!==O)?(this[g]={width:b,height:O,target:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref152=[this.buffer,this.target];this.target=_ref152[0];this.buffer=_ref152[1];}},this[g]):this[g]?this[g]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var R=this.renderer,b=R.__globalTransformMatrix||R.globalTransformMatrix;R.__globalTransformMatrix=b;var O=i.mat2d.fromValues(1,0,0,1,0,0);R.setGlobalTransform.apply(R,_toConsumableArray(i.mat2d.multiply(O,b,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(R,b,O){if(_superPropGet(M,"onPropertyChange",this,3)([R,b,O]),R==="zIndex"&&(this.canvas.style.zIndex=b),R==="transform"||R==="translate"||R==="rotate"||R==="scale"||R==="skew"){var L=this[m];if(this[m]=null,this.updateGlobalTransform(),L&&!this.layerTransformInvert){var w=this.renderer,I=w.__globalTransformMatrix||w.globalTransformMatrix;w.setGlobalTransform.apply(w,_toConsumableArray(I));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[v]&&(this[v]._requestID&&Object(a.cancelAnimationFrame)(this[v]._requestID),this[v]._resolve(),delete this[v]);}},{key:"render",value:function render(){var _this51=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[f].length?this.getFBO():null;b&&this.renderer.glRenderer.bindFBO(b.target),R&&this[P].clear();var O=this.draw();if(O&&O.length&&(this.renderer.drawMeshes(O),this.canvas.draw&&this.canvas.draw()),b){var L=this.renderer.glRenderer,w=this[f].length,_this$getResolution5=this.getResolution(),I=_this$getResolution5.width,A=_this$getResolution5.height,W=[0,0,I/this.displayRatio,A/this.displayRatio];this[f].forEach(function(z,K){z.blend=!0,z.setTexture(b.target.texture,{rect:W}),K===w-1?L.bindFBO(null):(b.swap(),L.bindFBO(b.target)),_this51[P].clear(),_this51.renderer.drawMeshes([z]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref154){var _this52=this;var R=_ref154.width,b=_ref154.height;var O=this.renderer,L=O.__globalTransformMatrix||O.globalTransformMatrix,w=L[4],I=L[5],A=L[0],_this$getResolution6=this.getResolution(),W=_this$getResolution6.width,z=_this$getResolution6.height;(W!==R||z!==b)&&(_superPropGet(M,"setResolution",this,3)([{width:R,height:b}]),this.canvas&&(this.canvas.width=R,this.canvas.height=b,O.updateResolution&&O.updateResolution()),this.attributes.size=[R,b],this[f].length&&this[f].forEach(function(U){var G=new e.Figure2D();G.rect(0,0,R/_this52.displayRatio,b/_this52.displayRatio),U.contours=G.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),K=_this$renderOffset[0],k=_this$renderOffset[1],q=this.displayRatio;(w!==K||I!==k||A!==q)&&(O.setGlobalTransform(q,0,0,q,K,k),O.__globalTransformMatrix=null,this[m]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
|
|
384
|
+
* tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
|
|
385
|
+
* @param {*} handler
|
|
386
|
+
* @param {*} options
|
|
387
|
+
*/},{key:"tick",value:function tick(){var _this53=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,O=_b$duration===void 0?1/0:_b$duration,L=d(b,["duration"]);var w=this.timeline.fork(L),I=this;this[u]=this[u]||[],this[u].push({handler:R,duration:O});var _A7=function A(){var W=null,z=null;var K=function K(){var k=_this53[u].map(function(_ref155){var q=_ref155.handler,U=_ref155.duration;var G=Math.min(1,w.currentTime/U);return{value:q?q(w.currentTime,G):null,p:G};});I[x]||(I[x]=Promise.resolve().then(function(){I[y]&&I.render(),delete I[x];for(var q=k.length-1;q>=0;q--){var _k$q=k[q],U=_k$q.value,G=_k$q.p;(U===!1||G>=1)&&_this53[u].splice(q,1);}_this53[u].length>0&&_A7();}));};if(_this53[v]&&_this53[v]._type!=="ticker"&&(Object(a.cancelAnimationFrame)(_this53[v]._requestID),delete _this53[v]),!_this53[v]){var k=new Promise(function(q){W=q,z=Object(a.requestAnimationFrame)(K);});k._resolve=W,k._requestID=z,k._type="ticker",_this53[v]=k;}};_A7();}},{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(),O=_this$getResolution7.width,L=_this$getResolution7.height,w=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*I[0]/O+w[0],b=b*I[1]/L+w[1];var A=this.displayRatio;return R*=A,b*=A,[R,b];}},{key:"toLocalPos",value:function toLocalPos(R,b){var _this$getResolution8=this.getResolution(),O=_this$getResolution8.width,L=_this$getResolution8.height,w=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*O/I[0]-w[0],b=b*L/I[1]-w[1];var A=this.displayRatio;R/=A,b/=A;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 v;});var e=t(224),n=t(288),i=t(213),a=t(252),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(x,f){if(x==null)return{};var g=l(x,f),u,m;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(x);for(m=0;m<M.length;m++)u=M[m],!(f.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(x,u)&&(g[u]=x[u]);}return g;}function l(x,f){if(x==null)return{};var g={},u=Object.keys(x),m,M;for(M=0;M<u.length;M++)m=u[M],!(f.indexOf(m)>=0)&&(g[m]=x[m]);return g;}function d(x,f,g){return f in x?Object.defineProperty(x,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):x[f]=g,x;}var c="http://www.w3.org/2000/svg",p=Symbol["for"]("spritejs_setAttribute"),y=Symbol("root"),P=Symbol("task");function T(x){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var g=x[y];if(g&&g.children[0]){var u=x.svg,m=x.layer?x.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=x.attributes.width||Number(u.getAttribute("data-original-width")),E=x.attributes.height||Number(u.getAttribute("data-original-height"));if(M*=m,E*=m,f&&x.attributes.flexible){var _R3=x.attributes.scale[0];if(M*=_R3,E*=_R3,u.setAttribute("width",M),u.setAttribute("height",E),M&&E&&x.textureImage){var _b9=x.textureImage.width,O=x.textureImage.height,L=x.clientSize;x.attributes.textureRect=[0,0,Math.round(L[0]*_b9/M),Math.round(L[1]*O/E)];}}else x[P]||(u.setAttribute("width",M),u.setAttribute("height",E),x[P]=Promise.resolve().then(function(){delete x[P];var R=g.innerHTML,b=new Blob([R],{type:"image/svg+xml"}),O=URL.createObjectURL(b),L=new Image();L.onload=function(){L.width&&L.height?(x.attributes[p]("texture",L),x.attributes.flexible&&(x.attributes.textureRect=null)):x.attributes[p]("texture",null);},L.src=O;}));}}var v=/*#__PURE__*/function(_e$default21){function v(){var _this54;var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,v);typeof f=="string"&&(f={svgText:f});var _f25=f,g=_f25.svgText,u=s(f,["svgText"]);if(_this54=_callSuper(this,v,[u]),_this54[y]=document.createElement("div"),g){_this54[y].innerHTML=g;var m=_this54[y].children[0];m?m.setAttribute("xmlns",c):(fetch(g).then(function(M){return M.text();}).then(function(M){_this54[y].innerHTML=M,(!_this54.observer||_this54.attributes.flexible)&&T(_assertThisInitialized(_this54));}),g=null);}if(!g){var _m7=document.createElementNS(c,"svg");_m7.setAttribute("xmlns",c),_this54[y].appendChild(_m7);}if(typeof MutationObserver=="function"){var _m8=new MutationObserver(function(M){T(_assertThisInitialized(_this54),!1);});_m8.observe(_this54[y],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this54.observer=_m8;}return _assertThisInitialized(_this54);}_inherits(v,_e$default21);return _createClass(v,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[y]?this[y].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref156){var f=_ref156.width,g=_ref156.height;_superPropGet(v,"setResolution",this,3)([{width:f,height:g}]),T(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(f){var g=_superPropGet(v,"dispatchPointerEvent",this,3)([f]);if(g&&this.attributes.passEvents&&typeof MouseEvent=="function"){var u=f.x,m=f.y;var _this$getOffsetPositi=this.getOffsetPosition(u,m),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),M=_this$getOffsetPositi2[0],E=_this$getOffsetPositi2[1];var R=f.originalEvent,b=this.attributes.anchor,O=this.clientSize;M=(M+b[0]*O[0])/2,E=(E+b[1]*O[1])/2;var L=f.type;if(L===R.type){var w=null;if(R instanceof MouseEvent)w=new MouseEvent(L,{screenX:M,screenY:E,clientX:M,clientY:E,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,
|
|
388
|
+
which:R.witch});else if(R instanceof TouchEvent){var I=null;var A=R.changedTouches||[R];for(var W=0;W<A.length;W++){var z=A[W];if(f.identifier===z.identifier){I=z;break;}}if(I){var _W3=new Touch({identifier:I.identifier,target:I.target,clientX:M,clientY:E,screenX:M,screenY:E,pageX:M,pageY:E,radiusX:I.radiusX,radiusY:I.radiusY,rotationAngle:I.rotationAngle,force:I.force});w=new TouchEvent(L,{cancelable:R.cancelable,bubbles:R.bubbles,composed:R.composed,touches:[_W3],targetTouches:[_W3],changedTouches:[_W3]});}}else w=R;w&&this.svg.dispatchEvent(w);}}return g;}},{key:"getElementById",value:function getElementById(f){return Object(a.querySelector)("#".concat(f),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(f){return Object(a.querySelectorAll)(".".concat(f),this);}},{key:"getElementsByName",value:function getElementsByName(f){return Object(a.querySelectorAll)("[name=\"".concat(f,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(f){return Object(a.querySelectorAll)(f,this);}},{key:"querySelector",value:function querySelector(f){return Object(a.querySelector)(f,this);}},{key:"querySelectorAll",value:function querySelectorAll(f){return Object(a.querySelectorAll)(f,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(f,g,u){_superPropGet(v,"onPropertyChange",this,3)([f,g,u]),f==="flexible"&&T(this),this.attributes.flexible&&(f==="width"||f==="height"||f==="scale"||f==="transform")&&T(this);}}]);}(e["default"]);d(v,"Attr",n["default"]),i["default"].registerNode(v,"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(l){var _this55;_classCallCheck(this,o);_this55=_callSuper(this,o,[l]),_this55[a]({passEvents:!1,flexible:!1});return _this55;}// readonly
|
|
389
|
+
_inherits(o,_e$default22);return _createClass(o,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(l){}// eslint-disable-line no-empty-function
|
|
390
|
+
},{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(l){return this[i]("passEvents",l);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(l){return this[i]("flexible",l);}}]);}(e["default"]);},/* 289 */ /***/function(h,r,t){t.r(r);var e=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(l,d){var c=Object.keys(l);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(l);d&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(l,y).enumerable;})),c.push.apply(c,p);}return c;}function i(l){for(var d=1;d<arguments.length;d++){var c=arguments[d]!=null?arguments[d]:{};d%2?n(Object(c),!0).forEach(function(p){a(l,p,c[p]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(c)):n(Object(c)).forEach(function(p){Object.defineProperty(l,p,Object.getOwnPropertyDescriptor(c,p));});}return l;}function a(l,d,c){return d in l?Object.defineProperty(l,d,{value:c,enumerable:!0,configurable:!0,writable:!0}):l[d]=c,l;}var o=Symbol("inited");var s=null;typeof Worker=="function"&&(s=/*#__PURE__*/function(_Worker){function s(l){var _this56;_classCallCheck(this,s);if(l.worker===!0&&(l.worker="./".concat(l.id,".worker.js")),_this56=_callSuper(this,s,[l.worker]),_this56.options=l,!l.canvas){var _this56$getResolution=_this56.getResolution(),d=_this56$getResolution.width,c=_this56$getResolution.height,p=e.ENV.createCanvas(d,c,{offscreen:!1});p.style&&(p.style.position="absolute"),p.dataset&&(p.dataset.layerId=l.id),l.canvas=p;}_this56.canvas=l.canvas;return _assertThisInitialized(_this56);}_inherits(s,_Worker);return _createClass(s,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref157){var l=_ref157.width,d=_ref157.height;if(this[o])this.postMessage({type:"resolution_change",width:l,height:d});else{this.canvas.width=l,this.canvas.height=d;var c=this.options,p=c.canvas.transferControlToOffscreen(),y=i({},c);delete y.container,y.canvas=p,this.postMessage({type:"create",options:y},[p]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,l=_this$canvas6.width,d=_this$canvas6.height;return{width:l,height:d};}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(l,d){Object.defineProperty(this,"parent",{value:l,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:d,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(l){this.postMessage({type:"event",event:{cancelBubble:l.cancelBubble,bubbles:l.bubbles,detail:l.detail,identifier:l.identifier,layerX:l.layerX,layerY:l.layerY,originalX:l.originalX,originalY:l.originalY,type:l.type,x:l.x,y:l.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),l=t(250),d=t(291),c=t(214),p=t(218),y=t(213);t(1).glMatrix.setMatrixArrayType(Array);var P=Symbol("enteredTargets");function T(E){return E.id=E.id||"_layer".concat(Math.random().toString(36).slice(2,12)),E.dataset||(E.dataset={}),E.dataset.layerId=E.id,E.connect=function(R,b){E.parent=R,Object.defineProperty(E,"zOrder",{value:b,writable:!1,configurable:!0});},E.disconnect=function(R){delete E.zOrder;},E.canvas=E,E.getResolution=function(){return{width:0,height:0};},E.setResolution=function(){return!1;},E.options={handleEvent:!1},E;}function v(E,R){var b=E.children;var O=null;for(var L=0;L<b.length;L++){var w=b[L];if((R===w||O!=null)&&(O=w),O&&O!==R&&!O.offscreen)return O.canvas;}return null;}function x(E,R){var _E$renderOffset=_slicedToArray(E.renderOffset,2),b=_E$renderOffset[0],O=_E$renderOffset[1],_E$getResolution=E.getResolution(),L=_E$getResolution.width,w=_E$getResolution.height,I=E.displayRatio;E.renderer.drawImage(R.canvas,-b/I,-O/I,L/I,w/I);}var f={};function g(E){var R=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],b=E.container;b.addEventListener("mouseleave",function(O){var L=E[P];if(L.size){var w=new c["default"]("mouseleave");w.setOriginalEvent(O),_toConsumableArray(L).forEach(function(I){I.dispatchEvent(w);}),E[P].clear();}},{passive:!0}),R.forEach(function(O){b.addEventListener(O,function(L){var _E$options=E.options,w=_E$options.left,I=_E$options.top,A=_E$options.displayRatio,W=E.orderedChildren;Object(d["default"])(L,{offsetLeft:w,offsetTop:I,displayRatio:A}).forEach(function(K){var k=K.identifier;if(K.type==="touchmove"||K.type==="touchend"){var U=f[k];U&&U.dispatchEvent(K),K.type==="touchend"&&delete f[k];}else{for(var _U=W.length-1;_U>=0;_U--){var G=W[_U];if(G.options.handleEvent!==!1){if(G.dispatchPointerEvent(K)&&K.target!==G)break;K.cancelBubble=!1;}}if(K.target===W[0])for(var _U2=W.length-1;_U2>=0;_U2--){var _G=W[_U2];if(_G.options.handleEvent!==!1){K.target=_G;break;}}}var q=K.target;if(K.type==="touchstart"&&(f[k]=K.target),K.type==="mousemove"){var _U3=E[P];var _G2;if(q){var et=q.ancestors||[];_G2=/* @__PURE__ */new Set([q].concat(_toConsumableArray(et)));}else _G2=/* @__PURE__ */new Set();var Z=Object.entries(L);if(!_U3.has(q)&&q){var _et2=new c["default"]("mouseenter");_et2.setOriginalEvent(L),Z.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),J=_ref159[0],ht=_ref159[1];_et2[J]=ht;}),_U3.add(q),q.dispatchEvent(_et2);var tt=q.ancestors;tt&&tt.forEach(function(J){J instanceof a["default"]&&!_U3.has(J)&&(_U3.add(J),J.dispatchEvent(_et2));});}var nt=new c["default"]("mouseleave");nt.setOriginalEvent(L),Z.forEach(function(_ref160){var _ref161=_slicedToArray(_ref160,2),et=_ref161[0],tt=_ref161[1];nt[et]=tt;}),_toConsumableArray(_U3).forEach(function(et){_G2.has(et)||(_U3["delete"](et),et.dispatchEvent(nt));});}});},{passive:O!=="contextmenu"});});}function u(E,R){if(R&&R.style){var b=E.width,O=E.height,L=E.mode,w=E.container;var I=w.clientWidth,A=w.clientHeight;b=b||I,O=O||A,L==="static"?(R.style.width="".concat(b,"px"),R.style.height="".concat(O,"px")):(R.style.top="0",R.style.left="0",R.style.width="".concat(I,"px"),R.style.height="".concat(A,"px"),R.style.transform="",R.style.webkitTransform="");}}var m=Symbol("offscreenLayerCount");var M=/*#__PURE__*/function(_l$default){/**
|
|
391
|
+
width
|
|
392
|
+
height
|
|
393
|
+
mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
|
|
394
|
+
*/function M(){var _this57;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this57=_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(_this57.container=R.container,_this57.container.style&&(_this57.container.style.overflow||(_this57.container.style.overflow="hidden"),_this57.container.style.position||(_this57.container.style.position="relative")),_this57.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 O=_assertThisInitialized(_this57);b.addEventListener("resize",function L(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(O.container)?O.resize():b.removeEventListener("resize",L);});}}_this57[P]=/* @__PURE__ */new Set(),_this57.setResolution(R),g(_assertThisInitialized(_this57)),_this57[m]=0;return _assertThisInitialized(_this57);}_inherits(M,_l$default);return _createClass(M,[{key:"hasOffscreenCanvas",get:function get(){return this[m]>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"])&&T(R);var b=_superPropGet(M,"appendChild",this,3)([R]),O=R.canvas;return R.offscreen?this[m]++:this.container.appendChild(O),u(this.options,O),R.setResolution(this.getResolution()),b;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this58=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(i.requestAnimationFrame)(function(){delete _this58._requestID,_this58.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(R,b){!(R instanceof o["default"])&&!(R instanceof s["default"])&&T(R);var O=_superPropGet(M,"insertBefore",this,3)([R,b]),L=R.canvas;if(!R.offscreen){var w=v(this,R);this.container.insertBefore(L,w);}return u(this.options,L),R.setResolution(this.getResolution()),O;}},{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 O=this.orderedChildren;for(var I=0;I<O.length;I++)if(O[I].id===R)return O[I];var L=b.worker;var w;return L?w=new s["default"](b):w=new o["default"](b),this.appendChild(w),w;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(){var _this59=this;var _len13,R,_key13,b,O,L,_loop2,w,_args21=arguments;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:for(_len13=_args21.length,R=new Array(_len13),_key13=0;_key13<_len13;_key13++){R[_key13]=_args21[_key13];}b=[],O=[],L=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(w){var I,A,W,z;return _regeneratorRuntime().wrap(function _loop2$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:I=R[w];if(typeof I=="string")A=Object(p.loadTexture)(I);else if(Array.isArray(I))A=Object(p.loadFrames).apply(void 0,_toConsumableArray(I));else{W=I.id,z=I.src;A=Object(p.loadTexture)(z,W);}A instanceof Promise||(A=Promise.resolve(A)),O.push(A.then(function(W){b.push(W),L[w]=W;var z=new c["default"]({type:"preload",detail:{current:W,loaded:b,resources:R}});_this59.dispatchEvent(z);}));case 3:case"end":return _context20.stop();}},_loop2);});w=0;case 4:if(!(w<R.length)){_context21.next=9;break;}return _context21.delegateYield(_loop2(w),"t0",6);case 6:w++;_context21.next=4;break;case 9:_context21.next=11;return Promise.all(O);case 11:return _context21.abrupt("return",L);case 12:case"end":return _context21.stop();}},_callee20);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(R){var b=_superPropGet(M,"removeChild",this,3)([R]);if(b){R._prepareRenderFinished&&R._prepareRenderFinished();var O=R.canvas;O&&O.remove&&O.remove(),R.offscreen&&this[m]--;}return b;}// for offscreen mode rendering
|
|
395
|
+
},{key:"render",value:function render(){var R=this.orderedChildren;var b=null;var O=[];for(var L=0;L<R.length;L++){var w=R[L],I=O.length>0;if(w instanceof o["default"]&&!w.offscreen){if(!w.autoRender)I&&(console.warn("Some offscreen canvas will not be rendered."),O.length=0);else if(b=w,I){w.renderer.clear();for(var A=0;A<O.length;A++){var W=O[A];W.render(),x(w,W);}O.length=0,w.render({clear:!1});}else w.prepareRender&&w.render();}else w.offscreen?b?(w.prepareRender&&w.render(),x(b,w)):O.push(w):w instanceof s["default"]&&I&&(console.warn("Some offscreen canvas will not be rendered."),O.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(R,b){var O=_superPropGet(M,"replaceChild",this,3)([R,b]);b.canvas.remove&&b.canvas.remove(),b.offscreen&&this[m]--;var L=R.canvas;if(!R.offscreen){var w=v(this,R);this.container.insertBefore(L,w);}return u(this.options,L),R.setResolution(this.getResolution()),O;}},{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 O=this.container,L=O.clientWidth,w=O.clientHeight;(R==null||b==null)&&(R=(_R4=R)!==null&&_R4!==void 0?_R4:L,b=(_b10=b)!==null&&_b10!==void 0?_b10:w);var _this$options=this.options,I=_this$options.mode,A=_this$options.displayRatio;if(R*=A,b*=A,this.options.left=0,this.options.top=0,I==="stickyHeight"||I==="stickyLeft"||I==="stickyRight"){var W=R;R=L*b/w,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=w*R/L,I==="stickyWidth"&&(this.options.top=0.5*(b-_W4)),I==="stickyBottom"&&(this.options.top=b-_W4);}_superPropGet(M,"setResolution",this,3)([{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 O=R?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),L=_this$getResolution9.width,w=_this$getResolution9.height;this[O]=this[O]||n.ENV.createCanvas(L,w,{offscreen:R});var I=this[O].getContext("2d");b=b||this.orderedChildren,this[O].width=L,this[O].height=w;for(var A=0;A<b.length;A++){var W=b[A];if(!W.options.ignoreSnapshot){W.render&&W.render();var z=W.canvas;z&&z!==W&&I.drawImage(z,0,0,L,w);}}return this[O];}}]);}(l["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(M.prototype.layer3d=function(E){var _this60=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(O,L){var w=document.createElement("script");w.async=!1,w.src=b,w.onload=function(){try{O(_this60.layer3d(E,R));}catch(I){L(I);}},document.documentElement.appendChild(w);});}),y["default"].registerNode(M,"scene");}.call(this,t(22));},/* 291 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i){var _ref164=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref164$offsetTop=_ref164.offsetTop,a=_ref164$offsetTop===void 0?0:_ref164$offsetTop,_ref164$offsetLeft=_ref164.offsetLeft,o=_ref164$offsetLeft===void 0?0:_ref164$offsetLeft,_ref164$displayRatio=_ref164.displayRatio,s=_ref164$displayRatio===void 0?1:_ref164$displayRatio;var l,d;var c=[],_i$target$getBounding=i.target.getBoundingClientRect(),p=_i$target$getBounding.left,y=_i$target$getBounding.top,P=_i$target$getBounding.width,T=_i$target$getBounding.height,v=i.target.width,x=i.target.height,f=i.changedTouches||[i];for(var u=0;u<f.length;u++){var m=f[u],M=m.identifier,E=m.clientX,R=m.clientY;E!=null&&R!=null&&c.push({x:Math.round((E|0)-p),y:Math.round((R|0)-y),identifier:M});}c.length<=0&&c.push({x:l,y:d});var g=[];return c.forEach(function(u){u.x!=null&&u.y!=null&&(l=(u.x*v/P-o)/s,d=(u.y*x/T-a)/s);var m=new e["default"](i);Object.defineProperties(m,{layerX:{value:l,configurable:!0},layerY:{value:d,configurable:!0},originalX:{value:u.x},originalY:{value:u.y},x:{value:l,configurable:!0},y:{value:d,configurable:!0},identifier:{value:u.identifier}}),g.push(m);}),g;}}/******/]);Wt.version;Wt.Arc;Wt.Block;Wt.Cloud;Wt.Color;var Ji=Wt.Ellipse;Wt.Gradient;var kt=Wt.Group,Zi=Wt.Label,Qi=Wt.Layer;Wt.LayerWorker;Wt.Node;Wt.Parallel;var ce=Wt.Path,le=Wt.Polyline,Gr=Wt.Rect;Wt.Regular;Wt.Ring;var qi=Wt.Scene,_i=Wt.Sprite;Wt.SpriteSvg;Wt.Star;Wt.Triangle;Wt.helpers;Wt.createElement;Wt.isSpriteNode;Wt.registerNode;Wt.requestAnimationFrame;Wt.cancelAnimationFrame;Wt.ENV;var je=(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 de(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h["default"]:h;}var ts=_typeof(je)=="object"&&je&&je.Object===Object&&je,Bn=ts,es=Bn,rs=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,ns=es||rs||Function("return this")(),ee=ns,is=ee,ss=is.Symbol,Fe=ss,Hr=Fe,Fn=Object.prototype,os=Fn.hasOwnProperty,as=Fn.toString,we=Hr?Hr.toStringTag:void 0;function ls(h){var r=os.call(h,we),t=h[we];try{h[we]=void 0;var e=!0;}catch(_unused18){}var n=as.call(h);return e&&(r?h[we]=t:delete h[we]),n;}var cs=ls,fs=Object.prototype,hs=fs.toString;function us(h){return hs.call(h);}var ds=us,Kr=Fe,gs=cs,ps=ds,ms="[object Null]",vs="[object Undefined]",Yr=Kr?Kr.toStringTag:void 0;function ys(h){return h==null?h===void 0?vs:ms:Yr&&Yr in Object(h)?gs(h):ps(h);}var ge=ys;function Ss(h){return h!=null&&_typeof(h)=="object";}var ne=Ss,xs=ge,Ts=ne,Ms="[object Number]";function Ps(h){return typeof h=="number"||Ts(h)&&xs(h)==Ms;}var Os=Ps,_t=/* @__PURE__ */de(Os);function Es(){this.__data__=[],this.size=0;}var Cs=Es;function As(h,r){return h===r||h!==h&&r!==r;}var Tr=As,Rs=Tr;function Is(h,r){for(var t=h.length;t--;)if(Rs(h[t][0],r))return t;return-1;}var tr=Is,Ls=tr,bs=Array.prototype,ws=bs.splice;function Ds(h){var r=this.__data__,t=Ls(r,h);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():ws.call(r,t,1),--this.size,!0;}var Ns=Ds,Ws=tr;function Bs(h){var r=this.__data__,t=Ws(r,h);return t<0?void 0:r[t][1];}var Fs=Bs,Us=tr;function js(h){return Us(this.__data__,h)>-1;}var $s=js,zs=tr;function Gs(h,r){var t=this.__data__,e=zs(t,h);return e<0?(++this.size,t.push([h,r])):t[e][1]=r,this;}var Hs=Gs,Ks=Cs,Ys=Ns,Vs=Fs,Xs=$s,ks=Hs;function Ee(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]);}}Ee.prototype.clear=Ks;Ee.prototype["delete"]=Ys;Ee.prototype.get=Vs;Ee.prototype.has=Xs;Ee.prototype.set=ks;var er=Ee,Js=er;function Zs(){this.__data__=new Js(),this.size=0;}var Qs=Zs;function qs(h){var r=this.__data__,t=r["delete"](h);return this.size=r.size,t;}var _s=qs;function to(h){return this.__data__.get(h);}var eo=to;function ro(h){return this.__data__.has(h);}var no=ro;function io(h){var r=_typeof(h);return h!=null&&(r=="object"||r=="function");}var fe=io,so=ge,oo=fe,ao="[object AsyncFunction]",lo="[object Function]",co="[object GeneratorFunction]",fo="[object Proxy]";function ho(h){if(!oo(h))return!1;var r=so(h);return r==lo||r==co||r==ao||r==fo;}var Un=ho,uo=ee,go=uo["__core-js_shared__"],po=go,ar=po,Vr=function(){var h=/[^.]+$/.exec(ar&&ar.keys&&ar.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:"";}();function mo(h){return!!Vr&&Vr in h;}var vo=mo,yo=Function.prototype,So=yo.toString;function xo(h){if(h!=null){try{return So.call(h);}catch(_unused19){}try{return h+"";}catch(_unused20){}}return"";}var jn=xo,To=Un,Mo=vo,Po=fe,Oo=jn,Eo=/[\\^$.*+?()[\]{}|]/g,Co=/^\[object .+?Constructor\]$/,Ao=Function.prototype,Ro=Object.prototype,Io=Ao.toString,Lo=Ro.hasOwnProperty,bo=RegExp("^"+Io.call(Lo).replace(Eo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wo(h){if(!Po(h)||Mo(h))return!1;var r=To(h)?bo:Co;return r.test(Oo(h));}var Do=wo;function No(h,r){return h==null?void 0:h[r];}var Wo=No,Bo=Do,Fo=Wo;function Uo(h,r){var t=Fo(h,r);return Bo(t)?t:void 0;}var pe=Uo,jo=pe,$o=ee,zo=jo($o,"Map"),Mr=zo,Go=pe,Ho=Go(Object,"create"),rr=Ho,Xr=rr;function Ko(){this.__data__=Xr?Xr(null):{},this.size=0;}var Yo=Ko;function Vo(h){var r=this.has(h)&&delete this.__data__[h];return this.size-=r?1:0,r;}var Xo=Vo,ko=rr,Jo="__lodash_hash_undefined__",Zo=Object.prototype,Qo=Zo.hasOwnProperty;function qo(h){var r=this.__data__;if(ko){var t=r[h];return t===Jo?void 0:t;}return Qo.call(r,h)?r[h]:void 0;}var _o=qo,ta=rr,ea=Object.prototype,ra=ea.hasOwnProperty;function na(h){var r=this.__data__;return ta?r[h]!==void 0:ra.call(r,h);}var ia=na,sa=rr,oa="__lodash_hash_undefined__";function aa(h,r){var t=this.__data__;return this.size+=this.has(h)?0:1,t[h]=sa&&r===void 0?oa:r,this;}var la=aa,ca=Yo,fa=Xo,ha=_o,ua=ia,da=la;function Ce(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]);}}Ce.prototype.clear=ca;Ce.prototype["delete"]=fa;Ce.prototype.get=ha;Ce.prototype.has=ua;Ce.prototype.set=da;var ga=Ce,kr=ga,pa=er,ma=Mr;function va(){this.size=0,this.__data__={hash:new kr(),map:new(ma||pa)(),string:new kr()};}var ya=va;function Sa(h){var r=_typeof(h);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?h!=="__proto__":h===null;}var xa=Sa,Ta=xa;function Ma(h,r){var t=h.__data__;return Ta(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var nr=Ma,Pa=nr;function Oa(h){var r=Pa(this,h)["delete"](h);return this.size-=r?1:0,r;}var Ea=Oa,Ca=nr;function Aa(h){return Ca(this,h).get(h);}var Ra=Aa,Ia=nr;function La(h){return Ia(this,h).has(h);}var ba=La,wa=nr;function Da(h,r){var t=wa(this,h),e=t.size;return t.set(h,r),this.size+=t.size==e?0:1,this;}var Na=Da,Wa=ya,Ba=Ea,Fa=Ra,Ua=ba,ja=Na;function Ae(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]);}}Ae.prototype.clear=Wa;Ae.prototype["delete"]=Ba;Ae.prototype.get=Fa;Ae.prototype.has=Ua;Ae.prototype.set=ja;var $n=Ae,$a=er,za=Mr,Ga=$n,Ha=200;function Ka(h,r){var t=this.__data__;if(t instanceof $a){var e=t.__data__;if(!za||e.length<Ha-1)return e.push([h,r]),this.size=++t.size,this;t=this.__data__=new Ga(e);}return t.set(h,r),this.size=t.size,this;}var Ya=Ka,Va=er,Xa=Qs,ka=_s,Ja=eo,Za=no,Qa=Ya;function Re(h){var r=this.__data__=new Va(h);this.size=r.size;}Re.prototype.clear=Xa;Re.prototype["delete"]=ka;Re.prototype.get=Ja;Re.prototype.has=Za;Re.prototype.set=Qa;var zn=Re;function qa(h,r){for(var t=-1,e=h==null?0:h.length;++t<e&&r(h[t],t,h)!==!1;);return h;}var _a=qa,tl=pe,el=function(){try{var h=tl(Object,"defineProperty");return h({},"",{}),h;}catch(_unused21){}}(),Gn=el,Jr=Gn;function rl(h,r,t){r=="__proto__"&&Jr?Jr(h,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):h[r]=t;}var Hn=rl,nl=Hn,il=Tr,sl=Object.prototype,ol=sl.hasOwnProperty;function al(h,r,t){var e=h[r];(!(ol.call(h,r)&&il(e,t))||t===void 0&&!(r in h))&&nl(h,r,t);}var Kn=al,ll=Kn,cl=Hn;function fl(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?cl(t,o,s):ll(t,o,s);}return t;}var ir=fl;function hl(h,r){for(var t=-1,e=Array(h);++t<h;)e[t]=r(t);return e;}var ul=hl,dl=ge,gl=ne,pl="[object Arguments]";function ml(h){return gl(h)&&dl(h)==pl;}var vl=ml,Zr=vl,yl=ne,Yn=Object.prototype,Sl=Yn.hasOwnProperty,xl=Yn.propertyIsEnumerable,Tl=Zr(/* @__PURE__ */function(){return arguments;}())?Zr:function(h){return yl(h)&&Sl.call(h,"callee")&&!xl.call(h,"callee");},Vn=Tl,Ml=Array.isArray,Ue=Ml,Ge={exports:{}};function Pl(){return!1;}var Ol=Pl;Ge.exports;(function(h,r){var t=ee,e=Ol,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,l=s||e;h.exports=l;})(Ge,Ge.exports);var Pr=Ge.exports,El=9007199254740991,Cl=/^(?:0|[1-9]\d*)$/;function Al(h,r){var _r2;var t=_typeof(h);return r=(_r2=r)!==null&&_r2!==void 0?_r2:El,!!r&&(t=="number"||t!="symbol"&&Cl.test(h))&&h>-1&&h%1==0&&h<r;}var Rl=Al,Il=9007199254740991;function Ll(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=Il;}var Xn=Ll,bl=ge,wl=Xn,Dl=ne,Nl="[object Arguments]",Wl="[object Array]",Bl="[object Boolean]",Fl="[object Date]",Ul="[object Error]",jl="[object Function]",$l="[object Map]",zl="[object Number]",Gl="[object Object]",Hl="[object RegExp]",Kl="[object Set]",Yl="[object String]",Vl="[object WeakMap]",Xl="[object ArrayBuffer]",kl="[object DataView]",Jl="[object Float32Array]",Zl="[object Float64Array]",Ql="[object Int8Array]",ql="[object Int16Array]",_l="[object Int32Array]",tc="[object Uint8Array]",ec="[object Uint8ClampedArray]",rc="[object Uint16Array]",nc="[object Uint32Array]",Ut={};Ut[Jl]=Ut[Zl]=Ut[Ql]=Ut[ql]=Ut[_l]=Ut[tc]=Ut[ec]=Ut[rc]=Ut[nc]=!0;Ut[Nl]=Ut[Wl]=Ut[Xl]=Ut[Bl]=Ut[kl]=Ut[Fl]=Ut[Ul]=Ut[jl]=Ut[$l]=Ut[zl]=Ut[Gl]=Ut[Hl]=Ut[Kl]=Ut[Yl]=Ut[Vl]=!1;function ic(h){return Dl(h)&&wl(h.length)&&!!Ut[bl(h)];}var sc=ic;function oc(h){return function(r){return h(r);};}var sr=oc,He={exports:{}};He.exports;(function(h,r){var t=Bn,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(_unused22){}}();h.exports=o;})(He,He.exports);var Or=He.exports,ac=sc,lc=sr,Qr=Or,qr=Qr&&Qr.isTypedArray,cc=qr?lc(qr):ac,kn=cc,fc=ul,hc=Vn,uc=Ue,dc=Pr,gc=Rl,pc=kn,mc=Object.prototype,vc=mc.hasOwnProperty;function yc(h,r){var t=uc(h),e=!t&&hc(h),n=!t&&!e&&dc(h),i=!t&&!e&&!n&&pc(h),a=t||e||n||i,o=a?fc(h.length,String):[],s=o.length;for(var l in h)(r||vc.call(h,l))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
396
|
+
l=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
397
|
+
n&&(l=="offset"||l=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
398
|
+
i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||// Skip index properties.
|
|
399
|
+
gc(l,s)))&&o.push(l);return o;}var Jn=yc,Sc=Object.prototype;function xc(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Sc;return h===t;}var Er=xc;function Tc(h,r){return function(t){return h(r(t));};}var Zn=Tc,Mc=Zn,Pc=Mc(Object.keys,Object),Oc=Pc,Ec=Er,Cc=Oc,Ac=Object.prototype,Rc=Ac.hasOwnProperty;function Ic(h){if(!Ec(h))return Cc(h);var r=[];for(var t in Object(h))Rc.call(h,t)&&t!="constructor"&&r.push(t);return r;}var Lc=Ic,bc=Un,wc=Xn;function Dc(h){return h!=null&&wc(h.length)&&!bc(h);}var Cr=Dc,Nc=Jn,Wc=Lc,Bc=Cr;function Fc(h){return Bc(h)?Nc(h):Wc(h);}var Ar=Fc,Uc=ir,jc=Ar;function $c(h,r){return h&&Uc(r,jc(r),h);}var zc=$c;function Gc(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Hc=Gc,Kc=fe,Yc=Er,Vc=Hc,Xc=Object.prototype,kc=Xc.hasOwnProperty;function Jc(h){if(!Kc(h))return Vc(h);var r=Yc(h),t=[];for(var e in h)e=="constructor"&&(r||!kc.call(h,e))||t.push(e);return t;}var Zc=Jc,Qc=Jn,qc=Zc,_c=Cr;function tf(h){return _c(h)?Qc(h,!0):qc(h);}var Rr=tf,ef=ir,rf=Rr;function nf(h,r){return h&&ef(r,rf(r),h);}var sf=nf,Ke={exports:{}};Ke.exports;(function(h,r){var t=ee,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(l,d){if(d)return l.slice();var c=l.length,p=o?o(c):new l.constructor(c);return l.copy(p),p;}h.exports=s;})(Ke,Ke.exports);var of=Ke.exports;function af(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var lf=af;function cf(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 Qn=cf;function ff(){return[];}var qn=ff,hf=Qn,uf=qn,df=Object.prototype,gf=df.propertyIsEnumerable,_r=Object.getOwnPropertySymbols,pf=_r?function(h){return h==null?[]:(h=Object(h),hf(_r(h),function(r){return gf.call(h,r);}));}:uf,Ir=pf,mf=ir,vf=Ir;function yf(h,r){return mf(h,vf(h),r);}var Sf=yf;function xf(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var Lr=xf,Tf=Zn,Mf=Tf(Object.getPrototypeOf,Object),_n=Mf,Pf=Lr,Of=_n,Ef=Ir,Cf=qn,Af=Object.getOwnPropertySymbols,Rf=Af?function(h){for(var r=[];h;)Pf(r,Ef(h)),h=Of(h);return r;}:Cf,ti=Rf,If=ir,Lf=ti;function bf(h,r){return If(h,Lf(h),r);}var wf=bf,Df=Lr,Nf=Ue;function Wf(h,r,t){var e=r(h);return Nf(h)?e:Df(e,t(h));}var ei=Wf,Bf=ei,Ff=Ir,Uf=Ar;function jf(h){return Bf(h,Uf,Ff);}var ri=jf,$f=ei,zf=ti,Gf=Rr;function Hf(h){return $f(h,Gf,zf);}var Kf=Hf,Yf=pe,Vf=ee,Xf=Yf(Vf,"DataView"),kf=Xf,Jf=pe,Zf=ee,Qf=Jf(Zf,"Promise"),qf=Qf,_f=pe,th=ee,eh=_f(th,"Set"),ni=eh,rh=pe,nh=ee,ih=rh(nh,"WeakMap"),sh=ih,dr=kf,gr=Mr,pr=qf,mr=ni,vr=sh,ii=ge,Ie=jn,tn="[object Map]",oh="[object Object]",en="[object Promise]",rn="[object Set]",nn="[object WeakMap]",sn="[object DataView]",ah=Ie(dr),lh=Ie(gr),ch=Ie(pr),fh=Ie(mr),hh=Ie(vr),he=ii;(dr&&he(new dr(new ArrayBuffer(1)))!=sn||gr&&he(new gr())!=tn||pr&&he(pr.resolve())!=en||mr&&he(new mr())!=rn||vr&&he(new vr())!=nn)&&(he=function he(h){var r=ii(h),t=r==oh?h.constructor:void 0,e=t?Ie(t):"";if(e)switch(e){case ah:return sn;case lh:return tn;case ch:return en;case fh:return rn;case hh:return nn;}return r;});var or=he,uh=Object.prototype,dh=uh.hasOwnProperty;function gh(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&dh.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var ph=gh,mh=ee,vh=mh.Uint8Array,si=vh,on=si;function yh(h){var r=new h.constructor(h.byteLength);return new on(r).set(new on(h)),r;}var br=yh,Sh=br;function xh(h,r){var t=r?Sh(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Th=xh,Mh=/\w*$/;function Ph(h){var r=new h.constructor(h.source,Mh.exec(h));return r.lastIndex=h.lastIndex,r;}var Oh=Ph,an=Fe,ln=an?an.prototype:void 0,cn=ln?ln.valueOf:void 0;function Eh(h){return cn?Object(cn.call(h)):{};}var Ch=Eh,Ah=br;function Rh(h,r){var t=r?Ah(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var Ih=Rh,Lh=br,bh=Th,wh=Oh,Dh=Ch,Nh=Ih,Wh="[object Boolean]",Bh="[object Date]",Fh="[object Map]",Uh="[object Number]",jh="[object RegExp]",$h="[object Set]",zh="[object String]",Gh="[object Symbol]",Hh="[object ArrayBuffer]",Kh="[object DataView]",Yh="[object Float32Array]",Vh="[object Float64Array]",Xh="[object Int8Array]",kh="[object Int16Array]",Jh="[object Int32Array]",Zh="[object Uint8Array]",Qh="[object Uint8ClampedArray]",qh="[object Uint16Array]",_h="[object Uint32Array]";function tu(h,r,t){var e=h.constructor;switch(r){case Hh:return Lh(h);case Wh:case Bh:return new e(+h);case Kh:return bh(h,t);case Yh:case Vh:case Xh:case kh:case Jh:case Zh:case Qh:case qh:case _h:return Nh(h,t);case Fh:return new e();case Uh:case zh:return new e(h);case jh:return wh(h);case $h:return new e();case Gh:return Dh(h);}}var eu=tu,ru=fe,fn=Object.create,nu=/* @__PURE__ */function(){function h(){}return function(r){if(!ru(r))return{};if(fn)return fn(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),iu=nu,su=iu,ou=_n,au=Er;function lu(h){return typeof h.constructor=="function"&&!au(h)?su(ou(h)):{};}var cu=lu,fu=or,hu=ne,uu="[object Map]";function du(h){return hu(h)&&fu(h)==uu;}var gu=du,pu=gu,mu=sr,hn=Or,un=hn&&hn.isMap,vu=un?mu(un):pu,yu=vu,Su=or,xu=ne,Tu="[object Set]";function Mu(h){return xu(h)&&Su(h)==Tu;}var Pu=Mu,Ou=Pu,Eu=sr,dn=Or,gn=dn&&dn.isSet,Cu=gn?Eu(gn):Ou,Au=Cu,Ru=zn,Iu=_a,Lu=Kn,bu=zc,wu=sf,Du=of,Nu=lf,Wu=Sf,Bu=wf,Fu=ri,Uu=Kf,ju=or,$u=ph,zu=eu,Gu=cu,Hu=Ue,Ku=Pr,Yu=yu,Vu=fe,Xu=Au,ku=Ar,Ju=Rr,Zu=1,Qu=2,qu=4,oi="[object Arguments]",_u="[object Array]",td="[object Boolean]",ed="[object Date]",rd="[object Error]",ai="[object Function]",nd="[object GeneratorFunction]",id="[object Map]",sd="[object Number]",li="[object Object]",od="[object RegExp]",ad="[object Set]",ld="[object String]",cd="[object Symbol]",fd="[object WeakMap]",hd="[object ArrayBuffer]",ud="[object DataView]",dd="[object Float32Array]",gd="[object Float64Array]",pd="[object Int8Array]",md="[object Int16Array]",vd="[object Int32Array]",yd="[object Uint8Array]",Sd="[object Uint8ClampedArray]",xd="[object Uint16Array]",Td="[object Uint32Array]",Ft={};Ft[oi]=Ft[_u]=Ft[hd]=Ft[ud]=Ft[td]=Ft[ed]=Ft[dd]=Ft[gd]=Ft[pd]=Ft[md]=Ft[vd]=Ft[id]=Ft[sd]=Ft[li]=Ft[od]=Ft[ad]=Ft[ld]=Ft[cd]=Ft[yd]=Ft[Sd]=Ft[xd]=Ft[Td]=!0;Ft[rd]=Ft[ai]=Ft[fd]=!1;function ze(h,r,t,e,n,i){var a,o=r&Zu,s=r&Qu,l=r&qu;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!Vu(h))return h;var d=Hu(h);if(d){if(a=$u(h),!o)return Nu(h,a);}else{var c=ju(h),p=c==ai||c==nd;if(Ku(h))return Du(h,o);if(c==li||c==oi||p&&!n){if(a=s||p?{}:Gu(h),!o)return s?Bu(h,wu(a,h)):Wu(h,bu(a,h));}else{if(!Ft[c])return n?h:{};a=zu(h,c,o);}}i||(i=new Ru());var y=i.get(h);if(y)return y;i.set(h,a),Xu(h)?h.forEach(function(v){a.add(ze(v,r,t,v,h,i));}):Yu(h)&&h.forEach(function(v,x){a.set(x,ze(v,r,t,x,h,i));});var P=l?s?Uu:Fu:s?Ju:ku,T=d?void 0:P(h);return Iu(T||h,function(v,x){T&&(x=v,v=h[x]),Lu(a,x,ze(v,r,t,x,h,i));}),a;}var Md=ze,Pd=Md,Od=1,Ed=4;function Cd(h){return Pd(h,Od|Ed);}var Ad=Cd,Xt=/* @__PURE__ */de(Ad);var ci="1.0.10",Rd="@netless/appliance-plugin",Id=typeof OffscreenCanvas=="function"?"worker":"mainThread";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var h=window.__netlessUA||"";h+=" ".concat(Rd,"@").concat(ci,"_").concat(Id),window.__netlessUA=h;}var re={syncOpt:{interval:500},canvasOpt:{contextType:ye.Canvas2d},cdn:{subWorkerUrl:"https://cdn.jsdelivr.net/npm/@netless/appliance-plugin@latest/dist/subWorker.js",fullWorkerUrl:"https://cdn.jsdelivr.net/npm/@netless/appliance-plugin@latest/dist/fullWorker.js"},cursor:{expirationTime:5e3},bufferSize:{full:2e4,sub:1e3},bezier:{combineUnitTime:100},pencilEraser:{useBitMap:!0}};function ae(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(me(e),"L").concat(me(n));var i="";for(var a=2,o=t-1;a<o;a++)e=h[a],n=h[a+1],i+=ve(e,n);return r?"M".concat(ve(h[0],h[1]),"Q").concat(me(h[1])).concat(ve(h[1],h[2]),"T").concat(i).concat(ve(h[t-1],h[0])).concat(ve(h[0],h[1]),"Z"):"M".concat(me(h[0]),"Q").concat(me(h[1])).concat(ve(h[1],h[2])).concat(h.length>3?"T":"").concat(i,"L").concat(me(h[t-1]));}var Jt=/*#__PURE__*/function(){function Jt(r){_classCallCheck(this,Jt);rt(this,"syncUnitTime",re.syncOpt.interval);rt(this,"vNodes");rt(this,"drawLayer");rt(this,"fullLayer");rt(this,"workId");var t=r.vNodes,e=r.fullLayer,n=r.drawLayer,i=r.workId,a=r.toolsOpt;this.vNodes=t,this.fullLayer=e,this.drawLayer=n,this.workId=i,this.syncUnitTime=a.syncUnitTime||this.syncUnitTime;}return _createClass(Jt,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return r.reduce(function(e,n){var i=e[e.length-1];return(n&&!i||n&&i&&!n.isNear(i,t))&&e.push(n),e;},[]);}/** 设置工作id */},{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,l=r.zIndex,d=r.scale,c=r.angle,p=r.translate,y={};_t(l)&&(y.zIndex=l),s&&(y.pos=[s[0],s[1]]),d&&(y.scale=d),c&&(y.rotate=c),p&&(y.translate=p),o.attr(y);var P=o==null?void 0:o.getBoundingClientRect();return P&&(t=Pt(t,{x:Math.floor(P.x-Jt.SafeBorderPadding),y:Math.floor(P.y-Jt.SafeBorderPadding),w:Math.floor(P.width+Jt.SafeBorderPadding*2),h:Math.floor(P.height+Jt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(r){var t=r.group,e=r.eraserlines,n=r.pos,i=r.layer,_r$isClear=r.isClear,a=_r$isClear===void 0?!0:_r$isClear,o=!!i.parent.gl;var _iterator13=_createForOfIteratorHelper(e),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var s=_step13.value;var l=s.thickness,d=s.op;var _iterator14=_createForOfIteratorHelper(d),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var c=_step14.value;var p=c.map(function(x,f){return f%2?x-n[1]:x-n[0];}),y=this.computEraserPoints(p,l),P=ae(y,!0),T={pos:[0,0],d:P,fillColor:"rgba(0,0,0,1)"},v=new ce(T);a&&(v.addEventListener("beforerender",function(_ref165){var x=_ref165.detail;var f=x.context;o?f.blendFuncSeparate(f.ZERO,f.ZERO,f.ZERO,f.ZERO):f.globalCompositeOperation="destination-out";}),v.addEventListener("afterrender",function(_ref166){var x=_ref166.detail;var f=x.context;o?f.blendFuncSeparate(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA,f.ONE,f.ONE_MINUS_SRC_ALPHA):f.globalCompositeOperation="source-over";})),t.append(v);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}}},{key:"computEraserPoints",value:function computEraserPoints(r,t){var e=Math.ceil(t/2);return r.length===2?this.computDot(r,e):this.computLine(r,e);}},{key:"computDot",value:function computDot(r,t){var e=new xt(r[0],r[1]);return xt.GetDotStroke(e,t,8);}},{key:"computLine",value:function computLine(r,t){var e=[],n=[];var i,a;for(var o=0;o<r.length;o+=2){var s=new xt(r[o],r[o+1]);var l=void 0;if(o==r.length-2){var d=new xt(r[o-2],r[o-1]);l=_.Sub(s,d).uni(),i=s;}else{o===0&&(a=s);var _d4=new xt(r[o+2],r[o+3]);l=_.Sub(_d4,s).uni();}if(l){var _d5=_.Per(l).mul(t);e.push(xt.Sub(s,_d5)),n.push(xt.Add(s,_d5));}}if(i&&a){var _o3=xt.GetSemicircleStroke(i,e[e.length-1],-1,8),_s4=xt.GetSemicircleStroke(a,n[0],-1,8);return e.concat(_o3,n.reverse(),_s4);}return[];}},{key:"replace",value:function replace(r,t,e){var _this61=this;var o;var n=r.getElementsByName(t),i=n.length;if(i){if(i>1)for(var s=1;s<n.length;s++)r.removeChild(n[s]),n[s].disconnect();e?r.replaceChild(e,n[0]):r.removeChild(n[0]),n[0].disconnect();}else e&&r.append(e);this.fullLayer===r?(o=this.drawLayer)==null||o.getElementsByName(t).forEach(function(s){var l;(l=_this61.drawLayer)==null||l.removeChild(s),s.disconnect();}):this.fullLayer.getElementsByName(t).forEach(function(s){_this61.fullLayer.removeChild(s),s.disconnect();});}}],[{key:"updateNodeOpt",value:function updateNodeOpt(r){var f;var t=r.node,e=r.opt,n=r.vNodes,i=r.willSerializeData,a=r.targetNode,o=e.zIndex,s=e.translate,l=e.angle,d=e.originPoint,c=e.scenePoint,p=e.scale,y=e.pointMap,P=e.thickness;var T;var v=a&&Xt(a)||n.get(t.name);if(!v)return;_t(o)&&(t.setAttribute("zIndex",o),v.opt.zIndex=o);var x=t.parent;if(x){if(d&&p&&a){var g=[v.op[0],v.op[1]];Ur(v.op,c,p,s);var u=[v.op[0],v.op[1]],m=[u[0]-g[0],u[1]-g[1]];if(v.centerPos=[v.centerPos[0]+m[0],v.centerPos[1]+m[1]],v.opt.translate=void 0,v.opt.scale=void 0,v.opt.eraserlines)for(var _i2=0,_Object$values=Object.values(v.opt.eraserlines);_i2<_Object$values.length;_i2++){var M=_Object$values[_i2];var E=M.op,R=M.thickness;M.thickness=R*Math.max(p[0],p[1]);for(var b=0;b<E.length;b++)jr(E[b],c,p,s);}}else if(s){if(t.setAttribute("translate",s),v.opt.translate=s,a){var _g6=[s[0]*x.worldScaling[0],s[1]*x.worldScaling[1]];T=Sr(v.rect,_g6),v.rect=T;}else{var _g7=Jt.getRectFromLayer(x,t.name);v.rect=_g7||v.rect;}}else if(_t(l))if(t.setAttribute("rotate",l),v.opt.rotate=l,a)T=Oi(v.rect,l),v.rect=T;else{var _g8=Jt.getRectFromLayer(x,t.name);v.rect=_g8||v.rect;}if(y){var _g9=y.get(t.name);if(_g9)for(var _u10=0,_m9=0;_u10<v.op.length;_u10+=3,_m9++)v.op[_u10]=_g9[_m9][0],v.op[_u10+1]=_g9[_m9][1];}if(P&&(f=v==null?void 0:v.opt)!=null&&f.thickness&&(v.opt.thickness=P),i&&!(d&&p&&a)){if(s){var _g10=v.op.map(function(u,m){var M=m%3;return M===0?u+s[0]:M===1?u+s[1]:u;});if(v.op=_g10,v.centerPos=[v.centerPos[0]+s[0],v.centerPos[1]+s[1]],v!=null&&v.opt&&(v.opt.translate=void 0),v.opt.eraserlines)for(var _i3=0,_Object$values2=Object.values(v.opt.eraserlines);_i3<_Object$values2.length;_i3++){var _u11=_Object$values2[_i3];var _m10=_u11.op;for(var _M6=0;_M6<_m10.length;_M6++){var _E3=_m10[_M6].map(function(R,b){return b%2?R+s[1]:R+s[0];});_u11.op[_M6]=_E3;}}}else if(_t(l)){var _g11=v.op;if(Gg(_g11,v.centerPos,l),v.op=_g11,v!=null&&v.opt&&(v.opt.rotate=void 0),v.opt.eraserlines)for(var _i4=0,_Object$values3=Object.values(v.opt.eraserlines);_i4<_Object$values3.length;_i4++){var _u12=_Object$values3[_i4];var _m11=_u12.op;for(var _M7=0;_M7<_m11.length;_M7++)Hg(_m11[_M7],v.centerPos,l);}}}v&&n.setInfo(t.name,v);}}},{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-Jt.SafeBorderPadding),y:Math.floor(n.y-Jt.SafeBorderPadding),w:Math.floor(n.width+Jt.SafeBorderPadding*2),h:Math.floor(n.height+Jt.SafeBorderPadding*2)};}}}]);}();rt(Jt,"SafeBorderPadding",10);var vt=Jt;var wr={exports:{}};wr.exports;(function(h){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(s,l){if(!i[s]){i[s]={};for(var d=0;d<s.length;d++)i[s][s.charAt(d)]=d;}return i[s][l];}var o={compressToBase64:function compressToBase64(s){if(s==null)return"";var l=o._compress(s,6,function(d){return e.charAt(d);});switch(l.length%4){default:case 0:return l;case 1:return l+"===";case 2:return l+"==";case 3:return l+"=";}},decompressFromBase64:function decompressFromBase64(s){return s==null?"":s==""?null:o._decompress(s.length,32,function(l){return a(e,s.charAt(l));});},compressToUTF16:function compressToUTF16(s){return s==null?"":o._compress(s,15,function(l){return t(l+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(s){return s==null?"":s==""?null:o._decompress(s.length,16384,function(l){return s.charCodeAt(l)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
400
|
+
compressToUint8Array:function compressToUint8Array(s){for(var l=o.compress(s),d=new Uint8Array(l.length*2),c=0,p=l.length;c<p;c++){var y=l.charCodeAt(c);d[c*2]=y>>>8,d[c*2+1]=y%256;}return d;},//decompress from uint8array (UCS-2 big endian format)
|
|
401
|
+
decompressFromUint8Array:function decompressFromUint8Array(s){if(s==null)return o.decompress(s);for(var l=new Array(s.length/2),d=0,c=l.length;d<c;d++)l[d]=s[d*2]*256+s[d*2+1];var p=[];return l.forEach(function(y){p.push(t(y));}),o.decompress(p.join(""));},//compress into a string that is already URI encoded
|
|
402
|
+
compressToEncodedURIComponent:function compressToEncodedURIComponent(s){return s==null?"":o._compress(s,6,function(l){return n.charAt(l);});},//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(l){return a(n,s.charAt(l));}));},compress:function compress(s){return o._compress(s,16,function(l){return t(l);});},_compress:function _compress(s,l,d){if(s==null)return"";var c,p,y={},P={},T="",v="",x="",f=2,g=3,u=2,m=[],M=0,E=0,R;for(R=0;R<s.length;R+=1)if(T=s.charAt(R),Object.prototype.hasOwnProperty.call(y,T)||(y[T]=g++,P[T]=!0),v=x+T,Object.prototype.hasOwnProperty.call(y,v))x=v;else{if(Object.prototype.hasOwnProperty.call(P,x)){if(x.charCodeAt(0)<256){for(c=0;c<u;c++)M=M<<1,E==l-1?(E=0,m.push(d(M)),M=0):E++;for(p=x.charCodeAt(0),c=0;c<8;c++)M=M<<1|p&1,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=p>>1;}else{for(p=1,c=0;c<u;c++)M=M<<1|p,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=0;for(p=x.charCodeAt(0),c=0;c<16;c++)M=M<<1|p&1,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=p>>1;}f--,f==0&&(f=Math.pow(2,u),u++),delete P[x];}else for(p=y[x],c=0;c<u;c++)M=M<<1|p&1,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=p>>1;f--,f==0&&(f=Math.pow(2,u),u++),y[v]=g++,x=String(T);}if(x!==""){if(Object.prototype.hasOwnProperty.call(P,x)){if(x.charCodeAt(0)<256){for(c=0;c<u;c++)M=M<<1,E==l-1?(E=0,m.push(d(M)),M=0):E++;for(p=x.charCodeAt(0),c=0;c<8;c++)M=M<<1|p&1,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=p>>1;}else{for(p=1,c=0;c<u;c++)M=M<<1|p,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=0;for(p=x.charCodeAt(0),c=0;c<16;c++)M=M<<1|p&1,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=p>>1;}f--,f==0&&(f=Math.pow(2,u),u++),delete P[x];}else for(p=y[x],c=0;c<u;c++)M=M<<1|p&1,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=p>>1;f--,f==0&&(f=Math.pow(2,u),u++);}for(p=2,c=0;c<u;c++)M=M<<1|p&1,E==l-1?(E=0,m.push(d(M)),M=0):E++,p=p>>1;for(;;)if(M=M<<1,E==l-1){m.push(d(M));break;}else E++;return m.join("");},decompress:function decompress(s){return s==null?"":s==""?null:o._decompress(s.length,32768,function(l){return s.charCodeAt(l);});},_decompress:function _decompress(s,l,d){var c=[],p=4,y=4,P=3,T="",v=[],x,f,g,u,m,M,E,R={val:d(0),position:l,index:1};for(x=0;x<3;x+=1)c[x]=x;for(g=0,m=Math.pow(2,2),M=1;M!=m;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=l,R.val=d(R.index++)),g|=(u>0?1:0)*M,M<<=1;switch(g){case 0:for(g=0,m=Math.pow(2,8),M=1;M!=m;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=l,R.val=d(R.index++)),g|=(u>0?1:0)*M,M<<=1;E=t(g);break;case 1:for(g=0,m=Math.pow(2,16),M=1;M!=m;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=l,R.val=d(R.index++)),g|=(u>0?1:0)*M,M<<=1;E=t(g);break;case 2:return"";}for(c[3]=E,f=E,v.push(E);;){if(R.index>s)return"";for(g=0,m=Math.pow(2,P),M=1;M!=m;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=l,R.val=d(R.index++)),g|=(u>0?1:0)*M,M<<=1;switch(E=g){case 0:for(g=0,m=Math.pow(2,8),M=1;M!=m;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=l,R.val=d(R.index++)),g|=(u>0?1:0)*M,M<<=1;c[y++]=t(g),E=y-1,p--;break;case 1:for(g=0,m=Math.pow(2,16),M=1;M!=m;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=l,R.val=d(R.index++)),g|=(u>0?1:0)*M,M<<=1;c[y++]=t(g),E=y-1,p--;break;case 2:return v.join("");}if(p==0&&(p=Math.pow(2,P),P++),c[E])T=c[E];else if(E===y)T=f+f.charAt(0);else return null;v.push(T),c[y++]=f+T.charAt(0),p--,f=T,p==0&&(p=Math.pow(2,P),P++);}}};return o;}();h!=null?h.exports=r:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return r;});})(wr);var fi=wr.exports;function Oe(h){return JSON.parse(fi.decompress(h));}function Zt(h){return fi.compress(JSON.stringify(h));}var hi=/*#__PURE__*/function(_vt){function hi(t){var _this62;_classCallCheck(this,hi);_this62=_callSuper(this,hi,[t]);rt(_this62,"canRotate",!0);rt(_this62,"scaleType",jt.all);rt(_this62,"toolsType",ut.Pencil);rt(_this62,"syncTimestamp");rt(_this62,"syncIndex",0);rt(_this62,"tmpPoints",[]);rt(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */rt(_this62,"uniThickness");rt(_this62,"workOptions");rt(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(hi,_vt);return _createClass(hi,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:lt.None};var 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:lt.DrawWork,dataType:Mt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(hi,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this63=this;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=t.drawCount,s=t.replaceId,l=e.workId,_this$transformData=this.transformData(e,!1),d=_this$transformData.tasks,c=_this$transformData.effects,p=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,p,Math.max(0,this.tmpPoints.length-2));var y={name:l,id:o==null?void 0:o.toString()};var P,T=!1;var v=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),d.length&&(d[0].taskId-this.syncTimestamp>this.syncUnitTime&&(T=!0,this.syncTimestamp=d[0].taskId,this.syncIndex=this.tmpPoints.length),i||a)){var _f26=n?this.fullLayer:this.drawLayer||this.fullLayer;P=this.draw({attrs:y,tasks:d,effects:c,layer:_f26,replaceId:s});}if(i)return p>10&&this.tmpPoints.splice(0,p-10),{rect:P,type:lt.DrawWork,dataType:Mt.Local};var x=[];return this.tmpPoints.slice(v).forEach(function(f){x.push(f.x,f.y,_this63.computRadius(f.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:lt.DrawWork,dataType:Mt.Local,rect:P,op:T?x:void 0,index:T?v*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var d;var e=this.workId;if(t.data){var _t$data=t.data,c=_t$data.op,p=_t$data.workState;c!=null&&c.length&&p===Rt.Done&&this.workOptions.strokeType===Lt.Stroke&&this.updateTempPointsWithPressureWhenDone(c);}var n=this.transformDataAll(!0),i={name:e};var a;var o=this.fullLayer;if(n.length&&(a=this.draw({attrs:i,tasks:n,replaceId:e,layer:o})),this.tmpPoints.length<2)return this.replace(o,e),{type:lt.RemoveNode,removeIds:[e],rect:a};var s=[];this.tmpPoints.map(function(c){s.push(c.x,c.y,c.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var l=Zt(s);return(d=this.vNodes)==null||d.setInfo(e,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&vt.getCenterPos(a,o)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:a,type:lt.FullWork,dataType:Mt.Local,ops:l,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var d,c;var e=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3){var y=new xt(e[p],e[p+1],e[p+2]);if(this.tmpPoints.length>0){var P=this.tmpPoints[this.tmpPoints.length-1],T=_.Sub(y,P).uni();y.setv(T);}this.tmpPoints.push(y);}if(this.tmpPoints.length<2)return;var a=this.transformDataAll(!0),o=(d=this.workId)==null?void 0:d.toString(),s={name:o};var l;if(o&&a.length){var _p3=n?this.fullLayer:this.drawLayer||this.fullLayer;l=this.draw({attrs:s,tasks:a,replaceId:i,layer:_p3}),(c=this.vNodes)==null||c.setInfo(o,{rect:l,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:l&&vt.getCenterPos(l,_p3)});}return l;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=this.filterSamePoints(this.tmpPoints,this.workOptions.thickness);return this.getTaskPoints(e,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this64=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,l=_this$workOptions.strokeType,d=_this$workOptions.thickness,c=_this$workOptions.zIndex,p=_this$workOptions.scale,y=_this$workOptions.rotate,P=_this$workOptions.translate,T=_this$workOptions.eraserlines;a!=null&&a.size&&(a.forEach(function(m){var M;(M=o.getElementById(m+""))==null||M.remove();}),a.clear());var v;var x=[],f=o.worldPosition,g=o.worldScaling;for(var m=0;m<n.length;m++){var _n$m=n[m],M=_n$m.pos,E=_n$m.points,_this$computDrawPoint=this.computDrawPoints(E),R=_this$computDrawPoint.ps,b=_this$computDrawPoint.rect;var O=void 0;var L=E.length===1;l===Lt.Stroke||L?O=ae(R,!0):O=ae(R,!1);var w={pos:M,d:O,fillColor:l===Lt.Stroke||L?s:void 0,lineDash:l===Lt.Dotted&&!L?[1,d*2]:l===Lt.LongDotted&&!L?[d,d*2]:void 0,strokeColor:s,lineCap:l===Lt.Stroke||L?void 0:"round",lineWidth:l===Lt.Stroke||L?0:d};v=Pt(v,{x:Math.floor((b.x+M[0])*g[0]+f[0]-vt.SafeBorderPadding),y:Math.floor((b.y+M[1])*g[1]+f[1]-vt.SafeBorderPadding),w:Math.floor(b.w*g[0]+2*vt.SafeBorderPadding),h:Math.floor(b.h*g[1]+2*vt.SafeBorderPadding)}),x.push(w);}p&&(e.scale=p),y&&(e.rotate=y),P&&(e.translate=P);var u=new kt();if(v){this.centerPos=vt.getCenterPos(v,o);var _m12=l===Lt.Stroke&&!T;u.attr(_objectSpread(_objectSpread({},e),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_m12?s:void 0,pos:this.centerPos,size:[(v.w-2*vt.SafeBorderPadding)/g[0],(v.h-2*vt.SafeBorderPadding)/g[1]],zIndex:c}));var _M8=x.map(function(E){return E.pos=[E.pos[0]-_this64.centerPos[0],E.pos[1]-_this64.centerPos[1]],new ce(E);});u.append.apply(u,_toConsumableArray(_M8)),_m12&&u.seal(),T&&this.drawEraserlines({group:u,eraserlines:T,pos:this.centerPos,layer:o}),this.replace(o,i||e.workId,u);}if(p||y||P){var _m13=u==null?void 0:u.getBoundingClientRect();if(_m13)return{x:Math.floor(_m13.x-vt.SafeBorderPadding),y:Math.floor(_m13.y-vt.SafeBorderPadding),w:Math.floor(_m13.width+vt.SafeBorderPadding*2),h:Math.floor(_m13.height+vt.SafeBorderPadding*2)};}return v;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Lt.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:Bt(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 l=0;l<t.length;l++){var _t$l=t[l],d=_t$l.point,c=_t$l.radius;var p=d.v;l===0&&t.length>1&&(p=t[l+1].point.v);var y=_.Per(p).mul(c);e.push(xt.Sub(d,y)),n.push(xt.Add(d,y));}var i=t[t.length-1],a=xt.GetSemicircleStroke(i.point,e[e.length-1],-1,8),o=xt.GetSemicircleStroke(t[0].point,n[0],-1,8),s=e.concat(a,n.reverse(),o);return{ps:s,rect:Bt(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:xt.GetDotStroke(e,n,8),rect:i};}},{key:"transformData",value:function transformData(t,e){var n=t.op,i=t.workState;var a=this.tmpPoints.length-1,o=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,s=_this$workOptions2.strokeType,l=_this$workOptions2.thickness,d=/* @__PURE__ */new Set();a=s===Lt.Stroke?this.updateTempPointsWithPressure(n,l,d):this.updateTempPoints(n,l,d);var c=e?this.tmpPoints:this.tmpPoints.slice(a);return o=this.getTaskPoints(c,l),{tasks:o,effects:d,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],l=[],d=t[0].t;for(;i<t.length;){var p=t[i],y=p.x-a,P=p.y-o,T=p.z,v=e?this.computRadius(T,e):T;if(l.push({point:new xt(y,P,T,t[i].v),radius:v}),i>0&&i<t.length-1){var _x50=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_x50<90||_x50>270){var _f27=(c=l.pop())==null?void 0:c.point.clone();_f27&&n.push({taskId:d,pos:s,points:[].concat(_toConsumableArray(l),[{point:_f27,radius:v}])}),a=t[i].x,o=t[i].y,s=[a,o];var g=p.x-a,u=p.y-o;l=[{point:new xt(g,u,T),radius:v}],d=Date.now();}}i++;}return n.push({taskId:d,pos:s,points:l}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,e,n){var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var l=0;l<t.length;l+=2){o=Math.min(o,a);var d=this.tmpPoints.length,c=new xt(t[l],t[l+1]);if(d===0){this.tmpPoints.push(c);continue;}var p=d-1,y=this.tmpPoints[p],P=_.Sub(c,y).uni();if(c.isNear(y,e)){if(y.z<this.MAX_REPEAR){if(y.setz(Math.min(y.z+1,this.MAX_REPEAR)),o=Math.min(o,p),d>1){var _x51=d-1;for(;_x51>0;){var _f28=this.tmpPoints[_x51].distance(this.tmpPoints[_x51-1]),g=Math.max(this.tmpPoints[_x51].z-this.uniThickness*_f28,0);if(this.tmpPoints[_x51-1].z>=g)break;this.tmpPoints[_x51-1].setz(g),o=Math.min(o,_x51-1),_x51--;}}}else o=1/0;continue;}c.setv(P);var T=c.distance(y),v=Math.max(y.z-this.uniThickness*T,0);d>1&&_.Equals(P,y.v,0.02)&&(v>0||y.z<=0)&&(n&&y.t&&n.add(y.t),this.tmpPoints.pop(),o=Math.min(p,o)),c.setz(v),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 _l4=this.tmpPoints[s].t;_l4&&(n==null||n.add(_l4));}else{var _l5=a-1;for(s=o;_l5>=0;){var _d6=this.tmpPoints[_l5].t;if(_d6&&(n==null||n.add(_d6),_l5<=o)){s=_l5,_l5=-1;break;}_l5--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPoints",value:function updateTempPoints(t,e,n){var l;var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var d=0;d<t.length;d+=2){var c=this.tmpPoints.length,p=new xt(t[d],t[d+1]);if(c===0){this.tmpPoints.push(p);continue;}var y=c-1,P=this.tmpPoints[y],T=_.Sub(p,P).uni();if(p.isNear(P,e/2)){o=Math.min(y,o);continue;}_.Equals(T,P.v,0.02)&&(n&&P.t&&n.add(P.t),this.tmpPoints.pop(),o=Math.min(y,o)),p.setv(T),this.tmpPoints.push(p);}var s=a;if(o===a){s=Math.max(s-1,0);var _d7=this.tmpPoints[s].t;_d7&&(n==null||n.add(_d7));}else{var _d8=Math.min(a-1,o);for(s=o;_d8>=0;){var _c4=(l=this.tmpPoints[_d8])==null?void 0:l.t;if(_c4&&(n==null||n.add(_c4),_d8<=o)){s=_d8,_d8=-1;break;}_d8--;}}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 xt(t[a],t[a+1]);if(o===0){this.tmpPoints.push(s);continue;}var l=o-1,d=this.tmpPoints[l],c=_.Sub(s,d).uni(),p=s.distance(d);if(o>1&&d.z===i)break;if(s.isNear(d,e/2)){if(n<3&&d.z<this.MAX_REPEAR&&(d.setz(Math.min(d.z+1,this.MAX_REPEAR)),o>1)){var P=o-1;for(;P>0;){var T=this.tmpPoints[P].distance(this.tmpPoints[P-1]),v=Math.max(this.tmpPoints[P].z-this.uniThickness*T,-e/4);if(this.tmpPoints[P-1].z>=v)break;this.tmpPoints[P-1].setz(v),P--;}}continue;}s.setv(c);var y=Math.max(d.z-this.uniThickness*p,i);o>1&&_.Equals(c,d.v,0.02)&&d.z<=0&&this.tmpPoints.pop(),s.setz(y),this.tmpPoints.push(s);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var l,d;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.tagName==="GROUP"?Jg(e)?e.setAttribute("bgcolor",a):e.children.forEach(function(c){c.setAttribute("strokeColor",a),c.getAttribute("fillColor")&&c.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(l=s==null?void 0:s.opt)!=null&&l.strokeColor&&(s.opt.strokeColor=a)),o&&s!=null&&s.opt&&(d=s.opt)!=null&&d.strokeType&&(s.opt.strokeType=o),s&&i.setInfo(e.name,s),vt.updateNodeOpt(t);}}]);}(vt);var ui=/*#__PURE__*/function(_vt2){function ui(t){var _this65;_classCallCheck(this,ui);_this65=_callSuper(this,ui,[t]);rt(_this65,"toolsType",ut.LaserPen);rt(_this65,"canRotate",!1);rt(_this65,"scaleType",jt.none);rt(_this65,"syncTimestamp");rt(_this65,"syncIndex",0);rt(_this65,"tmpPoints",[]);rt(_this65,"workOptions");rt(_this65,"consumeIndex",0);_this65.workOptions=t.toolsOpt,_this65.syncTimestamp=0;return _this65;}_inherits(ui,_vt2);return _createClass(ui,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(ui,"setWorkOptions",this,3)([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:lt.None};if(this.updateTempPoints(a||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:lt.None};var _this$workOptions3=this.workOptions,o=_this$workOptions3.strokeColor,s=_this$workOptions3.thickness,l=_this$workOptions3.strokeType,d=Bt(this.tmpPoints,s);var c=!1;var p=this.syncIndex,y=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var P={name:i==null?void 0:i.toString(),opacity:1,lineDash:l===Lt.Dotted?[1,s*2]:l===Lt.LongDotted?[s,s*2]:void 0,strokeColor:o,lineCap:"round",lineWidth:s,anchor:[0.5,0.5]},T=this.getTaskPoints(y);if(T.length){var _x52=Date.now();_x52-this.syncTimestamp>this.syncUnitTime&&(c=!0,this.syncTimestamp=_x52,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:P,tasks:T,isDot:!1,layer:this.drawLayer||this.fullLayer});}var v=[];return this.tmpPoints.slice(p).forEach(function(x){v.push(x.x,x.y);}),_objectSpread({rect:{x:d.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:d.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:d.w*this.fullLayer.worldScaling[0],h:d.h*this.fullLayer.worldScaling[1]},type:lt.DrawWork,dataType:Mt.Local,op:c?v:void 0,index:c?p*2:void 0},this.baseConsumeResult);}},{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,l=_this$workOptions4.strokeColor,d=_this$workOptions4.thickness,c=_this$workOptions4.strokeType;if(s){var P=this.computDotStroke({point:o[0],radius:d/2});o=P.ps,e=P.rect;}else e=Bt(this.tmpPoints,d);var p={name:t==null?void 0:t.toString(),fillColor:s?l:void 0,opacity:1,lineDash:c===Lt.Dotted&&!s?[1,d*2]:c===Lt.LongDotted&&!s?[d,d*2]:void 0,strokeColor:l,lineCap:s?void 0:"round",lineWidth:s?0:d,anchor:[0.5,0.5]},y=this.getTaskPoints(o);y.length&&this.draw({attrs:p,tasks:y,isDot:s,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(o){n.push(o.x,o.y);});var i=Zt(n);return _objectSpread({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:lt.FullWork,dataType:Mt.Local,ops:i,index:this.syncIndex*2},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var T;var 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 v=Bt(this.tmpPoints,o);return{x:v.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:v.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:v.w*this.fullLayer.worldScaling[0],h:v.h*this.fullLayer.worldScaling[1]};}var l=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(e||[]);var d,c=this.tmpPoints.slice(l);var p=c.length===1;if(p){var _v6=this.computDotStroke({point:c[0],radius:o/2});c=_v6.ps,d=_v6.rect;}else d=Bt(this.tmpPoints,o);var y={name:(T=this.workId)==null?void 0:T.toString(),fillColor:p?a:void 0,opacity:1,lineDash:s===Lt.Dotted&&!p?[1,o*2]:s===Lt.LongDotted&&!p?[o,o*2]:void 0,strokeColor:a,lineCap:p?void 0:"round",lineWidth:p?0:o,anchor:[0.5,0.5]},P=this.getTaskPoints(c);if(P.length){var _v7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:y,tasks:P,isDot:p,replaceId:n,layer:_v7});}return{x:d.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:d.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:d.w*this.fullLayer.worldScaling[0],h:d.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:xt.GetDotStroke(e,n,8),rect:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(e){var i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new xt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this66=this;var e,n,i,a,o,_iterator15,_step15,_loop3;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:e=t.attrs,n=t.tasks,i=t.isDot,a=t.layer,o=this.workOptions.duration;_iterator15=_createForOfIteratorHelper(n);_context23.prev=2;_loop3=/*#__PURE__*/_regeneratorRuntime().mark(function _loop3(){var s,l,d,c,p,_this66$workOptions,y,P,T,_a$getResolution,v,_x54;return _regeneratorRuntime().wrap(function _loop3$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:s=_step15.value;l=new ce(),d=s.pos,c=s.points;i?p=ae(c,!0):p=ae(c,!1),l.attr(_objectSpread(_objectSpread({},e),{},{pos:d,d:p}));_this66$workOptions=_this66.workOptions,y=_this66$workOptions.vertex,P=_this66$workOptions.fragment;if(y&&P){T=a.renderer.createProgram({vertex:y,fragment:P}),_a$getResolution=a.getResolution(),v=_a$getResolution.width,_x54=_a$getResolution.height;l.setUniforms({u_time:0,u_resolution:[v,_x54]}),l.setProgram(T);}a.appendChild(l),l.transition(o).attr({scale:i?[0.1,0.1]:[1,1],lineWidth:i?0:1}).then(function(){l.remove();});case 6:case"end":return _context22.stop();}},_loop3);});_iterator15.s();case 5:if((_step15=_iterator15.n()).done){_context23.next=9;break;}return _context23.delegateYield(_loop3(),"t0",7);case 7:_context23.next=5;break;case 9:_context23.next=14;break;case 11:_context23.prev=11;_context23.t1=_context23["catch"](2);_iterator15.e(_context23.t1);case 14:_context23.prev=14;_iterator15.f();return _context23.finish(14);case 17:case"end":return _context23.stop();}},_callee21,this,[[2,11,14,17]]);}));function draw(_x53){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var l;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 d=t[n],c=d.x-i,p=d.y-a;if(s.push(new xt(c,p)),n>0&&n<t.length-1){var y=t[n].getAngleByPoints(t[n-1],t[n+1]);if(y<90||y>270){var P=(l=s.pop())==null?void 0:l.clone();P&&e.push({pos:o,points:[].concat(_toConsumableArray(s),[P])}),i=t[n].x,a=t[n].y,o=[i,a];var T=d.x-i,v=d.y-a;s=[new xt(T,v)];}}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=Pt(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;}}]);}(vt);var Ld=Ye;Ye.polyline=Ye;Ye.polygon=bd;function Ye(h,r,t){var e=h.length,n=Se(h[0],r),i=[],a,o,s,l,d;for(t||(t=[]),a=1;a<e;a++){for(o=h[a-1],s=h[a],l=d=Se(s,r);;)if(n|l){if(n&l)break;n?(o=yr(o,s,n,r),n=Se(o,r)):(s=yr(o,s,l,r),l=Se(s,r));}else{i.push(o),l!==d?(i.push(s),a<e-1&&(t.push(i),i=[])):a===e-1&&i.push(s);break;}n=d;}return i.length&&t.push(i),t;}function bd(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=!(Se(n,r)&e),a=0;a<h.length;a++)o=h[a],s=!(Se(o,r)&e),s!==i&&t.push(yr(n,o,e,r)),s&&t.push(o),n=o,i=s;if(h=t,!h.length)break;}return t;}function yr(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 Se(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 Dr=/* @__PURE__ */de(Ld);var Te=/*#__PURE__*/function(_vt3){function Te(t,e){var _this67;_classCallCheck(this,Te);_this67=_callSuper(this,Te,[t]);rt(_this67,"canRotate",!1);rt(_this67,"scaleType",jt.none);rt(_this67,"toolsType",ut.Eraser);rt(_this67,"serviceWork");rt(_this67,"tmpPoints",[]);rt(_this67,"workOptions");rt(_this67,"worldPosition");rt(_this67,"worldScaling");rt(_this67,"eraserRect");rt(_this67,"eraserPolyline");_this67.serviceWork=e,_this67.workOptions=t.toolsOpt,_this67.worldPosition=_this67.fullLayer.worldPosition,_this67.worldScaling=_this67.fullLayer.worldScaling;return _this67;}_inherits(Te,_vt3);return _createClass(Te,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Te,"setWorkOptions",this,3)([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],_Te$eraserSizes$this$=Te.eraserSizes[this.workOptions.thickness],i=_Te$eraserSizes$this$.width,a=_Te$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 _e3=new _(this.tmpPoints[0],this.tmpPoints[1]),n=new _(this.tmpPoints[2],this.tmpPoints[3]),i=_.Sub(n,_e3).uni(),a=_.Dist(_e3,n),_Te$eraserSizes$this$2=Te.eraserSizes[this.workOptions.thickness],o=_Te$eraserSizes$this$2.width,s=_Te$eraserSizes$this$2.height,l=Math.min(o,s),d=Math.round(a/l);if(d>1){var c=[];for(var p=0;p<d;p++){var y=_.Mul(i,p*l);c.push(this.tmpPoints[0]+y.x,this.tmpPoints[1]+y.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]),_Te$eraserSizes$this$3=Te.eraserSizes[this.workOptions.thickness],a=_Te$eraserSizes$this$3.width,o=_Te$eraserSizes$this$3.height;return _.Dist(n,i)<Math.hypot(a,o)*0.5;}},{key:"remove",value:function remove(t){var _this68=this;var e=t.curNodeMap,n=t.removeIds;var i;var _iterator16=_createForOfIteratorHelper(e.values()),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var a=_step16.value;if(a.rect&&this.eraserRect&&this.eraserPolyline&&ue(this.eraserRect,a.rect)){var o=a.op,s=[],l=[];for(var c=0;c<o.length;c+=3){var p=new _(o[c]*this.worldScaling[0]+this.worldPosition[0],o[c+1]*this.worldScaling[1]+this.worldPosition[1],o[c+2]);l.push(p),s.push(new xt(p.x,p.y));}var d=s.length&&Bt(s)||a.rect;ue(d,this.eraserRect)&&(l.length>1?Dr.polyline(l.map(function(p){return p.XY;}),this.eraserPolyline).length&&n.add(a.name):n.add(a.name),i=Pt(i,d));}}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}return n.forEach(function(a){var s;var o=_this68.fullLayer.getElementsByName(a);_this68.fullLayer.removeChild(o[0]),(s=_this68.vNodes)==null||s["delete"](a);}),i&&(i.x-=vt.SafeBorderPadding,i.y-=vt.SafeBorderPadding,i.w+=vt.SafeBorderPadding*2,i.h+=vt.SafeBorderPadding*2),i;}},{key:"consume",value:function consume(t){var e=t.data.op;if(!e||e.length===0)return _objectSpread({type:lt.None},this.baseConsumeResult);var n=this.tmpPoints.length;if(n>1&&this.isNear([e[0],e[1]],[this.tmpPoints[n-2],this.tmpPoints[n-1]]))return _objectSpread({type:lt.None},this.baseConsumeResult);n<3?this.tmpPoints.push(e[0],e[1]):this.tmpPoints.splice(2,2,e[0],e[1]);var i=this.computRectCenterPoints();var a;var o=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:lt.None},this.baseConsumeResult);var s=this.getUnLockNodeMap(this.vNodes.getUnLockNodes());for(var l=0;l<i.length-1;l+=2){this.createEraserRect(i.slice(l,l+2));var d=this.remove({curNodeMap:s,removeIds:o});a=Pt(a,d);}return a&&o.size?{type:lt.RemoveNode,rect:a,removeIds:_toConsumableArray(o)}:_objectSpread({type:lt.None},this.baseConsumeResult);}},{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=new Map(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator17=_createForOfIteratorHelper(i.values()),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var o=_step17.value;if((e=o.selectIds)!=null&&e.length){var _iterator19=_createForOfIteratorHelper(o.selectIds),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var s=_step19.value;n["delete"](s);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}}}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}var _iterator18=_createForOfIteratorHelper(a.keys()),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var _o4=_step18.value;n["delete"](_o4);}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}return n;}return t;}}]);}(vt);// 来源于white-sdk
|
|
408
|
+
rt(Te,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var se=Te;var wd="__lodash_hash_undefined__";function Dd(h){return this.__data__.set(h,wd),this;}var Nd=Dd;function Wd(h){return this.__data__.has(h);}var Bd=Wd,Fd=$n,Ud=Nd,jd=Bd;function Ve(h){var r=-1,t=h==null?0:h.length;for(this.__data__=new Fd();++r<t;)this.add(h[r]);}Ve.prototype.add=Ve.prototype.push=Ud;Ve.prototype.has=jd;var Nr=Ve;function $d(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 zd=$d;function Gd(h,r){return h.has(r);}var Wr=Gd,Hd=Nr,Kd=zd,Yd=Wr,Vd=1,Xd=2;function kd(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 l=i.get(h),d=i.get(r);if(l&&d)return l==r&&d==h;var c=-1,p=!0,y=t&Xd?new Hd():void 0;for(i.set(h,r),i.set(r,h);++c<o;){var P=h[c],T=r[c];if(e)var v=a?e(T,P,c,r,h,i):e(P,T,c,h,r,i);if(v!==void 0){if(v)continue;p=!1;break;}if(y){if(!Kd(r,function(x,f){if(!Yd(y,f)&&(P===x||n(P,x,t,e,i)))return y.push(f);})){p=!1;break;}}else if(!(P===T||n(P,T,t,e,i))){p=!1;break;}}return i["delete"](h),i["delete"](r),p;}var di=kd;function Jd(h){var r=-1,t=Array(h.size);return h.forEach(function(e,n){t[++r]=[n,e];}),t;}var Zd=Jd;function Qd(h){var r=-1,t=Array(h.size);return h.forEach(function(e){t[++r]=e;}),t;}var Br=Qd,pn=Fe,mn=si,qd=Tr,_d=di,tg=Zd,eg=Br,rg=1,ng=2,ig="[object Boolean]",sg="[object Date]",og="[object Error]",ag="[object Map]",lg="[object Number]",cg="[object RegExp]",fg="[object Set]",hg="[object String]",ug="[object Symbol]",dg="[object ArrayBuffer]",gg="[object DataView]",vn=pn?pn.prototype:void 0,lr=vn?vn.valueOf:void 0;function pg(h,r,t,e,n,i,a){switch(t){case gg:if(h.byteLength!=r.byteLength||h.byteOffset!=r.byteOffset)return!1;h=h.buffer,r=r.buffer;case dg:return!(h.byteLength!=r.byteLength||!i(new mn(h),new mn(r)));case ig:case sg:case lg:return qd(+h,+r);case og:return h.name==r.name&&h.message==r.message;case cg:case hg:return h==r+"";case ag:var o=tg;case fg:var s=e&rg;if(o||(o=eg),h.size!=r.size&&!s)return!1;var l=a.get(h);if(l)return l==r;e|=ng,a.set(h,r);var d=_d(o(h),o(r),e,n,i,a);return a["delete"](h),d;case ug:if(lr)return lr.call(h)==lr.call(r);}return!1;}var mg=pg,yn=ri,vg=1,yg=Object.prototype,Sg=yg.hasOwnProperty;function xg(h,r,t,e,n,i){var a=t&vg,o=yn(h),s=o.length,l=yn(r),d=l.length;if(s!=d&&!a)return!1;for(var c=s;c--;){var p=o[c];if(!(a?p in r:Sg.call(r,p)))return!1;}var y=i.get(h),P=i.get(r);if(y&&P)return y==r&&P==h;var T=!0;i.set(h,r),i.set(r,h);for(var v=a;++c<s;){p=o[c];var x=h[p],f=r[p];if(e)var g=a?e(f,x,p,r,h,i):e(x,f,p,h,r,i);if(!(g===void 0?x===f||n(x,f,t,e,i):g)){T=!1;break;}v||(v=p=="constructor");}if(T&&!v){var u=h.constructor,m=r.constructor;u!=m&&"constructor"in h&&"constructor"in r&&!(typeof u=="function"&&u instanceof u&&typeof m=="function"&&m instanceof m)&&(T=!1);}return i["delete"](h),i["delete"](r),T;}var Tg=xg,cr=zn,Mg=di,Pg=mg,Og=Tg,Sn=or,xn=Ue,Tn=Pr,Eg=kn,Cg=1,Mn="[object Arguments]",Pn="[object Array]",$e="[object Object]",Ag=Object.prototype,On=Ag.hasOwnProperty;function Rg(h,r,t,e,n,i){var a=xn(h),o=xn(r),s=a?Pn:Sn(h),l=o?Pn:Sn(r);s=s==Mn?$e:s,l=l==Mn?$e:l;var d=s==$e,c=l==$e,p=s==l;if(p&&Tn(h)){if(!Tn(r))return!1;a=!0,d=!1;}if(p&&!d)return i||(i=new cr()),a||Eg(h)?Mg(h,r,t,e,n,i):Pg(h,r,s,t,e,n,i);if(!(t&Cg)){var y=d&&On.call(h,"__wrapped__"),P=c&&On.call(r,"__wrapped__");if(y||P){var T=y?h.value():h,v=P?r.value():r;return i||(i=new cr()),n(T,v,t,e,i);}}return p?(i||(i=new cr()),Og(h,r,t,e,n,i)):!1;}var Ig=Rg,Lg=Ig,En=ne;function gi(h,r,t,e,n){return h===r?!0:h==null||r==null||!En(h)&&!En(r)?h!==h&&r!==r:Lg(h,r,t,e,gi,n);}var bg=gi,wg=bg;function Dg(h,r){return wg(h,r);}var Ng=Dg,oe=/* @__PURE__ */de(Ng);var _e=/*#__PURE__*/function(_vt4){function _e(t){var _this69;_classCallCheck(this,_e);_this69=_callSuper(this,_e,[t]);rt(_this69,"toolsType",ut.Selector);rt(_this69,"tmpPoints",[]);rt(_this69,"workOptions");rt(_this69,"vNodes");rt(_this69,"selectIds");rt(_this69,"selectorColor");rt(_this69,"strokeColor");rt(_this69,"fillColor");rt(_this69,"oldSelectRect");rt(_this69,"canRotate",!1);rt(_this69,"canTextEdit",!1);rt(_this69,"canLock",!1);rt(_this69,"scaleType",jt.all);rt(_this69,"toolsTypes");rt(_this69,"shapeOpt");rt(_this69,"textOpt");rt(_this69,"isLocked");rt(_this69,"thickness");rt(_this69,"strokeType");rt(_this69,"useStroke");_this69.workOptions=t.toolsOpt,_this69.vNodes=t.vNodes;return _this69;}_inherits(_e,_vt4);return _createClass(_e,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=Bt(this.tmpPoints);if(e.w===0||e.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(e,t),n=_this$vNodes$getRectI.rectRange,i=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(i.keys()),intersectRect:n,subNodeMap:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length,n=t.length;if(n>1){var i=new xt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);e===2?this.tmpPoints.splice(1,1,i):this.tmpPoints.push(i);}}},{key:"drawSelector",value:function drawSelector(t){var _this70=this;var e=t.drawRect,n=t.subNodeMap,i=t.selectorId,a=t.layer,o=t.isService,s=new kt({pos:[e.x,e.y],anchor:[0,0],size:[e.w,e.h],id:i,name:i,zIndex:9999}),l=[];if(o){var d=new Gr({normalize:!0,pos:[e.w/2,e.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:e.w,height:e.h,name:_e.selectorBorderId});l.push(d);}n.forEach(function(d,c){var p=[d.rect.x+d.rect.w/2-e.x,d.rect.y+d.rect.h/2-e.y],y=new Gr({normalize:!0,pos:p,lineWidth:1,strokeColor:n.size>1?_this70.selectorColor||_this70.workOptions.strokeColor:void 0,width:d.rect.w,height:d.rect.h,id:"selector-".concat(c),name:"selector-".concat(c)});l.push(y);}),l&&s.append.apply(s,l),(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,l;var a=n.intersectRect,o=n.subNodeMap;(l=(s=e.parent)==null?void 0:s.getElementById(t))==null||l.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:o,selectorId:t,layer:e,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=jt.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0,this.thickness=void 0,this.strokeType=void 0,this.useStroke=!1;var e=/* @__PURE__ */new Set();var n,i=!0;var _iterator20=_createForOfIteratorHelper(t.values()),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var a=_step20.value;var o=a.opt,s=a.canRotate,l=a.scaleType,d=a.toolsType;this.selectorColor=this.workOptions.strokeColor,o.strokeColor&&(this.strokeColor=o.strokeColor),o.fillColor&&(this.fillColor=o.fillColor),o.textOpt&&(this.textOpt=o.textOpt),o.thickness&&(this.thickness=o.thickness),d!==ut.Pencil&&(i=!1),o.strokeType&&(this.strokeType=o.strokeType),d===ut.SpeechBalloon&&(e.add(d),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=o.placement),d===ut.Polygon&&(e.add(d),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices),d===ut.Star&&(e.add(d),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices,this.shapeOpt.innerRatio=o.innerRatio,this.shapeOpt.innerVerticeStep=o.innerVerticeStep),d===ut.Text&&(this.textOpt=o),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=s,this.scaleType=l),l===jt.none&&(this.scaleType=l),d===ut.Image&&(n=a);}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}i&&(this.useStroke=!0),e.size&&(this.toolsTypes=_toConsumableArray(e)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=jt.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1,this.thickness=void 0,this.strokeType=void 0,this.useStroke=void 0)):t.size>1&&!n.opt.locked&&(this.canLock=!1,this.canRotate=!1));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var t,e;if(this.scaleType===jt.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:lt.None};this.updateTempPoints(e);var a=this.computSelector();if(this.selectIds&&oe(this.selectIds,a.selectIds))return{type:lt.None};this.selectIds=a.selectIds;var o=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(Nt,this.fullLayer,a),this.oldSelectRect=o;var s=this.getChildrenPoints();return _objectSpread({type:lt.Select,dataType:Mt.Local,rect:Pt(o,i),selectIds:a.selectIds,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,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}},{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,Nt,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var i=this.getChildrenPoints();return _objectSpread({type:lt.Select,dataType:Mt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:i,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return{type:lt.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]:Nt;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,l=_toConsumableArray(s.values()).sort(function(d,c){return(c.opt.zIndex||0)-(d.opt.zIndex||0);});var _iterator21=_createForOfIteratorHelper(l),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _d9=_step21.value;var _c5=this.fullLayer.getElementsByName(_d9.name);if(Pi(_c5).find(function(y){return y.isPointCollision(i,a);})){o=_d9;break;}}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}if(o){var d=o.name;if(!oe(this.oldSelectRect,o.rect)){var c=/* @__PURE__ */new Map([[d,o]]);this.getSelecteorInfo(c),this.draw(e,this.fullLayer,{intersectRect:o.rect,subNodeMap:c,selectIds:this.selectIds||[]},n);}this.selectIds=[d],this.oldSelectRect=o.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator22=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _step22$value=_slicedToArray(_step22.value,2),_e4=_step22$value[0],n=_step22$value[1];n.isSelected&&(t=Pt(t,n.rect),this.vNodes.unSelected(_e4));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var e;var _iterator23=_createForOfIteratorHelper(t),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var n=_step23.value;var i=this.vNodes.get(n);i&&i.isSelected&&(e=Pt(e,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return e;}},{key:"selectedByIds",value:function selectedByIds(t){var e;var _iterator24=_createForOfIteratorHelper(t),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var n=_step24.value;var i=this.vNodes.get(n);i&&(e=Pt(e,i.rect),this.vNodes.selected(n));}}catch(err){_iterator24.e(err);}finally{_iterator24.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=Pt(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===ut.Ellipse||t===ut.Triangle||t===ut.Rectangle||t===ut.Polygon||t===ut.Star||t===ut.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var m,e,n,i,a,o,s,l,d,c,p,y,P,T,v,x,f,_iterator25,_step25,M,E,R,b,O,L,w,I,A,W,z,g,_M9,_E4,_R5,u;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:e=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,a=t.willSerializeData,o=t.worker,s=t.offset,l=this.fullLayer;if(l){_context24.next=3;break;}return _context24.abrupt("return");case 3:c=/* @__PURE__ */new Map(),p=e.originPoint,y=e.workState,P=e.angle,T=e.translate,v=e.dir,x=e.scale;s&&(T?e.translate=[T[0]+s[0],T[1]+s[1]]:e.translate=s);if(!(p||T||_t(P))){_context24.next=9;break;}if(!(y===Rt.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(i.setTargetAssignKeys(n),{type:lt.Select,dataType:Mt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:f=i.getLastTarget();case 9:if(!n){_context24.next=60;break;}_iterator25=_createForOfIteratorHelper(n);_context24.prev=11;_iterator25.s();case 13:if((_step25=_iterator25.n()).done){_context24.next=52;break;}M=_step25.value;E=i.get(M);if(!E){_context24.next=50;break;}R=E.toolsType,b=(l==null?void 0:l.getElementsByName(M))[0];if(!b){_context24.next=50;break;}O=!1,L=!1;w=_objectSpread({},e);I=void 0;if(!R){_context24.next=50;break;}w.thickness&&E.opt.thickness&&(O=E.opt.thickness!==w.thickness),w.strokeType&&(m=E.opt)!=null&&m.strokeType&&(L=E.opt.strokeType!==w.strokeType),I=f==null?void 0:f.get(M);A=Mi(R);if(!(A==null||A.updateNodeOpt({node:b,opt:w,vNodes:i,willSerializeData:a,targetNode:I}),E&&o&&(a&&(w.angle||w.translate)||w.originPoint&&w.scenePoint&&w.scale||w.pointMap&&w.pointMap.has(M)||R===ut.Text&&(w.fontSize||w.translate||w.textInfos&&w.textInfos.get(M))||R===ut.Image&&(w.angle||w.translate||w.scale)||R===w.toolsType&&w.willRefresh||O||L))){_context24.next=49;break;}W=o.createWorkShapeNode({workId:M,toolsType:R,toolsOpt:E.opt});W==null||W.setWorkId(M);z=void 0;if(!(R===ut.Image)){_context24.next=35;break;}_context24.next=32;return W.consumeServiceAsync({isFullWork:!0,replaceId:M,worker:o});case 32:z=_context24.sent;_context24.next=48;break;case 35:if(!(R===ut.Text)){_context24.next=41;break;}_context24.next=38;return W.consumeServiceAsync({isFullWork:!0,replaceId:M});case 38:z=_context24.sent;_context24.next=48;break;case 41:_context24.prev=41;z=W==null?void 0:W.consumeService({op:E.op,isFullWork:!0,replaceId:M});_context24.next=48;break;case 45:_context24.prev=45;_context24.t0=_context24["catch"](41);return _context24.abrupt("continue",50);case 48:z&&(E.rect=z);case 49:E&&(c.set(M,E),d=Pt(d,E.rect));case 50:_context24.next=13;break;case 52:_context24.next=57;break;case 54:_context24.prev=54;_context24.t1=_context24["catch"](11);_iterator25.e(_context24.t1);case 57:_context24.prev=57;_iterator25.f();return _context24.finish(57);case 60:f&&y===Rt.Done&&(i.deleteLastTarget(),f=void 0);g=d;if(!(p&&T&&x&&v&&g&&!s)){_context24.next=80;break;}_M9=[[g.x,g.y],[g.x+g.w,g.y],[g.x+g.w,g.y+g.h],[g.x,g.y+g.h]];_context24.t2=v;_context24.next=_context24.t2==="top"?67:_context24.t2==="topLeft"?67:_context24.t2==="left"?67:_context24.t2==="topRight"?69:_context24.t2==="right"?71:_context24.t2==="bottomRight"?71:_context24.t2==="bottom"?71:_context24.t2==="bottomLeft"?73:75;break;case 67:T[0]>0&&T[1]>0?_E4=_M9[0]:T[0]>0?_E4=_M9[3]:T[1]>0?_E4=_M9[1]:_E4=_M9[2];return _context24.abrupt("break",75);case 69:T[0]<0&&T[1]>0?_E4=_M9[1]:T[0]<0?_E4=_M9[2]:T[1]>0?_E4=_M9[0]:_E4=_M9[3];return _context24.abrupt("break",75);case 71:T[0]<0&&T[1]<0?_E4=_M9[2]:T[0]<0?_E4=_M9[1]:T[1]<0?_E4=_M9[3]:_E4=_M9[0];return _context24.abrupt("break",75);case 73:T[0]>0&&T[1]<0?_E4=_M9[3]:T[0]>0?_E4=_M9[0]:T[1]<0?_E4=_M9[2]:_E4=_M9[1];return _context24.abrupt("break",75);case 75:_R5=_E4&&[p[0]-_E4[0],p[1]-_E4[1]]||[0,0];if(oe(_R5,[0,0])){_context24.next=80;break;}_context24.next=79;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{},offset:_R5}));case 79:return _context24.abrupt("return",_context24.sent);case 80:this.getSelecteorInfo(c),this.draw(Nt,l,{selectIds:n||[],subNodeMap:c,intersectRect:g});u=Pt(this.oldSelectRect,g);return _context24.abrupt("return",(this.oldSelectRect=g,{type:lt.Select,dataType:Mt.Local,selectRect:g,renderRect:d,rect:Pt(u,g),selectIds:n}));case 83:case"end":return _context24.stop();}},_callee22,this,[[11,54,57,60],[41,45]]);}));function updateSelector(_x55){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:lt.Select,dataType:Mt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(xr,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,e,n){var _this71=this;var i=e.selectIds,a=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,a);var s;var l=/* @__PURE__ */new Map();return i==null||i.forEach(function(d){var c=_this71.vNodes.get(d);c&&(s=Pt(s,c.rect),l.set(d,c));}),this.getSelecteorInfo(l),this.draw(a,this.fullLayer,{intersectRect:s,selectIds:i||[],subNodeMap:l},n),Pt(s,o);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this72=this;var n;var t;var e=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(i){var a=_this72.vNodes.get(i);a&&(t=Pt(t,a.rect),e.set(i,a));},this),this.getSelecteorInfo(e),this.draw(Nt,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=Pt(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:lt.CursorHover,dataType:Mt.Local,rect:Pt(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:lt.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();});}}]);}(vt);rt(_e,"selectorBorderId","selector-border");var Xe=_e;var pi=/*#__PURE__*/function(_vt5){function pi(t){var _this73;_classCallCheck(this,pi);_this73=_callSuper(this,pi,[t]);rt(_this73,"canRotate",!1);rt(_this73,"scaleType",jt.both);rt(_this73,"toolsType",ut.Arrow);rt(_this73,"tmpPoints",[]);rt(_this73,"workOptions");rt(_this73,"oldRect");rt(_this73,"arrowTipWidth");rt(_this73,"syncTimestamp");_this73.workOptions=t.toolsOpt,_this73.arrowTipWidth=_this73.workOptions.thickness*4,_this73.syncTimestamp=0,_this73.syncUnitTime=50;return _this73;}_inherits(pi,_vt5);return _createClass(pi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,l=s==null?void 0:s.length;if(!l||l<2)return{type:lt.None};var d;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],d=!1):d=this.updateTempPoints(s),!d)return{type:lt.None};var c;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({workId:o,layer:y});}if(!i){var _y8=Date.now();return _y8-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y8,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:lt.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:lt.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread(_objectSpread({rect:p},this.baseConsumeResult),{},{type:lt.DrawWork,dataType:Mt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:lt.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=Zt(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:vt.getCenterPos(n,e)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:lt.FullWork,dataType:Mt.Local,ops:a,isSync:!0});}},{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,l=_this$workOptions6.rotate,d=_this$workOptions6.translate,c=_this$workOptions6.strokeType,p=_this$workOptions6.eraserlines,y=n.worldPosition,P=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(a),T=_this$computDrawPoint2.points,v=_this$computDrawPoint2.pos,x=_this$computDrawPoint2.rect,f=_this$computDrawPoint2.isTriangle,g=_this$computDrawPoint2.trianglePoints,u=_this$computDrawPoint2.trianglePos,m=[x.x+x.w/2,x.y+x.h/2],M={pos:m,name:e,id:e,zIndex:o,anchor:[0.5,0.5],size:[x.w,x.h]};s&&(M.scale=s),l&&(M.rotate=l),d&&(M.translate=d);var E=new kt(M),R={points:g,pos:[u[0]-m[0],u[1]-m[1]],fillColor:i,strokeColor:i,lineWidth:0,normalize:!1},b=new le(R);if(E.append(b),!f&&T&&v){var O={points:T,pos:[v[0]-m[0],v[1]-m[1]],fillColor:i,strokeColor:i,lineDash:c===Lt.Dotted&&!f?[1,a*2]:c===Lt.LongDotted&&!f?[a,a*2]:void 0,lineCap:c===Lt.Normal?void 0:"round",lineWidth:a,normalize:!1},L=new le(O);E.append(L);}if(p&&this.drawEraserlines({group:E,eraserlines:p,pos:m,layer:n}),this.replace(n,e,E),s||l||d){var _O9=E.getBoundingClientRect();return{x:Math.floor(_O9.x-vt.SafeBorderPadding),y:Math.floor(_O9.y-vt.SafeBorderPadding),w:Math.floor(_O9.width+vt.SafeBorderPadding*2),h:Math.floor(_O9.height+vt.SafeBorderPadding*2)};}return{x:Math.floor(x.x*P[0]+y[0]-vt.SafeBorderPadding),y:Math.floor(x.y*P[1]+y[1]-vt.SafeBorderPadding),w:Math.floor(x.w*P[0]+2*vt.SafeBorderPadding),h:Math.floor(x.h*P[1]+2*vt.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 _this74=this;var e=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=_.Per(e).mul(t/2),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),o=_.Mul(e,this.arrowTipWidth),s=_.Sub(this.tmpPoints[1],o),l=xt.Sub(s,n),d=xt.Add(s,n),c=_.Per(e).mul(t*1.5),p=xt.Sub(s,c),y=xt.Add(s,c),P=[this.tmpPoints[0],s],T=[p,this.tmpPoints[1],y],v=[i,a].concat(T,[l,d]);return{trianglePoints:T.map(function(x){return xt.Sub(x,_this74.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:P.map(function(x){return xt.Sub(x,_this74.tmpPoints[0]).XY;}).flat(1),rect:Bt(v),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this75=this;var t=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),e=this.tmpPoints[1].distance(this.tmpPoints[0]),n=_.Per(t).mul(Math.floor(e*3/8)),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),o=[i,this.tmpPoints[1],a];return{trianglePoints:o.map(function(s){return xt.Sub(s,_this75.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:Bt(o),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,l;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 d=0;d<e.length;d+=3)this.tmpPoints.push(new xt(e[d],e[d+1],e[d+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(l=this.vNodes)==null||l.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:vt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var l,d;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.tagName==="GROUP"?e.children.forEach(function(c){c.setAttribute("strokeColor",a),c.getAttribute("fillColor")&&c.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(l=s==null?void 0:s.opt)!=null&&l.strokeColor&&(s.opt.strokeColor=a)),o&&s!=null&&s.opt&&(d=s.opt)!=null&&d.strokeType&&(s.opt.strokeType=o),s&&i.setInfo(e.name,s),vt.updateNodeOpt(t);}}]);}(vt);var mi=/*#__PURE__*/function(_vt6){function mi(t){var _this76;_classCallCheck(this,mi);_this76=_callSuper(this,mi,[t]);rt(_this76,"canRotate",!1);rt(_this76,"scaleType",jt.all);rt(_this76,"toolsType",ut.Ellipse);rt(_this76,"tmpPoints",[]);rt(_this76,"workOptions");rt(_this76,"oldRect");rt(_this76,"syncTimestamp");_this76.workOptions=t.toolsOpt,_this76.syncTimestamp=0,_this76.syncUnitTime=50;return _this76;}_inherits(mi,_vt6);return _createClass(mi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,l=s==null?void 0:s.length;if(!l||l<2)return{type:lt.None};var d;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],d=!1):d=this.updateTempPoints(s),!d)return{type:lt.None};var c;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({workId:o,layer:y,isDrawing:!0});}if(!i){var _y9=Date.now();return _y9-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y9,_objectSpread(_objectSpread({type:lt.DrawWork,dataType:Mt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:lt.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:lt.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:lt.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=Zt(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&vt.getCenterPos(n,e)}),_objectSpread(_objectSpread({rect:n,type:lt.FullWork,dataType:Mt.Local},this.baseConsumeResult),{},{ops:a,isSync:!0});}},{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,l=_this$workOptions7.zIndex,d=_this$workOptions7.scale,c=_this$workOptions7.rotate,p=_this$workOptions7.translate,y=_this$workOptions7.strokeType,P=_this$workOptions7.eraserlines,T=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(s),v=_this$computDrawPoint3.radius,x=_this$computDrawPoint3.rect,f=_this$computDrawPoint3.pos,g={pos:f,name:e,id:e,radius:v,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:y===Lt.Dotted?[1,s*2]:y===Lt.LongDotted?[s,s*2]:void 0},u={name:e,id:e,zIndex:l,pos:f,anchor:[0.5,0.5],size:[x.w,x.h]};d&&(u.scale=d),c&&(u.rotate=c),p&&(u.translate=p);var m=new kt(u);if(i){var R=new ce({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/T[0],1/T[1]]});m.append(R);}var M=new Ji(_objectSpread(_objectSpread({},g),{},{pos:[0,0]}));m.append(M),P&&this.drawEraserlines({group:m,eraserlines:P,pos:f,layer:n}),this.replace(n,e,m);var E=m.getBoundingClientRect();return{x:Math.floor(E.x-vt.SafeBorderPadding),y:Math.floor(E.y-vt.SafeBorderPadding),w:Math.floor(E.width+vt.SafeBorderPadding*2),h:Math.floor(E.height+vt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var e=Bt(this.tmpPoints),n=Bt(this.tmpPoints,t),i=[Math.floor(e.x+e.w/2),Math.floor(e.y+e.h/2)];return{rect:n,pos:i,radius:[Math.floor(e.w/2),Math.floor(e.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,l;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 d=0;d<e.length;d+=3)this.tmpPoints.push(new xt(e[d],e[d+1],e[d+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(l=this.vNodes)==null||l.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:vt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,p,y;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.strokeType,l=i.get(e.name);var d=e;return e.tagName==="GROUP"&&(d=e.children[0]),a&&(d.setAttribute("strokeColor",a),(c=l==null?void 0:l.opt)!=null&&c.strokeColor&&(l.opt.strokeColor=a)),o&&(o==="transparent"?d.setAttribute("fillColor","rgba(0,0,0,0)"):d.setAttribute("fillColor",o),(p=l==null?void 0:l.opt)!=null&&p.fillColor&&(l.opt.fillColor=o)),s&&l!=null&&l.opt&&(y=l.opt)!=null&&y.strokeType&&(l.opt.strokeType=s),l&&i.setInfo(e.name,l),vt.updateNodeOpt(t);}}]);}(vt);var vi=/*#__PURE__*/function(_vt7){function vi(t){var _this77;_classCallCheck(this,vi);_this77=_callSuper(this,vi,[t]);rt(_this77,"canRotate",!0);rt(_this77,"scaleType",jt.all);rt(_this77,"toolsType",ut.Rectangle);rt(_this77,"tmpPoints",[]);rt(_this77,"workOptions");rt(_this77,"oldRect");rt(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(vi,_vt7);return _createClass(vi,[{key:"transformData",value:function transformData(){var t=Bt(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 _iterator26=_createForOfIteratorHelper(t),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var o=_step26.value;n.push(_construct(_,_toConsumableArray(o)));}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}var i=Bt(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 e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,l=s==null?void 0:s.length;if(!l||l<2)return{type:lt.None};var d;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],d=!1):d=this.updateTempPoints(s),!d)return{type:lt.None};var c=this.transformData();var p;if(i||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({ps:c,workId:o,layer:P,isDrawing:!0});}if(!i){var _P2=Date.now();return _P2-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P2,_objectSpread({type:lt.DrawWork,dataType:Mt.Local,op:c.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:lt.None};}var y=Pt(p,this.oldRect);return this.oldRect=p,_objectSpread({rect:y,type:lt.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var s;var t=this.workId;if(this.tmpPoints.length<2)return{type:lt.RemoveNode,removeIds:[t]};var e=this.transformData(),n=this.fullLayer,i=this.draw({ps:e,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var a=e.flat(1),o=Zt(a);return(s=this.vNodes)==null||s.setInfo(t,{rect:i,op:a,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&vt.getCenterPos(i,n)}),_objectSpread({rect:i,type:lt.FullWork,dataType:Mt.Local,ops:o,isSync:!0},this.baseConsumeResult);}},{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,l=_this$workOptions8.fillColor,d=_this$workOptions8.thickness,c=_this$workOptions8.zIndex,p=_this$workOptions8.scale,y=_this$workOptions8.rotate,P=_this$workOptions8.translate,T=_this$workOptions8.strokeType,v=_this$workOptions8.eraserlines,x=n.worldPosition,f=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(a),g=_this$computDrawPoint4.points,u=_this$computDrawPoint4.rect,m=_this$computDrawPoint4.pos,M={close:!0,normalize:!0,points:g,lineWidth:d,fillColor:l!=="transparent"&&l||void 0,strokeColor:s,lineJoin:"round",lineCap:"round",lineDash:T===Lt.Dotted?[1,d*2]:T===Lt.LongDotted?[d,d*2]:void 0},E={x:Math.floor(u.x*f[0]+x[0]-vt.SafeBorderPadding),y:Math.floor(u.y*f[1]+x[1]-vt.SafeBorderPadding),w:Math.floor(u.w*f[0]+2*vt.SafeBorderPadding),h:Math.floor(u.h*f[0]+2*vt.SafeBorderPadding)},R=new kt({name:e,id:e,zIndex:c,pos:m,anchor:[0.5,0.5],size:[u.w,u.h],scale:p,rotate:y,translate:P}),b=new le(_objectSpread(_objectSpread({},M),{},{pos:[0,0]}));if(R.appendChild(b),i){var O=new ce({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/f[0],1/f[1]]});R.appendChild(O);}if(v&&this.drawEraserlines({group:R,eraserlines:v,pos:m,layer:n}),this.replace(n,o||e,R),p||y||P){var _O10=R.getBoundingClientRect();return{x:Math.floor(_O10.x-vt.SafeBorderPadding),y:Math.floor(_O10.y-vt.SafeBorderPadding),w:Math.floor(_O10.width+2*vt.SafeBorderPadding),h:Math.floor(_O10.height+2*vt.SafeBorderPadding)};}return E;}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var d,c;var e=t.op,n=t.isFullWork,i=t.replaceId,a=(d=this.workId)==null?void 0:d.toString();if(!a)return;var o=[];for(var p=0;p<e.length;p+=3)o.push([e[p],e[p+1],e[p+2]]);var s=n?this.fullLayer:this.drawLayer||this.fullLayer,l=this.draw({ps:o,workId:a,layer:s,isDrawing:!1,replaceId:i});return this.oldRect=l,(c=this.vNodes)==null||c.setInfo(a,{rect:l,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:l&&vt.getCenterPos(l,s)}),l;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,p,y;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.strokeType,l=i.get(e.name);var d=e;return e.tagName==="GROUP"&&(d=e.children[0]),a&&(d.setAttribute("strokeColor",a),(c=l==null?void 0:l.opt)!=null&&c.strokeColor&&(l.opt.strokeColor=a)),o&&(o==="transparent"?d.setAttribute("fillColor","rgba(0,0,0,0)"):d.setAttribute("fillColor",o),(p=l==null?void 0:l.opt)!=null&&p.fillColor&&(l.opt.fillColor=o)),s&&l!=null&&l.opt&&(y=l.opt)!=null&&y.strokeType&&(l.opt.strokeType=s),l&&i.setInfo(e.name,l),vt.updateNodeOpt(t);}}]);}(vt);var yi=/*#__PURE__*/function(_vt8){function yi(t){var _this78;_classCallCheck(this,yi);_this78=_callSuper(this,yi,[t]);rt(_this78,"canRotate",!1);rt(_this78,"scaleType",jt.all);rt(_this78,"toolsType",ut.Star);rt(_this78,"tmpPoints",[]);rt(_this78,"workOptions");rt(_this78,"oldRect");rt(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(yi,_vt8);return _createClass(yi,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,l=s==null?void 0:s.length;if(!l||l<2)return{type:lt.None};var d;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],d=!1):d=this.updateTempPoints(s),!d)return{type:lt.None};var c;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({workId:o,layer:y,isDrawing:!0});}if(!i){var _y10=Date.now();return _y10-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y10,_objectSpread({type:lt.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:lt.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:lt.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:lt.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=Zt(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&vt.getCenterPos(n,e)}),_objectSpread({rect:n,type:lt.FullWork,dataType:Mt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{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,l=_this$workOptions9.zIndex,d=_this$workOptions9.vertices,c=_this$workOptions9.innerVerticeStep,p=_this$workOptions9.innerRatio,y=_this$workOptions9.scale,P=_this$workOptions9.rotate,T=_this$workOptions9.translate,v=_this$workOptions9.strokeType,x=_this$workOptions9.eraserlines,f=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(s,d,c,p),g=_this$computDrawPoint5.rect,u=_this$computDrawPoint5.pos,m=_this$computDrawPoint5.points,M={close:!0,points:m,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:v===Lt.Dotted?[1,s*2]:v===Lt.LongDotted?[s,s*2]:void 0},E={name:e,id:e,zIndex:l,pos:u,anchor:[0.5,0.5],size:[g.w,g.h]};y&&(E.scale=y),P&&(E.rotate=P),T&&(E.translate=T);var R=new kt(E);if(i){var L=new ce({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/f[0],1/f[1]]});R.append(L);}var b=new le(_objectSpread(_objectSpread({},M),{},{pos:[0,0]}));R.append(b),x&&this.drawEraserlines({group:R,eraserlines:x,pos:u,layer:n}),this.replace(n,e,R);var O=R.getBoundingClientRect();return{x:Math.floor(O.x-vt.SafeBorderPadding),y:Math.floor(O.y-vt.SafeBorderPadding),w:Math.floor(O.width+vt.SafeBorderPadding*2),h:Math.floor(O.height+vt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e,n,i){var a=Bt(this.tmpPoints),o=[Math.floor(a.x+a.w/2),Math.floor(a.y+a.h/2)],s=Ei(a.w,a.h),l=Math.floor(Math.min(a.w,a.h)/2),d=i*l,c=[],p=2*Math.PI/e;for(var P=0;P<e;P++){var T=P*p-0.5*Math.PI;var v=void 0,_x56=void 0;P%n===1?(v=d*s[0]*Math.cos(T),_x56=d*s[1]*Math.sin(T)):(v=l*s[0]*Math.cos(T),_x56=l*s[1]*Math.sin(T),c.push(v,_x56)),c.push(v,_x56);}return{rect:Bt(this.tmpPoints,t),pos:o,points:c};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,l;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 d=0;d<e.length;d+=3)this.tmpPoints.push(new xt(e[d],e[d+1],e[d+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(l=this.vNodes)==null||l.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&vt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var v;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,l=n.vertices,d=n.innerVerticeStep,c=n.innerRatio,p=n.strokeType,y=i.get(e.name),P=y==null?void 0:y.opt;var T=e;return e.tagName==="GROUP"&&(T=e.children[0]),a&&(T.setAttribute("strokeColor",a),P!=null&&P.strokeColor&&(P.strokeColor=a)),o&&(o==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",o),P!=null&&P.fillColor&&(P.fillColor=o)),s===ut.Star&&(l&&(P.vertices=l),d&&(P.innerVerticeStep=d),c&&(P.innerRatio=c)),p&&y!=null&&y.opt&&(v=y.opt)!=null&&v.strokeType&&(y.opt.strokeType=p),y&&i.setInfo(e.name,_objectSpread(_objectSpread({},y),{},{opt:P})),vt.updateNodeOpt(t);}}]);}(vt);var Si=/*#__PURE__*/function(_vt9){function Si(t){var _this79;_classCallCheck(this,Si);_this79=_callSuper(this,Si,[t]);rt(_this79,"canRotate",!1);rt(_this79,"scaleType",jt.all);rt(_this79,"toolsType",ut.Polygon);rt(_this79,"tmpPoints",[]);rt(_this79,"workOptions");rt(_this79,"oldRect");rt(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(Si,_vt9);return _createClass(Si,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=e.op,s=this.workId,l=o==null?void 0:o.length;if(!l||l<2)return{type:lt.None};var d;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(o[0],o[1])],d=!1):d=this.updateTempPoints(o),!d)return{type:lt.None};var c;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({workId:s,layer:y,isDrawing:!0});}if(!i){var _y11=Date.now();return _y11-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y11,_objectSpread({type:lt.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:lt.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:lt.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:lt.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=Zt(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&vt.getCenterPos(n,e)}),_objectSpread({rect:n,type:lt.FullWork,dataType:Mt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{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,l=_this$workOptions10.zIndex,d=_this$workOptions10.vertices,c=_this$workOptions10.scale,p=_this$workOptions10.rotate,y=_this$workOptions10.translate,P=_this$workOptions10.strokeType,T=_this$workOptions10.eraserlines,v=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(s,d),x=_this$computDrawPoint6.rect,f=_this$computDrawPoint6.pos,g=_this$computDrawPoint6.points,u={close:!0,points:g,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:P===Lt.Dotted?[1,s*2]:P===Lt.LongDotted?[s,s*2]:void 0},m={name:e,id:e,zIndex:l,pos:f,anchor:[0.5,0.5],size:[x.w,x.h]};c&&(m.scale=c),p&&(m.rotate=p),y&&(m.translate=y);var M=new kt(m);if(i){var b=new ce({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/v[0],1/v[1]]});M.append(b);}var E=new le(_objectSpread(_objectSpread({},u),{},{pos:[0,0]}));M.append(E),T&&this.drawEraserlines({group:M,eraserlines:T,pos:f,layer:n}),this.replace(n,e,M);var R=M.getBoundingClientRect();return{x:Math.floor(R.x-vt.SafeBorderPadding),y:Math.floor(R.y-vt.SafeBorderPadding),w:Math.floor(R.width+vt.SafeBorderPadding*2),h:Math.floor(R.height+vt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Bt(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],a=Ei(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),s=[],l=2*Math.PI/e;for(var c=0;c<e;c++){var p=c*l-0.5*Math.PI,y=o*a[0]*Math.cos(p),P=o*a[1]*Math.sin(p);s.push(y,P);}return{rect:Bt(this.tmpPoints,t),pos:i,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,l;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 d=0;d<e.length;d+=3)this.tmpPoints.push(new xt(e[d],e[d+1],e[d+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(l=this.vNodes)==null||l.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&vt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var P;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,l=n.vertices,d=n.strokeType,c=i.get(e.name),p=c==null?void 0:c.opt;var y=e;return e.tagName==="GROUP"&&(y=e.children[0]),a&&(y.setAttribute("strokeColor",a),p!=null&&p.strokeColor&&(p.strokeColor=a)),o&&(o==="transparent"?y.setAttribute("fillColor","rgba(0,0,0,0)"):y.setAttribute("fillColor",o),p!=null&&p.fillColor&&(p.fillColor=o)),s===ut.Polygon&&l&&(p.vertices=l),d&&c!=null&&c.opt&&(P=c.opt)!=null&&P.strokeType&&(c.opt.strokeType=d),c&&i.setInfo(e.name,_objectSpread(_objectSpread({},c),{},{opt:p})),vt.updateNodeOpt(t);}}]);}(vt);var qt=/*#__PURE__*/function(){function qt(){_classCallCheck(this,qt);}return _createClass(qt,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(qt.getBezierPoints(r,i,a,o,s))):i&&a&&o?e.push.apply(e,_toConsumableArray(qt.getBezierPoints(r,i,a,o))):i&&a?e.push.apply(e,_toConsumableArray(qt.getBezierPoints(r,i,a))):i&&e.push(i);}return e;}/**
|
|
409
|
+
* @desc 获取点,这里可以设置点的个数
|
|
410
|
+
* @param {number} num 点个数
|
|
411
|
+
* @param {Vec2d} p1 点坐标
|
|
412
|
+
* @param {Vec2d} p2 点坐标
|
|
413
|
+
* @param {Vec2d} p3 点坐标
|
|
414
|
+
* @param {Vec2d} p4 点坐标
|
|
415
|
+
* 如果参数是 num, p1, p2 为一阶贝塞尔
|
|
416
|
+
* 如果参数是 num, p1, c1, p2 为二阶贝塞尔
|
|
417
|
+
* 如果参数是 num, p1, c1, c2, p2 为三阶贝塞尔
|
|
418
|
+
*/},{key:"getBezierPoints",value:function getBezierPoints(){var 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=qt.oneBezier:n&&!i?a=qt.twoBezier:n&&i&&(a=qt.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;}/**
|
|
419
|
+
* @desc 一阶贝塞尔
|
|
420
|
+
* @param {number} t 当前百分比
|
|
421
|
+
* @param {Vec2d} p1 起点坐标
|
|
422
|
+
* @param {Vec2d} p2 终点坐标
|
|
423
|
+
*/},{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);}/**
|
|
424
|
+
* @desc 二阶贝塞尔
|
|
425
|
+
* @param {number} t 当前百分比
|
|
426
|
+
* @param {Array} p1 起点坐标
|
|
427
|
+
* @param {Array} p2 终点坐标
|
|
428
|
+
* @param {Array} cp 控制点
|
|
429
|
+
*/},{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);}/**
|
|
430
|
+
* @desc 三阶贝塞尔
|
|
431
|
+
* @param {number} t 当前百分比
|
|
432
|
+
* @param {Array} p1 起点坐标
|
|
433
|
+
* @param {Array} p2 终点坐标
|
|
434
|
+
* @param {Array} cp1 控制点1
|
|
435
|
+
* @param {Array} cp2 控制点2
|
|
436
|
+
*/},{key:"threeBezier",value:function threeBezier(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 xi=/*#__PURE__*/function(_vt10){function xi(t){var _this80;_classCallCheck(this,xi);_this80=_callSuper(this,xi,[t]);rt(_this80,"canRotate",!1);rt(_this80,"scaleType",jt.all);rt(_this80,"toolsType",ut.SpeechBalloon);rt(_this80,"ratio",0.8);rt(_this80,"tmpPoints",[]);rt(_this80,"workOptions");rt(_this80,"oldRect");rt(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(xi,_vt10);return _createClass(xi,[{key:"consume",value:function consume(t){var y;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(y=e==null?void 0:e.workId)==null?void 0:y.toString();if(!o)return{type:lt.None};var s=e.op,l=s==null?void 0:s.length;if(!l||l<2)return{type:lt.None};var d;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],d=!1):d=this.updateTempPoints(s),!d)return{type:lt.None};var c;if(i||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({workId:o,layer:P,isDrawing:!0});}if(!i){var _P3=Date.now();return _P3-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P3,_objectSpread({type:lt.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(T){return[].concat(_toConsumableArray(T.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:lt.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:lt.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:lt.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=Zt(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&vt.getCenterPos(n,e)}),_objectSpread({rect:n,type:lt.FullWork,dataType:Mt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{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,l=_this$workOptions11.placement,d=_this$workOptions11.scale,c=_this$workOptions11.rotate,p=_this$workOptions11.translate,y=_this$workOptions11.strokeType,P=_this$workOptions11.eraserlines,_this$computDrawPoint7=this.computDrawPoints(o,l),T=_this$computDrawPoint7.rect,v=_this$computDrawPoint7.pos,x=_this$computDrawPoint7.points,f={points:x.map(function(E){return E.XY;}),lineWidth:o,fillColor:a!=="transparent"&&a||void 0,strokeColor:i,normalize:!0,className:"".concat(v[0],",").concat(v[1]),close:!0,lineJoin:"round",lineCap:"round",lineDash:y===Lt.Dotted?[1,o*2]:y===Lt.LongDotted?[o,o*2]:void 0},g={name:e,id:e,zIndex:s,pos:v,anchor:[0.5,0.5],size:[T.w,T.h]};d&&(g.scale=d),c&&(g.rotate=c),p&&(g.translate=p);var u=new kt(g),m=new le(_objectSpread(_objectSpread({},f),{},{pos:[0,0]}));u.append(m),P&&this.drawEraserlines({group:u,eraserlines:P,pos:v,layer:n}),this.replace(n,e,u);var M=u.getBoundingClientRect();return{x:Math.floor(M.x-vt.SafeBorderPadding),y:Math.floor(M.y-vt.SafeBorderPadding),w:Math.floor(M.width+vt.SafeBorderPadding*2),h:Math.floor(M.height+vt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var e=Bt(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=Bt(this.tmpPoints),i=this.transformControlPoints(e),a=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),s=[],l=_.Add(i[0],new _(0,o,0)),d=_.Add(i[0],new _(a,0,0)),c=qt.getBezierPoints(10,l,i[0],d),p=_.Sub(i[1],new _(a,0,0)),y=_.Add(i[1],new _(0,o,0)),P=qt.getBezierPoints(10,p,i[1],y),T=_.Sub(i[2],new _(0,o,0)),v=_.Sub(i[2],new _(a,0,0)),x=qt.getBezierPoints(10,T,i[2],v),f=_.Add(i[3],new _(a,0,0)),g=_.Sub(i[3],new _(0,o,0)),u=qt.getBezierPoints(10,f,i[3],g),m=a*(1-this.ratio)*10,M=o*(1-this.ratio)*10;switch(e){case"bottom":{var b=_.Sub(i[2],new _(a*5-m/2,0,0)),O=_.Sub(i[2],new _(a*5,-M,0)),L=_.Sub(i[2],new _(a*5+m/2,0,0));s.push.apply(s,[O,L].concat(_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(x),[b]));break;}case"bottomRight":{var _b11=_.Sub(i[2],new _(a*1.1,0,0)),_O11=_.Sub(i[2],new _(a*1.1+m/2,-M,0)),_L8=_.Sub(i[2],new _(a*1.1+m,0,0));s.push.apply(s,[_O11,_L8].concat(_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(x),[_b11]));break;}case"bottomLeft":{var _b12=_.Add(i[3],new _(a*1.1+m,0,0)),_O12=_.Add(i[3],new _(a*1.1+m/2,M,0)),_L9=_.Add(i[3],new _(a*1.1,0,0));s.push.apply(s,[_O12,_L9].concat(_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(x),[_b12]));break;}case"top":{var _b13=_.Sub(i[1],new _(a*5-m/2,0,0)),_O13=_.Sub(i[1],new _(a*5,M,0)),_L10=_.Sub(i[1],new _(a*5+m/2,0,0));s.push.apply(s,[_O13,_b13].concat(_toConsumableArray(P),_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(c),[_L10]));break;}case"topRight":{var _b14=_.Sub(i[1],new _(a*1.1,0,0)),_O14=_.Sub(i[1],new _(a*1.1+m/2,M,0)),_L11=_.Sub(i[1],new _(a*1.1+m,0,0));s.push.apply(s,[_O14,_b14].concat(_toConsumableArray(P),_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(c),[_L11]));break;}case"topLeft":{var _b15=_.Add(i[0],new _(a*1.1+m,0,0)),_O15=_.Add(i[0],new _(a*1.1+m/2,-M,0)),_L12=_.Add(i[0],new _(a*1.1,0,0));s.push.apply(s,[_O15,_b15].concat(_toConsumableArray(P),_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(c),[_L12]));break;}case"left":{var _b16=_.Add(i[0],new _(0,o*5-M/2,0)),_O16=_.Add(i[0],new _(-m,o*5,0)),_L13=_.Add(i[0],new _(0,o*5+M/2,0));s.push.apply(s,[_O16,_b16].concat(_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(x),_toConsumableArray(u),[_L13]));break;}case"leftTop":{var _b17=_.Add(i[0],new _(0,o*1.1,0)),_O17=_.Add(i[0],new _(-m,o*1.1+M/2,0)),_L14=_.Add(i[0],new _(0,o*1.1+M,0));s.push.apply(s,[_O17,_b17].concat(_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(x),_toConsumableArray(u),[_L14]));break;}case"leftBottom":{var _b18=_.Sub(i[3],new _(0,o*1.1+M,0)),_O18=_.Sub(i[3],new _(m,o*1.1+M/2,0)),_L15=_.Sub(i[3],new _(0,o*1.1,0));s.push.apply(s,[_O18,_b18].concat(_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(x),_toConsumableArray(u),[_L15]));break;}case"right":{var _b19=_.Add(i[1],new _(0,o*5-M/2,0)),_O19=_.Add(i[1],new _(m,o*5,0)),_L16=_.Add(i[1],new _(0,o*5+M/2,0));s.push.apply(s,[_O19,_L16].concat(_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),[_b19]));break;}case"rightTop":{var _b20=_.Add(i[1],new _(0,o*1.1,0)),_O20=_.Add(i[1],new _(m,o*1.1+M/2,0)),_L17=_.Add(i[1],new _(0,o*1.1+M,0));s.push.apply(s,[_O20,_L17].concat(_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),[_b20]));break;}case"rightBottom":{var _b21=_.Sub(i[2],new _(0,o*1.1+M,0)),_O21=_.Sub(i[2],new _(-m,o*1.1+M/2,0)),_L18=_.Sub(i[2],new _(0,o*1.1,0));s.push.apply(s,[_O21,_L18].concat(_toConsumableArray(x),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),[_b21]));break;}}var E=Bt(this.tmpPoints,t),R=[Math.floor(E.x+E.w/2),Math.floor(E.y+E.h/2)];return{rect:E,pos:R,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,l;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 d=0;d<e.length;d+=3)this.tmpPoints.push(new xt(e[d],e[d+1],e[d+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(l=this.vNodes)==null||l.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&vt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var P;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,l=n.placement,d=n.strokeType,c=i.get(e.name),p=c==null?void 0:c.opt;var y=e;return e.tagName==="GROUP"&&(y=e.children[0]),a&&(y.setAttribute("strokeColor",a),p!=null&&p.strokeColor&&(p.strokeColor=a)),o&&(o==="transparent"?y.setAttribute("fillColor","rgba(0,0,0,0)"):y.setAttribute("fillColor",o),p!=null&&p.fillColor&&(p.fillColor=o)),s===ut.SpeechBalloon&&l&&(p.placement=l),d&&c!=null&&c.opt&&(P=c.opt)!=null&&P.strokeType&&(c.opt.strokeType=d),c&&i.setInfo(e.name,_objectSpread(_objectSpread({},c),{},{opt:p})),vt.updateNodeOpt(t);}}]);}(vt);var Wg=ge,Bg=ne,Fg="[object Boolean]";function Ug(h){return h===!0||h===!1||Bg(h)&&Wg(h)==Fg;}var jg=Ug,xe=/* @__PURE__ */de(jg);var Be=/*#__PURE__*/function(_vt11){function Be(t){var _this81;_classCallCheck(this,Be);_this81=_callSuper(this,Be,[t]);rt(_this81,"canRotate",!0);rt(_this81,"scaleType",jt.all);rt(_this81,"toolsType",ut.Image);rt(_this81,"tmpPoints",[]);rt(_this81,"workOptions");rt(_this81,"oldRect");_this81.workOptions=t.toolsOpt,_this81.scaleType=Be.getScaleType(_this81.workOptions);return _this81;}_inherits(Be,_vt11);return _createClass(Be,[{key:"consume",value:function consume(){return{type:lt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:lt.None};}},{key:"draw",value:function draw(t){var e=t.layer,n=t.workId,i=t.replaceId,a=t.imageBitmap,_this$workOptions12=this.workOptions,o=_this$workOptions12.centerX,s=_this$workOptions12.centerY,l=_this$workOptions12.width,d=_this$workOptions12.height,c=_this$workOptions12.rotate,p=_this$workOptions12.zIndex,y=_this$workOptions12.eraserlines,P=new kt({anchor:[0.5,0.5],pos:[o,s],name:n,size:[l,d],zIndex:p,rotate:c}),T={anchor:[0.5,0.5],pos:[0,0],size:[l,d],texture:a};a||(T.bgcolor="rgba(0,0,0,0.3)");var v=new _i(T);P.append(v),y&&this.drawEraserlines({group:P,eraserlines:y,pos:[o,s],layer:e}),this.replace(e,i||n,P);var x=P.getBoundingClientRect();if(x)return{x:Math.floor(x.x-vt.SafeBorderPadding),y:Math.floor(x.y-vt.SafeBorderPadding),w:Math.floor(x.width+vt.SafeBorderPadding*2),h:Math.floor(x.height+vt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var d,c,p,y,e,n,i,_this$workOptions13,a,o,s,l,P,T,v;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:e=t.isFullWork,n=t.replaceId,i=t.worker,_this$workOptions13=this.workOptions,a=_this$workOptions13.src,o=_this$workOptions13.uuid,s=((d=this.workId)==null?void 0:d.toString())||o,l=e?this.fullLayer:this.drawLayer||this.fullLayer;if(!a){_context25.next=15;break;}P=!!l.parent.gl;_context25.t0=i;if(!_context25.t0){_context25.next=8;break;}_context25.next=7;return i.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:s});case 7:T=_context25.sent;case 8:_context25.t1=T;if(_context25.t1){_context25.next=13;break;}_context25.next=12;return fetch(a,{method:"GET",mode:"cors",cache:"default"}).then(function(x){return x.blob();}).then(function(x){return createImageBitmap(x,{imageOrientation:P?"flipY":"none"}).then(function(f){return f;});})["catch"](function(x){console.error("load image error: ".concat(x));});case 12:T=_context25.sent;case 13:v=this.draw({workId:s,layer:l,replaceId:n,imageBitmap:T});return _context25.abrupt("return",(this.oldRect=s&&((p=(c=this.vNodes)==null?void 0:c.get(s))==null?void 0:p.rect)||void 0,(y=this.vNodes)==null||y.setInfo(s,{rect:v,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&vt.getCenterPos(v,l)}),v));case 15:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x57){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?jt.proportional:jt.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.originPoint,l=n.scenePoint,d=n.scale,c=n.angle,p=n.isLocked,y=n.zIndex,P=a&&Xt(a)||i.get(e.name);if(!P)return;var T=e.parent;if(T){if(_t(y)&&(e.setAttribute("zIndex",y),P.opt.zIndex=y),xe(p)&&(P.opt.locked=p),s&&l&&d&&o){var _P$opt=P.opt,v=_P$opt.centerX,_x58=_P$opt.centerY,_f29=_P$opt.width,g=_P$opt.height,u=_P$opt.uniformScale,m=u!==!1?[d[0],d[0]]:d,M=[v,_x58],E=[v,_x58];Ur(E,l,m,o);var R=[E[0]-M[0],E[1]-M[1]];if(P.centerPos=[P.centerPos[0]+R[0],P.centerPos[1]+R[1]],P.opt.width=Math.round(_f29*m[0]),P.opt.height=Math.round(g*m[1]),P.opt.centerX=E[0],P.opt.centerY=E[1],P.opt.eraserlines)for(var _i5=0,_Object$values4=Object.values(P.opt.eraserlines);_i5<_Object$values4.length;_i5++){var b=_Object$values4[_i5];var O=b.op,L=b.thickness;b.thickness=L*Math.max(d[0],d[1]);for(var w=0;w<O.length;w++)jr(O[w],l,d,o);}}else if(o){if(P.opt.centerX=P.opt.centerX+o[0],P.opt.centerY=P.opt.centerY+o[1],P.centerPos=[P.centerPos[0]+o[0],P.centerPos[1]+o[1]],P.opt.eraserlines)for(var _i6=0,_Object$values5=Object.values(P.opt.eraserlines);_i6<_Object$values5.length;_i6++){var _v8=_Object$values5[_i6];var _x59=_v8.op;for(var _f30=0;_f30<_x59.length;_f30++){var _g12=_x59[_f30].map(function(u,m){return m%2?u+o[1]:u+o[0];});_v8.op[_f30]=_g12;}}}else if(_t(c))if(P.opt.rotate=c,P.scaleType=Be.getScaleType(P.opt),a){var _v9=Oi(P.rect,c);P.rect=_v9;}else{var _v10=vt.getRectFromLayer(T,e.name);P.rect=_v10||P.rect;}return P&&i.setInfo(e.name,P),P==null?void 0:P.rect;}}}]);}(vt);var Ti=/*#__PURE__*/function(_vt12){function Ti(t){var _this82;_classCallCheck(this,Ti);_this82=_callSuper(this,Ti,[t]);rt(_this82,"canRotate",!1);rt(_this82,"scaleType",jt.both);rt(_this82,"toolsType",ut.Straight);rt(_this82,"tmpPoints",[]);rt(_this82,"workOptions");rt(_this82,"oldRect");rt(_this82,"straightTipWidth");rt(_this82,"syncTimestamp");_this82.workOptions=t.toolsOpt,_this82.straightTipWidth=_this82.workOptions.thickness/2,_this82.syncTimestamp=0,_this82.syncUnitTime=50;return _this82;}_inherits(Ti,_vt12);return _createClass(Ti,[{key:"consume",value:function consume(t){var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=this.workId,s=e.op,l=s==null?void 0:s.length;if(!l||l<2)return{type:lt.None};var d;if(this.tmpPoints.length===0?(this.tmpPoints=[new xt(s[0],s[1])],d=!1):d=this.updateTempPoints(s),!d)return{type:lt.None};var c;if(i||a){var y=n?this.fullLayer:this.drawLayer||this.fullLayer;c=this.draw({workId:o,layer:y});}if(!i){var _y12=Date.now();return _y12-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_y12,_objectSpread({type:lt.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:lt.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:lt.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:lt.RemoveNode,removeIds:[t]};var e=this.fullLayer,n=this.draw({workId:t,layer:e});this.oldRect=n;var i=this.tmpPoints.map(function(s){return[].concat(_toConsumableArray(s.XY),[0]);}).flat(1),a=Zt(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&vt.getCenterPos(n,e)}),_objectSpread({rect:n,type:lt.FullWork,dataType:Mt.Local,ops:a,isSync:!0},this.baseConsumeResult);}},{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,l=_this$workOptions14.rotate,d=_this$workOptions14.translate,c=_this$workOptions14.strokeType,p=_this$workOptions14.eraserlines,y=n.worldPosition,P=n.worldScaling,_this$computDrawPoint8=this.computDrawPoints(a,c),T=_this$computDrawPoint8.d,v=_this$computDrawPoint8.rect,x=_this$computDrawPoint8.isDot,f=[v.x+v.w/2,v.y+v.h/2],g=new kt({pos:f,anchor:[0.5,0.5],size:[v.w,v.h],name:e,id:e,normalize:!0,zIndex:o}),u={pos:[0,0],normalize:!0,d:T,fillColor:i,strokeColor:i,lineDash:c===Lt.Dotted&&!x?[1,a*2]:c===Lt.LongDotted&&!x?[a,a*2]:void 0,lineCap:c===Lt.Normal||x?void 0:"round",lineWidth:c===Lt.Normal||x?0:a};s&&(u.scale=s),l&&(u.rotate=l),d&&(u.translate=d);var m=new ce(u);if(g.append(m),p&&this.drawEraserlines({group:g,eraserlines:p,pos:f,layer:n}),this.replace(n,e,g),l||s||d){var E=m.getBoundingClientRect();return{x:Math.floor(E.x-vt.SafeBorderPadding),y:Math.floor(E.y-vt.SafeBorderPadding),w:Math.floor(E.width+vt.SafeBorderPadding*2),h:Math.floor(E.height+vt.SafeBorderPadding*2)};}return{x:Math.floor(v.x*P[0]+y[0]-vt.SafeBorderPadding),y:Math.floor(v.y*P[1]+y[1]-vt.SafeBorderPadding),w:Math.floor(v.w*P[0]+2*vt.SafeBorderPadding),h:Math.floor(v.h*P[1]+2*vt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t,e):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t,e){var n=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),i=_.Per(n).mul(t/2),a=xt.Sub(this.tmpPoints[0],i),o=xt.Add(this.tmpPoints[0],i),s=xt.Sub(this.tmpPoints[1],i),l=xt.Add(this.tmpPoints[1],i),d=xt.GetSemicircleStroke(this.tmpPoints[1],s,-1,8),c=xt.GetSemicircleStroke(this.tmpPoints[0],o,-1,8),p=[a,s].concat(_toConsumableArray(d),[l,o],_toConsumableArray(c));var y;return e!==Lt.Normal?y=ae(this.tmpPoints,!1):y=ae(p,!0),{d:y,rect:Bt(p),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var e=xt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:ae(e,!0),rect:Bt(e),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var s,l;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 d=0;d<e.length;d+=3)this.tmpPoints.push(new xt(e[d],e[d+1],e[d+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(l=this.vNodes)==null||l.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&vt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var l,d;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.strokeType,s=i.get(e.name);return a&&(e.tagName==="GROUP"?e.children.forEach(function(c){c.setAttribute("strokeColor",a),c.getAttribute("fillColor")&&c.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(l=s==null?void 0:s.opt)!=null&&l.strokeColor&&(s.opt.strokeColor=a)),o&&s!=null&&s.opt&&(d=s.opt)!=null&&d.strokeType&&(s.opt.strokeType=o),s&&i.setInfo(e.name,s),vt.updateNodeOpt(t);}}]);}(vt);var ie=/*#__PURE__*/function(_vt13){function ie(t){var _this83;_classCallCheck(this,ie);_this83=_callSuper(this,ie,[t]);rt(_this83,"canRotate",!1);rt(_this83,"scaleType",jt.proportional);rt(_this83,"toolsType",ut.Text);rt(_this83,"tmpPoints",[]);rt(_this83,"workOptions");rt(_this83,"oldRect");_this83.workOptions=t.toolsOpt;return _this83;}_inherits(ie,_vt13);return _createClass(ie,[{key:"consume",value:function consume(){return{type:lt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:lt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var e,n,i,_this$workOptions15,a,o,s,l,d,c,p,y,P,T,v,_x61,_f31;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.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,l=_this$workOptions15.eraserlines,d=n.worldPosition,c=n.worldScaling;if(!(!o||!a)){_context26.next=3;break;}return _context26.abrupt("return");case 3:p={name:e,id:e,pos:[o[0],o[1]],anchor:[0,0],size:a,zIndex:s},y=new kt(p),P={x:o[0],y:o[1],w:a[0],h:a[1]},T={x:Math.floor(P.x*c[0]+d[0]),y:Math.floor(P.y*c[1]+d[1]),w:Math.floor(P.w*c[0])+2,h:Math.floor(P.h*c[1])+2};if(!(this.replace(n,e,y),i&&n&&this.workOptions.text)){_context26.next=11;break;}_context26.next=7;return ie.createLabels(this.workOptions,n,T);case 7:v=_context26.sent;_x61=v.labels;_f31=v.maxWidth;y.append.apply(y,_toConsumableArray(_x61)),T.w=Math.ceil(Math.max(_f31*n.worldScaling[0],T.w));case 11:return _context26.abrupt("return",(l&&this.drawEraserlines({group:y,eraserlines:l,pos:[o[0],o[1]],layer:n}),T));case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x60){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var l,d,c,p,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:e=(l=this.workId)==null?void 0:l.toString();if(e){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,i=t.replaceId,a=t.isDrawLabel;this.oldRect=i&&((c=(d=this.vNodes)==null?void 0:d.get(i))==null?void 0:c.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:e,layer:o,isDrawLabel:_typeof(a)>"u"&&this.workOptions.workState===Rt.Done||a});case 8:s=_context27.sent;return _context27.abrupt("return",((p=this.vNodes)==null||p.setInfo(e,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&vt.getCenterPos(s,o)}),s));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x62){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(t,e){var P,T,n,i,a,o,s,l,d,c,p,y;return _regeneratorRuntime().wrap(function _callee26$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:if(this.workId){_context28.next=2;break;}return _context28.abrupt("return");case 2:n=this.workId.toString(),i=t.fontColor,a=t.fontBgColor,o=t.bold,s=t.italic,l=t.lineThrough,d=t.underline,c=t.zIndex,p=(P=this.vNodes)==null?void 0:P.get(n);if(p){_context28.next=5;break;}return _context28.abrupt("return");case 5:i&&(p.opt.fontColor=i),a&&(p.opt.fontBgColor=a),o&&(p.opt.bold=o),s&&(p.opt.italic=s),xe(l)&&(p.opt.lineThrough=l),xe(d)&&(p.opt.underline=d),_t(c)&&(p.opt.zIndex=c),this.oldRect=p.rect;_context28.next=8;return this.draw({workId:n,layer:this.fullLayer,isDrawLabel:_typeof(e)>"u"&&this.workOptions.workState===Rt.Done||e});case 8:y=_context28.sent;return _context28.abrupt("return",((T=this.vNodes)==null||T.setInfo(n,{rect:y,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:y&&vt.getCenterPos(y,this.fullLayer)}),y));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x63,_x64){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(t){var e=(t==null?void 0:t.parent).displayRatio||1,n=Math.ceil(t.worldScaling[0]*10)/10;var i=n;return n>=0.2&&n<1?i=n*e:n<=2&&n>=1?i=n*e*1.6:n>2&&n<=3?i=n*e*1.4:n>3&&n<=4?i=n*e*0.8:n>4&&(i=n*e*0.6),Math.floor(i*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(ie.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,e,n){var L,i,a,o,_ref167,s,l,d,c,p,y,P,T,v,x,f,g,u,m,M,E,R,b,O,w,I,A,W,z,K,k,q,U,G,Z,et,tt,J,ht,dt,B,F,Y,X,nt,_J2,_ht,_dt,_J3,_ht2,_et3,_tt2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:i=[],a=n.x,o=n.y,_ref167=(L=e.parent)==null?void 0:L.parent,s=_ref167.width,l=_ref167.height,d=Oe(t.text),c=d.length,p=t.fontSize,y=t.lineHeight,P=t.bold,T=t.textAlign,v=t.italic,x=t.fontFamily,f=t.verticalAlign,g=t.fontColor,u=t.fontBgColor,m=t.underline,M=t.lineThrough,E=ie.getSafetySnippetRatio(e)||1,R=Math.floor(p*E),b=ie.getSafetySnippetFontLength(R);O=0;w=0;case 3:if(!(w<c)){_context29.next=33;break;}I=d[w],A=y||R*1.5;if(!I){_context29.next=30;break;}W=Qg(I),z=[0,0],K=[0,p*1.2];f==="middle"&&(z[1]=w*p*1.2+5);k=[0,-p*0.15];z[0]=5;q=Math.sin(Math.PI/180*20);U=0;G=[];Z=0;case 14:if(!(Z<W)){_context29.next=27;break;}T==="left"&&(k[0]=U),Z===0&&v==="italic"&&(k[0]=k[0]-q/2*p);et=I.slice(Z,Z+b);tt={anchor:[0,0],pos:k,text:et,fontFamily:x,fontSize:R,lineHeight:A,strokeColor:g,fontWeight:P,fillColor:g,textAlign:T,fontStyle:v,scale:[1/E,1/E]};J=new Zi(tt);_context29.next=21;return J.textImageReady;case 21:ht=_context29.sent;dt=!0;if(ht){B=ht.rect&&ht.rect[2],F=ht.rect&&ht.rect[3];if(B&&F){Y=B/E,X=F/E;U=Y+U,v==="italic"&&(P==="bold"?U=U-q*p*1.2:U=U-q*p),((k[0]+z[0]+Y)*e.worldScaling[0]+a<=0||(k[0]+z[0])*e.worldScaling[0]+a>=s||(k[1]+z[1]+X)*e.worldScaling[1]+o<=0||(k[1]+z[1])*e.worldScaling[1]+o>=l)&&(J.disconnect(),dt=!1),dt&&G.push(J);}}Z+=b;case 25:_context29.next=14;break;case 27:K[0]=U,v==="italic"&&(K[0]=K[0]+q*p),O=Math.max(O,K[0]);nt=!0;if(((z[0]+K[0])*e.worldScaling[0]+a<=0||z[0]*e.worldScaling[0]+a>=s||(z[1]+K[1])*e.worldScaling[0]+o<=0||z[1]*e.worldScaling[1]+o>=l)&&(nt=!1),nt){if(m){_J2=Math.floor(p/10),_ht={normalize:!1,pos:[0,p*1.1+_J2/2],lineWidth:_J2,points:[0,0,Math.ceil(K[0]),0],strokeColor:g,className:"underline"},_dt=new le(_ht);G.push(_dt);}if(M){_J3={normalize:!1,pos:[0,p*1.2/2],lineWidth:Math.floor(p/10),points:[0,0,Math.ceil(K[0]),0],strokeColor:g,className:"lineThrough"},_ht2=new le(_J3);G.push(_ht2);}_et3={pos:z,anchor:[0,0],size:K,bgcolor:u},_tt2=new kt(_et3);_tt2.append.apply(_tt2,G),i.push(_tt2);}case 30:w++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:i,maxWidth:O});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x65,_x66,_x67){return _createLabels.apply(this,arguments);}return createLabels;}()},{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,l=n.translate,d=n.originPoint,c=n.scenePoint,p=n.scale,y=n.bold,P=n.italic,T=n.lineThrough,v=n.underline,x=n.fontSize,f=n.textInfos,g=n.zIndex,u=a&&Xt(a)||i.get(e.name);if(!u||!e.parent)return;var M=u.opt;if(_t(g)&&(e.setAttribute("zIndex",g),u.opt.zIndex=g),s&&M.fontColor&&(M.fontColor=s,e.children.forEach(function(E){E.tagName==="GROUP"&&E.children.forEach(function(R){R.tagName==="LABEL"?(R.setAttribute("fillColor",s),R.setAttribute("strokeColor",s)):R.tagName==="POLYLINE"&&R.setAttribute("strokeColor",s);});})),o&&M.fontBgColor&&(M.fontBgColor=o,e.children.forEach(function(E){E.tagName==="GROUP"&&E.setAttribute("bgcolor",o);})),y&&(M.bold=y),P&&(M.italic=P),xe(T)&&(M.lineThrough=T),xe(v)&&(M.underline=v),x&&(M.fontSize=x),d&&c&&p&&a&&M.boxPoint){var E=f==null?void 0:f.get(e.name);if(E){var L=E.fontSize,w=E.boxSize;M.boxSize=w||M.boxSize,M.fontSize=L||M.fontSize;}var R=[M.boxPoint[0],M.boxPoint[1]];Ur(M.boxPoint,c,p,l);var b=[u.op[0],u.op[1]],O=[b[0]-R[0],b[1]-R[1]];if(u.centerPos=[u.centerPos[0]+O[0],u.centerPos[1]+O[1]],u.opt.eraserlines)for(var _i7=0,_Object$values6=Object.values(u.opt.eraserlines);_i7<_Object$values6.length;_i7++){var _L19=_Object$values6[_i7];var _w9=_L19.op,I=_L19.thickness;_L19.thickness=I*Math.max(p[0],p[1]);for(var A=0;A<_w9.length;A++)jr(_w9[A],c,p,l);}}else if(l&&M.boxPoint&&(M.boxPoint=[M.boxPoint[0]+l[0],M.boxPoint[1]+l[1]],u.centerPos=[u.centerPos[0]+l[0],u.centerPos[1]+l[1]],u.opt.eraserlines))for(var _i8=0,_Object$values7=Object.values(u.opt.eraserlines);_i8<_Object$values7.length;_i8++){var _E5=_Object$values7[_i8];var _R6=_E5.op;for(var _b22=0;_b22<_R6.length;_b22++){var _O22=_R6[_b22].map(function(L,w){return w%2?L+l[1]:L+l[0];});_E5.op[_b22]=_O22;}}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();var a={x:Math.floor(i.x),y:Math.floor(i.y),w:Math.floor(i.width+2),h:Math.floor(i.height+2)};return n.children.forEach(function(o){if(o.tagName==="GROUP"){var s=n.getBoundingClientRect();a=Pt(a,{x:Math.floor(s.x),y:Math.floor(s.y),w:Math.floor(s.width+2),h:Math.floor(s.height+2)});}}),a;}}}]);}(vt);// 4k
|
|
437
|
+
rt(ie,"textImageSnippetSize",1024*4),rt(ie,"SafeBorderPadding",30);var ke=ie;var Me=/*#__PURE__*/function(_vt14){function Me(t,e){var _this84;_classCallCheck(this,Me);_this84=_callSuper(this,Me,[t]);rt(_this84,"canRotate",!1);rt(_this84,"scaleType",jt.none);rt(_this84,"toolsType",ut.PencilEraser);rt(_this84,"serviceWork");rt(_this84,"tmpPoints",[]);rt(_this84,"workOptions");rt(_this84,"worldPosition");rt(_this84,"worldScaling");rt(_this84,"eraserRect");rt(_this84,"eraserPolyline");_this84.serviceWork=e,_this84.workOptions=t.toolsOpt,_this84.worldPosition=_this84.fullLayer.worldPosition,_this84.worldScaling=_this84.fullLayer.worldScaling;return _this84;}_inherits(Me,_vt14);return _createClass(Me,[{key:"consumeService",value:function consumeService(){}},{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],_Me$eraserSizes$this$=Me.eraserSizes[this.workOptions.thickness],i=_Me$eraserSizes$this$.width,a=_Me$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 _e5=new _(this.tmpPoints[0],this.tmpPoints[1]),n=new _(this.tmpPoints[2],this.tmpPoints[3]),i=_.Sub(n,_e5).uni(),a=_.Dist(_e5,n),_Me$eraserSizes$this$2=Me.eraserSizes[this.workOptions.thickness],o=_Me$eraserSizes$this$2.width,s=_Me$eraserSizes$this$2.height,l=Math.min(o,s),d=Math.round(a/l);if(d>1){var c=[];for(var p=0;p<d;p++){var y=_.Mul(i,p*l);c.push(this.tmpPoints[0]+y.x,this.tmpPoints[1]+y.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]),_Me$eraserSizes$this$3=Me.eraserSizes[this.workOptions.thickness],a=_Me$eraserSizes$this$3.width,o=_Me$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,l){var d=s;var _loop4=function _loop4(){var p=s[c],y=p.findIndex(function(P,T){return T<p.length-1?o([P,p[T+1]],[l[0],l[1]]):!1;});if(y!==-1&&y>-1){var P=[],T=p.slice(0,y+1);if(_.Equals(p[y],l[0])||T.push(l[0].clone().setz(p[y].z)),T.length>1&&P.push(T),y+l.length-1<p.length-1){var v=y+l.length-1,_x68=p.slice(v),_f32=l[l.length-1];_.Equals(p[v],_f32)||_x68.unshift(_f32.clone().setz(p[v].z)),_x68.length>1&&P.push(_x68);}return{v:(d.splice.apply(d,[c,1].concat(P)),d)};}},_ret;for(var c=0;c<s.length;c++){_ret=_loop4();if(_ret)return _ret.v;}return d;}function o(s,l){var d=_.Sub(s[1],s[0]),c=_.Sub(l[1],l[0]),p=_.Sub(l[0],s[0]);return Math.abs(_.Cpr(d,c))<0.1&&Math.abs(_.Cpr(d,p))<0.1;}}},{key:"isSamePoint",value:function isSamePoint(t,e){return t[0]===e[0]&&t[1]===e[1];}},{key:"translateIntersect",value:function translateIntersect(t){var _this85=this;var e=[];for(var n=0;n<t.length;n++){var i=t[n].filter(function(s,l,d){return!(l>0&&_this85.isSamePoint(s,d[l-1]));}),a=[];var o=0;for(;o<i.length;){var s=i[o],l=new _(s[0],s[1]);a.push(l),o++;}e.push(a);}return e;}},{key:"isLineEraser",value:function isLineEraser(t,e){return!(t===ut.Pencil&&!e);}},{key:"remove",value:function remove(t){var _this86=this;var e=t.curNodeMap,n=t.removeIds,i=t.newWorkDatas;var a;var _iterator27=_createForOfIteratorHelper(e.entries()),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var _step27$value=_slicedToArray(_step27.value,2),o=_step27$value[0],s=_step27$value[1];if(s.rect&&this.eraserRect&&this.eraserPolyline&&ue(this.eraserRect,s.rect)){var l=s.op,d=s.toolsType,c=this.isLineEraser(d,!1),p=[],y=[];for(var T=0;T<l.length;T+=3){var v=new _(l[T]*this.worldScaling[0]+this.worldPosition[0],l[T+1]*this.worldScaling[1]+this.worldPosition[1],l[T+2]);y.push(v),p.push(new xt(v.x,v.y));}var P=p.length&&Bt(p)||s.rect;if(ue(P,this.eraserRect)){if(y.length>1){var _T3=Dr.polyline(y.map(function(v){return v.XY;}),this.eraserPolyline);if(_T3.length&&(n.add(s.name),!c)){var _v11=this.translateIntersect(_T3),_x69=this.cutPolyline(_v11,y);var _loop5=function _loop5(){var g="".concat(o,"_s_").concat(_f33),u=[];_x69[_f33].forEach(function(m){u.push((m.x-_this86.worldPosition[0])/_this86.worldScaling[0],(m.y-_this86.worldPosition[1])/_this86.worldScaling[1],m.z);}),s.opt&&s.toolsType&&_this86.vNodes&&(_this86.vNodes.setInfo(g,{rect:P,op:u,opt:s.opt,canRotate:s.canRotate,scaleType:s.scaleType,toolsType:s.toolsType}),i.set(g,{workId:g,op:u,opt:s.opt,toolsType:s.toolsType}));};for(var _f33=0;_f33<_x69.length;_f33++){_loop5();}}}else n.add(s.name);a=Pt(a,P);}}}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return n.forEach(function(o){var s;return(s=_this86.vNodes)==null?void 0:s["delete"](o);}),a&&(a.x-=vt.SafeBorderPadding,a.y-=vt.SafeBorderPadding,a.w+=vt.SafeBorderPadding*2,a.h+=vt.SafeBorderPadding*2),a;}},{key:"consume",value:function consume(t){var e=t.data.op;if(!e||e.length===0)return _objectSpread({type:lt.None},this.baseConsumeResult);var n=this.tmpPoints.length;if(n>1&&this.isNear([e[0],e[1]],[this.tmpPoints[n-2],this.tmpPoints[n-1]]))return _objectSpread({type:lt.None},this.baseConsumeResult);n<3?this.tmpPoints.push(e[0],e[1]):this.tmpPoints.splice(2,2,e[0],e[1]);var i=this.computRectCenterPoints();var a;var o=/* @__PURE__ */new Set(),s=/* @__PURE__ */new Map();if(!this.vNodes)return _objectSpread({type:lt.None},this.baseConsumeResult);this.vNodes.setTarget();var l=this.getUnLockNodeMap(this.vNodes.getLastTarget());for(var d=0;d<i.length-1;d+=2){this.createEraserRect(i.slice(d,d+2));var c=this.remove({curNodeMap:l,removeIds:o,newWorkDatas:s});a=Pt(a,c);}if(this.vNodes.deleteLastTarget(),a&&o.size){var _iterator28=_createForOfIteratorHelper(s.keys()),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var _d10=_step28.value;o.has(_d10)&&s["delete"](_d10);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return{type:lt.RemoveNode,rect:a,removeIds:_toConsumableArray(o),newWorkDatas:s};}return _objectSpread({type:lt.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getUnLockNodeMap",value:function getUnLockNodeMap(t){var e;if(this.serviceWork){var n=Xt(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator29=_createForOfIteratorHelper(i.values()),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var o=_step29.value;if((e=o.selectIds)!=null&&e.length){var _iterator31=_createForOfIteratorHelper(o.selectIds),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var s=_step31.value;n["delete"](s);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}var _iterator30=_createForOfIteratorHelper(a.keys()),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _o5=_step30.value;n["delete"](_o5);}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}return n;}return t;}}]);}(vt);// 来源于white-sdk
|
|
438
|
+
rt(Me,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var Je=Me;var We=/*#__PURE__*/function(_vt15){function We(t){var _this87;_classCallCheck(this,We);_this87=_callSuper(this,We,[t]);rt(_this87,"canRotate",!1);rt(_this87,"scaleType",jt.none);rt(_this87,"toolsType",ut.BitMapEraser);rt(_this87,"tmpPoints",[]);rt(_this87,"workOptions");rt(_this87,"worldPosition");rt(_this87,"worldScaling");rt(_this87,"eraserRect");rt(_this87,"eraserPolyline");rt(_this87,"syncUnitTime",re.syncOpt.interval);rt(_this87,"syncIndex",0);rt(_this87,"syncTimestamp");_this87.workOptions=t.toolsOpt,_this87.worldPosition=_this87.fullLayer.worldPosition,_this87.worldScaling=_this87.fullLayer.worldScaling,_this87.syncTimestamp=0;return _this87;}_inherits(We,_vt15);return _createClass(We,[{key:"consumeService",value:function consumeService(t){var e=t.op,n=t.isFullWork;this.tmpPoints.length=0;for(var s=0;s<e.length;s+=3){var l=new xt(e[s],e[s+1],e[s+2]);if(this.tmpPoints.length>0){var d=this.tmpPoints[this.tmpPoints.length-1],c=_.Sub(l,d).uni();l.setv(c);}this.tmpPoints.push(l);}if(this.tmpPoints.length<2)return;var i=this.tmpPoints[0].z*2,a=n?this.fullLayer:this.drawLayer||this.fullLayer;return this.draw({consumePoints:this.tmpPoints,layer:a,thickness:i});}},{key:"updateTempPoints",value:function updateTempPoints(t,e){var n=this.tmpPoints.length-1;var i=Date.now();for(var a=0;a<t.length;a+=2){var o=this.tmpPoints.length,s=new xt(t[a],t[a+1]);if(o===0){this.tmpPoints.push(s);continue;}var l=o-1,d=this.tmpPoints[l],c=_.Sub(s,d).uni();s.isNear(d,e/2)||(_.Equals(c,d.v,0.02)&&(this.tmpPoints.pop(),n--),s.setv(c),s.setT(i),this.tmpPoints.push(s));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t){if(!this.vNodes)return;var e=this.worldPosition;var n=Bt(this.tmpPoints,t);n=Sr(n,e),n=zg(n,this.worldScaling,e);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(n),i=_this$vNodes$getRectI3.nodeRange;if(!i.size)return;var a=[];var o=0;for(var l=1;l<this.tmpPoints.length;l++){var d=this.tmpPoints[l-1],c=this.tmpPoints[l];if(l===1&&o===0&&(a[o]=[d.XY]),a[o].push(c.XY),l<this.tmpPoints.length-1){var p=c.getAngleByPoints(d,this.tmpPoints[l+1]);(p<90||p>270)&&(o++,a[o]=[c.XY]);}}this.tmpPoints.length===1&&a.length===0&&a.push([this.tmpPoints[0].XY,this.tmpPoints[0].XY]);var s=/* @__PURE__ */new Map();var _iterator32=_createForOfIteratorHelper(i.entries()),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _step32$value=_slicedToArray(_step32.value,2),_l6=_step32$value[0],_d11=_step32$value[1];var _c6=Sr(_d11.rect,[-e[0],-e[1]]);_c6={x:_c6.x/this.worldScaling[0],y:_c6.y/this.worldScaling[1],w:_c6.w/this.worldScaling[0],h:_c6.h/this.worldScaling[1]};var _p4=[_c6.x,_c6.y,_c6.x+_c6.w,_c6.y+_c6.h],y=[],P=[];var _iterator33=_createForOfIteratorHelper(a),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _v12=_step33.value;Dr.polyline(_v12,_p4,y);}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}if(y.length&&_d11.opt){var _iterator34=_createForOfIteratorHelper(y),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var v=_step34.value;var _x70=[];for(var _f34=0;_f34<v.length;_f34++)_f34!==0&&oe(v[_f34],v[_f34-1])||_x70.push.apply(_x70,_toConsumableArray(v[_f34]));P.push(_x70);}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}_d11.opt.eraserlines||(_d11.opt.eraserlines=[]),_d11.opt.eraserlines&&(_d11.opt.eraserlines.push({op:P,thickness:t}),s.set(_l6,_d11));}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}return s;}},{key:"reRenderEffectNodes",value:function(){var _reRenderEffectNodes=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(t){var e,n,i,_iterator35,_step35,_step35$value,a,o,s,l,d;return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:n=t.willUpdateNodes,i=t.worker;_iterator35=_createForOfIteratorHelper(n.entries());_context30.prev=2;_iterator35.s();case 4:if((_step35=_iterator35.n()).done){_context30.next=31;break;}_step35$value=_slicedToArray(_step35.value,2),a=_step35$value[0],o=_step35$value[1];s=o.toolsType,l=i.createWorkShapeNode({workId:a,toolsType:s,toolsOpt:o.opt});l==null||l.setWorkId(a);d=void 0;if(!(s===ut.Image)){_context30.next=15;break;}_context30.next=12;return l.consumeServiceAsync({isFullWork:!0,replaceId:a,worker:i});case 12:d=_context30.sent;_context30.next=28;break;case 15:if(!(s===ut.Text)){_context30.next=21;break;}_context30.next=18;return l.consumeServiceAsync({isFullWork:!0,replaceId:a});case 18:d=_context30.sent;_context30.next=28;break;case 21:_context30.prev=21;d=l==null?void 0:l.consumeService({op:o.op,isFullWork:!0,replaceId:a});_context30.next=28;break;case 25:_context30.prev=25;_context30.t0=_context30["catch"](21);return _context30.abrupt("continue",29);case 28:d&&(e=Pt(e,d));case 29:_context30.next=4;break;case 31:_context30.next=36;break;case 33:_context30.prev=33;_context30.t1=_context30["catch"](2);_iterator35.e(_context30.t1);case 36:_context30.prev=36;_iterator35.f();return _context30.finish(36);case 39:return _context30.abrupt("return",e);case 40:case"end":return _context30.stop();}},_callee28,null,[[2,33,36,39],[21,25]]);}));function reRenderEffectNodes(_x71){return _reRenderEffectNodes.apply(this,arguments);}return reRenderEffectNodes;}()},{key:"consume",value:function consume(t){var e=t.data.op;if(!e||e.length===0)return _objectSpread({type:lt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_We$eraserSizes$n=We.eraserSizes[n],i=_We$eraserSizes$n.width,a=_We$eraserSizes$n.height,o=Math.max(i,a)/this.worldScaling[0],s=this.tmpPoints.length,l=this.tmpPoints[this.tmpPoints.length-1],d=this.updateTempPoints(e,o),c=this.tmpPoints[this.tmpPoints.length-1];if(s===this.tmpPoints.length&&c.equalsXY(l.x,l.y))return _objectSpread({type:lt.None},this.baseConsumeResult);this.syncIndex=Math.min(this.syncIndex,d,Math.max(0,this.tmpPoints.length-2));var p=this.syncIndex;this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var y=!1;var P=this.tmpPoints.slice(d),T=this.draw({consumePoints:P,layer:this.fullLayer,thickness:o});P[0].t-this.syncTimestamp>this.syncUnitTime&&(y=!0,this.syncTimestamp=P[0].t,this.syncIndex=this.tmpPoints.length);var v=[];return this.tmpPoints.slice(p).forEach(function(x){v.push(x.x,x.y,o/2);}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:lt.DrawWork,dataType:Mt.Local,rect:T,op:y?v:void 0,index:y?p*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var e=t.consumePoints,n=t.layer,i=t.thickness,a=this.workId;var o=n.getElementsByName(this.workId)[0],s=Bt(e,i);var d=[{op:[e.map(function(c){return[c.x,c.y];}).flat(1)],thickness:i}];return o||(o=new kt({normalize:!0,name:a,pos:[0,0],anchor:[0.5,0.5],bgcolor:"rgba(0,0,0,0.3)",zIndex:9999}),n.appendChild(o)),this.drawEraserlines({group:o,eraserlines:d,pos:[0,0],layer:n,isClear:!0}),s={x:Math.floor(s.x*this.worldScaling[0]+this.worldPosition[0]-vt.SafeBorderPadding),y:Math.floor(s.y*this.worldScaling[1]+this.worldPosition[1]-vt.SafeBorderPadding),w:Math.floor(s.w*this.worldScaling[0]+2*vt.SafeBorderPadding),h:Math.floor(s.h*this.worldScaling[1]+2*vt.SafeBorderPadding)},s;}},{key:"consumeAll",value:function consumeAll(){var t=this.fullLayer.getElementsByName(this.workId);var e;if(t.length&&(e=vt.getRectFromLayer(this.fullLayer,this.workId)),t.forEach(function(c){c.remove(),c.disconnect();}),!this.tmpPoints.length)return _objectSpread({type:lt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_We$eraserSizes$n2=We.eraserSizes[n],i=_We$eraserSizes$n2.width,a=_We$eraserSizes$n2.height,o=Math.max(i,a)/this.worldScaling[0],s=this.getChangeNodes(o);if(!(s!=null&&s.size))return _objectSpread(_objectSpread({type:lt.None},this.baseConsumeResult),{},{rect:e});var l=[];this.tmpPoints.map(function(c){l.push(c.x,c.y,o/2);});var d=Zt(l);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:lt.FullWork,dataType:Mt.Local,rect:e,ops:d,willUpdateNodes:s});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(vt);// 来源于white-sdk
|
|
439
|
+
rt(We,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var Ze=We;function Mi(h){switch(h){case ut.Arrow:return pi;case ut.Pencil:return hi;case ut.Straight:return Ti;case ut.Ellipse:return mi;case ut.Polygon:case ut.Triangle:return Si;case ut.Star:case ut.Rhombus:return yi;case ut.Rectangle:return vi;case ut.SpeechBalloon:return xi;case ut.Text:return ke;case ut.LaserPen:return ui;case ut.Eraser:return se;case ut.PencilEraser:return Je;case ut.BitMapEraser:return Ze;case ut.Selector:return Xe;case ut.Image:return Be;}}function Fr(h,r){var t=h.toolsType,e=_objectWithoutProperties(h,_excluded);switch(t){case ut.Arrow:return new pi(e);case ut.Pencil:return new hi(e);case ut.Straight:return new Ti(e);case ut.Ellipse:return new mi(e);case ut.Polygon:case ut.Triangle:return new Si(e);case ut.Star:case ut.Rhombus:return new yi(e);case ut.Rectangle:return new vi(e);case ut.SpeechBalloon:return new xi(e);case ut.Text:return new ke(e);case ut.LaserPen:return new ui(e);case ut.Eraser:return new se(e,r);case ut.BitMapEraser:return new Ze(e);case ut.PencilEraser:return new Je(e,r);case ut.Selector:return e.vNodes?new Xe(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case ut.Image:return new Be(e);default:return;}}function Pi(h){var r=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator36=_createForOfIteratorHelper(h),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _e6=_step36.value;if(_e6.tagName==="GROUP"&&_e6.children.length)return Pi(_e6.children);_e6.tagName&&t.includes(_e6.tagName)&&r.push(_e6);}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}return r;}function Pt(h,r){if(h&&r){var t=Math.min(h.x,r.x),_e7=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-_e7;return{x:t,y:_e7,w:a,h:o};}return r||h;}function Bt(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],l=_o$XY[1];e=Math.min(e,s-r),n=Math.min(n,l-r),i=Math.max(i,s+r),a=Math.max(a,l+r);}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t;}function ue(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.ceil(h.w+r*2),h:Math.ceil(h.h+r*2)};}function Sr(h,r){return{x:h.x+r[0],y:h.y+r[1],w:h.w,h:h.h};}function $g(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),l=_.RotWith(e,a,o),d=_.RotWith(n,a,o),c=_.RotWith(i,a,o);return[s,l,d,c];}function Oi(h,r){var t=$g(h,r);return Bt(t);}function zg(h,r,t){var e=new _(h.x,h.y),n=new _(h.x+h.w,h.y),i=new _(h.x+h.w,h.y+h.h),a=new _(h.x,h.y+h.h),o=new _(t[0],t[1]),s=new _(r[0],r[1]),l=_.ScaleWOrigin(e,s,o),d=_.ScaleWOrigin(n,s,o),c=_.ScaleWOrigin(i,s,o),p=_.ScaleWOrigin(a,s,o);return Bt([l,d,c,p]);}function Gg(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 Hg(h,r,t){var e=new _(r[0],r[1]);for(var n=0;n<h.length;n+=2){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 Ur(h,r,t){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new _(r[0],r[1]);for(var i=0;i<h.length;i+=3){var a=new _(h[i],h[i+1]),o=new _(t[0],t[1]),s=_.ScaleWOrigin(a,o,n);h[i]=s.x+e[0],h[i+1]=s.y+e[1];}}function jr(h,r,t){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new _(r[0],r[1]);for(var i=0;i<h.length;i+=2){var a=new _(h[i],h[i+1]),o=new _(t[0],t[1]),s=_.ScaleWOrigin(a,o,n);h[i]=s.x+e[0],h[i+1]=s.y+e[1];}}function Kg(h,r){return h[0]>=r.x&&h[0]<=r.x+r.w&&h[1]>=r.y&&h[1]<=r.y+r.h;}function Ei(h,r){var t=h<=r?1:h/r,e=r<=h?1:r/h;return[t,e];}function Yg(h){var _iterator37=_createForOfIteratorHelper(h),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var r=_step37.value;if(isNaN(r)||r===1/0||r===-1/0)return!1;}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}return!0;}function Vg(h){return h!==Math.floor(h);}function Xg(h){var r=h.toString();return r.indexOf(".")!==-1?r.split(".")[1].length:0;}function kg(h,r){for(;r!==0;){var _ref168=[r,h%r];h=_ref168[0];r=_ref168[1];}return h;}var Jg=function Jg(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;},Zg=function Zg(h){return!h.isHid;};function me(h){return"".concat(Qe(h.x),",").concat(Qe(h.y)," ");}function ve(h,r){return"".concat(Qe((h.x+r.x)/2),",").concat(Qe((h.y+r.y)/2)," ");}function Qe(h){return+h.toFixed(4);}var fr=function fr(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?Pe.outside:h.x>=r.x&&h.y>=r.y&&h.x+h.w<=r.x+r.w&&h.y+h.h<=r.y+r.h?Pe.inside:Pe.intersect;};function Qg(h){var r=0;for(var t=0;t<h.length;t++){var _e8=h.charCodeAt(t);_e8>=1&&_e8<=126||65376<=_e8&&_e8<=65439?r++:r+=2;}return r;}var De="cursorhover",Cn=20,qe="mainView";var qg=/*#__PURE__*/function(){function qg(r,t){_classCallCheck(this,qg);rt(this,"viewId");rt(this,"scene");rt(this,"fullLayer");rt(this,"curNodeMap",/* @__PURE__ */new Map());rt(this,"targetNodeMap",[]);rt(this,"highLevelIds");this.viewId=r,this.scene=t;}return _createClass(qg,[{key:"init",value:function init(r){this.fullLayer=r;}},{key:"get",value:function get(r){return this.curNodeMap.get(r);}},{key:"getUnLockNodes",value:function getUnLockNodes(){var r=/* @__PURE__ */new Map();var _iterator38=_createForOfIteratorHelper(this.curNodeMap.entries()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _step38$value=_slicedToArray(_step38.value,2),t=_step38$value[0],_e9=_step38$value[1];_e9.toolsType===ut.Image&&_e9.opt.locked||_e9.toolsType===ut.Text&&(_e9.opt.workState===Rt.Doing||_e9.opt.workState===Rt.Start)||r.set(t,_e9);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return r;}},{key:"getNodesByType",value:function getNodesByType(r){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(e,n){e.toolsType===r&&t.set(n,e);}),t;}},{key:"hasRenderNodes",value:function hasRenderNodes(){var r=!1;var _iterator39=_createForOfIteratorHelper(this.curNodeMap.values()),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var t=_step39.value;Zg(t)&&(r=!0);}}catch(err){_iterator39.e(err);}finally{_iterator39.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=Xt(t.rect)),t.op&&Yg(t.op)&&(e.op=Xt(t.op)),t.canRotate&&(e.canRotate=t.canRotate),t.scaleType&&(e.scaleType=t.scaleType),t.opt&&(e.opt=Xt(t.opt)),t.toolsType&&(e.toolsType=t.toolsType),t.centerPos&&(e.centerPos=Xt(t.centerPos)),xe(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 _iterator40=_createForOfIteratorHelper(this.curNodeMap.values()),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _e10=_step40.value;if(ue(r,_e10.rect)){if(t&&_e10.toolsType===ut.Image&&_e10.opt.locked||t&&_e10.toolsType===ut.Text&&(_e10.opt.workState===Rt.Doing||_e10.opt.workState===Rt.Start))continue;return!0;}}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return!1;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n;var i=/* @__PURE__ */new Map();var _iterator41=_createForOfIteratorHelper(this.curNodeMap.entries()),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _step41$value=_slicedToArray(_step41.value,2),a=_step41$value[0],o=_step41$value[1];if(ue(r,o.rect)){if(t&&o.toolsType===ut.Image&&o.opt.locked||e&&o.toolsType===ut.Text&&(o.opt.workState===Rt.Doing||o.opt.workState===Rt.Start))continue;n=Pt(n,o.rect),i.set(a,o);}}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return{rectRange:n,nodeRange:i};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(r,t){var e=Mi(t.toolsType);return this.fullLayer&&(e==null?void 0:e.getRectFromLayer(this.fullLayer,r));}},{key:"updateNodeRect",value:function updateNodeRect(r){var t=this.curNodeMap.get(r);if(t){var _e11=this.getNodeRectFormShape(r,t);if(!_e11){this.curNodeMap["delete"](r);return;}t.rect=_e11,this.curNodeMap.set(r,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(r){this.highLevelIds=r;var _iterator42=_createForOfIteratorHelper(this.highLevelIds.keys()),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var t=_step42.value;this.updateNodeRect(t);}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var r;var _iterator43=_createForOfIteratorHelper(this.curNodeMap.keys()),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var t=_step43.value;(r=this.highLevelIds)!=null&&r.has(t)||this.updateNodeRect(t);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"combineIntersectRect",value:function combineIntersectRect(r){var t=r;return this.curNodeMap.forEach(function(e){ue(t,e.rect)&&(t=Pt(t,e.rect));}),t;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(r){var t=/* @__PURE__ */new Map();var _iterator44=_createForOfIteratorHelper(r),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var _e12=_step44.value;var n=this.curNodeMap.get(_e12);n&&t.set(_e12,Xt(n));}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}return this.targetNodeMap.push(Xt(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(Xt(this.curNodeMap)),this.targetNodeMap.length-1;}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length&&(this.targetNodeMap.length=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 Ci=/*#__PURE__*/function(){function Ci(r,t,e){_classCallCheck(this,Ci);rt(this,"viewId");rt(this,"fullLayer");rt(this,"vNodes");rt(this,"dpr");rt(this,"contextType");rt(this,"opt");rt(this,"cameraOpt");rt(this,"scene");rt(this,"isSafari",!1);rt(this,"combinePostMsg",/* @__PURE__ */new Set());rt(this,"workerTaskId");rt(this,"protectedTask");rt(this,"hasPriorityDraw",!0);rt(this,"delayPostDoneResolve");rt(this,"cacheImages",/* @__PURE__ */new Map());rt(this,"imageResolveMap",/* @__PURE__ */new Map());if(this.viewId=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(e),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");this.scene=this.createScene(t.offscreenCanvasOpt);var n=re.bufferSize.full,i=re.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId===qe?n:i})),this.vNodes=new qg(r,this.scene);}return _createClass(Ci,[{key:"getCachedImages",value:function getCachedImages(r){return this.cacheImages.get(r);}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(r){return r.close();}),this.cacheImages.clear();}},{key:"clearImageResolveMap",value:function clearImageResolveMap(){this.imageResolveMap.forEach(function(_ref169){var r=_ref169.timer;r&&clearTimeout(r);}),this.imageResolveMap.clear();}},{key:"setHasPriorityDraw",value:function setHasPriorityDraw(r){this.hasPriorityDraw=r;}},{key:"getPriorityDraw",value:function getPriorityDraw(){return this.hasPriorityDraw;}},{key:"setIsSafari",value:function setIsSafari(r){this.isSafari=r;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(r){var s,t,e,n,i,a,o,l,_l7,d;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.imageSrc,a=r.imageBitmap,o=r.workId;_context31.t0=t;_context31.next=_context31.t0===lt.UpdateCamera?4:_context31.t0===lt.Destroy?7:_context31.t0===lt.Clear?9:_context31.t0===lt.UpdateTools?12:_context31.t0===lt.GetImageBitMap?14:16;break;case 4:_context31.next=6;return this.updateCamera(r);case 6:return _context31.abrupt("break",16);case 7:this.destroy();return _context31.abrupt("break",16);case 9:_context31.next=11;return this.clearAll();case 11:return _context31.abrupt("break",16);case 12:if(e&&n){l={toolsType:e,toolsOpt:n};this.localWork.setToolsOpt(l);}return _context31.abrupt("break",16);case 14:if(i&&a&&this.cacheImages.set(i,a),o){_l7=o.toString(),d=(s=this.imageResolveMap.get(_l7))==null?void 0:s.resolve;d&&d(_l7);}return _context31.abrupt("break",16);case 16:case"end":return _context31.stop();}},_callee29,this);}));function on(_x72){return _on.apply(this,arguments);}return on;}()},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(r){var _this88=this;var t,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=r.toolsType,e=r.opt,n=r.workId;if(!(t===ut.Image&&e&&e.src&&n)){_context32.next=9;break;}i=e.src,a=this.cacheImages.has(i),o=n.toString();if(a){_context32.next=8;break;}_context32.next=6;return new Promise(function(l){var d=_this88.imageResolveMap.get(o)||{resolve:void 0,timer:void 0};d.timer&&clearTimeout(d.timer),d.resolve=l,d.timer=setTimeout(function(){var c=_this88.imageResolveMap.get(o);c!=null&&c.resolve&&c.resolve(o);},5e3),_this88.imageResolveMap.set(o,d),_this88._post({sp:[{imageSrc:i,workId:o,viewId:_this88.viewId,isgl:!!_this88.fullLayer.parent.gl,isSubWorker:_this88.type===Ne.Sub,type:lt.GetImageBitMap}]});});case 6:s=_context32.sent;this.imageResolveMap["delete"](s);case 8:return _context32.abrupt("return",this.cacheImages.get(i));case 9:case"end":return _context32.stop();}},_callee30,this);}));function loadImageBitMap(_x73){return _loadImageBitMap.apply(this,arguments);}return loadImageBitMap;}()},{key:"createLocalWork",value:function createLocalWork(r){var t=r.workId,e=r.opt,n=r.toolsType;t&&e&&(!this.localWork.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:e}),this.setWorkOpt({workId:t,toolsOpt:e}));}},{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(r){var t=new OffscreenCanvas(100,100),e=r===Ne.Full&&this.viewId===qe?[ye.Webgl2,ye.Webgl,ye.Canvas2d]:[ye.Canvas2d];for(var _i9=0,_e13=e;_i9<_e13.length;_i9++){var n=_e13[_i9];try{if(t.getContext(n))return n;}catch(_unused25){continue;}}}},{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 qi(_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 kt({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(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(){var r;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.fullLayer.removeAllChildren()),this.clearCacheImages(),this.clearImageResolveMap(),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();case 1:case"end":return _context33.stop();}},_callee31,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{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.clearCacheImages(),this.clearImageResolveMap(),this.scene.remove(),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(r){return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:this.combinePostMsg.add(r);_context34.next=3;return this.runBatchPostData();case 3:case"end":return _context34.stop();}},_callee32,this);}));function post(_x74){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(){var _this89=this;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this89.workerTaskId=void 0,_this89.combinePost();},16));_context35.t0=this.type===Ne.Full&&!this.delayPostDoneResolve;if(!_context35.t0){_context35.next=6;break;}_context35.next=5;return new Promise(function(t){_this89.delayPostDoneResolve=t;});case 5:_context35.t0=_context35.sent;case 6:_context35.t1=_context35.t0;if(!_context35.t1){_context35.next=9;break;}this.delayPostDoneResolve=void 0;case 9:case"end":return _context35.stop();}},_callee33,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var i,a;this.workerTaskId=void 0;var r=[],t=[];var e;var n=/* @__PURE__ */new Set();var _iterator45=_createForOfIteratorHelper(this.combinePostMsg.values()),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var o=_step45.value;if((i=o.render)!=null&&i.length){var _iterator46=_createForOfIteratorHelper(o.render),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var s=_step46.value;var l=!1;if(s.workId&&n.add(s.workId),s.isClearAll&&(s.rect=this.getSceneRect(),s.isClear=!0,delete s.isClearAll),s.drawCanvas){var d=this.getLayer(s.drawCanvas);if(!d||!(d.parent instanceof Qi))continue;if(d.parent.render(),s.isDrawAll){var c=this.getSceneRect();s.rect=c,delete s.isDrawAll;}}var _iterator47=_createForOfIteratorHelper(r),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _d12=_step47.value;if(s.viewId===_d12.viewId){s.isClear&&_d12.clearCanvas&&_d12.isClear&&_d12.clearCanvas===s.clearCanvas&&(_d12.rect=Pt(_d12.rect,s.rect),l=!0),_d12.drawCanvas&&_d12.drawCanvas===s.drawCanvas&&(_d12.rect=Pt(_d12.rect,s.rect),l=!0);continue;}}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}l||(s.isClear&&!s.drawCanvas?r.unshift(s):r.push(s));}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}}if((a=o.sp)!=null&&a.length){var _iterator48=_createForOfIteratorHelper(o.sp),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _s5=_step48.value;var _l8=!1;var _iterator49=_createForOfIteratorHelper(t),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _d13=_step49.value;if(oe(_s5,_d13)){_l8=!0;break;}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}_l8||t.push(_s5);}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}}_t(o.drawCount)&&(e=o.drawCount);}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}return this.combinePostMsg.clear(),{render:r,sp:t,drawCount:e,workIds:n,viewId:this.viewId};}},{key:"safariFixRect",value:function safariFixRect(r,t){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;var e=this.scene.width,n=this.scene.height,i={x:Math.floor(Math.max(0,r.x)),y:Math.floor(Math.max(0,r.y)),w:Math.floor(Math.min(e,r.w)),h:Math.floor(Math.min(n,r.h))};if(i.x+i.w>e&&(i.w=Math.floor(e-i.x)),i.y+i.h>n&&(i.h=Math.floor(n-i.y)),Vg(t)){var a=Xg(t),o=Math.pow(10,a),s=kg(o,t*o),l=i.x%s,d=i.x-l;d>=0?(i.x=d,i.w=i.w+l):(i.x=0,i.w=i.w+l-d);var c=i.y%s,p=i.y-c;p>=0?(i.y=p,i.h=i.h+c):(i.y=0,i.h=i.h+c-p);}return i;}},{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 Ai=/*#__PURE__*/function(){function Ai(r){_classCallCheck(this,Ai);rt(this,"viewId");rt(this,"vNodes");rt(this,"thread");rt(this,"fullLayer");rt(this,"drawLayer");rt(this,"_post");rt(this,"tmpOpt");rt(this,"workShapes",/* @__PURE__ */new Map());rt(this,"drawCount",0);rt(this,"syncUnitTime",re.syncOpt.interval);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(Ai,[{key:"destroy",value:function destroy(){this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(r){return this.workShapes.get(r);}},{key:"createWorkShape",value:function createWorkShape(r,t){if(r&&this.tmpOpt){var _e14={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},_e14),{},{workId:r}));n&&this.workShapes.set(r,n);}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var e=this.getWorkShape(r);e||this.createWorkShape(r,t),e==null||e.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t;return Fr(_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,n;((t=this.tmpOpt)==null?void 0:t.toolsType)!==r.toolsType&&(e=this.tmpOpt)!=null&&e.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=r,(n=r.toolsOpt)!=null&&n.syncUnitTime&&(this.syncUnitTime=r.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(r){var t;(t=this.getWorkShape(r))==null||t.clearTmpPoints(),this.workShapes["delete"](r);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(r){return r.clearTmpPoints();}),this.workShapes.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();var a;return t&&this.workShapes.has(i)?(a=this.workShapes.get(i),a==null||a.setWorkOptions(e)):a=this.createWorkShapeNode({toolsOpt:e,toolsType:n,workId:i}),a?(this.workShapes.set(i,a),a):void 0;}}}]);}();var _g=ee,t0=function t0(){return _g.Date.now();},e0=t0,r0=/\s/;function n0(h){for(var r=h.length;r--&&r0.test(h.charAt(r)););return r;}var i0=n0,s0=i0,o0=/^\s+/;function a0(h){return h&&h.slice(0,s0(h)+1).replace(o0,"");}var l0=a0,c0=ge,f0=ne,h0="[object Symbol]";function u0(h){return _typeof(h)=="symbol"||f0(h)&&c0(h)==h0;}var d0=u0,g0=l0,An=fe,p0=d0,Rn=NaN,m0=/^[-+]0x[0-9a-f]+$/i,v0=/^0b[01]+$/i,y0=/^0o[0-7]+$/i,S0=parseInt;function x0(h){if(typeof h=="number")return h;if(p0(h))return Rn;if(An(h)){var r=typeof h.valueOf=="function"?h.valueOf():h;h=An(r)?r+"":r;}if(typeof h!="string")return h===0?h:+h;h=g0(h);var t=v0.test(h);return t||y0.test(h)?S0(h.slice(2),t?2:8):m0.test(h)?Rn:+h;}var T0=x0,M0=fe,hr=e0,In=T0,P0="Expected a function",O0=Math.max,E0=Math.min;function C0(h,r,t){var e,n,i,a,o,s,l=0,d=!1,c=!1,p=!0;if(typeof h!="function")throw new TypeError(P0);r=In(r)||0,M0(t)&&(d=!!t.leading,c="maxWait"in t,i=c?O0(In(t.maxWait)||0,r):i,p="trailing"in t?!!t.trailing:p);function y(M){var E=e,R=n;return e=n=void 0,l=M,a=h.apply(R,E),a;}function P(M){return l=M,o=setTimeout(x,r),d?y(M):a;}function T(M){var E=M-s,R=M-l,b=r-E;return c?E0(b,i-R):b;}function v(M){var E=M-s,R=M-l;return s===void 0||E>=r||E<0||c&&R>=i;}function x(){var M=hr();if(v(M))return f(M);o=setTimeout(x,T(M));}function f(M){return o=void 0,p&&e?y(M):(e=n=void 0,a);}function g(){o!==void 0&&clearTimeout(o),l=0,e=s=n=o=void 0;}function u(){return o===void 0?a:f(hr());}function m(){var M=hr(),E=v(M);if(e=arguments,n=this,s=M,E){if(o===void 0)return P(s);if(c)return clearTimeout(o),o=setTimeout(x,r),y(s);}return o===void 0&&(o=setTimeout(x,r)),a;}return m.cancel=g,m.flush=u,m;}var A0=C0,R0=A0,I0=fe,L0="Expected a function";function b0(h,r,t){var e=!0,n=!0;if(typeof h!="function")throw new TypeError(L0);return I0(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),R0(h,r,{leading:e,maxWait:r,trailing:n});}var w0=b0,D0=/* @__PURE__ */de(w0);function N0(h){return h;}var Ri=N0;function W0(h,r,t){switch(t.length){case 0:return h.call(r);case 1:return h.call(r,t[0]);case 2:return h.call(r,t[0],t[1]);case 3:return h.call(r,t[0],t[1],t[2]);}return h.apply(r,t);}var B0=W0,F0=B0,Ln=Math.max;function U0(h,r,t){return r=Ln(r===void 0?h.length-1:r,0),function(){for(var e=arguments,n=-1,i=Ln(e.length-r,0),a=Array(i);++n<i;)a[n]=e[r+n];n=-1;for(var o=Array(r+1);++n<r;)o[n]=e[n];return o[r]=t(a),F0(h,this,o);};}var j0=U0;function $0(h){return function(){return h;};}var z0=$0,G0=z0,bn=Gn,H0=Ri,K0=bn?function(h,r){return bn(h,"toString",{configurable:!0,enumerable:!1,value:G0(r),writable:!0});}:H0,Y0=K0,V0=800,X0=16,k0=Date.now;function J0(h){var r=0,t=0;return function(){var e=k0(),n=X0-(e-t);if(t=e,n>0){if(++r>=V0)return arguments[0];}else r=0;return h.apply(void 0,arguments);};}var Z0=J0,Q0=Y0,q0=Z0,_0=q0(Q0),tp=_0,ep=Ri,rp=j0,np=tp;function ip(h,r){return np(rp(h,r,ep),h+"");}var sp=ip;function op(h,r,t,e){for(var n=h.length,i=t+(e?1:-1);e?i--:++i<n;)if(r(h[i],i,h))return i;return-1;}var ap=op;function lp(h){return h!==h;}var cp=lp;function fp(h,r,t){for(var e=t-1,n=h.length;++e<n;)if(h[e]===r)return e;return-1;}var hp=fp,up=ap,dp=cp,gp=hp;function pp(h,r,t){return r===r?gp(h,r,t):up(h,dp,t);}var mp=pp,vp=mp;function yp(h,r){var t=h==null?0:h.length;return!!t&&vp(h,r,0)>-1;}var Ii=yp;function Sp(h,r,t){for(var e=-1,n=h==null?0:h.length;++e<n;)if(t(r,h[e]))return!0;return!1;}var Li=Sp;function xp(h,r){for(var t=-1,e=h==null?0:h.length,n=Array(e);++t<e;)n[t]=r(h[t],t,h);return n;}var Tp=xp,Mp=Nr,Pp=Ii,Op=Li,Ep=Tp,Cp=sr,Ap=Wr,Rp=200;function Ip(h,r,t,e){var n=-1,i=Pp,a=!0,o=h.length,s=[],l=r.length;if(!o)return s;t&&(r=Ep(r,Cp(t))),e?(i=Op,a=!1):r.length>=Rp&&(i=Ap,a=!1,r=new Mp(r));t:for(;++n<o;){var d=h[n],c=t==null?d:t(d);if(d=e||d!==0?d:0,a&&c===c){for(var p=l;p--;)if(r[p]===c)continue t;s.push(d);}else i(r,c,e)||s.push(d);}return s;}var Lp=Ip,wn=Fe,bp=Vn,wp=Ue,Dn=wn?wn.isConcatSpreadable:void 0;function Dp(h){return wp(h)||bp(h)||!!(Dn&&h&&h[Dn]);}var Np=Dp,Wp=Lr,Bp=Np;function bi(h,r,t,e,n){var i=-1,a=h.length;for(t||(t=Bp),n||(n=[]);++i<a;){var o=h[i];r>0&&t(o)?r>1?bi(o,r-1,t,e,n):Wp(n,o):e||(n[n.length]=o);}return n;}var Fp=bi;function Up(){}var jp=Up,ur=ni,$p=jp,zp=Br,Gp=1/0,Hp=ur&&1/zp(new ur([,-0]))[1]==Gp?function(h){return new ur(h);}:$p,Kp=Hp,Yp=Nr,Vp=Ii,Xp=Li,kp=Wr,Jp=Kp,Zp=Br,Qp=200;function qp(h,r,t){var e=-1,n=Vp,i=h.length,a=!0,o=[],s=o;if(t)a=!1,n=Xp;else if(i>=Qp){var l=r?null:Jp(h);if(l)return Zp(l);a=!1,n=kp,s=new Yp();}else s=r?[]:o;t:for(;++e<i;){var d=h[e],c=r?r(d):d;if(d=t||d!==0?d:0,a&&c===c){for(var p=s.length;p--;)if(s[p]===c)continue t;r&&s.push(c),o.push(d);}else n(s,c,t)||(s!==o&&s.push(c),o.push(d));}return o;}var _p=qp,tm=Lp,em=Fp,Nn=_p;function rm(h,r,t){var e=h.length;if(e<2)return e?Nn(h[0]):[];for(var n=-1,i=Array(e);++n<e;)for(var a=h[n],o=-1;++o<e;)o!=n&&(i[n]=tm(i[n]||a,h[o],r,t));return Nn(em(i,1),r,t);}var nm=rm,im=Cr,sm=ne;function om(h){return sm(h)&&im(h);}var am=om,lm=Qn,cm=sp,fm=nm,hm=am,um=cm(function(h){return fm(lm(h,hm));}),dm=um,gm=/* @__PURE__ */de(dm);var pm=/*#__PURE__*/function(_Ai){function pm(t){var _this90;_classCallCheck(this,pm);_this90=_callSuper(this,pm,[t]);rt(_this90,"combineUnitTime",re.bezier.combineUnitTime);rt(_this90,"combineTimerId");rt(_this90,"combineDrawResolve");rt(_this90,"combineDrawActiveId");rt(_this90,"drawWorkActiveId");rt(_this90,"effectSelectNodeData",/* @__PURE__ */new Set());rt(_this90,"batchEraserWorks",/* @__PURE__ */new Set());rt(_this90,"batchEraserRemoveNodes",/* @__PURE__ */new Set());rt(_this90,"batchEraserCombine",D0(function(){var t=_this90.updateBatchEraserCombineNode(_this90.batchEraserWorks,_this90.batchEraserRemoveNodes);_this90.batchEraserWorks.clear(),_this90.batchEraserRemoveNodes.clear(),t.length&&_this90._post({render:t});},200,{leading:!1}));return _this90;}_inherits(pm,_Ai);return _createClass(pm,[{key:"loadImageBitMap",value:function(){var _loadImageBitMap2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t){return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:return _context36.abrupt("return",this.thread.loadImageBitMap(t));case 1:case"end":return _context36.stop();}},_callee34,this);}));function loadImageBitMap(_x75){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t,e){var _this91=this;var n,i,a,o,s,l,d;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=t.op,i=t.workId,a=t.scenePath;if(!(n!=null&&n.length&&i)){_context37.next=57;break;}o=i.toString(),s=this.getWorkShape(o);if(s){_context37.next=5;break;}return _context37.abrupt("return");case 5:l=s.toolsType;if(!(l===ut.LaserPen)){_context37.next=8;break;}return _context37.abrupt("return");case 8:_context37.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==o;if(!_context37.t0){_context37.next=13;break;}this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context37.next=13;return this.consumeDrawAll({workId:this.combineDrawActiveId,scenePath:a,viewId:this.viewId,msgType:lt.DrawWork,dataType:Mt.Local},e);case 13:_context37.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==o;if(!_context37.t1){_context37.next=18;break;}_context37.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:a,viewId:this.viewId,msgType:lt.DrawWork,dataType:Mt.Local},e);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&o!==Nt&&(this.drawWorkActiveId=o);d=s.consume({data:t,isFullWork:!0});_context37.t2=l;_context37.next=_context37.t2===ut.Selector?23:_context37.t2===ut.PencilEraser?29:_context37.t2===ut.BitMapEraser?34:_context37.t2===ut.Eraser?39:_context37.t2===ut.Arrow?44:_context37.t2===ut.Straight?44:_context37.t2===ut.Ellipse?44:_context37.t2===ut.Rectangle?44:_context37.t2===ut.Star?44:_context37.t2===ut.Polygon?44:_context37.t2===ut.SpeechBalloon?44:_context37.t2===ut.Pencil?50:57;break;case 23:_context37.t3=d.type===lt.Select;if(!_context37.t3){_context37.next=28;break;}d.selectIds&&e.runReverseSelectWork(d.selectIds);_context37.next=28;return this.drawSelector(d);case 28:return _context37.abrupt("break",57);case 29:_context37.t4=d!=null&&d.rect;if(!_context37.t4){_context37.next=33;break;}_context37.next=33;return this.drawPencilEraser(d);case 33:return _context37.abrupt("break",57);case 34:_context37.t5=d!=null&&d.rect;if(!_context37.t5){_context37.next=38;break;}_context37.next=38;return this.drawBitMapEraser(d);case 38:return _context37.abrupt("break",57);case 39:_context37.t6=d!=null&&d.rect;if(!_context37.t6){_context37.next=43;break;}_context37.next=43;return this.drawEraser(d);case 43:return _context37.abrupt("break",57);case 44:_context37.t7=d;if(!_context37.t7){_context37.next=49;break;}this.drawCount++;_context37.next=49;return this.drawShape(d);case 49:return _context37.abrupt("break",57);case 50:this.drawCount++;this.combineTimerId||new Promise(function(c){_this91.combineDrawActiveId=o,_this91.combineDrawResolve=c,_this91.combineTimerId=setTimeout(function(){_this91.combineTimerId=void 0,_this91.combineDrawResolve&&_this91.combineDrawResolve(!0);},_this91.combineUnitTime);}).then(function(c){c&&_this91.drawPencilCombine(o,_this91.drawCount),_this91.combineDrawResolve=void 0;});_context37.t8=d;if(!_context37.t8){_context37.next=56;break;}_context37.next=56;return this.drawPencil(d);case 56:return _context37.abrupt("break",57);case 57:case"end":return _context37.stop();}},_callee35,this);}));function consumeDraw(_x76,_x77){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t,e){var o,s,l,d,n,i,a,c,p,y,P,T,v;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,i=t.scenePath,a=t.isLockSentEventCursor;if(!n){_context38.next=42;break;}c=n.toString();this.drawWorkActiveId===c&&(this.drawWorkActiveId=void 0);p=this.workShapes.get(c);if(p){_context38.next=8;break;}return _context38.abrupt("return");case 8:y=p.toolsType;if(!(y===ut.LaserPen)){_context38.next=11;break;}return _context38.abrupt("return");case 11:P=this.workShapes.get(De),T=(o=P==null?void 0:P.selectIds)==null?void 0:o[0],v=p.consumeAll({data:t});_context38.t0=y;_context38.next=_context38.t0===ut.Selector?15:_context38.t0===ut.PencilEraser?21:_context38.t0===ut.BitMapEraser?23:_context38.t0===ut.Eraser?28:_context38.t0===ut.Arrow?30:_context38.t0===ut.Straight?30:_context38.t0===ut.Ellipse?30:_context38.t0===ut.Rectangle?30:_context38.t0===ut.Star?30:_context38.t0===ut.Polygon?30:_context38.t0===ut.SpeechBalloon?30:_context38.t0===ut.Pencil?35:42;break;case 15:v.selectIds&&T&&(s=v.selectIds)!=null&&s.includes(T)&&P.cursorBlur();v.selectIds&&e.runReverseSelectWork(v.selectIds);_context38.next=19;return this.drawSelector(_objectSpread(_objectSpread({},v),{},{scenePath:i}));case 19:(l=p.selectIds)!=null&&l.length?p.clearTmpPoints():this.clearWorkShapeNodeCache(c);return _context38.abrupt("break",42);case 21:v!=null&&v.rect&&this.drawPencilEraser(_objectSpread(_objectSpread({},v),{},{scenePath:i})),p.clearTmpPoints();return _context38.abrupt("break",42);case 23:_context38.t1=v.rect||(d=v.newWorkDatas)!=null&&d.size;if(!_context38.t1){_context38.next=27;break;}_context38.next=27;return this.drawBitMapEraserFull(p,_objectSpread(_objectSpread({},v),{},{isLockSentEventCursor:a}));case 27:return _context38.abrupt("break",42);case 28:v!=null&&v.rect&&this.drawEraser(_objectSpread(_objectSpread({},v),{},{scenePath:i})),p.clearTmpPoints();return _context38.abrupt("break",42);case 30:_context38.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},v),{},{scenePath:i,isLockSentEventCursor:a}));case 32:this.drawCount=0;this.clearWorkShapeNodeCache(c);return _context38.abrupt("break",42);case 35:_context38.t2=v!=null&&v.rect;if(!_context38.t2){_context38.next=40;break;}_context38.next=39;return this.drawPencilFull(_objectSpread(_objectSpread({},v),{},{scenePath:i,isLockSentEventCursor:a}));case 39:this.drawCount=0;case 40:this.clearWorkShapeNodeCache(c);return _context38.abrupt("break",42);case 42:case"end":return _context38.stop();}},_callee36,this);}));function consumeDrawAll(_x78,_x79){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t,e){var _iterator50,_step50,n;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_iterator50=_createForOfIteratorHelper(this.workShapes.keys());_context39.prev=1;_iterator50.s();case 3:if((_step50=_iterator50.n()).done){_context39.next=9;break;}n=_step50.value;_context39.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:lt.DrawWork,dataType:Mt.Local},e);case 7:_context39.next=3;break;case 9:_context39.next=14;break;case 11:_context39.prev=11;_context39.t0=_context39["catch"](1);_iterator50.e(_context39.t0);case 14:_context39.prev=14;_iterator50.f();return _context39.finish(14);case 17:case"end":return _context39.stop();}},_callee37,this,[[1,11,14,17]]);}));function workShapesDone(_x80,_x81){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var i,a,e,n,o,s,l,d,c,p,y;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:e=this.setFullWork(t),n=t.ops&&Oe(t.ops)||t.op;if(!e){_context40.next=26;break;}o=(i=t.workId)==null?void 0:i.toString();if(o){_context40.next=5;break;}return _context40.abrupt("return");case 5:s=(a=this.vNodes.get(o))==null?void 0:a.rect;if(!(e.toolsType===ut.Image)){_context40.next=13;break;}_context40.next=9;return e.consumeServiceAsync({isFullWork:!0,replaceId:o,worker:this});case 9:l=_context40.sent;d=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);_context40.next=20;break;case 13:if(!(e.toolsType===ut.Text)){_context40.next=19;break;}_context40.next=16;return e.consumeServiceAsync({isFullWork:!0,replaceId:o});case 16:l=_context40.sent;_context40.next=20;break;case 19:l=e.consumeService({op:n,isFullWork:!0,replaceId:o}),d=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 20:l=Pt(l,d);c=[],p=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),l&&t.willRefresh&&(s&&c.push({rect:wt(s),isClear:!0,clearCanvas:St.Bg,viewId:this.viewId}),c.push({rect:wt(l),drawCanvas:St.Bg,viewId:this.viewId})),t.willSyncService&&p.push({opt:t.opt,toolsType:t.toolsType,type:lt.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),c.length||p.length)){_context40.next=26;break;}y={render:c,sp:p};_context40.next=26;return this._post(y);case 26:case"end":return _context40.stop();}},_callee38,this);}));function consumeFull(_x82){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"commandDeleteText",value:function commandDeleteText(t){var e=this.vNodes.get(t);if(e&&e.toolsType===ut.Text)return{type:lt.TextUpdate,toolsType:ut.Text,workId:t,dataType:Mt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t){var e,n,i,a,o,s,_iterator51,_step51,l,p,c;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:e=t.willSyncService,n=[],i=[],a=[],o=this.workShapes.get(Nt);if(o){_context41.next=3;break;}return _context41.abrupt("return");case 3:s=o.selectIds&&_toConsumableArray(o.selectIds)||[];_iterator51=_createForOfIteratorHelper(s);try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){l=_step51.value;if(this.vNodes.get(l)){p=this.commandDeleteText(l);p&&n.push(p);}c=this._removeWork(l);c.length&&i.push.apply(i,_toConsumableArray(c)),a.push(l);}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}a.length&&n.push({type:lt.RemoveNode,removeIds:a});n.push({type:lt.Select,selectIds:[],willSyncService:e});_context41.next=10;return this.blurSelector();case 10:_context41.t0=i.length||n.length;if(!_context41.t0){_context41.next=14;break;}_context41.next=14;return this._post({render:i,sp:n});case 14:case"end":return _context41.stop();}},_callee39,this);}));function removeSelector(_x83){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee40$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context42.next=7;break;}i=this._removeWork(n);_context42.t0=i.length;if(!_context42.t0){_context42.next=7;break;}_context42.next=7;return this._post({render:i});case 7:case"end":return _context42.stop();}},_callee40,this);}));function removeWork(_x84){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var i,a,o;var e=this.vNodes.get(t);e&&((i=this.fullLayer)==null||i.getElementsByName(t).forEach(function(s){s.remove();}),this.vNodes["delete"](t));var n=this.drawLayer&&vt.getRectFromLayer(this.drawLayer,t);if(n){var s=(a=this.drawLayer)==null?void 0:a.getElementsByName(t)[0];(o=this.drawLayer)==null||o.removeChild(s);}return this.getWorkShape(t)&&this.clearWorkShapeNodeCache(t),{fullRect:e==null?void 0:e.rect,drawRect:n};}},{key:"_removeWork",value:function _removeWork(t){var _this$removeNode=this.removeNode(t),e=_this$removeNode.fullRect,n=_this$removeNode.drawRect,i=[];return e&&i.push({rect:wt(e),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:wt(e),drawCanvas:St.Bg,viewId:this.viewId}),n&&i.push({rect:wt(n),clearCanvas:St.Float,isClear:!0,viewId:this.viewId},{rect:wt(n),drawCanvas:St.Float,viewId:this.viewId}),i;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var e,n,i,a,o,s,l,_iterator52,_step52,d,c,p,y,P;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:e=t.op,n=t.viewId,i=t.dataType;if(!(e!=null&&e.length)){_context43.next=32;break;}s=e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],l=e[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator52=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context43.prev=4;_iterator52.s();case 6:if((_step52=_iterator52.n()).done){_context43.next=14;break;}d=_step52.value;c=d.rect,p=d.name,y=d.toolsType,P=d.opt;if(!(y===ut.Text&&P.workState===Rt.Done&&Kg([s,l],c))){_context43.next=12;break;}a=p,o=this.setFullWork({workId:p,toolsType:y,opt:P});return _context43.abrupt("break",14);case 12:_context43.next=6;break;case 14:_context43.next=19;break;case 16:_context43.prev=16;_context43.t0=_context43["catch"](4);_iterator52.e(_context43.t0);case 19:_context43.prev=19;_iterator52.f();return _context43.finish(19);case 22:_context43.t1=a;if(!_context43.t1){_context43.next=32;break;}_context43.t2=o;if(!_context43.t2){_context43.next=28;break;}_context43.next=28;return o.consumeServiceAsync({isFullWork:!0,replaceId:o.getWorkId(),isDrawLabel:!1});case 28:_context43.next=30;return this.blurSelector({viewId:n,msgType:lt.Select,dataType:i,isSync:!0});case 30:_context43.next=32;return this._post({sp:[{type:lt.GetTextActive,toolsType:ut.Text,workId:a}]});case 32:case"end":return _context43.stop();}},_callee41,this,[[4,16,19,22]]);}));function checkTextActive(_x85){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var _this92=this;var e,n,i;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:e=this.workShapes.get(Nt),n=t.workId,i=t.msgType;if(!(e&&n&&e.selectIds&&e.selectIds.includes(n.toString()))){_context44.next=6;break;}i===lt.RemoveNode?e.selectIds=e.selectIds.filter(function(a){return a!==n.toString();}):this.effectSelectNodeData.add(t);_context44.next=5;return this.runEffectSelectWork(!0).then(function(){var a;(a=_this92.effectSelectNodeData)==null||a.clear();});case 5:return _context44.abrupt("return");case 6:return _context44.abrupt("return",t);case 7:case"end":return _context44.stop();}},_callee42,this);}));function colloctEffectSelectWork(_x86){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var _this93=this;var P,e,n,i,a,o,s,l,d,c,p,y;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:e=this.workShapes.get(Nt);if((P=e==null?void 0:e.selectIds)!=null&&P.length){_context45.next=3;break;}return _context45.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);a=i.updateSelectorOpt;o=i.willSerializeData;_context45.next=9;return e==null?void 0:e.updateSelector({updateSelectorOpt:a,selectIds:Xt(e.selectIds),vNodes:this.vNodes,willSerializeData:o,worker:this});case 9:s=_context45.sent;l=/* @__PURE__ */new Map();s!=null&&s.selectIds&&(d=gm(e.selectIds,s.selectIds),s.selectIds.forEach(function(T){var v=_this93.vNodes.get(T);if(v){var _x88=v.toolsType,_f35=v.op,g=v.opt;l.set(T,{opt:g,toolsType:_x88,ops:(_f35==null?void 0:_f35.length)&&Zt(_f35)||void 0});}}),e.selectIds=s.selectIds);c=[],p=[];s!=null&&s.rect&&c.push({rect:wt(s.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:wt(s.rect),drawCanvas:St.Bg,viewId:this.viewId});y=n&&n({res:s,workShapeNode:e,param:i,postData:{render:c,sp:p},newServiceStore:l})||{render:c,sp:p};d&&y.sp.push({type:lt.RemoveNode,removeIds:d,viewId:this.viewId});_context45.t0=y.render.length||y.sp.length;if(!_context45.t0){_context45.next=20;break;}_context45.next=20;return this._post(y);case 20:case"end":return _context45.stop();}},_callee43,this);}));function updateSelector(_x87){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var i,e,n,a;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:e=this.workShapes.get(Nt),n=e==null?void 0:e.blurSelector();if(!(this.clearWorkShapeNodeCache(Nt),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(a){a.name===Nt&&a.remove();}),n)){_context46.next=6;break;}a=[];a.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync}));_context46.next=6;return this._post({render:(n==null?void 0:n.rect)&&[{rect:wt(n.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:wt(n.rect),drawCanvas:St.Bg,viewId:this.viewId}],sp:a});case 6:case"end":return _context46.stop();}},_callee44,this);}));function blurSelector(_x89){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(Nt);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(Nt);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(){var t,a,e,n,i,o,_args47=arguments;return _regeneratorRuntime().wrap(function _callee45$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:t=_args47.length>0&&_args47[0]!==undefined?_args47[0]:!1;e=this.workShapes.get(Nt);if(e){_context47.next=4;break;}return _context47.abrupt("return");case 4:if(!(e&&!((a=e.selectIds)!=null&&a.length))){_context47.next=8;break;}_context47.next=7;return this.blurSelector();case 7:return _context47.abrupt("return");case 8:n=e.oldSelectRect,i=e.reRenderSelector();if(!i){_context47.next=13;break;}o=Pt(n,i)||i;_context47.next=13;return this._post({render:[{rect:wt(o),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:wt(o),drawCanvas:St.Bg,viewId:this.viewId}],sp:[{type:lt.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,thickness:e.thickness,useStroke:e.useStroke,strokeType:e.strokeType}]});case 13:case"end":return _context47.stop();}},_callee45,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(t){var i,a,o,s,l,d,c,e,n,_e$updateSelectIds,p,y,P;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:e=this.workShapes.get(Nt),n=t.selectIds;if(n!=null&&n.length){_context48.next=5;break;}_context48.next=4;return this.blurSelector(t);case 4:return _context48.abrupt("return");case 5:if(e){_context48.next=10;break;}!this.setFullWork(t)&&t.workId&&((i=this.tmpOpt)==null?void 0:i.toolsType)===ut.Selector&&this.createWorkShape(t.workId.toString());_context48.next=9;return this.updateFullSelectWork(t);case 9:return _context48.abrupt("return");case 10:if(!(e&&n!=null&&n.length)){_context48.next=16;break;}_e$updateSelectIds=e.updateSelectIds(n),p=_e$updateSelectIds.bgRect,y=_e$updateSelectIds.selectRect,P={render:[],sp:[]};p&&((a=P.render)==null||a.push({rect:wt(p),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:wt(p),drawCanvas:St.Bg,viewId:this.viewId}));(c=P.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:((l=t.opt)==null?void 0:l.fillColor)||e.fillColor,textOpt:((d=t.opt)==null?void 0:d.textOpt)||e.textOpt,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,type:lt.Select,selectRect:y,points:e.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt,thickness:e.thickness,useStroke:e.useStroke,strokeType:e.strokeType}));_context48.next=16;return this._post(P);case 16:case"end":return _context48.stop();}},_callee46,this);}));function updateFullSelectWork(_x90){return _updateFullSelectWork.apply(this,arguments);}return updateFullSelectWork;}()},{key:"destroy",value:function destroy(){this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1)),_superPropGet(pm,"destroy",this,3)([]),this.effectSelectNodeData.clear(),this.batchEraserWorks.clear(),this.batchEraserRemoveNodes.clear();}},{key:"drawBitMapEraser",value:function(){var _drawBitMapEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:e=[];t.op&&e.push(t);n=[];if(t.rect){i=wt(t.rect);n.push({rect:i,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:i,drawCanvas:St.Bg,viewId:this.viewId});}_context49.t0=e.length||n.length;if(!_context49.t0){_context49.next=8;break;}_context49.next=8;return this._post({sp:e,render:n});case 8:case"end":return _context49.stop();}},_callee47,this);}));function drawBitMapEraser(_x91){return _drawBitMapEraser.apply(this,arguments);}return drawBitMapEraser;}()},{key:"drawBitMapEraserFull",value:function(){var _drawBitMapEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t,e){var n,i,a,o,s,l,d,c,y,_iterator53,_step53,_step53$value,P,T,p,_y13;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:n=e.rect,i=e.willUpdateNodes,a=e.isLockSentEventCursor,o=e.scenePath,s=_objectWithoutProperties(e,_excluded3);l=n;d=t.getWorkId(),c=[_objectSpread(_objectSpread({},s),{},{workId:d,isLockSentEventCursor:a,scenePath:o,updateNodeOpt:{useAnimation:!1},isSync:!0,nextTasks:[{type:lt.RemoveNode,removeIds:[d],viewId:this.viewId}]})];if(!(i!=null&&i.size)){_context50.next=10;break;}_context50.next=6;return t==null?void 0:t.reRenderEffectNodes({willUpdateNodes:i,worker:this});case 6:y=_context50.sent;l=Pt(l,y);_iterator53=_createForOfIteratorHelper(i);try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){_step53$value=_slicedToArray(_step53.value,2),P=_step53$value[0],T=_step53$value[1];c.push({type:lt.UpdateNode,dataType:Mt.Local,opt:T.opt,workId:P,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}case 10:p=[];if(l){_y13=wt(l);p.push({rect:_y13,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:_y13,drawCanvas:St.Bg,viewId:this.viewId});}_context50.t0=c.length||p.length;if(!_context50.t0){_context50.next=16;break;}_context50.next=16;return this._post({sp:c,render:p});case 16:case"end":return _context50.stop();}},_callee48,this);}));function drawBitMapEraserFull(_x92,_x93){return _drawBitMapEraserFull.apply(this,arguments);}return drawBitMapEraserFull;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,e){var i,a,o,n,s,l;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:n=(i=this.workShapes.get(t))==null?void 0:i.combineConsume();if(!n){_context51.next=6;break;}s={render:[],drawCount:e};if(n!=null&&n.rect){l=wt(n.rect);(a=s.render)==null||a.push({rect:l,isClear:!0,clearCanvas:St.Float,viewId:this.viewId}),(o=s.render)==null||o.push({rect:l,drawCanvas:St.Float,viewId:this.viewId});}_context51.next=6;return this._post(s);case 6:case"end":return _context51.stop();}},_callee49,this);}));function drawPencilCombine(_x94,_x95){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t){var n,e;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:wt(t.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:wt(t.rect),drawCanvas:St.Bg,viewId:this.viewId}));_context52.next=4;return this._post(e);case 4:case"end":return _context52.stop();}},_callee50,this);}));function drawSelector(_x96){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilEraser",value:function(){var _drawPencilEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t){var _this94=this;var n,i,e,_iterator54,_step54,a,o;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:e=[];if((n=t.newWorkDatas)!=null&&n.size){_iterator54=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){a=_step54.value;o=a.workId.toString();this.batchEraserWorks.add(o),e.push({type:lt.FullWork,workId:o,ops:Zt(a.op),opt:a.opt,toolsType:a.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}delete t.newWorkDatas;}(i=t.removeIds)==null||i.forEach(function(a){_this94.batchEraserRemoveNodes.add(a);});e.push(t);_context53.next=6;return this._post({sp:e});case 6:this.batchEraserCombine();case 7:case"end":return _context53.stop();}},_callee51,this);}));function drawPencilEraser(_x97){return _drawPencilEraser.apply(this,arguments);}return drawPencilEraser;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t){var e,n;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:e=[],n=[];t.removeIds&&e.push(t);t.rect&&n.push({rect:t.rect,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:St.Bg,viewId:this.viewId});_context54.next=5;return this._post({sp:e,render:n});case 5:case"end":return _context54.stop();}},_callee52,this);}));function drawEraser(_x98){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(t){return _regeneratorRuntime().wrap(function _callee53$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:_context55.next=2;return this._post({drawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context55.stop();}},_callee53,this);}));function drawShape(_x99){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(t){return _regeneratorRuntime().wrap(function _callee54$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:_context56.next=2;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context56.stop();}},_callee54,this);}));function drawPencil(_x100){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t){var n,e;return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:e={drawCount:1/0,render:[],sp:[t]};(n=e.render)==null||n.push({isClearAll:!0,clearCanvas:St.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:St.Bg,viewId:this.viewId});_context57.next=4;return this._post(e);case 4:case"end":return _context57.stop();}},_callee55,this);}));function drawPencilFull(_x101){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"updateBatchEraserCombineNode",value:function updateBatchEraserCombineNode(t,e){var _this95=this;var n=[];var i;var _iterator55=_createForOfIteratorHelper(e.keys()),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var a=_step55.value;this.fullLayer.getElementsByName(a).forEach(function(o){var s=o.getBoundingClientRect();i=Pt(i,{x:s.x-se.SafeBorderPadding,y:s.y-se.SafeBorderPadding,w:s.width+se.SafeBorderPadding*2,h:s.height+se.SafeBorderPadding*2}),o.remove();});}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}return t.forEach(function(a){var o=_this95.vNodes.get(a);if(o)if(_this95.fullLayer.getElementsByName(a)[0])i=Pt(i,o.rect);else{var l=_this95.setFullWork(_objectSpread(_objectSpread({},o),{},{workId:a})),d=l&&l.consumeService({op:o.op,isFullWork:!0});d&&(o.rect=d,i=Pt(i,d));}}),i&&n.push({rect:i,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:i,drawCanvas:St.Bg,viewId:this.viewId}),n;}},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(t){var e,_iterator56,_step56,n,i,a,o;return _regeneratorRuntime().wrap(function _callee56$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:_iterator56=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context58.prev=1;_iterator56.s();case 3:if((_step56=_iterator56.n()).done){_context58.next=23;break;}n=_step56.value;i=this.setFullWork(n);if(!i){_context58.next=21;break;}a=(e=i.getWorkId())==null?void 0:e.toString();if(!(i.toolsType===ut.Image)){_context58.next=13;break;}_context58.next=11;return i.consumeServiceAsync({isFullWork:!0,replaceId:a,worker:this});case 11:_context58.next=20;break;case 13:if(!(i.toolsType===ut.Text)){_context58.next=18;break;}_context58.next=16;return i.consumeServiceAsync({isFullWork:!0,replaceId:a});case 16:_context58.next=20;break;case 18:o=n.ops&&Oe(n.ops);i.consumeService({op:o,isFullWork:!0,replaceId:a}),n!=null&&n.updateNodeOpt&&i.updataOptService(n.updateNodeOpt);case 20:n.workId&&this.workShapes["delete"](n.workId.toString());case 21:_context58.next=3;break;case 23:_context58.next=28;break;case 25:_context58.prev=25;_context58.t0=_context58["catch"](1);_iterator56.e(_context58.t0);case 28:_context58.prev=28;_iterator56.f();return _context58.finish(28);case 31:_context58.next=33;return this.reRenderSelector(t);case 33:case"end":return _context58.stop();}},_callee56,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x102){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(t){var o,e,n,i,a,s,l;return _regeneratorRuntime().wrap(function _callee57$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:e=t.opt,n=t.toolsType,i=t.point,a=this.setFullWork({workId:De,toolsType:n,opt:e});if(!(a&&i)){_context59.next=8;break;}s=a.cursorHover(i),l={render:[]};_context59.t0=s&&s.type===lt.CursorHover&&s.rect;if(!_context59.t0){_context59.next=8;break;}(o=l.render)==null||o.push({rect:wt(s.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:wt(s.rect),drawCanvas:St.Bg,viewId:this.viewId});_context59.next=8;return this._post(l);case 8:case"end":return _context59.stop();}},_callee57,this);}));function cursorHover(_x103){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(){var n,t,e;return _regeneratorRuntime().wrap(function _callee58$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:t=this.getWorkShape(De);_context60.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context60.t0){_context60.next=10;break;}e=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(De);_context60.t1=e;if(!_context60.t1){_context60.next=10;break;}_context60.next=10;return this._post({render:[{rect:wt(e),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:wt(e),drawCanvas:St.Bg,viewId:this.viewId}]});case 10:this.fullLayer.parent.children.forEach(function(i){i.name==="Cursor_Hover_Id"&&i.remove();});case 11:case"end":return _context60.stop();}},_callee58,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(Ai);var mm=/*#__PURE__*/function(){function mm(r){_classCallCheck(this,mm);rt(this,"viewId");rt(this,"vNodes");rt(this,"fullLayer");rt(this,"drawLayer");rt(this,"workShapes",/* @__PURE__ */new Map());rt(this,"selectorWorkShapes",/* @__PURE__ */new Map());rt(this,"thread");rt(this,"animationId");rt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());rt(this,"runEffectId");rt(this,"noAnimationRect");rt(this,"syncUnitTime",re.syncOpt.interval);rt(this,"post");this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this.thread=r.thread,this.post=r.thread.post.bind(r.thread);}return _createClass(mm,[{key:"destroy",value:function destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear();}},{key:"consumeDraw",value:function(){var _consumeDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(r){return _regeneratorRuntime().wrap(function _callee59$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:this.activeWorkShape(r),this.runAnimation();case 1:case"end":return _context61.stop();}},_callee59,this);}));function consumeDraw(_x104){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(r){this.activeWorkShape(r),this.runAnimation();}},{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,n){return t.toolsType=e,t.node=Fr({workId:r,toolsType:e,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(r){var _this96=this;r.forEach(function(t){_this96.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),_this96.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee60(r){var t,e,n;return _regeneratorRuntime().wrap(function _callee60$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:t=r.workId,e=t==null?void 0:t.toString();if(!e){_context62.next=10;break;}n=this.workShapes.get(e);if(!n){_context62.next=8;break;}this.workShapes["delete"](e);_context62.next=7;return this.removeNode(e,r,n==null?void 0:n.totalRect,!1);case 7:return _context62.abrupt("return");case 8:_context62.next=10;return this.removeNode(e,r);case 10:case"end":return _context62.stop();}},_callee60,this);}));function removeWork(_x105){return _removeWork3.apply(this,arguments);}return removeWork;}()},{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(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee61(r,t,e){var n,o,i,a,_args63=arguments;return _regeneratorRuntime().wrap(function _callee61$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:n=_args63.length>3&&_args63[3]!==undefined?_args63[3]:!0;r.indexOf(Nt)>-1&&this.removeSelectWork(t);i=e;a=(o=this.vNodes.get(r))==null?void 0:o.rect;a&&(i=Pt(a,i));this.fullLayer.getElementsByName(r).forEach(function(s){s.remove();});this.drawLayer.getElementsByName(r).forEach(function(s){s.remove();});this.vNodes["delete"](r);_context63.t0=i;if(!_context63.t0){_context63.next=12;break;}_context63.next=12;return this.post({render:[{rect:wt(i),isClear:!0,clearCanvas:n?St.Bg:St.ServiceFloat,workerType:n?void 0:Mt.Service,viewId:this.viewId},{rect:wt(i),drawCanvas:n?St.Bg:St.ServiceFloat,workerType:n?void 0:Mt.Service,viewId:this.viewId}]});case 12:case"end":return _context63.stop();}},_callee61,this);}));function removeNode(_x106,_x107,_x108){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(r){var y,P,T,v;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op,l=r.useAnimation;if(!t)return;var d=t.toString(),c=(y=this.vNodes.get(d))==null?void 0:y.rect;if(!((P=this.workShapes)!=null&&P.has(d))){var _x109={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,useAnimation:_typeof(l)<"u"?l:_typeof(a==null?void 0:a.useAnimation)<"u"?a==null?void 0:a.useAnimation:!0,oldRect:c,isDiff:!1};n&&e&&(_x109=this.setNodeKey(d,_x109,n,e)),(T=this.workShapes)==null||T.set(d,_x109);}var p=(v=this.workShapes)==null?void 0:v.get(d);i&&(p.type=i),o&&(p.animationWorkData=Oe(o),p.ops=o),a&&(p.updateNodeOpt=a),s&&(p.isDiff=this.hasDiffData(p.animationWorkData||[],s,p.toolsType),p.animationWorkData=s),p.node&&p.node.getWorkId()!==d&&p.node.setWorkId(d),c&&(p.oldRect=c),n&&e&&(e.syncUnitTime&&(this.syncUnitTime=e.syncUnitTime),p.toolsType!==n&&n&&e&&this.setNodeKey(d,p,n,e),p.node&&p.node.setWorkOptions(e));}},{key:"hasDiffData",value:function hasDiffData(r,t,e){var n=r.length;if(t.length<n)return!0;switch(e){case ut.Pencil:{for(var i=0;i<n;i+=3)if(t[i]!==r[i]||t[i+1]!==r[i+1])return!0;break;}case ut.LaserPen:{for(var _i10=0;_i10<n;_i10+=2)if(t[_i10]!==r[_i10]||t[_i10+1]!==r[_i10+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee62(){var _this97=this;var n,i,a,o,s,l,d,c,p,y,P,T,v,x,f,g,u,m,M,E,R,b,O,L,w,I,A,W,z,K,k,q,U,G,Z,nt,r,t,e,_iterator57,_step57,_loop6;return _regeneratorRuntime().wrap(function _callee62$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:this.animationId=void 0;r=!1;t={render:[]},e=/* @__PURE__ */new Map();_iterator57=_createForOfIteratorHelper(this.workShapes.entries());_context65.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step57$value,et,tt,J,ht,_J4,_ht3,_J5,_ht4,dt,B,_J6,_ht5,_J7,_ht6,_dt2,_B,F,Y,X,_Y,_J8,_ht7,_dt3,_B2,_F,_Y2;return _regeneratorRuntime().wrap(function _loop6$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:_step57$value=_slicedToArray(_step57.value,2),et=_step57$value[0],tt=_step57$value[1];_context64.t0=tt.toolsType;_context64.next=_context64.t0===ut.Image?4:_context64.t0===ut.Text?11:_context64.t0===ut.Arrow?19:_context64.t0===ut.Straight?19:_context64.t0===ut.Rectangle?19:_context64.t0===ut.Ellipse?19:_context64.t0===ut.Star?19:_context64.t0===ut.Polygon?19:_context64.t0===ut.SpeechBalloon?19:_context64.t0===ut.Pencil?22:_context64.t0===ut.BitMapEraser?37:_context64.t0===ut.PencilEraser?37:50;break;case 4:J=tt.oldRect;J&&((n=t.render)==null||n.push({rect:J,isClear:!0,clearCanvas:St.Bg,viewId:_this97.viewId}),(i=t.render)==null||i.push({rect:J,drawCanvas:St.Bg,viewId:_this97.viewId}));_context64.next=8;return(a=tt.node)==null?void 0:a.consumeServiceAsync({isFullWork:!0,worker:_this97.thread});case 8:ht=_context64.sent;_this97.selectorWorkShapes.forEach(function(dt,B){var F;(F=dt.selectIds)!=null&&F.includes(et)&&(_this97.willRunEffectSelectorIds.add(B),_this97.noAnimationRect=Pt(_this97.noAnimationRect,J),_this97.noAnimationRect=Pt(_this97.noAnimationRect,ht),_this97.runEffect());}),_this97.workShapes["delete"](et),(o=t.render)==null||o.push({rect:ht,drawCanvas:St.Bg,viewId:_this97.viewId});return _context64.abrupt("break",50);case 11:if(!tt.node){_context64.next=18;break;}_J4=tt.oldRect;_J4&&((s=t.render)==null||s.push({rect:_J4,isClear:!0,clearCanvas:St.Bg,viewId:_this97.viewId}),(l=t.render)==null||l.push({rect:_J4,drawCanvas:St.Bg,viewId:_this97.viewId}));_context64.next=16;return tt.node.consumeServiceAsync({isFullWork:!0,replaceId:et});case 16:_ht3=_context64.sent;_this97.selectorWorkShapes.forEach(function(dt,B){var F;(F=dt.selectIds)!=null&&F.includes(et)&&(_this97.willRunEffectSelectorIds.add(B),_this97.noAnimationRect=Pt(_this97.noAnimationRect,_J4),_this97.noAnimationRect=Pt(_this97.noAnimationRect,_ht3),_this97.runEffect());}),(d=tt.node)==null||d.clearTmpPoints(),_this97.workShapes["delete"](et),(c=t.render)==null||c.push({rect:_ht3,drawCanvas:St.Bg,viewId:_this97.viewId});case 18:return _context64.abrupt("break",50);case 19:_J5=!!tt.ops;if((p=tt.animationWorkData)!=null&&p.length){_ht4=tt.oldRect,dt=tt.node.oldRect;_ht4&&((y=t.render)==null||y.push({rect:_ht4,isClear:!0,clearCanvas:St.Bg,viewId:_this97.viewId}),(P=t.render)==null||P.push({rect:_ht4,drawCanvas:St.Bg,viewId:_this97.viewId})),dt&&((T=t.render)==null||T.push({rect:dt,isClear:!0,clearCanvas:St.ServiceFloat,viewId:_this97.viewId}));B=(v=tt.node)==null?void 0:v.consumeService({op:tt.animationWorkData,isFullWork:_J5});e.set(et,{workState:_ht4?tt.ops?Rt.Done:Rt.Doing:Rt.Start,op:tt.animationWorkData.filter(function(F,Y){if(Y%3!==2)return!0;}).slice(-2)}),_J5?(_this97.selectorWorkShapes.forEach(function(F,Y){var X;(X=F.selectIds)!=null&&X.includes(et)&&(_this97.willRunEffectSelectorIds.add(Y),_this97.noAnimationRect=Pt(_this97.noAnimationRect,_ht4),_this97.noAnimationRect=Pt(_this97.noAnimationRect,dt),_this97.noAnimationRect=Pt(_this97.noAnimationRect,B),_this97.runEffect());}),(x=tt.node)==null||x.clearTmpPoints(),_this97.workShapes["delete"](et),(f=t.render)==null||f.push({rect:B,drawCanvas:St.Bg,viewId:_this97.viewId})):(g=t.render)==null||g.push({rect:B,drawCanvas:St.ServiceFloat,workerType:_J5?void 0:Mt.Service,viewId:_this97.viewId}),tt.animationWorkData.length=0;}return _context64.abrupt("break",50);case 22:if(!(!tt.useAnimation&&tt.ops)){_context64.next=28;break;}_J6=(u=tt.node)==null?void 0:u.consumeService({op:tt.animationWorkData||[],isFullWork:!0,replaceId:et});_ht5=(m=tt.node)==null?void 0:m.updataOptService(tt.updateNodeOpt);_J6=Pt(_J6,_ht5),(M=t.render)==null||M.push({isClear:!0,rect:Pt(tt.oldRect,_J6),clearCanvas:St.Bg,viewId:_this97.viewId}),(E=t.render)==null||E.push({rect:Pt(tt.oldRect,_J6),drawCanvas:St.Bg,viewId:_this97.viewId}),_this97.selectorWorkShapes.forEach(function(dt,B){var F;(F=dt.selectIds)!=null&&F.includes(et)&&(_this97.willRunEffectSelectorIds.add(B),_this97.noAnimationRect=Pt(_this97.noAnimationRect,_J6),_this97.runEffect());}),(R=tt.node)==null||R.clearTmpPoints(),_this97.workShapes["delete"](et);_context64.next=36;break;case 28:if(!tt.useAnimation){_context64.next=36;break;}if(!tt.isDel){_context64.next=32;break;}(b=tt.node)==null||b.clearTmpPoints(),_this97.workShapes["delete"](et);return _context64.abrupt("break",50);case 32:_J7=3,_ht6=_this97.computNextAnimationIndex(tt,_J7),_dt2=tt.isDiff?0:Math.max(0,(tt.animationIndex||0)-_J7),_B=(tt.animationWorkData||[]).slice(_dt2,_ht6),F=(L=(O=tt.node)==null?void 0:O.getWorkId())==null?void 0:L.toString();if((tt.animationIndex||0)<_ht6||tt.isDiff){Y=(w=tt.node)==null?void 0:w.consumeService({op:_B,isFullWork:!1});if((I=t.render)==null||I.push({rect:Y,drawCanvas:St.ServiceFloat,viewId:_this97.viewId}),tt.animationIndex=_ht6,tt.isDiff&&(tt.isDiff=!1),_B.length){X=_B.filter(function(N,$){if($%_J7!==_J7-1)return!0;}).slice(-2);e.set(et,{workState:_dt2===0?Rt.Start:_ht6===((A=tt.animationWorkData)==null?void 0:A.length)?Rt.Done:Rt.Doing,op:X});}}else if(tt.ops){_Y=(W=tt.node)==null?void 0:W.consumeService({op:tt.animationWorkData||[],isFullWork:!0,replaceId:F});tt.isDel=!0,(z=t.render)==null||z.push({isClear:!0,rect:_Y,clearCanvas:St.ServiceFloat,viewId:_this97.viewId},{rect:_Y,drawCanvas:St.ServiceFloat,viewId:_this97.viewId},{isClear:!0,rect:_Y,clearCanvas:St.Bg,viewId:_this97.viewId},{rect:_Y,drawCanvas:St.Bg,viewId:_this97.viewId}),e.set(et,{workState:Rt.Done,op:_B.filter(function(X,N){if(N%_J7!==_J7-1)return!0;}).slice(-2)});}r=!0;return _context64.abrupt("break",50);case 36:return _context64.abrupt("break",50);case 37:if(!tt.isDel){_context64.next=40;break;}(K=tt.node)==null||K.clearTmpPoints(),_this97.workShapes["delete"](et);return _context64.abrupt("break",50);case 40:if(!(tt.ops&&(k=tt.animationWorkData)!=null&&k.length)){_context64.next=44;break;}_J8=tt.animationWorkData.slice(-3,-1);e.set(et,{workState:Rt.Done,op:_J8}),tt.isDel=!0;return _context64.abrupt("break",50);case 44:if(!tt.useAnimation){_context64.next=49;break;}_ht7=_this97.computNextAnimationIndex(tt,3),_dt3=tt.isDiff?0:Math.max(0,(tt.animationIndex||0)-3),_B2=(tt.animationWorkData||[]).slice(_dt3,_ht7);if((tt.animationIndex||0)<_ht7||tt.isDiff){_F=(q=tt.node)==null?void 0:q.consumeService({op:_B2,isFullWork:!0});if((U=t.render)==null||U.push({isClear:!0,rect:Pt(tt.oldRect,_F),clearCanvas:St.Bg,viewId:_this97.viewId}),(G=t.render)==null||G.push({rect:Pt(tt.oldRect,_F),drawCanvas:St.Bg,viewId:_this97.viewId}),tt.animationIndex=_ht7,tt.isDiff&&(tt.isDiff=!1),_B2.length){_Y2=_B2.filter(function(X,N){if(N%3!==2)return!0;}).slice(-2);e.set(et,{workState:_dt3===0?Rt.Start:_ht7===((Z=tt.animationWorkData)==null?void 0:Z.length)?Rt.Done:Rt.Doing,op:_Y2});}}r=!0;return _context64.abrupt("break",50);case 49:return _context64.abrupt("break",50);case 50:case"end":return _context64.stop();}},_loop6);});_iterator57.s();case 7:if((_step57=_iterator57.n()).done){_context65.next=11;break;}return _context65.delegateYield(_loop6(),"t0",9);case 9:_context65.next=7;break;case 11:_context65.next=16;break;case 13:_context65.prev=13;_context65.t1=_context65["catch"](4);_iterator57.e(_context65.t1);case 16:_context65.prev=16;_iterator57.f();return _context65.finish(16);case 19:r&&this.runAnimation();e.size&&(t.sp=[],e.forEach(function(et,tt){var J;(J=t.sp)==null||J.push({type:lt.Cursor,uid:tt.split(xr)[0],op:et.op,workState:et.workState,viewId:_this97.viewId});}));_context65.t2=(nt=t.render)!=null&&nt.length;if(!_context65.t2){_context65.next=25;break;}_context65.next=25;return this.post(t);case 25:case"end":return _context65.stop();}},_callee62,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this98=this;this.animationId||(this.animationId=setTimeout(function(){_this98.animationId=void 0,_this98.animationDraw();},16));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/this.syncUnitTime)*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(){var _effectRunSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(){var _this99=this;var r;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:this.runEffectId=void 0;r=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,a;var e=_this99.selectorWorkShapes.get(t),n=e&&e.selectIds&&((i=e.node)==null?void 0:i.selectServiceNode(t,e,!0));r=Pt(r,n),(a=e==null?void 0:e.selectIds)!=null&&a.length||_this99.selectorWorkShapes["delete"](t);});_context66.t0=r;if(!_context66.t0){_context66.next=7;break;}_context66.next=7;return this.post({render:[{rect:wt(r),isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:wt(r),drawCanvas:St.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context66.stop();}},_callee63,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(r){var d,c,p;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.selectIds,o=r.imageBitmap;if(!t)return;var s=t.toString();if(!((d=this.selectorWorkShapes)!=null&&d.has(s))){var y={toolsType:n,selectIds:a,type:i,opt:e,imageBitmap:o};n&&e&&(y=this.setNodeKey(s,y,n,e)),(c=this.selectorWorkShapes)==null||c.set(s,y);}var l=(p=this.selectorWorkShapes)==null?void 0:p.get(s);i&&(l.type=i),l.node&&l.node.getWorkId()!==s&&l.node.setWorkId(s),o&&(l.imageBitmap=o),l.selectIds=a||[];}}]);}();var vm=/*#__PURE__*/function(_Ai2){function vm(t){var _this100;_classCallCheck(this,vm);_this100=_callSuper(this,vm,[t]);rt(_this100,"drawWorkActiveId");return _this100;}_inherits(vm,_Ai2);return _createClass(vm,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(t){var i,e,n,a,o,s;return _regeneratorRuntime().wrap(function _callee64$(_context67){while(1)switch(_context67.prev=_context67.next){case 0:e=this.setFullWork(t),n=t.ops&&Oe(t.ops);if(!e){_context67.next=18;break;}s=(i=e.getWorkId())==null?void 0:i.toString();if(!(e.toolsType===ut.Image)){_context67.next=9;break;}_context67.next=6;return e.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 6:a=_context67.sent;_context67.next=16;break;case 9:if(!(e.toolsType===ut.Text)){_context67.next=15;break;}_context67.next=12;return e.consumeServiceAsync({isFullWork:!0,replaceId:s,isDrawLabel:!0});case 12:a=_context67.sent;_context67.next=16;break;case 15:a=e.consumeService({op:n,isFullWork:!0,replaceId:s}),o=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context67.abrupt("return",Pt(a,o));case 18:case"end":return _context67.stop();}},_callee64,this);}));function runFullWork(_x110){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 _iterator58=_createForOfIteratorHelper(this.workShapes.keys()),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var t=_step58.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}this.fullLayer.removeAllChildren();}},{key:"canUseSubWorker",value:function canUseSubWorker(t){var e=this.thread.getPriorityDraw();return e||!e&&t!==ut.Pencil;}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t){var e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:e=t.workId,n=e==null?void 0:e.toString(),i=n&&this.workShapes.get(n);if(i){_context68.next=3;break;}return _context68.abrupt("return");case 3:_context68.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==n;if(!_context68.t0){_context68.next=8;break;}_context68.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:lt.DrawWork,dataType:Mt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&n!==Nt&&(this.drawWorkActiveId=n);a=i.toolsType,o=i.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0});_context68.t1=a;_context68.next=_context68.t1===ut.Arrow?13:_context68.t1===ut.Straight?13:_context68.t1===ut.Ellipse?13:_context68.t1===ut.Rectangle?13:_context68.t1===ut.Star?13:_context68.t1===ut.Polygon?13:_context68.t1===ut.SpeechBalloon?13:_context68.t1===ut.Pencil?19:25;break;case 13:_context68.t2=o;if(!_context68.t2){_context68.next=18;break;}this.drawCount++;_context68.next=18;return this.drawShape(o);case 18:return _context68.abrupt("break",25);case 19:_context68.t3=o;if(!_context68.t3){_context68.next=24;break;}this.drawCount++;_context68.next=24;return this.drawPencil(o,e==null?void 0:e.toString());case 24:return _context68.abrupt("break",25);case 25:case"end":return _context68.stop();}},_callee65,this);}));function consumeDraw(_x111){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:e=t.workId;if(!e){_context69.next=12;break;}n=e.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);i=this.workShapes.get(n);if(i){_context69.next=7;break;}return _context69.abrupt("return");case 7:_context69.t0=i.toolsType;_context69.next=_context69.t0===ut.Arrow?10:_context69.t0===ut.Straight?10:_context69.t0===ut.Ellipse?10:_context69.t0===ut.Pencil?10:_context69.t0===ut.Rectangle?10:_context69.t0===ut.Star?10:_context69.t0===ut.Polygon?10:_context69.t0===ut.SpeechBalloon?10:12;break;case 10:this.drawCount=0,this.fullLayer.removeAllChildren(),this.clearWorkShapeNodeCache(n);return _context69.abrupt("break",12);case 12:case"end":return _context69.stop();}},_callee66,this);}));function consumeDrawAll(_x112){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){var e,n,i,a;return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context70.next=8;break;}i=this.removeNode(n);if(!i){_context70.next=8;break;}a=[];a.push({rect:wt(i),clearCanvas:St.Float,isClear:!0,viewId:this.viewId},{rect:wt(i),drawCanvas:St.Float,viewId:this.viewId});_context70.next=8;return this._post({render:a});case 8:case"end":return _context70.stop();}},_callee67,this);}));function removeWork(_x113){return _removeWork4.apply(this,arguments);}return removeWork;}()},{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=Pt(n,{x:a.x-vt.SafeBorderPadding,y:a.y-vt.SafeBorderPadding,w:a.width+vt.SafeBorderPadding*2,h:a.height+vt.SafeBorderPadding*2}),i.remove();}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t,e){return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:_context71.next=2;return this._post({drawCount:this.drawCount,render:[{rect:t==null?void 0:t.rect,workId:e,drawCanvas:St.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context71.stop();}},_callee68,this);}));function drawPencil(_x114,_x115){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(t){return _regeneratorRuntime().wrap(function _callee69$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:_context72.next=2;return this._post({drawCount:this.drawCount,render:[{rect:(t==null?void 0:t.rect)&&wt(t.rect),isClear:!0,clearCanvas:St.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&wt(t.rect),drawCanvas:St.Float,viewId:this.viewId}]});case 2:case"end":return _context72.stop();}},_callee69,this);}));function drawShape(_x116){return _drawShape2.apply(this,arguments);}return drawShape;}()}]);}(Ai);var ym=/*#__PURE__*/function(){function ym(r){_classCallCheck(this,ym);rt(this,"viewId");rt(this,"vNodes");rt(this,"topLayer");rt(this,"thread");rt(this,"post");rt(this,"serviceWorkShapes",/* @__PURE__ */new Map());rt(this,"localWorkShapes",/* @__PURE__ */new Map());rt(this,"tmpOpt");rt(this,"syncUnitTime",re.syncOpt.interval);rt(this,"animationId");this.viewId=r.viewId,this.vNodes=r.vNodes,this.topLayer=r.topLayer,this.thread=r.thread,this.post=r.thread.post.bind(r.thread);}return _createClass(ym,[{key:"canUseTopLayer",value:function canUseTopLayer(r){return r===ut.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(r){return this.localWorkShapes.get(r);}},{key:"createWorkShape",value:function createWorkShape(r,t){if(r&&this.tmpOpt){var _e15={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},_e15),{},{workId:r}));return n&&this.localWorkShapes.set(r,{node:n,toolsType:n.toolsType,workState:Rt.Start}),n;}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var n;var e=(n=this.localWorkShapes.get(r))==null?void 0:n.node;e||this.createWorkShape(r,t),e==null||e.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t=r.toolsType;if(t===ut.LaserPen)return Fr(_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){var t;this.tmpOpt=r,(t=r.toolsOpt)!=null&&t.syncUnitTime&&(this.syncUnitTime=r.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{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=Pt(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=Pt(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,n){return t.toolsType=e,t.node=this.createWorkShapeNode({workId:r,toolsType:e,toolsOpt:n}),t;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(r){var p,y;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op;if(!t)return;var l=t.toString(),d=(p=this.vNodes.get(l))==null?void 0:p.rect;if(!((y=this.serviceWorkShapes)!=null&&y.has(l))){var P={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,oldRect:d};n&&e&&(P=this.setNodeKey(l,P,n,e)),this.serviceWorkShapes.set(l,P);}var c=this.serviceWorkShapes.get(l);i&&(c.type=i),o&&(c.animationWorkData=Oe(o),c.ops=o),a&&(c.updateNodeOpt=a),s&&(c.animationWorkData=s),c.node&&c.node.getWorkId()!==l&&c.node.setWorkId(l),d&&(c.oldRect=d),n&&e&&(c.toolsType!==n&&n&&e&&this.setNodeKey(l,c,n,e),c.node&&c.node.setWorkOptions(e));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(){var _this101=this;var a,o,s,l,r,t,e,n,i,_iterator59,_step59,_step59$value,d,c,y,P,T,v,_iterator60,_step60,_step60$value,_d14,_c7,p,_y14,_P4,_T4,_v13;return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:this.animationId=void 0;r=!1;t=/* @__PURE__ */new Map(),e=[],n=[],i=[];_iterator59=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context73.prev=4;_iterator59.s();case 6:if((_step59=_iterator59.n()).done){_context73.next=20;break;}_step59$value=_slicedToArray(_step59.value,2),d=_step59$value[0],c=_step59$value[1];_context73.t0=c.toolsType;_context73.next=_context73.t0===ut.LaserPen?11:18;break;case 11:y=this.computNextAnimationIndex(c,8),P=Math.max(0,c.animationIndex||0),T=(c.animationWorkData||[]).slice(P,y);if((c.animationIndex||0)<y){v=(a=c.node)==null?void 0:a.consumeService({op:T,isFullWork:!1});c.totalRect=Pt(c.totalRect,v),c.animationIndex=y,T.length&&t.set(d,{workState:P===0?Rt.Start:y===((o=c.animationWorkData)==null?void 0:o.length)?Rt.Done:Rt.Doing,op:T.slice(-2)});}if(!(n.push({isClear:!0,rect:c.totalRect,clearCanvas:St.TopFloat,viewId:this.viewId}),e.push({rect:c.totalRect,drawCanvas:St.TopFloat,viewId:this.viewId}),c.isDel)){_context73.next=16;break;}(s=c.node)==null||s.clearTmpPoints(),this.serviceWorkShapes["delete"](d);return _context73.abrupt("break",18);case 16:c.ops&&c.animationIndex===((l=c.animationWorkData)==null?void 0:l.length)&&!c.isDel&&(this.topLayer.getElementsByName(d.toString())[0]||(c.isDel=!0,this.serviceWorkShapes.set(d,c))),r=!0;return _context73.abrupt("break",18);case 18:_context73.next=6;break;case 20:_context73.next=25;break;case 22:_context73.prev=22;_context73.t1=_context73["catch"](4);_iterator59.e(_context73.t1);case 25:_context73.prev=25;_iterator59.f();return _context73.finish(25);case 28:_iterator60=_createForOfIteratorHelper(this.localWorkShapes.entries());_context73.prev=29;_iterator60.s();case 31:if((_step60=_iterator60.n()).done){_context73.next=44;break;}_step60$value=_slicedToArray(_step60.value,2),_d14=_step60$value[0],_c7=_step60$value[1];p=_c7.result,_y14=_c7.toolsType,_P4=_c7.totalRect,_T4=_c7.isDel,_v13=_c7.workState;_context73.t2=_y14;_context73.next=_context73.t2===ut.LaserPen?37:42;break;case 37:if(!(_P4&&(n.push({isClear:!0,rect:_P4,clearCanvas:St.TopFloat,viewId:this.viewId}),e.push({rect:_P4,drawCanvas:St.TopFloat,viewId:this.viewId})),_T4)){_context73.next=40;break;}_c7.node.clearTmpPoints(),this.localWorkShapes["delete"](_d14),i.push({removeIds:[_d14.toString()],viewId:this.viewId,type:lt.RemoveNode});return _context73.abrupt("break",42);case 40:p&&((p.op||p.ops)&&i.push(p),_c7.result=void 0),!this.topLayer.getElementsByName(_d14.toString())[0]&&_v13===Rt.Done&&(_c7.isDel=!0,this.localWorkShapes.set(_d14,_c7)),r=!0;return _context73.abrupt("break",42);case 42:_context73.next=31;break;case 44:_context73.next=49;break;case 46:_context73.prev=46;_context73.t3=_context73["catch"](29);_iterator60.e(_context73.t3);case 49:_context73.prev=49;_iterator60.f();return _context73.finish(49);case 52:r&&this.runAnimation(),t.size&&t.forEach(function(d,c){i.push({type:lt.Cursor,uid:c.split(xr)[0],op:d.op,workState:d.workState,viewId:_this101.viewId});}),(e.length||n.length||i.length)&&this.post({render:[].concat(n,e),sp:i});case 53:case"end":return _context73.stop();}},_callee70,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this102=this;this.animationId||(this.animationId=setTimeout(function(){_this102.animationId=void 0,_this102.animationDraw();},16));}}]);}();var Ne=/* @__PURE__ */function(h){return h.Full="full",h.Sub="sub",h;}(Ne||{});var Sm=/*#__PURE__*/function(){function Sm(r,t){_classCallCheck(this,Sm);rt(this,"_self");rt(this,"version",ci);rt(this,"type");rt(this,"hasPriorityDraw",!0);rt(this,"workThreadMap",/* @__PURE__ */new Map());this._self=r,this.type=t,this.register();}return _createClass(Sm,[{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 xm(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),this.type==="sub"&&(o=new Tm(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this)),o.setHasPriorityDraw(this.hasPriorityDraw)),o&&a&&o.setIsSafari(a),o&&r.cameraOpt&&o.setCameraOpt(r.cameraOpt),o&&this.workThreadMap.set(t,o);}},{key:"register",value:function register(){var _this103=this;onmessage=/*#__PURE__*/function(){var _ref170=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(r){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_e16,n,i,a,o,_iterator61,_step61,l,_iterator62,_step62,_step62$value,_l9,d,c,_iterator63,_step63,_l10,s;return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:t=r.data;if(!t){_context74.next=56;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context74.prev=4;_iterator=_asyncIterator(t.values());case 6:_context74.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context74.sent).done)){_context74.next=40;break;}_e16=_step.value;n=_e16.msgType,i=_e16.viewId,a=_e16.tasksqueue,o=_e16.mainTasksqueueCount;if(!(n===lt.Console)){_context74.next=14;break;}console.log(_this103);return _context74.abrupt("continue",37);case 14:if(!(n===lt.Init)){_context74.next=17;break;}_this103.init(_e16);return _context74.abrupt("continue",37);case 17:if(!(_this103.type==="sub"&&(n===lt.PriorityWorker||n===lt.PriorityMainThreadWorker))){_context74.next=22;break;}n===lt.PriorityWorker?_this103.hasPriorityDraw=!0:n===lt.PriorityMainThreadWorker&&(_this103.hasPriorityDraw=!1);_iterator61=_createForOfIteratorHelper(_this103.workThreadMap.values());try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){l=_step61.value;l.setHasPriorityDraw(_this103.hasPriorityDraw);}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}return _context74.abrupt("continue",37);case 22:if(!(n===lt.TasksQueue&&a!=null&&a.size)){_context74.next=27;break;}_iterator62=_createForOfIteratorHelper(_this103.workThreadMap.entries());try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){_step62$value=_slicedToArray(_step62.value,2),_l9=_step62$value[0],d=_step62$value[1];c=a.get(_l9);c&&d.on(c);}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}_this103.type==="full"&&_t(o)&&_this103.post({workerTasksqueueCount:o});return _context74.abrupt("continue",37);case 27:if(!(i===Wi)){_context74.next=31;break;}_iterator63=_createForOfIteratorHelper(_this103.workThreadMap.values());try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){_l10=_step63.value;_l10.on(_e16),n===lt.Destroy&&_this103.workThreadMap["delete"](i);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}return _context74.abrupt("continue",37);case 31:s=_this103.workThreadMap.get(i);_context74.t0=s;if(!_context74.t0){_context74.next=37;break;}_context74.next=36;return s.on(_e16);case 36:n===lt.Destroy&&_this103.workThreadMap["delete"](i);case 37:_iteratorAbruptCompletion=false;_context74.next=6;break;case 40:_context74.next=46;break;case 42:_context74.prev=42;_context74.t1=_context74["catch"](4);_didIteratorError=true;_iteratorError=_context74.t1;case 46:_context74.prev=46;_context74.prev=47;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context74.next=51;break;}_context74.next=51;return _iterator["return"]();case 51:_context74.prev=51;if(!_didIteratorError){_context74.next=54;break;}throw _iteratorError;case 54:return _context74.finish(51);case 55:return _context74.finish(46);case 56:case"end":return _context74.stop();}},_callee71,null,[[4,42,46,56],[47,,51,55]]);}));return function onmessage(_x117){return _ref170.apply(this,arguments);};}();}},{key:"post",value:function post(r,t){t?this._self.postMessage(r,t):this._self.postMessage(r);}}]);}();var xm=/*#__PURE__*/function(_Ci){function xm(t,e,n){var _this104;_classCallCheck(this,xm);_this104=_callSuper(this,xm,[t,e,"full"/* Full */]);rt(_this104,"type","full");rt(_this104,"serviceDrawLayer");rt(_this104,"localDrawLayer");rt(_this104,"snapshotFullLayer");rt(_this104,"methodBuilder");rt(_this104,"localWork");rt(_this104,"serviceWork");rt(_this104,"_post");rt(_this104,"taskUpdateCameraId");rt(_this104,"debounceUpdateCameraId");rt(_this104,"debounceUpdateCache",/* @__PURE__ */new Set());_this104._post=n;var i=re.bufferSize.sub;_this104.serviceDrawLayer=_this104.createLayer("serviceDrawLayer",_this104.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i})),_this104.localDrawLayer=_this104.createLayer("localDrawLayer",_this104.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i}));var a={thread:_this104,viewId:_this104.viewId,vNodes:_this104.vNodes,fullLayer:_this104.fullLayer};_this104.localWork=new pm(_objectSpread(_objectSpread({},a),{},{drawLayer:_this104.localDrawLayer})),_this104.serviceWork=new mm(_objectSpread(_objectSpread({},a),{},{drawLayer:_this104.serviceDrawLayer})),_this104.methodBuilder=new Vi([bt.CopyNode,bt.SetColorNode,bt.DeleteNode,bt.RotateNode,bt.ScaleNode,bt.TranslateNode,bt.ZIndexNode,bt.SetFontStyle,bt.SetPoint,bt.SetLock,bt.SetShapeOpt]).registerForWorker(_this104),_this104.vNodes.init(_this104.fullLayer);return _this104;}_inherits(xm,_Ci);return _createClass(xm,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(){var _this105=this;var a,o,_this$combinePostData,t,e,n,s,_iterator64,_step64,l,d,i;return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,e=_objectWithoutProperties(_this$combinePostData,_excluded4);if(!(t!=null&&t.length)){_context75.next=28;break;}s=[];_iterator64=_createForOfIteratorHelper(t);_context75.prev=4;_iterator64.s();case 6:if((_step64=_iterator64.n()).done){_context75.next=19;break;}l=_step64.value;if(!l.rect){_context75.next=17;break;}if(!(l.rect=this.safariFixRect(Xt(l.rect),this.dpr),!l.rect)){_context75.next=11;break;}return _context75.abrupt("continue",17);case 11:if(!(l.drawCanvas&&l.rect&&l.rect.w>0&&l.rect.h>0)){_context75.next=16;break;}_context75.next=14;return this.getRectImageBitmap(l);case 14:d=_context75.sent;l.imageBitmap=d,n||(n=[]),n.push(d);case 16:s.push(l);case 17:_context75.next=6;break;case 19:_context75.next=24;break;case 21:_context75.prev=21;_context75.t0=_context75["catch"](4);_iterator64.e(_context75.t0);case 24:_context75.prev=24;_iterator64.f();return _context75.finish(24);case 27:e.render=s;case 28:i=(a=e.sp)==null?void 0:a.filter(function(s){return s.type!==lt.None;});i!=null&&i.length?e.sp=i.map(function(s){return _objectSpread(_objectSpread({},s),{},{viewId:_this105.viewId});}):delete e.sp,e.drawCount===void 0&&delete e.drawCount,(e!=null&&e.drawCount||i!=null&&i.length||(o=e.render)!=null&&o.length)&&this._post(e,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context75.stop();}},_callee72,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 _callee73(t){var e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context76.next=2;break;}return _context76.abrupt("return");case 2:e=t.msgType,n=t.dataType,i=t.workId,a=t.toolsType,o=t.workState;_context76.t0=e;_context76.next=_context76.t0===lt.CreateWork?6:_context76.t0===lt.DrawWork?8:_context76.t0===lt.Select?17:_context76.t0===lt.UpdateNode?24:_context76.t0===lt.FullWork?24:_context76.t0===lt.RemoveNode?26:_context76.t0===lt.GetTextActive?29:_context76.t0===lt.CursorHover?32:_context76.t0===lt.CursorBlur?35:38;break;case 6:a!==ut.LaserPen&&this.createLocalWork(t);return _context76.abrupt("break",38);case 8:_context76.t1=a!==ut.LaserPen;if(!_context76.t1){_context76.next=16;break;}if(!(o===Rt.Done&&n===Mt.Local)){_context76.next=15;break;}_context76.next=13;return this.consumeDrawAll(n,t);case 13:_context76.next=16;break;case 15:this.consumeDraw(n,t);case 16:return _context76.abrupt("break",38);case 17:if(!(i===Nt)){_context76.next=22;break;}_context76.next=20;return this.localWork.updateFullSelectWork(t);case 20:_context76.next=23;break;case 22:this.serviceWork.runSelectWork(t);case 23:return _context76.abrupt("return");case 24:this.consumeFull(n,t);return _context76.abrupt("return");case 26:_context76.next=28;return this.removeNode(t);case 28:return _context76.abrupt("return");case 29:_context76.next=31;return this.checkTextActive(t);case 31:return _context76.abrupt("return");case 32:_context76.next=34;return this.cursorHover(t);case 34:return _context76.abrupt("return");case 35:_context76.next=37;return this.cursorBlur();case 37:return _context76.abrupt("return");case 38:_context76.next=40;return _superPropGet(xm,"on",this,3)([t]);case 40:case"end":return _context76.stop();}},_callee73,this);}));function on(_x118){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t){var _this106=this;var e,n,i,a,o,_iterator65,_step65,s;return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:e=t.dataType,n=t.workId,i=t.removeIds,a=[],o=i||[];if(!(n&&o.push(n.toString()),o.length)){_context77.next=6;break;}_iterator65=_createForOfIteratorHelper(o);try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){s=_step65.value;s===Nt?a.push(this.localWork.removeSelector(t)):e===Mt.Local?a.push(this.localWork.removeWork(t).then(function(){_this106.localWork.colloctEffectSelectWork(t);})):e===Mt.Service&&a.push(this.serviceWork.removeWork(t).then(function(){_this106.localWork.colloctEffectSelectWork(t);}));}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}_context77.next=6;return Promise.all(a);case 6:case"end":return _context77.stop();}},_callee74,this);}));function removeNode(_x119){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t){var e;return _regeneratorRuntime().wrap(function _callee75$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:e=t.dataType;_context78.t0=e===Mt.Local;if(!_context78.t0){_context78.next=5;break;}_context78.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context78.stop();}},_callee75,this);}));function checkTextActive(_x120){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){return _regeneratorRuntime().wrap(function _callee76$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:this.vNodes.clear();_superPropGet(xm,"clearAll",this,3)([]);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());_context79.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:St.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:St.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:St.Float,viewId:this.viewId}],sp:[{type:lt.Clear}]});case 6:case"end":return _context79.stop();}},_callee76,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_superPropGet(xm,"updateLayer",this,3)([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 St.Bg:return this.fullLayer;case St.ServiceFloat:return this.serviceDrawLayer;case St.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 _callee77(t,e){var n;return _regeneratorRuntime().wrap(function _callee77$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:_context80.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context80.sent;_context80.t0=n&&t===Mt.Local;if(!_context80.t0){_context80.next=7;break;}_context80.next=7;return this.localWork.consumeFull(n);case 7:n&&t===Mt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context80.stop();}},_callee77,this);}));function consumeFull(_x121,_x122){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t,e){var n;return _regeneratorRuntime().wrap(function _callee78$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:n=e.workId;_context81.t0=t===Mt.Local&&n;if(!_context81.t0){_context81.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context81.next=6;return this.localWork.consumeDraw(e,this.serviceWork);case 6:t===Mt.Service&&this.serviceWork.consumeDraw(e);case 7:case"end":return _context81.stop();}},_callee78,this);}));function consumeDraw(_x123,_x124){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t,e){var n;return _regeneratorRuntime().wrap(function _callee79$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:n=e.workId;_context82.t0=t===Mt.Local&&n;if(!_context82.t0){_context82.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context82.next=6;return this.localWork.consumeDrawAll(e,this.serviceWork);case 6:case"end":return _context82.stop();}},_callee79,this);}));function consumeDrawAll(_x125,_x126){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t){var _this107=this;var a,e,n,i,o,p,_iterator66,_step66,_step66$value,y,P,s,_iterator67,_step67,_step67$value,_p9,_y19,_P8,l,d,_p5,_iterator68,_step68,_y15,c,_iterator69,_step69,_p6,_y16,_iterator70,_step70,_P5,_iterator71,_step71,_step71$value,_p8,_y18,_P7,T,v,_x129,_f37,g,u,m,M,_iterator72,_step72,_step72$value,_p7,_y17;return _regeneratorRuntime().wrap(function _callee80$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:e=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!oe(this.cameraOpt,n))){_context83.next=40;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);o=!!this.serviceDrawLayer.children.length;if(!i){_context83.next=30;break;}p=!1;_iterator66=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context83.prev=7;_iterator66.s();case 9:if((_step66=_iterator66.n()).done){_context83.next=19;break;}_step66$value=_slicedToArray(_step66.value,2),y=_step66$value[0],P=_step66$value[1];_context83.t0=P.toolsType;_context83.next=_context83.t0===ut.Text?14:_context83.t0===ut.BitMapEraser?14:_context83.t0===ut.PencilEraser?14:_context83.t0===ut.Eraser?14:_context83.t0===ut.Selector?14:_context83.t0===ut.LaserPen?14:15;break;case 14:return _context83.abrupt("break",17);case 15:y!==De&&y!==Nt&&(p=!0);return _context83.abrupt("break",17);case 17:_context83.next=9;break;case 19:_context83.next=24;break;case 21:_context83.prev=21;_context83.t1=_context83["catch"](7);_iterator66.e(_context83.t1);case 24:_context83.prev=24;_iterator66.f();return _context83.finish(24);case 27:if(!p){_context83.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this107.taskUpdateCameraId=void 0,_this107.updateCamera(t);},Cn);return _context83.abrupt("return");case 30:s=/* @__PURE__ */new Map();_iterator67=_createForOfIteratorHelper(this.vNodes.getNodesByType(ut.Text).entries());try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){_step67$value=_slicedToArray(_step67.value,2),_p9=_step67$value[0],_y19=_step67$value[1];_P8=_y19.rect;s.set(_p9,Xt(_P8));}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}l=new Set(s.keys());d=!1;if(this.localWork.hasSelector()){_p5=(a=this.localWork.getSelector())==null?void 0:a.selectIds;if(_p5){d=!0;_iterator68=_createForOfIteratorHelper(_p5);try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){_y15=_step68.value;l.add(_y15);}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}}}c=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator69=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){_p6=_step69.value;_y16=_p6.selectIds;if(_y16){c=!0;_iterator70=_createForOfIteratorHelper(_y16);try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){_P5=_step70.value;l.add(_P5);}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}}}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(l),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator71=_createForOfIteratorHelper(s.entries());try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){_step71$value=_slicedToArray(_step71.value,2),_p8=_step71$value[0],_y18=_step71$value[1];_P7=this.vNodes.get(_p8);if(_P7){T=_y18,v=_P7.rect,_x129=this.getSceneRect(),_f37=fr(T,_x129),g=fr(v,_x129);u=!1;if((_f37!==g||T.w!==v.w||T.h!==v.h||g===Pe.intersect)&&(u=!0),u){m=_P7.toolsType,M=_P7.opt;m===ut.Text&&M.workState===Rt.Done&&this.debounceUpdateCache.add(_p8);}}}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}if(d&&this.localWork.reRenderSelector(),c){_iterator72=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){_step72$value=_slicedToArray(_step72.value,2),_p7=_step72$value[0],_y17=_step72$value[1];this.serviceWork.runSelectWork({workId:_p7,selectIds:_y17.selectIds,msgType:lt.Select,dataType:Mt.Service,viewId:this.viewId});}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}}this.debounceUpdateCameraId=setTimeout(function(){var y;_this107.debounceUpdateCameraId=void 0;var p=[];var _iterator73=_createForOfIteratorHelper(_this107.debounceUpdateCache.values()),_step73;try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){var _P6=_step73.value;if((y=_this107.fullLayer)==null?void 0:y.getElementsByName(_P6)[0]){var v=_this107.vNodes.get(_P6);if(v){var _x128=v.toolsType,_f36=v.opt,g=v.rect,u=_this107.localWork.setFullWork({toolsType:_x128,opt:_f36,workId:_P6});if(u){var m=_this107.getSceneRect(),M=fr(g,m);p.push(u.consumeServiceAsync({isFullWork:!0,replaceId:_P6,isDrawLabel:M!==Pe.outside}));}}}_this107.debounceUpdateCache["delete"](_P6);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}p.length?Promise.all(p).then(function(){var P=[];P.push({isClearAll:!0,clearCanvas:St.Bg,viewId:_this107.viewId},{isDrawAll:!0,drawCanvas:St.Bg,viewId:_this107.viewId}),P.length&&_this107.post({render:P}),_this107.vNodes.updateLowLevelNodesRect(),_this107.vNodes.clearHighLevelIds();}):(_this107.vNodes.updateLowLevelNodesRect(),_this107.vNodes.clearHighLevelIds());},Cn);}o&&e.push({isClearAll:!0,clearCanvas:St.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&e.push({isClearAll:!0,clearCanvas:St.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:St.Bg,viewId:this.viewId}),e.length&&this.post({render:e});case 40:case"end":return _context83.stop();}},_callee80,this,[[7,21,24,27]]);}));function updateCamera(_x127){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=t.rect,n=t.drawCanvas,i=Math.floor(e.x*this.dpr),a=Math.floor(e.y*this.dpr),o=Math.floor(e.w*this.dpr||1),s=Math.floor(e.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),i,a,o,s,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(t){return _regeneratorRuntime().wrap(function _callee81$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:_context84.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context84.stop();}},_callee81,this);}));function cursorHover(_x130){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(){return _regeneratorRuntime().wrap(function _callee82$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:_context85.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context85.stop();}},_callee82,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(xm,"destroy",this,3)([]);}}]);}(Ci);var Tm=/*#__PURE__*/function(_Ci2){function Tm(t,e,n){var _this108;_classCallCheck(this,Tm);_this108=_callSuper(this,Tm,[t,e,"sub"/* Sub */]);rt(_this108,"type","sub");rt(_this108,"_post");rt(_this108,"topLayer");rt(_this108,"snapshotFullLayer");rt(_this108,"serviceWork");rt(_this108,"localWork");rt(_this108,"topLayerWork");_this108._post=n;var i=re.bufferSize.sub;_this108.topLayer=_this108.createLayer("topLayer",_this108.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i}));var a={thread:_this108,viewId:_this108.viewId,vNodes:_this108.vNodes,fullLayer:_this108.fullLayer,topLayer:_this108.topLayer};_this108.localWork=new vm(a),_this108.topLayerWork=new ym(a),_this108.vNodes.init(_this108.fullLayer);return _this108;}_inherits(Tm,_Ci2);return _createClass(Tm,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(){var _this109=this;var a,o,s,_this$combinePostData2,t,e,n,l,_iterator74,_step74,_d15,_i11,_l11,d,_l12,_iterator75,_step75,_d16,c,i;return _regeneratorRuntime().wrap(function _callee83$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,e=_objectWithoutProperties(_this$combinePostData2,_excluded5);if((a=e.workIds)!=null&&a.size&&e.drawCount){l=[];_iterator74=_createForOfIteratorHelper(e.workIds.values());try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){_d15=_step74.value;this.fullLayer.getElementsByName(_d15).forEach(function(c){c.id&&e.drawCount&&Number(c.id)<e.drawCount&&l.push(c);});}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}for(_i11=0,_l11=l;_i11<_l11.length;_i11++){d=_l11[_i11];d.remove(),d.disconnect();}}if(!(t!=null&&t.length)){_context86.next=29;break;}_l12=[];_iterator75=_createForOfIteratorHelper(t);_context86.prev=5;_iterator75.s();case 7:if((_step75=_iterator75.n()).done){_context86.next=20;break;}_d16=_step75.value;if(!_d16.rect){_context86.next=18;break;}if(!(_d16.rect=this.safariFixRect(Xt(_d16.rect),this.dpr),!_d16.rect)){_context86.next=12;break;}return _context86.abrupt("continue",18);case 12:if(!(_d16.drawCanvas&&_d16.rect&&_d16.rect.w>0&&_d16.rect.h>0)){_context86.next=17;break;}_context86.next=15;return this.getRectImageBitmap(_d16);case 15:c=_context86.sent;_d16.imageBitmap=c,n||(n=[]),n.push(c);case 17:_l12.push(_d16);case 18:_context86.next=7;break;case 20:_context86.next=25;break;case 22:_context86.prev=22;_context86.t0=_context86["catch"](5);_iterator75.e(_context86.t0);case 25:_context86.prev=25;_iterator75.f();return _context86.finish(25);case 28:e.render=_l12;case 29:i=(o=e.sp)==null?void 0:o.filter(function(l){return l.type!==lt.None;});i!=null&&i.length?e.sp=i.map(function(l){return _objectSpread(_objectSpread({},l),{},{viewId:_this109.viewId});}):delete e.sp,e.drawCount===void 0&&delete e.drawCount,(i!=null&&i.length||e.drawCount||(s=e==null?void 0:e.render)!=null&&s.length)&&this._post(e,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 31:case"end":return _context86.stop();}},_callee83,this,[[5,22,25,28]]);}));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 St.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(t){var e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee84$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.dataType,o=t.workState;_context87.t0=e;_context87.next=_context87.t0===lt.UpdateTools?4:_context87.t0===lt.CreateWork?9:_context87.t0===lt.DrawWork?11:_context87.t0===lt.RemoveNode?18:_context87.t0===lt.FullWork?21:_context87.t0===lt.Snapshot?26:_context87.t0===lt.BoundingBox?33:40;break;case 4:if(!(n&&this.topLayerWork.canUseTopLayer(n)&&i)){_context87.next=8;break;}s={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(s);return _context87.abrupt("return");case 8:return _context87.abrupt("break",40);case 9:this.createLocalWork(t);return _context87.abrupt("return");case 11:if(!(o===Rt.Done&&a===Mt.Local)){_context87.next=16;break;}_context87.next=14;return this.consumeDrawAll(a,t);case 14:_context87.next=17;break;case 16:this.consumeDraw(a,t);case 17:return _context87.abrupt("return");case 18:_context87.next=20;return this.removeNode(t);case 20:return _context87.abrupt("return");case 21:_context87.t1=n&&this.topLayerWork.canUseTopLayer(n);if(!_context87.t1){_context87.next=25;break;}_context87.next=25;return this.consumeDrawAll(a,t);case 25:return _context87.abrupt("return");case 26:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===qe?6e3:3e3}));_context87.t2=this.snapshotFullLayer;if(!_context87.t2){_context87.next=32;break;}_context87.next=31;return this.getSnapshot(t);case 31:this.snapshotFullLayer=void 0;case 32:return _context87.abrupt("return");case 33:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===qe?6e3:3e3}));_context87.t3=this.snapshotFullLayer;if(!_context87.t3){_context87.next=39;break;}_context87.next=38;return this.getBoundingRect(t);case 38:this.snapshotFullLayer=void 0;case 39:return _context87.abrupt("return");case 40:_context87.next=42;return _superPropGet(Tm,"on",this,3)([t]);case 42:case"end":return _context87.stop();}},_callee84,this);}));function on(_x131){return _on3.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var e=t.workId,n=t.toolsType,i=t.opt;if(n&&this.topLayerWork.canUseTopLayer(n)&&e&&i){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(e.toString(),i);return;}n&&this.localWork.canUseSubWorker(n)&&_superPropGet(Tm,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t){var e;return _regeneratorRuntime().wrap(function _callee85$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:e=t.dataType;_context88.t0=e===Mt.Local;if(!_context88.t0){_context88.next=5;break;}_context88.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context88.stop();}},_callee85,this);}));function removeNode(_x132){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"getOffscreen",value:function getOffscreen(t,e){return this.getLayer(t,e).parent.canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(t,e){var n,i;return _regeneratorRuntime().wrap(function _callee86$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:n=e.workId,i=e.toolsType;if(!n){_context89.next=11;break;}if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context89.next=5;break;}t===Mt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(e)),this.topLayerWork.consumeDraw(e);return _context89.abrupt("return");case 5:_context89.t0=i&&this.localWork.canUseSubWorker(i);if(!_context89.t0){_context89.next=10;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context89.next=10;return this.localWork.consumeDraw(e);case 10:return _context89.abrupt("return");case 11:case"end":return _context89.stop();}},_callee86,this);}));function consumeDraw(_x133,_x134){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(t,e){var n,i,a,o;return _regeneratorRuntime().wrap(function _callee87$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:n=e.workId,i=e.toolsType,a=e.dataType;if(!n){_context90.next=8;break;}o=n.toString();if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context90.next=6;break;}a===Mt.Local&&(this.topLayerWork.getWorkShape(o)||this.createLocalWork(e)),this.topLayerWork.consumeDrawAll(e);return _context90.abrupt("return");case 6:i&&this.localWork.canUseSubWorker(i)&&(this.localWork.getWorkShape(o)||_superPropGet(Tm,"createLocalWork",this,3)([e]),this.localWork.consumeDrawAll(e));return _context90.abrupt("return");case 8:case"end":return _context90.stop();}},_callee87,this);}));function consumeDrawAll(_x135,_x136){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(){return _regeneratorRuntime().wrap(function _callee88$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:this.vNodes.clear();_superPropGet(Tm,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.topLayer.removeAllChildren());_context91.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId}],sp:[{type:lt.Clear}]});case 5:case"end":return _context91.stop();}},_callee88,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{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=Math.floor(i.x*this.dpr),s=Math.floor(i.y*this.dpr),l=Math.floor(i.w*this.dpr||1),d=Math.floor(i.h*this.dpr||1);return createImageBitmap(this.getOffscreen(a,e),o,s,l,d,n);}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_superPropGet(Tm,"updateLayer",this,3)([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 _callee89(t){var _this110=this;var e,n,i,a,_iterator76,_step76,_loop7;return _regeneratorRuntime().wrap(function _callee89$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!oe(this.cameraOpt,n))){_context93.next=25;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:St.Float,viewId:this.viewId}),i)){_context93.next=21;break;}e.push({isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId});_iterator76=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context93.prev=6;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step76$value,o,s,l;return _regeneratorRuntime().wrap(function _loop7$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:_step76$value=_slicedToArray(_step76.value,2),o=_step76$value[0],s=_step76$value[1];if(s.totalRect){_this110.topLayer.getElementsByName(o.toString()).forEach(function(d){var c=d.getBoundingClientRect(),p=wt({x:c.x,y:c.y,w:c.width,h:c.height});l=Pt(l,p);}),s.totalRect=l,_this110.topLayerWork.localWorkShapes.set(o,s);}case 2:case"end":return _context92.stop();}},_loop7);});_iterator76.s();case 9:if((_step76=_iterator76.n()).done){_context93.next=13;break;}return _context93.delegateYield(_loop7(),"t0",11);case 11:_context93.next=9;break;case 13:_context93.next=18;break;case 15:_context93.prev=15;_context93.t1=_context93["catch"](6);_iterator76.e(_context93.t1);case 18:_context93.prev=18;_iterator76.f();return _context93.finish(18);case 21:_context93.t2=e.length;if(!_context93.t2){_context93.next=25;break;}_context93.next=25;return this.post({render:e});case 25:case"end":return _context93.stop();}},_callee89,this,[[6,15,18,21]]);}));function updateCamera(_x137){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 _callee90(t){var e,n,i,a,o,s,l,_i12,_Object$entries,_Object$entries$_i,c,p,y,P,T,d;return _regeneratorRuntime().wrap(function _callee90$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,o=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context94.next=26;break;}s=Xt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i12=0,_Object$entries=Object.entries(n);case 5:if(!(_i12<_Object$entries.length)){_context94.next=21;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i12],2),c=_Object$entries$_i[0],p=_Object$entries$_i[1];if(!(p!=null&&p.type)){_context94.next=18;break;}_context94.t0=p==null?void 0:p.type;_context94.next=_context94.t0===lt.UpdateNode?11:_context94.t0===lt.FullWork?11:18;break;case 11:y=p.opt;P=_objectSpread(_objectSpread({},p),{},{opt:y,workId:c,msgType:lt.FullWork,dataType:Mt.Service,viewId:this.viewId});_context94.next=15;return this.localWork.runFullWork(P);case 15:T=_context94.sent;l=Pt(l,T);return _context94.abrupt("break",18);case 18:_i12++;_context94.next=5;break;case 21:a&&o&&(d={resizeWidth:a,resizeHeight:o});_context94.next=24;return this.getSnapshotRender({scenePath:e,curCameraOpt:s,options:d});case 24:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 26:case"end":return _context94.stop();}},_callee90,this);}));function getSnapshot(_x138){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(t){var o,s,e,n,i,a;return _regeneratorRuntime().wrap(function _callee91$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context95.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:St.None},!0,i);case 4:a=_context95.sent;a&&(this._post({sp:[{type:lt.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 _context95.stop();}},_callee91,this);}));function getSnapshotRender(_x139){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92(t){var e,n,i,a,o,_i13,_Object$entries2,_Object$entries2$_i,s,l,d;return _regeneratorRuntime().wrap(function _callee92$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context96.next=27;break;}a=Xt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i13=0,_Object$entries2=Object.entries(n);case 5:if(!(_i13<_Object$entries2.length)){_context96.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i13],2),s=_Object$entries2$_i[0],l=_Object$entries2$_i[1];if(!(l!=null&&l.type)){_context96.next=16;break;}_context96.t0=l==null?void 0:l.type;_context96.next=_context96.t0===lt.UpdateNode?11:_context96.t0===lt.FullWork?11:16;break;case 11:_context96.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},l),{},{workId:s,msgType:lt.FullWork,dataType:Mt.Service,viewId:this.viewId}));case 13:d=_context96.sent;o=Pt(o,d);return _context96.abrupt("break",16);case 16:_i13++;_context96.next=5;break;case 19:_context96.t1=o;if(!_context96.t1){_context96.next=23;break;}_context96.next=23;return this.post({sp:[{type:lt.BoundingBox,scenePath:e,rect:o}]});case 23:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;this.snapshotFullLayer.removeAllChildren();this.setCameraOpt(a,this.fullLayer);case 27:case"end":return _context96.stop();}},_callee92,this);}));function getBoundingRect(_x140){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(Ci);var Wn=self;Wn.full=new Sm(Wn,Ne.Full);
|