@netless/appliance-plugin 1.1.9 → 1.1.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.
@@ -1,4 +1,4 @@
1
- var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["rect","willUpdateNodes","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,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _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 _n8=0,F=function F(){};return{s:F,n:function n(){return _n8>=r.length?{done:!0}:{done:!1,value:r[_n8++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _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 Ni=Object.defineProperty;var Wi=function Wi(h,r,t){return r in h?Ni(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var et=function et(h,r,t){return Wi(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||{}),It=/* @__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;}(It||{}),at=/* @__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[h.AuthWriter=24]="AuthWriter",h[h.AuthReader=25]="AuthReader",h[h.AuthClear=26]="AuthClear",h[h.AuthPage=27]="AuthPage",h[h.GetVNodeInfo=28]="GetVNodeInfo",h;}(at||{}),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||{}),Te=/* @__PURE__ */function(h){return h[h.inside=0]="inside",h[h.outside=1]="outside",h[h.intersect=2]="intersect",h;}(Te||{}),xr=/* @__PURE__ */function(h){return h.Image="image",h.Iconify="iconify",h;}(xr||{});var te=/*#__PURE__*/function(){function te(){_classCallCheck(this,te);et(this,"localWork");et(this,"serviceWork");et(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 Bi=/*#__PURE__*/function(_te){function Bi(){var _this;_classCallCheck(this,Bi);_this=_callSuper(this,Bi,arguments);et(_this,"emitEventType",bt.CopyNode);return _this;}_inherits(Bi,_te);return _createClass(Bi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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 De="++",Nt="selector",Fi="all";var Ui=/*#__PURE__*/function(_te2){function Ui(){var _this2;_classCallCheck(this,Ui);_this2=_callSuper(this,Ui,arguments);et(_this2,"emitEventType",bt.SetColorNode);return _this2;}_inherits(Ui,_te2);return _createClass(Ui,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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:at.TextUpdate,dataType:Mt.Local,willSyncService:!0})):d.push(_objectSpread(_objectSpread({},p),{},{workId:c,type:at.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:l,sp:d};}}]);}(te);var ji=/*#__PURE__*/function(_te3){function ji(){var _this3;_classCallCheck(this,ji);_this3=_callSuper(this,ji,arguments);et(_this3,"emitEventType",bt.ZIndexNode);return _this3;}_inherits(ji,_te3);return _createClass(ji,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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:at.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:s,sp:l};}}]);}(te);var $i=/*#__PURE__*/function(_te4){function $i(){var _this4;_classCallCheck(this,$i);_this4=_callSuper(this,$i,arguments);et(_this4,"emitEventType",bt.TranslateNode);return _this4;}_inherits($i,_te4);return _createClass($i,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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===It.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==It.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===It.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===It.Start)return{sp:[],render:[]};var x=o==null?void 0:o.selectRect;if(s){P.push({type:at.Select,selectIds:a.selectIds,selectRect:x,willSyncService:!0,isSync:!0,points:p===It.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],T=_step4$value[1];c&&T.toolsType===ut.Text?P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:at.TextUpdate,dataType:Mt.Local,willSyncService:!0})):P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:at.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:y,sp:P};}}]);}(te);var zi=/*#__PURE__*/function(_te5){function zi(){var _this5;_classCallCheck(this,zi);_this5=_callSuper(this,zi,arguments);et(_this5,"emitEventType",bt.DeleteNode);return _this5;}_inherits(zi,_te5);return _createClass(zi,[{key:"consume",value:function consume(){return!1;}}]);}(te);var Gi=/*#__PURE__*/function(_te6){function Gi(){var _this6;_classCallCheck(this,Gi);_this6=_callSuper(this,Gi,arguments);et(_this6,"emitEventType",bt.ScaleNode);return _this6;}_inherits(Gi,_te6);return _createClass(Gi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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===It.Start)return{sp:[],render:[]};if(l){p.push({type:at.Select,selectIds:i.selectIds,selectRect:y,willSyncService:!0,isSync:!0,points:d===It.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],x=_step5$value[1];x.toolsType===ut.Text?p.push(_objectSpread(_objectSpread({},x),{},{workId:P,type:at.TextUpdate,dataType:Mt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},x),{},{workId:P,type:at.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:c,sp:p};}}]);}(te);var Hi=/*#__PURE__*/function(_te7){function Hi(){var _this7;_classCallCheck(this,Hi);_this7=_callSuper(this,Hi,arguments);et(_this7,"emitEventType",bt.RotateNode);return _this7;}_inherits(Hi,_te7);return _createClass(Hi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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||[],x=a==null?void 0:a.selectRect;if(l){d&&p===It.Done&&P.push({type:at.Select,selectIds:i.selectIds,selectRect:x,willSyncService:!0,isSync:c,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt,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],T=_step6$value[1];P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:at.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:P};}}]);}(te);var Ki=/*#__PURE__*/function(_te8){function Ki(){var _this8;_classCallCheck(this,Ki);_this8=_callSuper(this,Ki,arguments);et(_this8,"emitEventType",bt.SetFontStyle);return _this8;}_inherits(Ki,_te8);return _createClass(Ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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:at.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),x=_step7$value[0],v=_step7$value[1];c&&v.toolsType===ut.Text?y.push(_objectSpread(_objectSpread({},v),{},{workId:x,type:at.TextUpdate,dataType:Mt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},v),{},{workId:x,type:at.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:p,sp:y};}}]);}(te);var Yi=/*#__PURE__*/function(_te9){function Yi(){var _this9;_classCallCheck(this,Yi);_this9=_callSuper(this,Yi,arguments);et(_this9,"emitEventType",bt.SetPoint);return _this9;}_inherits(Yi,_te9);return _createClass(Yi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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:at.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}c.push({type:at.Select,selectIds:a.selectIds,selectRect:p,willSyncService:s,isSync:l,points:a.getChildrenPoints()});}return{render:d,sp:c};}}]);}(te);var Vi=/*#__PURE__*/function(_te10){function Vi(){var _this10;_classCallCheck(this,Vi);_this10=_callSuper(this,Vi,arguments);et(_this10,"emitEventType",bt.SetLock);return _this10;}_inherits(Vi,_te10);return _createClass(Vi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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],x=_step9$value[1];p.push(_objectSpread(_objectSpread({},x),{},{workId:P,type:at.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:at.Select,selectIds:a.selectIds,selectRect:y,willSyncService:s,isSync:l});}return{render:c,sp:p};}}]);}(te);var Xi=/*#__PURE__*/function(_te11){function Xi(){var _this11;_classCallCheck(this,Xi);_this11=_callSuper(this,Xi,arguments);et(_this11,"emitEventType",bt.SetShapeOpt);return _this11;}_inherits(Xi,_te11);return _createClass(Xi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===at.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:at.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:s,sp:l};}}]);}(te);var ki=/*#__PURE__*/function(){function ki(r){var _this12=this;_classCallCheck(this,ki);et(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this12.build(t)];}));}return _createClass(ki,[{key:"build",value:function build(r){switch(r){case bt.TranslateNode:return new $i();case bt.ZIndexNode:return new ji();case bt.CopyNode:return new Bi();case bt.SetColorNode:return new Ui();case bt.DeleteNode:return new zi();case bt.ScaleNode:return new Gi();case bt.RotateNode:return new Hi();case bt.SetFontStyle:return new Ki();case bt.SetPoint:return new Yi();case bt.SetLock:return new Vi();case bt.SetShapeOpt:return new Xi();}}},{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 Ji={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
1
+ var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["rect","willUpdateNodes","willDeleteNodes","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,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _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 _n8=0,F=function F(){};return{s:F,n:function n(){return _n8>=r.length?{done:!0}:{done:!1,value:r[_n8++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _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 Ni=Object.defineProperty;var Wi=function Wi(h,r,t){return r in h?Ni(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var et=function et(h,r,t){return Wi(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||{}),wt=/* @__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;}(wt||{}),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||{}),It=/* @__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;}(It||{}),ot=/* @__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[h.AuthWriter=24]="AuthWriter",h[h.AuthReader=25]="AuthReader",h[h.AuthClear=26]="AuthClear",h[h.AuthPage=27]="AuthPage",h[h.GetVNodeInfo=28]="GetVNodeInfo",h[h.UpdateDpr=29]="UpdateDpr",h;}(ot||{}),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||{}),Te=/* @__PURE__ */function(h){return h[h.inside=0]="inside",h[h.outside=1]="outside",h[h.intersect=2]="intersect",h;}(Te||{}),xr=/* @__PURE__ */function(h){return h.Image="image",h.Iconify="iconify",h;}(xr||{});var te=/*#__PURE__*/function(){function te(){_classCallCheck(this,te);et(this,"localWork");et(this,"serviceWork");et(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 Bi=/*#__PURE__*/function(_te){function Bi(){var _this;_classCallCheck(this,Bi);_this=_callSuper(this,Bi,arguments);et(_this,"emitEventType",wt.CopyNode);return _this;}_inherits(Bi,_te);return _createClass(Bi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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 De="++",Nt="selector",Fi="all";var Ui=/*#__PURE__*/function(_te2){function Ui(){var _this2;_classCallCheck(this,Ui);_this2=_callSuper(this,Ui,arguments);et(_this2,"emitEventType",wt.SetColorNode);return _this2;}_inherits(Ui,_te2);return _createClass(Ui,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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:ot.TextUpdate,dataType:Mt.Local,willSyncService:!0})):d.push(_objectSpread(_objectSpread({},p),{},{workId:c,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:l,sp:d};}}]);}(te);var ji=/*#__PURE__*/function(_te3){function ji(){var _this3;_classCallCheck(this,ji);_this3=_callSuper(this,ji,arguments);et(_this3,"emitEventType",wt.ZIndexNode);return _this3;}_inherits(ji,_te3);return _createClass(ji,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:s,sp:l};}}]);}(te);var $i=/*#__PURE__*/function(_te4){function $i(){var _this4;_classCallCheck(this,$i);_this4=_callSuper(this,$i,arguments);et(_this4,"emitEventType",wt.TranslateNode);return _this4;}_inherits($i,_te4);return _createClass($i,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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===It.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==It.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===It.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===It.Start)return{sp:[],render:[]};var x=o==null?void 0:o.selectRect;if(s){P.push({type:ot.Select,selectIds:a.selectIds,selectRect:x,willSyncService:!0,isSync:!0,points:p===It.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],T=_step4$value[1];c&&T.toolsType===ut.Text?P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:ot.TextUpdate,dataType:Mt.Local,willSyncService:!0})):P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:y,sp:P};}}]);}(te);var zi=/*#__PURE__*/function(_te5){function zi(){var _this5;_classCallCheck(this,zi);_this5=_callSuper(this,zi,arguments);et(_this5,"emitEventType",wt.DeleteNode);return _this5;}_inherits(zi,_te5);return _createClass(zi,[{key:"consume",value:function consume(){return!1;}}]);}(te);var Gi=/*#__PURE__*/function(_te6){function Gi(){var _this6;_classCallCheck(this,Gi);_this6=_callSuper(this,Gi,arguments);et(_this6,"emitEventType",wt.ScaleNode);return _this6;}_inherits(Gi,_te6);return _createClass(Gi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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===It.Start)return{sp:[],render:[]};if(l){p.push({type:ot.Select,selectIds:i.selectIds,selectRect:y,willSyncService:!0,isSync:!0,points:d===It.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],x=_step5$value[1];x.toolsType===ut.Text?p.push(_objectSpread(_objectSpread({},x),{},{workId:P,type:ot.TextUpdate,dataType:Mt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},x),{},{workId:P,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:c,sp:p};}}]);}(te);var Hi=/*#__PURE__*/function(_te7){function Hi(){var _this7;_classCallCheck(this,Hi);_this7=_callSuper(this,Hi,arguments);et(_this7,"emitEventType",wt.RotateNode);return _this7;}_inherits(Hi,_te7);return _createClass(Hi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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||[],x=a==null?void 0:a.selectRect;if(l){d&&p===It.Done&&P.push({type:ot.Select,selectIds:i.selectIds,selectRect:x,willSyncService:!0,isSync:c,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt,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],T=_step6$value[1];P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:P};}}]);}(te);var Ki=/*#__PURE__*/function(_te8){function Ki(){var _this8;_classCallCheck(this,Ki);_this8=_callSuper(this,Ki,arguments);et(_this8,"emitEventType",wt.SetFontStyle);return _this8;}_inherits(Ki,_te8);return _createClass(Ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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:ot.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),x=_step7$value[0],v=_step7$value[1];c&&v.toolsType===ut.Text?y.push(_objectSpread(_objectSpread({},v),{},{workId:x,type:ot.TextUpdate,dataType:Mt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},v),{},{workId:x,type:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:p,sp:y};}}]);}(te);var Yi=/*#__PURE__*/function(_te9){function Yi(){var _this9;_classCallCheck(this,Yi);_this9=_callSuper(this,Yi,arguments);et(_this9,"emitEventType",wt.SetPoint);return _this9;}_inherits(Yi,_te9);return _createClass(Yi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}c.push({type:ot.Select,selectIds:a.selectIds,selectRect:p,willSyncService:s,isSync:l,points:a.getChildrenPoints()});}return{render:d,sp:c};}}]);}(te);var Vi=/*#__PURE__*/function(_te10){function Vi(){var _this10;_classCallCheck(this,Vi);_this10=_callSuper(this,Vi,arguments);et(_this10,"emitEventType",wt.SetLock);return _this10;}_inherits(Vi,_te10);return _createClass(Vi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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],x=_step9$value[1];p.push(_objectSpread(_objectSpread({},x),{},{workId:P,type:ot.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:ot.Select,selectIds:a.selectIds,selectRect:y,willSyncService:s,isSync:l});}return{render:c,sp:p};}}]);}(te);var Xi=/*#__PURE__*/function(_te11){function Xi(){var _this11;_classCallCheck(this,Xi);_this11=_callSuper(this,Xi,arguments);et(_this11,"emitEventType",wt.SetShapeOpt);return _this11;}_inherits(Xi,_te11);return _createClass(Xi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ot.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:ot.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:s,sp:l};}}]);}(te);var ki=/*#__PURE__*/function(){function ki(r){var _this12=this;_classCallCheck(this,ki);et(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this12.build(t)];}));}return _createClass(ki,[{key:"build",value:function build(r){switch(r){case wt.TranslateNode:return new $i();case wt.ZIndexNode:return new ji();case wt.CopyNode:return new Bi();case wt.SetColorNode:return new Ui();case wt.DeleteNode:return new zi();case wt.ScaleNode:return new Gi();case wt.RotateNode:return new Hi();case wt.SetFontStyle:return new Ki();case wt.SetPoint:return new Yi();case wt.SetLock:return new Vi();case wt.SetShapeOpt:return new Xi();}}},{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 Ji={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
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
3
  * Get the nearest point on a line with a known unit vector that passes through point A
4
4
  *
@@ -28,14 +28,14 @@ var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["rect","willUpda
28
28
  * @param radian 1,逆时针180度 -1,顺时针
29
29
  * @param average 均分数
30
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 R;});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 x=t(242);t.d(r,"Ellipse",function(){return x["default"];});var v=t(244);t.d(r,"Arc",function(){return v["default"];});var T=t(246);t.d(r,"Ring",function(){return T["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 A=t(290);t.d(r,"Scene",function(){return A["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,R=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 x;}),t.d(r,"scale",function(){return v;}),t.d(r,"fromRotation",function(){return T;}),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 A;}),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 R=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R;}function i(R){var W=new e.ARRAY_TYPE(4);return W[0]=R[0],W[1]=R[1],W[2]=R[2],W[3]=R[3],W;}function a(R,W){return R[0]=W[0],R[1]=W[1],R[2]=W[2],R[3]=W[3],R;}function o(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R;}function s(R,W,z,K){var k=new e.ARRAY_TYPE(4);return k[0]=R,k[1]=W,k[2]=z,k[3]=K,k;}function l(R,W,z,K,k){return R[0]=W,R[1]=z,R[2]=K,R[3]=k,R;}function d(R,W){if(R===W){var z=W[1];R[1]=W[2],R[2]=z;}else R[0]=W[0],R[1]=W[2],R[2]=W[1],R[3]=W[3];return R;}function c(R,W){var z=W[0],K=W[1],k=W[2],q=W[3],U=z*q-k*K;return U?(U=1/U,R[0]=q*U,R[1]=-K*U,R[2]=-k*U,R[3]=z*U,R):null;}function p(R,W){var z=W[0];return R[0]=W[3],R[1]=-W[1],R[2]=-W[2],R[3]=z,R;}function y(R){return R[0]*R[3]-R[2]*R[1];}function P(R,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=z[0],Z=z[1],nt=z[2],rt=z[3];return R[0]=K*G+q*Z,R[1]=k*G+U*Z,R[2]=K*nt+q*rt,R[3]=k*nt+U*rt,R;}function x(R,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=Math.sin(z),Z=Math.cos(z);return R[0]=K*Z+q*G,R[1]=k*Z+U*G,R[2]=K*-G+q*Z,R[3]=k*-G+U*Z,R;}function v(R,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=z[0],Z=z[1];return R[0]=K*G,R[1]=k*G,R[2]=q*Z,R[3]=U*Z,R;}function T(R,W){var z=Math.sin(W),K=Math.cos(W);return R[0]=K,R[1]=z,R[2]=-z,R[3]=K,R;}function f(R,W){return R[0]=W[0],R[1]=0,R[2]=0,R[3]=W[1],R;}function g(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")";}function u(R){return Math.hypot(R[0],R[1],R[2],R[3]);}function m(R,W,z,K){return R[2]=K[2]/K[0],z[0]=K[0],z[1]=K[1],z[3]=K[3]-R[2]*z[1],[R,W,z];}function M(R,W,z){return R[0]=W[0]+z[0],R[1]=W[1]+z[1],R[2]=W[2]+z[2],R[3]=W[3]+z[3],R;}function E(R,W,z){return R[0]=W[0]-z[0],R[1]=W[1]-z[1],R[2]=W[2]-z[2],R[3]=W[3]-z[3],R;}function A(R,W){return R[0]===W[0]&&R[1]===W[1]&&R[2]===W[2]&&R[3]===W[3];}function b(R,W){var z=R[0],K=R[1],k=R[2],q=R[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(R,W,z){return R[0]=W[0]*z,R[1]=W[1]*z,R[2]=W[2]*z,R[3]=W[3]*z,R;}function L(R,W,z,K){return R[0]=W[0]+z[0]*K,R[1]=W[1]+z[1]*K,R[2]=W[2]+z[2]*K,R[3]=W[3]+z[3]*K,R;}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 x;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromScaling",function(){return T;}),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 A;}),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 R=new e.ARRAY_TYPE(6);return R[0]=I[0],R[1]=I[1],R[2]=I[2],R[3]=I[3],R[4]=I[4],R[5]=I[5],R;}function a(I,R){return I[0]=R[0],I[1]=R[1],I[2]=R[2],I[3]=R[3],I[4]=R[4],I[5]=R[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,R,W,z,K,k){var q=new e.ARRAY_TYPE(6);return q[0]=I,q[1]=R,q[2]=W,q[3]=z,q[4]=K,q[5]=k,q;}function l(I,R,W,z,K,k,q){return I[0]=R,I[1]=W,I[2]=z,I[3]=K,I[4]=k,I[5]=q,I;}function d(I,R){var W=R[0],z=R[1],K=R[2],k=R[3],q=R[4],U=R[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,R,W){var z=R[0],K=R[1],k=R[2],q=R[3],U=R[4],G=R[5],Z=W[0],nt=W[1],rt=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*rt+k*tt,I[3]=K*rt+q*tt,I[4]=z*J+k*ht+U,I[5]=K*J+q*ht+G,I;}function y(I,R,W){var z=R[0],K=R[1],k=R[2],q=R[3],U=R[4],G=R[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,R,W){var z=R[0],K=R[1],k=R[2],q=R[3],U=R[4],G=R[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 x(I,R,W){var z=R[0],K=R[1],k=R[2],q=R[3],U=R[4],G=R[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,R){var W=Math.sin(R),z=Math.cos(R);return I[0]=z,I[1]=W,I[2]=-W,I[3]=z,I[4]=0,I[5]=0,I;}function T(I,R){return I[0]=R[0],I[1]=0,I[2]=0,I[3]=R[1],I[4]=0,I[5]=0,I;}function f(I,R){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=R[0],I[5]=R[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,R,W){return I[0]=R[0]+W[0],I[1]=R[1]+W[1],I[2]=R[2]+W[2],I[3]=R[3]+W[3],I[4]=R[4]+W[4],I[5]=R[5]+W[5],I;}function M(I,R,W){return I[0]=R[0]-W[0],I[1]=R[1]-W[1],I[2]=R[2]-W[2],I[3]=R[3]-W[3],I[4]=R[4]-W[4],I[5]=R[5]-W[5],I;}function E(I,R,W){return I[0]=R[0]*W,I[1]=R[1]*W,I[2]=R[2]*W,I[3]=R[3]*W,I[4]=R[4]*W,I[5]=R[5]*W,I;}function A(I,R,W,z){return I[0]=R[0]+W[0]*z,I[1]=R[1]+W[1]*z,I[2]=R[2]+W[2]*z,I[3]=R[3]+W[3]*z,I[4]=R[4]+W[4]*z,I[5]=R[5]+W[5]*z,I;}function b(I,R){return I[0]===R[0]&&I[1]===R[1]&&I[2]===R[2]&&I[3]===R[3]&&I[4]===R[4]&&I[5]===R[5];}function O(I,R){var W=I[0],z=I[1],K=I[2],k=I[3],q=I[4],U=I[5],G=R[0],Z=R[1],nt=R[2],rt=R[3],tt=R[4],J=R[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-rt)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(rt))&&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 x;}),t.d(r,"translate",function(){return v;}),t.d(r,"rotate",function(){return T;}),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 A;}),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 R;}),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,rt,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]=rt,B[5]=tt,B[6]=J,B[7]=ht,B[8]=dt,B;}function l(U,G,Z,nt,rt,tt,J,ht,dt,B){return U[0]=G,U[1]=Z,U[2]=nt,U[3]=rt,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],rt=G[5];U[1]=G[3],U[2]=G[6],U[3]=Z,U[5]=G[7],U[6]=nt,U[7]=rt;}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],rt=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+rt*N;return $?($=1/$,U[0]=Y*$,U[1]=(-F*nt+rt*B)*$,U[2]=(ht*nt-rt*J)*$,U[3]=X*$,U[4]=(F*Z-rt*dt)*$,U[5]=(-ht*Z+rt*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],rt=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]=rt*B-nt*F,U[2]=nt*ht-rt*J,U[3]=ht*dt-tt*F,U[4]=Z*F-rt*dt,U[5]=rt*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],rt=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*rt+J*ht)+nt*(dt*rt-tt*ht);}function x(U,G,Z){var nt=G[0],rt=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*rt+N*ht+$*F,U[2]=X*tt+N*dt+$*Y,U[3]=S*nt+C*J+D*B,U[4]=S*rt+C*ht+D*F,U[5]=S*tt+C*dt+D*Y,U[6]=j*nt+H*J+V*B,U[7]=j*rt+H*ht+V*F,U[8]=j*tt+H*dt+V*Y,U;}function v(U,G,Z){var nt=G[0],rt=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]=rt,U[2]=tt,U[3]=J,U[4]=ht,U[5]=dt,U[6]=X*nt+N*J+B,U[7]=X*rt+N*ht+F,U[8]=X*tt+N*dt+Y,U;}function T(U,G,Z){var nt=G[0],rt=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*rt+X*ht,U[2]=N*tt+X*dt,U[3]=N*J-X*nt,U[4]=N*ht-X*rt,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],rt=Z[1];return U[0]=nt*G[0],U[1]=nt*G[1],U[2]=nt*G[2],U[3]=rt*G[3],U[4]=rt*G[4],U[5]=rt*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],rt=G[2],tt=G[3],J=Z+Z,ht=nt+nt,dt=rt+rt,B=Z*J,F=nt*J,Y=nt*ht,X=rt*J,N=rt*ht,$=rt*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 A(U,G){var Z=G[0],nt=G[1],rt=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-rt*J,V=Z*B-tt*J,Q=nt*dt-rt*ht,it=nt*B-tt*ht,st=rt*B-tt*dt,ct=F*S-Y*$,gt=F*C-X*$,lt=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*lt-it*gt+st*ct;return yt?(yt=1/yt,U[0]=(ht*mt-dt*ft+B*ot)*yt,U[1]=(dt*lt-J*mt-B*gt)*yt,U[2]=(J*ft-ht*lt+B*ct)*yt,U[3]=(rt*ft-nt*mt-tt*ot)*yt,U[4]=(Z*mt-rt*lt+tt*gt)*yt,U[5]=(nt*lt-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 R(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],rt=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(rt-N)<=e.EPSILON*Math.max(1,Math.abs(rt),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=x,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 x;}),t.d(r,"scale",function(){return v;}),t.d(r,"rotate",function(){return T;}),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 A;}),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 R;}),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 rt;}),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,lt,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]=lt,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,lt,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]=lt,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],lt=C[9],ot=C[10],ft=C[11],mt=C[12],yt=C[13],pt=C[14],Tt=C[15],Rt=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-lt*mt,zt=gt*pt-ot*mt,Gt=gt*Tt-ft*mt,Kt=lt*pt-ot*yt,Yt=lt*Tt-ft*yt,Vt=ot*Tt-ft*pt,Dt=Rt*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-lt*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*Rt)*Dt,S[11]=(lt*Et-gt*At-ft*Rt)*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*Rt)*Dt,S[15]=(gt*Ct-lt*Ot+ot*Rt)*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],lt=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)-lt*(st*Tt-ct*pt)+yt*(st*ft-ct*ot),S[1]=-(j*(ot*Tt-ft*pt)-lt*(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)+lt*(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*(lt*Tt-ft*yt)-gt*(it*Tt-ct*yt)+mt*(it*ft-ct*lt),S[9]=-(D*(lt*Tt-ft*yt)-gt*(j*Tt-V*yt)+mt*(j*ft-V*lt)),S[10]=D*(it*Tt-ct*yt)-Q*(j*Tt-V*yt)+mt*(j*ct-V*it),S[11]=-(D*(it*ft-ct*lt)-Q*(j*ft-V*lt)+gt*(j*ct-V*it)),S[12]=-(Q*(lt*pt-ot*yt)-gt*(it*pt-st*yt)+mt*(it*ot-st*lt)),S[13]=D*(lt*pt-ot*yt)-gt*(j*pt-H*yt)+mt*(j*ot-H*lt),S[14]=-(D*(it*pt-st*yt)-Q*(j*pt-H*yt)+mt*(j*st-H*it)),S[15]=D*(it*ot-st*lt)-Q*(j*ot-H*lt)+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],lt=S[10],ot=S[11],ft=S[12],mt=S[13],yt=S[14],pt=S[15],Tt=C*Q-D*V,Rt=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-lt*ft,zt=ct*pt-ot*ft,Gt=gt*yt-lt*mt,Kt=gt*pt-ot*mt,Yt=lt*pt-ot*yt;return Tt*Yt-Rt*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],lt=C[8],ot=C[9],ft=C[10],mt=C[11],yt=C[12],pt=C[13],Tt=C[14],Rt=C[15],Ot=D[0],Et=D[1],Ct=D[2],At=D[3];return S[0]=Ot*j+Et*it+Ct*lt+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*Rt,Ot=D[4],Et=D[5],Ct=D[6],At=D[7],S[4]=Ot*j+Et*it+Ct*lt+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*Rt,Ot=D[8],Et=D[9],Ct=D[10],At=D[11],S[8]=Ot*j+Et*it+Ct*lt+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*Rt,Ot=D[12],Et=D[13],Ct=D[14],At=D[15],S[12]=Ot*j+Et*it+Ct*lt+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*Rt,S;}function x(S,C,D){var j=D[0],H=D[1],V=D[2],Q,it,st,ct,gt,lt,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],lt=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]=lt,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+lt*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 T(S,C,D,j){var H=j[0],V=j[1],Q=j[2],it=Math.hypot(H,V,Q),st,ct,gt,lt,ot,ft,mt,yt,pt,Tt,Rt,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,lt=C[0],ot=C[1],ft=C[2],mt=C[3],yt=C[4],pt=C[5],Tt=C[6],Rt=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]=lt*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+Rt*$t+At*zt,S[4]=lt*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+Rt*Kt+At*Yt,S[8]=lt*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+Rt*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],lt=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+lt*j,S[7]=st*H+ot*j,S[8]=ct*H-V*j,S[9]=gt*H-Q*j,S[10]=lt*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],lt=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-lt*j,S[3]=st*H-ot*j,S[8]=V*j+ct*H,S[9]=Q*j+gt*H,S[10]=it*j+lt*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],lt=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+lt*j,S[3]=st*H+ot*j,S[4]=ct*H-V*j,S[5]=gt*H-Q*j,S[6]=lt*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 A(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,lt=j*st,ot=j*ct,ft=H*st,mt=H*ct,yt=V*ct,pt=Q*it,Tt=Q*st,Rt=Q*ct;return S[0]=1-(ft+yt),S[1]=lt+Rt,S[2]=ot-Tt,S[3]=0,S[4]=lt-Rt,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],lt=j*j+H*H+V*V+Q*Q;return lt>0?(D[0]=(it*Q+gt*j+st*V-ct*H)*2/lt,D[1]=(st*Q+gt*H+ct*j-it*V)*2/lt,D[2]=(ct*Q+gt*V+it*H-st*j)*2/lt):(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 R(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);R(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,lt=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]=(lt-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]=(lt-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]=(lt+ft)/pt):(pt=Math.sqrt(1+mt-Q-gt)*2,S[3]=(it-ct)/pt,S[0]=(ot+st)/pt,S[1]=(lt+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,lt=H*st,ot=H*ct,ft=H*gt,mt=V*ct,yt=V*gt,pt=Q*gt,Tt=it*st,Rt=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-Rt)*Et,S[3]=0,S[4]=(ot-Ot)*Ct,S[5]=(1-(lt+pt))*Ct,S[6]=(yt+Tt)*Ct,S[7]=0,S[8]=(ft+Rt)*At,S[9]=(yt-Tt)*At,S[10]=(1-(lt+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,lt=it+it,ot=V*ct,ft=V*gt,mt=V*lt,yt=Q*gt,pt=Q*lt,Tt=it*lt,Rt=st*ct,Ot=st*gt,Et=st*lt,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,Re=(pt+Rt)*At,Ie=(mt+Ot)*Ht,$r=(pt-Rt)*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]=Re,S[7]=0,S[8]=Ie,S[9]=$r,S[10]=zr,S[11]=0,S[12]=D[0]+$t-(Kt*$t+Dt*zt+Ie*Gt),S[13]=D[1]+zt-(Yt*$t+Qt*zt+$r*Gt),S[14]=D[2]+Gt-(Vt*$t+Re*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,lt=j*it,ot=H*Q,ft=H*it,mt=H*st,yt=V*Q,pt=V*it,Tt=V*st;return S[0]=1-lt-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-lt,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,lt,ot,ft,mt=C[0],yt=C[1],pt=C[2],Tt=j[0],Rt=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,lt=yt-Ct,ot=pt-At,ft=1/Math.hypot(gt,lt,ot),gt*=ft,lt*=ft,ot*=ft,H=Rt*ot-Ot*lt,V=Ot*gt-Tt*ot,Q=Tt*lt-Rt*gt,ft=Math.hypot(H,V,Q),ft?(ft=1/ft,H*=ft,V*=ft,Q*=ft):(H=0,V=0,Q=0),it=lt*Q-ot*V,st=ot*H-gt*Q,ct=gt*V-lt*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]=lt,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+lt*yt+ot*pt),S[15]=1,S);}function rt(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],lt=V-D[1],ot=Q-D[2],ft=gt*gt+lt*lt+ot*ot;ft>0&&(ft=1/Math.sqrt(ft),gt*=ft,lt*=ft,ot*=ft);var mt=st*ot-ct*lt,yt=ct*gt-it*ot,pt=it*lt-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]=lt*pt-ot*yt,S[5]=ot*mt-gt*pt,S[6]=gt*yt-lt*mt,S[7]=0,S[8]=gt,S[9]=lt,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],lt=S[9],ot=S[10],ft=S[11],mt=S[12],yt=S[13],pt=S[14],Tt=S[15],Rt=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],Re=C[14],Ie=C[15];return Math.abs(D-Rt)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(Rt))&&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(lt-Kt)<=e.EPSILON*Math.max(1,Math.abs(lt),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-Re)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Re))&&Math.abs(Tt-Ie)<=e.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(Ie));}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 x;}),t.d(r,"calculateW",function(){return v;}),t.d(r,"exp",function(){return T;}),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 A;}),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 R;}),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 rt;}),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 x(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 T(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),T(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,lt;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,lt=Math.sin(N*it)/ct):(gt=1-N,lt=N),F[0]=gt*$+lt*j,F[1]=gt*S+lt*H,F[2]=gt*C+lt*V,F[3]=gt*D+lt*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 A(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,R=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,rt=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,rt(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],rt(Y,A(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 x;}),t.d(r,"min",function(){return v;}),t.d(r,"max",function(){return T;}),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 A;}),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 R;}),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 rt;}),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 x(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 T(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 A(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 R(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),lt=it*(3-2*Q);return C[0]=D[0]*st+j[0]*ct+H[0]*gt+V[0]*lt,C[1]=D[1]*st+j[1]*ct+H[1]*gt+V[1]*lt,C[2]=D[2]*st+j[2]*ct+H[2]*gt+V[2]*lt,C;}function W(C,D,j,H,V,Q){var it=1-Q,st=it*it,ct=Q*Q,gt=st*it,lt=3*Q*st,ot=3*ct*it,ft=ct*Q;return C[0]=D[0]*gt+j[0]*lt+H[0]*ot+V[0]*ft,C[1]=D[1]*gt+j[1]*lt+H[1]*ot+V[1]*ft,C[2]=D[2]*gt+j[2]*lt+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],lt=V*gt-Q*ct,ot=Q*st-H*gt,ft=H*ct-V*st,mt=V*ft-Q*ot,yt=Q*lt-H*ft,pt=H*ot-V*lt,Tt=it*2;return lt*=Tt,ot*=Tt,ft*=Tt,mt*=2,yt*=2,pt*=2,C[0]=st+lt+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),lt=ct*gt,ot=lt&&L(C,D)/lt;return Math.acos(Math.min(Math.max(ot,-1),1));}function rt(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 x;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return T;}),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 A;}),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 R;}),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 rt;}),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 x(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 T(B,F){return B[0]=Math.round(F[0]),B[1]=Math.round(F[1]),B[2]=Math.round(F[2]),B[3]=Math.round(F[3]),B;}function 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 A(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 R(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,rt=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 x;}),t.d(r,"set",function(){return v;}),t.d(r,"getReal",function(){return T;}),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 A;}),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 R;}),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 rt;}),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 x(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B[6]=0,B[7]=0,B;}function 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 T=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 A(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],lt=F[7];return B[4]=st*j+lt*S+ct*D-gt*C,B[5]=ct*j+lt*C+gt*S-st*D,B[6]=gt*j+lt*D+st*C-ct*S,B[7]=lt*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 R(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],lt=Y[2],ot=Y[3];return B[0]=X*ot+S*ct+N*lt-$*gt,B[1]=N*ot+S*gt+$*ct-X*lt,B[2]=$*ot+S*lt+X*gt-N*ct,B[3]=S*ot-X*ct-N*gt-$*lt,B[4]=X*H+S*C+N*j-$*D+V*ot+st*ct+Q*lt-it*gt,B[5]=N*H+S*D+$*C-X*j+Q*ot+st*gt+it*ct-V*lt,B[6]=$*H+S*j+X*D-N*C+it*ot+st*lt+V*gt-Q*ct,B[7]=S*H-X*C-N*D-$*j+st*ot-V*ct-Q*gt-it*lt,B;}var W=R;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,rt=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],lt=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-lt)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(lt));}},/* 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 x;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return T;}),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 A;}),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 R;}),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 rt;}),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 x(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 T(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 A(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 R(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 rt(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,
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 b;}),t.d(r,"isSpriteNode",function(){return I;}),t.d(r,"registerNode",function(){return R;});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 x=t(242);t.d(r,"Ellipse",function(){return x["default"];});var v=t(244);t.d(r,"Arc",function(){return v["default"];});var T=t(246);t.d(r,"Ring",function(){return T["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 A=t(290);t.d(r,"Scene",function(){return A["default"];});var w=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 b=w["default"].createElement,I=w["default"].isSpriteNode,R=w["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 x;}),t.d(r,"scale",function(){return v;}),t.d(r,"fromRotation",function(){return T;}),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 A;}),t.d(r,"equals",function(){return w;}),t.d(r,"multiplyScalar",function(){return O;}),t.d(r,"multiplyScalarAndAdd",function(){return L;}),t.d(r,"mul",function(){return b;}),t.d(r,"sub",function(){return I;});var e=t(2);function n(){var R=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R;}function i(R){var W=new e.ARRAY_TYPE(4);return W[0]=R[0],W[1]=R[1],W[2]=R[2],W[3]=R[3],W;}function a(R,W){return R[0]=W[0],R[1]=W[1],R[2]=W[2],R[3]=W[3],R;}function o(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R;}function s(R,W,z,K){var k=new e.ARRAY_TYPE(4);return k[0]=R,k[1]=W,k[2]=z,k[3]=K,k;}function l(R,W,z,K,k){return R[0]=W,R[1]=z,R[2]=K,R[3]=k,R;}function d(R,W){if(R===W){var z=W[1];R[1]=W[2],R[2]=z;}else R[0]=W[0],R[1]=W[2],R[2]=W[1],R[3]=W[3];return R;}function c(R,W){var z=W[0],K=W[1],k=W[2],q=W[3],U=z*q-k*K;return U?(U=1/U,R[0]=q*U,R[1]=-K*U,R[2]=-k*U,R[3]=z*U,R):null;}function p(R,W){var z=W[0];return R[0]=W[3],R[1]=-W[1],R[2]=-W[2],R[3]=z,R;}function y(R){return R[0]*R[3]-R[2]*R[1];}function P(R,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=z[0],Z=z[1],nt=z[2],rt=z[3];return R[0]=K*G+q*Z,R[1]=k*G+U*Z,R[2]=K*nt+q*rt,R[3]=k*nt+U*rt,R;}function x(R,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=Math.sin(z),Z=Math.cos(z);return R[0]=K*Z+q*G,R[1]=k*Z+U*G,R[2]=K*-G+q*Z,R[3]=k*-G+U*Z,R;}function v(R,W,z){var K=W[0],k=W[1],q=W[2],U=W[3],G=z[0],Z=z[1];return R[0]=K*G,R[1]=k*G,R[2]=q*Z,R[3]=U*Z,R;}function T(R,W){var z=Math.sin(W),K=Math.cos(W);return R[0]=K,R[1]=z,R[2]=-z,R[3]=K,R;}function f(R,W){return R[0]=W[0],R[1]=0,R[2]=0,R[3]=W[1],R;}function g(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")";}function u(R){return Math.hypot(R[0],R[1],R[2],R[3]);}function m(R,W,z,K){return R[2]=K[2]/K[0],z[0]=K[0],z[1]=K[1],z[3]=K[3]-R[2]*z[1],[R,W,z];}function M(R,W,z){return R[0]=W[0]+z[0],R[1]=W[1]+z[1],R[2]=W[2]+z[2],R[3]=W[3]+z[3],R;}function E(R,W,z){return R[0]=W[0]-z[0],R[1]=W[1]-z[1],R[2]=W[2]-z[2],R[3]=W[3]-z[3],R;}function A(R,W){return R[0]===W[0]&&R[1]===W[1]&&R[2]===W[2]&&R[3]===W[3];}function w(R,W){var z=R[0],K=R[1],k=R[2],q=R[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(R,W,z){return R[0]=W[0]*z,R[1]=W[1]*z,R[2]=W[2]*z,R[3]=W[3]*z,R;}function L(R,W,z,K){return R[0]=W[0]+z[0]*K,R[1]=W[1]+z[1]*K,R[2]=W[2]+z[2]*K,R[3]=W[3]+z[3]*K,R;}var b=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 x;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromScaling",function(){return T;}),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 A;}),t.d(r,"exactEquals",function(){return w;}),t.d(r,"equals",function(){return O;}),t.d(r,"mul",function(){return L;}),t.d(r,"sub",function(){return b;});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 R=new e.ARRAY_TYPE(6);return R[0]=I[0],R[1]=I[1],R[2]=I[2],R[3]=I[3],R[4]=I[4],R[5]=I[5],R;}function a(I,R){return I[0]=R[0],I[1]=R[1],I[2]=R[2],I[3]=R[3],I[4]=R[4],I[5]=R[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,R,W,z,K,k){var q=new e.ARRAY_TYPE(6);return q[0]=I,q[1]=R,q[2]=W,q[3]=z,q[4]=K,q[5]=k,q;}function l(I,R,W,z,K,k,q){return I[0]=R,I[1]=W,I[2]=z,I[3]=K,I[4]=k,I[5]=q,I;}function d(I,R){var W=R[0],z=R[1],K=R[2],k=R[3],q=R[4],U=R[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,R,W){var z=R[0],K=R[1],k=R[2],q=R[3],U=R[4],G=R[5],Z=W[0],nt=W[1],rt=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*rt+k*tt,I[3]=K*rt+q*tt,I[4]=z*J+k*ht+U,I[5]=K*J+q*ht+G,I;}function y(I,R,W){var z=R[0],K=R[1],k=R[2],q=R[3],U=R[4],G=R[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,R,W){var z=R[0],K=R[1],k=R[2],q=R[3],U=R[4],G=R[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 x(I,R,W){var z=R[0],K=R[1],k=R[2],q=R[3],U=R[4],G=R[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,R){var W=Math.sin(R),z=Math.cos(R);return I[0]=z,I[1]=W,I[2]=-W,I[3]=z,I[4]=0,I[5]=0,I;}function T(I,R){return I[0]=R[0],I[1]=0,I[2]=0,I[3]=R[1],I[4]=0,I[5]=0,I;}function f(I,R){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=R[0],I[5]=R[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,R,W){return I[0]=R[0]+W[0],I[1]=R[1]+W[1],I[2]=R[2]+W[2],I[3]=R[3]+W[3],I[4]=R[4]+W[4],I[5]=R[5]+W[5],I;}function M(I,R,W){return I[0]=R[0]-W[0],I[1]=R[1]-W[1],I[2]=R[2]-W[2],I[3]=R[3]-W[3],I[4]=R[4]-W[4],I[5]=R[5]-W[5],I;}function E(I,R,W){return I[0]=R[0]*W,I[1]=R[1]*W,I[2]=R[2]*W,I[3]=R[3]*W,I[4]=R[4]*W,I[5]=R[5]*W,I;}function A(I,R,W,z){return I[0]=R[0]+W[0]*z,I[1]=R[1]+W[1]*z,I[2]=R[2]+W[2]*z,I[3]=R[3]+W[3]*z,I[4]=R[4]+W[4]*z,I[5]=R[5]+W[5]*z,I;}function w(I,R){return I[0]===R[0]&&I[1]===R[1]&&I[2]===R[2]&&I[3]===R[3]&&I[4]===R[4]&&I[5]===R[5];}function O(I,R){var W=I[0],z=I[1],K=I[2],k=I[3],q=I[4],U=I[5],G=R[0],Z=R[1],nt=R[2],rt=R[3],tt=R[4],J=R[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-rt)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(rt))&&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,b=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 x;}),t.d(r,"translate",function(){return v;}),t.d(r,"rotate",function(){return T;}),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 A;}),t.d(r,"projection",function(){return w;}),t.d(r,"str",function(){return O;}),t.d(r,"frob",function(){return L;}),t.d(r,"add",function(){return b;}),t.d(r,"subtract",function(){return I;}),t.d(r,"multiplyScalar",function(){return R;}),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,rt,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]=rt,B[5]=tt,B[6]=J,B[7]=ht,B[8]=dt,B;}function l(U,G,Z,nt,rt,tt,J,ht,dt,B){return U[0]=G,U[1]=Z,U[2]=nt,U[3]=rt,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],rt=G[5];U[1]=G[3],U[2]=G[6],U[3]=Z,U[5]=G[7],U[6]=nt,U[7]=rt;}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],rt=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+rt*N;return $?($=1/$,U[0]=Y*$,U[1]=(-F*nt+rt*B)*$,U[2]=(ht*nt-rt*J)*$,U[3]=X*$,U[4]=(F*Z-rt*dt)*$,U[5]=(-ht*Z+rt*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],rt=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]=rt*B-nt*F,U[2]=nt*ht-rt*J,U[3]=ht*dt-tt*F,U[4]=Z*F-rt*dt,U[5]=rt*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],rt=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*rt+J*ht)+nt*(dt*rt-tt*ht);}function x(U,G,Z){var nt=G[0],rt=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*rt+N*ht+$*F,U[2]=X*tt+N*dt+$*Y,U[3]=S*nt+C*J+D*B,U[4]=S*rt+C*ht+D*F,U[5]=S*tt+C*dt+D*Y,U[6]=j*nt+H*J+V*B,U[7]=j*rt+H*ht+V*F,U[8]=j*tt+H*dt+V*Y,U;}function v(U,G,Z){var nt=G[0],rt=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]=rt,U[2]=tt,U[3]=J,U[4]=ht,U[5]=dt,U[6]=X*nt+N*J+B,U[7]=X*rt+N*ht+F,U[8]=X*tt+N*dt+Y,U;}function T(U,G,Z){var nt=G[0],rt=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*rt+X*ht,U[2]=N*tt+X*dt,U[3]=N*J-X*nt,U[4]=N*ht-X*rt,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],rt=Z[1];return U[0]=nt*G[0],U[1]=nt*G[1],U[2]=nt*G[2],U[3]=rt*G[3],U[4]=rt*G[4],U[5]=rt*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],rt=G[2],tt=G[3],J=Z+Z,ht=nt+nt,dt=rt+rt,B=Z*J,F=nt*J,Y=nt*ht,X=rt*J,N=rt*ht,$=rt*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 A(U,G){var Z=G[0],nt=G[1],rt=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-rt*J,V=Z*B-tt*J,Q=nt*dt-rt*ht,it=nt*B-tt*ht,st=rt*B-tt*dt,ct=F*S-Y*$,gt=F*C-X*$,lt=F*D-N*$,at=Y*C-X*S,ft=Y*D-N*S,mt=X*D-N*C,yt=j*mt-H*ft+V*at+Q*lt-it*gt+st*ct;return yt?(yt=1/yt,U[0]=(ht*mt-dt*ft+B*at)*yt,U[1]=(dt*lt-J*mt-B*gt)*yt,U[2]=(J*ft-ht*lt+B*ct)*yt,U[3]=(rt*ft-nt*mt-tt*at)*yt,U[4]=(Z*mt-rt*lt+tt*gt)*yt,U[5]=(nt*lt-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 w(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 b(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 R(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],rt=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(rt-N)<=e.EPSILON*Math.max(1,Math.abs(rt),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=x,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 x;}),t.d(r,"scale",function(){return v;}),t.d(r,"rotate",function(){return T;}),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 A;}),t.d(r,"fromYRotation",function(){return w;}),t.d(r,"fromZRotation",function(){return O;}),t.d(r,"fromRotationTranslation",function(){return L;}),t.d(r,"fromQuat2",function(){return b;}),t.d(r,"getTranslation",function(){return I;}),t.d(r,"getScaling",function(){return R;}),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 rt;}),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,lt,at,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]=lt,pt[12]=at,pt[13]=ft,pt[14]=mt,pt[15]=yt,pt;}function s(S,C,D,j,H,V,Q,it,st,ct,gt,lt,at,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]=lt,S[11]=at,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],lt=C[9],at=C[10],ft=C[11],mt=C[12],yt=C[13],pt=C[14],Tt=C[15],Rt=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-lt*mt,zt=gt*pt-at*mt,Gt=gt*Tt-ft*mt,Kt=lt*pt-at*yt,Yt=lt*Tt-ft*yt,Vt=at*Tt-ft*pt,Dt=Rt*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]=(at*At-lt*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-at*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*Rt)*Dt,S[11]=(lt*Et-gt*At-ft*Rt)*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*Rt)*Dt,S[15]=(gt*Ct-lt*Ot+at*Rt)*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],lt=C[9],at=C[10],ft=C[11],mt=C[12],yt=C[13],pt=C[14],Tt=C[15];return S[0]=it*(at*Tt-ft*pt)-lt*(st*Tt-ct*pt)+yt*(st*ft-ct*at),S[1]=-(j*(at*Tt-ft*pt)-lt*(H*Tt-V*pt)+yt*(H*ft-V*at)),S[2]=j*(st*Tt-ct*pt)-it*(H*Tt-V*pt)+yt*(H*ct-V*st),S[3]=-(j*(st*ft-ct*at)-it*(H*ft-V*at)+lt*(H*ct-V*st)),S[4]=-(Q*(at*Tt-ft*pt)-gt*(st*Tt-ct*pt)+mt*(st*ft-ct*at)),S[5]=D*(at*Tt-ft*pt)-gt*(H*Tt-V*pt)+mt*(H*ft-V*at),S[6]=-(D*(st*Tt-ct*pt)-Q*(H*Tt-V*pt)+mt*(H*ct-V*st)),S[7]=D*(st*ft-ct*at)-Q*(H*ft-V*at)+gt*(H*ct-V*st),S[8]=Q*(lt*Tt-ft*yt)-gt*(it*Tt-ct*yt)+mt*(it*ft-ct*lt),S[9]=-(D*(lt*Tt-ft*yt)-gt*(j*Tt-V*yt)+mt*(j*ft-V*lt)),S[10]=D*(it*Tt-ct*yt)-Q*(j*Tt-V*yt)+mt*(j*ct-V*it),S[11]=-(D*(it*ft-ct*lt)-Q*(j*ft-V*lt)+gt*(j*ct-V*it)),S[12]=-(Q*(lt*pt-at*yt)-gt*(it*pt-st*yt)+mt*(it*at-st*lt)),S[13]=D*(lt*pt-at*yt)-gt*(j*pt-H*yt)+mt*(j*at-H*lt),S[14]=-(D*(it*pt-st*yt)-Q*(j*pt-H*yt)+mt*(j*st-H*it)),S[15]=D*(it*at-st*lt)-Q*(j*at-H*lt)+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],lt=S[10],at=S[11],ft=S[12],mt=S[13],yt=S[14],pt=S[15],Tt=C*Q-D*V,Rt=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-lt*ft,zt=ct*pt-at*ft,Gt=gt*yt-lt*mt,Kt=gt*pt-at*mt,Yt=lt*pt-at*yt;return Tt*Yt-Rt*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],lt=C[8],at=C[9],ft=C[10],mt=C[11],yt=C[12],pt=C[13],Tt=C[14],Rt=C[15],Ot=D[0],Et=D[1],Ct=D[2],At=D[3];return S[0]=Ot*j+Et*it+Ct*lt+At*yt,S[1]=Ot*H+Et*st+Ct*at+At*pt,S[2]=Ot*V+Et*ct+Ct*ft+At*Tt,S[3]=Ot*Q+Et*gt+Ct*mt+At*Rt,Ot=D[4],Et=D[5],Ct=D[6],At=D[7],S[4]=Ot*j+Et*it+Ct*lt+At*yt,S[5]=Ot*H+Et*st+Ct*at+At*pt,S[6]=Ot*V+Et*ct+Ct*ft+At*Tt,S[7]=Ot*Q+Et*gt+Ct*mt+At*Rt,Ot=D[8],Et=D[9],Ct=D[10],At=D[11],S[8]=Ot*j+Et*it+Ct*lt+At*yt,S[9]=Ot*H+Et*st+Ct*at+At*pt,S[10]=Ot*V+Et*ct+Ct*ft+At*Tt,S[11]=Ot*Q+Et*gt+Ct*mt+At*Rt,Ot=D[12],Et=D[13],Ct=D[14],At=D[15],S[12]=Ot*j+Et*it+Ct*lt+At*yt,S[13]=Ot*H+Et*st+Ct*at+At*pt,S[14]=Ot*V+Et*ct+Ct*ft+At*Tt,S[15]=Ot*Q+Et*gt+Ct*mt+At*Rt,S;}function x(S,C,D){var j=D[0],H=D[1],V=D[2],Q,it,st,ct,gt,lt,at,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],lt=C[5],at=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]=lt,S[6]=at,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+lt*H+yt*V+C[13],S[14]=st*j+at*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 T(S,C,D,j){var H=j[0],V=j[1],Q=j[2],it=Math.hypot(H,V,Q),st,ct,gt,lt,at,ft,mt,yt,pt,Tt,Rt,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,lt=C[0],at=C[1],ft=C[2],mt=C[3],yt=C[4],pt=C[5],Tt=C[6],Rt=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]=lt*Ht+yt*$t+Ot*zt,S[1]=at*Ht+pt*$t+Et*zt,S[2]=ft*Ht+Tt*$t+Ct*zt,S[3]=mt*Ht+Rt*$t+At*zt,S[4]=lt*Gt+yt*Kt+Ot*Yt,S[5]=at*Gt+pt*Kt+Et*Yt,S[6]=ft*Gt+Tt*Kt+Ct*Yt,S[7]=mt*Gt+Rt*Kt+At*Yt,S[8]=lt*Vt+yt*Dt+Ot*qt,S[9]=at*Vt+pt*Dt+Et*qt,S[10]=ft*Vt+Tt*Dt+Ct*qt,S[11]=mt*Vt+Rt*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],lt=C[10],at=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+lt*j,S[7]=st*H+at*j,S[8]=ct*H-V*j,S[9]=gt*H-Q*j,S[10]=lt*H-it*j,S[11]=at*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],lt=C[10],at=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-lt*j,S[3]=st*H-at*j,S[8]=V*j+ct*H,S[9]=Q*j+gt*H,S[10]=it*j+lt*H,S[11]=st*j+at*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],lt=C[6],at=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+lt*j,S[3]=st*H+at*j,S[4]=ct*H-V*j,S[5]=gt*H-Q*j,S[6]=lt*H-it*j,S[7]=at*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 A(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 w(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,lt=j*st,at=j*ct,ft=H*st,mt=H*ct,yt=V*ct,pt=Q*it,Tt=Q*st,Rt=Q*ct;return S[0]=1-(ft+yt),S[1]=lt+Rt,S[2]=at-Tt,S[3]=0,S[4]=lt-Rt,S[5]=1-(gt+yt),S[6]=mt+pt,S[7]=0,S[8]=at+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 b(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],lt=j*j+H*H+V*V+Q*Q;return lt>0?(D[0]=(it*Q+gt*j+st*V-ct*H)*2/lt,D[1]=(st*Q+gt*H+ct*j-it*V)*2/lt,D[2]=(ct*Q+gt*V+it*H-st*j)*2/lt):(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 R(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);R(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,lt=C[6]*V,at=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]=(lt-ft)/pt,S[1]=(at-st)/pt,S[2]=(it-ct)/pt):Q>gt&&Q>mt?(pt=Math.sqrt(1+Q-gt-mt)*2,S[3]=(lt-ft)/pt,S[0]=0.25*pt,S[1]=(it+ct)/pt,S[2]=(at+st)/pt):gt>mt?(pt=Math.sqrt(1+gt-Q-mt)*2,S[3]=(at-st)/pt,S[0]=(it+ct)/pt,S[1]=0.25*pt,S[2]=(lt+ft)/pt):(pt=Math.sqrt(1+mt-Q-gt)*2,S[3]=(it-ct)/pt,S[0]=(at+st)/pt,S[1]=(lt+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,lt=H*st,at=H*ct,ft=H*gt,mt=V*ct,yt=V*gt,pt=Q*gt,Tt=it*st,Rt=it*ct,Ot=it*gt,Et=j[0],Ct=j[1],At=j[2];return S[0]=(1-(mt+pt))*Et,S[1]=(at+Ot)*Et,S[2]=(ft-Rt)*Et,S[3]=0,S[4]=(at-Ot)*Ct,S[5]=(1-(lt+pt))*Ct,S[6]=(yt+Tt)*Ct,S[7]=0,S[8]=(ft+Rt)*At,S[9]=(yt-Tt)*At,S[10]=(1-(lt+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,lt=it+it,at=V*ct,ft=V*gt,mt=V*lt,yt=Q*gt,pt=Q*lt,Tt=it*lt,Rt=st*ct,Ot=st*gt,Et=st*lt,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-(at+Tt))*At,Re=(pt+Rt)*At,Ie=(mt+Ot)*Ht,$r=(pt-Rt)*Ht,zr=(1-(at+yt))*Ht;return S[0]=Kt,S[1]=Yt,S[2]=Vt,S[3]=0,S[4]=Dt,S[5]=qt,S[6]=Re,S[7]=0,S[8]=Ie,S[9]=$r,S[10]=zr,S[11]=0,S[12]=D[0]+$t-(Kt*$t+Dt*zt+Ie*Gt),S[13]=D[1]+zt-(Yt*$t+qt*zt+$r*Gt),S[14]=D[2]+Gt-(Vt*$t+Re*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,lt=j*it,at=H*Q,ft=H*it,mt=H*st,yt=V*Q,pt=V*it,Tt=V*st;return S[0]=1-lt-mt,S[1]=gt+Tt,S[2]=at-pt,S[3]=0,S[4]=gt-Tt,S[5]=1-ct-mt,S[6]=ft+yt,S[7]=0,S[8]=at+pt,S[9]=ft-yt,S[10]=1-ct-lt,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,lt,at,ft,mt=C[0],yt=C[1],pt=C[2],Tt=j[0],Rt=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,lt=yt-Ct,at=pt-At,ft=1/Math.hypot(gt,lt,at),gt*=ft,lt*=ft,at*=ft,H=Rt*at-Ot*lt,V=Ot*gt-Tt*at,Q=Tt*lt-Rt*gt,ft=Math.hypot(H,V,Q),ft?(ft=1/ft,H*=ft,V*=ft,Q*=ft):(H=0,V=0,Q=0),it=lt*Q-at*V,st=at*H-gt*Q,ct=gt*V-lt*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]=lt,S[7]=0,S[8]=Q,S[9]=ct,S[10]=at,S[11]=0,S[12]=-(H*mt+V*yt+Q*pt),S[13]=-(it*mt+st*yt+ct*pt),S[14]=-(gt*mt+lt*yt+at*pt),S[15]=1,S);}function rt(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],lt=V-D[1],at=Q-D[2],ft=gt*gt+lt*lt+at*at;ft>0&&(ft=1/Math.sqrt(ft),gt*=ft,lt*=ft,at*=ft);var mt=st*at-ct*lt,yt=ct*gt-it*at,pt=it*lt-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]=lt*pt-at*yt,S[5]=at*mt-gt*pt,S[6]=gt*yt-lt*mt,S[7]=0,S[8]=gt,S[9]=lt,S[10]=at,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],lt=S[9],at=S[10],ft=S[11],mt=S[12],yt=S[13],pt=S[14],Tt=S[15],Rt=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],Re=C[14],Ie=C[15];return Math.abs(D-Rt)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(Rt))&&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(lt-Kt)<=e.EPSILON*Math.max(1,Math.abs(lt),Math.abs(Kt))&&Math.abs(at-Yt)<=e.EPSILON*Math.max(1,Math.abs(at),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-Re)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Re))&&Math.abs(Tt-Ie)<=e.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(Ie));}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 x;}),t.d(r,"calculateW",function(){return v;}),t.d(r,"exp",function(){return T;}),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 A;}),t.d(r,"fromEuler",function(){return w;}),t.d(r,"str",function(){return O;}),t.d(r,"clone",function(){return L;}),t.d(r,"fromValues",function(){return b;}),t.d(r,"copy",function(){return I;}),t.d(r,"set",function(){return R;}),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 rt;}),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 x(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 T(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),T(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,lt;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,lt=Math.sin(N*it)/ct):(gt=1-N,lt=N),F[0]=gt*$+lt*j,F[1]=gt*S+lt*H,F[2]=gt*C+lt*V,F[3]=gt*D+lt*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 A(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 w(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,b=a.fromValues,I=a.copy,R=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,rt=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,rt(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],rt(Y,A(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 x;}),t.d(r,"min",function(){return v;}),t.d(r,"max",function(){return T;}),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 A;}),t.d(r,"inverse",function(){return w;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return b;}),t.d(r,"lerp",function(){return I;}),t.d(r,"hermite",function(){return R;}),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 rt;}),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 x(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 T(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 A(C,D){return C[0]=-D[0],C[1]=-D[1],C[2]=-D[2],C;}function w(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 b(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 R(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),lt=it*(3-2*Q);return C[0]=D[0]*st+j[0]*ct+H[0]*gt+V[0]*lt,C[1]=D[1]*st+j[1]*ct+H[1]*gt+V[1]*lt,C[2]=D[2]*st+j[2]*ct+H[2]*gt+V[2]*lt,C;}function W(C,D,j,H,V,Q){var it=1-Q,st=it*it,ct=Q*Q,gt=st*it,lt=3*Q*st,at=3*ct*it,ft=ct*Q;return C[0]=D[0]*gt+j[0]*lt+H[0]*at+V[0]*ft,C[1]=D[1]*gt+j[1]*lt+H[1]*at+V[1]*ft,C[2]=D[2]*gt+j[2]*lt+H[2]*at+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],lt=V*gt-Q*ct,at=Q*st-H*gt,ft=H*ct-V*st,mt=V*ft-Q*at,yt=Q*lt-H*ft,pt=H*at-V*lt,Tt=it*2;return lt*=Tt,at*=Tt,ft*=Tt,mt*=2,yt*=2,pt*=2,C[0]=st+lt+mt,C[1]=ct+at+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),lt=ct*gt,at=lt&&L(C,D)/lt;return Math.acos(Math.min(Math.max(at,-1),1));}function rt(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 x;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return T;}),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 A;}),t.d(r,"inverse",function(){return w;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return b;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return R;}),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 rt;}),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 x(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 T(B,F){return B[0]=Math.round(F[0]),B[1]=Math.round(F[1]),B[2]=Math.round(F[2]),B[3]=Math.round(F[3]),B;}function 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 A(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=-F[3],B;}function w(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 b(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 R(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,rt=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 x;}),t.d(r,"set",function(){return v;}),t.d(r,"getReal",function(){return T;}),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 A;}),t.d(r,"rotateZ",function(){return w;}),t.d(r,"rotateByQuatAppend",function(){return O;}),t.d(r,"rotateByQuatPrepend",function(){return L;}),t.d(r,"rotateAroundAxis",function(){return b;}),t.d(r,"add",function(){return I;}),t.d(r,"multiply",function(){return R;}),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 rt;}),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 x(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B[6]=0,B[7]=0,B;}function 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 T=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 A(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 w(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 b(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],lt=F[7];return B[4]=st*j+lt*S+ct*D-gt*C,B[5]=ct*j+lt*C+gt*S-st*D,B[6]=gt*j+lt*D+st*C-ct*S,B[7]=lt*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 R(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],lt=Y[2],at=Y[3];return B[0]=X*at+S*ct+N*lt-$*gt,B[1]=N*at+S*gt+$*ct-X*lt,B[2]=$*at+S*lt+X*gt-N*ct,B[3]=S*at-X*ct-N*gt-$*lt,B[4]=X*H+S*C+N*j-$*D+V*at+st*ct+Q*lt-it*gt,B[5]=N*H+S*D+$*C-X*j+Q*at+st*gt+it*ct-V*lt,B[6]=$*H+S*j+X*D-N*C+it*at+st*lt+V*gt-Q*ct,B[7]=S*H-X*C-N*D-$*j+st*at-V*ct-Q*gt-it*lt,B;}var W=R;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,rt=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],lt=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-lt)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(lt));}},/* 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 x;}),t.d(r,"max",function(){return v;}),t.d(r,"round",function(){return T;}),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 A;}),t.d(r,"inverse",function(){return w;}),t.d(r,"normalize",function(){return O;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return b;}),t.d(r,"lerp",function(){return I;}),t.d(r,"random",function(){return R;}),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 rt;}),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 x(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 T(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 A(N,$){return N[0]=-$[0],N[1]=-$[1],N;}function w(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 b(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 R(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 rt(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 w;});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
32
  preserveDrawingBuffer:!1,// depth: false,
33
33
  // antialias: false,
34
- bufferSize:1500},x="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\nvoid main() {\n gl_PointSize = 1.0;\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0); \n vTextureCoord = a_vertexTextureCoord; \n}\n",v="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",T=Symbol("glRenderer"),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 A(O,L,w,I){var R=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(R),O.setMeshData([z.meshData]),E(O),R["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 R=L;L={getContext:function getContext(){return R;},width:w.width,height:w.height},R.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 _R=new e["default"](L,this[g]);I==="webgl2"&&!_R.isWebGL2&&(w.contextType="webgl"),Object(y.createShaders)(_R),Object(y.applyShader)(_R),Object(y.createCloudShaders)(_R);var W=_R.gl;W.clearColor(0,0,0,0),W.blendFuncSeparate(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA,W.ONE,W.ONE_MINUS_SRC_ALPHA),this[T]=_R;}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[T];}},{key:"isWebGL2",get:function get(){return this[T]&&this[T].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[T]||this[f];if(this[T]){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],R=[// 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),R,I);this.projectionMatrix=W,this[T]&&this[T].gl.viewport(0,0,L,w);}},{key:"createTexture",value:function createTexture(L,w){return(this[T]||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[T]||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,R=_ref4$strokeColor===void 0?null:_ref4$strokeColor,_ref4$strokeWidth=_ref4.strokeWidth,W=_ref4$strokeWidth===void 0?1:_ref4$strokeWidth;if(this[T]){var z=p["default"].createText(L,{font:w,fillColor:I,strokeColor:R,strokeWidth:W});return{image:this.createTexture(z.image),rect:z.rect};}return{_img:{font:w,fillColor:I,strokeColor:R,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[T]){var R=this[T].compileSync(w,L);return R._attribOpts=I,R;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref6$vertex=_ref6.vertex,L=_ref6$vertex===void 0?x:_ref6$vertex,_ref6$fragment=_ref6.fragment,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[T]){var I=Object.assign({},L._attribOpts,w);return this[T].useProgram(L,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[T]||this[f]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$f;if(this[T]){var w=this[T].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 R=this[T]||this[f],W=I||L.program;if(this[T]){var z=R.gl;if(w&&z.clear(z.COLOR_BUFFER_BIT),W)R.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)(R,{hasTexture:k,hasFilter:q,hasGradient:U,hasCloudColor:G,hasCloudFilter:Z,hasClipPath:nt});}this[m](),R.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(z,L),E(R),L.afterRender&&L.afterRender(z,L);}else R.setTransform(this.globalTransformMatrix),R.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 R=this[T]||this[f];if(this[T]){var W=R.fbo,z=Object(a["default"])(this,L,I==null),K=R.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:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref9=[this.buffer,this.target];this.target=_ref9[0];this.buffer=_ref9[1];}}),R.bindFBO(_this14.fbo.target)),!U&&q.filterCanvas){Object(y.applyShader)(R,{hasTexture:!0});var nt=_this14.filterContext;nt||(nt=p["default"].createCanvas(G,Z).getContext("2d"),_this14.filterContext=nt);var rt=L[q.packIndex],tt=rt.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)(rt,nt,!1),nt.restore(),Object(o.applyFilter)(nt,tt)):Object(o.drawMesh2D)(rt,nt,!0),_this14[m](),A(R,nt,G,Z)):(k&&nt.save(),Object(o.drawMesh2D)(rt,nt,!1),k&&nt.restore(),(!J||!J.filterCanvas||rt.filter!==J.filter)&&(Object(o.applyFilter)(nt,tt),_this14[m](),A(R,nt,G,Z)));}else{if(U)R.program!==U&&_this14.useProgram(U,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _nt=!!q.uniforms.u_texSampler,_rt=!!q.uniforms.u_filterFlag,_tt=!!q.uniforms.u_radialGradientVector,_J=!!q.uniforms.u_clipSampler;Object(y.applyShader)(R,{hasTexture:_nt,hasFilter:_rt,hasGradient:_tt,hasClipPath:_J});}q.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[m](),R.setMeshData([q]),E(R);}if(q.pass.length){var _nt2=q.pass.length;q.pass.forEach(function(rt,tt){rt.blend=q.enableBlend,rt.setTexture(R.fbo.texture),tt===_nt2-1?R.bindFBO(W):(_this14.fbo.swap(),R.bindFBO(_this14.fbo.target)),rt.program?R.useProgram(rt.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),R.useProgram(_this14.defaultPassProgram)),R.setMeshData([rt.meshData]),K.clear(K.COLOR_BUFFER_BIT),E(R);});}q.afterRender&&q.afterRender(K,q);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else R.setTransform(this.globalTransformMatrix),R.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 R=null,W=null;I===2?R=[w[0],w[1],L.width,L.height]:I===4?R=w:I===8&&(W=w.slice(0,4),R=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(R[0],R[1],K,k);var U=new l["default"](q,{width:K,height:k});U.setTexture(z,{rect:R,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 R=n.mat3.create();return R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[w,I]),R=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),R,L),R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[-w,-I]),this.globalTransform.apply(this,_toConsumableArray(R));}},{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],R=_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,R]),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,-R]),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],R=_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,R]),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,-R]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,w,I){var R=this.globalTransformMatrix;I&&(R=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,I));var W=L*R[0]+w*R[2]+R[4],z=L*R[1]+w*R[3]+R[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,x,v){return x in P?Object.defineProperty(P,x,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[x]=v,P;}var s={};function l(P){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var v=[],T=P.length;for(var f=0;f<T;f++)f%x<2&&v.push(0.5*(P[f]+1));return v;}function d(P,x){var v=x._buffers;Object.values(v).forEach(function(T){P.deleteBuffer(T);}),x._buffers={};}function c(P,x,v){return P.activeTexture(P.TEXTURE0+v),Array.isArray(x._img)?P.bindTexture(P.TEXTURE_CUBE_MAP,x):P.bindTexture(P.TEXTURE_2D,x),x;}var p={"int":"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i","float":"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};var y=/*#__PURE__*/function(){function y(x){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,y);this.options=Object.assign({},y.defaultOptions,v),this.canvas=x;var T;this.options.webgl2&&(T=x.getContext("webgl2",this.options)),T==null&&(T=Object(e.setupWebGL)(x,this.options),this.aia_ext=T.getExtension("ANGLE_instanced_arrays")),this.gl=T,T.viewport(0,0,x.width,x.height),T.clearColor(0,0,0,0),T.blendFuncSeparate(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA,T.ONE,T.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(y,[{key:"program",get:function get(){var x=this.gl;return x.getParameter(x.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
34
+ bufferSize:1500},x="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\nvoid main() {\n gl_PointSize = 1.0;\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0); \n vTextureCoord = a_vertexTextureCoord; \n}\n",v="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",T=Symbol("glRenderer"),f=Symbol("canvasRenderer"),g=Symbol("options"),u=Symbol("globalTransform"),m=Symbol("applyGlobalTransform"),M=Symbol("canvas");function E(O){var L=O.gl,b=O.fbo;b&&L.bindFramebuffer(L.FRAMEBUFFER,b),O._draw(),b&&L.bindFramebuffer(L.FRAMEBUFFER,null);}function A(O,L,b,I){var R=O.createTexture(L.canvas),W=[[[0,0],[b,0],[b,I],[0,I],[0,0]]];W.closed=!0;var z=new l["default"]({contours:W});z.setTexture(R),O.setMeshData([z.meshData]),E(O),R["delete"](),L.clearRect(0,0,b,I),delete L._filter;}var w=/*#__PURE__*/function(){function w(L){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,w);var I=b.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!L.getContext){var R=L;L={getContext:function getContext(){return R;},width:b.width,height:b.height},R.canvas=L,I="2d";}if(this[M]=L,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(b.contextType=I,this[g]=Object.assign({},P,b),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[g].webgl2=!0);var _R=new e["default"](L,this[g]);I==="webgl2"&&!_R.isWebGL2&&(b.contextType="webgl"),Object(y.createShaders)(_R),Object(y.applyShader)(_R),Object(y.createCloudShaders)(_R);var W=_R.gl;W.clearColor(0,0,0,0),W.blendFuncSeparate(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA,W.ONE,W.ONE_MINUS_SRC_ALPHA),this[T]=_R;}else this[f]=new i["default"](L,this[g]);this[u]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(w,[{key:"canvas",get:function get(){return this[M];}},{key:"canvasRenderer",get:function get(){return this[f];}},{key:"glRenderer",get:function get(){return this[T];}},{key:"isWebGL2",get:function get(){return this[T]&&this[T].isWebGL2;}},{key:"options",get:function get(){return this[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[T]||this[f];if(this[T]){var _this$canvas=this.canvas,b=_this$canvas.width,I=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[b,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,b=_this$canvas2.height,I=[// translation
35
+ 1,0,0,0,1,0,-L/2,-b/2,1],R=[// scale
36
+ 2/L,0,0,0,-2/b,0,0,0,1],W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,I);this.projectionMatrix=W,this[T]&&this[T].gl.viewport(0,0,L,b);}},{key:"createTexture",value:function createTexture(L,b){return(this[T]||this[f]).createTexture(L,b);}/* async */},{key:"loadTexture",value:function loadTexture(L){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$useImageBitmap=_ref3.useImageBitmap,b=_ref3$useImageBitmap===void 0?!1:_ref3$useImageBitmap;return(this[T]||this[f]).loadTexture(L,{useImageBitmap:b});}},{key:"createText",value:function createText(L){var _ref4=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref4$font=_ref4.font,b=_ref4$font===void 0?"16px arial":_ref4$font,_ref4$fillColor=_ref4.fillColor,I=_ref4$fillColor===void 0?null:_ref4$fillColor,_ref4$strokeColor=_ref4.strokeColor,R=_ref4$strokeColor===void 0?null:_ref4$strokeColor,_ref4$strokeWidth=_ref4.strokeWidth,W=_ref4$strokeWidth===void 0?1:_ref4$strokeWidth;if(this[T]){var z=p["default"].createText(L,{font:b,fillColor:I,strokeColor:R,strokeWidth:W});return{image:this.createTexture(z.image),rect:z.rect};}return{_img:{font:b,fillColor:I,strokeColor:R,strokeWidth:W,text:L}};}},{key:"createProgram",value:function createProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref5.vertex,b=_ref5.fragment,I=_ref5.options;if(this[T]){var R=this[T].compileSync(b,L);return R._attribOpts=I,R;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref6$vertex=_ref6.vertex,L=_ref6$vertex===void 0?x:_ref6$vertex,_ref6$fragment=_ref6.fragment,b=_ref6$fragment===void 0?v:_ref6$fragment,I=_ref6.options;return this.createProgram({vertex:L,fragment:b,options:I});}},{key:"useProgram",value:function useProgram(L){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[T]){var I=Object.assign({},L._attribOpts,b);return this[T].useProgram(L,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[T]||this[f]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$f;if(this[T]){var b=this[T].gl;b.clear(b.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,b=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,I=_ref7$program===void 0?null:_ref7$program;var R=this[T]||this[f],W=I||L.program;if(this[T]){var z=R.gl;if(b&&z.clear(z.COLOR_BUFFER_BIT),W)R.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)(R,{hasTexture:k,hasFilter:q,hasGradient:U,hasCloudColor:G,hasCloudFilter:Z,hasClipPath:nt});}this[m](),R.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(z,L),E(R),L.afterRender&&L.afterRender(z,L);}else R.setTransform(this.globalTransformMatrix),R.drawMeshCloud(L,{clear:b,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,b=_ref8$clear===void 0?!1:_ref8$clear,_ref8$program=_ref8.program,I=_ref8$program===void 0?null:_ref8$program;var R=this[T]||this[f];if(this[T]){var W=R.fbo,z=Object(a["default"])(this,L,I==null),K=R.gl;b&&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:b,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:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref9=[this.buffer,this.target];this.target=_ref9[0];this.buffer=_ref9[1];}}),R.bindFBO(_this14.fbo.target)),!U&&q.filterCanvas){Object(y.applyShader)(R,{hasTexture:!0});var nt=_this14.filterContext;nt||(nt=p["default"].createCanvas(G,Z).getContext("2d"),_this14.filterContext=nt);var rt=L[q.packIndex],tt=rt.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)(rt,nt,!1),nt.restore(),Object(o.applyFilter)(nt,tt)):Object(o.drawMesh2D)(rt,nt,!0),_this14[m](),A(R,nt,G,Z)):(k&&nt.save(),Object(o.drawMesh2D)(rt,nt,!1),k&&nt.restore(),(!J||!J.filterCanvas||rt.filter!==J.filter)&&(Object(o.applyFilter)(nt,tt),_this14[m](),A(R,nt,G,Z)));}else{if(U)R.program!==U&&_this14.useProgram(U,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _nt=!!q.uniforms.u_texSampler,_rt=!!q.uniforms.u_filterFlag,_tt=!!q.uniforms.u_radialGradientVector,_J=!!q.uniforms.u_clipSampler;Object(y.applyShader)(R,{hasTexture:_nt,hasFilter:_rt,hasGradient:_tt,hasClipPath:_J});}q.filterCanvas&&console.warn("User program ignored some filter effects."),_this14[m](),R.setMeshData([q]),E(R);}if(q.pass.length){var _nt2=q.pass.length;q.pass.forEach(function(rt,tt){rt.blend=q.enableBlend,rt.setTexture(R.fbo.texture),tt===_nt2-1?R.bindFBO(W):(_this14.fbo.swap(),R.bindFBO(_this14.fbo.target)),rt.program?R.useProgram(rt.program):(_this14.defaultPassProgram=_this14.defaultPassProgram||_this14.createPassProgram(),R.useProgram(_this14.defaultPassProgram)),R.setMeshData([rt.meshData]),K.clear(K.COLOR_BUFFER_BIT),E(R);});}q.afterRender&&q.afterRender(K,q);}};for(_iterator12.s();!(_step12=_iterator12.n()).done;){_loop();}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}}else R.setTransform(this.globalTransformMatrix),R.drawMeshes(L,{clear:b});}},{key:"drawImage",value:function drawImage(L){for(var _len=arguments.length,b=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){b[_key-1]=arguments[_key];}var I=b.length;if(I<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(b.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(b.length+1," arguments provided."));var R=null,W=null;I===2?R=[b[0],b[1],L.width,L.height]:I===4?R=b:I===8&&(W=b.slice(0,4),R=b.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(R[0],R[1],K,k);var U=new l["default"](q,{width:K,height:k});U.setTexture(z,{rect:R,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 b=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),b,L),this;}},{key:"globalTranslate",value:function globalTranslate(L,b){var I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[L,b]),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),b=_ref11[0],I=_ref11[1];var R=n.mat3.create();return R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[b,I]),R=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),R,L),R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[-b,-I]),this.globalTransform.apply(this,_toConsumableArray(R));}},{key:"globalScale",value:function globalScale(L){var b=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],R=_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,R]),W=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),W,[L,b]),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-R]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"globalSkew",value:function globalSkew(L){var b=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],R=_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,R]),W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,n.mat3.fromValues(1,Math.tan(b),Math.tan(L),1,0,0)),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-I,-R]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,b,I){var R=this.globalTransformMatrix;I&&(R=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,I));var W=L*R[0]+b*R[2]+R[4],z=L*R[1]+b*R[3]+R[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,x,v){return x in P?Object.defineProperty(P,x,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[x]=v,P;}var s={};function l(P){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var v=[],T=P.length;for(var f=0;f<T;f++)f%x<2&&v.push(0.5*(P[f]+1));return v;}function d(P,x){var v=x._buffers;Object.values(v).forEach(function(T){P.deleteBuffer(T);}),x._buffers={};}function c(P,x,v){return P.activeTexture(P.TEXTURE0+v),Array.isArray(x._img)?P.bindTexture(P.TEXTURE_CUBE_MAP,x):P.bindTexture(P.TEXTURE_2D,x),x;}var p={"int":"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i","float":"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};var y=/*#__PURE__*/function(){function y(x){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,y);this.options=Object.assign({},y.defaultOptions,v),this.canvas=x;var T;this.options.webgl2&&(T=x.getContext("webgl2",this.options)),T==null&&(T=Object(e.setupWebGL)(x,this.options),this.aia_ext=T.getExtension("ANGLE_instanced_arrays")),this.gl=T,T.viewport(0,0,x.width,x.height),T.clearColor(0,0,0,0),T.blendFuncSeparate(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA,T.ONE,T.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(y,[{key:"program",get:function get(){var x=this.gl;return x.getParameter(x.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
37
37
  // WebGLRenderingContext.uniformMatrix[234]fv()
38
- },{key:"_declareUniform",value:function _declareUniform(x,v){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var f=this.gl,g=f.getUniformLocation(x,v);var u;var m=this;if(/^sampler/.test(T)){var M=x._samplerMap,E=x._bindTextures;Object.defineProperty(x.uniforms,v,{get:function get(){return u;},set:function set(A){u=A;var b=M[v]!=null?M[v]:E.length;E[b]=A,c(f,A,b),M[v]||(M[v]=b,f.uniform1i(g,b)),m.options.autoUpdate&&m.update();},configurable:!1,enumerable:!0});}else{var _M=T.indexOf("Matrix")===0,_E=!_M&&/v$/.test(T),A=f["uniform".concat(T)].bind(f);Object.defineProperty(x.uniforms,v,{get:function get(){return u;},set:function set(b){u=b,typeof b=="number"&&(b=[b]),_M?A(g,!1,b):_E?A(g,b):A.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 x=this.program;x.meshData.forEach(function(v,T){var f=v.positions,g=v.cells,u=v.instanceCount,m=v.cellsCount,M=v.attributes,E=v.uniforms,A=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,x._buffers.verticesBuffer),O.bufferData(O.ARRAY_BUFFER,f,O.STATIC_DRAW),g&&(O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,x._buffers.cellsBuffer),O.bufferData(O.ELEMENT_ARRAY_BUFFER,g,O.STATIC_DRAW));var w=[];M&&Object.values(M).forEach(function(_ref16){var R=_ref16.name,W=_ref16.data,z=_ref16.divisor;if(O.bindBuffer(O.ARRAY_BUFFER,x._buffers[R]),O.bufferData(O.ARRAY_BUFFER,W,O.STATIC_DRAW),z!=null){var K=O.getAttribLocation(x,R);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),R=_ref18[0],W=_ref18[1];_this15.uniforms[R]=W;});var I;if(!g){var R=x._dimension;I=f.length/R;}if(x._enableTextures&&x._buffers.texCoordBuffer){var _R2=A||l(f,x._dimension);O.bindBuffer(O.ARRAY_BUFFER,x._buffers.texCoordBuffer),O.bufferData(O.ARRAY_BUFFER,y.FLOAT(_R2),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(R){O.vertexAttribDivisor?O.vertexAttribDivisor(R,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(R,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 x=this.program;if(!x||!x.uniforms)throw Error("No avaliable program.");return x.uniforms;}},{key:"deleteProgram",value:function deleteProgram(x){var v=this.gl;this.program===x&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),v.useProgram(null));var T=this.programs.indexOf(x);T>=0&&this.programs.splice(T,1),d(v,x),v.deleteProgram(x);}/**
38
+ },{key:"_declareUniform",value:function _declareUniform(x,v){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var f=this.gl,g=f.getUniformLocation(x,v);var u;var m=this;if(/^sampler/.test(T)){var M=x._samplerMap,E=x._bindTextures;Object.defineProperty(x.uniforms,v,{get:function get(){return u;},set:function set(A){u=A;var w=M[v]!=null?M[v]:E.length;E[w]=A,c(f,A,w),M[v]||(M[v]=w,f.uniform1i(g,w)),m.options.autoUpdate&&m.update();},configurable:!1,enumerable:!0});}else{var _M=T.indexOf("Matrix")===0,_E=!_M&&/v$/.test(T),A=f["uniform".concat(T)].bind(f);Object.defineProperty(x.uniforms,v,{get:function get(){return u;},set:function set(w){u=w,typeof w=="number"&&(w=[w]),_M?A(g,!1,w):_E?A(g,w):A.apply(void 0,[g].concat(_toConsumableArray(w))),m.options.autoUpdate&&m.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this15=this;var x=this.program;x.meshData.forEach(function(v,T){var f=v.positions,g=v.cells,u=v.instanceCount,m=v.cellsCount,M=v.attributes,E=v.uniforms,A=v.textureCoord,w=v.enableBlend,O=_this15.gl;var L=v.mode!=null?v.mode:O.TRIANGLES;typeof L=="string"&&(L=O[L]),w?O.enable(O.BLEND):O.disable(O.BLEND),O.bindBuffer(O.ARRAY_BUFFER,x._buffers.verticesBuffer),O.bufferData(O.ARRAY_BUFFER,f,O.STATIC_DRAW),g&&(O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,x._buffers.cellsBuffer),O.bufferData(O.ELEMENT_ARRAY_BUFFER,g,O.STATIC_DRAW));var b=[];M&&Object.values(M).forEach(function(_ref16){var R=_ref16.name,W=_ref16.data,z=_ref16.divisor;if(O.bindBuffer(O.ARRAY_BUFFER,x._buffers[R]),O.bufferData(O.ARRAY_BUFFER,W,O.STATIC_DRAW),z!=null){var K=O.getAttribLocation(x,R);K>=0&&(O.enableVertexAttribArray(K),b.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),R=_ref18[0],W=_ref18[1];_this15.uniforms[R]=W;});var I;if(!g){var R=x._dimension;I=f.length/R;}if(x._enableTextures&&x._buffers.texCoordBuffer){var _R2=A||l(f,x._dimension);O.bindBuffer(O.ARRAY_BUFFER,x._buffers.texCoordBuffer),O.bufferData(O.ARRAY_BUFFER,y.FLOAT(_R2),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),b.forEach(function(R){O.vertexAttribDivisor?O.vertexAttribDivisor(R,null):_this15.aia_ext&&_this15.aia_ext.vertexAttribDivisorANGLE(R,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 x=this.program;if(!x||!x.uniforms)throw Error("No avaliable program.");return x.uniforms;}},{key:"deleteProgram",value:function deleteProgram(x){var v=this.gl;this.program===x&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),v.useProgram(null));var T=this.programs.indexOf(x);T>=0&&this.programs.splice(T,1),d(v,x),v.deleteProgram(x);}/**
39
39
  [{
40
40
  positions: ...
41
41
  cells: ...
@@ -43,13 +43,13 @@ bufferSize:1500},x="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTex
43
43
  attributes: {name: {data:..., normalize: true}},
44
44
  uniforms: ...
45
45
  }]
46
- */},{key:"setMeshData",value:function setMeshData(x){var _this16=this;Array.isArray(x)||(x=[x]);var v=this.program;v.meshData=x.map(function(_ref19){var T=_ref19.mode,f=_ref19.positions,g=_ref19.instanceCount,u=_ref19.cells,m=_ref19.cellsCount,M=_ref19.attributes,E=_ref19.uniforms,A=_ref19.textureCoord,b=_ref19.enableBlend;var O={positions:y.FLOAT(f),uniforms:E,enableBlend:!!b,textureCoord:y.FLOAT(A)};if(u&&(O.cells=y.USHORT(u),O.cellsCount=m||O.cells.length),T!=null&&(O.mode=T),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],R=_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:R,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(x,v){var _this17=this;var T=/^\s*uniform\s+sampler/mg.test(x);x==null&&(x=i["default"]),v==null&&(v=T?a["default"]:n["default"]);var f=this.gl,g=Object(e.createProgram)(f,v,x);g.shaderText={vertexShader:v,fragmentShader:x},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],R=_w[2],W=_w[3];I==="mat"&&(R=Math.pow(R,2)),g._buffers[W]=f.createBuffer(),g._attribute[W]={name:W,type:I,size:Number(R)||1};}}var A=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;m=v.match(A)||[],m=m.concat(x.match(A)||[]),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],R=_L$slice2[2];w=p[w],R=!!R,w.indexOf("Matrix")!==0&&R&&(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(x){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var T=this.gl;T.useProgram(x);var f=x._dimension;T.bindBuffer(T.ARRAY_BUFFER,x._buffers.verticesBuffer);var g=T.getAttribLocation(x,this.options.vertexPosition);if(T.vertexAttribPointer(g,f,T.FLOAT,!1,0,0),T.enableVertexAttribArray(g),x._enableTextures){T.bindBuffer(T.ARRAY_BUFFER,x._buffers.texCoordBuffer);var u=T.getAttribLocation(x,this.options.vertexTextureCoord);T.vertexAttribPointer(u,x._texCoordSize||2,T.FLOAT,!1,0,0),T.enableVertexAttribArray(u);}if(Object.entries(x._attribute).forEach(function(_ref22){var _ref23=_slicedToArray(_ref22,2),u=_ref23[0],m=_ref23[1];if(m!=="ignored"){var M=m.size,E=v[u]||{},A=!!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&&(x._attribute[O]=m),T.bindBuffer(T.ARRAY_BUFFER,x._buffers[u]);var L=T.getAttribLocation(x,u);L>=0&&(T.vertexAttribPointer(L,M,T[b],A,0,0),T.enableVertexAttribArray(L));}}),!x.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 x;}},{key:"compileSync",value:function compileSync(x,v){x=x||i["default"];var T={};function f(M){M=M.replace(/^\s*/mg,"");var E=[],A=M.match(/^#pragma\s+include\s+.*/mg);if(A){for(var b=0;b<A.length;b++){var L=A[b].match(/(?:<|")(.*)(?:>|")/);if(L){var w=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),T[I])E.push("/* included ".concat(I," */"));else if(T[I]=!0,w==="lib"){var R=f(s[I]);E.push(R);}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(x),u=v?f(v):null;return this.createProgram(g,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(x,v){var T,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,A,b,L,w,I,R,_R3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:M=M.replace(/^\s*/mg,"");E=[],A=M.match(/^#pragma\s+include\s+.*/mg);if(!A){_context11.next=32;break;}b=0;case 4:if(!(b<A.length)){_context11.next=31;break;}L=A[b].match(/(?:<|")(.*)(?:>|")/);if(!L){_context11.next=28;break;}w=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),T[I])){_context11.next=13;break;}E.push("/* included ".concat(I," */"));_context11.next=28;break;case 13:if(!(T[I]=!0,w==="lib")){_context11.next=20;break;}_context11.next=16;return f(s[I]);case 16:R=_context11.sent;E.push(R);_context11.next=28;break;case 20:if(!(w==="link")){_context11.next=28;break;}_context11.next=23;return y.fetchShader(I);case 23:_R3=_context11.sent;_context11.next=26;return f(_R3);case 26:_R3=_context11.sent;E.push(_R3);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);};x=x||i["default"];T={};_context12.next=6;return f(x);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(x){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(x);case 3:x=_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(x,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 x=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,T=_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(x)?u.TEXTURE_CUBE_MAP:u.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),u.activeTexture(u.TEXTURE0+this._max_texture_image_units-1);var M=u.createTexture();u.bindTexture(m,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,E=_this$canvas4.width,A=_this$canvas4.height;if(x){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,x[b]);else u.texImage2D(m,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x);}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,A,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(m,0,u.RGBA,E,A,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,T),m===u.TEXTURE_CUBE_MAP&&(x.width=x[0].width,x.height=x[0].height),u.bindTexture(m,null),M._img=x||{width:E,height:A},M["delete"]=function(){_this18.deleteTexture(M);},M;}},{key:"deleteTexture",value:function deleteTexture(x){var v=x._img;this.gl.deleteTexture(x),typeof v.close=="function"&&v.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(x){var _ref25,_ref25$useImageBitmap,v,T,_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(x,{useImageBitmap:v});case 3:T=_context14.sent;return _context14.abrupt("return",this.createTexture(T));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,x=_ref26$color===void 0?1:_ref26$color,_ref26$blend=_ref26.blend,v=_ref26$blend===void 0?!1:_ref26$blend,_ref26$depth=_ref26.depth,T=_ref26$depth===void 0?this.options.depth!==!1:_ref26$depth,_ref26$stencil=_ref26.stencil,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 A=0;A<x;A++){var b=this.createTexture();g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0+A,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 T&&!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&&!T&&(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)),T&&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 x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=x;}},{key:"render",value:function render(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$clearBuffer=_ref27.clearBuffer,x=_ref27$clearBuffer===void 0?!0:_ref27$clearBuffer;this.startRender=!0;var v=this.gl;var T=this.program;T||(T=this.createProgram(),this.useProgram(T)),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 x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(s,x);}},{key:"FLOAT",value:function FLOAT(x,v){return Object(e.pointsToBuffer)(x,Float32Array,v);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(x,v){return Object(e.pointsToBuffer)(x,Uint8Array,v);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(x,v){return Object(e.pointsToBuffer)(x,Uint16Array,v);}},{key:"BYTE",value:function BYTE(x,v){return Object(e.pointsToBuffer)(x,Int8Array,v);}},{key:"SHORT",value:function SHORT(x,v){return Object(e.pointsToBuffer)(x,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 x=0;x<y.length;++x){try{P=c.getContext(y[x],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 _T="Vertex shader failed to compile. The error log is:".concat(c.getShaderInfoLog(P));throw new Error(_T);}var x=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(x,y),c.compileShader(x),!c.getShaderParameter(x,c.COMPILE_STATUS)){var _T2="Fragment shader failed to compile. The error log is:".concat(c.getShaderInfoLog(x));throw new Error(_T2);}var v=c.createProgram();if(c.attachShader(v,P),c.attachShader(v,x),c.linkProgram(v),!c.getProgramParameter(v,c.LINK_STATUS)){var _T3="Shader program failed to link. The error log is:".concat(c.getProgramInfoLog(v));throw new Error(_T3);}return c.deleteShader(P),c.deleteShader(x),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,x=c.length;y||(y=new p(P*x));var v=0;for(var _T4=0;_T4<x;_T4++)for(var _f5=0;_f5<P;_f5++)y[v++]=c[_T4][_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(x){P.onload=function(){p&&typeof createImageBitmap=="function"?createImageBitmap(P,{imageOrientation:"flipY"}).then(function(v){o[c]=v,y&&(o[y]=v),x(v);}):(o[c]=P,y&&(o[y]=P),x(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(x){return o[c]=x,y&&(o[y]=x),x;});});}return o[c];}var l={};function d(_x16){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(_x17){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),x=_s$getCloudRGBA.fill,v=_s$getCloudRGBA.stroke;d.push({mesh:s.mesh,_cloudOptions:[x,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,x=s.length;s.forEach(function(v,T){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 A=e["default"].createCanvas(y,P);A?_this19.filterBuffer=A.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(),T===x-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 x=y.style,v=y.variant,T=y.weight,f=y.stretch,g=y.size,u=y.pxLineHeight,m=y.family;return f==="normal"?"".concat(x," ").concat(v," ").concat(T," ").concat(g*P,"px/").concat(u*P,"px ").concat(m):"".concat(x," ").concat(v," ").concat(T," ").concat(f," ").concat(g*P,"px/").concat(u*P,"px ").concat(m);}function l(y,_ref31){var P=_ref31.font,x=_ref31.fillColor,v=_ref31.strokeColor,T=_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(x),String(v),String(T)].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 A=Object(i["default"])(P),b=Math.max(A.pxLineHeight,A.pxHeight*1.13);/italic|oblique/.test(P)&&(E+=b*Math.tan(15*Math.PI/180)),!x&&!v&&(x="#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(A,f),M.textAlign="center",M.textBaseline="middle";var I=O.height*0.5+A.pxHeight*0.05*f,R=O.width*0.5;if(x){if(Array.isArray(x))x=Object(a["default"])(x);else if(x.vector){var _z;var _x18=x,K=_x18.vector,k=_x18.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);}),x=_z;}M.fillStyle=x,M.fillText(y,R,I);}if(v){if(M.lineWidth=T*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,R,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 x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var v=x.offscreen||!d&&x.offscreen!==!1;var T;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?T=e.createCanvas(y,P,x):v&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(y,P):(T=document.createElement("canvas"),T.width=y,T.height=P),T;}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 x;}),t(1).glMatrix.setMatrixArrayType(Array);function e(v,T){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(!T&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;T=e(_u3,16);}f*=T,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 x(v,T){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),A=p.exec(m),b=y.exec(m);return M&&(u.weight=M[1]),E&&(u.style=E[1]),A&&(u.variant=A[1]),b&&(u.stretch=b[1]),u.pxHeight=e({size:u.size,unit:u.unit},T),u.pxLineHeight=e({size:u.lineHeight||u.size,unit:u.lineHeightUnit||u.unit},T),u;}},/* 24 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return"rgba(".concat(n.map(function(i,a){return a<3?Math.round(i*255):i;}).join(),")");}},/* 25 *//***/function(h,r,t){t.r(r),t.d(r,"applyFilter",function(){return o;}),t.d(r,"drawMesh2D",function(){return 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 x=0;x<4;x++)y[x]=Object(a.mix)(d[x],c[x],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 x=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var v=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;c.save();var T=!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 A=_ref34.offset,b=_ref34.color;var O=Object(n["default"])(b);P&&(O=s(O,P)),m.addColorStop(A,O);}),c.strokeStyle=m,T=!0;}else d.strokeStyle&&(P?c.strokeStyle=s(d.strokeStyle,P):c.strokeStyle=d.strokeStyle,T=!0);}T&&(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,A=_ref35.color;var b=Object(n["default"])(A);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,A=E>1&&e.vec2.equals(m[0],m[E-1]),b=M===u-1&&d.texture;if(m&&E>0){if(f||T||b){c.beginPath(),c.moveTo.apply(c,_toConsumableArray(m[0]));for(var O=1;O<E;O++)O===E-1&&A?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(x&&(_O=x),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,R=_O2.strokeColor,W=_O2.strokeWidth,z=_O2.text;!I&&!R&&(I="#000"),Array.isArray(I)&&(I=Object(n["default"])(I)),Array.isArray(R)&&(R=Object(n["default"])(R)),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)),R&&(c.lineWidth=W,c.strokeStyle=R,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();}T&&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),x=Object.keys(y),v=P.indexOf("u_texSampler"),T=x.indexOf("u_texSampler");if(v>=0&&P.splice(v,1),T>=0&&x.splice(T,1),P.length!==x.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,x,v,_T5,_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,x=!1;v=0;case 3:if(!(v<d.length)){_context17.next=47;break;}_T5=d[v];if(!(_T5 instanceof n["default"])){_context17.next=16;break;}_context17.t0=p.length;if(!_context17.t0){_context17.next=10;break;}_context17.next=10;return o(p,x);case 10:P=0;x=!1;_context17.next=14;return _T5;case 14:_context17.next=44;break;case 16:_f6=_T5.meshData;if(_f6.clipPath&&!_f6.uniforms.u_clipSampler){u=l.createTexture(_f6.clipPath);_f6.uniforms.u_clipSampler=u;}g=0;if(!((!c||!_T5.canIgnore())&&_f6&&_f6.positions.length)){_context17.next=40;break;}_T5.packIndex=v;_u6=_T5.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,x);case 27:P=0;x=!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||_T5.beforeRender||m.pass.length||_T5.pass.length||m.program!==_T5.program||!i(m,_T5,p));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(p,x);case 37:P=0;x=!1;case 39:p.push(_T5),x=x||_T5.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,x);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 x=a[0].program;for(var v=0;v<a.length;v++){var _T6=a[v].meshData;if(_T6){P+=_T6.positions.length;var _f7=_T6.positions[0].length;s+=_T6.positions.length*_f7,l+=_T6.cells.length*3,y+=_T6.attributes.a_color.length*4;var g=_T6.textureCoord;g&&(d+=g.length*g[0].length);var u=_T6.attributes.a_sourceRect;u&&(c+=u.length*4);var m=_T6.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)),x){var _v3=Object.entries(x._attribute),_T7=x._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=_T7[_g3]?_T7[_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,x=0;var v=a[0]?a[0].uniforms||{}:{},T=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 A=E.cells;for(var _b2=0;_b2<A.length;_b2++){var _O3=A[_b2];if(o){var _L=3*(x+_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(T){var _b7=Object.entries(T._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],R=_I3[0].length;for(var W=0;W<_I3.length;W++){var z=_I3[W],K=R*(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,x+=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:x*3,program:T};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(A){return Object.getOwnPropertyDescriptor(u,A).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"),x=Symbol("textureOptions"),v=Symbol("cloudColor"),T=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),A=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),R=new Uint8Array(4*u),W=new Uint8Array(4*u);return m&&(M.set(m.transform0,0),E.set(m.transform1,0),A.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),R.set(m.fillColor,0),W.set(m.strokeColor,0)),{bufferSize:u,transform0:M,transform1:E,color0:A,color1:b,color2:O,color3:L,color4:w,frameIndex:I,fillColor:R,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[T]=!1,this[p]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var 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[x]);}},{key:"hasCloudColor",get:function get(){return this[v];}},{key:"hasCloudFilter",get:function get(){return this[T];}},{key:"_getFilter",value:function _getFilter(u){return this[y][u]=this[y][u]||[],this[y][u];}},{key:"getFilter",value:function getFilter(u){return this._getFilter(u).join(" ");}},{key:"enableBlend",get:function get(){return this[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,A=_this$f2.color1,b=_this$f2.color2,O=_this$f2.color3,L=_this$f2.color4,w=_this$f2.frameIndex,I=_this$f2.fillColor,R=_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),A.set(A.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),R.set(R.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,A=_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),A.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[T]=!0):(M.set([1,0,0,0],u),E.set([0,1,0,0],u),A.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,A=_this$f4.color3,b=_this$f4.color4;return[m[u],M[u],E[u],A[u],b[u],m[u+1],M[u+1],E[u+1],A[u+1],b[u+1],m[u+2],M[u+2],E[u+2],A[u+2],b[u+2],m[u+3],M[u+3],E[u+3],A[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]],A=[M[u],M[u+1],M[u+2],M[u+3]];return E[3]/=255,A[3]/=255,{fill:"rgba(".concat(E.join(),")"),stroke:"rgba(".concat(A.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[x]=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,A=_this$d$meshData.uniforms,b=this[P],O={attributes:s({},u),cells:m,positions:M,textureCoord:E,uniforms:s({},A),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,R=_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:R,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 A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[M,E]),A=e.mat2d.rotate(Array.of(0,0,0,0,0,0),A,m),A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[-M,-E]),this.transform(u,A);}},{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],A=_ref45[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[E,A]),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,-A]),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],A=_ref49[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[E,A]),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,-A]),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 A=this.getTransform(u),b=Object(i.transformPoint)([m,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),A));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 x=[],v=y[0],T=y[1],f=y[2],g=y[3],u=y[4],m=y[5],M=y[6],E=y[7],A=y[8],b=y[9],O=y[10],L=y[11],w=y[12],I=y[13],R=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],rt=P[4];return x[0]=U*v+G*m+Z*O+nt*W,x[1]=U*T+G*M+Z*L+nt*z,x[2]=U*f+G*E+Z*w+nt*K,x[3]=U*g+G*A+Z*I+nt*k,x[4]=U*u+G*b+Z*R+nt*q+rt,U=P[5],G=P[6],Z=P[7],nt=P[8],rt=P[9],x[5]=U*v+G*m+Z*O+nt*W,x[6]=U*T+G*M+Z*L+nt*z,x[7]=U*f+G*E+Z*w+nt*K,x[8]=U*g+G*A+Z*I+nt*k,x[9]=U*u+G*b+Z*R+nt*q+rt,U=P[10],G=P[11],Z=P[12],nt=P[13],rt=P[14],x[10]=U*v+G*m+Z*O+nt*W,x[11]=U*T+G*M+Z*L+nt*z,x[12]=U*f+G*E+Z*w+nt*K,x[13]=U*g+G*A+Z*I+nt*k,x[14]=U*u+G*b+Z*R+nt*q+rt,U=P[15],G=P[16],Z=P[17],nt=P[18],rt=P[19],x[15]=U*v+G*m+Z*O+nt*W,x[16]=U*T+G*M+Z*L+nt*z,x[17]=U*f+G*E+Z*w+nt*K,x[18]=U*g+G*A+Z*I+nt*k,x[19]=U*u+G*b+Z*R+nt*q+rt,x;}function i(y){y=Object(e.clamp)(0,1,y);var P=0.2126*y,x=0.7152*y,v=0.0722*y;return[P+1-y,x,v,0,0,P,x+1-y,v,0,0,P,x,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),x=0.7152*(1-y),v=0.0722*(1-y);return[P+y,x,v,0,0,P,x+y,v,0,0,P,x,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,x=Math.cos(P),v=Math.sin(P),T=0.2126,f=0.7152,g=0.0722;return[T+x*(1-T)+v*-T,f+x*-f+v*-f,g+x*-g+v*(1-g),0,0,T+x*-T+v*0.143,f+x*(1-f)+v*0.14,g+x*-g+v*-0.283,0,0,T+x*-T+v*-(1-T),f+x*-f+v*f,g+x*(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),x=P.length,v=x<=4;p=1,v?(c=[parseInt(P[0]+P[0],16),parseInt(P[1]+P[1],16),parseInt(P[2]+P[2],16)],x===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)],x===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 T=d[1],f=T==="rgb",P=T.replace(/a$/,"");y=P;var x=P==="cmyk"?4:P==="gray"?1:3;c=d[2].trim().split(/\s*,\s*/).map(function(M,E){if(/%$/.test(M))return E===x?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);}),T===P&&c.push(1),p=f||c[x]===void 0?1:c[x],c=c.slice(0,x);}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"),x=Symbol("path"),v=Symbol("simplify"),T=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[x]=n()(m.path):this[x]=[],this[P]=null,this[v]=m.simplify!=null?m.simplify:0,this[T]=m.scale!=null?m.scale:2;}return _createClass(g,[{key:"contours",get:function get(){var m=null;if(!this[P]&&this[x]){var M=Object(l["default"])(s()(this[x]));this[P]=c()(M,this[T],this[v]),this[P].path=M,this[P].simplify=this[v],this[P].scale=this[T];}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[x];}},{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,A){return[].concat(_toConsumableArray(E),_toConsumableArray(A));});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$x;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[x])).map(function(_ref56){var _ref57=_toArray(_ref56),A=_ref57[0],b=_ref57.slice(1);var O=[A];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$x=this[x]).push.apply(_this$x,_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$x2;this[P]=null,typeof m=="string"&&(m=n()(m)),(_this$x2=this[x]).push.apply(_this$x2,_toConsumableArray(m));}},{key:"beginPath",value:function beginPath(){this[x]=[],this[P]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(m,M,E,A,b,O,L){var w=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(O+=b,L+=b,E<=0||A<=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 R=this[x].length>0&&I<f?"L":"M";var W=Object(y.getPoint)(m,M,E,A,O),z=Object(y.getPoint)(m,M,E,A,L),K=+!w;var k=I>Math.PI?1:0;w&&(k=1-k),R+=W.join(" "),R+="A".concat(E," ").concat(A," 0 ").concat(k," ").concat(K," ").concat(z.join(" ")),I>=f&&(R+="Z"),this.addPath(R);}},{key:"arc",value:function arc(m,M,E,A,b){var O=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(m,M,E,E,0,A,b,O);}},{key:"arcTo",value:function arcTo(m,M,E,A,b,O,L){this[P]=null,this[x].push(["A",m,M,E,A,b,O,L]);}},{key:"moveTo",value:function moveTo(m,M){this[P]=null,this[x].push(["M",m,M]);}},{key:"lineTo",value:function lineTo(m,M){this[P]=null,this[x].push(["L",m,M]);}},{key:"bezierCurveTo",value:function bezierCurveTo(m,M,E,A,b,O){this[P]=null,this[x].push(["C",m,M,E,A,b,O]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(m,M,E,A){this[P]=null,this[x].push(["Q",m,M,E,A]);}},{key:"rect",value:function rect(m,M,E,A){var b="M".concat(m," ").concat(M,"L").concat(m+E," ").concat(M,"L").concat(m+E," ").concat(M+A,"L").concat(m," ").concat(M+A,"Z");this.addPath(b);}},{key:"closePath",value:function closePath(){this[P]=null;var m=[];var M=this[x].length;M>0&&(m=this[x][M-1]),m[0]!=="Z"&&m[0]!=="z"&&this[x].push(["Z"]);}}]);}();},/* 41 *//***/function(h,r){h.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(o){var s=[];return o.replace(e,function(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,x=null,v=0,T=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,T,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!M.length)continue;M=M.map(function(L){var _L7=_slicedToArray(L,8),w=_L7[0],I=_L7[1],R=_L7[2],W=_L7[3],z=_L7[4],K=_L7[5],k=_L7[6],q=_L7[7];return{x1:R,y1:W,x2:z,y2:K,x:k,y:q};});for(var E=0,A;E<M.length;E++)A=M[E],u=["C",A.x1,A.y1,A.x2,A.y2,A.x,A.y],E<M.length-1&&l.push(u);break;case"S":var b=v,O=T;(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,x=T*2-x):(P=v,x=T),u=a(v,T,P,x,u[1],u[2]);break;case"Q":P=u[1],x=u[2],u=a(v,T,u[1],u[2],u[3],u[4]);break;case"L":u=i(v,T,u[1],u[2]);break;case"H":u=i(v,T,u[1],T);break;case"V":u=i(v,T,v,u[1]);break;case"Z":u=i(v,T,p,y);break;}s=m,v=u[u.length-2],T=u[u.length-1],u.length>4?(d=u[u.length-4],c=u[u.length-3]):(d=v,c=T),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,x,v,T){var f=T*(s-d)/2+v*(l-c)/2,g=-v*(s-d)/2+T*(l-c)/2,u=P*P,m=x*x,M=f*f,E=g*g;var A=u*m-u*E-m*M;A<0&&(A=0),A/=u*E+m*M,A=Math.sqrt(A)*(p===y?-1:1);var b=A*P/x*g,O=A*-x/P*f,L=T*b-v*O+(s+d)/2,w=v*b+T*O+(l+c)/2,I=(f-b)/P,R=(g-O)/x,W=(-f-b)/P,z=(-g-O)/x,K=n(1,0,I,R);var k=n(I,R,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,x,v){var T=Math.sin(v*e/360),f=Math.cos(v*e/360),g=f*(s-d)/2+T*(l-c)/2,u=-T*(s-d)/2+f*(l-c)/2;if(g===0&&u===0)return[];if(P===0||x===0)return[];P=Math.abs(P),x=Math.abs(x);var m=g*g/(P*P)+u*u/(x*x);m>1&&(P*=Math.sqrt(m),x*=Math.sqrt(m));var M=i(s,l,d,c,p,y,P,x,T,f),E=[];var A=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(A,b)),A+=b;return E.map(function(L){for(var w=0;w<L.length;w+=2){var I=L[w+0],R=L[w+1];I*=P,R*=x;var W=f*I-T*R,z=T*I+f*R;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 x=[],v=[],T=[0,0];return p.forEach(function(f,g,u){if(f[0]==="M")n(T,f.slice(1)),v.length>0&&(x.push(v),v=[]);else if(f[0]==="C")d(v,y,T,f),a(T,f[5],f[6]);else throw new Error("illegal type in SVG: "+f[0]);}),v.length>0&&x.push(v),x.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(x,v,T,f,g,u){u||(u=[]),g=typeof g=="number"?g:1;var m=s/g;return m*=m,p(x,v,T,f,u,m),u;};function p(P,x,v,T,f,g){f.push(t(P));var u=P[0],m=P[1],M=x[0],E=x[1],A=v[0],b=v[1],O=T[0],L=T[1];y(u,m,M,E,A,b,O,L,f,g,0),f.push(t(T));}function y(P,x,v,T,f,g,u,m,M,E,A){if(!(A>a)){var b=Math.PI,O=(P+v)/2,L=(x+T)/2,w=(v+f)/2,I=(T+g)/2,R=(f+u)/2,W=(g+m)/2,z=(O+w)/2,K=(L+I)/2,k=(w+R)/2,q=(I+W)/2,U=(z+k)/2,G=(K+q)/2;if(A>0){var Z=u-P,nt=m-x,rt=Math.abs((v-u)*nt-(T-m)*Z),tt=Math.abs((f-u)*nt-(g-m)*Z),J,ht;if(rt>o&&tt>o){if((rt+tt)*(rt+tt)<=E*(Z*Z+nt*nt)){if(d<l){M.push(e(U,G));return;}var dt=Math.atan2(g-T,f-v);if(J=Math.abs(dt-Math.atan2(T-x,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,T));return;}if(ht>c){M.push(e(f,g));return;}}}}else if(rt>o){if(rt*rt<=E*(Z*Z+nt*nt)){if(d<l){M.push(e(U,G));return;}if(J=Math.abs(Math.atan2(g-T,f-v)-Math.atan2(T-x,v-P)),J>=b&&(J=2*b-J),J<d){M.push(e(v,T)),M.push(e(f,g));return;}if(c!==0&&J>c){M.push(e(v,T));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-T,f-v)),J>=b&&(J=2*b-J),J<d){M.push(e(v,T)),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-(x+m)/2,Z*Z+nt*nt<=E){M.push(e(U,G));return;}}y(P,x,O,L,z,K,U,G,M,E,A+1),y(U,G,k,q,R,W,u,m,M,E,A+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 T;}),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,x=i();function v(g,u,m,M,E){p(g,m,M),y(g,g),P(u,-g[1],g[0]),P(x,-m[1],m[0]);var A=E/s(u,x);return Math.abs(A);}function T(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],x=y[y.length-1],v=Math.atan2(x[1]-P[1],x[0]-P[0]);return{current:s.map(function(T){return _toConsumableArray(T);}),point:{x:x[0],y:x[1],angle:v}};}var p=[];for(var _y2=0;_y2<s.length;_y2++){p[_y2]=[];var _P=s[_y2];var _x19=_P[0];for(var _v4=1;_v4<_P.length;_v4++){var _T8=_P[_v4],_f9=Object(e.distance)(_x19,_T8);if(l<_f9){var g=l/_f9,u=Math.atan2(_T8[1]-_x19[1],_T8[0]-_x19[0]),m={x:_x19[0]*(1-g)+_T8[0]*g,y:_x19[1]*(1-g)+_T8[1]*g,angle:u};if(p[_y2].push(_x19),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(_x19),_x19=_T8;}}}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=[],x=l.length;if(d>0){do d-=l[c%x],c++;while(d>0);d<0&&(p=-d,c--);}else if(d<0){c=-1;do d+=l[c%x+x-1],c--;while(d<0);d>=0&&(c++,p=l[c%x+x-1]-d);}do{var v=i(y,p);y=v.rest,++c%2&&P.push.apply(P,_toConsumableArray(v.current));var _T9=c%x;_T9<0&&(_T9+=x),p=l[_T9];}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,x=d*P+c;return[P,x];}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),x=/* @__PURE__ */t.n(P),v=t(31),T=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"),A=Symbol("fill"),b=Symbol("strokeColor"),O=Symbol("fillColor"),L=Symbol("transform"),w=Symbol("invertTransform"),I=Symbol("uniforms"),R=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"),rt=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=x()(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[A]=null,this[L]=[1,0,0,1,0,0],this[Z]=1,this[I]={},this[G]=[],this[W]=null,this[R]={},this.contours=N.contours,this[nt]=null,this[rt]={},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[rt][N]:this[rt][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[A]?this[A].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[R]}: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[rt],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}
46
+ */},{key:"setMeshData",value:function setMeshData(x){var _this16=this;Array.isArray(x)||(x=[x]);var v=this.program;v.meshData=x.map(function(_ref19){var T=_ref19.mode,f=_ref19.positions,g=_ref19.instanceCount,u=_ref19.cells,m=_ref19.cellsCount,M=_ref19.attributes,E=_ref19.uniforms,A=_ref19.textureCoord,w=_ref19.enableBlend;var O={positions:y.FLOAT(f),uniforms:E,enableBlend:!!w,textureCoord:y.FLOAT(A)};if(u&&(O.cells=y.USHORT(u),O.cellsCount=m||O.cells.length),T!=null&&(O.mode=T),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),b=_ref21[0],I=_ref21[1];if(!v._attribute[b])v._attribute[b]="ignored";else if(v._attribute[b]!=="ignored"){var _v$_attribute$b=v._attribute[b],R=_v$_attribute$b.name,W=_v$_attribute$b.type;var z=I.data||I;if(Array.isArray(z)&&(z=y[W](z)),L[b]={name:R,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[b].divisor=I.divisor;}}}),O.attributes=L;}return O;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(x,v){var _this17=this;var T=/^\s*uniform\s+sampler/mg.test(x);x==null&&(x=i["default"]),v==null&&(v=T?a["default"]:n["default"]);var f=this.gl,g=Object(e.createProgram)(f,v,x);g.shaderText={vertexShader:v,fragmentShader:x},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,b=m[O].match(L);if(b&&b[3]!==this.options.vertexPosition&&b[3]!==this.options.vertexTextureCoord){var _b=_slicedToArray(b,4),I=_b[1],R=_b[2],W=_b[3];I==="mat"&&(R=Math.pow(R,2)),g._buffers[W]=f.createBuffer(),g._attribute[W]={name:W,type:I,size:Number(R)||1};}}var A=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;m=v.match(A)||[],m=m.concat(x.match(A)||[]),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),b=_L$slice2[0],I=_L$slice2[1],R=_L$slice2[2];b=p[b],R=!!R,b.indexOf("Matrix")!==0&&R&&(b+="v"),_this17._declareUniform(g,I,b);}),g._buffers.verticesBuffer=f.createBuffer(),g._buffers.cellsBuffer=f.createBuffer();var w=f.getAttribLocation(g,this.options.vertexTextureCoord);return g._enableTextures=w>=0,g._enableTextures&&(g._buffers.texCoordBuffer=f.createBuffer()),this.programs.push(g),g;}},{key:"useProgram",value:function useProgram(x){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var T=this.gl;T.useProgram(x);var f=x._dimension;T.bindBuffer(T.ARRAY_BUFFER,x._buffers.verticesBuffer);var g=T.getAttribLocation(x,this.options.vertexPosition);if(T.vertexAttribPointer(g,f,T.FLOAT,!1,0,0),T.enableVertexAttribArray(g),x._enableTextures){T.bindBuffer(T.ARRAY_BUFFER,x._buffers.texCoordBuffer);var u=T.getAttribLocation(x,this.options.vertexTextureCoord);T.vertexAttribPointer(u,x._texCoordSize||2,T.FLOAT,!1,0,0),T.enableVertexAttribArray(u);}if(Object.entries(x._attribute).forEach(function(_ref22){var _ref23=_slicedToArray(_ref22,2),u=_ref23[0],m=_ref23[1];if(m!=="ignored"){var M=m.size,E=v[u]||{},A=!!E.normalize;var w=E.type||"FLOAT";var O=E.key||u;w==="UBYTE"&&(w="UNSIGNED_BYTE"),w==="USHORT"&&(w="UNSIGNED_SHORT"),m.type=w,O&&O!==u&&(x._attribute[O]=m),T.bindBuffer(T.ARRAY_BUFFER,x._buffers[u]);var L=T.getAttribLocation(x,u);L>=0&&(T.vertexAttribPointer(L,M,T[w],A,0,0),T.enableVertexAttribArray(L));}}),!x.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 x;}},{key:"compileSync",value:function compileSync(x,v){x=x||i["default"];var T={};function f(M){M=M.replace(/^\s*/mg,"");var E=[],A=M.match(/^#pragma\s+include\s+.*/mg);if(A){for(var w=0;w<A.length;w++){var L=A[w].match(/(?:<|")(.*)(?:>|")/);if(L){var b=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),T[I])E.push("/* included ".concat(I," */"));else if(T[I]=!0,b==="lib"){var R=f(s[I]);E.push(R);}else if(b==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}E.forEach(function(w){M=M.replace(/^#pragma\s+include\s+.*/m,w);});}return M;}var g=f(x),u=v?f(v):null;return this.createProgram(g,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(x,v){var T,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,A,w,L,b,I,R,_R3;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:M=M.replace(/^\s*/mg,"");E=[],A=M.match(/^#pragma\s+include\s+.*/mg);if(!A){_context11.next=32;break;}w=0;case 4:if(!(w<A.length)){_context11.next=31;break;}L=A[w].match(/(?:<|")(.*)(?:>|")/);if(!L){_context11.next=28;break;}b=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),T[I])){_context11.next=13;break;}E.push("/* included ".concat(I," */"));_context11.next=28;break;case 13:if(!(T[I]=!0,b==="lib")){_context11.next=20;break;}_context11.next=16;return f(s[I]);case 16:R=_context11.sent;E.push(R);_context11.next=28;break;case 20:if(!(b==="link")){_context11.next=28;break;}_context11.next=23;return y.fetchShader(I);case 23:_R3=_context11.sent;_context11.next=26;return f(_R3);case 26:_R3=_context11.sent;E.push(_R3);case 28:w++;_context11.next=4;break;case 31:E.forEach(function(w){M=M.replace(/^#pragma\s+include\s+.*/m,w);});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);};x=x||i["default"];T={};_context12.next=6;return f(x);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(x){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(x);case 3:x=_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(x,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 x=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,T=_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(x)?u.TEXTURE_CUBE_MAP:u.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),u.activeTexture(u.TEXTURE0+this._max_texture_image_units-1);var M=u.createTexture();u.bindTexture(m,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,E=_this$canvas4.width,A=_this$canvas4.height;if(x){if(m===u.TEXTURE_CUBE_MAP)for(var w=0;w<6;w++)u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+w,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x[w]);else u.texImage2D(m,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x);}else if(m===u.TEXTURE_CUBE_MAP)for(var _w=0;_w<6;_w++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_w,0,u.RGBA,E,A,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(m,0,u.RGBA,E,A,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,T),m===u.TEXTURE_CUBE_MAP&&(x.width=x[0].width,x.height=x[0].height),u.bindTexture(m,null),M._img=x||{width:E,height:A},M["delete"]=function(){_this18.deleteTexture(M);},M;}},{key:"deleteTexture",value:function deleteTexture(x){var v=x._img;this.gl.deleteTexture(x),typeof v.close=="function"&&v.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(x){var _ref25,_ref25$useImageBitmap,v,T,_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(x,{useImageBitmap:v});case 3:T=_context14.sent;return _context14.abrupt("return",this.createTexture(T));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,x=_ref26$color===void 0?1:_ref26$color,_ref26$blend=_ref26.blend,v=_ref26$blend===void 0?!1:_ref26$blend,_ref26$depth=_ref26.depth,T=_ref26$depth===void 0?this.options.depth!==!1:_ref26$depth,_ref26$stencil=_ref26.stencil,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 A=0;A<x;A++){var w=this.createTexture();g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0+A,g.TEXTURE_2D,w,0/* level */),m.push(w);}u.textures=m,u.texture=m[0],u.blend=v;var _this$canvas5=this.canvas,M=_this$canvas5.width,E=_this$canvas5.height;return T&&!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&&!T&&(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)),T&&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 x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=x;}},{key:"render",value:function render(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$clearBuffer=_ref27.clearBuffer,x=_ref27$clearBuffer===void 0?!0:_ref27$clearBuffer;this.startRender=!0;var v=this.gl;var T=this.program;T||(T=this.createProgram(),this.useProgram(T)),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 x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(s,x);}},{key:"FLOAT",value:function FLOAT(x,v){return Object(e.pointsToBuffer)(x,Float32Array,v);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(x,v){return Object(e.pointsToBuffer)(x,Uint8Array,v);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(x,v){return Object(e.pointsToBuffer)(x,Uint16Array,v);}},{key:"BYTE",value:function BYTE(x,v){return Object(e.pointsToBuffer)(x,Int8Array,v);}},{key:"SHORT",value:function SHORT(x,v){return Object(e.pointsToBuffer)(x,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 x=0;x<y.length;++x){try{P=c.getContext(y[x],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 _T="Vertex shader failed to compile. The error log is:".concat(c.getShaderInfoLog(P));throw new Error(_T);}var x=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(x,y),c.compileShader(x),!c.getShaderParameter(x,c.COMPILE_STATUS)){var _T2="Fragment shader failed to compile. The error log is:".concat(c.getShaderInfoLog(x));throw new Error(_T2);}var v=c.createProgram();if(c.attachShader(v,P),c.attachShader(v,x),c.linkProgram(v),!c.getProgramParameter(v,c.LINK_STATUS)){var _T3="Shader program failed to link. The error log is:".concat(c.getProgramInfoLog(v));throw new Error(_T3);}return c.deleteShader(P),c.deleteShader(x),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,x=c.length;y||(y=new p(P*x));var v=0;for(var _T4=0;_T4<x;_T4++)for(var _f5=0;_f5<P;_f5++)y[v++]=c[_T4][_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(x){P.onload=function(){p&&typeof createImageBitmap=="function"?createImageBitmap(P,{imageOrientation:"flipY"}).then(function(v){o[c]=v,y&&(o[y]=v),x(v);}):(o[c]=P,y&&(o[y]=P),x(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(x){return o[c]=x,y&&(o[y]=x),x;});});}return o[c];}var l={};function d(_x16){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(_x17){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),x=_s$getCloudRGBA.fill,v=_s$getCloudRGBA.stroke;d.push({mesh:s.mesh,_cloudOptions:[x,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,x=s.length;s.forEach(function(v,T){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 A=e["default"].createCanvas(y,P);A?_this19.filterBuffer=A.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(),T===x-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 x=y.style,v=y.variant,T=y.weight,f=y.stretch,g=y.size,u=y.pxLineHeight,m=y.family;return f==="normal"?"".concat(x," ").concat(v," ").concat(T," ").concat(g*P,"px/").concat(u*P,"px ").concat(m):"".concat(x," ").concat(v," ").concat(T," ").concat(f," ").concat(g*P,"px/").concat(u*P,"px ").concat(m);}function l(y,_ref31){var P=_ref31.font,x=_ref31.fillColor,v=_ref31.strokeColor,T=_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(x),String(v),String(T)].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 A=Object(i["default"])(P),w=Math.max(A.pxLineHeight,A.pxHeight*1.13);/italic|oblique/.test(P)&&(E+=w*Math.tan(15*Math.PI/180)),!x&&!v&&(x="#000");var O=M.canvas,L=Math.ceil(E),b=Math.ceil(w);O.width=Math.round(L*f),O.height=Math.round(b*f),M.save(),M.font=s(A,f),M.textAlign="center",M.textBaseline="middle";var I=O.height*0.5+A.pxHeight*0.05*f,R=O.width*0.5;if(x){if(Array.isArray(x))x=Object(a["default"])(x);else if(x.vector){var _z;var _x18=x,K=_x18.vector,k=_x18.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);}),x=_z;}M.fillStyle=x,M.fillText(y,R,I);}if(v){if(M.lineWidth=T*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,R,I);}M.restore();var W={image:g,rect:[0,0,L,b]};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 x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var v=x.offscreen||!d&&x.offscreen!==!1;var T;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?T=e.createCanvas(y,P,x):v&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(y,P):(T=document.createElement("canvas"),T.width=y,T.height=P),T;}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 x;}),t(1).glMatrix.setMatrixArrayType(Array);function e(v,T){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(!T&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;T=e(_u3,16);}f*=T,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 x(v,T){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),A=p.exec(m),w=y.exec(m);return M&&(u.weight=M[1]),E&&(u.style=E[1]),A&&(u.variant=A[1]),w&&(u.stretch=w[1]),u.pxHeight=e({size:u.size,unit:u.unit},T),u.pxLineHeight=e({size:u.lineHeight||u.size,unit:u.lineHeightUnit||u.unit},T),u;}},/* 24 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return"rgba(".concat(n.map(function(i,a){return a<3?Math.round(i*255):i;}).join(),")");}},/* 25 *//***/function(h,r,t){t.r(r),t.d(r,"applyFilter",function(){return o;}),t.d(r,"drawMesh2D",function(){return 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 x=0;x<4;x++)y[x]=Object(a.mix)(d[x],c[x],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 x=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var v=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;c.save();var T=!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 A=_ref34.offset,w=_ref34.color;var O=Object(n["default"])(w);P&&(O=s(O,P)),m.addColorStop(A,O);}),c.strokeStyle=m,T=!0;}else d.strokeStyle&&(P?c.strokeStyle=s(d.strokeStyle,P):c.strokeStyle=d.strokeStyle,T=!0);}T&&(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,A=_ref35.color;var w=Object(n["default"])(A);P&&(w=s(w,P)),g.addColorStop(E,w);}),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,A=E>1&&e.vec2.equals(m[0],m[E-1]),w=M===u-1&&d.texture;if(m&&E>0){if(f||T||w){c.beginPath(),c.moveTo.apply(c,_toConsumableArray(m[0]));for(var O=1;O<E;O++)O===E-1&&A?c.closePath():c.lineTo.apply(c,_toConsumableArray(m[O]));}if(f&&c.fill(d.fillRule),w){c.save(),c.clip();var _d$texture=d.texture,_O=_d$texture.image,L=_d$texture.options;if(x&&(_O=x),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,b=_O2.font,I=_O2.fillColor,R=_O2.strokeColor,W=_O2.strokeWidth,z=_O2.text;!I&&!R&&(I="#000"),Array.isArray(I)&&(I=Object(n["default"])(I)),Array.isArray(R)&&(R=Object(n["default"])(R)),c.font=b;var _c$measureText=c.measureText(z),K=_c$measureText.width,k=Object(i["default"])(b),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)),R&&(c.lineWidth=W,c.strokeStyle=R,c.strokeText(z,Z,G));}else{var _b2=L.rect;var _I=L.srcRect;L.scale&&(_b2=[0,0,c.canvas.width,c.canvas.height]),L.rotated&&_b2&&(_b2=[-_b2[1],_b2[0],_b2[3],_b2[2]]),_I&&(_b2=_b2||[0,0,_I[2],_I[3]]),L.rotated&&(c.translate(0,_b2?_b2[2]:_O.width),c.rotate(-0.5*Math.PI)),_I?c.drawImage.apply(c,[_O].concat(_toConsumableArray(_I),_toConsumableArray(_b2))):_b2?c.drawImage.apply(c,[_O].concat(_toConsumableArray(_b2))):c.drawImage(_O,0,0);}c.restore();}T&&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),x=Object.keys(y),v=P.indexOf("u_texSampler"),T=x.indexOf("u_texSampler");if(v>=0&&P.splice(v,1),T>=0&&x.splice(T,1),P.length!==x.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,x,v,_T5,_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,x=!1;v=0;case 3:if(!(v<d.length)){_context17.next=47;break;}_T5=d[v];if(!(_T5 instanceof n["default"])){_context17.next=16;break;}_context17.t0=p.length;if(!_context17.t0){_context17.next=10;break;}_context17.next=10;return o(p,x);case 10:P=0;x=!1;_context17.next=14;return _T5;case 14:_context17.next=44;break;case 16:_f6=_T5.meshData;if(_f6.clipPath&&!_f6.uniforms.u_clipSampler){u=l.createTexture(_f6.clipPath);_f6.uniforms.u_clipSampler=u;}g=0;if(!((!c||!_T5.canIgnore())&&_f6&&_f6.positions.length)){_context17.next=40;break;}_T5.packIndex=v;_u6=_T5.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,x);case 27:P=0;x=!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||_T5.beforeRender||m.pass.length||_T5.pass.length||m.program!==_T5.program||!i(m,_T5,p));if(!_context17.t2){_context17.next=39;break;}_context17.next=37;return o(p,x);case 37:P=0;x=!1;case 39:p.push(_T5),x=x||_T5.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,x);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 x=a[0].program;for(var v=0;v<a.length;v++){var _T6=a[v].meshData;if(_T6){P+=_T6.positions.length;var _f7=_T6.positions[0].length;s+=_T6.positions.length*_f7,l+=_T6.cells.length*3,y+=_T6.attributes.a_color.length*4;var g=_T6.textureCoord;g&&(d+=g.length*g[0].length);var u=_T6.attributes.a_sourceRect;u&&(c+=u.length*4);var m=_T6.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)),x){var _v3=Object.entries(x._attribute),_T7=x._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=_T7[_g3]?_T7[_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,x=0;var v=a[0]?a[0].uniforms||{}:{},T=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 w=E.positions;for(var O=0;O<w.length;O++){var L=w[O],b=3*(P+O);for(var I=0;I<L.length;I++)s[b+I]=L[I];}}else(_s2=s).push.apply(_s2,_toConsumableArray(E.positions));var A=E.cells;for(var _w2=0;_w2<A.length;_w2++){var _O3=A[_w2];if(o){var _L=3*(x+_w2);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 _w3=E.attributes.a_color;for(var _O4=0;_O4<_w3.length;_O4++){var _L2=_w3[_O4],_b3=4*(P+_O4);c[_b3]=_L2[0],c[_b3+1]=_L2[1],c[_b3+2]=_L2[2],c[_b3+3]=_L2[3];}}else(_c2=c).push.apply(_c2,_toConsumableArray(E.attributes.a_color));if(E.attributes.a_sourceRect)if(f=!0,o){var _w4=E.attributes.a_sourceRect;for(var _O5=0;_O5<_w4.length;_O5++){var _L3=_w4[_O5],_b4=4*(P+_O5);p[_b4]=_L3[0],p[_b4+1]=_L3[1],p[_b4+2]=_L3[2],p[_b4+3]=_L3[3];}}else(_p2=p).push.apply(_p2,_toConsumableArray(E.attributes.a_sourceRect));if(E.attributes.a_clipUV)if(g=!0,o){var _w5=E.attributes.a_clipUV;for(var _O6=0;_O6<_w5.length;_O6++){var _L4=_w5[_O6],_b5=2*(P+_O6);y[_b5]=_L4[0],y[_b5+1]=_L4[1];}}else(_y=y).push.apply(_y,_toConsumableArray(E.attributes.a_clipUV));if(E.textureCoord)if(o){var _w6=E.textureCoord;for(var _O7=0;_O7<_w6.length;_O7++){var _L5=_w6[_O7],_b6=3*(P+_O7);for(var _I2=0;_I2<_L5.length;_I2++)d[_b6+_I2]=_L5[_I2];}}else(_d3=d).push.apply(_d3,_toConsumableArray(E.textureCoord));if(T){var _w7=Object.entries(T._attribute);for(var _O8=0;_O8<_w7.length;_O8++){var _u$_L;var _w7$_O=_slicedToArray(_w7[_O8],2),_L6=_w7$_O[0],_b7=_w7$_O[1];if(_L6!=="a_color"&&_L6!=="a_sourceRect"&&_b7!=="ignored")if(u[_L6]=[],o){u[_L6]=o[_L6];var _I3=E.attributes[_L6],R=_I3[0].length;for(var W=0;W<_I3.length;W++){var z=_I3[W],K=R*(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,x+=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:x*3,program:T};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(A){return Object.getOwnPropertyDescriptor(u,A).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"),x=Symbol("textureOptions"),v=Symbol("cloudColor"),T=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),A=new Float32Array(4*u),w=new Float32Array(4*u),O=new Float32Array(4*u),L=new Float32Array(4*u),b=new Float32Array(4*u),I=new Uint8Array(u),R=new Uint8Array(4*u),W=new Uint8Array(4*u);return m&&(M.set(m.transform0,0),E.set(m.transform1,0),A.set(m.color0,0),w.set(m.color1,0),O.set(m.color2,0),L.set(m.color3,0),b.set(m.color4,0),I.set(m.frameIndex,0),R.set(m.fillColor,0),W.set(m.strokeColor,0)),{bufferSize:u,transform0:M,transform1:E,color0:A,color1:w,color2:O,color3:L,color4:b,frameIndex:I,fillColor:R,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[T]=!1,this[p]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var 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[x]);}},{key:"hasCloudColor",get:function get(){return this[v];}},{key:"hasCloudFilter",get:function get(){return this[T];}},{key:"_getFilter",value:function _getFilter(u){return this[y][u]=this[y][u]||[],this[y][u];}},{key:"getFilter",value:function getFilter(u){return this._getFilter(u).join(" ");}},{key:"enableBlend",get:function get(){return this[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,A=_this$f2.color1,w=_this$f2.color2,O=_this$f2.color3,L=_this$f2.color4,b=_this$f2.frameIndex,I=_this$f2.fillColor,R=_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),A.set(A.subarray(4*(u+1)),4*u),w.set(w.subarray(4*(u+1)),4*u),O.set(O.subarray(4*(u+1)),4*u),L.set(L.subarray(4*(u+1)),4*u),b.set(b.subarray(u+1),u),I.set(I.subarray(4*(u+1)),4*u),R.set(R.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,A=_this$f3.color2,w=_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),A.set([m[2],m[7],m[12],m[17]],u),w.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[T]=!0):(M.set([1,0,0,0],u),E.set([0,1,0,0],u),A.set([0,0,1,0],u),w.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,A=_this$f4.color3,w=_this$f4.color4;return[m[u],M[u],E[u],A[u],w[u],m[u+1],M[u+1],E[u+1],A[u+1],w[u+1],m[u+2],M[u+2],E[u+2],A[u+2],w[u+2],m[u+3],M[u+3],E[u+3],A[u+3],w[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]],A=[M[u],M[u+1],M[u+2],M[u+3]];return E[3]/=255,A[3]/=255,{fill:"rgba(".concat(E.join(),")"),stroke:"rgba(".concat(A.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[x]=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,A=_this$d$meshData.uniforms,w=this[P],O={attributes:s({},u),cells:m,positions:M,textureCoord:E,uniforms:s({},A),instanceCount:this[c],enableBlend:this.enableBlend};w.length&&w.forEach(function(G,Z){O.uniforms["u_texFrame".concat(Z)]=G;});var _this$f8=this[f],L=_this$f8.transform0,b=_this$f8.transform1,I=_this$f8.color0,R=_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:b,divisor:1},O.attributes.a_colorCloud0={data:I,divisor:1},O.attributes.a_colorCloud1={data:R,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 A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[M,E]),A=e.mat2d.rotate(Array.of(0,0,0,0,0,0),A,m),A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[-M,-E]),this.transform(u,A);}},{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],A=_ref45[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[E,A]),w=e.mat2d.scale(Array.of(0,0,0,0,0,0),w,[m,M]),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-E,-A]),this.transform(u,w);}},{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],A=_ref49[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[E,A]),w=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,e.mat2d.fromValues(1,Math.tan(M),Math.tan(m),1,0,0)),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-E,-A]),this.transform(u,w);}},{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 A=this.getTransform(u),w=Object(i.transformPoint)([m,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),A));return(_this$d=this[d]).isPointCollision.apply(_this$d,_toConsumableArray(w).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 x=[],v=y[0],T=y[1],f=y[2],g=y[3],u=y[4],m=y[5],M=y[6],E=y[7],A=y[8],w=y[9],O=y[10],L=y[11],b=y[12],I=y[13],R=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],rt=P[4];return x[0]=U*v+G*m+Z*O+nt*W,x[1]=U*T+G*M+Z*L+nt*z,x[2]=U*f+G*E+Z*b+nt*K,x[3]=U*g+G*A+Z*I+nt*k,x[4]=U*u+G*w+Z*R+nt*q+rt,U=P[5],G=P[6],Z=P[7],nt=P[8],rt=P[9],x[5]=U*v+G*m+Z*O+nt*W,x[6]=U*T+G*M+Z*L+nt*z,x[7]=U*f+G*E+Z*b+nt*K,x[8]=U*g+G*A+Z*I+nt*k,x[9]=U*u+G*w+Z*R+nt*q+rt,U=P[10],G=P[11],Z=P[12],nt=P[13],rt=P[14],x[10]=U*v+G*m+Z*O+nt*W,x[11]=U*T+G*M+Z*L+nt*z,x[12]=U*f+G*E+Z*b+nt*K,x[13]=U*g+G*A+Z*I+nt*k,x[14]=U*u+G*w+Z*R+nt*q+rt,U=P[15],G=P[16],Z=P[17],nt=P[18],rt=P[19],x[15]=U*v+G*m+Z*O+nt*W,x[16]=U*T+G*M+Z*L+nt*z,x[17]=U*f+G*E+Z*b+nt*K,x[18]=U*g+G*A+Z*I+nt*k,x[19]=U*u+G*w+Z*R+nt*q+rt,x;}function i(y){y=Object(e.clamp)(0,1,y);var P=0.2126*y,x=0.7152*y,v=0.0722*y;return[P+1-y,x,v,0,0,P,x+1-y,v,0,0,P,x,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),x=0.7152*(1-y),v=0.0722*(1-y);return[P+y,x,v,0,0,P,x+y,v,0,0,P,x,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,x=Math.cos(P),v=Math.sin(P),T=0.2126,f=0.7152,g=0.0722;return[T+x*(1-T)+v*-T,f+x*-f+v*-f,g+x*-g+v*(1-g),0,0,T+x*-T+v*0.143,f+x*(1-f)+v*0.14,g+x*-g+v*-0.283,0,0,T+x*-T+v*-(1-T),f+x*-f+v*f,g+x*(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),x=P.length,v=x<=4;p=1,v?(c=[parseInt(P[0]+P[0],16),parseInt(P[1]+P[1],16),parseInt(P[2]+P[2],16)],x===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)],x===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 T=d[1],f=T==="rgb",P=T.replace(/a$/,"");y=P;var x=P==="cmyk"?4:P==="gray"?1:3;c=d[2].trim().split(/\s*,\s*/).map(function(M,E){if(/%$/.test(M))return E===x?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);}),T===P&&c.push(1),p=f||c[x]===void 0?1:c[x],c=c.slice(0,x);}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"),x=Symbol("path"),v=Symbol("simplify"),T=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[x]=n()(m.path):this[x]=[],this[P]=null,this[v]=m.simplify!=null?m.simplify:0,this[T]=m.scale!=null?m.scale:2;}return _createClass(g,[{key:"contours",get:function get(){var m=null;if(!this[P]&&this[x]){var M=Object(l["default"])(s()(this[x]));this[P]=c()(M,this[T],this[v]),this[P].path=M,this[P].simplify=this[v],this[P].scale=this[T];}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[x];}},{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,A){return[].concat(_toConsumableArray(E),_toConsumableArray(A));});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$x;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[x])).map(function(_ref56){var _ref57=_toArray(_ref56),A=_ref57[0],w=_ref57.slice(1);var O=[A];for(var L=0;L<w.length;L+=2){var b=w[L]-m,I=w[L+1]-M;O.push(b,I);}return O;});return this.beginPath(),(_this$x=this[x]).push.apply(_this$x,_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$x2;this[P]=null,typeof m=="string"&&(m=n()(m)),(_this$x2=this[x]).push.apply(_this$x2,_toConsumableArray(m));}},{key:"beginPath",value:function beginPath(){this[x]=[],this[P]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(m,M,E,A,w,O,L){var b=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(O+=w,L+=w,E<=0||A<=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 R=this[x].length>0&&I<f?"L":"M";var W=Object(y.getPoint)(m,M,E,A,O),z=Object(y.getPoint)(m,M,E,A,L),K=+!b;var k=I>Math.PI?1:0;b&&(k=1-k),R+=W.join(" "),R+="A".concat(E," ").concat(A," 0 ").concat(k," ").concat(K," ").concat(z.join(" ")),I>=f&&(R+="Z"),this.addPath(R);}},{key:"arc",value:function arc(m,M,E,A,w){var O=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(m,M,E,E,0,A,w,O);}},{key:"arcTo",value:function arcTo(m,M,E,A,w,O,L){this[P]=null,this[x].push(["A",m,M,E,A,w,O,L]);}},{key:"moveTo",value:function moveTo(m,M){this[P]=null,this[x].push(["M",m,M]);}},{key:"lineTo",value:function lineTo(m,M){this[P]=null,this[x].push(["L",m,M]);}},{key:"bezierCurveTo",value:function bezierCurveTo(m,M,E,A,w,O){this[P]=null,this[x].push(["C",m,M,E,A,w,O]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(m,M,E,A){this[P]=null,this[x].push(["Q",m,M,E,A]);}},{key:"rect",value:function rect(m,M,E,A){var w="M".concat(m," ").concat(M,"L").concat(m+E," ").concat(M,"L").concat(m+E," ").concat(M+A,"L").concat(m," ").concat(M+A,"Z");this.addPath(w);}},{key:"closePath",value:function closePath(){this[P]=null;var m=[];var M=this[x].length;M>0&&(m=this[x][M-1]),m[0]!=="Z"&&m[0]!=="z"&&this[x].push(["Z"]);}}]);}();},/* 41 *//***/function(h,r){h.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(o){var s=[];return o.replace(e,function(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,x=null,v=0,T=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,T,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!M.length)continue;M=M.map(function(L){var _L7=_slicedToArray(L,8),b=_L7[0],I=_L7[1],R=_L7[2],W=_L7[3],z=_L7[4],K=_L7[5],k=_L7[6],q=_L7[7];return{x1:R,y1:W,x2:z,y2:K,x:k,y:q};});for(var E=0,A;E<M.length;E++)A=M[E],u=["C",A.x1,A.y1,A.x2,A.y2,A.x,A.y],E<M.length-1&&l.push(u);break;case"S":var w=v,O=T;(s=="C"||s=="S")&&(w+=w-d,O+=O-c),u=["C",w,O,u[1],u[2],u[3],u[4]];break;case"T":s=="Q"||s=="T"?(P=v*2-P,x=T*2-x):(P=v,x=T),u=a(v,T,P,x,u[1],u[2]);break;case"Q":P=u[1],x=u[2],u=a(v,T,u[1],u[2],u[3],u[4]);break;case"L":u=i(v,T,u[1],u[2]);break;case"H":u=i(v,T,u[1],T);break;case"V":u=i(v,T,v,u[1]);break;case"Z":u=i(v,T,p,y);break;}s=m,v=u[u.length-2],T=u[u.length-1],u.length>4?(d=u[u.length-4],c=u[u.length-3]):(d=v,c=T),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,x,v,T){var f=T*(s-d)/2+v*(l-c)/2,g=-v*(s-d)/2+T*(l-c)/2,u=P*P,m=x*x,M=f*f,E=g*g;var A=u*m-u*E-m*M;A<0&&(A=0),A/=u*E+m*M,A=Math.sqrt(A)*(p===y?-1:1);var w=A*P/x*g,O=A*-x/P*f,L=T*w-v*O+(s+d)/2,b=v*w+T*O+(l+c)/2,I=(f-w)/P,R=(g-O)/x,W=(-f-w)/P,z=(-g-O)/x,K=n(1,0,I,R);var k=n(I,R,W,z);return y===0&&k>0&&(k-=e),y===1&&k<0&&(k+=e),[L,b,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,x,v){var T=Math.sin(v*e/360),f=Math.cos(v*e/360),g=f*(s-d)/2+T*(l-c)/2,u=-T*(s-d)/2+f*(l-c)/2;if(g===0&&u===0)return[];if(P===0||x===0)return[];P=Math.abs(P),x=Math.abs(x);var m=g*g/(P*P)+u*u/(x*x);m>1&&(P*=Math.sqrt(m),x*=Math.sqrt(m));var M=i(s,l,d,c,p,y,P,x,T,f),E=[];var A=M[2],w=M[3];var O=Math.max(Math.ceil(Math.abs(w)/(e/4)),1);w/=O;for(var L=0;L<O;L++)E.push(a(A,w)),A+=w;return E.map(function(L){for(var b=0;b<L.length;b+=2){var I=L[b+0],R=L[b+1];I*=P,R*=x;var W=f*I-T*R,z=T*I+f*R;L[b+0]=W+M[0],L[b+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 x=[],v=[],T=[0,0];return p.forEach(function(f,g,u){if(f[0]==="M")n(T,f.slice(1)),v.length>0&&(x.push(v),v=[]);else if(f[0]==="C")d(v,y,T,f),a(T,f[5],f[6]);else throw new Error("illegal type in SVG: "+f[0]);}),v.length>0&&x.push(v),x.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(x,v,T,f,g,u){u||(u=[]),g=typeof g=="number"?g:1;var m=s/g;return m*=m,p(x,v,T,f,u,m),u;};function p(P,x,v,T,f,g){f.push(t(P));var u=P[0],m=P[1],M=x[0],E=x[1],A=v[0],w=v[1],O=T[0],L=T[1];y(u,m,M,E,A,w,O,L,f,g,0),f.push(t(T));}function y(P,x,v,T,f,g,u,m,M,E,A){if(!(A>a)){var w=Math.PI,O=(P+v)/2,L=(x+T)/2,b=(v+f)/2,I=(T+g)/2,R=(f+u)/2,W=(g+m)/2,z=(O+b)/2,K=(L+I)/2,k=(b+R)/2,q=(I+W)/2,U=(z+k)/2,G=(K+q)/2;if(A>0){var Z=u-P,nt=m-x,rt=Math.abs((v-u)*nt-(T-m)*Z),tt=Math.abs((f-u)*nt-(g-m)*Z),J,ht;if(rt>o&&tt>o){if((rt+tt)*(rt+tt)<=E*(Z*Z+nt*nt)){if(d<l){M.push(e(U,G));return;}var dt=Math.atan2(g-T,f-v);if(J=Math.abs(dt-Math.atan2(T-x,v-P)),ht=Math.abs(Math.atan2(m-g,u-f)-dt),J>=w&&(J=2*w-J),ht>=w&&(ht=2*w-ht),J+ht<d){M.push(e(U,G));return;}if(c!==0){if(J>c){M.push(e(v,T));return;}if(ht>c){M.push(e(f,g));return;}}}}else if(rt>o){if(rt*rt<=E*(Z*Z+nt*nt)){if(d<l){M.push(e(U,G));return;}if(J=Math.abs(Math.atan2(g-T,f-v)-Math.atan2(T-x,v-P)),J>=w&&(J=2*w-J),J<d){M.push(e(v,T)),M.push(e(f,g));return;}if(c!==0&&J>c){M.push(e(v,T));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-T,f-v)),J>=w&&(J=2*w-J),J<d){M.push(e(v,T)),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-(x+m)/2,Z*Z+nt*nt<=E){M.push(e(U,G));return;}}y(P,x,O,L,z,K,U,G,M,E,A+1),y(U,G,k,q,R,W,u,m,M,E,A+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 T;}),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,x=i();function v(g,u,m,M,E){p(g,m,M),y(g,g),P(u,-g[1],g[0]),P(x,-m[1],m[0]);var A=E/s(u,x);return Math.abs(A);}function T(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],x=y[y.length-1],v=Math.atan2(x[1]-P[1],x[0]-P[0]);return{current:s.map(function(T){return _toConsumableArray(T);}),point:{x:x[0],y:x[1],angle:v}};}var p=[];for(var _y2=0;_y2<s.length;_y2++){p[_y2]=[];var _P=s[_y2];var _x19=_P[0];for(var _v4=1;_v4<_P.length;_v4++){var _T8=_P[_v4],_f9=Object(e.distance)(_x19,_T8);if(l<_f9){var g=l/_f9,u=Math.atan2(_T8[1]-_x19[1],_T8[0]-_x19[0]),m={x:_x19[0]*(1-g)+_T8[0]*g,y:_x19[1]*(1-g)+_T8[1]*g,angle:u};if(p[_y2].push(_x19),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(_x19),_x19=_T8;}}}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=[],x=l.length;if(d>0){do d-=l[c%x],c++;while(d>0);d<0&&(p=-d,c--);}else if(d<0){c=-1;do d+=l[c%x+x-1],c--;while(d<0);d>=0&&(c++,p=l[c%x+x-1]-d);}do{var v=i(y,p);y=v.rest,++c%2&&P.push.apply(P,_toConsumableArray(v.current));var _T9=c%x;_T9<0&&(_T9+=x),p=l[_T9];}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,x=d*P+c;return[P,x];}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),x=/* @__PURE__ */t.n(P),v=t(31),T=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"),A=Symbol("fill"),w=Symbol("strokeColor"),O=Symbol("fillColor"),L=Symbol("transform"),b=Symbol("invertTransform"),I=Symbol("uniforms"),R=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"),rt=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=x()(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[A]=null,this[L]=[1,0,0,1,0,0],this[Z]=1,this[I]={},this[G]=[],this[W]=null,this[R]={},this.contours=N.contours,this[nt]=null,this[rt]={},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[rt][N]:this[rt][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[A]?this[A].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[w]&&this[w][3]!==0?Object(s["default"])(this[w]):"";}},{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[R]}:null;}},{key:"enableBlend",get:function get(){return this[W]===!0||this[W]===!1?this[W]:this[Z]<1||this[w]!=null&&this[w][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[b]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[b]=N;}return this[b];}},{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[rt],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
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[A]&&!this[E]&&this.setFill();var N=this[M],$={};if(N&&N.length){if(this[A])try{var D=y()(N,this[A]);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[R]);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[R].rect,$.rect)||this[R].hidden!==$.hidden||this[R].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 lt=it*Q[0]+st*Q[2]+Q[4],ot=it*Q[1]+st*Q[3]+Q[5];it=lt;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[A]==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'
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[w].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[R]);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[R].rect,$.rect)||this[R].hidden!==$.hidden||this[R].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 lt=it*Q[0]+st*Q[2]+Q[4],at=it*Q[1]+st*Q[3]+Q[5];it=lt;st=at;}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[w][3]===0,$=this[A]==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
49
  // cap: 'butt' or 'square'
50
50
  // lineDash: null
51
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[A]={rule:N},typeof $=="string"&&($=Object(v["default"])($)),this[O]=$,this;}/**
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[w]=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[A]={rule:N},typeof $=="string"&&($=Object(v["default"])($)),this[O]=$,this;}/**
53
53
  options: {
54
54
  scale: false,
55
55
  repeat: false,
@@ -61,9 +61,9 @@ bufferSize:1500},x="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTex
61
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[A]||this.setFill(),this.setUniforms({u_texSampler:N}),this[m]&&this[z](this[m],$),this[R]=$,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
62
  vector: [x0, y0, r0, x1, y1, r1],
63
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
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[b],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[b],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
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),lt=_ref91[0],ot=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ft=_ref92[0],mt=_ref92[1];var yt=ft-lt,pt=mt-ot,Tt=((ct-lt)*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"&&gt[0]>=C.fillPointCount)break;if(S==="stroke"&&gt[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),lt=_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-lt)*(mt-ot)-(ft-lt)*($-ot));if(Tt===0&&st([N,$],[lt,ot],[ft,mt]))return!0;var Rt=Math.sign((N-ft)*(pt-mt)-(yt-ft)*($-mt));if(Rt===0&&st([N,$],[ft,mt],[yt,pt]))return!0;var Ot=Math.sign((N-yt)*(ot-pt)-(lt-yt)*($-pt));if(Ot===0&&st([N,$],[yt,pt],[lt,ot])||Tt===1&&Rt===1&&Ot===1||Tt===-1&&Rt===-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 T["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,x=_ref93$lineWidth===void 0?1:_ref93$lineWidth,_ref93$lineJoin=_ref93.lineJoin,v=_ref93$lineJoin===void 0?"miter":_ref93$lineJoin,_ref93$miterLimit=_ref93.miterLimit,T=_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=x,this.lineJoin=v,this.miterLimit=T,this.lineCap=f,this.roundSegments=g,this._normal=null;}return _createClass(d,[{key:"build",value:function build(x){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var T=x.length;if(x=_toConsumableArray(x),T<2)return x;v&&((x[0][0]!==x[T-1][0]||x[0][1]!==x[T-1][1])&&x.push(_toConsumableArray(x[0])),x.push(_toConsumableArray(x[1]))),T=x.length,this._normal=null;var f={left:[],right:[]},g=this.lineWidth/2,u=this.lineCap;if(!v&&u==="square"){Object(e.direction)(i,x[0],x[1]),Object(e.scaleAndAdd)(x[0],x[0],i,g);var M=x.length-1;Object(e.direction)(i,x[M],x[M-1]),Object(e.scaleAndAdd)(x[M],x[M],i,g);}for(var _M4=1;_M4<T;_M4++){var E=x[_M4-1],A=x[_M4],b=x[_M4+1];this._seg(f,E,A,b,g,v);}return!v&&u==="round"&&y(f,this.roundSegments),[].concat(_toConsumableArray(f.left),_toConsumableArray(f.right.reverse()));}},{key:"_seg",value:function _seg(x,v,T,f,g,u){var m=this.lineJoin==="bevel",M=this.lineJoin==="round";if(Object(e.direction)(i,T,v),this._normal||(this._normal=Object(e.create)(),Object(e.normal)(this._normal,i)),x.left.length||p(x,v,this._normal,g),!f)Object(e.normal)(this._normal,i),u?p(x,v,this._normal,g):p(x,T,this._normal,g);else{Object(e.direction)(a,f,T);var E=Object(e.computeMiter)(o,s,i,a,g);E=Math.min(E,l);var A=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,T,this._normal,-g*A),c(x,n,A);var O=1/0;v&&(O=Math.min(O,Math.hypot(T[0]-v[0],T[1]-v[1]))),f&&(O=Math.min(O,Math.hypot(f[0]-T[0],f[1]-T[1])));var L=Math.max(g,Math.min(E,O));if(Object(e.scaleAndAdd)(n,T,s,L*A),c(x,n,-A),f)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,T,n,-g*A),M){var w=Object(e.clone)(n),I=A>0?x.left[x.left.length-1]:x.right[x.right.length-1],R=Object(e.clone)(T),W=Object(e.sub)(Object(e.create)(),I,R),z=Object(e.sub)(Object(e.create)(),w,R),K=Math.PI/this.roundSegments;for(var k=0;k<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],A*K),Math.sign(Object(e.cross)(n,W,z)[2])===A);k++)Object(e.add)(n,W,R),c(x,n,A);c(x,w,A);}else c(x,n,A);}else p(x,T,s,E),Object(e.copy)(this._normal,s);}}}]);}();function c(P,x,v){v>0?P.left.push(Object(e.clone)(x)):P.right.push(Object(e.clone)(x));}function p(P,x,v,T){var f=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,x,v,-T),c(P,n,-f),Object(e.scaleAndAdd)(n,x,v,T),c(P,n,f);}function y(_ref94,v){var P=_ref94.left,x=_ref94.right;var T=Object(e.create)(),f=Object(e.create)();var g=P[0],u=x[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)(T,f,[0,0],E),Object(e.add)(n,m,T),P.unshift(Object(e.clone)(n));}g=x[x.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)(T,f,[0,0],_E2),Object(e.add)(n,m,T),x.push(Object(e.clone)(n));}}},/* 59 *//***/function(h,r,t){t.r(r),t.d(r,"isUnitTransform",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 *//***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);h.exports=function(i,a){if(a=a||{},i=i.filter(function(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(T,f){return T.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],x=s.elements[d+2];p.push([y,P,x]);}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 T(),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.
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),lt=_ref91[0],at=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ft=_ref92[0],mt=_ref92[1];var yt=ft-lt,pt=mt-at,Tt=((ct-lt)*yt+(gt-at)*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"&&gt[0]>=C.fillPointCount)break;if(S==="stroke"&&gt[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),lt=_gt$map2$[0],at=_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-lt)*(mt-at)-(ft-lt)*($-at));if(Tt===0&&st([N,$],[lt,at],[ft,mt]))return!0;var Rt=Math.sign((N-ft)*(pt-mt)-(yt-ft)*($-mt));if(Rt===0&&st([N,$],[ft,mt],[yt,pt]))return!0;var Ot=Math.sign((N-yt)*(at-pt)-(lt-yt)*($-pt));if(Ot===0&&st([N,$],[yt,pt],[lt,at])||Tt===1&&Rt===1&&Ot===1||Tt===-1&&Rt===-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 T["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,x=_ref93$lineWidth===void 0?1:_ref93$lineWidth,_ref93$lineJoin=_ref93.lineJoin,v=_ref93$lineJoin===void 0?"miter":_ref93$lineJoin,_ref93$miterLimit=_ref93.miterLimit,T=_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=x,this.lineJoin=v,this.miterLimit=T,this.lineCap=f,this.roundSegments=g,this._normal=null;}return _createClass(d,[{key:"build",value:function build(x){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var T=x.length;if(x=_toConsumableArray(x),T<2)return x;v&&((x[0][0]!==x[T-1][0]||x[0][1]!==x[T-1][1])&&x.push(_toConsumableArray(x[0])),x.push(_toConsumableArray(x[1]))),T=x.length,this._normal=null;var f={left:[],right:[]},g=this.lineWidth/2,u=this.lineCap;if(!v&&u==="square"){Object(e.direction)(i,x[0],x[1]),Object(e.scaleAndAdd)(x[0],x[0],i,g);var M=x.length-1;Object(e.direction)(i,x[M],x[M-1]),Object(e.scaleAndAdd)(x[M],x[M],i,g);}for(var _M4=1;_M4<T;_M4++){var E=x[_M4-1],A=x[_M4],w=x[_M4+1];this._seg(f,E,A,w,g,v);}return!v&&u==="round"&&y(f,this.roundSegments),[].concat(_toConsumableArray(f.left),_toConsumableArray(f.right.reverse()));}},{key:"_seg",value:function _seg(x,v,T,f,g,u){var m=this.lineJoin==="bevel",M=this.lineJoin==="round";if(Object(e.direction)(i,T,v),this._normal||(this._normal=Object(e.create)(),Object(e.normal)(this._normal,i)),x.left.length||p(x,v,this._normal,g),!f)Object(e.normal)(this._normal,i),u?p(x,v,this._normal,g):p(x,T,this._normal,g);else{Object(e.direction)(a,f,T);var E=Object(e.computeMiter)(o,s,i,a,g);E=Math.min(E,l);var A=Object(e.dot)(o,this._normal)<0?-1:1;var w=m||M;if(!w&&this.lineJoin==="miter"&&E/g>this.miterLimit&&(w=!0),w){Object(e.scaleAndAdd)(n,T,this._normal,-g*A),c(x,n,A);var O=1/0;v&&(O=Math.min(O,Math.hypot(T[0]-v[0],T[1]-v[1]))),f&&(O=Math.min(O,Math.hypot(f[0]-T[0],f[1]-T[1])));var L=Math.max(g,Math.min(E,O));if(Object(e.scaleAndAdd)(n,T,s,L*A),c(x,n,-A),f)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,T,n,-g*A),M){var b=Object(e.clone)(n),I=A>0?x.left[x.left.length-1]:x.right[x.right.length-1],R=Object(e.clone)(T),W=Object(e.sub)(Object(e.create)(),I,R),z=Object(e.sub)(Object(e.create)(),b,R),K=Math.PI/this.roundSegments;for(var k=0;k<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],A*K),Math.sign(Object(e.cross)(n,W,z)[2])===A);k++)Object(e.add)(n,W,R),c(x,n,A);c(x,b,A);}else c(x,n,A);}else p(x,T,s,E),Object(e.copy)(this._normal,s);}}}]);}();function c(P,x,v){v>0?P.left.push(Object(e.clone)(x)):P.right.push(Object(e.clone)(x));}function p(P,x,v,T){var f=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,x,v,-T),c(P,n,-f),Object(e.scaleAndAdd)(n,x,v,T),c(P,n,f);}function y(_ref94,v){var P=_ref94.left,x=_ref94.right;var T=Object(e.create)(),f=Object(e.create)();var g=P[0],u=x[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)(T,f,[0,0],E),Object(e.add)(n,m,T),P.unshift(Object(e.clone)(n));}g=x[x.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)(T,f,[0,0],_E2),Object(e.add)(n,m,T),x.push(Object(e.clone)(n));}}},/* 59 *//***/function(h,r,t){t.r(r),t.d(r,"isUnitTransform",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 *//***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);h.exports=function(i,a){if(a=a||{},i=i.filter(function(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(T,f){return T.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],x=s.elements[d+2];p.push([y,P,x]);}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 T(),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
67
  * No vertex or face structures are allocated, but these must be assigned
68
68
  * before the current edge operation is completed.
69
69
  *///static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
@@ -157,10 +157,10 @@ connect:function connect(f,g){var u=!1,m=this.makeEdge_(f),M=m.Sym;if(g.Lface!==
157
157
  * An entire mesh can be deleted by zapping its faces, one at a time,
158
158
  * in any order. Zapped faces cannot be used in further mesh operations!
159
159
  */zapFace:function zapFace(f){var g=f.anEdge,u,m,M,E,A;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,A=f.next,A.prev=E,E.next=A;},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,A,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&&(A=this.countFaceVerts_(g),b=this.countFaceVerts_(M.Lface),A+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,A,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),A=g,A=g;(E=A.next)!==g;A=E){i(E.prev===A),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===A&&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,A,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),A=n.edgeEval(u,g,m),E+A<0&&(E=-E,A=-A),M.s=n.interpolate(E,u.s,A,g.s)):(E=n.edgeSign(f,u,g),A=-n.edgeSign(f,m,g),E+A<0&&(E=-E,A=-A),M.s=n.interpolate(E,u.s,A,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),A=n.transEval(u,g,m),E+A<0&&(E=-E,A=-A),M.t=n.interpolate(E,u.t,A,g.t)):(E=n.transSign(f,u,g),A=-n.transSign(f,m,g),E+A<0&&(E=-E,A=-A),M.t=n.interpolate(E,u.t,A,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 )
160
+ mergeConvexFaces:function mergeConvexFaces(f){var g,u,m,M,E,A,w;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&&(A=this.countFaceVerts_(g),w=this.countFaceVerts_(M.Lface),A+w-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,A,w,O;for(M=f,M=f;(m=M.next)!==f;M=m){i(m.prev===M),w=m.anEdge;do i(w.Sym!==w),i(w.Sym.Sym===w),i(w.Lnext.Onext.Sym===w),i(w.Onext.Sym.Lnext===w),i(w.Lface===m),w=w.Lnext;while(w!==m.anEdge);}for(i(m.prev===M&&m.anEdge===null),A=g,A=g;(E=A.next)!==g;A=E){i(E.prev===A),w=E.anEdge;do i(w.Sym!==w),i(w.Sym.Sym===w),i(w.Lnext.Onext.Sym===w),i(w.Onext.Sym.Lnext===w),i(w.Org===E),w=w.Onext;while(w!==E.anEdge);}for(i(E.prev===A&&E.anEdge===null),O=u,O=u;(w=O.next)!==u;O=w)i(w.Sym.next===O.Sym),i(w.Sym!==w),i(w.Sym.Sym===w),i(w.Org!==null),i(w.Dst!==null),i(w.Lnext.Onext.Sym===w),i(w.Onext.Sym.Lnext===w);i(w.Sym.next===O.Sym&&w.Sym===this.eHeadSym&&w.Sym.Sym===w&&w.Org===null&&w.Dst===null&&w.Lface===null&&w.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,A,w;n.vertLeq(f,g)||(w=f,f=g,g=w),n.vertLeq(u,m)||(w=u,u=m,m=w),n.vertLeq(f,u)||(w=f,f=u,u=w,w=g,g=m,m=w),n.vertLeq(u,g)?n.vertLeq(g,m)?(E=n.edgeEval(f,u,g),A=n.edgeEval(u,g,m),E+A<0&&(E=-E,A=-A),M.s=n.interpolate(E,u.s,A,g.s)):(E=n.edgeSign(f,u,g),A=-n.edgeSign(f,m,g),E+A<0&&(E=-E,A=-A),M.s=n.interpolate(E,u.s,A,m.s)):M.s=(u.s+g.s)/2,n.transLeq(f,g)||(w=f,f=g,g=w),n.transLeq(u,m)||(w=u,u=m,m=w),n.transLeq(f,u)||(w=f,f=u,u=w,w=g,g=m,m=w),n.transLeq(u,g)?n.transLeq(g,m)?(E=n.transEval(f,u,g),A=n.transEval(u,g,m),E+A<0&&(E=-E,A=-A),M.t=n.interpolate(E,u.t,A,g.t)):(E=n.transSign(f,u,g),A=-n.transSign(f,m,g),E+A<0&&(E=-E,A=-A),M.t=n.interpolate(E,u.t,A,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
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 x(){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,A,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 A=n.edgeEval(M.Dst,m,M.Org),b=n.edgeEval(E.Dst,m,E.Org);return A>=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 x();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,A,M=null,E=g,A=g.eUp;E!==u;){if(E.fixUpperEdge=!1,M=v.regionBelow(E),m=M.eUp,m.Org!=A.Org){if(!M.fixUpperEdge){v.finishRegion(f,E);break;}m=f.mesh.connect(A.Lprev,m.Sym),v.fixUpperEdge(f,M,m);}A.Onext!==m&&(f.mesh.splice(m.Oprev,m),f.mesh.splice(A,m)),v.finishRegion(f,E),A=M.eUp,E=M;}return A;},v.addRightEdges=function(f,g,u,m,M,E){var A,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;A=v.regionBelow(b),O=A.eUp.Sym,O.Org===L.Org;)O.Onext!==L&&(f.mesh.splice(O.Oprev,O),f.mesh.splice(L.Oprev,O)),A.windingNumber=b.windingNumber-O.winding,A.inside=v.isWindingInside(f,A.windingNumber),b.dirty=!0,!w&&v.checkForRightSplice(f,b)&&(v.addWinding(O,L),v.deleteRegion(f,b),f.mesh["delete"](L)),w=!1,b=A,L=O;b.dirty=!0,i(b.windingNumber-O.winding===A.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),A=0.5*m/(m+M);f.coords[0]+=E*g.coords[0]+A*u.coords[0],f.coords[1]+=E*g.coords[1]+A*u.coords[1],f.coords[2]+=E*g.coords[2]+A*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,A=M.Org,b=m.Dst,O=M.Dst,L,w,I=new a(),R,W;if(i(!n.vertEq(O,b)),i(n.edgeSign(b,f.event,E)<=0),i(n.edgeSign(O,f.event,A)>=0),i(E!==f.event&&A!==f.event),i(!g.fixUpperEdge&&!u.fixUpperEdge),E===A||(L=Math.min(E.t,b.t),w=Math.max(A.t,O.t),L>w))return!1;if(n.vertLeq(E,A)){if(n.edgeSign(O,E,A)>0)return!1;}else if(n.edgeSign(b,A,E)<0)return!1;return v.debugEvent(f),n.intersect(b,E,O,A,I),i(Math.min(E.t,b.t)<=I.t),i(I.t<=Math.max(A.t,O.t)),i(Math.min(O.s,b.s)<=I.s),i(I.s<=Math.max(A.s,E.s)),n.vertLeq(I,f.event)&&(I.s=f.event.s,I.t=f.event.t),R=n.vertLeq(E,A)?E:A,n.vertLeq(R,I)&&(I.s=R.s,I.t=R.t),n.vertEq(I,E)||n.vertEq(I,A)?(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,A,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),A=g.eUp,b=E.eUp,O=!1;if(A.Dst!==b.Dst&&v.checkForIntersect(f,g),n.vertEq(A.Org,f.event)&&(f.mesh.splice(M.Oprev,A),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,A.Org)?m=b.Oprev:m=A,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,A,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=A=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,A,M,!0);},v.connectLeftVertex=function(f,g){var u,m,M,E,A,b,O=new x();if(O.eUp=g.anEdge.Sym,u=f.dict.search(O).key,m=v.regionBelow(u),!!m){if(E=u.eUp,A=m.eUp,n.edgeSign(E.Dst,g,E.Org)===0){v.connectLeftDegenerate(f,u,g);return;}if(M=n.vertLeq(A.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(A.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,A=v.finishLeftRegions(f,M,null);A.Onext===E?v.connectRightVertex(f,m,A):v.addRightEdges(f,m,A.Onext,E,E,!0);},v.addSentinel=function(f,g,u,m){var M=new x(),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,A=f.bmax[1]+u;v.addSentinel(f,m,M,E),v.addSentinel(f,m,M,A);},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 T(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=e.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0;}T.prototype={dot_:function dot_(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,A,b=[0,0,0],O=[0,0,0],L=[0,0,0],w=[0,0,0],I=[0,0,0],R=[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,R[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,R[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(A=0,u=W[K],m=R[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>A&&(A=E,f[0]=I[0],f[1]=I[1],f[2]=I[2]);A<=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
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 x(){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,A,w,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 A=n.edgeEval(M.Dst,m,M.Org),w=n.edgeEval(E.Dst,m,E.Org);return A>=w;},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 x();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,A,M=null,E=g,A=g.eUp;E!==u;){if(E.fixUpperEdge=!1,M=v.regionBelow(E),m=M.eUp,m.Org!=A.Org){if(!M.fixUpperEdge){v.finishRegion(f,E);break;}m=f.mesh.connect(A.Lprev,m.Sym),v.fixUpperEdge(f,M,m);}A.Onext!==m&&(f.mesh.splice(m.Oprev,m),f.mesh.splice(A,m)),v.finishRegion(f,E),A=M.eUp,E=M;}return A;},v.addRightEdges=function(f,g,u,m,M,E){var A,w,O,L,b=!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),w=g,L=M;A=v.regionBelow(w),O=A.eUp.Sym,O.Org===L.Org;)O.Onext!==L&&(f.mesh.splice(O.Oprev,O),f.mesh.splice(L.Oprev,O)),A.windingNumber=w.windingNumber-O.winding,A.inside=v.isWindingInside(f,A.windingNumber),w.dirty=!0,!b&&v.checkForRightSplice(f,w)&&(v.addWinding(O,L),v.deleteRegion(f,w),f.mesh["delete"](L)),b=!1,w=A,L=O;w.dirty=!0,i(w.windingNumber-O.winding===A.windingNumber),E&&v.walkDirtyRegions(f,w);},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),A=0.5*m/(m+M);f.coords[0]+=E*g.coords[0]+A*u.coords[0],f.coords[1]+=E*g.coords[1]+A*u.coords[1],f.coords[2]+=E*g.coords[2]+A*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,A=M.Org,w=m.Dst,O=M.Dst,L,b,I=new a(),R,W;if(i(!n.vertEq(O,w)),i(n.edgeSign(w,f.event,E)<=0),i(n.edgeSign(O,f.event,A)>=0),i(E!==f.event&&A!==f.event),i(!g.fixUpperEdge&&!u.fixUpperEdge),E===A||(L=Math.min(E.t,w.t),b=Math.max(A.t,O.t),L>b))return!1;if(n.vertLeq(E,A)){if(n.edgeSign(O,E,A)>0)return!1;}else if(n.edgeSign(w,A,E)<0)return!1;return v.debugEvent(f),n.intersect(w,E,O,A,I),i(Math.min(E.t,w.t)<=I.t),i(I.t<=Math.max(A.t,O.t)),i(Math.min(O.s,w.s)<=I.s),i(I.s<=Math.max(A.s,E.s)),n.vertLeq(I,f.event)&&(I.s=f.event.s,I.t=f.event.t),R=n.vertLeq(E,A)?E:A,n.vertLeq(R,I)&&(I.s=R.s,I.t=R.t),n.vertEq(I,E)||n.vertEq(I,A)?(v.checkForRightSplice(f,g),!1):!n.vertEq(w,f.event)&&n.edgeSign(w,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):w===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(w,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,w,A,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),A=g.eUp,w=E.eUp,O=!1;if(A.Dst!==w.Dst&&v.checkForIntersect(f,g),n.vertEq(A.Org,f.event)&&(f.mesh.splice(M.Oprev,A),g=v.topLeftRegion(f,g),M=v.regionBelow(g).eUp,v.finishLeftRegions(f,v.regionBelow(g),E),O=!0),n.vertEq(w.Org,f.event)&&(f.mesh.splice(u,w.Oprev),u=v.finishLeftRegions(f,E,null),O=!0),O){v.addRightEdges(f,g,u.Onext,M,M,!0);return;}n.vertLeq(w.Org,A.Org)?m=w.Oprev:m=A,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,A,w;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),w=v.regionBelow(g),E=w.eUp.Sym,M=A=E.Onext,w.fixUpperEdge&&(i(M!==E),v.deleteRegion(f,w),f.mesh["delete"](E),E=M.Oprev),f.mesh.splice(u.anEdge,E),n.edgeGoesLeft(M)||(M=null),v.addRightEdges(f,g,E.Onext,A,M,!0);},v.connectLeftVertex=function(f,g){var u,m,M,E,A,w,O=new x();if(O.eUp=g.anEdge.Sym,u=f.dict.search(O).key,m=v.regionBelow(u),!!m){if(E=u.eUp,A=m.eUp,n.edgeSign(E.Dst,g,E.Org)===0){v.connectLeftDegenerate(f,u,g);return;}if(M=n.vertLeq(A.Dst,E.Dst)?u:m,u.inside||M.fixUpperEdge){if(M===u)w=f.mesh.connect(g.anEdge.Sym,E.Lnext);else{var L=f.mesh.connect(A.Dnext,g.anEdge);w=L.Sym;}M.fixUpperEdge?v.fixUpperEdge(f,M,w):v.computeWinding(f,v.addRegionBelow(f,u,w)),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,A=v.finishLeftRegions(f,M,null);A.Onext===E?v.connectRightVertex(f,m,A):v.addRightEdges(f,m,A.Onext,E,E,!0);},v.addSentinel=function(f,g,u,m){var M=new x(),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,A=f.bmax[1]+u;v.addSentinel(f,m,M,E),v.addSentinel(f,m,M,A);},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 T(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=e.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0;}T.prototype={dot_:function dot_(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,A,w=[0,0,0],O=[0,0,0],L=[0,0,0],b=[0,0,0],I=[0,0,0],R=[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,w[K]=M,R[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>w[K]&&(w[K]=M,R[K]=g);if(K=0,w[1]-O[1]>w[0]-O[0]&&(K=1),w[2]-O[2]>w[K]-O[K]&&(K=2),O[K]>=w[K]){f[0]=0,f[1]=0,f[2]=1;return;}for(A=0,u=W[K],m=R[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)b[0]=g.coords[0]-m.coords[0],b[1]=g.coords[1]-m.coords[1],b[2]=g.coords[2]-m.coords[2],I[0]=L[1]*b[2]-L[2]*b[1],I[1]=L[2]*b[0]-L[0]*b[2],I[2]=L[0]*b[1]-L[1]*b[0],E=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],E>A&&(A=E,f[0]=I[0],f[1]=I[1],f[2]=I[2]);A<=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
164
  #include <stdlib.h>
165
165
  extern int RandomSweep;
166
166
  #define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
@@ -182,7 +182,7 @@ extractMin:function extractMin(){var f=this.nodes,g=this.handles,u=f[1].handle,m
182
182
  #endif
183
183
  #endif*//* Determine the polygon normal and project vertices onto the plane
184
184
  * of the polygon.
185
- */projectPolygon_:function projectPolygon_(){var f,g=this.mesh.vHead,u=[0,0,0],m,M,E,A,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_(),A=!0,f=g.next;f!==g;f=f.next)A?(this.bmin[0]=this.bmax[0]=f.s,this.bmin[1]=this.bmax[1]=f.t,A=!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
185
+ */projectPolygon_:function projectPolygon_(){var f,g=this.mesh.vHead,u=[0,0,0],m,M,E,A,w=!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),w=!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(w&&this.checkOrientation_(),A=!0,f=g.next;f!==g;f=f.next)A?(this.bmin[0]=this.bmax[0]=f.s,this.bmin[1]=this.bmax[1]=f.t,A=!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
186
  * (what else would it do??) The region must consist of a single
187
187
  * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
188
188
  * case means that any vertical line intersects the interior of the
@@ -226,15 +226,15 @@ discardExterior_:function discardExterior_(f){var g,u;for(g=f.fHead.next;g!==f.f
226
226
  * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
227
227
  * separate an interior region from an exterior one.
228
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,A,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){A=E.anEdge,L=0;do M=A.Org,M.n===-1&&(M.n=O,O++),L++,A=A.Lnext;while(A!==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 R=0;for(E=f.fHead.next;E!==f.fHead;E=E.next)if(E.inside){A=E.anEdge,L=0;do M=A.Org,this.elements[R++]=M.n,L++,A=A.Lnext;while(A!==E.anEdge);for(w=L;w<u;++w)this.elements[R++]=-1;if(g===e.CONNECTED_POLYGONS){A=E.anEdge;do this.elements[R++]=this.getNeighbourFace_(A),A=A.Lnext;while(A!==E.anEdge);for(w=L;w<u;++w)this.elements[R++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
230
- outputContours_:function outputContours_(f,g){var u,m,M,E=0,A=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){A=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,A++,m=m.Lnext;while(m!==M);this.elements[L++]=E,this.elements[L++]=A,E+=A;}},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 x=[],v=!!(P&1),_T10=!!(P&2),_f10=!!(P&4),g=!!(P&8);v&&x.push("#define TEXTURE 1"),_T10&&x.push("#define FILTER 1"),_f10&&x.push("#define GRADIENT 1"),g&&x.push("#define CLIPPATH 1");var u="".concat(x.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,x=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,v=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasClipPath=_ref95.hasClipPath,T=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var f=P|x<<1|v<<2|T<<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 x=[],v=!!(P&1),_T11=!!(P&2),_f11=!!(P&4),g=!!(P&8),u=!!(P&16),m=!!(P&32);v&&x.push("#define TEXTURE 1"),_T11&&x.push("#define FILTER 1"),_f11&&x.push("#define GRADIENT 1"),g&&x.push("#define CLOUDCOLOR 1"),u&&x.push("#define CLOUDFILTER 1"),m&&x.push("#define CLIPPATH 1");var M="".concat(x.join("\n"),"\n"),E=[];if(v){E.push("uniform sampler2D u_texSampler;");for(var A=0;A<12;A++)E.push("uniform sampler2D u_texFrame".concat(A,";"));}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,x=_ref96$hasFilter===void 0?!1:_ref96$hasFilter,_ref96$hasGradient=_ref96.hasGradient,v=_ref96$hasGradient===void 0?!1:_ref96$hasGradient,_ref96$hasCloudColor=_ref96.hasCloudColor,T=_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|x<<1|v<<2|T<<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(T){if(e===setTimeout)return setTimeout(T,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(T,0);try{return e(T,0);}catch(_unused6){try{return e.call(null,T,0);}catch(_unused7){return e.call(this,T,0);}}}function s(T){if(n===clearTimeout)return clearTimeout(T);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(T);try{return n(T);}catch(_unused8){try{return n.call(null,T);}catch(_unused9){return n.call(this,T);}}}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 T=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(T);}}t.nextTick=function(T){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 x(T,f)),l.length===1&&!d&&o(P);};function x(T,f){this.fun=T,this.array=f;}x.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function 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(T){return[];},t.binding=function(T){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(T){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return A;});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"),x=Symbol("resolution"),v=Symbol("animations"),T=Symbol("eventListeners"),f=Symbol("captureEventListeners"),g=Symbol("filters"),u=Symbol("display"),m=Symbol("program"),M=Symbol("shaderAttrs"),E=Symbol("uniforms");var A=/*#__PURE__*/function(){function A(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,A);this.attributes=new this.constructor.Attr(this),this[x]={width:300,height:150},Object.assign(this.attributes,O),this[v]=/* @__PURE__ */new Set(),this[T]={},this[f]={};}return _createClass(A,[{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,R=_w8.once,W=I?f:T;return this[W][O]=this[W][O]||[],this[W][O].push({listener:L,once:R}),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 R=w.length-1;R>=0;R--){var W=w[R],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 _R4=0;_R4<w.length;_R4++){var _W=w[_R4],_z3=_W[T]&&_W[T][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),R=_ref100[0],W=_ref100[1];L.setAttribute(R,W);});var I=this[E];if(this[E]){var R={};Object.entries(I).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],z=_ref102[1];typeof z=="function"&&(z=z(_this23,W)),R[W]=z;}),L.setUniforms(R);}}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:T][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],R=O*w[1]+L*w[3]+w[5];return[I,R];}},{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],R=O*w[1]+L*w[3]+w[5];return[I,R];}},{key:"getResolution",value:function getResolution(){return c({},this[x]);}},{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$x3=this[x],w=_this$x3.width,I=_this$x3.height;(w!==O||I!==L)&&(this[x]={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:T;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 R=w.capture?f:T;if(this[R][O]){var W=this[R][O];if(W)for(var z=0;z<W.length;z++){var K=W[z].listener;if(K===L){this[R][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 R=0;return _typeof(O)=="object"&&(R=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:R*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();p(A,"Attr",n["default"]),a["default"].registerNode(A,"node");},/* 71 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return A;});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"),x=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],R=_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,R);else if(I==="offsetTranslate")w[4]+=R[0],w[5]+=R[1];else if(I==="offsetRotate")w=e.mat2d.rotate(Array.of(0,0,0,0,0,0),w,R);else if(I==="skew"){var _R5=_slicedToArray(R,2),W=_R5[0],z=_R5[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,R);(O||L)&&(w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-O,-L]));}),w;}var T=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 R=b[f];R.has(O)&&R["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;})),R.set(O,L)),b[T]=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 R=b.offsetRotate;R==="auto"?R=w.angle:R==="reverse"?R=Math.PI+w.angle:R=Math.PI*R/180,I.set("offsetRotate",R),I.set("offsetTranslate",[w.x,w.y]),b[T]=null;}}var A=/*#__PURE__*/function(){function A(O){var _this24=this;_classCallCheck(this,A);this[p]=O,this[y]={},this[T]=e.mat2d.fromValues(1,0,0,1,0,0),this[f]=/* @__PURE__ */new Map(),this[P]={},this[x]=[],Object.defineProperty(O,"transformMatrix",{get:function get(){return _this24[T]||(_this24[T]=v(_this24[f],_this24.transformOrigin)),_toConsumableArray(_this24[T]);}}),this[a]({id:"",name:"",className:"",/* class */x:0,y:0,/* pos */transformOrigin:[0,0],transform:"",translate:[0,0],rotate:0,scale:[1,1],skew:[0,0],opacity:1,zIndex:0,offsetPath:void 0,offsetDistance:0,offsetRotate:"auto",pointerEvents:"visible",// none | visible | visibleFill | visibleStroke | all
233
- filter:"none",display:""}),this[o]("class","pos"),this[g]=/* @__PURE__ */new Set(),this[m]=new n.Figure2D({scale:5,simplify:0});}return _createClass(A,[{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[x].length;L++){var w=this[x][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$x4;(_this$x4=this[x]).push.apply(_this$x4,arguments);}},{key:s,value:function value(O,L){var w=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[y][O],R=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&&R.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 R=O.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(R){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var z=0;z<R.length;z++){var k=R[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[T]=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[T]=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 x=arguments[P];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(y[v]=x[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,x,v,T){return typeof y=="string"&&(y=i()(y)),typeof P=="string"&&(P=i()(P)),e.Effects["default"](y,P,x,v,T);}function c(y,P,x,v,T){return e.Effects["default"](y,P,x,v,T);}e.Effects["default"]=function(y,P,x,v,T){return Array.isArray(y)&&Array.isArray(P)?y.map(function(f,g){return f+(x-v)/(T-v)*(P[g]-f);}):typeof y=="number"&&typeof P=="number"?y+(x-v)/(T-v)*(P-y):x-v>T-x?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,x,v){var _this26;_classCallCheck(this,p);var T=P.attr();Object.entries(T).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),f=_ref113[0],g=_ref113[1];T[f]=e.Effects[f]?g:l(g);}),x=x.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,[T,x,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(x){function v(){P.setter(P.frame,P.target);var T=P.playState;T==="finished"||T==="idle"?(Object(a.cancelAnimationFrame)(P.requestId),x()):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 x(){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 T=P.playState;P.setter(P.frame,P.target),T!=="idle"&&(T==="running"?P.requestId=Object(a.requestAnimationFrame)(x):(T==="paused"||T==="pending"&&P.timeline.currentTime<0)&&P.ready.then(function(){P.setter(P.frame,P.target),P.requestId=Object(a.requestAnimationFrame)(x);}));});});}},{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),x=t(175),v=f(x),T=t(186);function f(w){return w&&w.__esModule?w:{"default":w};}var g=(0,T.createNowTime)(),u={originTime:0,playbackRate:1},m=(0,v["default"])("timeMark"),M=(0,v["default"])("playbackRate"),E=(0,v["default"])("timers"),A=(0,v["default"])("originTime"),b=(0,v["default"])("setTimer"),O=(0,v["default"])("parent"),L=function(){function w(I,R){(0,p["default"])(this,w),I instanceof w&&(R=I,I={}),I=(0,d["default"])({},u,I),R&&(this[O]=R);var W=I.nowtime||g;if(R)Object.defineProperty(this,"globalTime",{get:function get(){return R.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[A]=I.originTime,this[M]=I.playbackRate,this[E]=new s["default"]();}return(0,P["default"])(w,[{key:"markTime",value:function value(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=R.time,z=W===void 0?this.currentTime:W,K=R.entropy,k=K===void 0?this.entropy:K,q=R.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(R){return new w(R,this);}},{key:"seekGlobalTime",value:function value(R){var W=this.seekTimeMark(R),z=this[m][W],K=z.entropy,k=z.playbackRate,q=z.globalTime;return q+(R-K)/Math.abs(k);}},{key:"seekLocalTime",value:function value(R){var W=this.seekTimeMark(R),z=this[m][W],K=z.localTime,k=z.entropy,q=z.playbackRate;return q>0?K+(R-k):K-(R-k);}},{key:"seekTimeMark",value:function value(R){var W=this[m],z=0,K=W.length-1;if(R<=W[z].entropy)return z;if(R>=W[K].entropy)return K;for(var k=Math.floor((z+K)/2);k>z&&k<K;){if(R===W[k].entropy)return k;R<W[k].entropy?K=k:R>W[k].entropy&&(z=k),k=Math.floor((z+K)/2);}return z;}},{key:"updateTimers",value:function value(){var R=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];R[b](q.handler,q.time,k);});}},{key:"clearTimeout",value:function(I){function R(W){return I.apply(this,arguments);}return R.toString=function(){return I.toString();},R;}(function(I){var R=this[E].get(I);R&&R.timerID!=null&&(this[O]?this[O].clearTimeout(R.timerID):clearTimeout(R.timerID)),this[E]["delete"](I);})},{key:"clearInterval",value:function value(R){return this.clearTimeout(R);}},{key:"clear",value:function value(){var R=this,W=this[E];[].concat((0,a["default"])(W.keys())).forEach(function(z){R.clearTimeout(z);});}/*
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,A,w=0,O=0,L,b;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){A=E.anEdge,L=0;do M=A.Org,M.n===-1&&(M.n=O,O++),L++,A=A.Lnext;while(A!==E.anEdge);i(L<=u),E.n=w,++w;}for(this.elementCount=w,g===e.CONNECTED_POLYGONS&&(w*=2),this.elements=[],this.elements.length=w*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 R=0;for(E=f.fHead.next;E!==f.fHead;E=E.next)if(E.inside){A=E.anEdge,L=0;do M=A.Org,this.elements[R++]=M.n,L++,A=A.Lnext;while(A!==E.anEdge);for(b=L;b<u;++b)this.elements[R++]=-1;if(g===e.CONNECTED_POLYGONS){A=E.anEdge;do this.elements[R++]=this.getNeighbourFace_(A),A=A.Lnext;while(A!==E.anEdge);for(b=L;b<u;++b)this.elements[R++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
230
+ outputContours_:function outputContours_(f,g){var u,m,M,E=0,A=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 w=0,O=0,L=0;for(E=0,u=f.fHead.next;u!==f.fHead;u=u.next)if(u.inside){A=0,M=m=u.anEdge;do this.vertices[w++]=m.Org.coords[0],this.vertices[w++]=m.Org.coords[1],g>2&&(this.vertices[w++]=m.Org.coords[2]),this.vertexIndices[O++]=m.Org.idx,A++,m=m.Lnext;while(m!==M);this.elements[L++]=E,this.elements[L++]=A,E+=A;}},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 x=[],v=!!(P&1),_T10=!!(P&2),_f10=!!(P&4),g=!!(P&8);v&&x.push("#define TEXTURE 1"),_T10&&x.push("#define FILTER 1"),_f10&&x.push("#define GRADIENT 1"),g&&x.push("#define CLIPPATH 1");var u="".concat(x.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,x=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,v=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasClipPath=_ref95.hasClipPath,T=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var f=P|x<<1|v<<2|T<<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 x=[],v=!!(P&1),_T11=!!(P&2),_f11=!!(P&4),g=!!(P&8),u=!!(P&16),m=!!(P&32);v&&x.push("#define TEXTURE 1"),_T11&&x.push("#define FILTER 1"),_f11&&x.push("#define GRADIENT 1"),g&&x.push("#define CLOUDCOLOR 1"),u&&x.push("#define CLOUDFILTER 1"),m&&x.push("#define CLIPPATH 1");var M="".concat(x.join("\n"),"\n"),E=[];if(v){E.push("uniform sampler2D u_texSampler;");for(var A=0;A<12;A++)E.push("uniform sampler2D u_texFrame".concat(A,";"));}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,x=_ref96$hasFilter===void 0?!1:_ref96$hasFilter,_ref96$hasGradient=_ref96.hasGradient,v=_ref96$hasGradient===void 0?!1:_ref96$hasGradient,_ref96$hasCloudColor=_ref96.hasCloudColor,T=_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|x<<1|v<<2|T<<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(T){if(e===setTimeout)return setTimeout(T,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(T,0);try{return e(T,0);}catch(_unused6){try{return e.call(null,T,0);}catch(_unused7){return e.call(this,T,0);}}}function s(T){if(n===clearTimeout)return clearTimeout(T);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(T);try{return n(T);}catch(_unused8){try{return n.call(null,T);}catch(_unused9){return n.call(this,T);}}}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 T=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(T);}}t.nextTick=function(T){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 x(T,f)),l.length===1&&!d&&o(P);};function x(T,f){this.fun=T,this.array=f;}x.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function 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(T){return[];},t.binding=function(T){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(T){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return A;});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(w,O){var L=Object.keys(w);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(w);O&&(b=b.filter(function(I){return Object.getOwnPropertyDescriptor(w,I).enumerable;})),L.push.apply(L,b);}return L;}function c(w){for(var O=1;O<arguments.length;O++){var L=arguments[O]!=null?arguments[O]:{};O%2?d(Object(L),!0).forEach(function(b){p(w,b,L[b]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(L)):d(Object(L)).forEach(function(b){Object.defineProperty(w,b,Object.getOwnPropertyDescriptor(L,b));});}return w;}function p(w,O,L){return O in w?Object.defineProperty(w,O,{value:L,enumerable:!0,configurable:!0,writable:!0}):w[O]=L,w;}var y=Symbol["for"]("spritejs_changedAttrs"),P=Symbol["for"]("spritejs_attributes"),x=Symbol("resolution"),v=Symbol("animations"),T=Symbol("eventListeners"),f=Symbol("captureEventListeners"),g=Symbol("filters"),u=Symbol("display"),m=Symbol("program"),M=Symbol("shaderAttrs"),E=Symbol("uniforms");var A=/*#__PURE__*/function(){function A(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,A);this.attributes=new this.constructor.Attr(this),this[x]={width:300,height:150},Object.assign(this.attributes,O),this[v]=/* @__PURE__ */new Set(),this[T]={},this[f]={};}return _createClass(A,[{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,b=_this$attributes.y;return O[4]+=L,O[5]+=b,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 b=L.__cacheRenderMatrix||L.renderMatrix;b&&(O=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,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 b=this.children;b&&b.forEach(function(I){I.activateAnimations&&I.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(O,L){var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};O==="mousewheel"&&(O="wheel"),typeof b=="boolean"&&(b={capture:b});var _b8=b,I=_b8.capture,R=_b8.once,W=I?f:T;return this[W][O]=this[W][O]||[],this[W][O].push({listener:L,once:R}),this;}},{key:"animate",value:function animate(O,L){var _this21=this;var b=new i["default"](this,O,L);return this.effects&&b.applyEffects(this.effects),this.layer&&(b.baseTimeline=this.layer.timeline,b.play(),b.finished.then(function(){_this21[v]["delete"](b);})),this[v].add(b),b;}},{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],b=O[1];return typeof b=="function"&&(b=b(this.attr(L))),this.setAttribute(L,b),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 b=[this];var I=this.parent;for(;O.bubbles&&I;)b.push(I),I=I.parent;for(var R=b.length-1;R>=0;R--){var W=b[R],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&&b.removeEventListener(K);}),delete O.currentTarget),!O.bubbles&&O.cancelBubble)break;}if(!O.cancelBubble)for(var _R4=0;_R4<b.length;_R4++){var _W=b[_R4],_z3=_W[T]&&_W[T][L];if(_z3&&_z3.length&&(O.currentTarget=_W,_z3.forEach(function(_ref98){var K=_ref98.listener,k=_ref98.once;K.call(_this22,O),k&&b.removeEventListener(K);}),delete O.currentTarget),!O.bubbles||O.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(O){var L=O.layerX,b=O.layerY;return this.isPointCollision(L,b)?(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 b=this[M];b&&Object.entries(b).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),R=_ref100[0],W=_ref100[1];L.setAttribute(R,W);});var I=this[E];if(this[E]){var R={};Object.entries(I).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],z=_ref102[1];typeof z=="function"&&(z=z(_this23,W)),R[W]=z;}),L.setUniforms(R);}}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:T][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,b=L.indexOf(this);return L[b+O];}},{key:"getWorldPosition",value:function getWorldPosition(O,L){var b=this.renderMatrix,I=O*b[0]+L*b[2]+b[4],R=O*b[1]+L*b[3]+b[5];return[I,R];}},{key:"getOffsetPosition",value:function getOffsetPosition(O,L){var b=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=O*b[0]+L*b[2]+b[4],R=O*b[1]+L*b[3]+b[5];return[I,R];}},{key:"getResolution",value:function getResolution(){return c({},this[x]);}},{key:"isPointCollision",value:function isPointCollision(O,L){if(!this.mesh)return!1;var b=this.attributes.pointerEvents;if(b==="none"||b!=="all"&&!this.isVisible)return!1;var I="both";return b==="visibleFill"&&(I="fill"),b==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(O,L,I);}},{key:"onPropertyChange",value:function onPropertyChange(O,L,b){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$x3=this[x],b=_this$x3.width,I=_this$x3.height;(b!==O||I!==L)&&(this[x]={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:T;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 b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof b=="boolean"&&(b={capture:b});var R=b.capture?f:T;if(this[R][O]){var W=this[R][O];if(W)for(var z=0;z<W.length;z++){var K=W[z].listener;if(K===L){this[R][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 b=this,I=Symbol("animation");L=L||"linear";var R=0;return _typeof(O)=="object"&&(R=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(b.attr(K)));}),this[I]=b.animate([W],{duration:O*1e3,delay:R*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();p(A,"Attr",n["default"]),a["default"].registerNode(A,"node");},/* 71 *//***/function(h,r,t){t.r(r),t.d(r,"default",function(){return A;});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"),x=Symbol("alias");function v(w,_ref108){var _ref109=_slicedToArray(_ref108,2),O=_ref109[0],L=_ref109[1];var b=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(w).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),I=_ref111[0],R=_ref111[1];if((O||L)&&(b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[O,L])),I==="matrix")b=e.mat2d.multiply(b,b,R);else if(I==="offsetTranslate")b[4]+=R[0],b[5]+=R[1];else if(I==="offsetRotate")b=e.mat2d.rotate(Array.of(0,0,0,0,0,0),b,R);else if(I==="skew"){var _R5=_slicedToArray(R,2),W=_R5[0],z=_R5[1];b=e.mat2d.multiply(b,b,e.mat2d.fromValues(1,Math.tan(z),Math.tan(W),1,0,0));}else e.mat2d[I](b,b,R);(O||L)&&(b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-O,-L]));}),b;}var T=Symbol("transformMatrix"),f=Symbol("transforms"),g=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),m=Symbol("offsetFigure");function M(w,O,L){var b=w[y][O];if(w[s](O,L,!1)||w[u]!==O){var R=w[f];R.has(O)&&R["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;})),R.set(O,L)),w[T]=null,w[p].onPropertyChange(O,L,b,w);}}function E(w){var O=w[m],L=w.offsetDistance*O.getTotalLength(),b=O.getPointAtLength(L);if(b){var I=w[f];var R=w.offsetRotate;R==="auto"?R=b.angle:R==="reverse"?R=Math.PI+b.angle:R=Math.PI*R/180,I.set("offsetRotate",R),I.set("offsetTranslate",[b.x,b.y]),w[T]=null;}}var A=/*#__PURE__*/function(){function A(O){var _this24=this;_classCallCheck(this,A);this[p]=O,this[y]={},this[T]=e.mat2d.fromValues(1,0,0,1,0,0),this[f]=/* @__PURE__ */new Map(),this[P]={},this[x]=[],Object.defineProperty(O,"transformMatrix",{get:function get(){return _this24[T]||(_this24[T]=v(_this24[f],_this24.transformOrigin)),_toConsumableArray(_this24[T]);}}),this[a]({id:"",name:"",className:"",/* class */x:0,y:0,/* pos */transformOrigin:[0,0],transform:"",translate:[0,0],rotate:0,scale:[1,1],skew:[0,0],opacity:1,zIndex:0,offsetPath:void 0,offsetDistance:0,offsetRotate:"auto",pointerEvents:"visible",// none | visible | visibleFill | visibleStroke | all
233
+ filter:"none",display:""}),this[o]("class","pos"),this[g]=/* @__PURE__ */new Set(),this[m]=new n.Figure2D({scale:5,simplify:0});}return _createClass(A,[{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[x].length;L++){var b=this[x][L];O[b]=this[b];}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$x4;(_this$x4=this[x]).push.apply(_this$x4,arguments);}},{key:s,value:function value(O,L){var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[y][O],R=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,b&&R.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 b=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 R=O.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(R){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var z=0;z<R.length;z++){var k=R[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[T]=null,this[p].onPropertyChange("transform",O,b,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[T]=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 x=arguments[P];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(y[v]=x[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,x,v,T){return typeof y=="string"&&(y=i()(y)),typeof P=="string"&&(P=i()(P)),e.Effects["default"](y,P,x,v,T);}function c(y,P,x,v,T){return e.Effects["default"](y,P,x,v,T);}e.Effects["default"]=function(y,P,x,v,T){return Array.isArray(y)&&Array.isArray(P)?y.map(function(f,g){return f+(x-v)/(T-v)*(P[g]-f);}):typeof y=="number"&&typeof P=="number"?y+(x-v)/(T-v)*(P-y):x-v>T-x?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,x,v){var _this26;_classCallCheck(this,p);var T=P.attr();Object.entries(T).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),f=_ref113[0],g=_ref113[1];T[f]=e.Effects[f]?g:l(g);}),x=x.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,[T,x,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(x){function v(){P.setter(P.frame,P.target);var T=P.playState;T==="finished"||T==="idle"?(Object(a.cancelAnimationFrame)(P.requestId),x()):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 x(){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 T=P.playState;P.setter(P.frame,P.target),T!=="idle"&&(T==="running"?P.requestId=Object(a.requestAnimationFrame)(x):(T==="paused"||T==="pending"&&P.timeline.currentTime<0)&&P.ready.then(function(){P.setter(P.frame,P.target),P.requestId=Object(a.requestAnimationFrame)(x);}));});});}},{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),x=t(175),v=f(x),T=t(186);function f(b){return b&&b.__esModule?b:{"default":b};}var g=(0,T.createNowTime)(),u={originTime:0,playbackRate:1},m=(0,v["default"])("timeMark"),M=(0,v["default"])("playbackRate"),E=(0,v["default"])("timers"),A=(0,v["default"])("originTime"),w=(0,v["default"])("setTimer"),O=(0,v["default"])("parent"),L=function(){function b(I,R){(0,p["default"])(this,b),I instanceof b&&(R=I,I={}),I=(0,d["default"])({},u,I),R&&(this[O]=R);var W=I.nowtime||g;if(R)Object.defineProperty(this,"globalTime",{get:function get(){return R.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[A]=I.originTime,this[M]=I.playbackRate,this[E]=new s["default"]();}return(0,P["default"])(b,[{key:"markTime",value:function value(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=R.time,z=W===void 0?this.currentTime:W,K=R.entropy,k=K===void 0?this.entropy:K,q=R.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(R){return new b(R,this);}},{key:"seekGlobalTime",value:function value(R){var W=this.seekTimeMark(R),z=this[m][W],K=z.entropy,k=z.playbackRate,q=z.globalTime;return q+(R-K)/Math.abs(k);}},{key:"seekLocalTime",value:function value(R){var W=this.seekTimeMark(R),z=this[m][W],K=z.localTime,k=z.entropy,q=z.playbackRate;return q>0?K+(R-k):K-(R-k);}},{key:"seekTimeMark",value:function value(R){var W=this[m],z=0,K=W.length-1;if(R<=W[z].entropy)return z;if(R>=W[K].entropy)return K;for(var k=Math.floor((z+K)/2);k>z&&k<K;){if(R===W[k].entropy)return k;R<W[k].entropy?K=k:R>W[k].entropy&&(z=k),k=Math.floor((z+K)/2);}return z;}},{key:"updateTimers",value:function value(){var R=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];R[w](q.handler,q.time,k);});}},{key:"clearTimeout",value:function(I){function R(W){return I.apply(this,arguments);}return R.toString=function(){return I.toString();},R;}(function(I){var R=this[E].get(I);R&&R.timerID!=null&&(this[O]?this[O].clearTimeout(R.timerID):clearTimeout(R.timerID)),this[E]["delete"](I);})},{key:"clearInterval",value:function value(R){return this.clearTimeout(R);}},{key:"clear",value:function value(){var R=this,W=this[E];[].concat((0,a["default"])(W.keys())).forEach(function(z){R.clearTimeout(z);});}/*
234
234
  setTimeout(func, {delay: 100, isEntropy: true})
235
235
  setTimeout(func, {entropy: 100})
236
236
  setTimeout(func, 100})
237
- */},{key:"setTimeout",value:function value(R){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](R,W);}},{key:"setInterval",value:function value(R){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),R();},W);return K;}},{key:b,value:function value(R,W){var z=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,v["default"])("timerID");W=(0,T.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],rt=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),rt!==setTimeout&&(q={delay:q,heading:tt}),U=rt(function(){z[E]["delete"](K),R();},q)),this[E].set(K,{timerID:U,handler:R,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 R=this.lastTimeMark,W=R.localTime,z=R.globalTime;return W+(this.globalTime-z)*this.playbackRate;},set:function set(R){var W=this,z=this.currentTime,K=R,k=this[E];this.markTime({time:R}),[].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,rt=nt.isEntropy,tt=nt.delay,J=nt.heading,ht=Z.handler,dt=Z.startTime;if(rt)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.
237
+ */},{key:"setTimeout",value:function value(R){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[w](R,W);}},{key:"setInterval",value:function value(R){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},z=this,K=this[w](function k(){z[w](k,W,K),R();},W);return K;}},{key:w,value:function value(R,W){var z=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,v["default"])("timerID");W=(0,T.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],rt=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),rt!==setTimeout&&(q={delay:q,heading:tt}),U=rt(function(){z[E]["delete"](K),R();},q)),this[E].set(K,{timerID:U,handler:R,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 R=this.lastTimeMark,W=R.localTime,z=R.globalTime;return W+(this.globalTime-z)*this.playbackRate;},set:function set(R){var W=this,z=this.currentTime,K=R,k=this[E];this.markTime({time:R}),[].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,rt=nt.isEntropy,tt=nt.delay,J=nt.heading,ht=Z.handler,dt=Z.startTime;if(rt)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
238
  // If current playbackRate is negative, the currentTime should go backwards
239
239
  // while the entropy remain to go forwards.
240
240
  // Both of the initial values is set to -originTime
@@ -247,16 +247,16 @@ filter:"none",display:""}),this[o]("class","pos"),this[g]=/* @__PURE__ */new Set
247
247
  // change entropy will NOT cause currentTime changing but may influence the pass
248
248
  // and the future of the timeline. (It may change the result of seek***Time)
249
249
  // While entropy is set, all the marks behind will be droped
250
- set:function set(R){if(this.entropy>R){var W=this.seekTimeMark(R);this[m].length=W+1;}this.markTime({entropy:R}),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(R){R!==this.playbackRate&&(this.markTime({playbackRate:R}),this[M]=R,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var R=this.parent;R;){if(R.playbackRate===0)return!0;R=R.parent;}return!1;}}]),w;}();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 x=(0,a["default"])(l),v;!(p=(v=x.next()).done)&&(c.push(v.value),!(d&&c.length===d));p=!0);}catch(T){y=!0,P=T;}finally{try{!p&&x["return"]&&x["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",x="values",v=function v(){return this;};h.exports=function(T,f,g,u,m,M,E){s(g,f,u);var A=function A(U){if(!p&&U in w)return w[U];switch(U){case P:return function(){return new g(this,U);};case x:return function(){return new g(this,U);};}return function(){return new g(this,U);};},b=f+" Iterator",O=m==x,L=!1,w=T.prototype,I=w[c]||w[y]||m&&w[m],R=I||A(m),W=m?O?A("entries"):R:void 0,z=f=="Array"&&w.entries||I,K,k,q;if(z&&(q=d(z.call(new T())),q!==Object.prototype&&q.next&&(l(q,b,!0),!e&&typeof q[c]!="function"&&a(q,c,v))),O&&I&&I.name!==x&&(L=!0,R=function R(){return I.call(this);}),(!e||E)&&(p||L||!w[c])&&a(w,c,R),o[f]=R,o[b]=v,m)if(K={values:O?R:A(x),keys:M?R:A(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,x=d&_l2.S,v=d&_l2.P,T=d&_l2.B,f=d&_l2.W,g=P?n:n[c]||(n[c]={}),u=g[s],m=P?e:x?e[c]:(e[c]||{})[s],M,E,A;P&&(p=c);for(M in p)E=!y&&m&&m[M]!==void 0,!(E&&o(g,M))&&(A=E?m[M]:p[M],g[M]=P&&typeof m[M]!="function"?p[M]:T&&E?i(A,e):f&&m[M]==A?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;}(A):v&&typeof A=="function"?i(Function.call,A):A,v&&((g.virtual||(g.virtual={}))[M]=A,d&_l2.R&&u&&!u[M]&&a(u,M,A)));};_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)
250
+ set:function set(R){if(this.entropy>R){var W=this.seekTimeMark(R);this[m].length=W+1;}this.markTime({entropy:R}),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(R){R!==this.playbackRate&&(this.markTime({playbackRate:R}),this[M]=R,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var R=this.parent;R;){if(R.playbackRate===0)return!0;R=R.parent;}return!1;}}]),b;}();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 x=(0,a["default"])(l),v;!(p=(v=x.next()).done)&&(c.push(v.value),!(d&&c.length===d));p=!0);}catch(T){y=!0,P=T;}finally{try{!p&&x["return"]&&x["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",x="values",v=function v(){return this;};h.exports=function(T,f,g,u,m,M,E){s(g,f,u);var A=function A(U){if(!p&&U in b)return b[U];switch(U){case P:return function(){return new g(this,U);};case x:return function(){return new g(this,U);};}return function(){return new g(this,U);};},w=f+" Iterator",O=m==x,L=!1,b=T.prototype,I=b[c]||b[y]||m&&b[m],R=I||A(m),W=m?O?A("entries"):R:void 0,z=f=="Array"&&b.entries||I,K,k,q;if(z&&(q=d(z.call(new T())),q!==Object.prototype&&q.next&&(l(q,w,!0),!e&&typeof q[c]!="function"&&a(q,c,v))),O&&I&&I.name!==x&&(L=!0,R=function R(){return I.call(this);}),(!e||E)&&(p||L||!b[c])&&a(b,c,R),o[f]=R,o[w]=v,m)if(K={values:O?R:A(x),keys:M?R:A(P),entries:W},E)for(k in K)k in b||i(b,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,x=d&_l2.S,v=d&_l2.P,T=d&_l2.B,f=d&_l2.W,g=P?n:n[c]||(n[c]={}),u=g[s],m=P?e:x?e[c]:(e[c]||{})[s],M,E,A;P&&(p=c);for(M in p)E=!y&&m&&m[M]!==void 0,!(E&&o(g,M))&&(A=E?m[M]:p[M],g[M]=P&&typeof m[M]!="function"?p[M]:T&&E?i(A,e):f&&m[M]==A?function(w){var O=function O(L,b,I){if(this instanceof w){switch(arguments.length){case 0:return new w();case 1:return new w(L);case 2:return new w(L,b);}return new w(L,b,I);}return w.apply(this,arguments);};return O[s]=w[s],O;}(A):v&&typeof A=="function"?i(Function.call,A):A,v&&((g.virtual||(g.virtual={}))[M]=A,d&_l2.R&&u&&!u[M]&&a(u,M,A)));};_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
251
  from:function from(p){var y=i(p),P=typeof this=="function"?this:Array,x=arguments.length,v=x>1?arguments[1]:void 0,T=v!==void 0,f=0,g=d(y),u,m,M,E;if(T&&(v=e(v,x>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,T?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,T?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
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
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),x=p?"_s":"size",v=function v(T,f){var g=y(f),u;if(g!=="F")return T._i[g];for(u=T._f;u;u=u.n)if(u.k==f)return u;};h.exports={getConstructor:function getConstructor(T,f,g,u){var m=T(function(M,E){o(M,m,f,"_i"),M._t=f,M._i=n(null),M._f=void 0,M._l=void 0,M[x]=0,E!=null&&s(E,g,M[u],M);});return i(m.prototype,{// 23.1.3.1 Map.prototype.clear()
254
254
  // 23.2.3.2 Set.prototype.clear()
255
- clear:function clear(){for(var E=P(this,f),A=E._i,b=E._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete A[b.i];E._f=E._l=void 0,E[x]=0;},// 23.1.3.3 Map.prototype.delete(key)
255
+ clear:function clear(){for(var E=P(this,f),A=E._i,w=E._f;w;w=w.n)w.r=!0,w.p&&(w.p=w.p.n=void 0),delete A[w.i];E._f=E._l=void 0,E[x]=0;},// 23.1.3.3 Map.prototype.delete(key)
256
256
  // 23.2.3.4 Set.prototype.delete(value)
257
- "delete":function _delete(M){var E=P(this,f),A=v(E,M);if(A){var b=A.n,O=A.p;delete E._i[A.i],A.r=!0,O&&(O.n=b),b&&(b.p=O),E._f==A&&(E._f=b),E._l==A&&(E._l=O),E[x]--;}return!!A;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
257
+ "delete":function _delete(M){var E=P(this,f),A=v(E,M);if(A){var w=A.n,O=A.p;delete E._i[A.i],A.r=!0,O&&(O.n=w),w&&(w.p=O),E._f==A&&(E._f=w),E._l==A&&(E._l=O),E[x]--;}return!!A;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
258
258
  // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
259
- forEach:function forEach(E){P(this,f);for(var A=a(E,arguments.length>1?arguments[1]:void 0,3),b;b=b?b.n:this._f;)for(A(b.v,b.k,this);b&&b.r;)b=b.p;},// 23.1.3.7 Map.prototype.has(key)
259
+ forEach:function forEach(E){P(this,f);for(var A=a(E,arguments.length>1?arguments[1]:void 0,3),w;w=w?w.n:this._f;)for(A(w.v,w.k,this);w&&w.r;)w=w.p;},// 23.1.3.7 Map.prototype.has(key)
260
260
  // 23.2.3.7 Set.prototype.has(value)
261
261
  has:function has(E){return!!v(P(this,f),E);}}),p&&e(m.prototype,"size",{get:function get(){return P(this,f)[x];}}),m;},def:function def(T,f,g){var u=v(T,f),m,M;return u?u.v=g:(T._l=u={i:M=y(f,!0),// <- index
262
262
  k:f,// <- key
@@ -266,17 +266,17 @@ n:void 0,// <- next entry
266
266
  r:!1// <- removed
267
267
  },T._f||(T._f=u),m&&(m.n=u),T[x]++,M!=="F"&&(T._i[M]=u)),T;},getEntry:v,setStrong:function setStrong(T,f,g){l(T,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,x,v){var T=v?function(){return p;}:s(p),f=e(P,x,y?2:1),g=0,u,m,M,E;if(typeof T!="function")throw TypeError(p+" is not iterable!");if(i(T)){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=T.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(x){a(x,e,{value:{i:"O"+ ++o,// object ID
268
268
  w:{}// weak collections IDs
269
- }});},c=function c(x,v){if(!n(x))return _typeof(x)=="symbol"?x:(typeof x=="string"?"S":"P")+x;if(!i(x,e)){if(!s(x))return"F";if(!v)return"E";d(x);}return x[e].i;},p=function p(x,v){if(!i(x,e)){if(!s(x))return!0;if(!v)return!1;d(x);}return x[e].w;},y=function y(x){return l&&P.NEED&&s(x)&&!i(x,e)&&d(x),x;},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),x=t(100);h.exports=function(v,T,f,g,u,m){var M=e[v],E=M,A=u?"set":"add",b=E&&E.prototype,O={};return!x||typeof E!="function"||!(m||b.forEach&&!a(function(){new E().entries().next();}))?(E=g.getConstructor(T,v,u,A),s(E.prototype,f),i.NEED=!0):(E=T(function(L,w){d(L,E,v,"_c"),L._c=new M(),w!=null&&l(w,u,L[A],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,R){if(d(this,E,L),!w&&m&&!c(I))return L=="get"?void 0:!1;var W=this._c[L](I===0?0:I,R);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,x=s==5||P,v=l||o;return function(T,f,g){for(var u=i(T),m=n(u),M=e(f,g,3),E=a(m.length),A=0,b=d?v(T,E):c?v(T,0):void 0,O,L;E>A;A++)if((x||A in m)&&(O=m[A],L=M(O,A,u),s)){if(d)b[A]=L;else if(L)switch(s){case 3:return!0;case 5:return O;case 6:return A;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(x){p.push(P(x,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,x=1,v=i.f,T=a.f;P>x;)for(var f=s(arguments[x++]),g=v?n(f).concat(v(f)):n(f),u=g.length,m=0,M;u>m;)M=g[m++],(!e||T.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),x=t(179),v=t(180),T=t(156),f=t(97),g=t(98),u=t(124),m=t(84),M=t(103),E=t(104),A=t(108),b=t(181),O=t(183),L=t(168),w=t(96),I=t(110),R=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,rt=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 A(W({},"a",{get:function get(){return W(this,"a",{value:7}).a;}})).a!=7;})?function(lt,ot,ft){var mt=R(ht,ot);mt&&delete ht[ot],W(lt,ot,ft),mt&&lt!==ht&&W(ht,ot,mt);}:W,X=function X(lt){var ot=tt[lt]=A(_K2[U]);return ot._k=lt,ot;},N=dt&&_typeof(_K2.iterator)=="symbol"?function(lt){return _typeof(lt)=="symbol";}:function(lt){return lt 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=A(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?A(ot):S(A(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=R(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(lt){return X(y(lt));}),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
269
+ }});},c=function c(x,v){if(!n(x))return _typeof(x)=="symbol"?x:(typeof x=="string"?"S":"P")+x;if(!i(x,e)){if(!s(x))return"F";if(!v)return"E";d(x);}return x[e].i;},p=function p(x,v){if(!i(x,e)){if(!s(x))return!0;if(!v)return!1;d(x);}return x[e].w;},y=function y(x){return l&&P.NEED&&s(x)&&!i(x,e)&&d(x),x;},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),x=t(100);h.exports=function(v,T,f,g,u,m){var M=e[v],E=M,A=u?"set":"add",w=E&&E.prototype,O={};return!x||typeof E!="function"||!(m||w.forEach&&!a(function(){new E().entries().next();}))?(E=g.getConstructor(T,v,u,A),s(E.prototype,f),i.NEED=!0):(E=T(function(L,b){d(L,E,v,"_c"),L._c=new M(),b!=null&&l(b,u,L[A],L);}),P("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(L){var b=L=="add"||L=="set";L in w&&!(m&&L=="clear")&&o(E.prototype,L,function(I,R){if(d(this,E,L),!b&&m&&!c(I))return L=="get"?void 0:!1;var W=this._c[L](I===0?0:I,R);return b?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,x=s==5||P,v=l||o;return function(T,f,g){for(var u=i(T),m=n(u),M=e(f,g,3),E=a(m.length),A=0,w=d?v(T,E):c?v(T,0):void 0,O,L;E>A;A++)if((x||A in m)&&(O=m[A],L=M(O,A,u),s)){if(d)w[A]=L;else if(L)switch(s){case 3:return!0;case 5:return O;case 6:return A;case 2:w.push(O);}else if(y)return!1;}return P?-1:p||y?y:w;};};},/* 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(x){p.push(P(x,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,x=1,v=i.f,T=a.f;P>x;)for(var f=s(arguments[x++]),g=v?n(f).concat(v(f)):n(f),u=g.length,m=0,M;u>m;)M=g[m++],(!e||T.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),x=t(179),v=t(180),T=t(156),f=t(97),g=t(98),u=t(124),m=t(84),M=t(103),E=t(104),A=t(108),w=t(181),O=t(183),L=t(168),b=t(96),I=t(110),R=O.f,W=b.f,z=w.f,_K2=e.Symbol,k=e.JSON,q=k&&k.stringify,U="prototype",G=y("_hidden"),Z=y("toPrimitive"),nt={}.propertyIsEnumerable,rt=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 A(W({},"a",{get:function get(){return W(this,"a",{value:7}).a;}})).a!=7;})?function(lt,at,ft){var mt=R(ht,at);mt&&delete ht[at],W(lt,at,ft),mt&&lt!==ht&&W(ht,at,mt);}:W,X=function X(lt){var at=tt[lt]=A(_K2[U]);return at._k=lt,at;},N=dt&&_typeof(_K2.iterator)=="symbol"?function(lt){return _typeof(lt)=="symbol";}:function(lt){return lt instanceof _K2;},_$2=function $(at,ft,mt){return at===ht&&_$2(J,ft,mt),f(at),ft=M(ft,!0),f(mt),n(tt,ft)?(mt.enumerable?(n(at,G)&&at[G][ft]&&(at[G][ft]=!1),mt=A(mt,{enumerable:E(0,!1)})):(n(at,G)||W(at,G,E(1,{})),at[G][ft]=!0),Y(at,ft,mt)):W(at,ft,mt);},S=function S(at,ft){f(at);for(var mt=v(ft=m(ft)),yt=0,pt=mt.length,Tt;pt>yt;)_$2(at,Tt=mt[yt++],ft[Tt]);return at;},C=function C(at,ft){return ft===void 0?A(at):S(A(at),ft);},D=function D(at){var ft=nt.call(this,at=M(at,!0));return this===ht&&n(tt,at)&&!n(J,at)?!1:ft||!n(this,at)||!n(tt,at)||n(this,G)&&this[G][at]?ft:!0;},j=function j(at,ft){if(at=m(at),ft=M(ft,!0),!(at===ht&&n(tt,ft)&&!n(J,ft))){var mt=R(at,ft);return mt&&n(tt,ft)&&!(n(at,G)&&at[G][ft])&&(mt.enumerable=!0),mt;}},H=function H(at){for(var ft=z(m(at)),mt=[],yt=0,pt;ft.length>yt;)!n(tt,pt=ft[yt++])&&pt!=G&&pt!=s&&mt.push(pt);return mt;},V=function V(at){for(var ft=at===ht,mt=z(ft?J:m(at)),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 at=p(arguments.length>0?arguments[0]:void 0),_ft=function ft(mt){this===ht&&_ft.call(J,mt),n(this,G)&&n(this[G],at)&&(this[G][at]=!1),Y(this,at,E(1,mt));};return i&&F&&Y(ht,at,{configurable:!0,set:_ft}),X(at);},o(_K2[U],"toString",function(){return this._k;}),O.f=j,b.f=_$2,t(182).f=w.f=H,t(169).f=D,L.f=V,i&&!t(89)&&o(ht,"propertyIsEnumerable",D,!0),P.f=function(lt){return X(y(lt));}),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
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;)x(st[ct++]);a(a.S+a.F*!dt,"Symbol",{// 19.4.2.1 Symbol.for(key)
271
271
  "for":function _for(lt){return n(rt,lt+="")?rt[lt]:rt[lt]=_K2(lt);},// 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 rt)if(rt[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])
272
+ keyFor:function keyFor(at){if(!N(at))throw TypeError(at+" is not a symbol!");for(var ft in rt)if(rt[ft]===at)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
273
  create:C,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
274
274
  defineProperty:_$2,// 19.1.2.3 Object.defineProperties(O, Properties)
275
275
  defineProperties:S,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
276
276
  getOwnPropertyDescriptor:j,// 19.1.2.7 Object.getOwnPropertyNames(O)
277
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 lt=_K2();return q([lt])!="[null]"||q({a:lt})!="{}"||q(Object(lt))!="{}";})),"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 T(yt)||(yt=function yt(Tt,Rt){if(typeof pt=="function"&&(Rt=pt.call(this,Tt,Rt)),!N(Rt))return Rt;}),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(T){return T&&T.__esModule?T:{"default":T};}var d=t(189),c=new s["default"]();function p(){for(var T=arguments.length,f=Array(T),g=0;g<T;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(T){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,A=M,b=(g-E)/(A-E),O=1/T,L=b/O;return f==="end"?L=Math.floor(L):L=Math.ceil(L),O*L*(A-E)+E;}}return 0;};}function P(T){var f=/^cubic-bezier\((.*)\)/,g=T.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=T.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),A=E[0],b=E[1];return y(parseInt(A,10),b);}return T;}var x={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){
278
+ getOwnPropertySymbols:V});var gt=l(function(){L.f(1);});a(a.S+a.F*gt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(at){return L.f(u(at));}}),k&&a(a.S+a.F*(!dt||l(function(){var lt=_K2();return q([lt])!="[null]"||q({a:lt})!="{}"||q(Object(lt))!="{}";})),"JSON",{stringify:function stringify(at){for(var ft=[at],mt=1,yt,pt;arguments.length>mt;)ft.push(arguments[mt++]);if(pt=yt=ft[1],!(!g(yt)&&at===void 0||N(at)))return T(yt)||(yt=function yt(Tt,Rt){if(typeof pt=="function"&&(Rt=pt.call(this,Tt,Rt)),!N(Rt))return Rt;}),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(T){return T&&T.__esModule?T:{"default":T};}var d=t(189),c=new s["default"]();function p(){for(var T=arguments.length,f=Array(T),g=0;g<T;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(T){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,A=M,w=(g-E)/(A-E),O=1/T,L=w/O;return f==="end"?L=Math.floor(L):L=Math.ceil(L),O*L*(A-E)+E;}}return 0;};}function P(T){var f=/^cubic-bezier\((.*)\)/,g=T.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=T.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),A=E[0],w=E[1];return y(parseInt(A,10),w);}return T;}var x={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
280
  // let ret = 0
281
281
  // for(let i = 0; i < frames.length; i++){
282
282
  // const {offset} = frames[i]
@@ -298,13 +298,13 @@ getOwnPropertySymbols:V});var gt=l(function(){L.f(1);});a(a.S+a.F*gt,"Object",{g
298
298
  // }
299
299
  // return ret
300
300
  // }
301
- "step-start":y(1,"start"),"step-end":y(1,"end")};function v(T){return typeof T=="string"?x[T]?T=x[T]:T=P(T):T.type==="cubic-bezier"?T=p.apply(void 0,(0,a["default"])(T.value)):T.type==="steps"&&(T=y(T.step,T.pos)),T;}r.Easings=x,r.parseEasing=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(T,f){return 1-3*f+3*T;}function d(T,f){return 3*f-6*T;}function c(T){return 3*T;}function p(T,f,g){return((l(f,g)*T+d(f,g))*T+c(f))*T;}function y(T,f,g){return 3*l(f,g)*T*T+2*d(f,g)*T+c(f);}function P(T,f,g,u,m){var M,E,A=0;do E=f+(g-f)/2,M=p(E,u,m)-T,M>0?g=E:f=E;while(Math.abs(M)>n&&++A<i);return E;}function x(T,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)-T;f-=E/M;}return f;}function v(T){return T;}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 A(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]),R=O+I*o,W=y(R,f,u);return W>=e?x(b,R,f,u):W===0?R:P(b,O,O+o,f,u);}return function(O){return O===0?0:O===1?1:p(A(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),x=t(75),v=g(x),T=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"),A=(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},R=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,T.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[A]&&!this[A].timerID&&(this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),K[w](E),K[w](A);},{delay:Z,heading:!1}),this[A].reverseTimerID=this.timeline.setTimeout(function(){K[A].resolve(),K[w](E),K[w](A),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](A),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[w](E),this[w](A);}},{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,T.periodicity)(nt,k)[1]/k;}}else(G==="running"||G==="paused")&&(Z=(0,T.periodicity)(U.currentTime,k)[1]/k);return G==="finished"&&(Z=(0,T.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,T.getProgress)(this.timeline,this[u],this.progress),nt=Z.p,rt=Z.inverted,tt=k;return U<0&&K==="pending"?(q==="backwards"||q==="both")&&(tt=rt?G[G.length-1]:G[0]):(K!=="pending"&&K!=="finished"||q==="forwards"||q==="both")&&(tt=(0,T.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,T.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[A]||(this[A]=(0,T.defer)(),this.timeline&&this[L]()),this[A].promise);}}]),W;}();r["default"]=R;},/* 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)(),x=t(198),v=t(199),T=t(200),f=t(201),g="Promise",u=n.TypeError,m=n.process,M=m&&m.versions,E=M&&M.v8||"",_A=n[g],b=a(m)=="process",O=function O(){},L,w,I,R,W=w=x.f,z=!!function(){try{var rt=_A.resolve(1),tt=(rt.constructor={})[t(122)("species")]=function(J){J(O,O);};return(b||typeof PromiseRejectionEvent=="function")&&rt.then(O)instanceof tt&&E.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),K=function K(rt){var tt;return s(rt)&&typeof(tt=rt.then)=="function"?tt:!1;},k=function k(rt,tt){if(!rt._n){rt._n=!0;var J=rt._c;P(function(){for(var ht=rt._v,dt=rt._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||(rt._h==2&&G(rt),rt._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++]);rt._c=[],rt._n=!1,tt&&!rt._h&&q(rt);});}},q=function q(rt){y.call(n,function(){var tt=rt._v,J=U(rt),ht,dt,B;if(J&&(ht=v(function(){b?m.emit("unhandledRejection",tt,rt):(dt=n.onunhandledrejection)?dt({promise:rt,reason:tt}):(B=n.console)&&B.error&&B.error("Unhandled promise rejection",tt);}),rt._h=b||U(rt)?2:1),rt._a=void 0,J&&ht.e)throw ht.v;});},U=function U(rt){return rt._h!==1&&(rt._a||rt._c).length===0;},G=function G(rt){y.call(n,function(){var tt;b?m.emit("rejectionHandled",rt):(tt=n.onrejectionhandled)&&tt({promise:rt,reason:rt._v});});},Z=function Z(rt){var tt=this;tt._d||(tt._d=!0,tt=tt._w||tt,tt._v=rt,tt._s=2,tt._a||(tt._a=tt._c.slice()),k(tt,!0));},_nt3=function nt(rt){var tt=this,J;if(!tt._d){tt._d=!0,tt=tt._w||tt;try{if(tt===rt)throw u("Promise can't be resolved itself");(J=K(rt))?P(function(){var ht={_w:tt,_d:!1};try{J.call(rt,i(_nt3,ht,1),i(Z,ht,1));}catch(dt){Z.call(ht,dt);}}):(tt._v=rt,tt._s=1,k(tt,!1));}catch(ht){Z.call({_w:tt,_d:!1},ht);}}};z||(_A=function A(tt){d(this,_A,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)(_A.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
302
- then:function then(tt,J){var ht=W(p(this,_A));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(rt){return this.then(void 0,rt);}}),I=function I(){var rt=new L();this.promise=rt,this.resolve=i(_nt3,rt,1),this.reject=i(Z,rt,1);},x.f=W=function W(rt){return rt===_A||rt===R?new I(rt):w(rt);}),o(o.G+o.W+o.F*!z,{Promise:_A}),t(121)(_A,g),t(149)(g),R=t(92)[g],o(o.S+o.F*!z,g,{// 25.4.4.5 Promise.reject(r)
301
+ "step-start":y(1,"start"),"step-end":y(1,"end")};function v(T){return typeof T=="string"?x[T]?T=x[T]:T=P(T):T.type==="cubic-bezier"?T=p.apply(void 0,(0,a["default"])(T.value)):T.type==="steps"&&(T=y(T.step,T.pos)),T;}r.Easings=x,r.parseEasing=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(T,f){return 1-3*f+3*T;}function d(T,f){return 3*f-6*T;}function c(T){return 3*T;}function p(T,f,g){return((l(f,g)*T+d(f,g))*T+c(f))*T;}function y(T,f,g){return 3*l(f,g)*T*T+2*d(f,g)*T+c(f);}function P(T,f,g,u,m){var M,E,A=0;do E=f+(g-f)/2,M=p(E,u,m)-T,M>0?g=E:f=E;while(Math.abs(M)>n&&++A<i);return E;}function x(T,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)-T;f-=E/M;}return f;}function v(T){return T;}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 A(w){for(var O=0,L=1,b=a-1;L!==b&&M[L]<=w;++L)O+=o;--L;var I=(w-M[L])/(M[L+1]-M[L]),R=O+I*o,W=y(R,f,u);return W>=e?x(w,R,f,u):W===0?R:P(w,O,O+o,f,u);}return function(O){return O===0?0:O===1?1:p(A(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),x=t(75),v=g(x),T=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"),A=(0,P["default"])("finishedDefer"),w=(0,P["default"])("effects"),O=(0,P["default"])("activeReadyTimer"),L=(0,P["default"])("activeFinishTimer"),b=(0,P["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},R=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,T.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[w]={},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[A]&&!this[A].timerID&&(this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),K[b](E),K[b](A);},{delay:Z,heading:!1}),this[A].reverseTimerID=this.timeline.setTimeout(function(){K[A].resolve(),K[b](E),K[b](A),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:b,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[b](E),this[b](A),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[b](E),this[b](A);}},{key:"applyEffects",value:function value(K){return(0,s["default"])(this[w],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,T.periodicity)(nt,k)[1]/k;}}else(G==="running"||G==="paused")&&(Z=(0,T.periodicity)(U.currentTime,k)[1]/k);return G==="finished"&&(Z=(0,T.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,T.getProgress)(this.timeline,this[u],this.progress),nt=Z.p,rt=Z.inverted,tt=k;return U<0&&K==="pending"?(q==="backwards"||q==="both")&&(tt=rt?G[G.length-1]:G[0]):(K!=="pending"&&K!=="finished"||q==="forwards"||q==="both")&&(tt=(0,T.getCurrentFrame)(this[u],G,this[w],nt)),tt;}},{key:"timing",get:function get(){return this[u];}},{key:"effects",get:function get(){return this[w];}},{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,T.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[A]||(this[A]=(0,T.defer)(),this.timeline&&this[L]()),this[A].promise);}}]),W;}();r["default"]=R;},/* 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)(),x=t(198),v=t(199),T=t(200),f=t(201),g="Promise",u=n.TypeError,m=n.process,M=m&&m.versions,E=M&&M.v8||"",_A=n[g],w=a(m)=="process",O=function O(){},L,b,I,R,W=b=x.f,z=!!function(){try{var rt=_A.resolve(1),tt=(rt.constructor={})[t(122)("species")]=function(J){J(O,O);};return(w||typeof PromiseRejectionEvent=="function")&&rt.then(O)instanceof tt&&E.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),K=function K(rt){var tt;return s(rt)&&typeof(tt=rt.then)=="function"?tt:!1;},k=function k(rt,tt){if(!rt._n){rt._n=!0;var J=rt._c;P(function(){for(var ht=rt._v,dt=rt._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||(rt._h==2&&G(rt),rt._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++]);rt._c=[],rt._n=!1,tt&&!rt._h&&q(rt);});}},q=function q(rt){y.call(n,function(){var tt=rt._v,J=U(rt),ht,dt,B;if(J&&(ht=v(function(){w?m.emit("unhandledRejection",tt,rt):(dt=n.onunhandledrejection)?dt({promise:rt,reason:tt}):(B=n.console)&&B.error&&B.error("Unhandled promise rejection",tt);}),rt._h=w||U(rt)?2:1),rt._a=void 0,J&&ht.e)throw ht.v;});},U=function U(rt){return rt._h!==1&&(rt._a||rt._c).length===0;},G=function G(rt){y.call(n,function(){var tt;w?m.emit("rejectionHandled",rt):(tt=n.onrejectionhandled)&&tt({promise:rt,reason:rt._v});});},Z=function Z(rt){var tt=this;tt._d||(tt._d=!0,tt=tt._w||tt,tt._v=rt,tt._s=2,tt._a||(tt._a=tt._c.slice()),k(tt,!0));},_nt3=function nt(rt){var tt=this,J;if(!tt._d){tt._d=!0,tt=tt._w||tt;try{if(tt===rt)throw u("Promise can't be resolved itself");(J=K(rt))?P(function(){var ht={_w:tt,_d:!1};try{J.call(rt,i(_nt3,ht,1),i(Z,ht,1));}catch(dt){Z.call(ht,dt);}}):(tt._v=rt,tt._s=1,k(tt,!1));}catch(ht){Z.call({_w:tt,_d:!1},ht);}}};z||(_A=function A(tt){d(this,_A,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)(_A.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
302
+ then:function then(tt,J){var ht=W(p(this,_A));return ht.ok=typeof tt=="function"?tt:!0,ht.fail=typeof J=="function"&&J,ht.domain=w?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(rt){return this.then(void 0,rt);}}),I=function I(){var rt=new L();this.promise=rt,this.resolve=i(_nt3,rt,1),this.reject=i(Z,rt,1);},x.f=W=function W(rt){return rt===_A||rt===R?new I(rt):b(rt);}),o(o.G+o.W+o.F*!z,{Promise:_A}),t(121)(_A,g),t(149)(g),R=t(92)[g],o(o.S+o.F*!z,g,{// 25.4.4.5 Promise.reject(r)
304
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
305
  resolve:function resolve(tt){return f(e&&this===R?_A:this,tt);}}),o(o.S+o.F*!(z&&t(140)(function(rt){_A.all(rt)["catch"](O);})),g,{// 25.4.4.1 Promise.all(iterable)
306
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={},x="onreadystatechange",v,T,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=[],A=1;arguments.length>A;)E.push(arguments[A++]);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?(T=new c(),f=T.port2,T.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)):x in a("script")?v=function v(m){i.appendChild(a("script"))[x]=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,T;for(s&&(v=a.domain)&&v.exit();l;){T=l.fn,l=l.next;try{T();}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 x=o.resolve(void 0);c=function c(){x.then(p);};}else c=function c(){n.call(e,p);};return function(v){var T={fn:v,next:void 0};d&&(d.next=T),l||(l=T,c()),d=T;};};},/* 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=x,r.periodicity=v,r.calculateFramesOffset=T,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 x(){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),A=m-E*M;return A===0&&E>0&&(A=M,E--),[E,A];}function T(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 A=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-A)/w,R=0;R<w-1;R++)m[b+R+1].offset=A+I*(R+1);A=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 A=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(A/O);E===1&&w--,w%2^b==="alternate-reverse"&&(E=1-E,L=!0);}return{p:E,inverted:L};}function g(m,M,E,A){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 R=E[w]||E["default"],W=R(m[w],I,A,m.offset,M.offset);W!=null&&(b[w]=W);}}),b;}function u(m,M,E,A){var b=m.easing,O=m.effect;O||(E=(0,s["default"])({},y["default"],E));var L={};A=b(A,M);for(var w=1;w<M.length;w++){var I=M[w],R=I.offset;if(R>=A||w===M.length-1){var W=M[w-1],z=W.offset,K=W.easing,k=A;if(K){var q=R-z;k=K((A-z)/q)*q+z;}O?L=O(W,I,k,z,R):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,x){var v;return p==="url"||p==="drop-shadow"&&x===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],x=_ref119[1];_this29.meshCloud.mesh.setAttribute(P,x);});var y=this.uniforms;if(this.uniforms){var P={};Object.entries(y).forEach(function(_ref120){var _ref121=_slicedToArray(_ref120,2),x=_ref121[0],v=_ref121[1];typeof v=="function"&&(v=v(_this29,x)),P[x]=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 x=0;x<this[o];x++)if(!this.meshCloud.isPointCollision(x,[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 x=Math.PI*p/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,v=_this$meshNode$attrib.x,_T12=_this$meshNode$attrib.y;this.meshCloud.rotate(c,x,[y+v,P+_T12]),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],x=_ref127[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,v=_this$meshNode$attrib2.x,_T13=_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,x+_T13]),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],x=_ref132[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,v=_this$meshNode$attrib3.x,_T14=_this$meshNode$attrib3.y;this.meshCloud.skew(c,[p,y],[P+v,x+_T14]),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,x){if(i[P])return i[P];var v=e.ENV.loadImage(P,{alias:x,useImageBitmap:!1});return v!==null&&v!==void 0?v:P;}function o(_x20,_x21,_x22){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(P,x,v){var T,_P$attributes,_f13,g,u,m;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:T=x;typeof x=="string"&&(T=a(x));_context18.t0=T&&typeof T.then=="function";if(!_context18.t0){_context18.next=7;break;}_context18.next=6;return T;case 6:T=_context18.sent;case 7:if(!(x===P.attributes.texture)){_context18.next=11;break;}T&&T.image&&(T.sourceRect&&(P.attributes.sourceRect=T.sourceRect),P.textureImageRotated=!!T.rotated,T=T.image);_P$attributes=P.attributes,_f13=_P$attributes.width,g=_P$attributes.height,u=_P$attributes.textureRect,m=P.textureImage;P.textureImage=T,v&&m!==T&&!u&&(_f13==null||g==null)&&P.updateContours(),P.forceUpdate();case 11:return _context18.abrupt("return",T);case 12:case"end":return _context18.stop();}},_callee18);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function l(P,x){if(x[s]=x[s]||/* @__PURE__ */new Map(),x[s].has(P))return x[s].get(P);var v=x.createTexture(P);return!/^blob:/.test(P.src)&&typeof P.getContext!="function"&&x[s].set(P,v),v;}function d(P,x){if(x[s]&&x[s].has(P)){var v=x[s].get(P);return x.deleteTexture(v),x[s]["delete"](P),!0;}return!1;}var c=Symbol("textureContext");function p(P,x){var v=P.textureImage instanceof String?String(P.textureImage):P.textureImage,T=P.textureImageRotated,f=x.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 A=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=x.uniforms.u_texSampler),x.setTexture(A,{rect:m,repeat:M,srcRect:E,rotated:T}),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=x.uniforms.u_texSampler),x.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function y(_x23,_x24){return _y5.apply(this,arguments);}function _y5(){_y5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(P,x){var v,T;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_context19.t0=typeof x=="string";if(!_context19.t0){_context19.next=7;break;}_context19.next=4;return fetch(x,{method:"GET",mode:"cors",cache:"default"});case 4:_context19.next=6;return _context19.sent.json();case 6:x=_context19.sent;case 7:_context19.next=9;return a(P);case 9:v=_context19.sent;T=x.frames;return _context19.abrupt("return",(Object.entries(T).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 A=[u,m,M,E];var b=g.rotated;b&&(A=[A[0],A[1],A[3],A[2]]),i[f]={image:v,sourceRect:A,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,x,v){return x in P?Object.defineProperty(P,x,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[x]=v,P;}var p=Symbol("mesh");var y=/*#__PURE__*/function(_i$default2){function y(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);return _callSuper(this,y,[x]);}_inherits(y,_i$default2);return _createClass(y,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,x=_this$attributes2.paddingTop,v=_this$attributes2.paddingRight,T=_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,x+m+T+g];}// content + padding
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={},x="onreadystatechange",v,T,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=[],A=1;arguments.length>A;)E.push(arguments[A++]);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?(T=new c(),f=T.port2,T.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)):x in a("script")?v=function v(m){i.appendChild(a("script"))[x]=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,T;for(s&&(v=a.domain)&&v.exit();l;){T=l.fn,l=l.next;try{T();}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 x=o.resolve(void 0);c=function c(){x.then(p);};}else c=function c(){n.call(e,p);};return function(v){var T={fn:v,next:void 0};d&&(d.next=T),l||(l=T,c()),d=T;};};},/* 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=x,r.periodicity=v,r.calculateFramesOffset=T,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 x(){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),A=m-E*M;return A===0&&E>0&&(A=M,E--),[E,A];}function T(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 A=0,w=-1,O=0;O<m.length;O++){var L=m[O];if(L.offset!=null){var b=O-w;if(b>1)for(var I=(L.offset-A)/b,R=0;R<b-1;R++)m[w+R+1].offset=A+I*(R+1);A=L.offset,w=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 A=m.currentTime,w=M.direction,O=M.duration,L=!1;if(w==="reverse")E=1-E,L=!0;else if(w==="alternate"||w==="alternate-reverse"){var b=Math.floor(A/O);E===1&&b--,b%2^w==="alternate-reverse"&&(E=1-E,L=!0);}return{p:E,inverted:L};}function g(m,M,E,A){var w={};return(0,a["default"])(M).forEach(function(O){var L=(0,n["default"])(O,2),b=L[0],I=L[1];if(b!=="offset"&&b!=="easing"){var R=E[b]||E["default"],W=R(m[b],I,A,m.offset,M.offset);W!=null&&(w[b]=W);}}),w;}function u(m,M,E,A){var w=m.easing,O=m.effect;O||(E=(0,s["default"])({},y["default"],E));var L={};A=w(A,M);for(var b=1;b<M.length;b++){var I=M[b],R=I.offset;if(R>=A||b===M.length-1){var W=M[b-1],z=W.offset,K=W.easing,k=A;if(K){var q=R-z;k=K((A-z)/q)*q+z;}O?L=O(W,I,k,z,R):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,x){var v;return p==="url"||p==="drop-shadow"&&x===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],x=_ref119[1];_this29.meshCloud.mesh.setAttribute(P,x);});var y=this.uniforms;if(this.uniforms){var P={};Object.entries(y).forEach(function(_ref120){var _ref121=_slicedToArray(_ref120,2),x=_ref121[0],v=_ref121[1];typeof v=="function"&&(v=v(_this29,x)),P[x]=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 x=0;x<this[o];x++)if(!this.meshCloud.isPointCollision(x,[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 x=Math.PI*p/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,v=_this$meshNode$attrib.x,_T12=_this$meshNode$attrib.y;this.meshCloud.rotate(c,x,[y+v,P+_T12]),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],x=_ref127[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,v=_this$meshNode$attrib2.x,_T13=_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,x+_T13]),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],x=_ref132[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,v=_this$meshNode$attrib3.x,_T14=_this$meshNode$attrib3.y;this.meshCloud.skew(c,[p,y],[P+v,x+_T14]),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,x){if(i[P])return i[P];var v=e.ENV.loadImage(P,{alias:x,useImageBitmap:!1});return v!==null&&v!==void 0?v:P;}function o(_x20,_x21,_x22){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(P,x,v){var T,_P$attributes,_f13,g,u,m;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:T=x;typeof x=="string"&&(T=a(x));_context18.t0=T&&typeof T.then=="function";if(!_context18.t0){_context18.next=7;break;}_context18.next=6;return T;case 6:T=_context18.sent;case 7:if(!(x===P.attributes.texture)){_context18.next=11;break;}T&&T.image&&(T.sourceRect&&(P.attributes.sourceRect=T.sourceRect),P.textureImageRotated=!!T.rotated,T=T.image);_P$attributes=P.attributes,_f13=_P$attributes.width,g=_P$attributes.height,u=_P$attributes.textureRect,m=P.textureImage;P.textureImage=T,v&&m!==T&&!u&&(_f13==null||g==null)&&P.updateContours(),P.forceUpdate();case 11:return _context18.abrupt("return",T);case 12:case"end":return _context18.stop();}},_callee18);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function l(P,x){if(x[s]=x[s]||/* @__PURE__ */new Map(),x[s].has(P))return x[s].get(P);var v=x.createTexture(P);return!/^blob:/.test(P.src)&&typeof P.getContext!="function"&&x[s].set(P,v),v;}function d(P,x){if(x[s]&&x[s].has(P)){var v=x[s].get(P);return x.deleteTexture(v),x[s]["delete"](P),!0;}return!1;}var c=Symbol("textureContext");function p(P,x){var v=P.textureImage instanceof String?String(P.textureImage):P.textureImage,T=P.textureImageRotated,f=x.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 A=l(v,g);m?(m[0]+=u[0],m[1]+=u[1]):m=u;var w=null;f&&!g[s].has(f.image)&&(!f.options||!f.options.hidden)&&(w=x.uniforms.u_texSampler),x.setTexture(A,{rect:m,repeat:M,srcRect:E,rotated:T}),w&&w["delete"]&&w["delete"](),P[c]=g;}}else if(f){var _u8=null;!g[s].has(f.image)&&(!f.options||!f.options.hidden)&&(_u8=x.uniforms.u_texSampler),x.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function y(_x23,_x24){return _y5.apply(this,arguments);}function _y5(){_y5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(P,x){var v,T;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_context19.t0=typeof x=="string";if(!_context19.t0){_context19.next=7;break;}_context19.next=4;return fetch(x,{method:"GET",mode:"cors",cache:"default"});case 4:_context19.next=6;return _context19.sent.json();case 6:x=_context19.sent;case 7:_context19.next=9;return a(P);case 9:v=_context19.sent;T=x.frames;return _context19.abrupt("return",(Object.entries(T).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 A=[u,m,M,E];var w=g.rotated;w&&(A=[A[0],A[1],A[3],A[2]]),i[f]={image:v,sourceRect:A,rotated:w};}),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,x,v){return x in P?Object.defineProperty(P,x,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[x]=v,P;}var p=Symbol("mesh");var y=/*#__PURE__*/function(_i$default2){function y(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);return _callSuper(this,y,[x]);}_inherits(y,_i$default2);return _createClass(y,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,x=_this$attributes2.paddingTop,v=_this$attributes2.paddingRight,T=_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,x+m+T+g];}// content + padding
308
308
  },{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,x=_this$attributes3.paddingTop,v=_this$attributes3.paddingRight,T=_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,x+u+T];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,x=_this$attributes4.width,v=_this$attributes4.height,T=_this$attributes4.boxSizing,f=_this$attributes4.paddingTop,g=_this$attributes4.paddingRight,u=_this$attributes4.paddingBottom,m=_this$attributes4.paddingLeft;if(x=x||0,v=v||0,T==="border-box"){var M=2*this.attributes.borderWidth;x-=M+g+m,v-=M+f+u,x=Math.max(0,x),v=Math.max(0,v);}return[x,v];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),x=_this$borderSize[0],v=_this$borderSize[1];return x>0&&v>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var x=this.clientBox;if(x){var _v5;var v=this[p];if(v)v.box!==x&&(v.contours=x.contours,v.box=x);else{v=new n.Mesh2D(x),v.box=x;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 _T15=this.opacity;return v.getOpacity()!==_T15&&v.setOpacity(_T15),(_v5=v).setTransform.apply(_v5,_toConsumableArray(this.renderMatrix)),v;}return null;}// content + padding + border
309
309
  },{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,x=_this$attributes6.paddingTop,v=_this$attributes6.paddingRight,T=_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,x+m+T+M];}},{key:"originalClientRect",get:function get(){if(this.mesh){var x=this.mesh.boundingBox;return[x[0][0],x[0][1],x[1][0]-x[0][0],x[1][1]-x[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),x=_this$originalClientR[0],v=_this$originalClientR[1],T=_this$originalClientR[2],f=_this$originalClientR[3],g=this.attributes.padding;return[x+g[0],v+g[1],T-g[0]-g[2],f-g[1]-g[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var x=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(x=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,x));var v=null;if(this.mesh){v=_toConsumableArray(this.mesh.boundingBox);var _T16=this.attributes.borderWidth;_T16&&(v[0]=[v[0][0]-_T16,v[0][1]-_T16],v[1]=[v[1][0]+_T16,v[1][1]+_T16]);}return Object(d["default"])(v,x);}// transformPoint(x, y) {
310
310
  // const m = mat2d.invert(this.renderMatrix);
@@ -312,10 +312,10 @@ race:function race(tt){var J=this,ht=W(J),dt=ht.reject,B=v(function(){c(tt,!1,fu
312
312
  // const newY = x * m[1] + y * m[3] + m[5];
313
313
  // return [newX, newY];
314
314
  // }
315
- /* override */},{key:"onPropertyChange",value:function onPropertyChange(x,v,T){if(_superPropGet(y,"onPropertyChange",this,3)([x,v,T]),(x==="anchorX"||x==="anchorY"||x==="boxSizing"||x==="width"||x==="height"||x==="borderWidth"||x==="paddingLeft"||x==="paddingRight"||x==="paddingTop"||x==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(x))&&this.updateContours(),this[p]&&x==="clipPath"&&this[p].setClipPath(v),this[p]&&x==="bgcolor"&&Object(o.setFillColor)(this[p],{color:v}),this[p]&&(x==="borderColor"||x==="borderWidth"||x==="borderDash"||x==="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,x=_this$attributes8.anchorX,v=_this$attributes8.anchorY,T=_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*T,E=-x*m[0]+M,A=-v*m[1]+M;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[E,A,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 x=_ref138.offset,v=_ref138.color;return{offset:x,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 x=p.boundingBox[0];if(P.vector){var v=P.vector,_T17=P.colors;v.length===4?(v=[v[0]+x[0],v[1]+x[1],v[2]+x[0],v[3]+x[1]],p.setLinearGradient({vector:v,colors:_T17,type:y})):v.length===3?(v=[v[0]+x[0],v[1]+x[1],v[2]],p.setCircularGradient({vector:v,colors:_T17,type:y})):(v=[v[0]+x[0],v[1]+x[1],v[2],v[3]+x[0],v[4]+x[1],v[5]],p.setRadialGradient({vector:v,colors:_T17,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,x=_ref140.lineCap,v=_ref140.lineJoin,T=_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:x,join:v,miterLimit:g,lineDash:T,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 x=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],x=_y7[2],v=_y7[3],_y6),typeof y=="string"&&(_n2=n()(y),_n3=_slicedToArray(_n2,4),y=_n3[0],P=_n3[1],x=_n3[2],v=_n3[3],y/=255,P/=255,x/=255),_this31=_callSuper(this,c,[y,P,x,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),x="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(x).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,x=o+l,v=a+s/2,T=o+l/2;d==="leftTop"?(i.moveTo(a,T),i.bezierCurveTo(a,T-y,v-p,o,v,o)):d==="rightTop"?i.bezierCurveTo(v+p,o,P,T-y,P,T):d==="rightBottom"?i.bezierCurveTo(P,T+y,v+p,x,v,x):d==="leftBottom"&&i.bezierCurveTo(v-p,x,a,T+y,a,T);}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],x=_d$map2[4],v=_d$map2[5],_T18=_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-x*2,o+l-v*2,x*2,v*2,"rightBottom"),i.lineTo(a+_T18,o+l),e(i,a,o+l-_f16*2,_T18*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],x=i*n[0]+s*n[2]+n[4],v=i*n[1]+s*n[3]+n[5],T=Math.min(l,c,y,x),f=Math.min(d,p,P,v),g=Math.max(l,c,y,x),u=Math.max(d,p,P,v);return{x:T,y:f,width:g-T,height:u-f,left:T,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 x=this.textureImage,v=this.attributes.textureRect,_T19=this.attributes.sourceRect;if(v)y==null&&(c=v[0]+v[2]),P==null&&(p=v[1]+v[3]);else if(_T19){var _f17=this.layer?this.layer.displayRatio:1;y==null&&(c=_T19[2]/_f17),P==null&&(p=_T19[3]/_f17);}else if(x){var _f18=this.layer?this.layer.displayRatio:1;y==null&&(c=x.width/_f18),P==null&&(p=x.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,x=_this$attributes10.height;(P==null||x==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(x,v,T){return v in x?Object.defineProperty(x,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[v]=T,x;}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(T,f,g,u,m){var _i$a;var M=(g-u)/(m-u);if(M<=0)return T;if(M>=1)return f;var E=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(f)),A=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(E).concat([M]))[0];return A.reduce(function(O,L){return"".concat(O).concat(L.slice(2).join(" ")," ");},"M".concat(A[0][0]," ").concat(A[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 _T21;var _T20=this[y];if(_T20)_T20.path!==v&&(_T20.contours=v.contours,_T20.path=v);else{_T20=new e.Mesh2D(this.path),_T20.path=v;var g=this.attributes.fillColor,u=this.attributes.fillRule;g&&Object(s.setFillColor)(_T20,{color:g,rule:u});var m=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&m>0){var _this$attributes11=this.attributes,A=_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)(_T20,{color:M,lineWidth:m,lineCap:A,lineJoin:b,miterLimit:O,lineDash:L,lineDashOffset:w,roundSegments:I});}this[y]=_T20;var E=this.attributes.clipPath;E&&this[y].setClipPath(E);}var _f19=this.opacity;return _T20.getOpacity()!==_f19&&_T20.setOpacity(_f19),(_T21=_T20).setTransform.apply(_T21,_toConsumableArray(this.renderMatrix)),_T20;}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 T=this.mesh;return T&&Object(l.drawTexture)(this,T),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 _T22=this.mesh.getPointAtLength(v);if(_T22)return[_T22.x,_T22.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,T,f){if(_superPropGet(P,"onPropertyChange",this,3)([v,T,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,A=_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:A,miterLimit:b,roundSegments:O});}}this[y]&&v==="clipPath"&&this[y].setClipPath(T),v==="texture"&&Object(l.applyTexture)(this,T);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);p(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 R=[],W=!0,z=!1,K=void 0;try{for(var k=w[Symbol.iterator](),q;!(W=(q=k.next()).done)&&(R.push(q.value),!(I&&R.length===I));W=!0);}catch(U){z=!0,K=U;}finally{try{!W&&k["return"]&&k["return"]();}finally{if(z)throw K;}}return R;}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,R,W,z,K,k){var q=w.x,U=w.y;q*=I,U*=R;var G=W*q-z*U,Z=z*q+W*U;return{x:G+K,y:Z+k};},a=function a(w,I){var R=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*R,y:z+W*R},{x:K+k*R,y:k-K*R},{x:K,y:k}];},o=function o(w,I,R,W){var z=w*W-I*R<0?-1:1,K=Math.sqrt(w*w+I*I),k=Math.sqrt(w*w+I*I),q=w*R+I*W,U=q/(K*k);return U>1&&(U=1),U<-1&&(U=-1),z*Math.acos(U);},s=function s(w,I,R,W,z,K,k,q,U,G,Z,nt){var rt=Math.pow(z,2),tt=Math.pow(K,2),J=Math.pow(Z,2),ht=Math.pow(nt,2),dt=rt*tt-rt*ht-tt*J;dt<0&&(dt=0),dt/=rt*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+R)/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,R=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,rt=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*(R-z)/2,B=-J*(I-W)/2+ht*(R-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,R,W,z,K,k,Z,rt,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,lt=i(H[2],K,k,ht,J,N,$),ot=lt.x,ft=lt.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/**
315
+ /* override */},{key:"onPropertyChange",value:function onPropertyChange(x,v,T){if(_superPropGet(y,"onPropertyChange",this,3)([x,v,T]),(x==="anchorX"||x==="anchorY"||x==="boxSizing"||x==="width"||x==="height"||x==="borderWidth"||x==="paddingLeft"||x==="paddingRight"||x==="paddingTop"||x==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(x))&&this.updateContours(),this[p]&&x==="clipPath"&&this[p].setClipPath(v),this[p]&&x==="bgcolor"&&Object(o.setFillColor)(this[p],{color:v}),this[p]&&(x==="borderColor"||x==="borderWidth"||x==="borderDash"||x==="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,x=_this$attributes8.anchorX,v=_this$attributes8.anchorY,T=_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*T,E=-x*m[0]+M,A=-v*m[1]+M;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[E,A,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 x=_ref138.offset,v=_ref138.color;return{offset:x,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 x=p.boundingBox[0];if(P.vector){var v=P.vector,_T17=P.colors;v.length===4?(v=[v[0]+x[0],v[1]+x[1],v[2]+x[0],v[3]+x[1]],p.setLinearGradient({vector:v,colors:_T17,type:y})):v.length===3?(v=[v[0]+x[0],v[1]+x[1],v[2]],p.setCircularGradient({vector:v,colors:_T17,type:y})):(v=[v[0]+x[0],v[1]+x[1],v[2],v[3]+x[0],v[4]+x[1],v[5]],p.setRadialGradient({vector:v,colors:_T17,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,x=_ref140.lineCap,v=_ref140.lineJoin,T=_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:x,join:v,miterLimit:g,lineDash:T,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 x=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],x=_y7[2],v=_y7[3],_y6),typeof y=="string"&&(_n2=n()(y),_n3=_slicedToArray(_n2,4),y=_n3[0],P=_n3[1],x=_n3[2],v=_n3[3],y/=255,P/=255,x/=255),_this31=_callSuper(this,c,[y,P,x,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),x="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(x).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,x=o+l,v=a+s/2,T=o+l/2;d==="leftTop"?(i.moveTo(a,T),i.bezierCurveTo(a,T-y,v-p,o,v,o)):d==="rightTop"?i.bezierCurveTo(v+p,o,P,T-y,P,T):d==="rightBottom"?i.bezierCurveTo(P,T+y,v+p,x,v,x):d==="leftBottom"&&i.bezierCurveTo(v-p,x,a,T+y,a,T);}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],x=_d$map2[4],v=_d$map2[5],_T18=_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-x*2,o+l-v*2,x*2,v*2,"rightBottom"),i.lineTo(a+_T18,o+l),e(i,a,o+l-_f16*2,_T18*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],x=i*n[0]+s*n[2]+n[4],v=i*n[1]+s*n[3]+n[5],T=Math.min(l,c,y,x),f=Math.min(d,p,P,v),g=Math.max(l,c,y,x),u=Math.max(d,p,P,v);return{x:T,y:f,width:g-T,height:u-f,left:T,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 x=this.textureImage,v=this.attributes.textureRect,_T19=this.attributes.sourceRect;if(v)y==null&&(c=v[0]+v[2]),P==null&&(p=v[1]+v[3]);else if(_T19){var _f17=this.layer?this.layer.displayRatio:1;y==null&&(c=_T19[2]/_f17),P==null&&(p=_T19[3]/_f17);}else if(x){var _f18=this.layer?this.layer.displayRatio:1;y==null&&(c=x.width/_f18),P==null&&(p=x.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,x=_this$attributes10.height;(P==null||x==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(x,v,T){return v in x?Object.defineProperty(x,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[v]=T,x;}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(T,f,g,u,m){var _i$a;var M=(g-u)/(m-u);if(M<=0)return T;if(M>=1)return f;var E=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(f)),A=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(E).concat([M]))[0];return A.reduce(function(O,L){return"".concat(O).concat(L.slice(2).join(" ")," ");},"M".concat(A[0][0]," ").concat(A[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 _T21;var _T20=this[y];if(_T20)_T20.path!==v&&(_T20.contours=v.contours,_T20.path=v);else{_T20=new e.Mesh2D(this.path),_T20.path=v;var g=this.attributes.fillColor,u=this.attributes.fillRule;g&&Object(s.setFillColor)(_T20,{color:g,rule:u});var m=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&m>0){var _this$attributes11=this.attributes,A=_this$attributes11.lineCap,w=_this$attributes11.lineJoin,O=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,b=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_T20,{color:M,lineWidth:m,lineCap:A,lineJoin:w,miterLimit:O,lineDash:L,lineDashOffset:b,roundSegments:I});}this[y]=_T20;var E=this.attributes.clipPath;E&&this[y].setClipPath(E);}var _f19=this.opacity;return _T20.getOpacity()!==_f19&&_T20.setOpacity(_f19),(_T21=_T20).setTransform.apply(_T21,_toConsumableArray(this.renderMatrix)),_T20;}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 T=this.mesh;return T&&Object(l.drawTexture)(this,T),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 _T22=this.mesh.getPointAtLength(v);if(_T22)return[_T22.x,_T22.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,T,f){if(_superPropGet(P,"onPropertyChange",this,3)([v,T,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,A=_this$attributes14.lineDashOffset,w=_this$attributes14.miterLimit,O=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[y],{color:_g4,lineCap:m,lineJoin:M,lineWidth:_u9,lineDash:E,lineDashOffset:A,miterLimit:w,roundSegments:O});}}this[y]&&v==="clipPath"&&this[y].setClipPath(T),v==="texture"&&Object(l.applyTexture)(this,T);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);p(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(b,I){var R=[],W=!0,z=!1,K=void 0;try{for(var k=b[Symbol.iterator](),q;!(W=(q=k.next()).done)&&(R.push(q.value),!(I&&R.length===I));W=!0);}catch(U){z=!0,K=U;}finally{try{!W&&k["return"]&&k["return"]();}finally{if(z)throw K;}}return R;}return function(b,I){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return L(b,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(b,I,R,W,z,K,k){var q=b.x,U=b.y;q*=I,U*=R;var G=W*q-z*U,Z=z*q+W*U;return{x:G+K,y:Z+k};},a=function a(b,I){var R=1.3333333333333333*Math.tan(I/4),W=Math.cos(b),z=Math.sin(b),K=Math.cos(b+I),k=Math.sin(b+I);return[{x:W-z*R,y:z+W*R},{x:K+k*R,y:k-K*R},{x:K,y:k}];},o=function o(b,I,R,W){var z=b*W-I*R<0?-1:1,K=Math.sqrt(b*b+I*I),k=Math.sqrt(b*b+I*I),q=b*R+I*W,U=q/(K*k);return U>1&&(U=1),U<-1&&(U=-1),z*Math.acos(U);},s=function s(b,I,R,W,z,K,k,q,U,G,Z,nt){var rt=Math.pow(z,2),tt=Math.pow(K,2),J=Math.pow(Z,2),ht=Math.pow(nt,2),dt=rt*tt-rt*ht-tt*J;dt<0&&(dt=0),dt/=rt*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+(b+R)/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(b){var I=b.px,R=b.py,W=b.cx,z=b.cy,K=b.rx,k=b.ry,q=b.xAxisRotation,U=q===void 0?0:q,G=b.largeArcFlag,Z=G===void 0?0:G,nt=b.sweepFlag,rt=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*(R-z)/2,B=-J*(I-W)/2+ht*(R-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,R,W,z,K,k,Z,rt,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,lt=i(H[2],K,k,ht,J,N,$),at=lt.x,ft=lt.y;return{x1:Q,y1:it,x2:ct,y2:gt,x:at,y:ft};});},d={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
316
316
  * segment pattern
317
317
  * @type {RegExp}
318
- */},c=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function p(L){var w=[];return L.replace(c,function(I,R,W){var z=R.toLowerCase();for(W=P(W),z=="m"&&W.length>2&&(w.push([R].concat(W.splice(0,2))),z="l",R=R=="m"?"l":"L");;){if(W.length==d[z])return W.unshift(R),w.push(W);if(W.length<d[z])throw new Error("malformed path data");w.push([R].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 x(L){var w=L[0][0],I=L[0][1],R=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],rt=z[7];w=Math.min(w,K,k,q,U),I=Math.min(I,G,Z,nt,rt),R=Math.max(R,K,k,q,U),W=Math.max(W,G,Z,nt,rt);}),[w,I,R,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 T(L,w){var I=L[0],R=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],rt=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-R,2)+Math.pow(J-k,2))+Math.sqrt(Math.pow(nt-W,2)+Math.pow(ht-q,2))+Math.sqrt(Math.pow(rt-z,2)+Math.pow(dt-U,2));}function f(L,w){var I=u(L.length),R=[];I.forEach(function(z){var K=0,k=0;z.forEach(function(q){K+=T(L[q],w[k++]);}),R.push({index:z,distance:K});}),R.sort(function(z,K){return z.distance-K.distance;});var W=[];return R[0].index.forEach(function(z){W.push(L[z]);}),W;}function g(L,w){var I=m(L.length),R=[];I.forEach(function(z){var K=0;z.forEach(function(k){K+=v(x(L[k]),x(w[k]));}),R.push({index:z,distance:K});}),R.sort(function(z,K){return z.distance-K.distance;});var W=[];return R[0].index.forEach(function(z){W.push(L[z]);}),W;}function u(L){for(var w=[],I=0;I<L;I++){for(var R=[],W=0;W<L;W++){var z=W+I;z>L-1&&(z-=L),R[z]=W;}w.push(R);}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 R(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()),R(W),W.splice(z,0,K),I.pop();return w;}return R(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,R,W){return[L+(I-L)*W,w+(R-w)*W];},E.q2b=function(L,w,I,R,W,z){return[L,w,(L+2*I)/3,(w+2*R)/3,(W+2*I)/3,(z+2*R)/3,W,z];},E.path2shapes=function(L){for(var w=E.parser(L),I=0,R=0,W=0,z=w.length,K=[],k=null,q=void 0,U=void 0,G=void 0,Z=void 0,nt=void 0,rt=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],R=R+J[2];break;case"M":nt=K.length,K[nt]=[],k=K[nt],I=J[1],R=J[2];break;case"l":k.push([I,R,I,R,I,R,I+J[1],R+J[2]]),I+=J[1],R+=J[2];break;case"L":k.push([I,R,J[1],J[2],J[1],J[2],J[1],J[2]]),I=J[1],R=J[2];break;case"h":k.push([I,R,I,R,I,R,I+J[1],R]),I+=J[1];break;case"H":k.push([I,R,J[1],R,J[1],R,J[1],R]),I=J[1];break;case"v":k.push([I,R,I,R,I,R,I,R+J[1]]),R+=J[1];break;case"V":k.push([I,R,I,J[1],I,J[1],I,J[1]]),R=J[1];break;case"C":k.push([I,R,J[1],J[2],J[3],J[4],J[5],J[6]]),I=J[5],R=J[6];break;case"S":dt[0]==="C"||dt[0]==="c"?k.push([I,R,I+dt[5]-dt[3],R+dt[6]-dt[4],J[1],J[2],J[3],J[4]]):(dt[0]==="S"||dt[0]==="s")&&k.push([I,R,I+dt[3]-dt[1],R+dt[4]-dt[2],J[1],J[2],J[3],J[4]]),I=J[3],R=J[4];break;case"c":k.push([I,R,I+J[1],R+J[2],I+J[3],R+J[4],I+J[5],R+J[6]]),I=I+J[5],R=R+J[6];break;case"s":dt[0]==="C"||dt[0]==="c"?k.push([I,R,I+dt[5]-dt[3],R+dt[6]-dt[4],I+J[1],R+J[2],I+J[3],R+J[4]]):(dt[0]==="S"||dt[0]==="s")&&k.push([I,R,I+dt[3]-dt[1],R+dt[4]-dt[2],I+J[1],R+J[2],I+J[3],R+J[4]]),I=I+J[3],R=R+J[4];break;case"a":rt=l({rx:J[1],ry:J[2],px:I,py:R,xAxisRotation:J[3],largeArcFlag:J[4],sweepFlag:J[5],cx:I+J[6],cy:R+J[7]}),tt=rt[rt.length-1],rt.forEach(function(B,F){F===0?k.push([I,R,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):k.push([rt[F-1].x,rt[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),I=tt.x,R=tt.y;break;case"A":rt=l({rx:J[1],ry:J[2],px:I,py:R,xAxisRotation:J[3],largeArcFlag:J[4],sweepFlag:J[5],cx:J[6],cy:J[7]}),tt=rt[rt.length-1],rt.forEach(function(B,F){F===0?k.push([I,R,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):k.push([rt[F-1].x,rt[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),I=tt.x,R=tt.y;break;case"Q":k.push(E.q2b(I,R,J[1],J[2],J[3],J[4])),I=J[3],R=J[4];break;case"q":k.push(E.q2b(I,R,I+J[1],R+J[2],J[3]+I,J[4]+R)),I+=J[3],R+=J[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?(G=I+dt[3]-dt[1],Z=R+dt[4]-dt[2],k.push(E.q2b(I,R,G,Z,J[1],J[2]))):(dt[0]==="T"||dt[0]==="t")&&(k.push(E.q2b(I,R,I+I-G,R+R-Z,J[1],J[2])),G=I+I-G,Z=R+R-Z),I=J[1],R=J[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?(G=I+dt[3]-dt[1],Z=R+dt[4]-dt[2],k.push(E.q2b(I,R,G,Z,I+J[1],R+J[2]))):(dt[0]==="T"||dt[0]==="t")&&(k.push(E.q2b(I,R,I+I-G,R+R-Z,I+J[1],R+J[2])),G=I+I-G,Z=R+R-Z),I+=J[1],R+=J[2];break;case"Z":q=k[0][0],U=k[0][1],k.push([I,R,q,U,q,U,q,U]);break;case"z":q=k[0][0],U=k[0][1],k.push([I,R,q,U,q,U,q,U]);break;}}return K;},E._upCurves=function(L,w){for(var I=0,R=0,W=L.length;I<w;I++)L.push(L[R].slice(0)),R++,R>W-1&&(R-=W);};function A(L,w,I,R,W,z,K,k,q){return{left:b(L,w,I,R,W,z,K,k,q),right:b(K,k,W,z,I,R,L,w,1-q,!0)};}function b(L,w,I,R,W,z,K,k,q,U){var G=(I-L)*q+L,Z=(R-w)*q+w,nt=(W-I)*q+I,rt=(z-R)*q+R,tt=(K-W)*q+W,J=(k-z)*q+z,ht=(nt-G)*q+G,dt=(rt-Z)*q+Z,B=(tt-nt)*q+nt,F=(J-rt)*q+rt,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,R=0;I<w;I++){var W=L[R],z=A(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],0.5);L.splice(R,1),L.splice(R,0,z.left,z.right),R+=2,R>=L.length-1&&(R=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);},R=0;R<w;R++)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,R=w.length,W=JSON.parse(JSON.stringify(L)),z=JSON.parse(JSON.stringify(w));return I>R?O(z,I-R):I<R&&O(W,R-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 R=[];return L.forEach(function(W,z){var K=[];W.forEach(function(k,q){K.push(E.lerpCurve(k,w[z][q],I));}),R.push(K);}),R;},E.animate=function(L){var w=E.path2shapes(L.from),I=E.path2shapes(L.to),R=E._preprocessing(w,I),W=/* @__PURE__ */new Date(),z=L.end||function(){},K=L.progress||function(){},k=L.begin||function(){},q=L.easing||function(rt){return rt;},U=null,G=null,Z=L.time;k(w);var nt=function rt(){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(R[0],R[1],J),K(G,J),U=requestAnimationFrame(rt);};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'
318
+ */},c=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function p(L){var b=[];return L.replace(c,function(I,R,W){var z=R.toLowerCase();for(W=P(W),z=="m"&&W.length>2&&(b.push([R].concat(W.splice(0,2))),z="l",R=R=="m"?"l":"L");;){if(W.length==d[z])return W.unshift(R),b.push(W);if(W.length<d[z])throw new Error("malformed path data");b.push([R].concat(W.splice(0,d[z])));}}),b;}var y=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function P(L){var b=L.match(y);return b?b.map(Number):[];}function x(L){var b=L[0][0],I=L[0][1],R=b,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],rt=z[7];b=Math.min(b,K,k,q,U),I=Math.min(I,G,Z,nt,rt),R=Math.max(R,K,k,q,U),W=Math.max(W,G,Z,nt,rt);}),[b,I,R,W];}function v(L,b){return Math.sqrt(Math.pow(L[0]-b[0],2)+Math.pow(L[1]-b[1],2))+Math.sqrt(Math.pow(L[2]-b[2],2)+Math.pow(L[3]-b[3],2));}function T(L,b){var I=L[0],R=L[2],W=L[4],z=L[6],K=L[1],k=L[3],q=L[5],U=L[7],G=b[0],Z=b[2],nt=b[4],rt=b[6],tt=b[1],J=b[3],ht=b[5],dt=b[7];return Math.sqrt(Math.pow(G-I,2)+Math.pow(tt-K,2))+Math.sqrt(Math.pow(Z-R,2)+Math.pow(J-k,2))+Math.sqrt(Math.pow(nt-W,2)+Math.pow(ht-q,2))+Math.sqrt(Math.pow(rt-z,2)+Math.pow(dt-U,2));}function f(L,b){var I=u(L.length),R=[];I.forEach(function(z){var K=0,k=0;z.forEach(function(q){K+=T(L[q],b[k++]);}),R.push({index:z,distance:K});}),R.sort(function(z,K){return z.distance-K.distance;});var W=[];return R[0].index.forEach(function(z){W.push(L[z]);}),W;}function g(L,b){var I=m(L.length),R=[];I.forEach(function(z){var K=0;z.forEach(function(k){K+=v(x(L[k]),x(b[k]));}),R.push({index:z,distance:K});}),R.sort(function(z,K){return z.distance-K.distance;});var W=[];return R[0].index.forEach(function(z){W.push(L[z]);}),W;}function u(L){for(var b=[],I=0;I<L;I++){for(var R=[],W=0;W<L;W++){var z=W+I;z>L-1&&(z-=L),R[z]=W;}b.push(R);}return b;}function m(L){for(var b=[],I=0;I<L;I++)b.push(I);return M(b);}function M(L){var b=[],I=[];function R(W){var z,K;for(z=0;z<W.length;z++)K=W.splice(z,1)[0],I.push(K),W.length==0&&b.push(I.slice()),R(W),W.splice(z,0,K),I.pop();return b;}return R(L);}var E={};E.parser=p,E.lerpCurve=function(L,b,I){return E.lerpPoints(L[0],L[1],b[0],b[1],I).concat(E.lerpPoints(L[2],L[3],b[2],b[3],I)).concat(E.lerpPoints(L[4],L[5],b[4],b[5],I)).concat(E.lerpPoints(L[6],L[7],b[6],b[7],I));},E.lerpPoints=function(L,b,I,R,W){return[L+(I-L)*W,b+(R-b)*W];},E.q2b=function(L,b,I,R,W,z){return[L,b,(L+2*I)/3,(b+2*R)/3,(W+2*I)/3,(z+2*R)/3,W,z];},E.path2shapes=function(L){for(var b=E.parser(L),I=0,R=0,W=0,z=b.length,K=[],k=null,q=void 0,U=void 0,G=void 0,Z=void 0,nt=void 0,rt=void 0,tt=void 0;W<z;W++){var J=b[W],ht=J[0],dt=b[W-1];switch(ht){case"m":nt=K.length,K[nt]=[],k=K[nt],I=I+J[1],R=R+J[2];break;case"M":nt=K.length,K[nt]=[],k=K[nt],I=J[1],R=J[2];break;case"l":k.push([I,R,I,R,I,R,I+J[1],R+J[2]]),I+=J[1],R+=J[2];break;case"L":k.push([I,R,J[1],J[2],J[1],J[2],J[1],J[2]]),I=J[1],R=J[2];break;case"h":k.push([I,R,I,R,I,R,I+J[1],R]),I+=J[1];break;case"H":k.push([I,R,J[1],R,J[1],R,J[1],R]),I=J[1];break;case"v":k.push([I,R,I,R,I,R,I,R+J[1]]),R+=J[1];break;case"V":k.push([I,R,I,J[1],I,J[1],I,J[1]]),R=J[1];break;case"C":k.push([I,R,J[1],J[2],J[3],J[4],J[5],J[6]]),I=J[5],R=J[6];break;case"S":dt[0]==="C"||dt[0]==="c"?k.push([I,R,I+dt[5]-dt[3],R+dt[6]-dt[4],J[1],J[2],J[3],J[4]]):(dt[0]==="S"||dt[0]==="s")&&k.push([I,R,I+dt[3]-dt[1],R+dt[4]-dt[2],J[1],J[2],J[3],J[4]]),I=J[3],R=J[4];break;case"c":k.push([I,R,I+J[1],R+J[2],I+J[3],R+J[4],I+J[5],R+J[6]]),I=I+J[5],R=R+J[6];break;case"s":dt[0]==="C"||dt[0]==="c"?k.push([I,R,I+dt[5]-dt[3],R+dt[6]-dt[4],I+J[1],R+J[2],I+J[3],R+J[4]]):(dt[0]==="S"||dt[0]==="s")&&k.push([I,R,I+dt[3]-dt[1],R+dt[4]-dt[2],I+J[1],R+J[2],I+J[3],R+J[4]]),I=I+J[3],R=R+J[4];break;case"a":rt=l({rx:J[1],ry:J[2],px:I,py:R,xAxisRotation:J[3],largeArcFlag:J[4],sweepFlag:J[5],cx:I+J[6],cy:R+J[7]}),tt=rt[rt.length-1],rt.forEach(function(B,F){F===0?k.push([I,R,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):k.push([rt[F-1].x,rt[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),I=tt.x,R=tt.y;break;case"A":rt=l({rx:J[1],ry:J[2],px:I,py:R,xAxisRotation:J[3],largeArcFlag:J[4],sweepFlag:J[5],cx:J[6],cy:J[7]}),tt=rt[rt.length-1],rt.forEach(function(B,F){F===0?k.push([I,R,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):k.push([rt[F-1].x,rt[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),I=tt.x,R=tt.y;break;case"Q":k.push(E.q2b(I,R,J[1],J[2],J[3],J[4])),I=J[3],R=J[4];break;case"q":k.push(E.q2b(I,R,I+J[1],R+J[2],J[3]+I,J[4]+R)),I+=J[3],R+=J[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?(G=I+dt[3]-dt[1],Z=R+dt[4]-dt[2],k.push(E.q2b(I,R,G,Z,J[1],J[2]))):(dt[0]==="T"||dt[0]==="t")&&(k.push(E.q2b(I,R,I+I-G,R+R-Z,J[1],J[2])),G=I+I-G,Z=R+R-Z),I=J[1],R=J[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?(G=I+dt[3]-dt[1],Z=R+dt[4]-dt[2],k.push(E.q2b(I,R,G,Z,I+J[1],R+J[2]))):(dt[0]==="T"||dt[0]==="t")&&(k.push(E.q2b(I,R,I+I-G,R+R-Z,I+J[1],R+J[2])),G=I+I-G,Z=R+R-Z),I+=J[1],R+=J[2];break;case"Z":q=k[0][0],U=k[0][1],k.push([I,R,q,U,q,U,q,U]);break;case"z":q=k[0][0],U=k[0][1],k.push([I,R,q,U,q,U,q,U]);break;}}return K;},E._upCurves=function(L,b){for(var I=0,R=0,W=L.length;I<b;I++)L.push(L[R].slice(0)),R++,R>W-1&&(R-=W);};function A(L,b,I,R,W,z,K,k,q){return{left:w(L,b,I,R,W,z,K,k,q),right:w(K,k,W,z,I,R,L,b,1-q,!0)};}function w(L,b,I,R,W,z,K,k,q,U){var G=(I-L)*q+L,Z=(R-b)*q+b,nt=(W-I)*q+I,rt=(z-R)*q+R,tt=(K-W)*q+W,J=(k-z)*q+z,ht=(nt-G)*q+G,dt=(rt-Z)*q+Z,B=(tt-nt)*q+nt,F=(J-rt)*q+rt,Y=(B-ht)*q+ht,X=(F-dt)*q+dt;return U?[Y,X,ht,dt,G,Z,L,b]:[L,b,G,Z,ht,dt,Y,X];}E._splitCurves=function(L,b){for(var I=0,R=0;I<b;I++){var W=L[R],z=A(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],0.5);L.splice(R,1),L.splice(R,0,z.left,z.right),R+=2,R>=L.length-1&&(R=0);}};function O(L,b){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);},R=0;R<b;R++)I();}return E.lerp=function(L,b,I){return E._lerp(E.path2shapes(L),E.path2shapes(b),I);},E.MIM_CURVES_COUNT=100,E._preprocessing=function(L,b){var I=L.length,R=b.length,W=JSON.parse(JSON.stringify(L)),z=JSON.parse(JSON.stringify(b));return I>R?O(z,I-R):I<R&&O(W,R-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,b,I){var R=[];return L.forEach(function(W,z){var K=[];W.forEach(function(k,q){K.push(E.lerpCurve(k,b[z][q],I));}),R.push(K);}),R;},E.animate=function(L){var b=E.path2shapes(L.from),I=E.path2shapes(L.to),R=E._preprocessing(b,I),W=/* @__PURE__ */new Date(),z=L.end||function(){},K=L.progress||function(){},k=L.begin||function(){},q=L.easing||function(rt){return rt;},U=null,G=null,Z=L.time;k(b);var nt=function rt(){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(R[0],R[1],J),K(G,J),U=requestAnimationFrame(rt);};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
319
  lineCap:"butt",// 'butt' or 'square' or 'round'
320
320
  roundSegments:20,// default roundSegment if lineJoin or lineCap is round
321
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
@@ -337,22 +337,22 @@ closeType:"none"// none | sector | normal
337
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
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,x=p.startAngle,v=p.endAngle;var T=new e.Figure2D();if(x=Math.PI*x/180,v=Math.PI*v/180,y>P&&(_ref145=[P,y],y=_ref145[0],P=_ref145[1],_ref145),y<=0&&T.moveTo(0,0),T.arc(0,0,P,x,v,!1),y>0){var u=Math.PI*2;v<x&&(v=x+u+(v-x)%u),v-x>=u&&(v=x+u-1e-6),T.arc(0,0,y,v,x,!0);}return T.closePath(),T.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
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(x,v,T){return v in x?Object.defineProperty(x,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[v]=T,x;}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],T=_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&&(T=u.rect[3]));}return[v,T];}},{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 T=this.mesh;if(T){var _f22=this[l];if(_f22){var g=T.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=T.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],A=this.attributes.textAlign,b=this.attributes.verticalAlign;var O=0;A==="center"?O=(M-u)/2:(A==="right"||A==="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,R=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,z=this.attributes.borderWidth;O+=R+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,T.setTexture(g,{rect:[O,I,u,m]}),this[p]=!1,this[c]=this.renderer;}}}return v;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,T,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,T,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,T=_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:T,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,x=this.fontWeight,v=this.fontStretch,T=this.fontSize,f=this.lineHeight,g=this.fontFamily;return"".concat(y," ").concat(P," ").concat(x," ").concat(v," ").concat(T,"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,x,v){return x in P?Object.defineProperty(P,x,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[x]=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 x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);_this47=_callSuper(this,y,[x]),_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(x,v){return x.zIndex-v.zIndex||x.zOrder-v.zOrder;})),this[d];}},{key:"append",value:function append(){var _this48=this;for(var _len12=arguments.length,x=new Array(_len12),_key12=0;_key12<_len12;_key12++){x[_key12]=arguments[_key12];}return x.map(function(v){return _this48.appendChild(v);});}},{key:"appendChild",value:function appendChild(x){return x.remove(),this[c].push(x),x.connect(this,this[l]++),this[d]&&(this[d].length&&x.zIndex<this[d][this[d].length-1].zIndex?this.reorder():this[d].push(x)),x;}/* override */// get isVisible() {
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(x,v,T){return v in x?Object.defineProperty(x,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[v]=T,x;}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],T=_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&&(T=u.rect[3]));}return[v,T];}},{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 T=this.mesh;if(T){var _f22=this[l];if(_f22){var g=T.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=T.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],A=this.attributes.textAlign,w=this.attributes.verticalAlign;var O=0;A==="center"?O=(M-u)/2:(A==="right"||A==="end")&&(O=M-u);var L=this.attributes.fontSize,b=this.attributes.lineHeight;var I=0;w==="top"?I=(L-b)/2:w==="bottom"&&(I=(b-L)/2);var _this$attributes19=this.attributes,R=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,z=this.attributes.borderWidth;O+=R+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,T.setTexture(g,{rect:[O,I,u,m]}),this[p]=!1,this[c]=this.renderer;}}}return v;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(v,T,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,T,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,T=_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:T,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,x=this.fontWeight,v=this.fontStretch,T=this.fontSize,f=this.lineHeight,g=this.fontFamily;return"".concat(y," ").concat(P," ").concat(x," ").concat(v," ").concat(T,"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,x,v){return x in P?Object.defineProperty(P,x,{value:v,enumerable:!0,configurable:!0,writable:!0}):P[x]=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 x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);_this47=_callSuper(this,y,[x]),_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(x,v){return x.zIndex-v.zIndex||x.zOrder-v.zOrder;})),this[d];}},{key:"append",value:function append(){var _this48=this;for(var _len12=arguments.length,x=new Array(_len12),_key12=0;_key12<_len12;_key12++){x[_key12]=arguments[_key12];}return x.map(function(v){return _this48.appendChild(v);});}},{key:"appendChild",value:function appendChild(x){return x.remove(),this[c].push(x),x.connect(this,this[l]++),this[d]&&(this[d].length&&x.zIndex<this[d][this[d].length-1].zIndex?this.reorder():this[d].push(x)),x;}/* override */// get isVisible() {
341
341
  // return this.attributes.opacity > 0 && this[_children].length > 0;
342
342
  // }
343
- /* override */},{key:"cloneNode",value:function cloneNode(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var v=_superPropGet(y,"cloneNode",this,3)([]);return x&&this[c].forEach(function(T){var f=T.cloneNode(x);v.appendChild(f);}),v;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(x){var v=this.orderedChildren;for(var _T25=v.length-1;_T25>=0;_T25--)if(v[_T25].dispatchPointerEvent(x))return!0;return _superPropGet(y,"dispatchPointerEvent",this,3)([x]);}/* override */},{key:"draw",value:function draw(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(y,"draw",this,3)([x]),!this[p]&&this.attributes.display!=="none"){var v=this.orderedChildren;for(var _T26=0;_T26<v.length;_T26++)v[_T26].draw(x);}return this.__cacheRenderMatrix=null,x;}},{key:"getElementById",value:function getElementById(x){return Object(o.querySelector)("#".concat(x),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(x){return Object(o.querySelectorAll)(".".concat(x),this);}},{key:"getElementsByName",value:function getElementsByName(x){return Object(o.querySelectorAll)("[name=\"".concat(x,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(x){return Object(o.querySelectorAll)(x,this);}},{key:"insertBefore",value:function insertBefore(x,v){if(v==null)return this.appendChild(x);x.remove();var T=this[c].indexOf(v);if(T<0)throw new Error("Invalid reference node.");var f=v.zOrder;for(var g=T;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(T,0,x),x.connect(this,f),this[d])if(x.zIndex!==v.zIndex)this.reorder();else{var _g5=this[d].indexOf(v);this[d].splice(_g5,0,x);}return x;}},{key:"querySelector",value:function querySelector(x){return Object(o.querySelector)(x,this);}},{key:"querySelectorAll",value:function querySelectorAll(x){return Object(o.querySelectorAll)(x,this);}},{key:"replaceChild",value:function replaceChild(x,v){x.remove();var T=this[c].indexOf(v);if(T<0)throw new Error("Invalid reference node.");if(this[c][T]=x,x.connect(this,v.zOrder),this[d])if(x.zIndex!==v.zIndex)this.reorder();else{var _f23=this[d].indexOf(v);this[d][_f23]=x;}return v.disconnect(this),x;}},{key:"removeAllChildren",value:function removeAllChildren(){var x=this[c];for(var v=x.length-1;v>=0;v--)x[v].remove();}},{key:"removeChild",value:function removeChild(x){var v=this[c].indexOf(x);if(v>=0){if(this[c].splice(v,1),this[d]){var _T27=this[d].indexOf(x);this[d].splice(_T27,1);}return x.disconnect(this),x;}return null;}},{key:"reorder",value:function reorder(){this[d]=null;}},{key:"seal",value:function seal(){function x(g,u){var m=[];for(var M=0;M<g.length;M++){var E=_toConsumableArray(g[M]);for(var A=1;A<E.length;A+=2){var b=E[A],O=E[A+1];E[A]=b*u[0]+O*u[2]+u[4],E[A+1]=b*u[1]+O*u[3]+u[5];}m.push(E);}return m;}var v=this.orderedChildren,T=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=x(m,u.localMatrix),T.addPath(m);}if(u.path){var _m6=u.path.contours.path;_m6=x(_m6,u.localMatrix),T.addPath(_m6);}}return this[p]=!0,this.clientBox=T,{clientBox:T,localMatrix:f};}/* override */},{key:"setResolution",value:function setResolution(_ref146){var x=_ref146.width,v=_ref146.height;_superPropGet(y,"setResolution",this,3)([{width:x,height:v}]),this[c].forEach(function(T){T.setResolution({width:x,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 x;});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 T=v.length,f,g,u;for(;--T>-1;){for(f=g=v[T],v[T]=null,u=!0;g;){if(v.indexOf(g)>-1){u=!1,v.splice(T,1);break;}g=s(g);}u&&(v[T]=f);}return v;}var d={isTag:a,existsOne:function existsOne(v,T){return T.some(function(f){return a(f)?v(f)||d.existsOne(v,o(f)):!1;});},getSiblings:function getSiblings(v){var T=s(v);return T&&o(T);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(v,T){if(v.nodeType===1&&T==="class"||T==="id")return v[T];if(this.hasAttrib(v,T)){var _f24=v.attributes[T];return Array.isArray(_f24)&&(_f24="[".concat(_f24.join(),"]")),String(_f24);}},hasAttrib:function hasAttrib(v,T){return v.attributes[T]!=null;},removeSubsets:l,getName:function getName(v){return v.tagName?v.tagName.toLowerCase():null;},findOne:function v(T,f){var g=null;for(var u=0,m=f.length;u<m&&!g;u++)if(T(f[u]))g=f[u];else{var M=o(f[u]);M&&M.length>0&&(g=v(T,M));}return g;},findAll:function v(T,f){var g=[];for(var u=0,m=f.length;u<m;u++){if(!a(f[u]))continue;T(f[u])&&g.push(f[u]);var M=o(f[u]);M&&(g=g.concat(v(T,M)));}return g;},getText:function v(T){return Array.isArray(T)?T.map(v).join(""):a(T)?v(o(T)):T.nodeType===3?T.nodeValue:n["default"].isSpriteNode(T.nodeName)?T.text:"";}};function c(v){if(typeof v!="string")return v;var T=v.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return T&&(T=T.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,"\"]")];}),T.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),f=_ref148[0],g=_ref148[1];v=v.replace(f,g);})),T=v.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),T&&(T=T.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,"]\"]")];}),T.forEach(function(_ref149){var _ref150=_slicedToArray(_ref149,2),f=_ref150[0],g=_ref150[1];v=v.replace(f,g);})),v;}function p(v,T){return i.selectAll(c(v),T,{adapter:d});}function y(v,T){return i.selectOne(c(v),T,{adapter:d});}function P(v,T){return i.is(v,c(T),{adapter:d});}function x(v){return i.compile(c(v),{adapter:d});}},/* 253 *//***/function(h,r,t){h.exports=x;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,T){var f=T.getSiblings(v);if(!Array.isArray(f))return[];for(f=f.slice(0);f.shift()!==v;);return f;}function c(v,T){Array.isArray(v)||(v=[v]);for(var f=v.slice(0),g=0,u=v.length;g<u;g++){var m=d(f[g],T);f.push.apply(f,m);}return f;}var p=l(function(T,f,g){return T===n||!f||f.length===0?[]:g.adapter.findAll(T,f);}),y=l(function(T,f,g){return T===n||!f||f.length===0?null:g.adapter.findOne(T,f);});function P(v,T,f){return f=f||{},f.adapter=f.adapter||e,(typeof T=="function"?T:o(T,f))(v);}function x(v,T,f){return p(v,T,f);}x.compile=o,x.filters=i.Pseudos.filters,x.pseudos=i.Pseudos.pseudos,x.selectAll=p,x.selectOne=y,x.is=P,x.parse=o,x.iterate=p,x._compileUnsafe=s,x._compileToken=i.compileToken;},/* 254 *//***/function(h,r,t){var e=h.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){e[i]=n[i].bind(e);});});},/* 255 *//***/function(h,r,t){var e=t(256),n=t(257),i=e.isTag;h.exports={getInnerHTML:a,getOuterHTML:n,getText:o};function a(s,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
343
+ /* override */},{key:"cloneNode",value:function cloneNode(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var v=_superPropGet(y,"cloneNode",this,3)([]);return x&&this[c].forEach(function(T){var f=T.cloneNode(x);v.appendChild(f);}),v;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(x){var v=this.orderedChildren;for(var _T25=v.length-1;_T25>=0;_T25--)if(v[_T25].dispatchPointerEvent(x))return!0;return _superPropGet(y,"dispatchPointerEvent",this,3)([x]);}/* override */},{key:"draw",value:function draw(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(y,"draw",this,3)([x]),!this[p]&&this.attributes.display!=="none"){var v=this.orderedChildren;for(var _T26=0;_T26<v.length;_T26++)v[_T26].draw(x);}return this.__cacheRenderMatrix=null,x;}},{key:"getElementById",value:function getElementById(x){return Object(o.querySelector)("#".concat(x),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(x){return Object(o.querySelectorAll)(".".concat(x),this);}},{key:"getElementsByName",value:function getElementsByName(x){return Object(o.querySelectorAll)("[name=\"".concat(x,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(x){return Object(o.querySelectorAll)(x,this);}},{key:"insertBefore",value:function insertBefore(x,v){if(v==null)return this.appendChild(x);x.remove();var T=this[c].indexOf(v);if(T<0)throw new Error("Invalid reference node.");var f=v.zOrder;for(var g=T;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(T,0,x),x.connect(this,f),this[d])if(x.zIndex!==v.zIndex)this.reorder();else{var _g5=this[d].indexOf(v);this[d].splice(_g5,0,x);}return x;}},{key:"querySelector",value:function querySelector(x){return Object(o.querySelector)(x,this);}},{key:"querySelectorAll",value:function querySelectorAll(x){return Object(o.querySelectorAll)(x,this);}},{key:"replaceChild",value:function replaceChild(x,v){x.remove();var T=this[c].indexOf(v);if(T<0)throw new Error("Invalid reference node.");if(this[c][T]=x,x.connect(this,v.zOrder),this[d])if(x.zIndex!==v.zIndex)this.reorder();else{var _f23=this[d].indexOf(v);this[d][_f23]=x;}return v.disconnect(this),x;}},{key:"removeAllChildren",value:function removeAllChildren(){var x=this[c];for(var v=x.length-1;v>=0;v--)x[v].remove();}},{key:"removeChild",value:function removeChild(x){var v=this[c].indexOf(x);if(v>=0){if(this[c].splice(v,1),this[d]){var _T27=this[d].indexOf(x);this[d].splice(_T27,1);}return x.disconnect(this),x;}return null;}},{key:"reorder",value:function reorder(){this[d]=null;}},{key:"seal",value:function seal(){function x(g,u){var m=[];for(var M=0;M<g.length;M++){var E=_toConsumableArray(g[M]);for(var A=1;A<E.length;A+=2){var w=E[A],O=E[A+1];E[A]=w*u[0]+O*u[2]+u[4],E[A+1]=w*u[1]+O*u[3]+u[5];}m.push(E);}return m;}var v=this.orderedChildren,T=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=x(m,u.localMatrix),T.addPath(m);}if(u.path){var _m6=u.path.contours.path;_m6=x(_m6,u.localMatrix),T.addPath(_m6);}}return this[p]=!0,this.clientBox=T,{clientBox:T,localMatrix:f};}/* override */},{key:"setResolution",value:function setResolution(_ref146){var x=_ref146.width,v=_ref146.height;_superPropGet(y,"setResolution",this,3)([{width:x,height:v}]),this[c].forEach(function(T){T.setResolution({width:x,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 x;});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 T=v.length,f,g,u;for(;--T>-1;){for(f=g=v[T],v[T]=null,u=!0;g;){if(v.indexOf(g)>-1){u=!1,v.splice(T,1);break;}g=s(g);}u&&(v[T]=f);}return v;}var d={isTag:a,existsOne:function existsOne(v,T){return T.some(function(f){return a(f)?v(f)||d.existsOne(v,o(f)):!1;});},getSiblings:function getSiblings(v){var T=s(v);return T&&o(T);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(v,T){if(v.nodeType===1&&T==="class"||T==="id")return v[T];if(this.hasAttrib(v,T)){var _f24=v.attributes[T];return Array.isArray(_f24)&&(_f24="[".concat(_f24.join(),"]")),String(_f24);}},hasAttrib:function hasAttrib(v,T){return v.attributes[T]!=null;},removeSubsets:l,getName:function getName(v){return v.tagName?v.tagName.toLowerCase():null;},findOne:function v(T,f){var g=null;for(var u=0,m=f.length;u<m&&!g;u++)if(T(f[u]))g=f[u];else{var M=o(f[u]);M&&M.length>0&&(g=v(T,M));}return g;},findAll:function v(T,f){var g=[];for(var u=0,m=f.length;u<m;u++){if(!a(f[u]))continue;T(f[u])&&g.push(f[u]);var M=o(f[u]);M&&(g=g.concat(v(T,M)));}return g;},getText:function v(T){return Array.isArray(T)?T.map(v).join(""):a(T)?v(o(T)):T.nodeType===3?T.nodeValue:n["default"].isSpriteNode(T.nodeName)?T.text:"";}};function c(v){if(typeof v!="string")return v;var T=v.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return T&&(T=T.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,"\"]")];}),T.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),f=_ref148[0],g=_ref148[1];v=v.replace(f,g);})),T=v.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),T&&(T=T.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,"]\"]")];}),T.forEach(function(_ref149){var _ref150=_slicedToArray(_ref149,2),f=_ref150[0],g=_ref150[1];v=v.replace(f,g);})),v;}function p(v,T){return i.selectAll(c(v),T,{adapter:d});}function y(v,T){return i.selectOne(c(v),T,{adapter:d});}function P(v,T){return i.is(v,c(T),{adapter:d});}function x(v){return i.compile(c(v),{adapter:d});}},/* 253 *//***/function(h,r,t){h.exports=x;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,T){var f=T.getSiblings(v);if(!Array.isArray(f))return[];for(f=f.slice(0);f.shift()!==v;);return f;}function c(v,T){Array.isArray(v)||(v=[v]);for(var f=v.slice(0),g=0,u=v.length;g<u;g++){var m=d(f[g],T);f.push.apply(f,m);}return f;}var p=l(function(T,f,g){return T===n||!f||f.length===0?[]:g.adapter.findAll(T,f);}),y=l(function(T,f,g){return T===n||!f||f.length===0?null:g.adapter.findOne(T,f);});function P(v,T,f){return f=f||{},f.adapter=f.adapter||e,(typeof T=="function"?T:o(T,f))(v);}function x(v,T,f){return p(v,T,f);}x.compile=o,x.filters=i.Pseudos.filters,x.pseudos=i.Pseudos.pseudos,x.selectAll=p,x.selectOne=y,x.is=P,x.parse=o,x.iterate=p,x._compileUnsafe=s,x._compileToken=i.compileToken;},/* 254 *//***/function(h,r,t){var e=h.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){e[i]=n[i].bind(e);});});},/* 255 *//***/function(h,r,t){var e=t(256),n=t(257),i=e.isTag;h.exports={getInnerHTML:a,getOuterHTML:n,getText:o};function a(s,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
344
  Directive:"directive",//<? ... ?>
345
345
  Comment:"comment",//<!-- ... -->
346
346
  Script:"script",//<script> tags
347
347
  Style:"style",//<style> tags
348
348
  Tag:"tag",//Any tag
349
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,T){if(v){var f="",g;for(var u in v)g=v[u],f&&(f+=" "),T.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),f+=u,(g!==null&&g!==""||T.xmlMode)&&(f+='="'+(T.decodeEntities?n.encodeXML(g):g.replace(/\"/g,"&quot;"))+'"');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,T){!Array.isArray(v)&&!v.cheerio&&(v=[v]),T=T||{};for(var f="",g=0;g<v.length;g++){var u=v[g];u.type==="root"?f+=l(u.children,T):e.isTag(u)?f+=c(u,T):u.type===e.Directive?f+=p(u):u.type===e.Comment?f+=x(u):u.type===e.CDATA?f+=P(u):f+=y(u,T);}return f;},d=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function c(v,T){T.xmlMode==="foreign"&&(v.name=i.elementNames[v.name]||v.name,v.parent&&d.indexOf(v.parent.name)>=0&&(T=Object.assign({},T,{xmlMode:!1}))),!T.xmlMode&&["svg","math"].indexOf(v.name)>=0&&(T=Object.assign({},T,{xmlMode:"foreign"}));var f="<"+v.name,g=o(v.attribs,T);return g&&(f+=" "+g),T.xmlMode&&(!v.children||v.children.length===0)?f+="/>":(f+=">",v.children&&(f+=l(v.children,T)),(!s[v.name]||T.xmlMode)&&(f+="</"+v.name+">")),f;}function p(v){return"<"+v.data+">";}function y(v,T){var f=v.data||"";return T.decodeEntities&&!(v.parent&&v.parent.name in a)&&(f=n.encodeXML(f)),f;}function P(v){return"<![CDATA["+v.children[0].data+"]]>";}function x(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(x){return String(x).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 x=new RegExp("&(?:"+p.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),v=d(n["default"]);function T(f){return f.substr(-1)!==";"&&(f+=";"),v(f);}return function(f){return String(f).replace(x,T);};}();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(T){return T&&T.__esModule?T:{"default":T};};Object.defineProperty(r,"__esModule",{value:!0}),r.escape=r.encodeHTML=r.encodeXML=void 0;var n=e(t(263)),i=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(T){return Object.keys(T).sort().reduce(function(f,g){return f[T[g]]="&"+g+";",f;},{});}function c(T){for(var f=[],g=[],u=0,m=Object.keys(T);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 A=E;A<f.length-1&&f[A].charCodeAt(1)+1===f[A+1].charCodeAt(1);)A+=1;var b=1+A-E;b<3||f.splice(E,b,f[E]+"-"+f[A]);}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(T){return"&#x"+T.codePointAt(0).toString(16).toUpperCase()+";";}function P(T,f){return function(g){return g.replace(f,function(u){return T[u];}).replace(p,y);};}var x=c(i);function v(T){return T.replace(x,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=[],x,v=0,T=c.length;v<T&&!(d(c[v])&&(P.push(c[v]),--y<=0)||(x=c[v].children,p&&x&&x.length>0&&(x=i(d,x,p,y),P=P.concat(x),y-=x.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(R){return w.isTag(R)&&O(R);};}function P(O,L,w){var I=e(O,L);return m(I,L,w);}function x(O){return O.type==="pseudo"&&(O.name==="scope"||Array.isArray(O.data)&&O.data.some(function(L){return L.some(x);}));}var v={type:"descendant"},T={type:"_flexibleDescendant"},f={type:"pseudo",name:"scope"},g={};function u(O,L,w){var I=L.adapter,R=!!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(R&&!(Array.isArray(W)?W.some(x):x(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 R=!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]=T:(K==="adjacent"||K==="sibling")&&(R=!0);}return E(z,L,w);}).reduce(A,d);return W.shouldTestNextSiblings=R,W;}function M(O){return a[O.type]<0;}function E(O,L,w){return O.reduce(function(I,R){if(I===d)return I;if(!(R.type in o))throw new Error("Rule type "+R.type+" is not supported by css-select");return o[R.type](I,R,L,w);},L&&L.rootFunc||l);}function A(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 R={xmlMode:!!(w&&w.xmlMode),strict:!!(w&&w.strict),adapter:w.adapter};if(R.strict&&(L.length>1||L.some(b)))throw new Error("complex selectors in :not aren't allowed in strict mode");var W=m(L,R,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,R={xmlMode:!!(w&&w.xmlMode),strict:!!(w&&w.strict),adapter:I},W=L.some(b)?[g]:null,z=m(L,R,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 R={xmlMode:!!(w&&w.xmlMode),strict:!!(w&&w.strict),rootFunc:O,adapter:w.adapter};return m(L,R,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"]=x;var e=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,a={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},s={"#":["id","equals"],".":["class","element"]},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
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,T){if(v){var f="",g;for(var u in v)g=v[u],f&&(f+=" "),T.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),f+=u,(g!==null&&g!==""||T.xmlMode)&&(f+='="'+(T.decodeEntities?n.encodeXML(g):g.replace(/\"/g,"&quot;"))+'"');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,T){!Array.isArray(v)&&!v.cheerio&&(v=[v]),T=T||{};for(var f="",g=0;g<v.length;g++){var u=v[g];u.type==="root"?f+=l(u.children,T):e.isTag(u)?f+=c(u,T):u.type===e.Directive?f+=p(u):u.type===e.Comment?f+=x(u):u.type===e.CDATA?f+=P(u):f+=y(u,T);}return f;},d=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function c(v,T){T.xmlMode==="foreign"&&(v.name=i.elementNames[v.name]||v.name,v.parent&&d.indexOf(v.parent.name)>=0&&(T=Object.assign({},T,{xmlMode:!1}))),!T.xmlMode&&["svg","math"].indexOf(v.name)>=0&&(T=Object.assign({},T,{xmlMode:"foreign"}));var f="<"+v.name,g=o(v.attribs,T);return g&&(f+=" "+g),T.xmlMode&&(!v.children||v.children.length===0)?f+="/>":(f+=">",v.children&&(f+=l(v.children,T)),(!s[v.name]||T.xmlMode)&&(f+="</"+v.name+">")),f;}function p(v){return"<"+v.data+">";}function y(v,T){var f=v.data||"";return T.decodeEntities&&!(v.parent&&v.parent.name in a)&&(f=n.encodeXML(f)),f;}function P(v){return"<![CDATA["+v.children[0].data+"]]>";}function x(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(x){return String(x).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 x=new RegExp("&(?:"+p.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),v=d(n["default"]);function T(f){return f.substr(-1)!==";"&&(f+=";"),v(f);}return function(f){return String(f).replace(x,T);};}();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(T){return T&&T.__esModule?T:{"default":T};};Object.defineProperty(r,"__esModule",{value:!0}),r.escape=r.encodeHTML=r.encodeXML=void 0;var n=e(t(263)),i=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(T){return Object.keys(T).sort().reduce(function(f,g){return f[T[g]]="&"+g+";",f;},{});}function c(T){for(var f=[],g=[],u=0,m=Object.keys(T);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 A=E;A<f.length-1&&f[A].charCodeAt(1)+1===f[A+1].charCodeAt(1);)A+=1;var w=1+A-E;w<3||f.splice(E,w,f[E]+"-"+f[A]);}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(T){return"&#x"+T.codePointAt(0).toString(16).toUpperCase()+";";}function P(T,f){return function(g){return g.replace(f,function(u){return T[u];}).replace(p,y);};}var x=c(i);function v(T){return T.replace(x,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=[],x,v=0,T=c.length;v<T&&!(d(c[v])&&(P.push(c[v]),--y<=0)||(x=c[v].children,p&&x&&x.length>0&&(x=i(d,x,p,y),P=P.concat(x),y-=x.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,b){var I=P(O,L,b);return y(I,L);}function y(O,L){var b=L.adapter;return function(R){return b.isTag(R)&&O(R);};}function P(O,L,b){var I=e(O,L);return m(I,L,b);}function x(O){return O.type==="pseudo"&&(O.name==="scope"||Array.isArray(O.data)&&O.data.some(function(L){return L.some(x);}));}var v={type:"descendant"},T={type:"_flexibleDescendant"},f={type:"pseudo",name:"scope"},g={};function u(O,L,b){var I=L.adapter,R=!!b&&!!b.length&&b.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(R&&!(Array.isArray(W)?W.some(x):x(W)))W.unshift(v);else return;W.unshift(f);});}function m(O,L,b){O=O.filter(function(z){return z.length>0;}),O.forEach(i);var I=Array.isArray(b);b=L&&L.context||b,b&&!I&&(b=[b]),u(O,L,b);var R=!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]=T:(K==="adjacent"||K==="sibling")&&(R=!0);}return E(z,L,b);}).reduce(A,d);return W.shouldTestNextSiblings=R,W;}function M(O){return a[O.type]<0;}function E(O,L,b){return O.reduce(function(I,R){if(I===d)return I;if(!(R.type in o))throw new Error("Rule type "+R.type+" is not supported by css-select");return o[R.type](I,R,L,b);},L&&L.rootFunc||l);}function A(O,L){return L===d||O===l?O:O===d||L===l?L:function(I){return O(I)||L(I);};}function w(O){return O.some(M);}c.not=function(O,L,b,I){var R={xmlMode:!!(b&&b.xmlMode),strict:!!(b&&b.strict),adapter:b.adapter};if(R.strict&&(L.length>1||L.some(w)))throw new Error("complex selectors in :not aren't allowed in strict mode");var W=m(L,R,I);return W===d?O:W===l?d:function(K){return!W(K)&&O(K);};},c.has=function(O,L,b){var I=b.adapter,R={xmlMode:!!(b&&b.xmlMode),strict:!!(b&&b.strict),adapter:I},W=L.some(w)?[g]:null,z=m(L,R,W);return z===d?d:z===l?function(k){return I.getChildren(k).some(I.isTag)&&O(k);}:(z=y(z,b),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,b,I){var R={xmlMode:!!(b&&b.xmlMode),strict:!!(b&&b.strict),rootFunc:O,adapter:b.adapter};return m(L,R,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"]=x;var e=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,a={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},s={"#":["id","equals"],".":["class","element"]},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
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 x(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 A(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(A(0);g!=="";){var O=g.charAt(0);if(P(O))M=!0,A(1);else if(O in o)m.push({type:o[O]}),M=!1,A(1);else if(O===","){if(m.length===0)throw new Error("Empty sub-selector");f.push(m),m=[],M=!1,A(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 R=g.match(i);if(!R)throw new Error("Malformed attribute selector: "+g);g=g.substr(R[0].length);var W=y(R[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),m.push({type:"attribute",name:W,action:a[R[2]],value:y(R[4]||R[5]||""),ignoreCase:!!R[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(),R=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),R=[],g=v(R,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(R=g.substr(1,q-2),g=g.substr(q),d.has(z)){var K=R.charAt(0);K===R.slice(-1)&&c.has(K)&&(R=R.slice(1,-1)),R=y(R);}}m.push({type:"pseudo",name:z,data:R});}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(),T(f,m),g;}return T(f,m),g;}function T(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
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 x(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 A(Z){for(;P(g.charAt(Z));)Z++;g=g.substr(Z);}function w(Z){for(var nt=0;g.charAt(--Z)==="\\";)nt++;return(nt&1)===1;}for(A(0);g!=="";){var O=g.charAt(0);if(P(O))M=!0,A(1);else if(O in o)m.push({type:o[O]}),M=!1,A(1);else if(O===","){if(m.length===0)throw new Error("Empty sub-selector");f.push(m),m=[],M=!1,A(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],b=L[0],I=L[1];g=g.substr(1),m.push({type:"attribute",name:b,action:I,value:E(),ignoreCase:!1});}else if(O==="["){g=g.substr(1);var R=g.match(i);if(!R)throw new Error("Malformed attribute selector: "+g);g=g.substr(R[0].length);var W=y(R[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),m.push({type:"attribute",name:W,action:a[R[2]],value:y(R[4]||R[5]||""),ignoreCase:!!R[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(),R=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),R=[],g=v(R,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)==="("&&!w(q)?U++:g.charAt(q)===")"&&!w(q)&&U--;if(U)throw new Error("Parenthesis not matched");if(R=g.substr(1,q-2),g=g.substr(q),d.has(z)){var K=R.charAt(0);K===R.slice(-1)&&c.has(K)&&(R=R.slice(1,-1)),R=y(R);}}m.push({type:"pseudo",name:z,data:R});}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(),T(f,m),g;}return T(f,m),g;}function T(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
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
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 x=p.getAttributeValue(P,l);return x!=null&&(x.length===c||x.charAt(c)==="-")&&x.substr(0,c).toLowerCase()===d&&a(P);}):function(P){var x=p.getAttributeValue(P,l);return x!=null&&x.substr(0,c)===d&&(x.length===c||x.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 T=c.getAttributeValue(v,l);return T!=null&&P.test(T)&&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 x=p.getAttributeValue(P,l);return x!=null&&x.substr(0,c).toLowerCase()===d&&a(P);}):function(P){var x=p.getAttributeValue(P,l);return x!=null&&x.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 x=p.getAttributeValue(P,l);return x!=null&&x.substr(c).toLowerCase()===d&&a(P);}):function(P){var x=p.getAttributeValue(P,l);return x!=null&&x.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 x=c.getAttributeValue(P,l);return x!=null&&p.test(x)&&a(P);};}return function(P){var x=c.getAttributeValue(P,l);return x!=null&&x.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(T,f){var g={name:T,value:f};return function(m,M,E){return s(m,g,E);};}function d(T,f){return function(g){return!!f.getParent(g)&&T(g);};}var c={contains:function contains(T,f,g){var u=g.adapter;return function(M){return T(M)&&u.getText(M).indexOf(f)>=0;};},icontains:function icontains(T,f,g){var u=f.toLowerCase(),m=g.adapter;return function(E){return T(E)&&m.getText(E).toLowerCase().indexOf(u)>=0;};},//location specific methods
355
- "nth-child":function nthChild(T,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(T,m):function(E){for(var A=m.getSiblings(E),b=0,O=0;b<A.length;b++)if(m.isTag(A[b])){if(A[b]===E)break;O++;}return u(O)&&T(E);};},"nth-last-child":function nthLastChild(T,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(T,m):function(E){for(var A=m.getSiblings(E),b=0,O=A.length-1;O>=0;O--)if(m.isTag(A[O])){if(A[O]===E)break;b++;}return u(b)&&T(E);};},"nth-of-type":function nthOfType(T,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(T,m):function(E){for(var A=m.getSiblings(E),b=0,O=0;O<A.length;O++)if(m.isTag(A[O])){if(A[O]===E)break;m.getName(A[O])===m.getName(E)&&b++;}return u(b)&&T(E);};},"nth-last-of-type":function nthLastOfType(T,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(T,m):function(E){for(var A=m.getSiblings(E),b=0,O=A.length-1;O>=0;O--)if(m.isTag(A[O])){if(A[O]===E)break;m.getName(A[O])===m.getName(E)&&b++;}return u(b)&&T(E);};},//TODO determine the actual root element
355
+ "nth-child":function nthChild(T,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(T,m):function(E){for(var A=m.getSiblings(E),w=0,O=0;w<A.length;w++)if(m.isTag(A[w])){if(A[w]===E)break;O++;}return u(O)&&T(E);};},"nth-last-child":function nthLastChild(T,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(T,m):function(E){for(var A=m.getSiblings(E),w=0,O=A.length-1;O>=0;O--)if(m.isTag(A[O])){if(A[O]===E)break;w++;}return u(w)&&T(E);};},"nth-of-type":function nthOfType(T,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(T,m):function(E){for(var A=m.getSiblings(E),w=0,O=0;O<A.length;O++)if(m.isTag(A[O])){if(A[O]===E)break;m.getName(A[O])===m.getName(E)&&w++;}return u(w)&&T(E);};},"nth-last-of-type":function nthLastOfType(T,f,g){var u=e(f),m=g.adapter;return u===o?u:u===a?d(T,m):function(E){for(var A=m.getSiblings(E),w=0,O=A.length-1;O>=0;O--)if(m.isTag(A[O])){if(A[O]===E)break;m.getName(A[O])===m.getName(E)&&w++;}return u(w)&&T(E);};},//TODO determine the actual root element
356
356
  root:function root(T,f,g){var u=g.adapter;return function(m){return!u.getParent(m)&&T(m);};},scope:function scope(T,f,g,u){var m=g.adapter;if(!u||u.length===0)return c.root(T,f,g);function M(E,A){return typeof m.equals=="function"?m.equals(E,A):E===A;}return u.length===1?function(E){return M(u[0],E)&&T(E);}:function(E){return u.indexOf(E)>=0&&T(E);};},//jQuery extensions (others follow as pseudos)
357
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
358
  hover:function hover(T,f,g){var u=g.adapter;return typeof u.isHovered=="function"?function(M){return T(M)&&u.isHovered(M);}:o;},visited:function visited(T,f,g){var u=g.adapter;return typeof u.isVisited=="function"?function(M){return T(M)&&u.isVisited(M);}:o;},active:function active(T,f,g){var u=g.adapter;return typeof u.isActive=="function"?function(M){return T(M)&&u.isActive(M);}:o;}};function p(T,f){for(var g=0;T&&g<T.length;g++)if(f.isTag(T[g]))return T[g];}var y={empty:function empty(T,f){return!f.getChildren(T).some(function(g){return f.isTag(g)||g.type==="text";});},"first-child":function firstChild(T,f){return p(f.getSiblings(T),f)===T;},"last-child":function lastChild(T,f){for(var g=f.getSiblings(T),u=g.length-1;u>=0;u--){if(g[u]===T)return!0;if(f.isTag(g[u]))break;}return!1;},"first-of-type":function firstOfType(T,f){for(var g=f.getSiblings(T),u=0;u<g.length;u++)if(f.isTag(g[u])){if(g[u]===T)return!0;if(f.getName(g[u])===f.getName(T))break;}return!1;},"last-of-type":function lastOfType(T,f){for(var g=f.getSiblings(T),u=g.length-1;u>=0;u--)if(f.isTag(g[u])){if(g[u]===T)return!0;if(f.getName(g[u])===f.getName(T))break;}return!1;},"only-of-type":function onlyOfType(T,f){for(var g=f.getSiblings(T),u=0,m=g.length;u<m;u++)if(f.isTag(g[u])){if(g[u]===T)continue;if(f.getName(g[u])===f.getName(T))return!1;}return!0;},"only-child":function onlyChild(T,f){for(var g=f.getSiblings(T),u=0;u<g.length;u++)if(f.isTag(g[u])&&g[u]!==T)return!1;return!0;},//:matches(a, area, link)[href]
@@ -375,37 +375,37 @@ parent:function parent(T,f){return!y.empty(T,f);},//:matches(h1, h2, h3, h4, h5,
375
375
  header:P(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
376
376
  button:function button(T,f){var g=f.getName(T);return g==="button"||g==="input"&&f.getAttributeValue(T,"type")==="button";},//:matches(input, textarea, select, button)
377
377
  input:P(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
378
- text:function text(T,f){var g;return f.getName(T)==="input"&&(!(g=f.getAttributeValue(T,"type"))||g.toLowerCase()==="text");}};function P(T){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var f=new Set(T);return function(g,u){return f.has(u.getName(g));};}return function(g,u){return T.indexOf(u.getName(g))>=0;};}function x(T,f,g){if(g===null){if(T.length>2&&f!=="scope")throw new Error("pseudo-selector :"+f+" requires an argument");}else if(T.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(T,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](T,M,g,u);if(typeof y[m]=="function"){var A=y[m];return x(A,m,M),A===o?A:T===a?function(O){return A(O,E,M);}:function(O){return A(O,E,M)&&T(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,A){if(E==null)return{};var b=c(E,A),O,L;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(E);for(L=0;L<w.length;L++)O=w[L],!(A.indexOf(O)>=0)&&Object.prototype.propertyIsEnumerable.call(E,O)&&(b[O]=E[O]);}return b;}function c(E,A){if(E==null)return{};var b={},O=Object.keys(E),L,w;for(w=0;w<O.length;w++)L=O[w],!(A.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"),x=Symbol("timeline"),v=Symbol("prepareRender"),T=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 A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this49=_callSuper(this,M),!A.canvas){var _this49$getResolution=_this49.getResolution(),w=_this49$getResolution.width,I=_this49$getResolution.height,R=e.ENV.createCanvas(w,I,{offscreen:!!A.offscreen,id:A.id,extra:A.extra});R.style&&(R.style.position="absolute"),R.dataset&&(R.dataset.layerId=A.id),R.contextType&&(A.contextType=R.contextType),A.canvas=R;}var b=A.canvas,O=Object.assign({},p,A);_this49[y]=O.autoRender,delete A.autoRender;var L=O.Renderer||e.Renderer;_this49[P]=new L(b,O),_this49.options=A,_this49.id=A.id,_this49[f]=[],_this49.setResolution(b),_this49.canvas=b,_this49[x]=new n.Timeline(),_this49.__mouseCapturedTarget=null,_this49[m]=null;return _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(),A=_this$getResolution.height;return A/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,A=_this$parent$options.left,b=_this$parent$options.top;return[A,b];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[x];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),A=_this$getResolution2.width;return A/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,A=_this$attributes21.x,b=_this$attributes21.y;return[1,0,0,1,A,b];}},{key:"layerTransformInvert",get:function get(){if(this[m])return this[m];var A=this.transformMatrix;return A[0]===1&&A[1]===0&&A[2]===0&&A[3]===1&&A[4]===0&&A[5]===0?null:(this[m]=i.mat2d.invert(Array.of(0,0,0,0,0,0),A),this[m]);}},{key:"forceContextLoss",value:function forceContextLoss(){var A=this.renderer.glRenderer;if(A){var b=A.getExtension("WEBGL_lose_context");if(b)return b.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
378
+ text:function text(T,f){var g;return f.getName(T)==="input"&&(!(g=f.getAttributeValue(T,"type"))||g.toLowerCase()==="text");}};function P(T){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var f=new Set(T);return function(g,u){return f.has(u.getName(g));};}return function(g,u){return T.indexOf(u.getName(g))>=0;};}function x(T,f,g){if(g===null){if(T.length>2&&f!=="scope")throw new Error("pseudo-selector :"+f+" requires an argument");}else if(T.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(T,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](T,M,g,u);if(typeof y[m]=="function"){var A=y[m];return x(A,m,M),A===o?A:T===a?function(O){return A(O,E,M);}:function(O){return A(O,E,M)&&T(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,A){if(E==null)return{};var w=c(E,A),O,L;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(E);for(L=0;L<b.length;L++)O=b[L],!(A.indexOf(O)>=0)&&Object.prototype.propertyIsEnumerable.call(E,O)&&(w[O]=E[O]);}return w;}function c(E,A){if(E==null)return{};var w={},O=Object.keys(E),L,b;for(b=0;b<O.length;b++)L=O[b],!(A.indexOf(L)>=0)&&(w[L]=E[L]);return w;}var p={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
379
+ },y=Symbol("autoRender"),P=Symbol("renderer"),x=Symbol("timeline"),v=Symbol("prepareRender"),T=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 A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this49=_callSuper(this,M),!A.canvas){var _this49$getResolution=_this49.getResolution(),b=_this49$getResolution.width,I=_this49$getResolution.height,R=e.ENV.createCanvas(b,I,{offscreen:!!A.offscreen,id:A.id,extra:A.extra});R.style&&(R.style.position="absolute"),R.dataset&&(R.dataset.layerId=A.id),R.contextType&&(A.contextType=R.contextType),A.canvas=R;}var w=A.canvas,O=Object.assign({},p,A);_this49[y]=O.autoRender,delete A.autoRender;var L=O.Renderer||e.Renderer;_this49[P]=new L(w,O),_this49.options=A,_this49.id=A.id,_this49[f]=[],_this49.setResolution(w),_this49.canvas=w,_this49[x]=new n.Timeline(),_this49.__mouseCapturedTarget=null,_this49[m]=null;return _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(),A=_this$getResolution.height;return A/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,A=_this$parent$options.left,w=_this$parent$options.top;return[A,w];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[x];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),A=_this$getResolution2.width;return A/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,A=_this$attributes21.x,w=_this$attributes21.y;return[1,0,0,1,A,w];}},{key:"layerTransformInvert",get:function get(){if(this[m])return this[m];var A=this.transformMatrix;return A[0]===1&&A[1]===0&&A[2]===0&&A[3]===1&&A[4]===0&&A[5]===0?null:(this[m]=i.mat2d.invert(Array.of(0,0,0,0,0,0),A),this[m]);}},{key:"forceContextLoss",value:function forceContextLoss(){var A=this.renderer.glRenderer;if(A){var w=A.getExtension("WEBGL_lose_context");if(w)return w.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
380
380
  // return true;
381
381
  // }
382
- },{key:"addPass",value:function addPass(){var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},A=_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,R=this.renderer.createPassProgram({vertex:A,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(R),this[f].push(z),this.forceUpdate(),z;}return null;}// delete unused texture to release memory.
383
- },{key:"deleteTexture",value:function deleteTexture(A){return Object(l.deleteTexture)(A,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(A){var b=A.type;if(b==="mousedown"||b==="mouseup"||b==="mousemove"){var R=this.__mouseCapturedTarget;if(R){if(R.layer===this)return R.dispatchEvent(A),!0;this.__mouseCapturedTarget=null;}}var O,L;var w=this.layerTransformInvert;if(w){O=A.x,L=A.y;var _R6=w,W=_R6[0]*O+_R6[2]*L+_R6[4],z=_R6[1]*O+_R6[3]*L+_R6[5];delete A.x,delete A.y,delete A.layerX,delete A.layerY,Object.defineProperties(A,{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)([A]);return w&&Object.defineProperties(A,{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 A=null;var b=new Promise(function(O){A=O;});b._resolve=A,this[v]=b;}else{var _A2=null,_b8=null;var O=new Promise(function(L){_A2=L,_this50[y]&&(_b8=Object(a.requestAnimationFrame)(function(){delete O._requestID,_this50.render();}));});O._resolve=_A2,O._requestID=_b8,this[v]=O;}}},{key:"getFBO",value:function getFBO(){var A=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),b=_this$getResolution4.width,O=_this$getResolution4.height;return A&&(!this[g]||this[g].width!==b||this[g].height!==O)?(this[g]={width:b,height:O,target:A.createFBO(),buffer:A.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 A=this.renderer,b=A.__globalTransformMatrix||A.globalTransformMatrix;A.__globalTransformMatrix=b;var O=i.mat2d.fromValues(1,0,0,1,0,0);A.setGlobalTransform.apply(A,_toConsumableArray(i.mat2d.multiply(O,b,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(A,b,O){if(_superPropGet(M,"onPropertyChange",this,3)([A,b,O]),A==="zIndex"&&(this.canvas.style.zIndex=b),A==="transform"||A==="translate"||A==="rotate"||A==="scale"||A==="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,A=_ref153$clear===void 0?!0:_ref153$clear;var b=this[f].length?this.getFBO():null;b&&this.renderer.glRenderer.bindFBO(b.target),A&&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,R=_this$getResolution5.height,W=[0,0,I/this.displayRatio,R/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 A=_ref154.width,b=_ref154.height;var O=this.renderer,L=O.__globalTransformMatrix||O.globalTransformMatrix,w=L[4],I=L[5],R=L[0],_this$getResolution6=this.getResolution(),W=_this$getResolution6.width,z=_this$getResolution6.height;(W!==A||z!==b)&&(_superPropGet(M,"setResolution",this,3)([{width:A,height:b}]),this.canvas&&(this.canvas.width=A,this.canvas.height=b,O.updateResolution&&O.updateResolution()),this.attributes.size=[A,b],this[f].length&&this[f].forEach(function(U){var G=new e.Figure2D();G.rect(0,0,A/_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||R!==q)&&(O.setGlobalTransform(q,0,0,q,K,k),O.__globalTransformMatrix=null,this[m]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
382
+ },{key:"addPass",value:function addPass(){var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},A=_ref151.vertex,w=_ref151.fragment,O=_ref151.options,L=_ref151.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),b=_this$getResolution3.width,I=_this$getResolution3.height,R=this.renderer.createPassProgram({vertex:A,fragment:w,options:O}),W=new e.Figure2D();W.rect(0,0,b/this.displayRatio,I/this.displayRatio);var z=new e.Mesh2D(W);return z.setUniforms(L),z.setProgram(R),this[f].push(z),this.forceUpdate(),z;}return null;}// delete unused texture to release memory.
383
+ },{key:"deleteTexture",value:function deleteTexture(A){return Object(l.deleteTexture)(A,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(A){var w=A.type;if(w==="mousedown"||w==="mouseup"||w==="mousemove"){var R=this.__mouseCapturedTarget;if(R){if(R.layer===this)return R.dispatchEvent(A),!0;this.__mouseCapturedTarget=null;}}var O,L;var b=this.layerTransformInvert;if(b){O=A.x,L=A.y;var _R6=b,W=_R6[0]*O+_R6[2]*L+_R6[4],z=_R6[1]*O+_R6[3]*L+_R6[5];delete A.x,delete A.y,delete A.layerX,delete A.layerY,Object.defineProperties(A,{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)([A]);return b&&Object.defineProperties(A,{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 A=null;var w=new Promise(function(O){A=O;});w._resolve=A,this[v]=w;}else{var _A2=null,_w8=null;var O=new Promise(function(L){_A2=L,_this50[y]&&(_w8=Object(a.requestAnimationFrame)(function(){delete O._requestID,_this50.render();}));});O._resolve=_A2,O._requestID=_w8,this[v]=O;}}},{key:"getFBO",value:function getFBO(){var A=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),w=_this$getResolution4.width,O=_this$getResolution4.height;return A&&(!this[g]||this[g].width!==w||this[g].height!==O)?(this[g]={width:w,height:O,target:A.createFBO(),buffer:A.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 A=this.renderer,w=A.__globalTransformMatrix||A.globalTransformMatrix;A.__globalTransformMatrix=w;var O=i.mat2d.fromValues(1,0,0,1,0,0);A.setGlobalTransform.apply(A,_toConsumableArray(i.mat2d.multiply(O,w,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(A,w,O){if(_superPropGet(M,"onPropertyChange",this,3)([A,w,O]),A==="zIndex"&&(this.canvas.style.zIndex=w),A==="transform"||A==="translate"||A==="rotate"||A==="scale"||A==="skew"){var L=this[m];if(this[m]=null,this.updateGlobalTransform(),L&&!this.layerTransformInvert){var b=this.renderer,I=b.__globalTransformMatrix||b.globalTransformMatrix;b.setGlobalTransform.apply(b,_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,A=_ref153$clear===void 0?!0:_ref153$clear;var w=this[f].length?this.getFBO():null;w&&this.renderer.glRenderer.bindFBO(w.target),A&&this[P].clear();var O=this.draw();if(O&&O.length&&(this.renderer.drawMeshes(O),this.canvas.draw&&this.canvas.draw()),w){var L=this.renderer.glRenderer,b=this[f].length,_this$getResolution5=this.getResolution(),I=_this$getResolution5.width,R=_this$getResolution5.height,W=[0,0,I/this.displayRatio,R/this.displayRatio];this[f].forEach(function(z,K){z.blend=!0,z.setTexture(w.target.texture,{rect:W}),K===b-1?L.bindFBO(null):(w.swap(),L.bindFBO(w.target)),_this51[P].clear(),_this51.renderer.drawMeshes([z]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref154){var _this52=this;var A=_ref154.width,w=_ref154.height;var O=this.renderer,L=O.__globalTransformMatrix||O.globalTransformMatrix,b=L[4],I=L[5],R=L[0],_this$getResolution6=this.getResolution(),W=_this$getResolution6.width,z=_this$getResolution6.height;(W!==A||z!==w)&&(_superPropGet(M,"setResolution",this,3)([{width:A,height:w}]),this.canvas&&(this.canvas.width=A,this.canvas.height=w,O.updateResolution&&O.updateResolution()),this.attributes.size=[A,w],this[f].length&&this[f].forEach(function(U){var G=new e.Figure2D();G.rect(0,0,A/_this52.displayRatio,w/_this52.displayRatio),U.contours=G.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),K=_this$renderOffset[0],k=_this$renderOffset[1],q=this.displayRatio;(b!==K||I!==k||R!==q)&&(O.setGlobalTransform(q,0,0,q,K,k),O.__globalTransformMatrix=null,this[m]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
384
384
  * tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
385
385
  * @param {*} handler
386
386
  * @param {*} options
387
- */},{key:"tick",value:function tick(){var _this53=this;var A=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:A,duration:O});var _R7=function R(){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[T]||(I[T]=Promise.resolve().then(function(){I[y]&&I.render(),delete I[T];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&&_R7();}));};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;}};_R7();}},{key:"toGlobalPos",value:function toGlobalPos(A,b){if(this.layerTransformInvert){var W=this.transformMatrix;A=W[0]*A+W[2]*b+W[4],b=W[1]*A+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];A=A*I[0]/O+w[0],b=b*I[1]/L+w[1];var R=this.displayRatio;return A*=R,b*=R,[A,b];}},{key:"toLocalPos",value:function toLocalPos(A,b){var _this$getResolution8=this.getResolution(),O=_this$getResolution8.width,L=_this$getResolution8.height,w=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];A=A*O/I[0]-w[0],b=b*L/I[1]-w[1];var R=this.displayRatio;A/=R,b/=R;var W=this.layerTransformInvert;return W&&(A=W[0]*A+W[2]*b+W[4],b=W[1]*A+W[3]*b+W[5]),[A,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(T,f){if(T==null)return{};var g=l(T,f),u,m;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);for(m=0;m<M.length;m++)u=M[m],!(f.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(T,u)&&(g[u]=T[u]);}return g;}function l(T,f){if(T==null)return{};var g={},u=Object.keys(T),m,M;for(M=0;M<u.length;M++)m=u[M],!(f.indexOf(m)>=0)&&(g[m]=T[m]);return g;}function d(T,f,g){return f in T?Object.defineProperty(T,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):T[f]=g,T;}var c="http://www.w3.org/2000/svg",p=Symbol["for"]("spritejs_setAttribute"),y=Symbol("root"),P=Symbol("task");function x(T){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var g=T[y];if(g&&g.children[0]){var u=T.svg,m=T.layer?T.layer.displayRatio:1;if(!u.hasAttribute("data-original-width")){var A=u.getAttribute("width");A=A?Object(o.sizeToPixel)(A):300;var b=u.getAttribute("height");b=b?Object(o.sizeToPixel)(b):150,u.hasAttribute("viewBox")||u.setAttribute("viewBox","0 0 ".concat(Math.round(A)," ").concat(Math.round(b))),u.setAttribute("data-original-width",A),u.setAttribute("data-original-height",b);}var M=T.attributes.width||Number(u.getAttribute("data-original-width")),E=T.attributes.height||Number(u.getAttribute("data-original-height"));if(M*=m,E*=m,f&&T.attributes.flexible){var _A3=T.attributes.scale[0];if(M*=_A3,E*=_A3,u.setAttribute("width",M),u.setAttribute("height",E),M&&E&&T.textureImage){var _b9=T.textureImage.width,O=T.textureImage.height,L=T.clientSize;T.attributes.textureRect=[0,0,Math.round(L[0]*_b9/M),Math.round(L[1]*O/E)];}}else T[P]||(u.setAttribute("width",M),u.setAttribute("height",E),T[P]=Promise.resolve().then(function(){delete T[P];var A=g.innerHTML,b=new Blob([A],{type:"image/svg+xml"}),O=URL.createObjectURL(b),L=new Image();L.onload=function(){L.width&&L.height?(T.attributes[p]("texture",L),T.attributes.flexible&&(T.attributes.textureRect=null)):T.attributes[p]("texture",null);},L.src=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)&&x(_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){x(_this54,!1);});_m8.observe(_this54[y],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this54.observer=_m8;}return _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}]),x(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 A=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===A.type){var w=null;if(A instanceof MouseEvent)w=new MouseEvent(L,{screenX:M,screenY:E,clientX:M,clientY:E,bubbles:A.bubbles,button:A.button,buttons:A.buttons,cancelBubble:A.cancelBubble,cancelable:A.cancelable,currentTarget:A.currentTarget,fromElement:A.fromElement,relatedTarget:A.relatedTarget,returnValue:A.returnValue,srcElement:A.srcElement,target:A.target,toElement:A.toElement,// view: originalEvent.view,
388
- which:A.witch});else if(A instanceof TouchEvent){var I=null;var R=A.changedTouches||[A];for(var W=0;W<R.length;W++){var z=R[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:A.cancelable,bubbles:A.bubbles,composed:A.composed,touches:[_W3],targetTouches:[_W3],changedTouches:[_W3]});}}else w=A;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"&&x(this),this.attributes.flexible&&(f==="width"||f==="height"||f==="scale"||f==="transform")&&x(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
387
+ */},{key:"tick",value:function tick(){var _this53=this;var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _w$duration=w.duration,O=_w$duration===void 0?1/0:_w$duration,L=d(w,["duration"]);var b=this.timeline.fork(L),I=this;this[u]=this[u]||[],this[u].push({handler:A,duration:O});var _R7=function R(){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,b.currentTime/U);return{value:q?q(b.currentTime,G):null,p:G};});I[T]||(I[T]=Promise.resolve().then(function(){I[y]&&I.render(),delete I[T];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&&_R7();}));};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;}};_R7();}},{key:"toGlobalPos",value:function toGlobalPos(A,w){if(this.layerTransformInvert){var W=this.transformMatrix;A=W[0]*A+W[2]*w+W[4],w=W[1]*A+W[3]*w+W[5];}var _this$getResolution7=this.getResolution(),O=_this$getResolution7.width,L=_this$getResolution7.height,b=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];A=A*I[0]/O+b[0],w=w*I[1]/L+b[1];var R=this.displayRatio;return A*=R,w*=R,[A,w];}},{key:"toLocalPos",value:function toLocalPos(A,w){var _this$getResolution8=this.getResolution(),O=_this$getResolution8.width,L=_this$getResolution8.height,b=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];A=A*O/I[0]-b[0],w=w*L/I[1]-b[1];var R=this.displayRatio;A/=R,w/=R;var W=this.layerTransformInvert;return W&&(A=W[0]*A+W[2]*w+W[4],w=W[1]*A+W[3]*w+W[5]),[A,w];}}]);}(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(T,f){if(T==null)return{};var g=l(T,f),u,m;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);for(m=0;m<M.length;m++)u=M[m],!(f.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(T,u)&&(g[u]=T[u]);}return g;}function l(T,f){if(T==null)return{};var g={},u=Object.keys(T),m,M;for(M=0;M<u.length;M++)m=u[M],!(f.indexOf(m)>=0)&&(g[m]=T[m]);return g;}function d(T,f,g){return f in T?Object.defineProperty(T,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):T[f]=g,T;}var c="http://www.w3.org/2000/svg",p=Symbol["for"]("spritejs_setAttribute"),y=Symbol("root"),P=Symbol("task");function x(T){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var g=T[y];if(g&&g.children[0]){var u=T.svg,m=T.layer?T.layer.displayRatio:1;if(!u.hasAttribute("data-original-width")){var A=u.getAttribute("width");A=A?Object(o.sizeToPixel)(A):300;var w=u.getAttribute("height");w=w?Object(o.sizeToPixel)(w):150,u.hasAttribute("viewBox")||u.setAttribute("viewBox","0 0 ".concat(Math.round(A)," ").concat(Math.round(w))),u.setAttribute("data-original-width",A),u.setAttribute("data-original-height",w);}var M=T.attributes.width||Number(u.getAttribute("data-original-width")),E=T.attributes.height||Number(u.getAttribute("data-original-height"));if(M*=m,E*=m,f&&T.attributes.flexible){var _A3=T.attributes.scale[0];if(M*=_A3,E*=_A3,u.setAttribute("width",M),u.setAttribute("height",E),M&&E&&T.textureImage){var _w9=T.textureImage.width,O=T.textureImage.height,L=T.clientSize;T.attributes.textureRect=[0,0,Math.round(L[0]*_w9/M),Math.round(L[1]*O/E)];}}else T[P]||(u.setAttribute("width",M),u.setAttribute("height",E),T[P]=Promise.resolve().then(function(){delete T[P];var A=g.innerHTML,w=new Blob([A],{type:"image/svg+xml"}),O=URL.createObjectURL(w),L=new Image();L.onload=function(){L.width&&L.height?(T.attributes[p]("texture",L),T.attributes.flexible&&(T.attributes.textureRect=null)):T.attributes[p]("texture",null);},L.src=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)&&x(_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){x(_this54,!1);});_m8.observe(_this54[y],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this54.observer=_m8;}return _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}]),x(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 A=f.originalEvent,w=this.attributes.anchor,O=this.clientSize;M=(M+w[0]*O[0])/2,E=(E+w[1]*O[1])/2;var L=f.type;if(L===A.type){var b=null;if(A instanceof MouseEvent)b=new MouseEvent(L,{screenX:M,screenY:E,clientX:M,clientY:E,bubbles:A.bubbles,button:A.button,buttons:A.buttons,cancelBubble:A.cancelBubble,cancelable:A.cancelable,currentTarget:A.currentTarget,fromElement:A.fromElement,relatedTarget:A.relatedTarget,returnValue:A.returnValue,srcElement:A.srcElement,target:A.target,toElement:A.toElement,// view: originalEvent.view,
388
+ which:A.witch});else if(A instanceof TouchEvent){var I=null;var R=A.changedTouches||[A];for(var W=0;W<R.length;W++){var z=R[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});b=new TouchEvent(L,{cancelable:A.cancelable,bubbles:A.bubbles,composed:A.composed,touches:[_W3],targetTouches:[_W3],changedTouches:[_W3]});}}else b=A;b&&this.svg.dispatchEvent(b);}}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"&&x(this),this.attributes.flexible&&(f==="width"||f==="height"||f==="scale"||f==="transform")&&x(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
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 _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 x(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(A,b){E.parent=A,Object.defineProperty(E,"zOrder",{value:b,writable:!1,configurable:!0});},E.disconnect=function(A){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,A){var b=E.children;var O=null;for(var L=0;L<b.length;L++){var w=b[L];if((A===w||O!=null)&&(O=w),O&&O!==A&&!O.offscreen)return O.canvas;}return null;}function T(E,A){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(A.canvas,-b/I,-O/I,L/I,w/I);}var f={};function g(E){var A=["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}),A.forEach(function(O){b.addEventListener(O,function(L){var _E$options=E.options,w=_E$options.left,I=_E$options.top,R=_E$options.displayRatio,W=E.orderedChildren;Object(d["default"])(L,{offsetLeft:w,offsetTop:I,displayRatio:R}).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 rt=q.ancestors||[];_G2=/* @__PURE__ */new Set([q].concat(_toConsumableArray(rt)));}else _G2=/* @__PURE__ */new Set();var Z=Object.entries(L);if(!_U3.has(q)&&q){var _rt2=new c["default"]("mouseenter");_rt2.setOriginalEvent(L),Z.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),J=_ref159[0],ht=_ref159[1];_rt2[J]=ht;}),_U3.add(q),q.dispatchEvent(_rt2);var tt=q.ancestors;tt&&tt.forEach(function(J){J instanceof a["default"]&&!_U3.has(J)&&(_U3.add(J),J.dispatchEvent(_rt2));});}var nt=new c["default"]("mouseleave");nt.setOriginalEvent(L),Z.forEach(function(_ref160){var _ref161=_slicedToArray(_ref160,2),rt=_ref161[0],tt=_ref161[1];nt[rt]=tt;}),_toConsumableArray(_U3).forEach(function(rt){_G2.has(rt)||(_U3["delete"](rt),rt.dispatchEvent(nt));});}});},{passive:O!=="contextmenu"});});}function u(E,A){if(A&&A.style){var b=E.width,O=E.height,L=E.mode,w=E.container;var I=w.clientWidth,R=w.clientHeight;b=b||I,O=O||R,L==="static"?(A.style.width="".concat(b,"px"),A.style.height="".concat(O,"px")):(A.style.top="0",A.style.left="0",A.style.width="".concat(I,"px"),A.style.height="".concat(R,"px"),A.style.transform="",A.style.webkitTransform="");}}var m=Symbol("offscreenLayerCount");var M=/*#__PURE__*/function(_l$default){/**
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 _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 x(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(A,w){E.parent=A,Object.defineProperty(E,"zOrder",{value:w,writable:!1,configurable:!0});},E.disconnect=function(A){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,A){var w=E.children;var O=null;for(var L=0;L<w.length;L++){var b=w[L];if((A===b||O!=null)&&(O=b),O&&O!==A&&!O.offscreen)return O.canvas;}return null;}function T(E,A){var _E$renderOffset=_slicedToArray(E.renderOffset,2),w=_E$renderOffset[0],O=_E$renderOffset[1],_E$getResolution=E.getResolution(),L=_E$getResolution.width,b=_E$getResolution.height,I=E.displayRatio;E.renderer.drawImage(A.canvas,-w/I,-O/I,L/I,b/I);}var f={};function g(E){var A=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],w=E.container;w.addEventListener("mouseleave",function(O){var L=E[P];if(L.size){var b=new c["default"]("mouseleave");b.setOriginalEvent(O),_toConsumableArray(L).forEach(function(I){I.dispatchEvent(b);}),E[P].clear();}},{passive:!0}),A.forEach(function(O){w.addEventListener(O,function(L){var _E$options=E.options,b=_E$options.left,I=_E$options.top,R=_E$options.displayRatio,W=E.orderedChildren;Object(d["default"])(L,{offsetLeft:b,offsetTop:I,displayRatio:R}).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 rt=q.ancestors||[];_G2=/* @__PURE__ */new Set([q].concat(_toConsumableArray(rt)));}else _G2=/* @__PURE__ */new Set();var Z=Object.entries(L);if(!_U3.has(q)&&q){var _rt2=new c["default"]("mouseenter");_rt2.setOriginalEvent(L),Z.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),J=_ref159[0],ht=_ref159[1];_rt2[J]=ht;}),_U3.add(q),q.dispatchEvent(_rt2);var tt=q.ancestors;tt&&tt.forEach(function(J){J instanceof a["default"]&&!_U3.has(J)&&(_U3.add(J),J.dispatchEvent(_rt2));});}var nt=new c["default"]("mouseleave");nt.setOriginalEvent(L),Z.forEach(function(_ref160){var _ref161=_slicedToArray(_ref160,2),rt=_ref161[0],tt=_ref161[1];nt[rt]=tt;}),_toConsumableArray(_U3).forEach(function(rt){_G2.has(rt)||(_U3["delete"](rt),rt.dispatchEvent(nt));});}});},{passive:O!=="contextmenu"});});}function u(E,A){if(A&&A.style){var w=E.width,O=E.height,L=E.mode,b=E.container;var I=b.clientWidth,R=b.clientHeight;w=w||I,O=O||R,L==="static"?(A.style.width="".concat(w,"px"),A.style.height="".concat(O,"px")):(A.style.top="0",A.style.left="0",A.style.width="".concat(I,"px"),A.style.height="".concat(R,"px"),A.style.transform="",A.style.webkitTransform="");}}var m=Symbol("offscreenLayerCount");var M=/*#__PURE__*/function(_l$default){/**
391
391
  width
392
392
  height
393
393
  mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
394
- */function M(){var _this57;var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this57=_callSuper(this,M),!A.container)if(typeof n.ENV.Container=="function")A.container=new n.ENV.Container(A.width||300,A.height||150);else throw new Error("No container specified.");if(_this57.container=A.container,_this57.container.style&&(_this57.container.style.overflow||(_this57.container.style.overflow="hidden"),_this57.container.style.position||(_this57.container.style.position="relative")),_this57.options=A,A.displayRatio=A.displayRatio||1,A.mode=A.mode||"scale",A.left=0,A.top=0,A.autoResize=A.autoResize!==!1,A.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=_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(A),g(_this57),_this57[m]=0;return _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(A){this.options.displayRatio!==A&&(this.options.displayRatio=A,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(A){this.options.height!==A&&(this.options.height=A,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(A){this.options.mode!==A&&(this.options.mode=A,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(A){this.options.width!==A&&(this.options.width=A,this.resize());}},{key:"appendChild",value:function appendChild(A){!(A instanceof o["default"])&&!(A instanceof s["default"])&&x(A);var b=_superPropGet(M,"appendChild",this,3)([A]),O=A.canvas;return A.offscreen?this[m]++:this.container.appendChild(O),u(this.options,O),A.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(A,b){!(A instanceof o["default"])&&!(A instanceof s["default"])&&x(A);var O=_superPropGet(M,"insertBefore",this,3)([A,b]),L=A.canvas;if(!A.offscreen){var w=v(this,A);this.container.insertBefore(L,w);}return u(this.options,L),A.setResolution(this.getResolution()),O;}},{key:"layer",value:function layer(){var A=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=A;var O=this.orderedChildren;for(var I=0;I<O.length;I++)if(O[I].id===A)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,A,_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,A=new Array(_len13),_key13=0;_key13<_len13;_key13++){A[_key13]=_args21[_key13];}b=[],O=[],L=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(w){var I,R,W,z;return _regeneratorRuntime().wrap(function _loop2$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:I=A[w];if(typeof I=="string")R=Object(p.loadTexture)(I);else if(Array.isArray(I))R=Object(p.loadFrames).apply(void 0,_toConsumableArray(I));else{W=I.id,z=I.src;R=Object(p.loadTexture)(z,W);}R instanceof Promise||(R=Promise.resolve(R)),O.push(R.then(function(W){b.push(W),L[w]=W;var z=new c["default"]({type:"preload",detail:{current:W,loaded:b,resources:A}});_this59.dispatchEvent(z);}));case 3:case"end":return _context20.stop();}},_loop2);});w=0;case 4:if(!(w<A.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(A){var b=_superPropGet(M,"removeChild",this,3)([A]);if(b){A._prepareRenderFinished&&A._prepareRenderFinished();var O=A.canvas;O&&O.remove&&O.remove(),A.offscreen&&this[m]--;}return b;}// for offscreen mode rendering
395
- },{key:"render",value:function render(){var A=this.orderedChildren;var b=null;var O=[];for(var L=0;L<A.length;L++){var w=A[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 R=0;R<O.length;R++){var W=O[R];W.render(),T(w,W);}O.length=0,w.render({clear:!1});}else w.prepareRender&&w.render();}else w.offscreen?b?(w.prepareRender&&w.render(),T(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(A,b){var O=_superPropGet(M,"replaceChild",this,3)([A,b]);b.canvas.remove&&b.canvas.remove(),b.offscreen&&this[m]--;var L=A.canvas;if(!A.offscreen){var w=v(this,A);this.container.insertBefore(L,w);}return u(this.options,L),A.setResolution(this.getResolution()),O;}},{key:"resize",value:function resize(){var A=this.options;this.children.forEach(function(b){u(A,b.canvas);}),this.setResolution(A),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _A4,_b10;var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},A=_ref162.width,b=_ref162.height;var O=this.container,L=O.clientWidth,w=O.clientHeight;(A==null||b==null)&&(A=(_A4=A)!==null&&_A4!==void 0?_A4:L,b=(_b10=b)!==null&&_b10!==void 0?_b10:w);var _this$options=this.options,I=_this$options.mode,R=_this$options.displayRatio;if(A*=R,b*=R,this.options.left=0,this.options.top=0,I==="stickyHeight"||I==="stickyLeft"||I==="stickyRight"){var W=A;A=L*b/w,I==="stickyHeight"&&(this.options.left=0.5*(A-W)),I==="stickyRight"&&(this.options.left=A-W);}else if(I==="stickyWidth"||I==="stickyTop"||I==="stickyBottom"){var _W4=b;b=w*A/L,I==="stickyWidth"&&(this.options.top=0.5*(b-_W4)),I==="stickyBottom"&&(this.options.top=b-_W4);}_superPropGet(M,"setResolution",this,3)([{width:A,height:b}]);}},{key:"snapshot",value:function snapshot(){var _ref163=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref163$offscreen=_ref163.offscreen,A=_ref163$offscreen===void 0?!1:_ref163$offscreen,b=_ref163.layers;var O=A?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),L=_this$getResolution9.width,w=_this$getResolution9.height;this[O]=this[O]||n.ENV.createCanvas(L,w,{offscreen:A});var I=this[O].getContext("2d");b=b||this.orderedChildren,this[O].width=L,this[O].height=w;for(var R=0;R<b.length;R++){var W=b[R];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 A=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var b=A.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,A));}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,x=_i$target$getBounding.height,v=i.target.width,T=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,A=m.clientY;E!=null&&A!=null&&c.push({x:Math.round((E|0)-p),y:Math.round((A|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*T/x-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 Qi=Wt.Ellipse;Wt.Gradient;var kt=Wt.Group,qi=Wt.Label,_i=Wt.Layer;Wt.LayerWorker;Wt.Node;Wt.Parallel;var ce=Wt.Path,le=Wt.Polyline,Gr=Wt.Rect;Wt.Regular;Wt.Ring;var ts=Wt.Scene,es=Wt.Sprite;Wt.SpriteSvg;Wt.Star;Wt.Triangle;Wt.helpers;Wt.createElement;Wt.isSpriteNode;Wt.registerNode;Wt.requestAnimationFrame;Wt.cancelAnimationFrame;Wt.ENV;var Ue=(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 fe(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h["default"]:h;}var rs=_typeof(Ue)=="object"&&Ue&&Ue.Object===Object&&Ue,Bn=rs,ns=Bn,is=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,ss=ns||is||Function("return this")(),ee=ss,os=ee,as=os.Symbol,Be=as,Hr=Be,Fn=Object.prototype,ls=Fn.hasOwnProperty,cs=Fn.toString,Le=Hr?Hr.toStringTag:void 0;function fs(h){var r=ls.call(h,Le),t=h[Le];try{h[Le]=void 0;var e=!0;}catch(_unused18){}var n=cs.call(h);return e&&(r?h[Le]=t:delete h[Le]),n;}var hs=fs,us=Object.prototype,ds=us.toString;function gs(h){return ds.call(h);}var ps=gs,Kr=Be,ms=hs,vs=ps,ys="[object Null]",Ss="[object Undefined]",Yr=Kr?Kr.toStringTag:void 0;function xs(h){return h==null?h===void 0?Ss:ys:Yr&&Yr in Object(h)?ms(h):vs(h);}var de=xs;function Ts(h){return h!=null&&_typeof(h)=="object";}var ne=Ts,Ms=de,Ps=ne,Os="[object Number]";function Es(h){return typeof h=="number"||Ps(h)&&Ms(h)==Os;}var Cs=Es,_t=/* @__PURE__ */fe(Cs);function As(){this.__data__=[],this.size=0;}var Rs=As;function Is(h,r){return h===r||h!==h&&r!==r;}var Tr=Is,Ls=Tr;function bs(h,r){for(var t=h.length;t--;)if(Ls(h[t][0],r))return t;return-1;}var tr=bs,ws=tr,Ds=Array.prototype,Ns=Ds.splice;function Ws(h){var r=this.__data__,t=ws(r,h);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():Ns.call(r,t,1),--this.size,!0;}var Bs=Ws,Fs=tr;function Us(h){var r=this.__data__,t=Fs(r,h);return t<0?void 0:r[t][1];}var js=Us,$s=tr;function zs(h){return $s(this.__data__,h)>-1;}var Gs=zs,Hs=tr;function Ks(h,r){var t=this.__data__,e=Hs(t,h);return e<0?(++this.size,t.push([h,r])):t[e][1]=r,this;}var Ys=Ks,Vs=Rs,Xs=Bs,ks=js,Js=Gs,Zs=Ys;function Pe(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]);}}Pe.prototype.clear=Vs;Pe.prototype["delete"]=Xs;Pe.prototype.get=ks;Pe.prototype.has=Js;Pe.prototype.set=Zs;var er=Pe,Qs=er;function qs(){this.__data__=new Qs(),this.size=0;}var _s=qs;function to(h){var r=this.__data__,t=r["delete"](h);return this.size=r.size,t;}var eo=to;function ro(h){return this.__data__.get(h);}var no=ro;function io(h){return this.__data__.has(h);}var so=io;function oo(h){var r=_typeof(h);return h!=null&&(r=="object"||r=="function");}var he=oo,ao=de,lo=he,co="[object AsyncFunction]",fo="[object Function]",ho="[object GeneratorFunction]",uo="[object Proxy]";function go(h){if(!lo(h))return!1;var r=ao(h);return r==fo||r==ho||r==co||r==uo;}var Un=go,po=ee,mo=po["__core-js_shared__"],vo=mo,ar=vo,Vr=function(){var h=/[^.]+$/.exec(ar&&ar.keys&&ar.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:"";}();function yo(h){return!!Vr&&Vr in h;}var So=yo,xo=Function.prototype,To=xo.toString;function Mo(h){if(h!=null){try{return To.call(h);}catch(_unused19){}try{return h+"";}catch(_unused20){}}return"";}var jn=Mo,Po=Un,Oo=So,Eo=he,Co=jn,Ao=/[\\^$.*+?()[\]{}|]/g,Ro=/^\[object .+?Constructor\]$/,Io=Function.prototype,Lo=Object.prototype,bo=Io.toString,wo=Lo.hasOwnProperty,Do=RegExp("^"+bo.call(wo).replace(Ao,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function No(h){if(!Eo(h)||Oo(h))return!1;var r=Po(h)?Do:Ro;return r.test(Co(h));}var Wo=No;function Bo(h,r){return h==null?void 0:h[r];}var Fo=Bo,Uo=Wo,jo=Fo;function $o(h,r){var t=jo(h,r);return Uo(t)?t:void 0;}var ge=$o,zo=ge,Go=ee,Ho=zo(Go,"Map"),Mr=Ho,Ko=ge,Yo=Ko(Object,"create"),rr=Yo,Xr=rr;function Vo(){this.__data__=Xr?Xr(null):{},this.size=0;}var Xo=Vo;function ko(h){var r=this.has(h)&&delete this.__data__[h];return this.size-=r?1:0,r;}var Jo=ko,Zo=rr,Qo="__lodash_hash_undefined__",qo=Object.prototype,_o=qo.hasOwnProperty;function ta(h){var r=this.__data__;if(Zo){var t=r[h];return t===Qo?void 0:t;}return _o.call(r,h)?r[h]:void 0;}var ea=ta,ra=rr,na=Object.prototype,ia=na.hasOwnProperty;function sa(h){var r=this.__data__;return ra?r[h]!==void 0:ia.call(r,h);}var oa=sa,aa=rr,la="__lodash_hash_undefined__";function ca(h,r){var t=this.__data__;return this.size+=this.has(h)?0:1,t[h]=aa&&r===void 0?la:r,this;}var fa=ca,ha=Xo,ua=Jo,da=ea,ga=oa,pa=fa;function Oe(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]);}}Oe.prototype.clear=ha;Oe.prototype["delete"]=ua;Oe.prototype.get=da;Oe.prototype.has=ga;Oe.prototype.set=pa;var ma=Oe,kr=ma,va=er,ya=Mr;function Sa(){this.size=0,this.__data__={hash:new kr(),map:new(ya||va)(),string:new kr()};}var xa=Sa;function Ta(h){var r=_typeof(h);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?h!=="__proto__":h===null;}var Ma=Ta,Pa=Ma;function Oa(h,r){var t=h.__data__;return Pa(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var nr=Oa,Ea=nr;function Ca(h){var r=Ea(this,h)["delete"](h);return this.size-=r?1:0,r;}var Aa=Ca,Ra=nr;function Ia(h){return Ra(this,h).get(h);}var La=Ia,ba=nr;function wa(h){return ba(this,h).has(h);}var Da=wa,Na=nr;function Wa(h,r){var t=Na(this,h),e=t.size;return t.set(h,r),this.size+=t.size==e?0:1,this;}var Ba=Wa,Fa=xa,Ua=Aa,ja=La,$a=Da,za=Ba;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=Fa;Ee.prototype["delete"]=Ua;Ee.prototype.get=ja;Ee.prototype.has=$a;Ee.prototype.set=za;var $n=Ee,Ga=er,Ha=Mr,Ka=$n,Ya=200;function Va(h,r){var t=this.__data__;if(t instanceof Ga){var e=t.__data__;if(!Ha||e.length<Ya-1)return e.push([h,r]),this.size=++t.size,this;t=this.__data__=new Ka(e);}return t.set(h,r),this.size=t.size,this;}var Xa=Va,ka=er,Ja=_s,Za=eo,Qa=no,qa=so,_a=Xa;function Ce(h){var r=this.__data__=new ka(h);this.size=r.size;}Ce.prototype.clear=Ja;Ce.prototype["delete"]=Za;Ce.prototype.get=Qa;Ce.prototype.has=qa;Ce.prototype.set=_a;var zn=Ce;function tl(h,r){for(var t=-1,e=h==null?0:h.length;++t<e&&r(h[t],t,h)!==!1;);return h;}var el=tl,rl=ge,nl=function(){try{var h=rl(Object,"defineProperty");return h({},"",{}),h;}catch(_unused21){}}(),Gn=nl,Jr=Gn;function il(h,r,t){r=="__proto__"&&Jr?Jr(h,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):h[r]=t;}var Hn=il,sl=Hn,ol=Tr,al=Object.prototype,ll=al.hasOwnProperty;function cl(h,r,t){var e=h[r];(!(ll.call(h,r)&&ol(e,t))||t===void 0&&!(r in h))&&sl(h,r,t);}var Kn=cl,fl=Kn,hl=Hn;function ul(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?hl(t,o,s):fl(t,o,s);}return t;}var ir=ul;function dl(h,r){for(var t=-1,e=Array(h);++t<h;)e[t]=r(t);return e;}var gl=dl,pl=de,ml=ne,vl="[object Arguments]";function yl(h){return ml(h)&&pl(h)==vl;}var Sl=yl,Zr=Sl,xl=ne,Yn=Object.prototype,Tl=Yn.hasOwnProperty,Ml=Yn.propertyIsEnumerable,Pl=Zr(/* @__PURE__ */function(){return arguments;}())?Zr:function(h){return xl(h)&&Tl.call(h,"callee")&&!Ml.call(h,"callee");},Vn=Pl,Ol=Array.isArray,Fe=Ol,ze={exports:{}};function El(){return!1;}var Cl=El;ze.exports;(function(h,r){var t=ee,e=Cl,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;})(ze,ze.exports);var Pr=ze.exports,Al=9007199254740991,Rl=/^(?:0|[1-9]\d*)$/;function Il(h,r){var _r2;var t=_typeof(h);return r=(_r2=r)!==null&&_r2!==void 0?_r2:Al,!!r&&(t=="number"||t!="symbol"&&Rl.test(h))&&h>-1&&h%1==0&&h<r;}var Ll=Il,bl=9007199254740991;function wl(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=bl;}var Xn=wl,Dl=de,Nl=Xn,Wl=ne,Bl="[object Arguments]",Fl="[object Array]",Ul="[object Boolean]",jl="[object Date]",$l="[object Error]",zl="[object Function]",Gl="[object Map]",Hl="[object Number]",Kl="[object Object]",Yl="[object RegExp]",Vl="[object Set]",Xl="[object String]",kl="[object WeakMap]",Jl="[object ArrayBuffer]",Zl="[object DataView]",Ql="[object Float32Array]",ql="[object Float64Array]",_l="[object Int8Array]",tc="[object Int16Array]",ec="[object Int32Array]",rc="[object Uint8Array]",nc="[object Uint8ClampedArray]",ic="[object Uint16Array]",sc="[object Uint32Array]",Ut={};Ut[Ql]=Ut[ql]=Ut[_l]=Ut[tc]=Ut[ec]=Ut[rc]=Ut[nc]=Ut[ic]=Ut[sc]=!0;Ut[Bl]=Ut[Fl]=Ut[Jl]=Ut[Ul]=Ut[Zl]=Ut[jl]=Ut[$l]=Ut[zl]=Ut[Gl]=Ut[Hl]=Ut[Kl]=Ut[Yl]=Ut[Vl]=Ut[Xl]=Ut[kl]=!1;function oc(h){return Wl(h)&&Nl(h.length)&&!!Ut[Dl(h)];}var ac=oc;function lc(h){return function(r){return h(r);};}var sr=lc,Ge={exports:{}};Ge.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;})(Ge,Ge.exports);var Or=Ge.exports,cc=ac,fc=sr,Qr=Or,qr=Qr&&Qr.isTypedArray,hc=qr?fc(qr):cc,kn=hc,uc=gl,dc=Vn,gc=Fe,pc=Pr,mc=Ll,vc=kn,yc=Object.prototype,Sc=yc.hasOwnProperty;function xc(h,r){var t=gc(h),e=!t&&dc(h),n=!t&&!e&&pc(h),i=!t&&!e&&!n&&vc(h),a=t||e||n||i,o=a?uc(h.length,String):[],s=o.length;for(var l in h)(r||Sc.call(h,l))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.
394
+ */function M(){var _this57;var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this57=_callSuper(this,M),!A.container)if(typeof n.ENV.Container=="function")A.container=new n.ENV.Container(A.width||300,A.height||150);else throw new Error("No container specified.");if(_this57.container=A.container,_this57.container.style&&(_this57.container.style.overflow||(_this57.container.style.overflow="hidden"),_this57.container.style.position||(_this57.container.style.position="relative")),_this57.options=A,A.displayRatio=A.displayRatio||1,A.mode=A.mode||"scale",A.left=0,A.top=0,A.autoResize=A.autoResize!==!1,A.autoResize){var w;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?w=globalThis:w=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:e,w.addEventListener){var O=_this57;w.addEventListener("resize",function L(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(O.container)?O.resize():w.removeEventListener("resize",L);});}}_this57[P]=/* @__PURE__ */new Set(),_this57.setResolution(A),g(_this57),_this57[m]=0;return _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(A){this.options.displayRatio!==A&&(this.options.displayRatio=A,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(A){this.options.height!==A&&(this.options.height=A,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(A){this.options.mode!==A&&(this.options.mode=A,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(A){this.options.width!==A&&(this.options.width=A,this.resize());}},{key:"appendChild",value:function appendChild(A){!(A instanceof o["default"])&&!(A instanceof s["default"])&&x(A);var w=_superPropGet(M,"appendChild",this,3)([A]),O=A.canvas;return A.offscreen?this[m]++:this.container.appendChild(O),u(this.options,O),A.setResolution(this.getResolution()),w;}/* 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(A,w){!(A instanceof o["default"])&&!(A instanceof s["default"])&&x(A);var O=_superPropGet(M,"insertBefore",this,3)([A,w]),L=A.canvas;if(!A.offscreen){var b=v(this,A);this.container.insertBefore(L,b);}return u(this.options,L),A.setResolution(this.getResolution()),O;}},{key:"layer",value:function layer(){var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};w=Object.assign({},this.options,w),w.id=A;var O=this.orderedChildren;for(var I=0;I<O.length;I++)if(O[I].id===A)return O[I];var L=w.worker;var b;return L?b=new s["default"](w):b=new o["default"](w),this.appendChild(b),b;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(){var _this59=this;var _len13,A,_key13,w,O,L,_loop2,b,_args21=arguments;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:for(_len13=_args21.length,A=new Array(_len13),_key13=0;_key13<_len13;_key13++){A[_key13]=_args21[_key13];}w=[],O=[],L=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(b){var I,R,W,z;return _regeneratorRuntime().wrap(function _loop2$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:I=A[b];if(typeof I=="string")R=Object(p.loadTexture)(I);else if(Array.isArray(I))R=Object(p.loadFrames).apply(void 0,_toConsumableArray(I));else{W=I.id,z=I.src;R=Object(p.loadTexture)(z,W);}R instanceof Promise||(R=Promise.resolve(R)),O.push(R.then(function(W){w.push(W),L[b]=W;var z=new c["default"]({type:"preload",detail:{current:W,loaded:w,resources:A}});_this59.dispatchEvent(z);}));case 3:case"end":return _context20.stop();}},_loop2);});b=0;case 4:if(!(b<A.length)){_context21.next=9;break;}return _context21.delegateYield(_loop2(b),"t0",6);case 6:b++;_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(A){var w=_superPropGet(M,"removeChild",this,3)([A]);if(w){A._prepareRenderFinished&&A._prepareRenderFinished();var O=A.canvas;O&&O.remove&&O.remove(),A.offscreen&&this[m]--;}return w;}// for offscreen mode rendering
395
+ },{key:"render",value:function render(){var A=this.orderedChildren;var w=null;var O=[];for(var L=0;L<A.length;L++){var b=A[L],I=O.length>0;if(b instanceof o["default"]&&!b.offscreen){if(!b.autoRender)I&&(console.warn("Some offscreen canvas will not be rendered."),O.length=0);else if(w=b,I){b.renderer.clear();for(var R=0;R<O.length;R++){var W=O[R];W.render(),T(b,W);}O.length=0,b.render({clear:!1});}else b.prepareRender&&b.render();}else b.offscreen?w?(b.prepareRender&&b.render(),T(w,b)):O.push(b):b instanceof s["default"]&&I&&(console.warn("Some offscreen canvas will not be rendered."),O.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(A,w){var O=_superPropGet(M,"replaceChild",this,3)([A,w]);w.canvas.remove&&w.canvas.remove(),w.offscreen&&this[m]--;var L=A.canvas;if(!A.offscreen){var b=v(this,A);this.container.insertBefore(L,b);}return u(this.options,L),A.setResolution(this.getResolution()),O;}},{key:"resize",value:function resize(){var A=this.options;this.children.forEach(function(w){u(A,w.canvas);}),this.setResolution(A),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _A4,_w10;var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},A=_ref162.width,w=_ref162.height;var O=this.container,L=O.clientWidth,b=O.clientHeight;(A==null||w==null)&&(A=(_A4=A)!==null&&_A4!==void 0?_A4:L,w=(_w10=w)!==null&&_w10!==void 0?_w10:b);var _this$options=this.options,I=_this$options.mode,R=_this$options.displayRatio;if(A*=R,w*=R,this.options.left=0,this.options.top=0,I==="stickyHeight"||I==="stickyLeft"||I==="stickyRight"){var W=A;A=L*w/b,I==="stickyHeight"&&(this.options.left=0.5*(A-W)),I==="stickyRight"&&(this.options.left=A-W);}else if(I==="stickyWidth"||I==="stickyTop"||I==="stickyBottom"){var _W4=w;w=b*A/L,I==="stickyWidth"&&(this.options.top=0.5*(w-_W4)),I==="stickyBottom"&&(this.options.top=w-_W4);}_superPropGet(M,"setResolution",this,3)([{width:A,height:w}]);}},{key:"snapshot",value:function snapshot(){var _ref163=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref163$offscreen=_ref163.offscreen,A=_ref163$offscreen===void 0?!1:_ref163$offscreen,w=_ref163.layers;var O=A?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),L=_this$getResolution9.width,b=_this$getResolution9.height;this[O]=this[O]||n.ENV.createCanvas(L,b,{offscreen:A});var I=this[O].getContext("2d");w=w||this.orderedChildren,this[O].width=L,this[O].height=b;for(var R=0;R<w.length;R++){var W=w[R];if(!W.options.ignoreSnapshot){W.render&&W.render();var z=W.canvas;z&&z!==W&&I.drawImage(z,0,0,L,b);}}return this[O];}}]);}(l["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(M.prototype.layer3d=function(E){var _this60=this;var A=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var w=A.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(O,L){var b=document.createElement("script");b.async=!1,b.src=w,b.onload=function(){try{O(_this60.layer3d(E,A));}catch(I){L(I);}},document.documentElement.appendChild(b);});}),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,x=_i$target$getBounding.height,v=i.target.width,T=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,A=m.clientY;E!=null&&A!=null&&c.push({x:Math.round((E|0)-p),y:Math.round((A|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*T/x-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 Qi=Wt.Ellipse;Wt.Gradient;var kt=Wt.Group,qi=Wt.Label,_i=Wt.Layer;Wt.LayerWorker;Wt.Node;Wt.Parallel;var ce=Wt.Path,le=Wt.Polyline,Gr=Wt.Rect;Wt.Regular;Wt.Ring;var ts=Wt.Scene,es=Wt.Sprite;Wt.SpriteSvg;Wt.Star;Wt.Triangle;Wt.helpers;Wt.createElement;Wt.isSpriteNode;Wt.registerNode;Wt.requestAnimationFrame;Wt.cancelAnimationFrame;Wt.ENV;var Ue=(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 fe(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h["default"]:h;}var rs=_typeof(Ue)=="object"&&Ue&&Ue.Object===Object&&Ue,Bn=rs,ns=Bn,is=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,ss=ns||is||Function("return this")(),ee=ss,os=ee,as=os.Symbol,Be=as,Hr=Be,Fn=Object.prototype,ls=Fn.hasOwnProperty,cs=Fn.toString,Le=Hr?Hr.toStringTag:void 0;function fs(h){var r=ls.call(h,Le),t=h[Le];try{h[Le]=void 0;var e=!0;}catch(_unused18){}var n=cs.call(h);return e&&(r?h[Le]=t:delete h[Le]),n;}var hs=fs,us=Object.prototype,ds=us.toString;function gs(h){return ds.call(h);}var ps=gs,Kr=Be,ms=hs,vs=ps,ys="[object Null]",Ss="[object Undefined]",Yr=Kr?Kr.toStringTag:void 0;function xs(h){return h==null?h===void 0?Ss:ys:Yr&&Yr in Object(h)?ms(h):vs(h);}var de=xs;function Ts(h){return h!=null&&_typeof(h)=="object";}var ne=Ts,Ms=de,Ps=ne,Os="[object Number]";function Es(h){return typeof h=="number"||Ps(h)&&Ms(h)==Os;}var Cs=Es,Zt=/* @__PURE__ */fe(Cs);function As(){this.__data__=[],this.size=0;}var Rs=As;function Is(h,r){return h===r||h!==h&&r!==r;}var Tr=Is,Ls=Tr;function ws(h,r){for(var t=h.length;t--;)if(Ls(h[t][0],r))return t;return-1;}var tr=ws,bs=tr,Ds=Array.prototype,Ns=Ds.splice;function Ws(h){var r=this.__data__,t=bs(r,h);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():Ns.call(r,t,1),--this.size,!0;}var Bs=Ws,Fs=tr;function Us(h){var r=this.__data__,t=Fs(r,h);return t<0?void 0:r[t][1];}var js=Us,$s=tr;function zs(h){return $s(this.__data__,h)>-1;}var Gs=zs,Hs=tr;function Ks(h,r){var t=this.__data__,e=Hs(t,h);return e<0?(++this.size,t.push([h,r])):t[e][1]=r,this;}var Ys=Ks,Vs=Rs,Xs=Bs,ks=js,Js=Gs,Zs=Ys;function Pe(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]);}}Pe.prototype.clear=Vs;Pe.prototype["delete"]=Xs;Pe.prototype.get=ks;Pe.prototype.has=Js;Pe.prototype.set=Zs;var er=Pe,Qs=er;function qs(){this.__data__=new Qs(),this.size=0;}var _s=qs;function to(h){var r=this.__data__,t=r["delete"](h);return this.size=r.size,t;}var eo=to;function ro(h){return this.__data__.get(h);}var no=ro;function io(h){return this.__data__.has(h);}var so=io;function oo(h){var r=_typeof(h);return h!=null&&(r=="object"||r=="function");}var he=oo,ao=de,lo=he,co="[object AsyncFunction]",fo="[object Function]",ho="[object GeneratorFunction]",uo="[object Proxy]";function go(h){if(!lo(h))return!1;var r=ao(h);return r==fo||r==ho||r==co||r==uo;}var Un=go,po=ee,mo=po["__core-js_shared__"],vo=mo,ar=vo,Vr=function(){var h=/[^.]+$/.exec(ar&&ar.keys&&ar.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:"";}();function yo(h){return!!Vr&&Vr in h;}var So=yo,xo=Function.prototype,To=xo.toString;function Mo(h){if(h!=null){try{return To.call(h);}catch(_unused19){}try{return h+"";}catch(_unused20){}}return"";}var jn=Mo,Po=Un,Oo=So,Eo=he,Co=jn,Ao=/[\\^$.*+?()[\]{}|]/g,Ro=/^\[object .+?Constructor\]$/,Io=Function.prototype,Lo=Object.prototype,wo=Io.toString,bo=Lo.hasOwnProperty,Do=RegExp("^"+wo.call(bo).replace(Ao,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function No(h){if(!Eo(h)||Oo(h))return!1;var r=Po(h)?Do:Ro;return r.test(Co(h));}var Wo=No;function Bo(h,r){return h==null?void 0:h[r];}var Fo=Bo,Uo=Wo,jo=Fo;function $o(h,r){var t=jo(h,r);return Uo(t)?t:void 0;}var ge=$o,zo=ge,Go=ee,Ho=zo(Go,"Map"),Mr=Ho,Ko=ge,Yo=Ko(Object,"create"),rr=Yo,Xr=rr;function Vo(){this.__data__=Xr?Xr(null):{},this.size=0;}var Xo=Vo;function ko(h){var r=this.has(h)&&delete this.__data__[h];return this.size-=r?1:0,r;}var Jo=ko,Zo=rr,Qo="__lodash_hash_undefined__",qo=Object.prototype,_o=qo.hasOwnProperty;function ta(h){var r=this.__data__;if(Zo){var t=r[h];return t===Qo?void 0:t;}return _o.call(r,h)?r[h]:void 0;}var ea=ta,ra=rr,na=Object.prototype,ia=na.hasOwnProperty;function sa(h){var r=this.__data__;return ra?r[h]!==void 0:ia.call(r,h);}var oa=sa,aa=rr,la="__lodash_hash_undefined__";function ca(h,r){var t=this.__data__;return this.size+=this.has(h)?0:1,t[h]=aa&&r===void 0?la:r,this;}var fa=ca,ha=Xo,ua=Jo,da=ea,ga=oa,pa=fa;function Oe(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]);}}Oe.prototype.clear=ha;Oe.prototype["delete"]=ua;Oe.prototype.get=da;Oe.prototype.has=ga;Oe.prototype.set=pa;var ma=Oe,kr=ma,va=er,ya=Mr;function Sa(){this.size=0,this.__data__={hash:new kr(),map:new(ya||va)(),string:new kr()};}var xa=Sa;function Ta(h){var r=_typeof(h);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?h!=="__proto__":h===null;}var Ma=Ta,Pa=Ma;function Oa(h,r){var t=h.__data__;return Pa(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var nr=Oa,Ea=nr;function Ca(h){var r=Ea(this,h)["delete"](h);return this.size-=r?1:0,r;}var Aa=Ca,Ra=nr;function Ia(h){return Ra(this,h).get(h);}var La=Ia,wa=nr;function ba(h){return wa(this,h).has(h);}var Da=ba,Na=nr;function Wa(h,r){var t=Na(this,h),e=t.size;return t.set(h,r),this.size+=t.size==e?0:1,this;}var Ba=Wa,Fa=xa,Ua=Aa,ja=La,$a=Da,za=Ba;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=Fa;Ee.prototype["delete"]=Ua;Ee.prototype.get=ja;Ee.prototype.has=$a;Ee.prototype.set=za;var $n=Ee,Ga=er,Ha=Mr,Ka=$n,Ya=200;function Va(h,r){var t=this.__data__;if(t instanceof Ga){var e=t.__data__;if(!Ha||e.length<Ya-1)return e.push([h,r]),this.size=++t.size,this;t=this.__data__=new Ka(e);}return t.set(h,r),this.size=t.size,this;}var Xa=Va,ka=er,Ja=_s,Za=eo,Qa=no,qa=so,_a=Xa;function Ce(h){var r=this.__data__=new ka(h);this.size=r.size;}Ce.prototype.clear=Ja;Ce.prototype["delete"]=Za;Ce.prototype.get=Qa;Ce.prototype.has=qa;Ce.prototype.set=_a;var zn=Ce;function tl(h,r){for(var t=-1,e=h==null?0:h.length;++t<e&&r(h[t],t,h)!==!1;);return h;}var el=tl,rl=ge,nl=function(){try{var h=rl(Object,"defineProperty");return h({},"",{}),h;}catch(_unused21){}}(),Gn=nl,Jr=Gn;function il(h,r,t){r=="__proto__"&&Jr?Jr(h,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):h[r]=t;}var Hn=il,sl=Hn,ol=Tr,al=Object.prototype,ll=al.hasOwnProperty;function cl(h,r,t){var e=h[r];(!(ll.call(h,r)&&ol(e,t))||t===void 0&&!(r in h))&&sl(h,r,t);}var Kn=cl,fl=Kn,hl=Hn;function ul(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?hl(t,o,s):fl(t,o,s);}return t;}var ir=ul;function dl(h,r){for(var t=-1,e=Array(h);++t<h;)e[t]=r(t);return e;}var gl=dl,pl=de,ml=ne,vl="[object Arguments]";function yl(h){return ml(h)&&pl(h)==vl;}var Sl=yl,Zr=Sl,xl=ne,Yn=Object.prototype,Tl=Yn.hasOwnProperty,Ml=Yn.propertyIsEnumerable,Pl=Zr(/* @__PURE__ */function(){return arguments;}())?Zr:function(h){return xl(h)&&Tl.call(h,"callee")&&!Ml.call(h,"callee");},Vn=Pl,Ol=Array.isArray,Fe=Ol,ze={exports:{}};function El(){return!1;}var Cl=El;ze.exports;(function(h,r){var t=ee,e=Cl,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;})(ze,ze.exports);var Pr=ze.exports,Al=9007199254740991,Rl=/^(?:0|[1-9]\d*)$/;function Il(h,r){var _r2;var t=_typeof(h);return r=(_r2=r)!==null&&_r2!==void 0?_r2:Al,!!r&&(t=="number"||t!="symbol"&&Rl.test(h))&&h>-1&&h%1==0&&h<r;}var Ll=Il,wl=9007199254740991;function bl(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=wl;}var Xn=bl,Dl=de,Nl=Xn,Wl=ne,Bl="[object Arguments]",Fl="[object Array]",Ul="[object Boolean]",jl="[object Date]",$l="[object Error]",zl="[object Function]",Gl="[object Map]",Hl="[object Number]",Kl="[object Object]",Yl="[object RegExp]",Vl="[object Set]",Xl="[object String]",kl="[object WeakMap]",Jl="[object ArrayBuffer]",Zl="[object DataView]",Ql="[object Float32Array]",ql="[object Float64Array]",_l="[object Int8Array]",tc="[object Int16Array]",ec="[object Int32Array]",rc="[object Uint8Array]",nc="[object Uint8ClampedArray]",ic="[object Uint16Array]",sc="[object Uint32Array]",Ut={};Ut[Ql]=Ut[ql]=Ut[_l]=Ut[tc]=Ut[ec]=Ut[rc]=Ut[nc]=Ut[ic]=Ut[sc]=!0;Ut[Bl]=Ut[Fl]=Ut[Jl]=Ut[Ul]=Ut[Zl]=Ut[jl]=Ut[$l]=Ut[zl]=Ut[Gl]=Ut[Hl]=Ut[Kl]=Ut[Yl]=Ut[Vl]=Ut[Xl]=Ut[kl]=!1;function oc(h){return Wl(h)&&Nl(h.length)&&!!Ut[Dl(h)];}var ac=oc;function lc(h){return function(r){return h(r);};}var sr=lc,Ge={exports:{}};Ge.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;})(Ge,Ge.exports);var Or=Ge.exports,cc=ac,fc=sr,Qr=Or,qr=Qr&&Qr.isTypedArray,hc=qr?fc(qr):cc,kn=hc,uc=gl,dc=Vn,gc=Fe,pc=Pr,mc=Ll,vc=kn,yc=Object.prototype,Sc=yc.hasOwnProperty;function xc(h,r){var t=gc(h),e=!t&&dc(h),n=!t&&!e&&pc(h),i=!t&&!e&&!n&&vc(h),a=t||e||n||i,o=a?uc(h.length,String):[],s=o.length;for(var l in h)(r||Sc.call(h,l))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.
396
396
  l=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
397
397
  n&&(l=="offset"||l=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
398
398
  i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||// Skip index properties.
399
- mc(l,s)))&&o.push(l);return o;}var Jn=xc,Tc=Object.prototype;function Mc(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Tc;return h===t;}var Er=Mc;function Pc(h,r){return function(t){return h(r(t));};}var Zn=Pc,Oc=Zn,Ec=Oc(Object.keys,Object),Cc=Ec,Ac=Er,Rc=Cc,Ic=Object.prototype,Lc=Ic.hasOwnProperty;function bc(h){if(!Ac(h))return Rc(h);var r=[];for(var t in Object(h))Lc.call(h,t)&&t!="constructor"&&r.push(t);return r;}var wc=bc,Dc=Un,Nc=Xn;function Wc(h){return h!=null&&Nc(h.length)&&!Dc(h);}var Cr=Wc,Bc=Jn,Fc=wc,Uc=Cr;function jc(h){return Uc(h)?Bc(h):Fc(h);}var Ar=jc,$c=ir,zc=Ar;function Gc(h,r){return h&&$c(r,zc(r),h);}var Hc=Gc;function Kc(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Yc=Kc,Vc=he,Xc=Er,kc=Yc,Jc=Object.prototype,Zc=Jc.hasOwnProperty;function Qc(h){if(!Vc(h))return kc(h);var r=Xc(h),t=[];for(var e in h)e=="constructor"&&(r||!Zc.call(h,e))||t.push(e);return t;}var qc=Qc,_c=Jn,tf=qc,ef=Cr;function rf(h){return ef(h)?_c(h,!0):tf(h);}var Rr=rf,nf=ir,sf=Rr;function of(h,r){return h&&nf(r,sf(r),h);}var af=of,He={exports:{}};He.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;})(He,He.exports);var lf=He.exports;function cf(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var ff=cf;function hf(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=hf;function uf(){return[];}var qn=uf,df=Qn,gf=qn,pf=Object.prototype,mf=pf.propertyIsEnumerable,_r=Object.getOwnPropertySymbols,vf=_r?function(h){return h==null?[]:(h=Object(h),df(_r(h),function(r){return mf.call(h,r);}));}:gf,Ir=vf,yf=ir,Sf=Ir;function xf(h,r){return yf(h,Sf(h),r);}var Tf=xf;function Mf(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var Lr=Mf,Pf=Zn,Of=Pf(Object.getPrototypeOf,Object),_n=Of,Ef=Lr,Cf=_n,Af=Ir,Rf=qn,If=Object.getOwnPropertySymbols,Lf=If?function(h){for(var r=[];h;)Ef(r,Af(h)),h=Cf(h);return r;}:Rf,ti=Lf,bf=ir,wf=ti;function Df(h,r){return bf(h,wf(h),r);}var Nf=Df,Wf=Lr,Bf=Fe;function Ff(h,r,t){var e=r(h);return Bf(h)?e:Wf(e,t(h));}var ei=Ff,Uf=ei,jf=Ir,$f=Ar;function zf(h){return Uf(h,$f,jf);}var ri=zf,Gf=ei,Hf=ti,Kf=Rr;function Yf(h){return Gf(h,Kf,Hf);}var Vf=Yf,Xf=ge,kf=ee,Jf=Xf(kf,"DataView"),Zf=Jf,Qf=ge,qf=ee,_f=Qf(qf,"Promise"),th=_f,eh=ge,rh=ee,nh=eh(rh,"Set"),ni=nh,ih=ge,sh=ee,oh=ih(sh,"WeakMap"),ah=oh,dr=Zf,gr=Mr,pr=th,mr=ni,vr=ah,ii=de,Ae=jn,tn="[object Map]",lh="[object Object]",en="[object Promise]",rn="[object Set]",nn="[object WeakMap]",sn="[object DataView]",ch=Ae(dr),fh=Ae(gr),hh=Ae(pr),uh=Ae(mr),dh=Ae(vr),ue=ii;(dr&&ue(new dr(new ArrayBuffer(1)))!=sn||gr&&ue(new gr())!=tn||pr&&ue(pr.resolve())!=en||mr&&ue(new mr())!=rn||vr&&ue(new vr())!=nn)&&(ue=function ue(h){var r=ii(h),t=r==lh?h.constructor:void 0,e=t?Ae(t):"";if(e)switch(e){case ch:return sn;case fh:return tn;case hh:return en;case uh:return rn;case dh:return nn;}return r;});var or=ue,gh=Object.prototype,ph=gh.hasOwnProperty;function mh(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&ph.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var vh=mh,yh=ee,Sh=yh.Uint8Array,si=Sh,on=si;function xh(h){var r=new h.constructor(h.byteLength);return new on(r).set(new on(h)),r;}var br=xh,Th=br;function Mh(h,r){var t=r?Th(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Ph=Mh,Oh=/\w*$/;function Eh(h){var r=new h.constructor(h.source,Oh.exec(h));return r.lastIndex=h.lastIndex,r;}var Ch=Eh,an=Be,ln=an?an.prototype:void 0,cn=ln?ln.valueOf:void 0;function Ah(h){return cn?Object(cn.call(h)):{};}var Rh=Ah,Ih=br;function Lh(h,r){var t=r?Ih(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var bh=Lh,wh=br,Dh=Ph,Nh=Ch,Wh=Rh,Bh=bh,Fh="[object Boolean]",Uh="[object Date]",jh="[object Map]",$h="[object Number]",zh="[object RegExp]",Gh="[object Set]",Hh="[object String]",Kh="[object Symbol]",Yh="[object ArrayBuffer]",Vh="[object DataView]",Xh="[object Float32Array]",kh="[object Float64Array]",Jh="[object Int8Array]",Zh="[object Int16Array]",Qh="[object Int32Array]",qh="[object Uint8Array]",_h="[object Uint8ClampedArray]",tu="[object Uint16Array]",eu="[object Uint32Array]";function ru(h,r,t){var e=h.constructor;switch(r){case Yh:return wh(h);case Fh:case Uh:return new e(+h);case Vh:return Dh(h,t);case Xh:case kh:case Jh:case Zh:case Qh:case qh:case _h:case tu:case eu:return Bh(h,t);case jh:return new e();case $h:case Hh:return new e(h);case zh:return Nh(h);case Gh:return new e();case Kh:return Wh(h);}}var nu=ru,iu=he,fn=Object.create,su=/* @__PURE__ */function(){function h(){}return function(r){if(!iu(r))return{};if(fn)return fn(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),ou=su,au=ou,lu=_n,cu=Er;function fu(h){return typeof h.constructor=="function"&&!cu(h)?au(lu(h)):{};}var hu=fu,uu=or,du=ne,gu="[object Map]";function pu(h){return du(h)&&uu(h)==gu;}var mu=pu,vu=mu,yu=sr,hn=Or,un=hn&&hn.isMap,Su=un?yu(un):vu,xu=Su,Tu=or,Mu=ne,Pu="[object Set]";function Ou(h){return Mu(h)&&Tu(h)==Pu;}var Eu=Ou,Cu=Eu,Au=sr,dn=Or,gn=dn&&dn.isSet,Ru=gn?Au(gn):Cu,oi=Ru,Iu=/* @__PURE__ */fe(oi),Lu=zn,bu=el,wu=Kn,Du=Hc,Nu=af,Wu=lf,Bu=ff,Fu=Tf,Uu=Nf,ju=ri,$u=Vf,zu=or,Gu=vh,Hu=nu,Ku=hu,Yu=Fe,Vu=Pr,Xu=xu,ku=he,Ju=oi,Zu=Ar,Qu=Rr,qu=1,_u=2,td=4,ai="[object Arguments]",ed="[object Array]",rd="[object Boolean]",nd="[object Date]",id="[object Error]",li="[object Function]",sd="[object GeneratorFunction]",od="[object Map]",ad="[object Number]",ci="[object Object]",ld="[object RegExp]",cd="[object Set]",fd="[object String]",hd="[object Symbol]",ud="[object WeakMap]",dd="[object ArrayBuffer]",gd="[object DataView]",pd="[object Float32Array]",md="[object Float64Array]",vd="[object Int8Array]",yd="[object Int16Array]",Sd="[object Int32Array]",xd="[object Uint8Array]",Td="[object Uint8ClampedArray]",Md="[object Uint16Array]",Pd="[object Uint32Array]",Ft={};Ft[ai]=Ft[ed]=Ft[dd]=Ft[gd]=Ft[rd]=Ft[nd]=Ft[pd]=Ft[md]=Ft[vd]=Ft[yd]=Ft[Sd]=Ft[od]=Ft[ad]=Ft[ci]=Ft[ld]=Ft[cd]=Ft[fd]=Ft[hd]=Ft[xd]=Ft[Td]=Ft[Md]=Ft[Pd]=!0;Ft[id]=Ft[li]=Ft[ud]=!1;function $e(h,r,t,e,n,i){var a,o=r&qu,s=r&_u,l=r&td;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!ku(h))return h;var d=Yu(h);if(d){if(a=Gu(h),!o)return Bu(h,a);}else{var c=zu(h),p=c==li||c==sd;if(Vu(h))return Wu(h,o);if(c==ci||c==ai||p&&!n){if(a=s||p?{}:Ku(h),!o)return s?Uu(h,Nu(a,h)):Fu(h,Du(a,h));}else{if(!Ft[c])return n?h:{};a=Hu(h,c,o);}}i||(i=new Lu());var y=i.get(h);if(y)return y;i.set(h,a),Ju(h)?h.forEach(function(v){a.add($e(v,r,t,v,h,i));}):Xu(h)&&h.forEach(function(v,T){a.set(T,$e(v,r,t,T,h,i));});var P=l?s?$u:ju:s?Qu:Zu,x=d?void 0:P(h);return bu(x||h,function(v,T){x&&(T=v,v=h[T]),wu(a,T,$e(v,r,t,T,h,i));}),a;}var Od=$e,Ed=Od,Cd=1,Ad=4;function Rd(h){return Ed(h,Cd|Ad);}var Id=Rd,Xt=/* @__PURE__ */fe(Id);var fi="1.1.9",Ld="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var h=window.__netlessUA||"";h+=" ".concat(Ld,"@").concat(fi),window.__netlessUA=h;}var re={syncOpt:{interval:500},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},strokeWidth:{min:1,max:10}};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(pe(e),"L").concat(pe(n));var i="";for(var a=2,o=t-1;a<o;a++)e=h[a],n=h[a+1],i+=me(e,n);return r?"M".concat(me(h[0],h[1]),"Q").concat(pe(h[1])).concat(me(h[1],h[2]),"T").concat(i).concat(me(h[t-1],h[0])).concat(me(h[0],h[1]),"Z"):"M".concat(pe(h[0]),"Q").concat(pe(h[1])).concat(me(h[1],h[2])).concat(h.length>3?"T":"").concat(i,"L").concat(pe(h[t-1]));}var Jt=/*#__PURE__*/function(){function Jt(r){_classCallCheck(this,Jt);et(this,"syncUnitTime",re.syncOpt.interval);et(this,"vNodes");et(this,"drawLayer");et(this,"fullLayer");et(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(T,f){return f%2?T-n[1]:T-n[0];}),y=this.computEraserPoints(p,l),P=ae(y,!0),x={pos:[0,0],d:P,fillColor:"rgba(0,0,0,1)"},v=new ce(x);a&&(v.addEventListener("beforerender",function(_ref165){var T=_ref165.detail;var f=T.context;o?f.blendFuncSeparate(f.ZERO,f.ZERO,f.ZERO,f.ZERO):f.globalCompositeOperation="destination-out";}),v.addEventListener("afterrender",function(_ref166){var T=_ref166.detail;var f=T.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 x;var v=a&&Xt(a)||n.get(t.name);if(!v)return;_t(o)&&(t.setAttribute("zIndex",o),v.opt.zIndex=o);var T=t.parent;if(T){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,A=M.thickness;M.thickness=A*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]*T.worldScaling[0],s[1]*T.worldScaling[1]];x=Sr(v.rect,_g6),v.rect=x;}else{var _g7=Jt.getRectFromLayer(T,t.name);v.rect=_g7||v.rect;}}else if(_t(l))if(t.setAttribute("rotate",l),v.opt.rotate=l,a)x=Ei(v.rect,l),v.rect=x;else{var _g8=Jt.getRectFromLayer(T,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(A,b){return b%2?A+s[1]:A+s[0];});_u11.op[_M6]=_E3;}}}else if(_t(l)){var _g11=v.op;if(H0(_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++)K0(_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)};}}}]);}();et(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)
399
+ mc(l,s)))&&o.push(l);return o;}var Jn=xc,Tc=Object.prototype;function Mc(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Tc;return h===t;}var Er=Mc;function Pc(h,r){return function(t){return h(r(t));};}var Zn=Pc,Oc=Zn,Ec=Oc(Object.keys,Object),Cc=Ec,Ac=Er,Rc=Cc,Ic=Object.prototype,Lc=Ic.hasOwnProperty;function wc(h){if(!Ac(h))return Rc(h);var r=[];for(var t in Object(h))Lc.call(h,t)&&t!="constructor"&&r.push(t);return r;}var bc=wc,Dc=Un,Nc=Xn;function Wc(h){return h!=null&&Nc(h.length)&&!Dc(h);}var Cr=Wc,Bc=Jn,Fc=bc,Uc=Cr;function jc(h){return Uc(h)?Bc(h):Fc(h);}var Ar=jc,$c=ir,zc=Ar;function Gc(h,r){return h&&$c(r,zc(r),h);}var Hc=Gc;function Kc(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Yc=Kc,Vc=he,Xc=Er,kc=Yc,Jc=Object.prototype,Zc=Jc.hasOwnProperty;function Qc(h){if(!Vc(h))return kc(h);var r=Xc(h),t=[];for(var e in h)e=="constructor"&&(r||!Zc.call(h,e))||t.push(e);return t;}var qc=Qc,_c=Jn,tf=qc,ef=Cr;function rf(h){return ef(h)?_c(h,!0):tf(h);}var Rr=rf,nf=ir,sf=Rr;function of(h,r){return h&&nf(r,sf(r),h);}var af=of,He={exports:{}};He.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;})(He,He.exports);var lf=He.exports;function cf(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var ff=cf;function hf(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=hf;function uf(){return[];}var qn=uf,df=Qn,gf=qn,pf=Object.prototype,mf=pf.propertyIsEnumerable,_r=Object.getOwnPropertySymbols,vf=_r?function(h){return h==null?[]:(h=Object(h),df(_r(h),function(r){return mf.call(h,r);}));}:gf,Ir=vf,yf=ir,Sf=Ir;function xf(h,r){return yf(h,Sf(h),r);}var Tf=xf;function Mf(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var Lr=Mf,Pf=Zn,Of=Pf(Object.getPrototypeOf,Object),_n=Of,Ef=Lr,Cf=_n,Af=Ir,Rf=qn,If=Object.getOwnPropertySymbols,Lf=If?function(h){for(var r=[];h;)Ef(r,Af(h)),h=Cf(h);return r;}:Rf,ti=Lf,wf=ir,bf=ti;function Df(h,r){return wf(h,bf(h),r);}var Nf=Df,Wf=Lr,Bf=Fe;function Ff(h,r,t){var e=r(h);return Bf(h)?e:Wf(e,t(h));}var ei=Ff,Uf=ei,jf=Ir,$f=Ar;function zf(h){return Uf(h,$f,jf);}var ri=zf,Gf=ei,Hf=ti,Kf=Rr;function Yf(h){return Gf(h,Kf,Hf);}var Vf=Yf,Xf=ge,kf=ee,Jf=Xf(kf,"DataView"),Zf=Jf,Qf=ge,qf=ee,_f=Qf(qf,"Promise"),th=_f,eh=ge,rh=ee,nh=eh(rh,"Set"),ni=nh,ih=ge,sh=ee,oh=ih(sh,"WeakMap"),ah=oh,dr=Zf,gr=Mr,pr=th,mr=ni,vr=ah,ii=de,Ae=jn,tn="[object Map]",lh="[object Object]",en="[object Promise]",rn="[object Set]",nn="[object WeakMap]",sn="[object DataView]",ch=Ae(dr),fh=Ae(gr),hh=Ae(pr),uh=Ae(mr),dh=Ae(vr),ue=ii;(dr&&ue(new dr(new ArrayBuffer(1)))!=sn||gr&&ue(new gr())!=tn||pr&&ue(pr.resolve())!=en||mr&&ue(new mr())!=rn||vr&&ue(new vr())!=nn)&&(ue=function ue(h){var r=ii(h),t=r==lh?h.constructor:void 0,e=t?Ae(t):"";if(e)switch(e){case ch:return sn;case fh:return tn;case hh:return en;case uh:return rn;case dh:return nn;}return r;});var or=ue,gh=Object.prototype,ph=gh.hasOwnProperty;function mh(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&ph.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var vh=mh,yh=ee,Sh=yh.Uint8Array,si=Sh,on=si;function xh(h){var r=new h.constructor(h.byteLength);return new on(r).set(new on(h)),r;}var wr=xh,Th=wr;function Mh(h,r){var t=r?Th(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Ph=Mh,Oh=/\w*$/;function Eh(h){var r=new h.constructor(h.source,Oh.exec(h));return r.lastIndex=h.lastIndex,r;}var Ch=Eh,an=Be,ln=an?an.prototype:void 0,cn=ln?ln.valueOf:void 0;function Ah(h){return cn?Object(cn.call(h)):{};}var Rh=Ah,Ih=wr;function Lh(h,r){var t=r?Ih(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var wh=Lh,bh=wr,Dh=Ph,Nh=Ch,Wh=Rh,Bh=wh,Fh="[object Boolean]",Uh="[object Date]",jh="[object Map]",$h="[object Number]",zh="[object RegExp]",Gh="[object Set]",Hh="[object String]",Kh="[object Symbol]",Yh="[object ArrayBuffer]",Vh="[object DataView]",Xh="[object Float32Array]",kh="[object Float64Array]",Jh="[object Int8Array]",Zh="[object Int16Array]",Qh="[object Int32Array]",qh="[object Uint8Array]",_h="[object Uint8ClampedArray]",tu="[object Uint16Array]",eu="[object Uint32Array]";function ru(h,r,t){var e=h.constructor;switch(r){case Yh:return bh(h);case Fh:case Uh:return new e(+h);case Vh:return Dh(h,t);case Xh:case kh:case Jh:case Zh:case Qh:case qh:case _h:case tu:case eu:return Bh(h,t);case jh:return new e();case $h:case Hh:return new e(h);case zh:return Nh(h);case Gh:return new e();case Kh:return Wh(h);}}var nu=ru,iu=he,fn=Object.create,su=/* @__PURE__ */function(){function h(){}return function(r){if(!iu(r))return{};if(fn)return fn(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),ou=su,au=ou,lu=_n,cu=Er;function fu(h){return typeof h.constructor=="function"&&!cu(h)?au(lu(h)):{};}var hu=fu,uu=or,du=ne,gu="[object Map]";function pu(h){return du(h)&&uu(h)==gu;}var mu=pu,vu=mu,yu=sr,hn=Or,un=hn&&hn.isMap,Su=un?yu(un):vu,xu=Su,Tu=or,Mu=ne,Pu="[object Set]";function Ou(h){return Mu(h)&&Tu(h)==Pu;}var Eu=Ou,Cu=Eu,Au=sr,dn=Or,gn=dn&&dn.isSet,Ru=gn?Au(gn):Cu,oi=Ru,Iu=/* @__PURE__ */fe(oi),Lu=zn,wu=el,bu=Kn,Du=Hc,Nu=af,Wu=lf,Bu=ff,Fu=Tf,Uu=Nf,ju=ri,$u=Vf,zu=or,Gu=vh,Hu=nu,Ku=hu,Yu=Fe,Vu=Pr,Xu=xu,ku=he,Ju=oi,Zu=Ar,Qu=Rr,qu=1,_u=2,td=4,ai="[object Arguments]",ed="[object Array]",rd="[object Boolean]",nd="[object Date]",id="[object Error]",li="[object Function]",sd="[object GeneratorFunction]",od="[object Map]",ad="[object Number]",ci="[object Object]",ld="[object RegExp]",cd="[object Set]",fd="[object String]",hd="[object Symbol]",ud="[object WeakMap]",dd="[object ArrayBuffer]",gd="[object DataView]",pd="[object Float32Array]",md="[object Float64Array]",vd="[object Int8Array]",yd="[object Int16Array]",Sd="[object Int32Array]",xd="[object Uint8Array]",Td="[object Uint8ClampedArray]",Md="[object Uint16Array]",Pd="[object Uint32Array]",Ft={};Ft[ai]=Ft[ed]=Ft[dd]=Ft[gd]=Ft[rd]=Ft[nd]=Ft[pd]=Ft[md]=Ft[vd]=Ft[yd]=Ft[Sd]=Ft[od]=Ft[ad]=Ft[ci]=Ft[ld]=Ft[cd]=Ft[fd]=Ft[hd]=Ft[xd]=Ft[Td]=Ft[Md]=Ft[Pd]=!0;Ft[id]=Ft[li]=Ft[ud]=!1;function $e(h,r,t,e,n,i){var a,o=r&qu,s=r&_u,l=r&td;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!ku(h))return h;var d=Yu(h);if(d){if(a=Gu(h),!o)return Bu(h,a);}else{var c=zu(h),p=c==li||c==sd;if(Vu(h))return Wu(h,o);if(c==ci||c==ai||p&&!n){if(a=s||p?{}:Ku(h),!o)return s?Uu(h,Nu(a,h)):Fu(h,Du(a,h));}else{if(!Ft[c])return n?h:{};a=Hu(h,c,o);}}i||(i=new Lu());var y=i.get(h);if(y)return y;i.set(h,a),Ju(h)?h.forEach(function(v){a.add($e(v,r,t,v,h,i));}):Xu(h)&&h.forEach(function(v,T){a.set(T,$e(v,r,t,T,h,i));});var P=l?s?$u:ju:s?Qu:Zu,x=d?void 0:P(h);return wu(x||h,function(v,T){x&&(T=v,v=h[T]),bu(a,T,$e(v,r,t,T,h,i));}),a;}var Od=$e,Ed=Od,Cd=1,Ad=4;function Rd(h){return Ed(h,Cd|Ad);}var Id=Rd,Xt=/* @__PURE__ */fe(Id);var fi="1.1.10",Ld="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var h=window.__netlessUA||"";h+=" ".concat(Ld,"@").concat(fi),window.__netlessUA=h;}var re={syncOpt:{interval:500},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},strokeWidth:{min:1,max:10}};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(pe(e),"L").concat(pe(n));var i="";for(var a=2,o=t-1;a<o;a++)e=h[a],n=h[a+1],i+=me(e,n);return r?"M".concat(me(h[0],h[1]),"Q").concat(pe(h[1])).concat(me(h[1],h[2]),"T").concat(i).concat(me(h[t-1],h[0])).concat(me(h[0],h[1]),"Z"):"M".concat(pe(h[0]),"Q").concat(pe(h[1])).concat(me(h[1],h[2])).concat(h.length>3?"T":"").concat(i,"L").concat(pe(h[t-1]));}var Jt=/*#__PURE__*/function(){function Jt(r){_classCallCheck(this,Jt);et(this,"syncUnitTime",re.syncOpt.interval);et(this,"vNodes");et(this,"drawLayer");et(this,"fullLayer");et(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={};Zt(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(T,f){return f%2?T-n[1]:T-n[0];}),y=this.computEraserPoints(p,l),P=ae(y,!0),x={pos:[0,0],d:P,fillColor:"rgba(0,0,0,1)"},v=new ce(x);a&&(v.addEventListener("beforerender",function(_ref165){var T=_ref165.detail;var f=T.context;o?f.blendFuncSeparate(f.ZERO,f.ZERO,f.ZERO,f.ZERO):f.globalCompositeOperation="destination-out";}),v.addEventListener("afterrender",function(_ref166){var T=_ref166.detail;var f=T.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 x;var v=a&&Xt(a)||n.get(t.name);if(!v)return;Zt(o)&&(t.setAttribute("zIndex",o),v.opt.zIndex=o);var T=t.parent;if(T){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,A=M.thickness;M.thickness=A*Math.max(p[0],p[1]);for(var w=0;w<E.length;w++)jr(E[w],c,p,s);}}else if(s){if(t.setAttribute("translate",s),v.opt.translate=s,a){var _g6=[s[0]*T.worldScaling[0],s[1]*T.worldScaling[1]];x=Sr(v.rect,_g6),v.rect=x;}else{var _g7=Jt.getRectFromLayer(T,t.name);v.rect=_g7||v.rect;}}else if(Zt(l))if(t.setAttribute("rotate",l),v.opt.rotate=l,a)x=Ei(v.rect,l),v.rect=x;else{var _g8=Jt.getRectFromLayer(T,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(A,w){return w%2?A+s[1]:A+s[0];});_u11.op[_M6]=_E3;}}}else if(Zt(l)){var _g11=v.op;if(H0(_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++)K0(_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)};}}}]);}();et(Jt,"SafeBorderPadding",10);var vt=Jt;var br={exports:{}};br.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
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
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
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={},x="",v="",T="",f=2,g=3,u=2,m=[],M=0,E=0,A;for(A=0;A<s.length;A+=1)if(x=s.charAt(A),Object.prototype.hasOwnProperty.call(y,x)||(y[x]=g++,P[x]=!0),v=T+x,Object.prototype.hasOwnProperty.call(y,v))T=v;else{if(Object.prototype.hasOwnProperty.call(P,T)){if(T.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=T.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=T.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[T];}else for(p=y[T],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++,T=String(x);}if(T!==""){if(Object.prototype.hasOwnProperty.call(P,T)){if(T.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=T.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=T.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[T];}else for(p=y[T],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,x="",v=[],T,f,g,u,m,M,E,A={val:d(0),position:l,index:1};for(T=0;T<3;T+=1)c[T]=T;for(g=0,m=Math.pow(2,2),M=1;M!=m;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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(A.index>s)return"";for(g=0,m=Math.pow(2,P),M=1;M!=m;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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])x=c[E];else if(E===y)x=f+f.charAt(0);else return null;v.push(x),c[y++]=f+x.charAt(0),p--,f=x,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 hi=wr.exports;function Me(h){return JSON.parse(hi.decompress(h));}function Zt(h){return hi.compress(JSON.stringify(h));}var ui=/*#__PURE__*/function(_vt){function ui(t){var _this62;_classCallCheck(this,ui);_this62=_callSuper(this,ui,[t]);et(_this62,"canRotate",!0);et(_this62,"scaleType",jt.all);et(_this62,"toolsType",ut.Pencil);et(_this62,"syncTimestamp");et(_this62,"syncIndex",0);et(_this62,"tmpPoints",[]);et(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */et(_this62,"uniThickness");et(_this62,"workOptions");et(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(ui,_vt);return _createClass(ui,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:at.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:at.DrawWork,dataType:Mt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(ui,"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,x=!1;var v=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),d.length&&(d[0].taskId-this.syncTimestamp>this.syncUnitTime&&(x=!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:at.DrawWork,dataType:Mt.Local};var T=[];return this.tmpPoints.slice(v).forEach(function(f){T.push(f.x,f.y,_this63.computRadius(f.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:at.DrawWork,dataType:Mt.Local,rect:P,op:x?T:void 0,index:x?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===It.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:at.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:at.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],x=_.Sub(y,P).uni();y.setv(x);}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,x=_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 T=[],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),A=_this$computDrawPoint.ps,b=_this$computDrawPoint.rect;var O=void 0;var L=E.length===1;l===Lt.Stroke||L?O=ae(A,!0):O=ae(A,!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)}),T.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&&!x;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=T.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(),x&&this.drawEraserlines({group:u,eraserlines:x,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,x=p.z,v=e?this.computRadius(x,e):x;if(l.push({point:new xt(y,P,x,t[i].v),radius:v}),i>0&&i<t.length-1){var _T28=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_T28<90||_T28>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,x),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 _T29=d-1;for(;_T29>0;){var _f28=this.tmpPoints[_T29].distance(this.tmpPoints[_T29-1]),g=Math.max(this.tmpPoints[_T29].z-this.uniThickness*_f28,0);if(this.tmpPoints[_T29-1].z>=g)break;this.tmpPoints[_T29-1].setz(g),o=Math.min(o,_T29-1),_T29--;}}}else o=1/0;continue;}c.setv(P);var x=c.distance(y),v=Math.max(y.z-this.uniThickness*x,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],x=_.Sub(p,P).uni();if(p.isNear(P,e/2)){o=Math.min(y,o);continue;}_.Equals(x,P.v,0.02)&&(n&&P.t&&n.add(P.t),this.tmpPoints.pop(),o=Math.min(y,o)),p.setv(x),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 x=this.tmpPoints[P].distance(this.tmpPoints[P-1]),v=Math.max(this.tmpPoints[P].z-this.uniThickness*x,-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"?Z0(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 di=/*#__PURE__*/function(_vt2){function di(t){var _this65;_classCallCheck(this,di);_this65=_callSuper(this,di,[t]);et(_this65,"toolsType",ut.LaserPen);et(_this65,"canRotate",!1);et(_this65,"scaleType",jt.none);et(_this65,"syncTimestamp");et(_this65,"syncIndex",0);et(_this65,"tmpPoints",[]);et(_this65,"workOptions");et(_this65,"consumeIndex",0);_this65.workOptions=t.toolsOpt,_this65.syncTimestamp=0;return _this65;}_inherits(di,_vt2);return _createClass(di,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(di,"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:at.None};if(this.updateTempPoints(a||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:at.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]},x=this.getTaskPoints(y);if(x.length){var _T30=Date.now();_T30-this.syncTimestamp>this.syncUnitTime&&(c=!0,this.syncTimestamp=_T30,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:P,tasks:x,isDot:!1,layer:this.drawLayer||this.fullLayer});}var v=[];return this.tmpPoints.slice(p).forEach(function(T){v.push(T.x,T.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:at.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:at.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 x;var e=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,a=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,s=_this$workOptions5.strokeType;if(!e.length){var 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:(x=this.workId)==null?void 0:x.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,x,_a$getResolution,v,_T31;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){x=a.renderer.createProgram({vertex:y,fragment:P}),_a$getResolution=a.getResolution(),v=_a$getResolution.width,_T31=_a$getResolution.height;l.setUniforms({u_time:0,u_resolution:[v,_T31]}),l.setProgram(x);}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(_x25){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 x=d.x-i,v=d.y-a;s=[new xt(x,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 bd=Ke;Ke.polyline=Ke;Ke.polygon=wd;function Ke(h,r,t){var e=h.length,n=ve(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=ve(s,r);;)if(n|l){if(n&l)break;n?(o=yr(o,s,n,r),n=ve(o,r)):(s=yr(o,s,l,r),l=ve(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 wd(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=!(ve(n,r)&e),a=0;a<h.length;a++)o=h[a],s=!(ve(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
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={},x="",v="",T="",f=2,g=3,u=2,m=[],M=0,E=0,A;for(A=0;A<s.length;A+=1)if(x=s.charAt(A),Object.prototype.hasOwnProperty.call(y,x)||(y[x]=g++,P[x]=!0),v=T+x,Object.prototype.hasOwnProperty.call(y,v))T=v;else{if(Object.prototype.hasOwnProperty.call(P,T)){if(T.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=T.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=T.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[T];}else for(p=y[T],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++,T=String(x);}if(T!==""){if(Object.prototype.hasOwnProperty.call(P,T)){if(T.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=T.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=T.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[T];}else for(p=y[T],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,x="",v=[],T,f,g,u,m,M,E,A={val:d(0),position:l,index:1};for(T=0;T<3;T+=1)c[T]=T;for(g=0,m=Math.pow(2,2),M=1;M!=m;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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(A.index>s)return"";for(g=0,m=Math.pow(2,P),M=1;M!=m;)u=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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=A.val&A.position,A.position>>=1,A.position==0&&(A.position=l,A.val=d(A.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])x=c[E];else if(E===y)x=f+f.charAt(0);else return null;v.push(x),c[y++]=f+x.charAt(0),p--,f=x,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;});})(br);var hi=br.exports;function Me(h){return JSON.parse(hi.decompress(h));}function Qt(h){return hi.compress(JSON.stringify(h));}var ui=/*#__PURE__*/function(_vt){function ui(t){var _this62;_classCallCheck(this,ui);_this62=_callSuper(this,ui,[t]);et(_this62,"canRotate",!0);et(_this62,"scaleType",jt.all);et(_this62,"toolsType",ut.Pencil);et(_this62,"syncTimestamp");et(_this62,"syncIndex",0);et(_this62,"tmpPoints",[]);et(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */et(_this62,"uniThickness");et(_this62,"workOptions");et(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(ui,_vt);return _createClass(ui,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:ot.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:ot.DrawWork,dataType:Mt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(ui,"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,x=!1;var v=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),d.length&&(d[0].taskId-this.syncTimestamp>this.syncUnitTime&&(x=!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:ot.DrawWork,dataType:Mt.Local};var T=[];return this.tmpPoints.slice(v).forEach(function(f){T.push(f.x,f.y,_this63.computRadius(f.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ot.DrawWork,dataType:Mt.Local,rect:P,op:x?T:void 0,index:x?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===It.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:ot.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=Qt(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:ot.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],x=_.Sub(y,P).uni();y.setv(x);}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,x=_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 T=[],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),A=_this$computDrawPoint.ps,w=_this$computDrawPoint.rect;var O=void 0;var L=E.length===1;l===Lt.Stroke||L?O=ae(A,!0):O=ae(A,!1);var b={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((w.x+M[0])*g[0]+f[0]-vt.SafeBorderPadding),y:Math.floor((w.y+M[1])*g[1]+f[1]-vt.SafeBorderPadding),w:Math.floor(w.w*g[0]+2*vt.SafeBorderPadding),h:Math.floor(w.h*g[1]+2*vt.SafeBorderPadding)}),T.push(b);}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&&!x;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=T.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(),x&&this.drawEraserlines({group:u,eraserlines:x,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,x=p.z,v=e?this.computRadius(x,e):x;if(l.push({point:new xt(y,P,x,t[i].v),radius:v}),i>0&&i<t.length-1){var _T28=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_T28<90||_T28>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,x),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 _T29=d-1;for(;_T29>0;){var _f28=this.tmpPoints[_T29].distance(this.tmpPoints[_T29-1]),g=Math.max(this.tmpPoints[_T29].z-this.uniThickness*_f28,0);if(this.tmpPoints[_T29-1].z>=g)break;this.tmpPoints[_T29-1].setz(g),o=Math.min(o,_T29-1),_T29--;}}}else o=1/0;continue;}c.setv(P);var x=c.distance(y),v=Math.max(y.z-this.uniThickness*x,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],x=_.Sub(p,P).uni();if(p.isNear(P,e/2)){o=Math.min(y,o);continue;}_.Equals(x,P.v,0.02)&&(n&&P.t&&n.add(P.t),this.tmpPoints.pop(),o=Math.min(y,o)),p.setv(x),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 x=this.tmpPoints[P].distance(this.tmpPoints[P-1]),v=Math.max(this.tmpPoints[P].z-this.uniThickness*x,-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"?Z0(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 di=/*#__PURE__*/function(_vt2){function di(t){var _this65;_classCallCheck(this,di);_this65=_callSuper(this,di,[t]);et(_this65,"toolsType",ut.LaserPen);et(_this65,"canRotate",!1);et(_this65,"scaleType",jt.none);et(_this65,"syncTimestamp");et(_this65,"syncIndex",0);et(_this65,"tmpPoints",[]);et(_this65,"workOptions");et(_this65,"consumeIndex",0);_this65.workOptions=t.toolsOpt,_this65.syncTimestamp=0;return _this65;}_inherits(di,_vt2);return _createClass(di,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(di,"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:ot.None};if(this.updateTempPoints(a||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:ot.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]},x=this.getTaskPoints(y);if(x.length){var _T30=Date.now();_T30-this.syncTimestamp>this.syncUnitTime&&(c=!0,this.syncTimestamp=_T30,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:P,tasks:x,isDot:!1,layer:this.drawLayer||this.fullLayer});}var v=[];return this.tmpPoints.slice(p).forEach(function(T){v.push(T.x,T.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:ot.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=Qt(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:ot.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 x;var e=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,a=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,s=_this$workOptions5.strokeType;if(!e.length){var 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:(x=this.workId)==null?void 0:x.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,x,_a$getResolution,v,_T31;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){x=a.renderer.createProgram({vertex:y,fragment:P}),_a$getResolution=a.getResolution(),v=_a$getResolution.width,_T31=_a$getResolution.height;l.setUniforms({u_time:0,u_resolution:[v,_T31]}),l.setProgram(x);}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(_x25){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 x=d.x-i,v=d.y-a;s=[new xt(x,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 wd=Ke;Ke.polyline=Ke;Ke.polygon=bd;function Ke(h,r,t){var e=h.length,n=ve(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=ve(s,r);;)if(n|l){if(n&l)break;n?(o=yr(o,s,n,r),n=ve(o,r)):(s=yr(o,s,l,r),l=ve(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=!(ve(n,r)&e),a=0;a<h.length;a++)o=h[a],s=!(ve(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
404
  t&4?[h[0]+(r[0]-h[0])*(e[1]-h[1])/(r[1]-h[1]),e[1]]:// bottom
405
405
  t&2?[e[2],h[1]+(r[1]-h[1])*(e[2]-h[0])/(r[0]-h[0])]:// right
406
406
  t&1?[e[0],h[1]+(r[1]-h[1])*(e[0]-h[0])/(r[0]-h[0])]:// left
407
- null;}function ve(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__ */fe(bd);var Se=/*#__PURE__*/function(_vt3){function Se(t,e){var _this67;_classCallCheck(this,Se);_this67=_callSuper(this,Se,[t]);et(_this67,"canRotate",!1);et(_this67,"scaleType",jt.none);et(_this67,"toolsType",ut.Eraser);et(_this67,"serviceWork");et(_this67,"tmpPoints",[]);et(_this67,"workOptions");et(_this67,"worldPosition");et(_this67,"worldScaling");et(_this67,"eraserRect");et(_this67,"eraserPolyline");_this67.serviceWork=e,_this67.workOptions=t.toolsOpt,_this67.worldPosition=_this67.fullLayer.worldPosition,_this67.worldScaling=_this67.fullLayer.worldScaling;return _this67;}_inherits(Se,_vt3);return _createClass(Se,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Se,"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],_Se$eraserSizes$this$=Se.eraserSizes[this.workOptions.thickness],i=_Se$eraserSizes$this$.width,a=_Se$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),_Se$eraserSizes$this$2=Se.eraserSizes[this.workOptions.thickness],o=_Se$eraserSizes$this$2.width,s=_Se$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]),_Se$eraserSizes$this$3=Se.eraserSizes[this.workOptions.thickness],a=_Se$eraserSizes$this$3.width,o=_Se$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&&We(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;We(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,a.rect||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:at.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:at.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:at.None},this.baseConsumeResult);var s=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap));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:at.RemoveNode,rect:a,removeIds:_toConsumableArray(o)}:_objectSpread({type:at.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getCanEraserNodeMap",value:function getCanEraserNodeMap(t){var 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
- et(Se,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var se=Se;var Dd="__lodash_hash_undefined__";function Nd(h){return this.__data__.set(h,Dd),this;}var Wd=Nd;function Bd(h){return this.__data__.has(h);}var Fd=Bd,Ud=$n,jd=Wd,$d=Fd;function Ye(h){var r=-1,t=h==null?0:h.length;for(this.__data__=new Ud();++r<t;)this.add(h[r]);}Ye.prototype.add=Ye.prototype.push=jd;Ye.prototype.has=$d;var Nr=Ye;function zd(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 Gd=zd;function Hd(h,r){return h.has(r);}var Wr=Hd,Kd=Nr,Yd=Gd,Vd=Wr,Xd=1,kd=2;function Jd(h,r,t,e,n,i){var a=t&Xd,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&kd?new Kd():void 0;for(i.set(h,r),i.set(r,h);++c<o;){var P=h[c],x=r[c];if(e)var v=a?e(x,P,c,r,h,i):e(P,x,c,h,r,i);if(v!==void 0){if(v)continue;p=!1;break;}if(y){if(!Yd(r,function(T,f){if(!Vd(y,f)&&(P===T||n(P,T,t,e,i)))return y.push(f);})){p=!1;break;}}else if(!(P===x||n(P,x,t,e,i))){p=!1;break;}}return i["delete"](h),i["delete"](r),p;}var gi=Jd;function Zd(h){var r=-1,t=Array(h.size);return h.forEach(function(e,n){t[++r]=[n,e];}),t;}var Qd=Zd;function qd(h){var r=-1,t=Array(h.size);return h.forEach(function(e){t[++r]=e;}),t;}var Br=qd,pn=Be,mn=si,_d=Tr,t0=gi,e0=Qd,r0=Br,n0=1,i0=2,s0="[object Boolean]",o0="[object Date]",a0="[object Error]",l0="[object Map]",c0="[object Number]",f0="[object RegExp]",h0="[object Set]",u0="[object String]",d0="[object Symbol]",g0="[object ArrayBuffer]",p0="[object DataView]",vn=pn?pn.prototype:void 0,lr=vn?vn.valueOf:void 0;function m0(h,r,t,e,n,i,a){switch(t){case p0:if(h.byteLength!=r.byteLength||h.byteOffset!=r.byteOffset)return!1;h=h.buffer,r=r.buffer;case g0:return!(h.byteLength!=r.byteLength||!i(new mn(h),new mn(r)));case s0:case o0:case c0:return _d(+h,+r);case a0:return h.name==r.name&&h.message==r.message;case f0:case u0:return h==r+"";case l0:var o=e0;case h0:var s=e&n0;if(o||(o=r0),h.size!=r.size&&!s)return!1;var l=a.get(h);if(l)return l==r;e|=i0,a.set(h,r);var d=t0(o(h),o(r),e,n,i,a);return a["delete"](h),d;case d0:if(lr)return lr.call(h)==lr.call(r);}return!1;}var v0=m0,yn=ri,y0=1,S0=Object.prototype,x0=S0.hasOwnProperty;function T0(h,r,t,e,n,i){var a=t&y0,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:x0.call(r,p)))return!1;}var y=i.get(h),P=i.get(r);if(y&&P)return y==r&&P==h;var x=!0;i.set(h,r),i.set(r,h);for(var v=a;++c<s;){p=o[c];var T=h[p],f=r[p];if(e)var g=a?e(f,T,p,r,h,i):e(T,f,p,h,r,i);if(!(g===void 0?T===f||n(T,f,t,e,i):g)){x=!1;break;}v||(v=p=="constructor");}if(x&&!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)&&(x=!1);}return i["delete"](h),i["delete"](r),x;}var M0=T0,cr=zn,P0=gi,O0=v0,E0=M0,Sn=or,xn=Fe,Tn=Pr,C0=kn,A0=1,Mn="[object Arguments]",Pn="[object Array]",je="[object Object]",R0=Object.prototype,On=R0.hasOwnProperty;function I0(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?je:s,l=l==Mn?je:l;var d=s==je,c=l==je,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||C0(h)?P0(h,r,t,e,n,i):O0(h,r,s,t,e,n,i);if(!(t&A0)){var y=d&&On.call(h,"__wrapped__"),P=c&&On.call(r,"__wrapped__");if(y||P){var x=y?h.value():h,v=P?r.value():r;return i||(i=new cr()),n(x,v,t,e,i);}}return p?(i||(i=new cr()),E0(h,r,t,e,n,i)):!1;}var L0=I0,b0=L0,En=ne;function pi(h,r,t,e,n){return h===r?!0:h==null||r==null||!En(h)&&!En(r)?h!==h&&r!==r:b0(h,r,t,e,pi,n);}var w0=pi,D0=w0;function N0(h,r){return D0(h,r);}var W0=N0,oe=/* @__PURE__ */fe(W0);var _e=/*#__PURE__*/function(_vt4){function _e(t){var _this69;_classCallCheck(this,_e);_this69=_callSuper(this,_e,[t]);et(_this69,"toolsType",ut.Selector);et(_this69,"tmpPoints",[]);et(_this69,"workOptions");et(_this69,"vNodes");et(_this69,"selectIds");et(_this69,"selectorColor");et(_this69,"strokeColor");et(_this69,"fillColor");et(_this69,"oldSelectRect");et(_this69,"canRotate",!1);et(_this69,"canTextEdit",!1);et(_this69,"canLock",!1);et(_this69,"scaleType",jt.all);et(_this69,"toolsTypes");et(_this69,"shapeOpt");et(_this69,"textOpt");et(_this69,"isLocked");et(_this69,"thickness");et(_this69,"strokeType");et(_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===It.Start&&(i=this.unSelectedAllIds()),!(e!=null&&e.length)||!this.vNodes.curNodeMap.size)return{type:at.None};this.updateTempPoints(e);var a=this.computSelector();if(this.selectIds&&oe(this.selectIds,a.selectIds))return{type:at.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:at.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:at.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:at.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(Oi(_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,x,v,T,f,_iterator25,_step25,M,E,A,b,O,L,w,I,R,W,z,K,g,_M9,_E4,_A5,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,x=e.translate,v=e.dir,T=e.scale;s&&(x?e.translate=[x[0]+s[0],x[1]+s[1]]:e.translate=s);if(!(p||x||_t(P))){_context24.next=9;break;}if(!(y===It.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(i.setTargetAssignKeys(n),{type:at.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;}A=E.toolsType,b=E.opt,O=(l==null?void 0:l.getElementsByName(M))[0];if(!O){_context24.next=50;break;}L=!1,w=!1;I=_objectSpread({},e);R=void 0;if(!A){_context24.next=50;break;}I.thickness&&E.opt.thickness&&(L=E.opt.thickness!==I.thickness),I.strokeType&&(m=E.opt)!=null&&m.strokeType&&(w=E.opt.strokeType!==I.strokeType),R=f==null?void 0:f.get(M);W=Pi(A);if(!(W==null||W.updateNodeOpt({node:O,opt:I,vNodes:i,willSerializeData:a,targetNode:R}),E&&o&&(a&&(I.angle||I.translate)||I.originPoint&&I.scenePoint&&I.scale||I.pointMap&&I.pointMap.has(M)||A===ut.Text&&(I.fontSize||I.translate||I.textInfos&&I.textInfos.get(M))||A===ut.Image&&(I.angle||I.translate||I.scale||I.strokeColor&&b.type===xr.Iconify)||A===I.toolsType&&I.willRefresh||L||w))){_context24.next=49;break;}z=o.createWorkShapeNode({workId:M,toolsType:A,toolsOpt:E.opt});z==null||z.setWorkId(M);K=void 0;if(!(A===ut.Image)){_context24.next=35;break;}_context24.next=32;return z.consumeServiceAsync({isFullWork:!0,replaceId:M,worker:o});case 32:K=_context24.sent;_context24.next=48;break;case 35:if(!(A===ut.Text)){_context24.next=41;break;}_context24.next=38;return z.consumeServiceAsync({isFullWork:!0,replaceId:M});case 38:K=_context24.sent;_context24.next=48;break;case 41:_context24.prev=41;K=z==null?void 0:z.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:K&&(E.rect=K);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===It.Done&&(i.deleteLastTarget(),f=void 0);g=d;if(!(p&&x&&T&&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:x[0]>0&&x[1]>0?_E4=_M9[0]:x[0]>0?_E4=_M9[3]:x[1]>0?_E4=_M9[1]:_E4=_M9[2];return _context24.abrupt("break",75);case 69:x[0]<0&&x[1]>0?_E4=_M9[1]:x[0]<0?_E4=_M9[2]:x[1]>0?_E4=_M9[0]:_E4=_M9[3];return _context24.abrupt("break",75);case 71:x[0]<0&&x[1]<0?_E4=_M9[2]:x[0]<0?_E4=_M9[1]:x[1]<0?_E4=_M9[3]:_E4=_M9[0];return _context24.abrupt("break",75);case 73:x[0]>0&&x[1]<0?_E4=_M9[3]:x[0]>0?_E4=_M9[0]:x[1]<0?_E4=_M9[2]:_E4=_M9[1];return _context24.abrupt("break",75);case 75:_A5=_E4&&[p[0]-_E4[0],p[1]-_E4[1]]||[0,0];if(oe(_A5,[0,0])){_context24.next=80;break;}_context24.next=79;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{},offset:_A5}));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:at.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(_x26){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:at.Select,dataType:Mt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(De,"-");}},{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:at.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:at.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);et(_e,"selectorBorderId","selector-border");var Ve=_e;var mi=/*#__PURE__*/function(_vt5){function mi(t){var _this73;_classCallCheck(this,mi);_this73=_callSuper(this,mi,[t]);et(_this73,"canRotate",!1);et(_this73,"scaleType",jt.both);et(_this73,"toolsType",ut.Arrow);et(_this73,"tmpPoints",[]);et(_this73,"workOptions");et(_this73,"oldRect");et(_this73,"arrowTipWidth");et(_this73,"syncTimestamp");_this73.workOptions=t.toolsOpt,_this73.arrowTipWidth=_this73.workOptions.thickness*4,_this73.syncTimestamp=0,_this73.syncUnitTime=50;return _this73;}_inherits(mi,_vt5);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:at.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:at.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:at.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:at.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread(_objectSpread({rect:p},this.baseConsumeResult),{},{type:at.DrawWork,dataType:Mt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:at.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:at.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),x=_this$computDrawPoint2.points,v=_this$computDrawPoint2.pos,T=_this$computDrawPoint2.rect,f=_this$computDrawPoint2.isTriangle,g=_this$computDrawPoint2.trianglePoints,u=_this$computDrawPoint2.trianglePos,m=[T.x+T.w/2,T.y+T.h/2],M={pos:m,name:e,id:e,zIndex:o,anchor:[0.5,0.5],size:[T.w,T.h]};s&&(M.scale=s),l&&(M.rotate=l),d&&(M.translate=d);var E=new kt(M),A={points:g,pos:[u[0]-m[0],u[1]-m[1]],fillColor:i,strokeColor:i,lineWidth:0,normalize:!1},b=new le(A);if(E.append(b),!f&&x&&v){var O={points:x,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(T.x*P[0]+y[0]-vt.SafeBorderPadding),y:Math.floor(T.y*P[1]+y[1]-vt.SafeBorderPadding),w:Math.floor(T.w*P[0]+2*vt.SafeBorderPadding),h:Math.floor(T.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],x=[p,this.tmpPoints[1],y],v=[i,a].concat(x,[l,d]);return{trianglePoints:x.map(function(T){return xt.Sub(T,_this74.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:P.map(function(T){return xt.Sub(T,_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 vi=/*#__PURE__*/function(_vt6){function vi(t){var _this76;_classCallCheck(this,vi);_this76=_callSuper(this,vi,[t]);et(_this76,"canRotate",!1);et(_this76,"scaleType",jt.all);et(_this76,"toolsType",ut.Ellipse);et(_this76,"tmpPoints",[]);et(_this76,"workOptions");et(_this76,"oldRect");et(_this76,"syncTimestamp");_this76.workOptions=t.toolsOpt,_this76.syncTimestamp=0,_this76.syncUnitTime=50;return _this76;}_inherits(vi,_vt6);return _createClass(vi,[{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:at.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:at.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:at.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:at.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:at.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:at.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:at.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,x=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(s),v=_this$computDrawPoint3.radius,T=_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:[T.w,T.h]};d&&(u.scale=d),c&&(u.rotate=c),p&&(u.translate=p);var m=new kt(u);if(i){var A=new ce({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/x[0],1/x[1]]});m.append(A);}var M=new Qi(_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 yi=/*#__PURE__*/function(_vt7){function yi(t){var _this77;_classCallCheck(this,yi);_this77=_callSuper(this,yi,[t]);et(_this77,"canRotate",!0);et(_this77,"scaleType",jt.all);et(_this77,"toolsType",ut.Rectangle);et(_this77,"tmpPoints",[]);et(_this77,"workOptions");et(_this77,"oldRect");et(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(yi,_vt7);return _createClass(yi,[{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:at.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:at.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:at.DrawWork,dataType:Mt.Local,op:c.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:at.None};}var y=Pt(p,this.oldRect);return this.oldRect=p,_objectSpread({rect:y,type:at.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var s;var t=this.workId;if(this.tmpPoints.length<2)return{type:at.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:at.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,x=_this$workOptions8.strokeType,v=_this$workOptions8.eraserlines,T=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:x===Lt.Dotted?[1,d*2]:x===Lt.LongDotted?[d,d*2]:void 0},E={x:Math.floor(u.x*f[0]+T[0]-vt.SafeBorderPadding),y:Math.floor(u.y*f[1]+T[1]-vt.SafeBorderPadding),w:Math.floor(u.w*f[0]+2*vt.SafeBorderPadding),h:Math.floor(u.h*f[0]+2*vt.SafeBorderPadding)},A=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(A.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]]});A.appendChild(O);}if(v&&this.drawEraserlines({group:A,eraserlines:v,pos:m,layer:n}),this.replace(n,o||e,A),p||y||P){var _O10=A.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 Si=/*#__PURE__*/function(_vt8){function Si(t){var _this78;_classCallCheck(this,Si);_this78=_callSuper(this,Si,[t]);et(_this78,"canRotate",!1);et(_this78,"scaleType",jt.all);et(_this78,"toolsType",ut.Star);et(_this78,"tmpPoints",[]);et(_this78,"workOptions");et(_this78,"oldRect");et(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(Si,_vt8);return _createClass(Si,[{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:at.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:at.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:at.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:at.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:at.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:at.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:at.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,x=_this$workOptions9.translate,v=_this$workOptions9.strokeType,T=_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),x&&(E.translate=x);var A=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]]});A.append(L);}var b=new le(_objectSpread(_objectSpread({},M),{},{pos:[0,0]}));A.append(b),T&&this.drawEraserlines({group:A,eraserlines:T,pos:u,layer:n}),this.replace(n,e,A);var O=A.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=Ci(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 x=P*p-0.5*Math.PI;var v=void 0,_T32=void 0;P%n===1?(v=d*s[0]*Math.cos(x),_T32=d*s[1]*Math.sin(x)):(v=l*s[0]*Math.cos(x),_T32=l*s[1]*Math.sin(x),c.push(v,_T32)),c.push(v,_T32);}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 x=e;return e.tagName==="GROUP"&&(x=e.children[0]),a&&(x.setAttribute("strokeColor",a),P!=null&&P.strokeColor&&(P.strokeColor=a)),o&&(o==="transparent"?x.setAttribute("fillColor","rgba(0,0,0,0)"):x.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 xi=/*#__PURE__*/function(_vt9){function xi(t){var _this79;_classCallCheck(this,xi);_this79=_callSuper(this,xi,[t]);et(_this79,"canRotate",!1);et(_this79,"scaleType",jt.all);et(_this79,"toolsType",ut.Polygon);et(_this79,"tmpPoints",[]);et(_this79,"workOptions");et(_this79,"oldRect");et(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(xi,_vt9);return _createClass(xi,[{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:at.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:at.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:at.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:at.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:at.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:at.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:at.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,x=_this$workOptions10.eraserlines,v=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(s,d),T=_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:[T.w,T.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),x&&this.drawEraserlines({group:M,eraserlines:x,pos:f,layer:n}),this.replace(n,e,M);var A=M.getBoundingClientRect();return{x:Math.floor(A.x-vt.SafeBorderPadding),y:Math.floor(A.y-vt.SafeBorderPadding),w:Math.floor(A.width+vt.SafeBorderPadding*2),h:Math.floor(A.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=Ci(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;}/**
407
+ null;}function ve(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__ */fe(wd);var Se=/*#__PURE__*/function(_vt3){function Se(t,e){var _this67;_classCallCheck(this,Se);_this67=_callSuper(this,Se,[t]);et(_this67,"canRotate",!1);et(_this67,"scaleType",jt.none);et(_this67,"toolsType",ut.Eraser);et(_this67,"serviceWork");et(_this67,"tmpPoints",[]);et(_this67,"workOptions");et(_this67,"worldPosition");et(_this67,"worldScaling");et(_this67,"eraserRect");et(_this67,"eraserPolyline");_this67.serviceWork=e,_this67.workOptions=t.toolsOpt,_this67.worldPosition=_this67.fullLayer.worldPosition,_this67.worldScaling=_this67.fullLayer.worldScaling;return _this67;}_inherits(Se,_vt3);return _createClass(Se,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Se,"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],_Se$eraserSizes$this$=Se.eraserSizes[this.workOptions.thickness],i=_Se$eraserSizes$this$.width,a=_Se$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),_Se$eraserSizes$this$2=Se.eraserSizes[this.workOptions.thickness],o=_Se$eraserSizes$this$2.width,s=_Se$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]),_Se$eraserSizes$this$3=Se.eraserSizes[this.workOptions.thickness],a=_Se$eraserSizes$this$3.width,o=_Se$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&&We(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;We(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,a.rect||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:ot.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:ot.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:ot.None},this.baseConsumeResult);var s=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap));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:ot.RemoveNode,rect:a,removeIds:_toConsumableArray(o)}:_objectSpread({type:ot.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getCanEraserNodeMap",value:function getCanEraserNodeMap(t){var 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
+ et(Se,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var se=Se;var Dd="__lodash_hash_undefined__";function Nd(h){return this.__data__.set(h,Dd),this;}var Wd=Nd;function Bd(h){return this.__data__.has(h);}var Fd=Bd,Ud=$n,jd=Wd,$d=Fd;function Ye(h){var r=-1,t=h==null?0:h.length;for(this.__data__=new Ud();++r<t;)this.add(h[r]);}Ye.prototype.add=Ye.prototype.push=jd;Ye.prototype.has=$d;var Nr=Ye;function zd(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 Gd=zd;function Hd(h,r){return h.has(r);}var Wr=Hd,Kd=Nr,Yd=Gd,Vd=Wr,Xd=1,kd=2;function Jd(h,r,t,e,n,i){var a=t&Xd,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&kd?new Kd():void 0;for(i.set(h,r),i.set(r,h);++c<o;){var P=h[c],x=r[c];if(e)var v=a?e(x,P,c,r,h,i):e(P,x,c,h,r,i);if(v!==void 0){if(v)continue;p=!1;break;}if(y){if(!Yd(r,function(T,f){if(!Vd(y,f)&&(P===T||n(P,T,t,e,i)))return y.push(f);})){p=!1;break;}}else if(!(P===x||n(P,x,t,e,i))){p=!1;break;}}return i["delete"](h),i["delete"](r),p;}var gi=Jd;function Zd(h){var r=-1,t=Array(h.size);return h.forEach(function(e,n){t[++r]=[n,e];}),t;}var Qd=Zd;function qd(h){var r=-1,t=Array(h.size);return h.forEach(function(e){t[++r]=e;}),t;}var Br=qd,pn=Be,mn=si,_d=Tr,t0=gi,e0=Qd,r0=Br,n0=1,i0=2,s0="[object Boolean]",o0="[object Date]",a0="[object Error]",l0="[object Map]",c0="[object Number]",f0="[object RegExp]",h0="[object Set]",u0="[object String]",d0="[object Symbol]",g0="[object ArrayBuffer]",p0="[object DataView]",vn=pn?pn.prototype:void 0,lr=vn?vn.valueOf:void 0;function m0(h,r,t,e,n,i,a){switch(t){case p0:if(h.byteLength!=r.byteLength||h.byteOffset!=r.byteOffset)return!1;h=h.buffer,r=r.buffer;case g0:return!(h.byteLength!=r.byteLength||!i(new mn(h),new mn(r)));case s0:case o0:case c0:return _d(+h,+r);case a0:return h.name==r.name&&h.message==r.message;case f0:case u0:return h==r+"";case l0:var o=e0;case h0:var s=e&n0;if(o||(o=r0),h.size!=r.size&&!s)return!1;var l=a.get(h);if(l)return l==r;e|=i0,a.set(h,r);var d=t0(o(h),o(r),e,n,i,a);return a["delete"](h),d;case d0:if(lr)return lr.call(h)==lr.call(r);}return!1;}var v0=m0,yn=ri,y0=1,S0=Object.prototype,x0=S0.hasOwnProperty;function T0(h,r,t,e,n,i){var a=t&y0,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:x0.call(r,p)))return!1;}var y=i.get(h),P=i.get(r);if(y&&P)return y==r&&P==h;var x=!0;i.set(h,r),i.set(r,h);for(var v=a;++c<s;){p=o[c];var T=h[p],f=r[p];if(e)var g=a?e(f,T,p,r,h,i):e(T,f,p,h,r,i);if(!(g===void 0?T===f||n(T,f,t,e,i):g)){x=!1;break;}v||(v=p=="constructor");}if(x&&!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)&&(x=!1);}return i["delete"](h),i["delete"](r),x;}var M0=T0,cr=zn,P0=gi,O0=v0,E0=M0,Sn=or,xn=Fe,Tn=Pr,C0=kn,A0=1,Mn="[object Arguments]",Pn="[object Array]",je="[object Object]",R0=Object.prototype,On=R0.hasOwnProperty;function I0(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?je:s,l=l==Mn?je:l;var d=s==je,c=l==je,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||C0(h)?P0(h,r,t,e,n,i):O0(h,r,s,t,e,n,i);if(!(t&A0)){var y=d&&On.call(h,"__wrapped__"),P=c&&On.call(r,"__wrapped__");if(y||P){var x=y?h.value():h,v=P?r.value():r;return i||(i=new cr()),n(x,v,t,e,i);}}return p?(i||(i=new cr()),E0(h,r,t,e,n,i)):!1;}var L0=I0,w0=L0,En=ne;function pi(h,r,t,e,n){return h===r?!0:h==null||r==null||!En(h)&&!En(r)?h!==h&&r!==r:w0(h,r,t,e,pi,n);}var b0=pi,D0=b0;function N0(h,r){return D0(h,r);}var W0=N0,oe=/* @__PURE__ */fe(W0);var _e=/*#__PURE__*/function(_vt4){function _e(t){var _this69;_classCallCheck(this,_e);_this69=_callSuper(this,_e,[t]);et(_this69,"toolsType",ut.Selector);et(_this69,"tmpPoints",[]);et(_this69,"workOptions");et(_this69,"vNodes");et(_this69,"selectIds");et(_this69,"selectorColor");et(_this69,"strokeColor");et(_this69,"fillColor");et(_this69,"oldSelectRect");et(_this69,"canRotate",!1);et(_this69,"canTextEdit",!1);et(_this69,"canLock",!1);et(_this69,"scaleType",jt.all);et(_this69,"toolsTypes");et(_this69,"shapeOpt");et(_this69,"textOpt");et(_this69,"isLocked");et(_this69,"thickness");et(_this69,"strokeType");et(_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===It.Start&&(i=this.unSelectedAllIds()),!(e!=null&&e.length)||!this.vNodes.curNodeMap.size)return{type:ot.None};this.updateTempPoints(e);var a=this.computSelector();if(this.selectIds&&oe(this.selectIds,a.selectIds))return{type:ot.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:ot.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:ot.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:ot.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(Oi(_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,x,v,T,f,_iterator25,_step25,M,E,A,w,O,L,b,I,R,W,z,K,g,_M9,_E4,_A5,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,x=e.translate,v=e.dir,T=e.scale;s&&(x?e.translate=[x[0]+s[0],x[1]+s[1]]:e.translate=s);if(!(p||x||Zt(P))){_context24.next=9;break;}if(!(y===It.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(i.setTargetAssignKeys(n),{type:ot.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;}A=E.toolsType,w=E.opt,O=(l==null?void 0:l.getElementsByName(M))[0];if(!O){_context24.next=50;break;}L=!1,b=!1;I=_objectSpread({},e);R=void 0;if(!A){_context24.next=50;break;}I.thickness&&E.opt.thickness&&(L=E.opt.thickness!==I.thickness),I.strokeType&&(m=E.opt)!=null&&m.strokeType&&(b=E.opt.strokeType!==I.strokeType),R=f==null?void 0:f.get(M);W=Pi(A);if(!(W==null||W.updateNodeOpt({node:O,opt:I,vNodes:i,willSerializeData:a,targetNode:R}),E&&o&&(a&&(I.angle||I.translate)||I.originPoint&&I.scenePoint&&I.scale||I.pointMap&&I.pointMap.has(M)||A===ut.Text&&(I.fontSize||I.translate||I.textInfos&&I.textInfos.get(M))||A===ut.Image&&(I.angle||I.translate||I.scale||I.strokeColor&&w.type===xr.Iconify)||A===I.toolsType&&I.willRefresh||L||b))){_context24.next=49;break;}z=o.createWorkShapeNode({workId:M,toolsType:A,toolsOpt:E.opt});z==null||z.setWorkId(M);K=void 0;if(!(A===ut.Image)){_context24.next=35;break;}_context24.next=32;return z.consumeServiceAsync({isFullWork:!0,replaceId:M,worker:o});case 32:K=_context24.sent;_context24.next=48;break;case 35:if(!(A===ut.Text)){_context24.next=41;break;}_context24.next=38;return z.consumeServiceAsync({isFullWork:!0,replaceId:M});case 38:K=_context24.sent;_context24.next=48;break;case 41:_context24.prev=41;K=z==null?void 0:z.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:K&&(E.rect=K);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===It.Done&&(i.deleteLastTarget(),f=void 0);g=d;if(!(p&&x&&T&&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:x[0]>0&&x[1]>0?_E4=_M9[0]:x[0]>0?_E4=_M9[3]:x[1]>0?_E4=_M9[1]:_E4=_M9[2];return _context24.abrupt("break",75);case 69:x[0]<0&&x[1]>0?_E4=_M9[1]:x[0]<0?_E4=_M9[2]:x[1]>0?_E4=_M9[0]:_E4=_M9[3];return _context24.abrupt("break",75);case 71:x[0]<0&&x[1]<0?_E4=_M9[2]:x[0]<0?_E4=_M9[1]:x[1]<0?_E4=_M9[3]:_E4=_M9[0];return _context24.abrupt("break",75);case 73:x[0]>0&&x[1]<0?_E4=_M9[3]:x[0]>0?_E4=_M9[0]:x[1]<0?_E4=_M9[2]:_E4=_M9[1];return _context24.abrupt("break",75);case 75:_A5=_E4&&[p[0]-_E4[0],p[1]-_E4[1]]||[0,0];if(oe(_A5,[0,0])){_context24.next=80;break;}_context24.next=79;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{},offset:_A5}));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:ot.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(_x26){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:ot.Select,dataType:Mt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(De,"-");}},{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:ot.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:ot.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);et(_e,"selectorBorderId","selector-border");var Ve=_e;var mi=/*#__PURE__*/function(_vt5){function mi(t){var _this73;_classCallCheck(this,mi);_this73=_callSuper(this,mi,[t]);et(_this73,"canRotate",!1);et(_this73,"scaleType",jt.both);et(_this73,"toolsType",ut.Arrow);et(_this73,"tmpPoints",[]);et(_this73,"workOptions");et(_this73,"oldRect");et(_this73,"arrowTipWidth");et(_this73,"syncTimestamp");_this73.workOptions=t.toolsOpt,_this73.arrowTipWidth=_this73.workOptions.thickness*4,_this73.syncTimestamp=0,_this73.syncUnitTime=50;return _this73;}_inherits(mi,_vt5);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:ot.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:ot.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:ot.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:ot.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread(_objectSpread({rect:p},this.baseConsumeResult),{},{type:ot.DrawWork,dataType:Mt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.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=Qt(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:ot.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),x=_this$computDrawPoint2.points,v=_this$computDrawPoint2.pos,T=_this$computDrawPoint2.rect,f=_this$computDrawPoint2.isTriangle,g=_this$computDrawPoint2.trianglePoints,u=_this$computDrawPoint2.trianglePos,m=[T.x+T.w/2,T.y+T.h/2],M={pos:m,name:e,id:e,zIndex:o,anchor:[0.5,0.5],size:[T.w,T.h]};s&&(M.scale=s),l&&(M.rotate=l),d&&(M.translate=d);var E=new kt(M),A={points:g,pos:[u[0]-m[0],u[1]-m[1]],fillColor:i,strokeColor:i,lineWidth:0,normalize:!1},w=new le(A);if(E.append(w),!f&&x&&v){var O={points:x,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(T.x*P[0]+y[0]-vt.SafeBorderPadding),y:Math.floor(T.y*P[1]+y[1]-vt.SafeBorderPadding),w:Math.floor(T.w*P[0]+2*vt.SafeBorderPadding),h:Math.floor(T.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],x=[p,this.tmpPoints[1],y],v=[i,a].concat(x,[l,d]);return{trianglePoints:x.map(function(T){return xt.Sub(T,_this74.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:P.map(function(T){return xt.Sub(T,_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 vi=/*#__PURE__*/function(_vt6){function vi(t){var _this76;_classCallCheck(this,vi);_this76=_callSuper(this,vi,[t]);et(_this76,"canRotate",!1);et(_this76,"scaleType",jt.all);et(_this76,"toolsType",ut.Ellipse);et(_this76,"tmpPoints",[]);et(_this76,"workOptions");et(_this76,"oldRect");et(_this76,"syncTimestamp");_this76.workOptions=t.toolsOpt,_this76.syncTimestamp=0,_this76.syncUnitTime=50;return _this76;}_inherits(vi,_vt6);return _createClass(vi,[{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:ot.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:ot.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:ot.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:ot.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:ot.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.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=Qt(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:ot.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,x=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(s),v=_this$computDrawPoint3.radius,T=_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:[T.w,T.h]};d&&(u.scale=d),c&&(u.rotate=c),p&&(u.translate=p);var m=new kt(u);if(i){var A=new ce({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/x[0],1/x[1]]});m.append(A);}var M=new Qi(_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 yi=/*#__PURE__*/function(_vt7){function yi(t){var _this77;_classCallCheck(this,yi);_this77=_callSuper(this,yi,[t]);et(_this77,"canRotate",!0);et(_this77,"scaleType",jt.all);et(_this77,"toolsType",ut.Rectangle);et(_this77,"tmpPoints",[]);et(_this77,"workOptions");et(_this77,"oldRect");et(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(yi,_vt7);return _createClass(yi,[{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:ot.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:ot.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:ot.DrawWork,dataType:Mt.Local,op:c.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ot.None};}var y=Pt(p,this.oldRect);return this.oldRect=p,_objectSpread({rect:y,type:ot.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var s;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.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=Qt(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:ot.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,x=_this$workOptions8.strokeType,v=_this$workOptions8.eraserlines,T=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:x===Lt.Dotted?[1,d*2]:x===Lt.LongDotted?[d,d*2]:void 0},E={x:Math.floor(u.x*f[0]+T[0]-vt.SafeBorderPadding),y:Math.floor(u.y*f[1]+T[1]-vt.SafeBorderPadding),w:Math.floor(u.w*f[0]+2*vt.SafeBorderPadding),h:Math.floor(u.h*f[0]+2*vt.SafeBorderPadding)},A=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}),w=new le(_objectSpread(_objectSpread({},M),{},{pos:[0,0]}));if(A.appendChild(w),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]]});A.appendChild(O);}if(v&&this.drawEraserlines({group:A,eraserlines:v,pos:m,layer:n}),this.replace(n,o||e,A),p||y||P){var _O10=A.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 Si=/*#__PURE__*/function(_vt8){function Si(t){var _this78;_classCallCheck(this,Si);_this78=_callSuper(this,Si,[t]);et(_this78,"canRotate",!1);et(_this78,"scaleType",jt.all);et(_this78,"toolsType",ut.Star);et(_this78,"tmpPoints",[]);et(_this78,"workOptions");et(_this78,"oldRect");et(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(Si,_vt8);return _createClass(Si,[{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:ot.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:ot.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:ot.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:ot.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:ot.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.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=Qt(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:ot.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,x=_this$workOptions9.translate,v=_this$workOptions9.strokeType,T=_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),x&&(E.translate=x);var A=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]]});A.append(L);}var w=new le(_objectSpread(_objectSpread({},M),{},{pos:[0,0]}));A.append(w),T&&this.drawEraserlines({group:A,eraserlines:T,pos:u,layer:n}),this.replace(n,e,A);var O=A.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=Ci(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 x=P*p-0.5*Math.PI;var v=void 0,_T32=void 0;P%n===1?(v=d*s[0]*Math.cos(x),_T32=d*s[1]*Math.sin(x)):(v=l*s[0]*Math.cos(x),_T32=l*s[1]*Math.sin(x),c.push(v,_T32)),c.push(v,_T32);}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 x=e;return e.tagName==="GROUP"&&(x=e.children[0]),a&&(x.setAttribute("strokeColor",a),P!=null&&P.strokeColor&&(P.strokeColor=a)),o&&(o==="transparent"?x.setAttribute("fillColor","rgba(0,0,0,0)"):x.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 xi=/*#__PURE__*/function(_vt9){function xi(t){var _this79;_classCallCheck(this,xi);_this79=_callSuper(this,xi,[t]);et(_this79,"canRotate",!1);et(_this79,"scaleType",jt.all);et(_this79,"toolsType",ut.Polygon);et(_this79,"tmpPoints",[]);et(_this79,"workOptions");et(_this79,"oldRect");et(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(xi,_vt9);return _createClass(xi,[{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:ot.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:ot.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:ot.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:ot.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:ot.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.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=Qt(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:ot.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,x=_this$workOptions10.eraserlines,v=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(s,d),T=_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:[T.w,T.h]};c&&(m.scale=c),p&&(m.rotate=p),y&&(m.translate=y);var M=new kt(m);if(i){var w=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(w);}var E=new le(_objectSpread(_objectSpread({},u),{},{pos:[0,0]}));M.append(E),x&&this.drawEraserlines({group:M,eraserlines:x,pos:f,layer:n}),this.replace(n,e,M);var A=M.getBoundingClientRect();return{x:Math.floor(A.x-vt.SafeBorderPadding),y:Math.floor(A.y-vt.SafeBorderPadding),w:Math.floor(A.width+vt.SafeBorderPadding*2),h:Math.floor(A.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=Ci(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 _t=/*#__PURE__*/function(){function _t(){_classCallCheck(this,_t);}return _createClass(_t,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(_t.getBezierPoints(r,i,a,o,s))):i&&a&&o?e.push.apply(e,_toConsumableArray(_t.getBezierPoints(r,i,a,o))):i&&a?e.push.apply(e,_toConsumableArray(_t.getBezierPoints(r,i,a))):i&&e.push(i);}return e;}/**
409
409
  * @desc 获取点,这里可以设置点的个数
410
410
  * @param {number} num 点个数
411
411
  * @param {Vec2d} p1 点坐标
@@ -415,7 +415,7 @@ et(Se,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.fr
415
415
  * 如果参数是 num, p1, p2 为一阶贝塞尔
416
416
  * 如果参数是 num, p1, c1, p2 为二阶贝塞尔
417
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;}/**
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=_t.oneBezier:n&&!i?a=_t.twoBezier:n&&i&&(a=_t.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
419
  * @desc 一阶贝塞尔
420
420
  * @param {number} t 当前百分比
421
421
  * @param {Vec2d} p1 起点坐标
@@ -433,7 +433,7 @@ et(Se,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.fr
433
433
  * @param {Array} p2 终点坐标
434
434
  * @param {Array} cp1 控制点1
435
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 Ti=/*#__PURE__*/function(_vt10){function Ti(t){var _this80;_classCallCheck(this,Ti);_this80=_callSuper(this,Ti,[t]);et(_this80,"canRotate",!1);et(_this80,"scaleType",jt.all);et(_this80,"toolsType",ut.SpeechBalloon);et(_this80,"ratio",0.8);et(_this80,"tmpPoints",[]);et(_this80,"workOptions");et(_this80,"oldRect");et(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(Ti,_vt10);return _createClass(Ti,[{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:at.None};var s=e.op,l=s==null?void 0:s.length;if(!l||l<2)return{type:at.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:at.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:at.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:at.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:at.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:at.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:at.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),x=_this$computDrawPoint7.rect,v=_this$computDrawPoint7.pos,T=_this$computDrawPoint7.points,f={points:T.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:[x.w,x.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),x=_.Sub(i[2],new _(0,o,0)),v=_.Sub(i[2],new _(a,0,0)),T=qt.getBezierPoints(10,x,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(T),[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(T),[_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(T),[_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(T),_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(T),_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(T),_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(T),_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(T),_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(T),_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(T),_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(T),_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(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),[_b21]));break;}}var E=Bt(this.tmpPoints,t),A=[Math.floor(E.x+E.w/2),Math.floor(E.y+E.h/2)];return{rect:E,pos:A,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 B0=de,F0=ne,U0="[object Boolean]";function j0(h){return h===!0||h===!1||F0(h)&&B0(h)==U0;}var $0=j0,ye=/* @__PURE__ */fe($0);var Ne=/*#__PURE__*/function(_vt11){function Ne(t){var _this81;_classCallCheck(this,Ne);_this81=_callSuper(this,Ne,[t]);et(_this81,"canRotate",!0);et(_this81,"scaleType",jt.all);et(_this81,"toolsType",ut.Image);et(_this81,"tmpPoints",[]);et(_this81,"workOptions");et(_this81,"oldRect");_this81.workOptions=t.toolsOpt,_this81.scaleType=Ne.getScaleType(_this81.workOptions);return _this81;}_inherits(Ne,_vt11);return _createClass(Ne,[{key:"consume",value:function consume(){return{type:at.None};}},{key:"consumeAll",value:function consumeAll(){return{type:at.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}),x={anchor:[0.5,0.5],pos:[0,0],size:[l,d],texture:a};a||(x.bgcolor="rgba(0,0,0,0.3)");var v=new es(x);P.append(v),y&&this.drawEraserlines({group:P,eraserlines:y,pos:[o,s],layer:e}),this.replace(e,i||n,P);var T=P.getBoundingClientRect();if(T)return{x:Math.floor(T.x-vt.SafeBorderPadding),y:Math.floor(T.y-vt.SafeBorderPadding),w:Math.floor(T.width+vt.SafeBorderPadding*2),h:Math.floor(T.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,x;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=8;break;}_context25.next=4;return i.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:s,isSubWorker:i instanceof Di});case 4:P=_context25.sent;if(!P){_context25.next=8;break;}x=this.draw({workId:s,layer:l,replaceId:n,imageBitmap:P});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:x,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:x&&vt.getCenterPos(x,l)}),x));case 8:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x27){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=n.strokeColor,x=a&&Xt(a)||i.get(e.name);if(!x)return;var v=e.parent;if(v){if(P&&(x.opt.strokeColor=P),_t(y)&&(e.setAttribute("zIndex",y),x.opt.zIndex=y),ye(p)&&(x.opt.locked=p),s&&l&&d&&o){var _x$opt=x.opt,_T33=_x$opt.centerX,_f29=_x$opt.centerY,g=_x$opt.width,u=_x$opt.height,m=_x$opt.uniformScale,M=m!==!1?[d[0],d[0]]:d,E=[_T33,_f29],A=[_T33,_f29];Ur(A,l,M,o);var b=[A[0]-E[0],A[1]-E[1]];if(x.centerPos=[x.centerPos[0]+b[0],x.centerPos[1]+b[1]],x.opt.width=Math.round(g*M[0]),x.opt.height=Math.round(u*M[1]),x.opt.centerX=A[0],x.opt.centerY=A[1],x.opt.eraserlines)for(var _i5=0,_Object$values4=Object.values(x.opt.eraserlines);_i5<_Object$values4.length;_i5++){var O=_Object$values4[_i5];var L=O.op,w=O.thickness;O.thickness=w*Math.max(d[0],d[1]);for(var I=0;I<L.length;I++)jr(L[I],l,d,o);}}else if(o){if(x.opt.centerX=x.opt.centerX+o[0],x.opt.centerY=x.opt.centerY+o[1],x.centerPos=[x.centerPos[0]+o[0],x.centerPos[1]+o[1]],x.opt.eraserlines)for(var _i6=0,_Object$values5=Object.values(x.opt.eraserlines);_i6<_Object$values5.length;_i6++){var _T34=_Object$values5[_i6];var _f30=_T34.op;for(var _g12=0;_g12<_f30.length;_g12++){var _u13=_f30[_g12].map(function(m,M){return M%2?m+o[1]:m+o[0];});_T34.op[_g12]=_u13;}}}else if(_t(c))if(x.opt.rotate=c,x.scaleType=Ne.getScaleType(x.opt),a){var _T35=Ei(x.rect,c);x.rect=_T35;}else{var _T36=vt.getRectFromLayer(v,e.name);x.rect=_T36||x.rect;}return x&&i.setInfo(e.name,x),x==null?void 0:x.rect;}}}]);}(vt);var Mi=/*#__PURE__*/function(_vt12){function Mi(t){var _this82;_classCallCheck(this,Mi);_this82=_callSuper(this,Mi,[t]);et(_this82,"canRotate",!1);et(_this82,"scaleType",jt.both);et(_this82,"toolsType",ut.Straight);et(_this82,"tmpPoints",[]);et(_this82,"workOptions");et(_this82,"oldRect");et(_this82,"straightTipWidth");et(_this82,"syncTimestamp");_this82.workOptions=t.toolsOpt,_this82.straightTipWidth=_this82.workOptions.thickness/2,_this82.syncTimestamp=0,_this82.syncUnitTime=50;return _this82;}_inherits(Mi,_vt12);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:at.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:at.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:at.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:at.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:at.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:at.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:at.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),x=_this$computDrawPoint8.d,v=_this$computDrawPoint8.rect,T=_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:x,fillColor:i,strokeColor:i,lineDash:c===Lt.Dotted&&!T?[1,a*2]:c===Lt.LongDotted&&!T?[a,a*2]:void 0,lineCap:c===Lt.Normal||T?void 0:"round",lineWidth:c===Lt.Normal||T?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]);et(_this83,"canRotate",!1);et(_this83,"scaleType",jt.proportional);et(_this83,"toolsType",ut.Text);et(_this83,"tmpPoints",[]);et(_this83,"workOptions");et(_this83,"oldRect");_this83.workOptions=t.toolsOpt;return _this83;}_inherits(ie,_vt13);return _createClass(ie,[{key:"consume",value:function consume(){return{type:at.None};}},{key:"consumeAll",value:function consumeAll(){return{type:at.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,x,v,_T37,_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]},x={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,x);case 7:v=_context26.sent;_T37=v.labels;_f31=v.maxWidth;y.append.apply(y,_toConsumableArray(_T37)),x.w=Math.ceil(Math.max(_f31*n.worldScaling[0],x.w));case 11:return _context26.abrupt("return",(l&&this.drawEraserlines({group:y,eraserlines:l,pos:[o[0],o[1]],layer:n}),x));case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x28){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===It.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(_x29){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,x,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),ye(l)&&(p.opt.lineThrough=l),ye(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===It.Done||e});case 8:y=_context28.sent;return _context28.abrupt("return",((x=this.vNodes)==null||x.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(_x30,_x31){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,x,v,T,f,g,u,m,M,E,A,b,O,w,I,R,W,z,K,k,q,U,G,Z,rt,tt,J,ht,dt,B,F,Y,X,nt,_J2,_ht,_dt,_J3,_ht2,_rt3,_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=Me(t.text),c=d.length,p=t.fontSize,y=t.lineHeight,P=t.bold,x=t.textAlign,v=t.italic,T=t.fontFamily,f=t.verticalAlign,g=t.fontColor,u=t.fontBgColor,m=t.underline,M=t.lineThrough,E=ie.getSafetySnippetRatio(e)||1,A=Math.floor(p*E),b=ie.getSafetySnippetFontLength(A);O=0;w=0;case 3:if(!(w<c)){_context29.next=33;break;}I=d[w],R=y||A*1.5;if(!I){_context29.next=30;break;}W=Q0(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;}x==="left"&&(k[0]=U),Z===0&&v==="italic"&&(k[0]=k[0]-q/2*p);rt=I.slice(Z,Z+b);tt={anchor:[0,0],pos:k,text:rt,fontFamily:T,fontSize:A,lineHeight:R,strokeColor:g,fontWeight:P,fillColor:g,textAlign:x,fontStyle:v,scale:[1/E,1/E]};J=new qi(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);}_rt3={pos:z,anchor:[0,0],size:K,bgcolor:u},_tt2=new kt(_rt3);_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(_x32,_x33,_x34){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,x=n.lineThrough,v=n.underline,T=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(A){A.tagName==="LABEL"?(A.setAttribute("fillColor",s),A.setAttribute("strokeColor",s)):A.tagName==="POLYLINE"&&A.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),ye(x)&&(M.lineThrough=x),ye(v)&&(M.underline=v),T&&(M.fontSize=T),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 A=[M.boxPoint[0],M.boxPoint[1]];Ur(M.boxPoint,c,p,l);var b=[u.op[0],u.op[1]],O=[b[0]-A[0],b[1]-A[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 R=0;R<_w9.length;R++)jr(_w9[R],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 _A6=_E5.op;for(var _b22=0;_b22<_A6.length;_b22++){var _O22=_A6[_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
- et(ie,"textImageSnippetSize",1024*4),et(ie,"SafeBorderPadding",30);var Xe=ie;var xe=/*#__PURE__*/function(_vt14){function xe(t,e){var _this84;_classCallCheck(this,xe);_this84=_callSuper(this,xe,[t]);et(_this84,"canRotate",!1);et(_this84,"scaleType",jt.none);et(_this84,"toolsType",ut.PencilEraser);et(_this84,"serviceWork");et(_this84,"tmpPoints",[]);et(_this84,"workOptions");et(_this84,"worldPosition");et(_this84,"worldScaling");et(_this84,"eraserRect");et(_this84,"eraserPolyline");_this84.serviceWork=e,_this84.workOptions=t.toolsOpt,_this84.worldPosition=_this84.fullLayer.worldPosition,_this84.worldScaling=_this84.fullLayer.worldScaling;return _this84;}_inherits(xe,_vt14);return _createClass(xe,[{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],_xe$eraserSizes$this$=xe.eraserSizes[this.workOptions.thickness],i=_xe$eraserSizes$this$.width,a=_xe$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),_xe$eraserSizes$this$2=xe.eraserSizes[this.workOptions.thickness],o=_xe$eraserSizes$this$2.width,s=_xe$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]),_xe$eraserSizes$this$3=xe.eraserSizes[this.workOptions.thickness],a=_xe$eraserSizes$this$3.width,o=_xe$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,x){return x<p.length-1?o([P,p[x+1]],[l[0],l[1]]):!1;});if(y!==-1&&y>-1){var P=[],x=p.slice(0,y+1);if(_.Equals(p[y],l[0])||x.push(l[0].clone().setz(p[y].z)),x.length>1&&P.push(x),y+l.length-1<p.length-1){var v=y+l.length-1,_T38=p.slice(v),_f32=l[l.length-1];_.Equals(p[v],_f32)||_T38.unshift(_f32.clone().setz(p[v].z)),_T38.length>1&&P.push(_T38);}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&&We(this.eraserRect,s.rect)){var l=s.op,d=s.toolsType,c=this.isLineEraser(d,!1),p=[],y=[];for(var x=0;x<l.length;x+=3){var v=new _(l[x]*this.worldScaling[0]+this.worldPosition[0],l[x+1]*this.worldScaling[1]+this.worldPosition[1],l[x+2]);y.push(v),p.push(new xt(v.x,v.y));}var P=p.length&&Bt(p)||s.rect;if(We(P,this.eraserRect)){if(y.length>1){var _x35=Dr.polyline(y.map(function(v){return v.XY;}),this.eraserPolyline);if(_x35.length&&(n.add(s.name),!c)){var _v8=this.translateIntersect(_x35),_T39=this.cutPolyline(_v8,y);var _loop5=function _loop5(){var g="".concat(o,"_s_").concat(_f33),u=[];_T39[_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<_T39.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:at.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:at.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:at.None},this.baseConsumeResult);this.vNodes.setTarget();var l=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(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:at.RemoveNode,rect:a,removeIds:_toConsumableArray(o),newWorkDatas:s};}return _objectSpread({type:at.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getCanEraserNodeMap",value:function getCanEraserNodeMap(t){var 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
- et(xe,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var ke=xe;var we=/*#__PURE__*/function(_vt15){function we(t){var _this87;_classCallCheck(this,we);_this87=_callSuper(this,we,[t]);et(_this87,"canRotate",!1);et(_this87,"scaleType",jt.none);et(_this87,"toolsType",ut.BitMapEraser);et(_this87,"tmpPoints",[]);et(_this87,"workOptions");et(_this87,"worldPosition");et(_this87,"worldScaling");et(_this87,"eraserRect");et(_this87,"eraserPolyline");et(_this87,"syncUnitTime",re.syncOpt.interval);et(_this87,"syncIndex",0);et(_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=G0(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 _v9=_step33.value;Dr.polyline(_v9,_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 _T40=[];for(var _f34=0;_f34<v.length;_f34++)_f34!==0&&oe(v[_f34],v[_f34-1])||_T40.push.apply(_T40,_toConsumableArray(v[_f34]));P.push(_T40);}}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(_x36){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:at.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:at.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),x=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(T){v.push(T.x,T.y,o/2);}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:at.DrawWork,dataType:Mt.Local,rect:x,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:at.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:at.FullWork},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:at.FullWork,dataType:Mt.Local,rect:e,ops:d,willUpdateNodes:s});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(vt);// 来源于white-sdk
439
- et(we,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var Je=we;function Pi(h){switch(h){case ut.Arrow:return mi;case ut.Pencil:return ui;case ut.Straight:return Mi;case ut.Ellipse:return vi;case ut.Polygon:case ut.Triangle:return xi;case ut.Star:case ut.Rhombus:return Si;case ut.Rectangle:return yi;case ut.SpeechBalloon:return Ti;case ut.Text:return Xe;case ut.LaserPen:return di;case ut.Eraser:return se;case ut.PencilEraser:return ke;case ut.BitMapEraser:return Je;case ut.Selector:return Ve;case ut.Image:return Ne;}}function Fr(h,r){var t=h.toolsType,e=_objectWithoutProperties(h,_excluded);switch(t){case ut.Arrow:return new mi(e);case ut.Pencil:return new ui(e);case ut.Straight:return new Mi(e);case ut.Ellipse:return new vi(e);case ut.Polygon:case ut.Triangle:return new xi(e);case ut.Star:case ut.Rhombus:return new Si(e);case ut.Rectangle:return new yi(e);case ut.SpeechBalloon:return new Ti(e);case ut.Text:return new Xe(e);case ut.LaserPen:return new di(e);case ut.Eraser:return new se(e,r);case ut.BitMapEraser:return new Je(e);case ut.PencilEraser:return new ke(e,r);case ut.Selector:return e.vNodes?new Ve(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case ut.Image:return new Ne(e);default:return;}}function Oi(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 Oi(_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 We(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 z0(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 Ei(h,r){var t=z0(h,r);return Bt(t);}function G0(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 H0(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 K0(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 Y0(h,r){return h[0]>=r.x&&h[0]<=r.x+r.w&&h[1]>=r.y&&h[1]<=r.y+r.h;}function Ci(h,r){var t=h<=r?1:h/r,e=r<=h?1:r/h;return[t,e];}function V0(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 X0(h){return h!==Math.floor(h);}function k0(h){var r=h.toString();return r.indexOf(".")!==-1?r.split(".")[1].length:0;}function J0(h,r){for(;r!==0;){var _ref168=[r,h%r];h=_ref168[0];r=_ref168[1];}return h;}var Z0=function Z0(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;};function pe(h){return"".concat(Ze(h.x),",").concat(Ze(h.y)," ");}function me(h,r){return"".concat(Ze((h.x+r.x)/2),",").concat(Ze((h.y+r.y)/2)," ");}function Ze(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?Te.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?Te.inside:Te.intersect;};function Q0(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 be="cursorhover",Cn=20,Qe="mainView";var q0=/*#__PURE__*/function(){function q0(r,t){_classCallCheck(this,q0);et(this,"viewId");et(this,"scene");et(this,"fullLayer");et(this,"curNodeMap",/* @__PURE__ */new Map());et(this,"targetNodeMap",[]);et(this,"highLevelIds");et(this,"canClearUids");et(this,"localUid");this.viewId=r,this.scene=t;}return _createClass(q0,[{key:"init",value:function init(r){this.fullLayer=r;}},{key:"get",value:function get(r){return this.curNodeMap.get(r);}},{key:"setLocalUid",value:function setLocalUid(r){this.localUid=r;}},{key:"getLocalUid",value:function getLocalUid(){return this.localUid;}},{key:"setCanClearUids",value:function setCanClearUids(r){this.canClearUids=r;}},{key:"getCanClearUids",value:function getCanClearUids(){return this.canClearUids;}},{key:"getCanEraserNodes",value:function getCanEraserNodes(r){var t=/* @__PURE__ */new Map();var _iterator38=_createForOfIteratorHelper(r.entries()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _step38$value=_slicedToArray(_step38.value,2),_e9=_step38$value[0],n=_step38$value[1];n.toolsType===ut.Image&&n.opt.locked||n.toolsType===ut.Text&&(n.opt.workState===It.Doing||n.opt.workState===It.Start)||this.isCanClearWorkId(_e9)&&t.set(_e9,n);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return t;}},{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(){return!0;}},{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&&V0(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)),ye(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:"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 _iterator39=_createForOfIteratorHelper(this.curNodeMap.entries()),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _step39$value=_slicedToArray(_step39.value,2),a=_step39$value[0],o=_step39$value[1];if(We(r,o.rect)){if(t&&o.toolsType===ut.Image&&o.opt.locked||e&&o.toolsType===ut.Text&&(o.opt.workState===It.Doing||o.opt.workState===It.Start))continue;n=Pt(n,o.rect),i.set(a,o);}}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}return{rectRange:n,nodeRange:i};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(r,t){var e=Pi(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 _e10=this.getNodeRectFormShape(r,t);if(!_e10){this.curNodeMap["delete"](r);return;}t.rect=_e10,this.curNodeMap.set(r,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(r){this.highLevelIds=r;var _iterator40=_createForOfIteratorHelper(this.highLevelIds.keys()),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var t=_step40.value;this.updateNodeRect(t);}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var r;var _iterator41=_createForOfIteratorHelper(this.curNodeMap.keys()),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var t=_step41.value;(r=this.highLevelIds)!=null&&r.has(t)||this.updateNodeRect(t);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(r){var t=/* @__PURE__ */new Map();var _iterator42=_createForOfIteratorHelper(r),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var _e11=_step42.value;var n=this.curNodeMap.get(_e11);n&&t.set(_e11,Xt(n));}}catch(err){_iterator42.e(err);}finally{_iterator42.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;}},{key:"isLocalWorkId",value:function isLocalWorkId(r){return r.split(De).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(r){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(Iu(this.canClearUids)){var t=r.split(De);if(t.length===1)return this.canClearUids.has("localSelf")||this.localUid&&this.canClearUids.has(this.localUid);if(t.length===2)return this.canClearUids.has(t[0]);}return!1;}}]);}();var Ai=/*#__PURE__*/function(){function Ai(r,t,e){_classCallCheck(this,Ai);et(this,"viewId");et(this,"scene");et(this,"fullLayer");et(this,"vNodes");et(this,"dpr");et(this,"contextType");et(this,"opt");et(this,"cameraOpt");et(this,"isSafari",!1);et(this,"combinePostMsg",/* @__PURE__ */new Set());et(this,"workerTaskId");et(this,"protectedTask");et(this,"hasPriorityDraw",!0);et(this,"delayPostDoneResolve");et(this,"cacheImages",/* @__PURE__ */new Map());et(this,"imageResolveMap",/* @__PURE__ */new Map());var n,i;if(this.viewId=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(e,(n=t==null?void 0:t.offscreenCanvasOpt)==null?void 0:n.contextType),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");try{this.createRenderLayer(t);}catch(_unused25){if(this.contextType!=="2d")this.contextType="2d",(i=this.scene)==null||i.disconnect(),this.createRenderLayer(t);else throw new Error("Sorry, your browser doesn't support canvas context type ".concat(this.contextType));}this.vNodes=new q0(r,this.scene);}return _createClass(Ai,[{key:"createRenderLayer",value:function createRenderLayer(r){this.scene=this.createScene(r.offscreenCanvasOpt);var t=re.bufferSize.full,e=re.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:this.viewId===Qe?t:e}));}},{key:"getCachedImages",value:function getCachedImages(r){var t;return(t=this.cacheImages.get(r))==null?void 0:t.imageBitmap;}},{key:"getCachedImagesByWorkId",value:function getCachedImagesByWorkId(r){var _iterator43=_createForOfIteratorHelper(this.cacheImages.entries()),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _step43$value=_slicedToArray(_step43.value,2),t=_step43$value[0],_e12=_step43$value[1];if(t===r&&_e12.imageBitmap)return _e12.imageBitmap;}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(r,t){var _iterator44=_createForOfIteratorHelper(this.cacheImages.entries()),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var _step44$value=_slicedToArray(_step44.value,2),_e13=_step44$value[0],n=_step44$value[1];t&&_e13===t||n.workId===r&&(n.imageBitmap.close(),this.cacheImages["delete"](_e13));}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(r){return r.imageBitmap.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 t,e,n,i,a,o,s,_s5,l,d,c;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===at.UpdateCamera?4:_context31.t0===at.Destroy?7:_context31.t0===at.Clear?9:_context31.t0===at.UpdateTools?12:_context31.t0===at.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){s={toolsType:e,toolsOpt:n};this.localWork.setToolsOpt(s);}return _context31.abrupt("break",16);case 14:if(i&&a&&o){_s5=o.toString();this.cacheImages.set(i,{imageBitmap:a,workId:_s5});l=this.imageResolveMap.get(i);if(l){d=l.resolve,c=l.timer;c&&clearTimeout(c),d&&d(i);}this.deleteCachedImagesByWorkId(_s5,i);}return _context31.abrupt("break",16);case 16:case"end":return _context31.stop();}},_callee29,this);}));function on(_x37){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(r,t,e){var n=r*e,i=t*e;return n<=50||i<=50?[50,50]:n<=100||i<=100?[100,100]:n<=200||i<=200?[200,200]:n<=400||i<=400?[400,400]:n<=800||i<=800?[800,800]:[1600,1600];}},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(r){var _this88=this;var t,e,n,i,a,o,s,l,d,c,p,_this$getIconSize,_this$getIconSize2,v,_T41,_v10,_v11,x;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=r.toolsType,e=r.opt,n=r.workId,i=r.isSubWorker;if(!(t===ut.Image&&e&&n)){_context32.next=19;break;}a=n.toString(),o=e.src,s=e.type,l=e.width,d=e.height,c=e.strokeColor;if(!(!o||!s||!l||!d)){_context32.next=5;break;}return _context32.abrupt("return");case 5:p=o;if(s===xr.Iconify){_this$getIconSize=this.getIconSize(l,d,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),v=_this$getIconSize2[0],_T41=_this$getIconSize2[1];p="".concat(o,"?width=").concat(v,"&height=").concat(_T41,"&color=").concat(c);}if(!this.cacheImages.has(p)){_context32.next=11;break;}_v10=this.getCachedImages(p);if(!_v10){_context32.next=11;break;}return _context32.abrupt("return",_v10);case 11:if(!this.imageResolveMap.has(p)){_context32.next=15;break;}_v11=this.getCachedImagesByWorkId(a);if(!_v11){_context32.next=15;break;}return _context32.abrupt("return",_v11);case 15:_context32.next=17;return new Promise(function(v){var T=_this88.imageResolveMap.get(p)||{resolve:void 0,timer:void 0};T.timer&&clearTimeout(T.timer),T.resolve=v,T.timer=setTimeout(function(){var f=_this88.imageResolveMap.get(p);f!=null&&f.resolve&&f.resolve(p);},5e3),_this88.imageResolveMap.set(p,T),_this88._post({sp:[{imageSrc:p,workId:a,viewId:_this88.viewId,isgl:!!_this88.fullLayer.parent.gl,isSubWorker:i,type:at.GetImageBitMap}]});});case 17:x=_context32.sent;return _context32.abrupt("return",(this.imageResolveMap["delete"](x),this.getCachedImages(p)));case 19:case"end":return _context32.stop();}},_callee30,this);}));function loadImageBitMap(_x38){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,t){var e=new OffscreenCanvas(100,100);var n=["2d"];r===qe.Full&&this.viewId===Qe&&(n=["webgl2","webgl","2d"],t&&n.unshift(t));for(var _i9=0,_n7=n;_i9<_n7.length;_i9++){var i=_n7[_i9];try{if(e.getContext(i))return i;}catch(_unused26){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 ts(_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(_x39){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===qe.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 _i))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 _s6=_step48.value;var _l7=!1;var _iterator49=_createForOfIteratorHelper(t),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _d13=_step49.value;if(oe(_s6,_d13)){_l7=!0;break;}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}_l7||t.push(_s6);}}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)),X0(t)){var a=k0(t),o=Math.pow(10,a),s=J0(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 Ri=/*#__PURE__*/function(){function Ri(r){_classCallCheck(this,Ri);et(this,"viewId");et(this,"vNodes");et(this,"thread");et(this,"fullLayer");et(this,"drawLayer");et(this,"_post");et(this,"tmpOpt");et(this,"workShapes",/* @__PURE__ */new Map());et(this,"drawCount",0);et(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(Ri,[{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 _0=ee,tg=function tg(){return _0.Date.now();},eg=tg,rg=/\s/;function ng(h){for(var r=h.length;r--&&rg.test(h.charAt(r)););return r;}var ig=ng,sg=ig,og=/^\s+/;function ag(h){return h&&h.slice(0,sg(h)+1).replace(og,"");}var lg=ag,cg=de,fg=ne,hg="[object Symbol]";function ug(h){return _typeof(h)=="symbol"||fg(h)&&cg(h)==hg;}var dg=ug,gg=lg,An=he,pg=dg,Rn=NaN,mg=/^[-+]0x[0-9a-f]+$/i,vg=/^0b[01]+$/i,yg=/^0o[0-7]+$/i,Sg=parseInt;function xg(h){if(typeof h=="number")return h;if(pg(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=gg(h);var t=vg.test(h);return t||yg.test(h)?Sg(h.slice(2),t?2:8):mg.test(h)?Rn:+h;}var Tg=xg,Mg=he,hr=eg,In=Tg,Pg="Expected a function",Og=Math.max,Eg=Math.min;function Cg(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(Pg);r=In(r)||0,Mg(t)&&(d=!!t.leading,c="maxWait"in t,i=c?Og(In(t.maxWait)||0,r):i,p="trailing"in t?!!t.trailing:p);function y(M){var E=e,A=n;return e=n=void 0,l=M,a=h.apply(A,E),a;}function P(M){return l=M,o=setTimeout(T,r),d?y(M):a;}function x(M){var E=M-s,A=M-l,b=r-E;return c?Eg(b,i-A):b;}function v(M){var E=M-s,A=M-l;return s===void 0||E>=r||E<0||c&&A>=i;}function T(){var M=hr();if(v(M))return f(M);o=setTimeout(T,x(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(T,r),y(s);}return o===void 0&&(o=setTimeout(T,r)),a;}return m.cancel=g,m.flush=u,m;}var Ag=Cg,Rg=Ag,Ig=he,Lg="Expected a function";function bg(h,r,t){var e=!0,n=!0;if(typeof h!="function")throw new TypeError(Lg);return Ig(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),Rg(h,r,{leading:e,maxWait:r,trailing:n});}var wg=bg,Dg=/* @__PURE__ */fe(wg);function Ng(h){return h;}var Ii=Ng;function Wg(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 Bg=Wg,Fg=Bg,Ln=Math.max;function Ug(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),Fg(h,this,o);};}var jg=Ug;function $g(h){return function(){return h;};}var zg=$g,Gg=zg,bn=Gn,Hg=Ii,Kg=bn?function(h,r){return bn(h,"toString",{configurable:!0,enumerable:!1,value:Gg(r),writable:!0});}:Hg,Yg=Kg,Vg=800,Xg=16,kg=Date.now;function Jg(h){var r=0,t=0;return function(){var e=kg(),n=Xg-(e-t);if(t=e,n>0){if(++r>=Vg)return arguments[0];}else r=0;return h.apply(void 0,arguments);};}var Zg=Jg,Qg=Yg,qg=Zg,_g=qg(Qg),tp=_g,ep=Ii,rp=jg,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 Li=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 bi=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=Li,Op=bi,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=Be,bp=Vn,wp=Fe,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 wi(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?wi(o,r-1,t,e,n):Wp(n,o):e||(n[n.length]=o);}return n;}var Fp=wi;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=Li,Xp=bi,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__ */fe(dm);var pm=/*#__PURE__*/function(_Ri){function pm(t){var _this90;_classCallCheck(this,pm);_this90=_callSuper(this,pm,[t]);et(_this90,"combineUnitTime",re.bezier.combineUnitTime);et(_this90,"combineTimerId");et(_this90,"combineDrawResolve");et(_this90,"combineDrawActiveId");et(_this90,"drawWorkActiveId");et(_this90,"effectSelectNodeData",/* @__PURE__ */new Set());et(_this90,"batchEraserWorks",/* @__PURE__ */new Set());et(_this90,"batchEraserRemoveNodes",/* @__PURE__ */new Set());et(_this90,"batchEraserCombine",Dg(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,_Ri);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:_context36.next=2;return this.thread.loadImageBitMap(t);case 2:return _context36.abrupt("return",_context36.sent);case 3:case"end":return _context36.stop();}},_callee34,this);}));function loadImageBitMap(_x40){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:at.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:at.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===at.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(_x41,_x42){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,x,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(be),x=(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&&x&&(s=v.selectIds)!=null&&s.includes(x)&&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:this.drawPencilEraser(_objectSpread(_objectSpread({},v),{},{scenePath:i}),a),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,v,a);case 27:return _context38.abrupt("break",42);case 28:this.drawEraser(_objectSpread(_objectSpread({},v),{},{scenePath:i}),a),p.clearTmpPoints();return _context38.abrupt("break",42);case 30:_context38.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},v),{},{scenePath:i}),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}),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(_x43,_x44){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:at.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(_x45,_x46){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&&Me(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:at.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(_x47){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:at.TextUpdate,toolsType:ut.Text,workId:t,dataType:Mt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t,e){var n,i,a,o,s,l,_iterator51,_step51,d,y,p;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:n=t.willSyncService,i=[],a=[],o=[],s=this.workShapes.get(Nt);if(s){_context41.next=3;break;}return _context41.abrupt("return");case 3:l=s.selectIds&&_toConsumableArray(s.selectIds)||[];_iterator51=_createForOfIteratorHelper(l);try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){d=_step51.value;if(this.vNodes.get(d)){y=this.commandDeleteText(d);y&&i.push(y);}p=this._removeWork(d);p.length&&a.push.apply(a,_toConsumableArray(p)),e==null||e.deleteCachedImagesByWorkId(d),o.push(d);}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}o.length&&i.push({type:at.RemoveNode,removeIds:o});i.push({type:at.Select,selectIds:[],willSyncService:n});_context41.next=10;return this.blurSelector();case 10:_context41.t0=a.length||i.length;if(!_context41.t0){_context41.next=14;break;}_context41.next=14;return this._post({render:a,sp:i});case 14:case"end":return _context41.stop();}},_callee39,this);}));function removeSelector(_x48,_x49){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(_x50){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===It.Done&&Y0([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:at.Select,dataType:i,isSync:!0});case 30:_context43.next=32;return this._post({sp:[{type:at.GetTextActive,toolsType:ut.Text,workId:a}]});case 32:case"end":return _context43.stop();}},_callee41,this,[[4,16,19,22]]);}));function checkTextActive(_x51){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===at.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(_x52){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(x){var v=_this93.vNodes.get(x);if(v){var _T42=v.toolsType,_f35=v.op,g=v.opt;l.set(x,{opt:g,toolsType:_T42,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:at.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(_x53){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(_x54){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:at.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:at.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(_x55){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(_x56){return _drawBitMapEraser.apply(this,arguments);}return drawBitMapEraser;}()},{key:"drawBitMapEraserFull",value:function(){var _drawBitMapEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t,e,n){var i,a,o,s,l,d,c,y,_iterator53,_step53,_step53$value,P,x,p,_y13;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:i=e.rect,a=e.willUpdateNodes,o=e.scenePath,s=_objectWithoutProperties(e,_excluded3);l=i;d=t.getWorkId(),c=[_objectSpread(_objectSpread({},s),{},{workId:d,scenePath:o,updateNodeOpt:{useAnimation:!1},isSync:!0,nextTasks:[{type:at.RemoveNode,removeIds:[d],viewId:this.viewId}]})];if(!(n&&c.push({type:at.None,isLockSentEventCursor:n}),a!=null&&a.size)){_context50.next=10;break;}_context50.next=6;return t==null?void 0:t.reRenderEffectNodes({willUpdateNodes:a,worker:this});case 6:y=_context50.sent;l=Pt(l,y);_iterator53=_createForOfIteratorHelper(a);try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){_step53$value=_slicedToArray(_step53.value,2),P=_step53$value[0],x=_step53$value[1];c.push({type:at.UpdateNode,dataType:Mt.Local,opt:x.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(_x57,_x58,_x59){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(_x60,_x61){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(_x62){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilEraser",value:function(){var _drawPencilEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t,e){var _this94=this;var i,a,n,_iterator54,_step54,o,s;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:n=[];if((i=t.newWorkDatas)!=null&&i.size){_iterator54=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){o=_step54.value;s=o.workId.toString();this.batchEraserWorks.add(s),n.push({type:at.FullWork,workId:s,ops:Zt(o.op),opt:o.opt,toolsType:o.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}delete t.newWorkDatas;}(a=t.removeIds)==null||a.forEach(function(o){_this94.batchEraserRemoveNodes.add(o);});e&&n.push({type:at.None,isLockSentEventCursor:e});t.rect&&n.push(t);_context53.next=7;return this._post({sp:n});case 7:this.batchEraserCombine();case 8:case"end":return _context53.stop();}},_callee51,this);}));function drawPencilEraser(_x63,_x64){return _drawPencilEraser.apply(this,arguments);}return drawPencilEraser;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t,e){var n,i;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:n=[],i=[];e&&n.push({type:at.None,isLockSentEventCursor:e});t.removeIds&&n.push(t);t.rect&&i.push({rect:t.rect,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:St.Bg,viewId:this.viewId});_context54.next=6;return this._post({sp:n,render:i});case 6:case"end":return _context54.stop();}},_callee52,this);}));function drawEraser(_x65,_x66){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(_x67){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(_x68){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t,e){var i,a,n;return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:n={drawCount:1/0,render:[],sp:[t]};e&&((i=n.sp)==null||i.push({type:at.None,isLockSentEventCursor:e}));(a=n.render)==null||a.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=5;return this._post(n);case 5:case"end":return _context57.stop();}},_callee55,this);}));function drawPencilFull(_x69,_x70){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&&Me(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(_x71){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:be,toolsType:n,opt:e});if(!(a&&i)){_context59.next=8;break;}s=a.cursorHover(i),l={render:[]};_context59.t0=s&&s.type===at.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(_x72){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(be);_context60.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context60.t0){_context60.next=10;break;}e=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(be);_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;}()}]);}(Ri);var mm=/*#__PURE__*/function(){function mm(r){_classCallCheck(this,mm);et(this,"viewId");et(this,"vNodes");et(this,"fullLayer");et(this,"drawLayer");et(this,"workShapes",/* @__PURE__ */new Map());et(this,"selectorWorkShapes",/* @__PURE__ */new Map());et(this,"thread");et(this,"animationId");et(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());et(this,"runEffectId");et(this,"noAnimationRect");et(this,"syncUnitTime",re.syncOpt.interval);et(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(_x73){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(_x74){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(_x75,_x76,_x77){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(r){var y,P,x,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 _T43={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&&(_T43=this.setNodeKey(d,_T43,n,e)),(x=this.workShapes)==null||x.set(d,_T43);}var p=(v=this.workShapes)==null?void 0:v.get(d);i&&(p.type=i),o&&(p.animationWorkData=Me(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,x,v,T,f,g,u,m,M,E,A,b,O,L,w,I,R,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,rt,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),rt=_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(rt)&&(_this97.willRunEffectSelectorIds.add(B),_this97.noAnimationRect=Pt(_this97.noAnimationRect,J),_this97.noAnimationRect=Pt(_this97.noAnimationRect,ht),_this97.runEffect());}),_this97.workShapes["delete"](rt),(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:rt});case 16:_ht3=_context64.sent;_this97.selectorWorkShapes.forEach(function(dt,B){var F;(F=dt.selectIds)!=null&&F.includes(rt)&&(_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"](rt),(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&&((x=t.render)==null||x.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(rt,{workState:_ht4?tt.ops?It.Done:It.Doing:It.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(rt)&&(_this97.willRunEffectSelectorIds.add(Y),_this97.noAnimationRect=Pt(_this97.noAnimationRect,_ht4),_this97.noAnimationRect=Pt(_this97.noAnimationRect,dt),_this97.noAnimationRect=Pt(_this97.noAnimationRect,B),_this97.runEffect());}),(T=tt.node)==null||T.clearTmpPoints(),_this97.workShapes["delete"](rt),(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:rt});_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(rt)&&(_this97.willRunEffectSelectorIds.add(B),_this97.noAnimationRect=Pt(_this97.noAnimationRect,_J6),_this97.runEffect());}),(A=tt.node)==null||A.clearTmpPoints(),_this97.workShapes["delete"](rt);_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"](rt);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(rt,{workState:_dt2===0?It.Start:_ht6===((R=tt.animationWorkData)==null?void 0:R.length)?It.Done:It.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(rt,{workState:It.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"](rt);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(rt,{workState:It.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(rt,{workState:_dt3===0?It.Start:_ht7===((Z=tt.animationWorkData)==null?void 0:Z.length)?It.Done:It.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(rt,tt){var J;(J=t.sp)==null||J.push({type:at.Cursor,uid:tt.split(De)[0],op:rt.op,workState:rt.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(_Ri2){function vm(t){var _this100;_classCallCheck(this,vm);_this100=_callSuper(this,vm,[t]);et(_this100,"drawWorkActiveId");return _this100;}_inherits(vm,_Ri2);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&&Me(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(_x78){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:at.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(_x79){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(_x80){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(_x81){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(_x82,_x83){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(_x84){return _drawShape2.apply(this,arguments);}return drawShape;}()}]);}(Ri);var ym=/*#__PURE__*/function(){function ym(r){_classCallCheck(this,ym);et(this,"viewId");et(this,"vNodes");et(this,"topLayer");et(this,"thread");et(this,"post");et(this,"serviceWorkShapes",/* @__PURE__ */new Map());et(this,"localWorkShapes",/* @__PURE__ */new Map());et(this,"tmpOpt");et(this,"syncUnitTime",re.syncOpt.interval);et(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:It.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=It.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=It.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=Me(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,x,v,_iterator60,_step60,_step60$value,_d14,_c7,p,_y14,_P4,_x85,_v12;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),x=(c.animationWorkData||[]).slice(P,y);if((c.animationIndex||0)<y){v=(a=c.node)==null?void 0:a.consumeService({op:x,isFullWork:!1});c.totalRect=Pt(c.totalRect,v),c.animationIndex=y,x.length&&t.set(d,{workState:P===0?It.Start:y===((o=c.animationWorkData)==null?void 0:o.length)?It.Done:It.Doing,op:x.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,_x85=_c7.isDel,_v12=_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})),_x85)){_context73.next=40;break;}_c7.node.clearTmpPoints(),this.localWorkShapes["delete"](_d14),i.push({removeIds:[_d14.toString()],viewId:this.viewId,type:at.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]&&_v12===It.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:at.Cursor,uid:c.split(De)[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 qe=/* @__PURE__ */function(h){return h.Full="full",h.Sub="sub",h;}(qe||{});var Sm=/*#__PURE__*/function(){function Sm(r,t){_classCallCheck(this,Sm);et(this,"_self");et(this,"version",fi);et(this,"type");et(this,"hasPriorityDraw",!0);et(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 Di(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,_l8,d,c,_iterator63,_step63,_l9,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===at.Console)){_context74.next=14;break;}console.log(_this103);return _context74.abrupt("continue",37);case 14:if(!(n===at.Init)){_context74.next=17;break;}_this103.init(_e16);return _context74.abrupt("continue",37);case 17:if(!(_this103.type==="sub"&&(n===at.PriorityWorker||n===at.PriorityMainThreadWorker))){_context74.next=22;break;}n===at.PriorityWorker?_this103.hasPriorityDraw=!0:n===at.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===at.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),_l8=_step62$value[0],d=_step62$value[1];c=a.get(_l8);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===Fi)){_context74.next=31;break;}_iterator63=_createForOfIteratorHelper(_this103.workThreadMap.values());try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){_l9=_step63.value;_l9.on(_e16),n===at.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===at.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(_x86){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(_Ai){function xm(t,e,n){var _this104;_classCallCheck(this,xm);_this104=_callSuper(this,xm,[t,e,"full"/* Full */]);et(_this104,"type","full");et(_this104,"serviceDrawLayer");et(_this104,"localDrawLayer");et(_this104,"snapshotFullLayer");et(_this104,"methodBuilder");et(_this104,"localWork");et(_this104,"serviceWork");et(_this104,"_post");et(_this104,"taskUpdateCameraId");et(_this104,"debounceUpdateCameraId");et(_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 ki([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,_Ai);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!==at.None||s.isLockSentEventCursor;});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 _this106=this;var e,n,i,a,o,s,l,d,_l10;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,s=t.workIds;_context76.t0=e;_context76.next=_context76.t0===at.AuthClear?6:_context76.t0===at.CreateWork?9:_context76.t0===at.DrawWork?11:_context76.t0===at.Select?20:_context76.t0===at.UpdateNode?27:_context76.t0===at.FullWork?27:_context76.t0===at.RemoveNode?29:_context76.t0===at.GetTextActive?32:_context76.t0===at.CursorHover?35:_context76.t0===at.CursorBlur?38:_context76.t0===at.GetVNodeInfo?41:43;break;case 6:l=t.clearUids,d=t.localUid;this.vNodes.setCanClearUids(l),this.vNodes.setLocalUid(d);return _context76.abrupt("break",43);case 9:a!==ut.LaserPen&&this.createLocalWork(t);return _context76.abrupt("break",43);case 11:_context76.t1=a!==ut.LaserPen;if(!_context76.t1){_context76.next=19;break;}if(!(o===It.Done&&n===Mt.Local)){_context76.next=18;break;}_context76.next=16;return this.consumeDrawAll(n,t);case 16:_context76.next=19;break;case 18:this.consumeDraw(n,t);case 19:return _context76.abrupt("break",43);case 20:if(!(i===Nt)){_context76.next=25;break;}_context76.next=23;return this.localWork.updateFullSelectWork(t);case 23:_context76.next=26;break;case 25:this.serviceWork.runSelectWork(t);case 26:return _context76.abrupt("return");case 27:this.consumeFull(n,t);return _context76.abrupt("return");case 29:_context76.next=31;return this.removeNode(t);case 31:return _context76.abrupt("return");case 32:_context76.next=34;return this.checkTextActive(t);case 34:return _context76.abrupt("return");case 35:_context76.next=37;return this.cursorHover(t);case 37:return _context76.abrupt("return");case 38:_context76.next=40;return this.cursorBlur();case 40:return _context76.abrupt("return");case 41:if(i&&s){_l10=s.map(function(d){return _this106.vNodes.get(d);});this.post({sp:[{type:at.GetVNodeInfo,dataType:Mt.Worker,workId:i,vInfo:_l10}]});}return _context76.abrupt("break",43);case 43:_context76.next=45;return _superPropGet(xm,"on",this,3)([t]);case 45:case"end":return _context76.stop();}},_callee73,this);}));function on(_x87){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t){var _this107=this;var e,n,i,a,o,_iterator65,_step65,_loop7;return _regeneratorRuntime().wrap(function _callee74$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:e=t.dataType,n=t.workId,i=t.removeIds,a=[],o=i||[];if(!(n&&o.push(n.toString()),o.length)){_context78.next=20;break;}_iterator65=_createForOfIteratorHelper(o);_context78.prev=3;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var s;return _regeneratorRuntime().wrap(function _loop7$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:s=_step65.value;s===Nt?a.push(_this107.localWork.removeSelector(t,_this107)):e===Mt.Local?a.push(_this107.localWork.removeWork(t).then(function(){_this107.localWork.colloctEffectSelectWork(t),_this107.deleteCachedImagesByWorkId(s);})):e===Mt.Service&&a.push(_this107.serviceWork.removeWork(t).then(function(){_this107.localWork.colloctEffectSelectWork(t),_this107.deleteCachedImagesByWorkId(s);}));case 2:case"end":return _context77.stop();}},_loop7);});_iterator65.s();case 6:if((_step65=_iterator65.n()).done){_context78.next=10;break;}return _context78.delegateYield(_loop7(),"t0",8);case 8:_context78.next=6;break;case 10:_context78.next=15;break;case 12:_context78.prev=12;_context78.t1=_context78["catch"](3);_iterator65.e(_context78.t1);case 15:_context78.prev=15;_iterator65.f();return _context78.finish(15);case 18:_context78.next=20;return Promise.all(a);case 20:case"end":return _context78.stop();}},_callee74,null,[[3,12,15,18]]);}));function removeNode(_x88){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$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:e=t.dataType;_context79.t0=e===Mt.Local;if(!_context79.t0){_context79.next=5;break;}_context79.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context79.stop();}},_callee75,this);}));function checkTextActive(_x89){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){return _regeneratorRuntime().wrap(function _callee76$(_context80){while(1)switch(_context80.prev=_context80.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());_context80.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:at.Clear}]});case 6:case"end":return _context80.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$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:_context81.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context81.sent;_context81.t0=n&&t===Mt.Local;if(!_context81.t0){_context81.next=7;break;}_context81.next=7;return this.localWork.consumeFull(n);case 7:n&&t===Mt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context81.stop();}},_callee77,this);}));function consumeFull(_x90,_x91){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$(_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.consumeDraw(e,this.serviceWork);case 6:t===Mt.Service&&this.serviceWork.consumeDraw(e);case 7:case"end":return _context82.stop();}},_callee78,this);}));function consumeDraw(_x92,_x93){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$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:n=e.workId;_context83.t0=t===Mt.Local&&n;if(!_context83.t0){_context83.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context83.next=6;return this.localWork.consumeDrawAll(e,this.serviceWork);case 6:case"end":return _context83.stop();}},_callee79,this);}));function consumeDrawAll(_x94,_x95){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t){var _this108=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,x,v,_T45,_f37,g,u,m,M,_iterator72,_step72,_step72$value,_p7,_y17;return _regeneratorRuntime().wrap(function _callee80$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:e=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!oe(this.cameraOpt,n))){_context84.next=40;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);o=!!this.serviceDrawLayer.children.length;if(!i){_context84.next=30;break;}p=!1;_iterator66=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context84.prev=7;_iterator66.s();case 9:if((_step66=_iterator66.n()).done){_context84.next=19;break;}_step66$value=_slicedToArray(_step66.value,2),y=_step66$value[0],P=_step66$value[1];_context84.t0=P.toolsType;_context84.next=_context84.t0===ut.Text?14:_context84.t0===ut.BitMapEraser?14:_context84.t0===ut.PencilEraser?14:_context84.t0===ut.Eraser?14:_context84.t0===ut.Selector?14:_context84.t0===ut.LaserPen?14:15;break;case 14:return _context84.abrupt("break",17);case 15:y!==be&&y!==Nt&&(p=!0);return _context84.abrupt("break",17);case 17:_context84.next=9;break;case 19:_context84.next=24;break;case 21:_context84.prev=21;_context84.t1=_context84["catch"](7);_iterator66.e(_context84.t1);case 24:_context84.prev=24;_iterator66.f();return _context84.finish(24);case 27:if(!p){_context84.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this108.taskUpdateCameraId=void 0,_this108.updateCamera(t);},Cn);return _context84.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){x=_y18,v=_P7.rect,_T45=this.getSceneRect(),_f37=fr(x,_T45),g=fr(v,_T45);u=!1;if((_f37!==g||x.w!==v.w||x.h!==v.h||g===Te.intersect)&&(u=!0),u){m=_P7.toolsType,M=_P7.opt;m===ut.Text&&M.workState===It.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:at.Select,dataType:Mt.Service,viewId:this.viewId});}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}}this.debounceUpdateCameraId=setTimeout(function(){var y;_this108.debounceUpdateCameraId=void 0;var p=[];var _iterator73=_createForOfIteratorHelper(_this108.debounceUpdateCache.values()),_step73;try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){var _P6=_step73.value;if((y=_this108.fullLayer)==null?void 0:y.getElementsByName(_P6)[0]){var v=_this108.vNodes.get(_P6);if(v){var _T44=v.toolsType,_f36=v.opt,g=v.rect,u=_this108.localWork.setFullWork({toolsType:_T44,opt:_f36,workId:_P6});if(u){var m=_this108.getSceneRect(),M=fr(g,m);p.push(u.consumeServiceAsync({isFullWork:!0,replaceId:_P6,isDrawLabel:M!==Te.outside}));}}}_this108.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:_this108.viewId},{isDrawAll:!0,drawCanvas:St.Bg,viewId:_this108.viewId}),P.length&&_this108.post({render:P}),_this108.vNodes.updateLowLevelNodesRect(),_this108.vNodes.clearHighLevelIds();}):(_this108.vNodes.updateLowLevelNodesRect(),_this108.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 _context84.stop();}},_callee80,this,[[7,21,24,27]]);}));function updateCamera(_x96){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$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:_context85.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context85.stop();}},_callee81,this);}));function cursorHover(_x97){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(){return _regeneratorRuntime().wrap(function _callee82$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:_context86.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context86.stop();}},_callee82,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(xm,"destroy",this,3)([]);}}]);}(Ai);var Di=/*#__PURE__*/function(_Ai2){function Di(t,e,n){var _this109;_classCallCheck(this,Di);_this109=_callSuper(this,Di,[t,e,"sub"/* Sub */]);et(_this109,"type","sub");et(_this109,"_post");et(_this109,"topLayer");et(_this109,"snapshotFullLayer");et(_this109,"serviceWork");et(_this109,"localWork");et(_this109,"topLayerWork");_this109._post=n;var i=re.bufferSize.sub;_this109.topLayer=_this109.createLayer("topLayer",_this109.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i}));var a={thread:_this109,viewId:_this109.viewId,vNodes:_this109.vNodes,fullLayer:_this109.fullLayer,topLayer:_this109.topLayer};_this109.localWork=new vm(a),_this109.topLayerWork=new ym(a),_this109.vNodes.init(_this109.fullLayer);return _this109;}_inherits(Di,_Ai2);return _createClass(Di,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(){var _this110=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$(_context87){while(1)switch(_context87.prev=_context87.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)){_context87.next=29;break;}_l12=[];_iterator75=_createForOfIteratorHelper(t);_context87.prev=5;_iterator75.s();case 7:if((_step75=_iterator75.n()).done){_context87.next=20;break;}_d16=_step75.value;if(!_d16.rect){_context87.next=18;break;}if(!(_d16.rect=this.safariFixRect(Xt(_d16.rect),this.dpr),!_d16.rect)){_context87.next=12;break;}return _context87.abrupt("continue",18);case 12:if(!(_d16.drawCanvas&&_d16.rect&&_d16.rect.w>0&&_d16.rect.h>0)){_context87.next=17;break;}_context87.next=15;return this.getRectImageBitmap(_d16);case 15:c=_context87.sent;_d16.imageBitmap=c,n||(n=[]),n.push(c);case 17:_l12.push(_d16);case 18:_context87.next=7;break;case 20:_context87.next=25;break;case 22:_context87.prev=22;_context87.t0=_context87["catch"](5);_iterator75.e(_context87.t0);case 25:_context87.prev=25;_iterator75.f();return _context87.finish(25);case 28:e.render=_l12;case 29:i=(o=e.sp)==null?void 0:o.filter(function(l){return l.type!==at.None;});i!=null&&i.length?e.sp=i.map(function(l){return _objectSpread(_objectSpread({},l),{},{viewId:_this110.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 _context87.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$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.dataType,o=t.workState;_context88.t0=e;_context88.next=_context88.t0===at.UpdateTools?4:_context88.t0===at.CreateWork?9:_context88.t0===at.DrawWork?11:_context88.t0===at.RemoveNode?18:_context88.t0===at.FullWork?21:_context88.t0===at.Snapshot?26:_context88.t0===at.BoundingBox?33:40;break;case 4:if(!(n&&this.topLayerWork.canUseTopLayer(n)&&i)){_context88.next=8;break;}s={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(s);return _context88.abrupt("return");case 8:return _context88.abrupt("break",40);case 9:this.createLocalWork(t);return _context88.abrupt("return");case 11:if(!(o===It.Done&&a===Mt.Local)){_context88.next=16;break;}_context88.next=14;return this.consumeDrawAll(a,t);case 14:_context88.next=17;break;case 16:this.consumeDraw(a,t);case 17:return _context88.abrupt("return");case 18:_context88.next=20;return this.removeNode(t);case 20:return _context88.abrupt("return");case 21:_context88.t1=n&&this.topLayerWork.canUseTopLayer(n);if(!_context88.t1){_context88.next=25;break;}_context88.next=25;return this.consumeDrawAll(a,t);case 25:return _context88.abrupt("return");case 26:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Qe?6e3:3e3}));_context88.t2=this.snapshotFullLayer;if(!_context88.t2){_context88.next=32;break;}_context88.next=31;return this.getSnapshot(t);case 31:this.snapshotFullLayer=void 0;case 32:return _context88.abrupt("return");case 33:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Qe?6e3:3e3}));_context88.t3=this.snapshotFullLayer;if(!_context88.t3){_context88.next=39;break;}_context88.next=38;return this.getBoundingRect(t);case 38:this.snapshotFullLayer=void 0;case 39:return _context88.abrupt("return");case 40:_context88.next=42;return _superPropGet(Di,"on",this,3)([t]);case 42:case"end":return _context88.stop();}},_callee84,this);}));function on(_x98){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(Di,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t){var e;return _regeneratorRuntime().wrap(function _callee85$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:e=t.dataType;_context89.t0=e===Mt.Local;if(!_context89.t0){_context89.next=5;break;}_context89.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context89.stop();}},_callee85,this);}));function removeNode(_x99){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$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:n=e.workId,i=e.toolsType;if(!n){_context90.next=11;break;}if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context90.next=5;break;}t===Mt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(e)),this.topLayerWork.consumeDraw(e);return _context90.abrupt("return");case 5:_context90.t0=i&&this.localWork.canUseSubWorker(i);if(!_context90.t0){_context90.next=10;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context90.next=10;return this.localWork.consumeDraw(e);case 10:return _context90.abrupt("return");case 11:case"end":return _context90.stop();}},_callee86,this);}));function consumeDraw(_x100,_x101){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$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:n=e.workId,i=e.toolsType,a=e.dataType;if(!n){_context91.next=8;break;}o=n.toString();if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context91.next=6;break;}a===Mt.Local&&(this.topLayerWork.getWorkShape(o)||this.createLocalWork(e)),this.topLayerWork.consumeDrawAll(e);return _context91.abrupt("return");case 6:i&&this.localWork.canUseSubWorker(i)&&(this.localWork.getWorkShape(o)||_superPropGet(Di,"createLocalWork",this,3)([e]),this.localWork.consumeDrawAll(e));return _context91.abrupt("return");case 8:case"end":return _context91.stop();}},_callee87,this);}));function consumeDrawAll(_x102,_x103){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(){return _regeneratorRuntime().wrap(function _callee88$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:this.vNodes.clear();_superPropGet(Di,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.topLayer.removeAllChildren());_context92.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId}],sp:[{type:at.Clear}]});case 5:case"end":return _context92.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(Di,"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 _this111=this;var e,n,i,a,_iterator76,_step76,_loop8;return _regeneratorRuntime().wrap(function _callee89$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!oe(this.cameraOpt,n))){_context94.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)){_context94.next=21;break;}e.push({isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId});_iterator76=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context94.prev=6;_loop8=/*#__PURE__*/_regeneratorRuntime().mark(function _loop8(){var _step76$value,o,s,l;return _regeneratorRuntime().wrap(function _loop8$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:_step76$value=_slicedToArray(_step76.value,2),o=_step76$value[0],s=_step76$value[1];if(s.totalRect){_this111.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,_this111.topLayerWork.localWorkShapes.set(o,s);}case 2:case"end":return _context93.stop();}},_loop8);});_iterator76.s();case 9:if((_step76=_iterator76.n()).done){_context94.next=13;break;}return _context94.delegateYield(_loop8(),"t0",11);case 11:_context94.next=9;break;case 13:_context94.next=18;break;case 15:_context94.prev=15;_context94.t1=_context94["catch"](6);_iterator76.e(_context94.t1);case 18:_context94.prev=18;_iterator76.f();return _context94.finish(18);case 21:_context94.t2=e.length;if(!_context94.t2){_context94.next=25;break;}_context94.next=25;return this.post({render:e});case 25:case"end":return _context94.stop();}},_callee89,this,[[6,15,18,21]]);}));function updateCamera(_x104){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,x,d;return _regeneratorRuntime().wrap(function _callee90$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,o=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context95.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)){_context95.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)){_context95.next=18;break;}_context95.t0=p==null?void 0:p.type;_context95.next=_context95.t0===at.UpdateNode?11:_context95.t0===at.FullWork?11:18;break;case 11:y=p.opt;P=_objectSpread(_objectSpread({},p),{},{opt:y,workId:c,msgType:at.FullWork,dataType:Mt.Service,viewId:this.viewId});_context95.next=15;return this.localWork.runFullWork(P);case 15:x=_context95.sent;l=Pt(l,x);return _context95.abrupt("break",18);case 18:_i12++;_context95.next=5;break;case 21:a&&o&&(d={resizeWidth:a,resizeHeight:o});_context95.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 _context95.stop();}},_callee90,this);}));function getSnapshot(_x105){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$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context96.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:St.None},!0,i);case 4:a=_context96.sent;a&&(this._post({sp:[{type:at.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 _context96.stop();}},_callee91,this);}));function getSnapshotRender(_x106){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$(_context97){while(1)switch(_context97.prev=_context97.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context97.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)){_context97.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)){_context97.next=16;break;}_context97.t0=l==null?void 0:l.type;_context97.next=_context97.t0===at.UpdateNode?11:_context97.t0===at.FullWork?11:16;break;case 11:_context97.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},l),{},{workId:s,msgType:at.FullWork,dataType:Mt.Service,viewId:this.viewId}));case 13:d=_context97.sent;o=Pt(o,d);return _context97.abrupt("break",16);case 16:_i13++;_context97.next=5;break;case 19:_context97.t1=o;if(!_context97.t1){_context97.next=23;break;}_context97.next=23;return this.post({sp:[{type:at.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 _context97.stop();}},_callee92,this);}));function getBoundingRect(_x107){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(Ai);var Wn=self;Wn.full=new Sm(Wn,qe.Full);
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 Ti=/*#__PURE__*/function(_vt10){function Ti(t){var _this80;_classCallCheck(this,Ti);_this80=_callSuper(this,Ti,[t]);et(_this80,"canRotate",!1);et(_this80,"scaleType",jt.all);et(_this80,"toolsType",ut.SpeechBalloon);et(_this80,"ratio",0.8);et(_this80,"tmpPoints",[]);et(_this80,"workOptions");et(_this80,"oldRect");et(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(Ti,_vt10);return _createClass(Ti,[{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:ot.None};var s=e.op,l=s==null?void 0:s.length;if(!l||l<2)return{type:ot.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:ot.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:ot.DrawWork,dataType:Mt.Local,op:this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:ot.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:ot.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.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=Qt(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:ot.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),x=_this$computDrawPoint7.rect,v=_this$computDrawPoint7.pos,T=_this$computDrawPoint7.points,f={points:T.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:[x.w,x.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=_t.getBezierPoints(10,l,i[0],d),p=_.Sub(i[1],new _(a,0,0)),y=_.Add(i[1],new _(0,o,0)),P=_t.getBezierPoints(10,p,i[1],y),x=_.Sub(i[2],new _(0,o,0)),v=_.Sub(i[2],new _(a,0,0)),T=_t.getBezierPoints(10,x,i[2],v),f=_.Add(i[3],new _(a,0,0)),g=_.Sub(i[3],new _(0,o,0)),u=_t.getBezierPoints(10,f,i[3],g),m=a*(1-this.ratio)*10,M=o*(1-this.ratio)*10;switch(e){case"bottom":{var w=_.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(T),[w]));break;}case"bottomRight":{var _w11=_.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(T),[_w11]));break;}case"bottomLeft":{var _w12=_.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(T),[_w12]));break;}case"top":{var _w13=_.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,_w13].concat(_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_L10]));break;}case"topRight":{var _w14=_.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,_w14].concat(_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_L11]));break;}case"topLeft":{var _w15=_.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,_w15].concat(_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_L12]));break;}case"left":{var _w16=_.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,_w16].concat(_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),[_L13]));break;}case"leftTop":{var _w17=_.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,_w17].concat(_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),[_L14]));break;}case"leftBottom":{var _w18=_.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,_w18].concat(_toConsumableArray(c),_toConsumableArray(P),_toConsumableArray(T),_toConsumableArray(u),[_L15]));break;}case"right":{var _w19=_.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(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),[_w19]));break;}case"rightTop":{var _w20=_.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(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),[_w20]));break;}case"rightBottom":{var _w21=_.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(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(P),[_w21]));break;}}var E=Bt(this.tmpPoints,t),A=[Math.floor(E.x+E.w/2),Math.floor(E.y+E.h/2)];return{rect:E,pos:A,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 B0=de,F0=ne,U0="[object Boolean]";function j0(h){return h===!0||h===!1||F0(h)&&B0(h)==U0;}var $0=j0,ye=/* @__PURE__ */fe($0);var Ne=/*#__PURE__*/function(_vt11){function Ne(t){var _this81;_classCallCheck(this,Ne);_this81=_callSuper(this,Ne,[t]);et(_this81,"canRotate",!0);et(_this81,"scaleType",jt.all);et(_this81,"toolsType",ut.Image);et(_this81,"tmpPoints",[]);et(_this81,"workOptions");et(_this81,"oldRect");_this81.workOptions=t.toolsOpt,_this81.scaleType=Ne.getScaleType(_this81.workOptions);return _this81;}_inherits(Ne,_vt11);return _createClass(Ne,[{key:"consume",value:function consume(){return{type:ot.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ot.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}),x={anchor:[0.5,0.5],pos:[0,0],size:[l,d],texture:a};a||(x.bgcolor="rgba(0,0,0,0.3)");var v=new es(x);P.append(v),y&&this.drawEraserlines({group:P,eraserlines:y,pos:[o,s],layer:e}),this.replace(e,i||n,P);var T=P.getBoundingClientRect();if(T)return{x:Math.floor(T.x-vt.SafeBorderPadding),y:Math.floor(T.y-vt.SafeBorderPadding),w:Math.floor(T.width+vt.SafeBorderPadding*2),h:Math.floor(T.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,x;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=8;break;}_context25.next=4;return i.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:s,isSubWorker:i instanceof Di});case 4:P=_context25.sent;if(!P){_context25.next=8;break;}x=this.draw({workId:s,layer:l,replaceId:n,imageBitmap:P});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:x,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:x&&vt.getCenterPos(x,l)}),x));case 8:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x27){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=n.strokeColor,x=a&&Xt(a)||i.get(e.name);if(!x)return;var v=e.parent;if(v){if(P&&(x.opt.strokeColor=P),Zt(y)&&(e.setAttribute("zIndex",y),x.opt.zIndex=y),ye(p)&&(x.opt.locked=p),s&&l&&d&&o){var _x$opt=x.opt,_T33=_x$opt.centerX,_f29=_x$opt.centerY,g=_x$opt.width,u=_x$opt.height,m=_x$opt.uniformScale,M=m!==!1?[d[0],d[0]]:d,E=[_T33,_f29],A=[_T33,_f29];Ur(A,l,M,o);var w=[A[0]-E[0],A[1]-E[1]];if(x.centerPos=[x.centerPos[0]+w[0],x.centerPos[1]+w[1]],x.opt.width=Math.round(g*M[0]),x.opt.height=Math.round(u*M[1]),x.opt.centerX=A[0],x.opt.centerY=A[1],x.opt.eraserlines)for(var _i5=0,_Object$values4=Object.values(x.opt.eraserlines);_i5<_Object$values4.length;_i5++){var O=_Object$values4[_i5];var L=O.op,b=O.thickness;O.thickness=b*Math.max(d[0],d[1]);for(var I=0;I<L.length;I++)jr(L[I],l,d,o);}}else if(o){if(x.opt.centerX=x.opt.centerX+o[0],x.opt.centerY=x.opt.centerY+o[1],x.centerPos=[x.centerPos[0]+o[0],x.centerPos[1]+o[1]],x.opt.eraserlines)for(var _i6=0,_Object$values5=Object.values(x.opt.eraserlines);_i6<_Object$values5.length;_i6++){var _T34=_Object$values5[_i6];var _f30=_T34.op;for(var _g12=0;_g12<_f30.length;_g12++){var _u13=_f30[_g12].map(function(m,M){return M%2?m+o[1]:m+o[0];});_T34.op[_g12]=_u13;}}}else if(Zt(c))if(x.opt.rotate=c,x.scaleType=Ne.getScaleType(x.opt),a){var _T35=Ei(x.rect,c);x.rect=_T35;}else{var _T36=vt.getRectFromLayer(v,e.name);x.rect=_T36||x.rect;}return x&&i.setInfo(e.name,x),x==null?void 0:x.rect;}}}]);}(vt);var Mi=/*#__PURE__*/function(_vt12){function Mi(t){var _this82;_classCallCheck(this,Mi);_this82=_callSuper(this,Mi,[t]);et(_this82,"canRotate",!1);et(_this82,"scaleType",jt.both);et(_this82,"toolsType",ut.Straight);et(_this82,"tmpPoints",[]);et(_this82,"workOptions");et(_this82,"oldRect");et(_this82,"straightTipWidth");et(_this82,"syncTimestamp");_this82.workOptions=t.toolsOpt,_this82.straightTipWidth=_this82.workOptions.thickness/2,_this82.syncTimestamp=0,_this82.syncUnitTime=50;return _this82;}_inherits(Mi,_vt12);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:ot.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:ot.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:ot.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:ot.None};}var p=Pt(c,this.oldRect);return this.oldRect=c,_objectSpread({rect:p,type:ot.DrawWork,dataType:Mt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:ot.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=Qt(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:ot.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),x=_this$computDrawPoint8.d,v=_this$computDrawPoint8.rect,T=_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:x,fillColor:i,strokeColor:i,lineDash:c===Lt.Dotted&&!T?[1,a*2]:c===Lt.LongDotted&&!T?[a,a*2]:void 0,lineCap:c===Lt.Normal||T?void 0:"round",lineWidth:c===Lt.Normal||T?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]);et(_this83,"canRotate",!1);et(_this83,"scaleType",jt.proportional);et(_this83,"toolsType",ut.Text);et(_this83,"tmpPoints",[]);et(_this83,"workOptions");et(_this83,"oldRect");_this83.workOptions=t.toolsOpt;return _this83;}_inherits(ie,_vt13);return _createClass(ie,[{key:"consume",value:function consume(){return{type:ot.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ot.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,x,v,_T37,_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]},x={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,x);case 7:v=_context26.sent;_T37=v.labels;_f31=v.maxWidth;y.append.apply(y,_toConsumableArray(_T37)),x.w=Math.ceil(Math.max(_f31*n.worldScaling[0],x.w));case 11:return _context26.abrupt("return",(l&&this.drawEraserlines({group:y,eraserlines:l,pos:[o[0],o[1]],layer:n}),x));case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x28){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===It.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(_x29){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,x,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),ye(l)&&(p.opt.lineThrough=l),ye(d)&&(p.opt.underline=d),Zt(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===It.Done||e});case 8:y=_context28.sent;return _context28.abrupt("return",((x=this.vNodes)==null||x.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(_x30,_x31){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,x,v,T,f,g,u,m,M,E,A,w,O,b,I,R,W,z,K,k,q,U,G,Z,rt,tt,J,ht,dt,B,F,Y,X,nt,_J2,_ht,_dt,_J3,_ht2,_rt3,_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=Me(t.text),c=d.length,p=t.fontSize,y=t.lineHeight,P=t.bold,x=t.textAlign,v=t.italic,T=t.fontFamily,f=t.verticalAlign,g=t.fontColor,u=t.fontBgColor,m=t.underline,M=t.lineThrough,E=ie.getSafetySnippetRatio(e)||1,A=Math.floor(p*E),w=ie.getSafetySnippetFontLength(A);O=0;b=0;case 3:if(!(b<c)){_context29.next=33;break;}I=d[b],R=y||A*1.5;if(!I){_context29.next=30;break;}W=Q0(I),z=[0,0],K=[0,p*1.2];f==="middle"&&(z[1]=b*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;}x==="left"&&(k[0]=U),Z===0&&v==="italic"&&(k[0]=k[0]-q/2*p);rt=I.slice(Z,Z+w);tt={anchor:[0,0],pos:k,text:rt,fontFamily:T,fontSize:A,lineHeight:R,strokeColor:g,fontWeight:P,fillColor:g,textAlign:x,fontStyle:v,scale:[1/E,1/E]};J=new qi(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+=w;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);}_rt3={pos:z,anchor:[0,0],size:K,bgcolor:u},_tt2=new kt(_rt3);_tt2.append.apply(_tt2,G),i.push(_tt2);}case 30:b++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:i,maxWidth:O});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x32,_x33,_x34){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,x=n.lineThrough,v=n.underline,T=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(Zt(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(A){A.tagName==="LABEL"?(A.setAttribute("fillColor",s),A.setAttribute("strokeColor",s)):A.tagName==="POLYLINE"&&A.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),ye(x)&&(M.lineThrough=x),ye(v)&&(M.underline=v),T&&(M.fontSize=T),d&&c&&p&&a&&M.boxPoint){var E=f==null?void 0:f.get(e.name);if(E){var L=E.fontSize,b=E.boxSize;M.boxSize=b||M.boxSize,M.fontSize=L||M.fontSize;}var A=[M.boxPoint[0],M.boxPoint[1]];Ur(M.boxPoint,c,p,l);var w=[u.op[0],u.op[1]],O=[w[0]-A[0],w[1]-A[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 _b9=_L19.op,I=_L19.thickness;_L19.thickness=I*Math.max(p[0],p[1]);for(var R=0;R<_b9.length;R++)jr(_b9[R],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 _A6=_E5.op;for(var _w22=0;_w22<_A6.length;_w22++){var _O22=_A6[_w22].map(function(L,b){return b%2?L+l[1]:L+l[0];});_E5.op[_w22]=_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
+ et(ie,"textImageSnippetSize",1024*4),et(ie,"SafeBorderPadding",30);var Xe=ie;var xe=/*#__PURE__*/function(_vt14){function xe(t,e){var _this84;_classCallCheck(this,xe);_this84=_callSuper(this,xe,[t]);et(_this84,"canRotate",!1);et(_this84,"scaleType",jt.none);et(_this84,"toolsType",ut.PencilEraser);et(_this84,"serviceWork");et(_this84,"tmpPoints",[]);et(_this84,"workOptions");et(_this84,"worldPosition");et(_this84,"worldScaling");et(_this84,"eraserRect");et(_this84,"eraserPolyline");_this84.serviceWork=e,_this84.workOptions=t.toolsOpt,_this84.worldPosition=_this84.fullLayer.worldPosition,_this84.worldScaling=_this84.fullLayer.worldScaling;return _this84;}_inherits(xe,_vt14);return _createClass(xe,[{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],_xe$eraserSizes$this$=xe.eraserSizes[this.workOptions.thickness],i=_xe$eraserSizes$this$.width,a=_xe$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),_xe$eraserSizes$this$2=xe.eraserSizes[this.workOptions.thickness],o=_xe$eraserSizes$this$2.width,s=_xe$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]),_xe$eraserSizes$this$3=xe.eraserSizes[this.workOptions.thickness],a=_xe$eraserSizes$this$3.width,o=_xe$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,x){return x<p.length-1?o([P,p[x+1]],[l[0],l[1]]):!1;});if(y!==-1&&y>-1){var P=[],x=p.slice(0,y+1);if(_.Equals(p[y],l[0])||x.push(l[0].clone().setz(p[y].z)),x.length>1&&P.push(x),y+l.length-1<p.length-1){var v=y+l.length-1,_T38=p.slice(v),_f32=l[l.length-1];_.Equals(p[v],_f32)||_T38.unshift(_f32.clone().setz(p[v].z)),_T38.length>1&&P.push(_T38);}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&&We(this.eraserRect,s.rect)){var l=s.op,d=s.toolsType,c=this.isLineEraser(d,!1),p=[],y=[];for(var x=0;x<l.length;x+=3){var v=new _(l[x]*this.worldScaling[0]+this.worldPosition[0],l[x+1]*this.worldScaling[1]+this.worldPosition[1],l[x+2]);y.push(v),p.push(new xt(v.x,v.y));}var P=p.length&&Bt(p)||s.rect;if(We(P,this.eraserRect)){if(y.length>1){var _x35=Dr.polyline(y.map(function(v){return v.XY;}),this.eraserPolyline);if(_x35.length&&(n.add(s.name),!c)){var _v8=this.translateIntersect(_x35),_T39=this.cutPolyline(_v8,y);var _loop5=function _loop5(){var g="".concat(o,"_s_").concat(_f33),u=[];_T39[_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<_T39.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:ot.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:ot.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:ot.None},this.baseConsumeResult);this.vNodes.setTarget();var l=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(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:ot.RemoveNode,rect:a,removeIds:_toConsumableArray(o),newWorkDatas:s};}return _objectSpread({type:ot.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getCanEraserNodeMap",value:function getCanEraserNodeMap(t){var 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
+ et(xe,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var ke=xe;var be=/*#__PURE__*/function(_vt15){function be(t){var _this87;_classCallCheck(this,be);_this87=_callSuper(this,be,[t]);et(_this87,"canRotate",!1);et(_this87,"scaleType",jt.none);et(_this87,"toolsType",ut.BitMapEraser);et(_this87,"tmpPoints",[]);et(_this87,"workOptions");et(_this87,"worldPosition");et(_this87,"worldScaling");et(_this87,"eraserRect");et(_this87,"eraserPolyline");et(_this87,"syncUnitTime",re.syncOpt.interval);et(_this87,"syncIndex",0);et(_this87,"syncTimestamp");_this87.workOptions=t.toolsOpt,_this87.worldPosition=_this87.fullLayer.worldPosition,_this87.worldScaling=_this87.fullLayer.worldScaling,_this87.syncTimestamp=0;return _this87;}_inherits(be,_vt15);return _createClass(be,[{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=G0(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 d=1;d<this.tmpPoints.length;d++){var c=this.tmpPoints[d-1],p=this.tmpPoints[d];if(d===1&&o===0&&(a[o]=[c.XY]),a[o].push(p.XY),d<this.tmpPoints.length-1){var y=p.getAngleByPoints(c,this.tmpPoints[d+1]);(y<90||y>270)&&(o++,a[o]=[p.XY]);}}this.tmpPoints.length===1&&a.length===0&&a.push([this.tmpPoints[0].XY,this.tmpPoints[0].XY]);var s=/* @__PURE__ */new Map(),l=/* @__PURE__ */new Set();var _iterator32=_createForOfIteratorHelper(i.entries()),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _step32$value=_slicedToArray(_step32.value,2),_d11=_step32$value[0],_c6=_step32$value[1];if(this.isTransparentRect(_c6.rect)){l.add(_d11);continue;}var _y13=Sr(_c6.rect,[-e[0],-e[1]]);_y13={x:_y13.x/this.worldScaling[0],y:_y13.y/this.worldScaling[1],w:_y13.w/this.worldScaling[0],h:_y13.h/this.worldScaling[1]};var P=[_y13.x,_y13.y,_y13.x+_y13.w,_y13.y+_y13.h],x=[],v=[];var _iterator33=_createForOfIteratorHelper(a),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _f35=_step33.value;Dr.polyline(_f35,P,x);}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}if(x.length&&_c6.opt){var _iterator34=_createForOfIteratorHelper(x),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _f34=_step34.value;var g=[];for(var u=0;u<_f34.length;u++)u!==0&&oe(_f34[u],_f34[u-1])||g.push.apply(g,_toConsumableArray(_f34[u]));v.push(g);}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}_c6.opt.eraserlines||(_c6.opt.eraserlines=[]),_c6.opt.eraserlines&&(_c6.opt.eraserlines.push({op:v,thickness:t}),s.set(_d11,_c6));}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}return{willUpdateNodes:s,willDeleteNodes:l};}},{key:"reRenderEffectNodes",value:function(){var _reRenderEffectNodes=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(t){var o,e,n,i,a,_iterator35,_step35,s,_iterator36,_step36,_step36$value,_s5,l,d,c,p;return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:n=t.willUpdateNodes,i=t.willDeleteNodes,a=t.worker;if(i!=null&&i.size){_iterator35=_createForOfIteratorHelper(i.keys());try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){s=_step35.value;this.replace(this.fullLayer,s),(o=this.vNodes)==null||o["delete"](s);}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}if(!(n!=null&&n.size)){_context30.next=41;break;}_iterator36=_createForOfIteratorHelper(n.entries());_context30.prev=4;_iterator36.s();case 6:if((_step36=_iterator36.n()).done){_context30.next=33;break;}_step36$value=_slicedToArray(_step36.value,2),_s5=_step36$value[0],l=_step36$value[1];d=l.toolsType,c=a.createWorkShapeNode({workId:_s5,toolsType:d,toolsOpt:l.opt});c==null||c.setWorkId(_s5);p=void 0;if(!(d===ut.Image)){_context30.next=17;break;}_context30.next=14;return c.consumeServiceAsync({isFullWork:!0,replaceId:_s5,worker:a});case 14:p=_context30.sent;_context30.next=30;break;case 17:if(!(d===ut.Text)){_context30.next=23;break;}_context30.next=20;return c.consumeServiceAsync({isFullWork:!0,replaceId:_s5});case 20:p=_context30.sent;_context30.next=30;break;case 23:_context30.prev=23;p=c==null?void 0:c.consumeService({op:l.op,isFullWork:!0,replaceId:_s5});_context30.next=30;break;case 27:_context30.prev=27;_context30.t0=_context30["catch"](23);return _context30.abrupt("continue",31);case 30:p&&(e=Pt(e,p));case 31:_context30.next=6;break;case 33:_context30.next=38;break;case 35:_context30.prev=35;_context30.t1=_context30["catch"](4);_iterator36.e(_context30.t1);case 38:_context30.prev=38;_iterator36.f();return _context30.finish(38);case 41:return _context30.abrupt("return",e);case 42:case"end":return _context30.stop();}},_callee28,this,[[4,35,38,41],[23,27]]);}));function reRenderEffectNodes(_x36){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:ot.None},this.baseConsumeResult);var n=this.workOptions.thickness,_be$eraserSizes$n=be.eraserSizes[n],i=_be$eraserSizes$n.width,a=_be$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:ot.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),x=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(T){v.push(T.x,T.y,o/2);}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ot.DrawWork,dataType:Mt.Local,rect:x,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:"isTransparentRectByGL",value:function isTransparentRectByGL(t,e){var n=e.x,i=e.y,a=e.w,o=e.h,s=new Uint8Array(a*o*4);t.readPixels(n,t.drawingBufferHeight-i-o,a,o,t.RGBA,t.UNSIGNED_BYTE,s);var l=!0;for(var d=0;d<s.length;d+=4)if(s[d+3]!==0){l=!1;break;}return l;}},{key:"isTransparentRectByCanvas",value:function isTransparentRectByCanvas(t,e){var n=t.getContext("2d",{willReadFrequently:!0});if(!n)return!1;var i=e.x,a=e.y,o=e.w,s=e.h,l=n.getImageData(i,a,o,s);var d=!0;for(var c=0;c<l.data.length;c+=4)if(l.data[c+3]!==0){d=!1;break;}return d;}},{key:"isTransparentRect",value:function isTransparentRect(t){var e=this.fullLayer.parent.displayRatio||1,n=Math.floor(t.x*e),i=Math.floor(t.y*e),a=Math.floor(t.w*e),o=Math.floor(t.h*e),s=this.fullLayer.renderer.glRenderer;if(s)return this.isTransparentRectByGL(s,{x:n,y:i,w:a,h:o});var l=this.fullLayer.renderer.canvas;return l&&this.isTransparentRectByCanvas(l,{x:n,y:i,w:a,h:o})||!1;}},{key:"consumeAll",value:function consumeAll(){var c;var t=this.fullLayer.getElementsByName(this.workId);var e;if(t.length&&(e=vt.getRectFromLayer(this.fullLayer,this.workId)),t.forEach(function(p){p.remove(),p.disconnect();}),!this.tmpPoints.length)return _objectSpread({type:ot.None},this.baseConsumeResult);var n=this.workOptions.thickness,_be$eraserSizes$n2=be.eraserSizes[n],i=_be$eraserSizes$n2.width,a=_be$eraserSizes$n2.height,o=Math.max(i,a)/this.worldScaling[0],s=this.getChangeNodes(o);if(!s||s&&!((c=s.willUpdateNodes)!=null&&c.size)&&!s.willDeleteNodes.size)return _objectSpread(_objectSpread({type:ot.FullWork},this.baseConsumeResult),{},{rect:e});var l=[];this.tmpPoints.map(function(p){l.push(p.x,p.y,o/2);});var d=Qt(l);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:ot.FullWork,dataType:Mt.Local,rect:e,ops:d,willUpdateNodes:s.willUpdateNodes,willDeleteNodes:s.willDeleteNodes});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(vt);// 来源于white-sdk
439
+ et(be,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var Je=be;function Pi(h){switch(h){case ut.Arrow:return mi;case ut.Pencil:return ui;case ut.Straight:return Mi;case ut.Ellipse:return vi;case ut.Polygon:case ut.Triangle:return xi;case ut.Star:case ut.Rhombus:return Si;case ut.Rectangle:return yi;case ut.SpeechBalloon:return Ti;case ut.Text:return Xe;case ut.LaserPen:return di;case ut.Eraser:return se;case ut.PencilEraser:return ke;case ut.BitMapEraser:return Je;case ut.Selector:return Ve;case ut.Image:return Ne;}}function Fr(h,r){var t=h.toolsType,e=_objectWithoutProperties(h,_excluded);switch(t){case ut.Arrow:return new mi(e);case ut.Pencil:return new ui(e);case ut.Straight:return new Mi(e);case ut.Ellipse:return new vi(e);case ut.Polygon:case ut.Triangle:return new xi(e);case ut.Star:case ut.Rhombus:return new Si(e);case ut.Rectangle:return new yi(e);case ut.SpeechBalloon:return new Ti(e);case ut.Text:return new Xe(e);case ut.LaserPen:return new di(e);case ut.Eraser:return new se(e,r);case ut.BitMapEraser:return new Je(e);case ut.PencilEraser:return new ke(e,r);case ut.Selector:return e.vNodes?new Ve(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case ut.Image:return new Ne(e);default:return;}}function Oi(h){var r=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator37=_createForOfIteratorHelper(h),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _e6=_step37.value;if(_e6.tagName==="GROUP"&&_e6.children.length)return Oi(_e6.children);_e6.tagName&&t.includes(_e6.tagName)&&r.push(_e6);}}catch(err){_iterator37.e(err);}finally{_iterator37.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 We(h,r){return!(h.x+h.w<r.x||h.x>r.x+r.w||h.y+h.h<r.y||h.y>r.y+r.h);}function bt(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(h.x-r),y:Math.floor(h.y-r),w:Math.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 z0(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 Ei(h,r){var t=z0(h,r);return Bt(t);}function G0(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 H0(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 K0(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 Y0(h,r){return h[0]>=r.x&&h[0]<=r.x+r.w&&h[1]>=r.y&&h[1]<=r.y+r.h;}function Ci(h,r){var t=h<=r?1:h/r,e=r<=h?1:r/h;return[t,e];}function V0(h){var _iterator38=_createForOfIteratorHelper(h),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var r=_step38.value;if(isNaN(r)||r===1/0||r===-1/0)return!1;}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return!0;}function X0(h){return h!==Math.floor(h);}function k0(h){var r=h.toString();return r.indexOf(".")!==-1?r.split(".")[1].length:0;}function J0(h,r){for(;r!==0;){var _ref168=[r,h%r];h=_ref168[0];r=_ref168[1];}return h;}var Z0=function Z0(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;};function pe(h){return"".concat(Ze(h.x),",").concat(Ze(h.y)," ");}function me(h,r){return"".concat(Ze((h.x+r.x)/2),",").concat(Ze((h.y+r.y)/2)," ");}function Ze(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?Te.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?Te.inside:Te.intersect;};function Q0(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 we="cursorhover",Cn=20,Qe="mainView";var q0=/*#__PURE__*/function(){function q0(r,t){_classCallCheck(this,q0);et(this,"viewId");et(this,"scene");et(this,"fullLayer");et(this,"curNodeMap",/* @__PURE__ */new Map());et(this,"targetNodeMap",[]);et(this,"highLevelIds");et(this,"canClearUids");et(this,"localUid");this.viewId=r,this.scene=t;}return _createClass(q0,[{key:"init",value:function init(r){this.fullLayer=r;}},{key:"get",value:function get(r){return this.curNodeMap.get(r);}},{key:"setLocalUid",value:function setLocalUid(r){this.localUid=r;}},{key:"getLocalUid",value:function getLocalUid(){return this.localUid;}},{key:"setCanClearUids",value:function setCanClearUids(r){this.canClearUids=r;}},{key:"getCanClearUids",value:function getCanClearUids(){return this.canClearUids;}},{key:"getCanEraserNodes",value:function getCanEraserNodes(r){var t=/* @__PURE__ */new Map();var _iterator39=_createForOfIteratorHelper(r.entries()),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _step39$value=_slicedToArray(_step39.value,2),_e9=_step39$value[0],n=_step39$value[1];n.toolsType===ut.Image&&n.opt.locked||n.toolsType===ut.Text&&(n.opt.workState===It.Doing||n.opt.workState===It.Start)||this.isCanClearWorkId(_e9)&&t.set(_e9,n);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}return t;}},{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(){return!0;}},{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&&V0(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)),ye(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:"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 _iterator40=_createForOfIteratorHelper(this.curNodeMap.entries()),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _step40$value=_slicedToArray(_step40.value,2),a=_step40$value[0],o=_step40$value[1];if(We(r,o.rect)){if(t&&o.toolsType===ut.Image&&o.opt.locked||e&&o.toolsType===ut.Text&&(o.opt.workState===It.Doing||o.opt.workState===It.Start))continue;n=Pt(n,o.rect),i.set(a,o);}}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return{rectRange:n,nodeRange:i};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(r,t){var e=Pi(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 _e10=this.getNodeRectFormShape(r,t);if(!_e10){this.curNodeMap["delete"](r);return;}t.rect=_e10,this.curNodeMap.set(r,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(r){this.highLevelIds=r;var _iterator41=_createForOfIteratorHelper(this.highLevelIds.keys()),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var t=_step41.value;this.updateNodeRect(t);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var r;var _iterator42=_createForOfIteratorHelper(this.curNodeMap.keys()),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var t=_step42.value;(r=this.highLevelIds)!=null&&r.has(t)||this.updateNodeRect(t);}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(r){var t=/* @__PURE__ */new Map();var _iterator43=_createForOfIteratorHelper(r),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _e11=_step43.value;var n=this.curNodeMap.get(_e11);n&&t.set(_e11,Xt(n));}}catch(err){_iterator43.e(err);}finally{_iterator43.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;}},{key:"isLocalWorkId",value:function isLocalWorkId(r){return r.split(De).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(r){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(Iu(this.canClearUids)){var t=r.split(De);if(t.length===1)return this.canClearUids.has("localSelf")||this.localUid&&this.canClearUids.has(this.localUid);if(t.length===2)return this.canClearUids.has(t[0]);}return!1;}}]);}();var Ai=/*#__PURE__*/function(){function Ai(r,t,e){_classCallCheck(this,Ai);et(this,"viewId");et(this,"scene");et(this,"fullLayer");et(this,"vNodes");et(this,"dpr");et(this,"contextType");et(this,"opt");et(this,"cameraOpt");et(this,"isSafari",!1);et(this,"combinePostMsg",/* @__PURE__ */new Set());et(this,"workerTaskId");et(this,"protectedTask");et(this,"hasPriorityDraw",!0);et(this,"delayPostDoneResolve");et(this,"cacheImages",/* @__PURE__ */new Map());et(this,"imageResolveMap",/* @__PURE__ */new Map());var n,i;if(this.viewId=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(e,(n=t==null?void 0:t.offscreenCanvasOpt)==null?void 0:n.contextType),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");try{this.createRenderLayer(t);}catch(_unused25){if(this.contextType!=="2d")this.contextType="2d",(i=this.scene)==null||i.disconnect(),this.createRenderLayer(t);else throw new Error("Sorry, your browser doesn't support canvas context type ".concat(this.contextType));}this.vNodes=new q0(r,this.scene);}return _createClass(Ai,[{key:"createRenderLayer",value:function createRenderLayer(r){this.scene=this.createScene(r.offscreenCanvasOpt);var t=re.bufferSize.full,e=re.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:this.viewId===Qe?t:e}));}},{key:"updateDpr",value:function(){var _updateDpr=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(r){return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:this.dpr=r,this.scene.displayRatio=r;case 1:case"end":return _context31.stop();}},_callee29,this);}));function updateDpr(_x37){return _updateDpr.apply(this,arguments);}return updateDpr;}()},{key:"getCachedImages",value:function getCachedImages(r){var t;return(t=this.cacheImages.get(r))==null?void 0:t.imageBitmap;}},{key:"getCachedImagesByWorkId",value:function getCachedImagesByWorkId(r){var _iterator44=_createForOfIteratorHelper(this.cacheImages.entries()),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var _step44$value=_slicedToArray(_step44.value,2),t=_step44$value[0],_e12=_step44$value[1];if(t===r&&_e12.imageBitmap)return _e12.imageBitmap;}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(r,t){var _iterator45=_createForOfIteratorHelper(this.cacheImages.entries()),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var _step45$value=_slicedToArray(_step45.value,2),_e13=_step45$value[0],n=_step45$value[1];t&&_e13===t||n.workId===r&&(n.imageBitmap.close(),this.cacheImages["delete"](_e13));}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(r){return r.imageBitmap.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 _callee30(r){var t,e,n,i,a,o,s,l,_l6,d,c,p;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=r.msgType,e=r.toolsType,n=r.opt,i=r.imageSrc,a=r.imageBitmap,o=r.workId,s=r.dpr;_context32.t0=t;_context32.next=_context32.t0===ot.UpdateDpr?4:_context32.t0===ot.UpdateCamera?9:_context32.t0===ot.Destroy?12:_context32.t0===ot.Clear?14:_context32.t0===ot.UpdateTools?17:_context32.t0===ot.GetImageBitMap?19:21;break;case 4:_context32.t1=Zt(s);if(!_context32.t1){_context32.next=8;break;}_context32.next=8;return this.updateDpr(s);case 8:return _context32.abrupt("break",21);case 9:_context32.next=11;return this.updateCamera(r);case 11:return _context32.abrupt("break",21);case 12:this.destroy();return _context32.abrupt("break",21);case 14:_context32.next=16;return this.clearAll();case 16:return _context32.abrupt("break",21);case 17:if(e&&n){l={toolsType:e,toolsOpt:n};this.localWork.setToolsOpt(l);}return _context32.abrupt("break",21);case 19:if(i&&a&&o){_l6=o.toString();this.cacheImages.set(i,{imageBitmap:a,workId:_l6});d=this.imageResolveMap.get(i);if(d){c=d.resolve,p=d.timer;p&&clearTimeout(p),c&&c(i);}this.deleteCachedImagesByWorkId(_l6,i);}return _context32.abrupt("break",21);case 21:case"end":return _context32.stop();}},_callee30,this);}));function on(_x38){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(r,t,e){var n=r*e,i=t*e;return n<=50||i<=50?[50,50]:n<=100||i<=100?[100,100]:n<=200||i<=200?[200,200]:n<=400||i<=400?[400,400]:n<=800||i<=800?[800,800]:[1600,1600];}},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(r){var _this88=this;var t,e,n,i,a,o,s,l,d,c,p,_this$getIconSize,_this$getIconSize2,v,_T40,_v9,_v10,x;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:t=r.toolsType,e=r.opt,n=r.workId,i=r.isSubWorker;if(!(t===ut.Image&&e&&n)){_context33.next=19;break;}a=n.toString(),o=e.src,s=e.type,l=e.width,d=e.height,c=e.strokeColor;if(!(!o||!s||!l||!d)){_context33.next=5;break;}return _context33.abrupt("return");case 5:p=o;if(s===xr.Iconify){_this$getIconSize=this.getIconSize(l,d,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),v=_this$getIconSize2[0],_T40=_this$getIconSize2[1];p="".concat(o,"?width=").concat(v,"&height=").concat(_T40,"&color=").concat(c);}if(!this.cacheImages.has(p)){_context33.next=11;break;}_v9=this.getCachedImages(p);if(!_v9){_context33.next=11;break;}return _context33.abrupt("return",_v9);case 11:if(!this.imageResolveMap.has(p)){_context33.next=15;break;}_v10=this.getCachedImagesByWorkId(a);if(!_v10){_context33.next=15;break;}return _context33.abrupt("return",_v10);case 15:_context33.next=17;return new Promise(function(v){var T=_this88.imageResolveMap.get(p)||{resolve:void 0,timer:void 0};T.timer&&clearTimeout(T.timer),T.resolve=v,T.timer=setTimeout(function(){var f=_this88.imageResolveMap.get(p);f!=null&&f.resolve&&f.resolve(p);},5e3),_this88.imageResolveMap.set(p,T),_this88._post({sp:[{imageSrc:p,workId:a,viewId:_this88.viewId,isgl:!!_this88.fullLayer.parent.gl,isSubWorker:i,type:ot.GetImageBitMap}]});});case 17:x=_context33.sent;return _context33.abrupt("return",(this.imageResolveMap["delete"](x),this.getCachedImages(p)));case 19:case"end":return _context33.stop();}},_callee31,this);}));function loadImageBitMap(_x39){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,t){var e=new OffscreenCanvas(100,100);var n=["2d"];r===qe.Full&&this.viewId===Qe&&(n=["webgl2","webgl","2d"],t&&n.unshift(t));for(var _i9=0,_n7=n;_i9<_n7.length;_i9++){var i=_n7[_i9];try{if(e.getContext(i))return i;}catch(_unused26){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 ts(_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 _callee32(){var r;return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.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 _context34.stop();}},_callee32,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 _callee33(r){return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.combinePostMsg.add(r);_context35.next=3;return this.runBatchPostData();case 3:case"end":return _context35.stop();}},_callee33,this);}));function post(_x40){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(){var _this89=this;return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this89.workerTaskId=void 0,_this89.combinePost();},16));_context36.t0=this.type===qe.Full&&!this.delayPostDoneResolve;if(!_context36.t0){_context36.next=6;break;}_context36.next=5;return new Promise(function(t){_this89.delayPostDoneResolve=t;});case 5:_context36.t0=_context36.sent;case 6:_context36.t1=_context36.t0;if(!_context36.t1){_context36.next=9;break;}this.delayPostDoneResolve=void 0;case 9:case"end":return _context36.stop();}},_callee34,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 _iterator46=_createForOfIteratorHelper(this.combinePostMsg.values()),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var o=_step46.value;if((i=o.render)!=null&&i.length){var _iterator47=_createForOfIteratorHelper(o.render),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var s=_step47.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 _i))continue;if(d.parent.render(),s.isDrawAll){var c=this.getSceneRect();s.rect=c,delete s.isDrawAll;}}var _iterator48=_createForOfIteratorHelper(r),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _d12=_step48.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){_iterator48.e(err);}finally{_iterator48.f();}l||(s.isClear&&!s.drawCanvas?r.unshift(s):r.push(s));}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}}if((a=o.sp)!=null&&a.length){var _iterator49=_createForOfIteratorHelper(o.sp),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _s6=_step49.value;var _l7=!1;var _iterator50=_createForOfIteratorHelper(t),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var _d13=_step50.value;if(oe(_s6,_d13)){_l7=!0;break;}}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}_l7||t.push(_s6);}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}Zt(o.drawCount)&&(e=o.drawCount);}}catch(err){_iterator46.e(err);}finally{_iterator46.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)),X0(t)){var a=k0(t),o=Math.pow(10,a),s=J0(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 Ri=/*#__PURE__*/function(){function Ri(r){_classCallCheck(this,Ri);et(this,"viewId");et(this,"vNodes");et(this,"thread");et(this,"fullLayer");et(this,"drawLayer");et(this,"_post");et(this,"tmpOpt");et(this,"workShapes",/* @__PURE__ */new Map());et(this,"drawCount",0);et(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(Ri,[{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 _0=ee,tg=function tg(){return _0.Date.now();},eg=tg,rg=/\s/;function ng(h){for(var r=h.length;r--&&rg.test(h.charAt(r)););return r;}var ig=ng,sg=ig,og=/^\s+/;function ag(h){return h&&h.slice(0,sg(h)+1).replace(og,"");}var lg=ag,cg=de,fg=ne,hg="[object Symbol]";function ug(h){return _typeof(h)=="symbol"||fg(h)&&cg(h)==hg;}var dg=ug,gg=lg,An=he,pg=dg,Rn=NaN,mg=/^[-+]0x[0-9a-f]+$/i,vg=/^0b[01]+$/i,yg=/^0o[0-7]+$/i,Sg=parseInt;function xg(h){if(typeof h=="number")return h;if(pg(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=gg(h);var t=vg.test(h);return t||yg.test(h)?Sg(h.slice(2),t?2:8):mg.test(h)?Rn:+h;}var Tg=xg,Mg=he,hr=eg,In=Tg,Pg="Expected a function",Og=Math.max,Eg=Math.min;function Cg(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(Pg);r=In(r)||0,Mg(t)&&(d=!!t.leading,c="maxWait"in t,i=c?Og(In(t.maxWait)||0,r):i,p="trailing"in t?!!t.trailing:p);function y(M){var E=e,A=n;return e=n=void 0,l=M,a=h.apply(A,E),a;}function P(M){return l=M,o=setTimeout(T,r),d?y(M):a;}function x(M){var E=M-s,A=M-l,w=r-E;return c?Eg(w,i-A):w;}function v(M){var E=M-s,A=M-l;return s===void 0||E>=r||E<0||c&&A>=i;}function T(){var M=hr();if(v(M))return f(M);o=setTimeout(T,x(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(T,r),y(s);}return o===void 0&&(o=setTimeout(T,r)),a;}return m.cancel=g,m.flush=u,m;}var Ag=Cg,Rg=Ag,Ig=he,Lg="Expected a function";function wg(h,r,t){var e=!0,n=!0;if(typeof h!="function")throw new TypeError(Lg);return Ig(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),Rg(h,r,{leading:e,maxWait:r,trailing:n});}var bg=wg,Dg=/* @__PURE__ */fe(bg);function Ng(h){return h;}var Ii=Ng;function Wg(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 Bg=Wg,Fg=Bg,Ln=Math.max;function Ug(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),Fg(h,this,o);};}var jg=Ug;function $g(h){return function(){return h;};}var zg=$g,Gg=zg,wn=Gn,Hg=Ii,Kg=wn?function(h,r){return wn(h,"toString",{configurable:!0,enumerable:!1,value:Gg(r),writable:!0});}:Hg,Yg=Kg,Vg=800,Xg=16,kg=Date.now;function Jg(h){var r=0,t=0;return function(){var e=kg(),n=Xg-(e-t);if(t=e,n>0){if(++r>=Vg)return arguments[0];}else r=0;return h.apply(void 0,arguments);};}var Zg=Jg,Qg=Yg,qg=Zg,_g=qg(Qg),tp=_g,ep=Ii,rp=jg,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 Li=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 wi=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=Li,Op=wi,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,bn=Be,wp=Vn,bp=Fe,Dn=bn?bn.isConcatSpreadable:void 0;function Dp(h){return bp(h)||wp(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=Li,Xp=wi,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__ */fe(dm);var pm=/*#__PURE__*/function(_Ri){function pm(t){var _this90;_classCallCheck(this,pm);_this90=_callSuper(this,pm,[t]);et(_this90,"combineUnitTime",re.bezier.combineUnitTime);et(_this90,"combineTimerId");et(_this90,"combineDrawResolve");et(_this90,"combineDrawActiveId");et(_this90,"drawWorkActiveId");et(_this90,"effectSelectNodeData",/* @__PURE__ */new Set());et(_this90,"batchEraserWorks",/* @__PURE__ */new Set());et(_this90,"batchEraserRemoveNodes",/* @__PURE__ */new Set());et(_this90,"batchEraserCombine",Dg(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,_Ri);return _createClass(pm,[{key:"loadImageBitMap",value:function(){var _loadImageBitMap2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t){return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:_context37.next=2;return this.thread.loadImageBitMap(t);case 2:return _context37.abrupt("return",_context37.sent);case 3:case"end":return _context37.stop();}},_callee35,this);}));function loadImageBitMap(_x41){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t,e){var _this91=this;var n,i,a,o,s,l,d;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:n=t.op,i=t.workId,a=t.scenePath;if(!(n!=null&&n.length&&i)){_context38.next=57;break;}o=i.toString(),s=this.getWorkShape(o);if(s){_context38.next=5;break;}return _context38.abrupt("return");case 5:l=s.toolsType;if(!(l===ut.LaserPen)){_context38.next=8;break;}return _context38.abrupt("return");case 8:_context38.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==o;if(!_context38.t0){_context38.next=13;break;}this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context38.next=13;return this.consumeDrawAll({workId:this.combineDrawActiveId,scenePath:a,viewId:this.viewId,msgType:ot.DrawWork,dataType:Mt.Local},e);case 13:_context38.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==o;if(!_context38.t1){_context38.next=18;break;}_context38.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:a,viewId:this.viewId,msgType:ot.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});_context38.t2=l;_context38.next=_context38.t2===ut.Selector?23:_context38.t2===ut.PencilEraser?29:_context38.t2===ut.BitMapEraser?34:_context38.t2===ut.Eraser?39:_context38.t2===ut.Arrow?44:_context38.t2===ut.Straight?44:_context38.t2===ut.Ellipse?44:_context38.t2===ut.Rectangle?44:_context38.t2===ut.Star?44:_context38.t2===ut.Polygon?44:_context38.t2===ut.SpeechBalloon?44:_context38.t2===ut.Pencil?50:57;break;case 23:_context38.t3=d.type===ot.Select;if(!_context38.t3){_context38.next=28;break;}d.selectIds&&e.runReverseSelectWork(d.selectIds);_context38.next=28;return this.drawSelector(d);case 28:return _context38.abrupt("break",57);case 29:_context38.t4=d!=null&&d.rect;if(!_context38.t4){_context38.next=33;break;}_context38.next=33;return this.drawPencilEraser(d);case 33:return _context38.abrupt("break",57);case 34:_context38.t5=d!=null&&d.rect;if(!_context38.t5){_context38.next=38;break;}_context38.next=38;return this.drawBitMapEraser(d);case 38:return _context38.abrupt("break",57);case 39:_context38.t6=d!=null&&d.rect;if(!_context38.t6){_context38.next=43;break;}_context38.next=43;return this.drawEraser(d);case 43:return _context38.abrupt("break",57);case 44:_context38.t7=d;if(!_context38.t7){_context38.next=49;break;}this.drawCount++;_context38.next=49;return this.drawShape(d);case 49:return _context38.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;});_context38.t8=d;if(!_context38.t8){_context38.next=56;break;}_context38.next=56;return this.drawPencil(d);case 56:return _context38.abrupt("break",57);case 57:case"end":return _context38.stop();}},_callee36,this);}));function consumeDraw(_x42,_x43){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t,e){var o,s,l,d,n,i,a,c,p,y,P,x,v;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.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){_context39.next=42;break;}c=n.toString();this.drawWorkActiveId===c&&(this.drawWorkActiveId=void 0);p=this.workShapes.get(c);if(p){_context39.next=8;break;}return _context39.abrupt("return");case 8:y=p.toolsType;if(!(y===ut.LaserPen)){_context39.next=11;break;}return _context39.abrupt("return");case 11:P=this.workShapes.get(we),x=(o=P==null?void 0:P.selectIds)==null?void 0:o[0],v=p.consumeAll({data:t});_context39.t0=y;_context39.next=_context39.t0===ut.Selector?15:_context39.t0===ut.PencilEraser?21:_context39.t0===ut.BitMapEraser?23:_context39.t0===ut.Eraser?28:_context39.t0===ut.Arrow?30:_context39.t0===ut.Straight?30:_context39.t0===ut.Ellipse?30:_context39.t0===ut.Rectangle?30:_context39.t0===ut.Star?30:_context39.t0===ut.Polygon?30:_context39.t0===ut.SpeechBalloon?30:_context39.t0===ut.Pencil?35:42;break;case 15:v.selectIds&&x&&(s=v.selectIds)!=null&&s.includes(x)&&P.cursorBlur();v.selectIds&&e.runReverseSelectWork(v.selectIds);_context39.next=19;return this.drawSelector(_objectSpread(_objectSpread({},v),{},{scenePath:i}));case 19:(l=p.selectIds)!=null&&l.length?p.clearTmpPoints():this.clearWorkShapeNodeCache(c);return _context39.abrupt("break",42);case 21:this.drawPencilEraser(_objectSpread(_objectSpread({},v),{},{scenePath:i}),a),p.clearTmpPoints();return _context39.abrupt("break",42);case 23:_context39.t1=v.rect||(d=v.newWorkDatas)!=null&&d.size;if(!_context39.t1){_context39.next=27;break;}_context39.next=27;return this.drawBitMapEraserFull(p,v,a);case 27:return _context39.abrupt("break",42);case 28:this.drawEraser(_objectSpread(_objectSpread({},v),{},{scenePath:i}),a),p.clearTmpPoints();return _context39.abrupt("break",42);case 30:_context39.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},v),{},{scenePath:i}),a);case 32:this.drawCount=0;this.clearWorkShapeNodeCache(c);return _context39.abrupt("break",42);case 35:_context39.t2=v!=null&&v.rect;if(!_context39.t2){_context39.next=40;break;}_context39.next=39;return this.drawPencilFull(_objectSpread(_objectSpread({},v),{},{scenePath:i}),a);case 39:this.drawCount=0;case 40:this.clearWorkShapeNodeCache(c);return _context39.abrupt("break",42);case 42:case"end":return _context39.stop();}},_callee37,this);}));function consumeDrawAll(_x44,_x45){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t,e){var _iterator51,_step51,n;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:_iterator51=_createForOfIteratorHelper(this.workShapes.keys());_context40.prev=1;_iterator51.s();case 3:if((_step51=_iterator51.n()).done){_context40.next=9;break;}n=_step51.value;_context40.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:ot.DrawWork,dataType:Mt.Local},e);case 7:_context40.next=3;break;case 9:_context40.next=14;break;case 11:_context40.prev=11;_context40.t0=_context40["catch"](1);_iterator51.e(_context40.t0);case 14:_context40.prev=14;_iterator51.f();return _context40.finish(14);case 17:case"end":return _context40.stop();}},_callee38,this,[[1,11,14,17]]);}));function workShapesDone(_x46,_x47){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t){var i,a,e,n,o,s,l,d,c,p,y;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:e=this.setFullWork(t),n=t.ops&&Me(t.ops)||t.op;if(!e){_context41.next=26;break;}o=(i=t.workId)==null?void 0:i.toString();if(o){_context41.next=5;break;}return _context41.abrupt("return");case 5:s=(a=this.vNodes.get(o))==null?void 0:a.rect;if(!(e.toolsType===ut.Image)){_context41.next=13;break;}_context41.next=9;return e.consumeServiceAsync({isFullWork:!0,replaceId:o,worker:this});case 9:l=_context41.sent;d=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);_context41.next=20;break;case 13:if(!(e.toolsType===ut.Text)){_context41.next=19;break;}_context41.next=16;return e.consumeServiceAsync({isFullWork:!0,replaceId:o});case 16:l=_context41.sent;_context41.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:bt(s),isClear:!0,clearCanvas:St.Bg,viewId:this.viewId}),c.push({rect:bt(l),drawCanvas:St.Bg,viewId:this.viewId})),t.willSyncService&&p.push({opt:t.opt,toolsType:t.toolsType,type:ot.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),c.length||p.length)){_context41.next=26;break;}y={render:c,sp:p};_context41.next=26;return this._post(y);case 26:case"end":return _context41.stop();}},_callee39,this);}));function consumeFull(_x48){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:ot.TextUpdate,toolsType:ut.Text,workId:t,dataType:Mt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t,e){var n,i,a,o,s,l,_iterator52,_step52,d,y,p;return _regeneratorRuntime().wrap(function _callee40$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:n=t.willSyncService,i=[],a=[],o=[],s=this.workShapes.get(Nt);if(s){_context42.next=3;break;}return _context42.abrupt("return");case 3:l=s.selectIds&&_toConsumableArray(s.selectIds)||[];_iterator52=_createForOfIteratorHelper(l);try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){d=_step52.value;if(this.vNodes.get(d)){y=this.commandDeleteText(d);y&&i.push(y);}p=this._removeWork(d);p.length&&a.push.apply(a,_toConsumableArray(p)),e==null||e.deleteCachedImagesByWorkId(d),o.push(d);}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}o.length&&i.push({type:ot.RemoveNode,removeIds:o});i.push({type:ot.Select,selectIds:[],willSyncService:n});_context42.next=10;return this.blurSelector();case 10:_context42.t0=a.length||i.length;if(!_context42.t0){_context42.next=14;break;}_context42.next=14;return this._post({render:a,sp:i});case 14:case"end":return _context42.stop();}},_callee40,this);}));function removeSelector(_x49,_x50){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context43.next=7;break;}i=this._removeWork(n);_context43.t0=i.length;if(!_context43.t0){_context43.next=7;break;}_context43.next=7;return this._post({render:i});case 7:case"end":return _context43.stop();}},_callee41,this);}));function removeWork(_x51){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:bt(e),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:bt(e),drawCanvas:St.Bg,viewId:this.viewId}),n&&i.push({rect:bt(n),clearCanvas:St.Float,isClear:!0,viewId:this.viewId},{rect:bt(n),drawCanvas:St.Float,viewId:this.viewId}),i;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var e,n,i,a,o,s,l,_iterator53,_step53,d,c,p,y,P;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:e=t.op,n=t.viewId,i=t.dataType;if(!(e!=null&&e.length)){_context44.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];_iterator53=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context44.prev=4;_iterator53.s();case 6:if((_step53=_iterator53.n()).done){_context44.next=14;break;}d=_step53.value;c=d.rect,p=d.name,y=d.toolsType,P=d.opt;if(!(y===ut.Text&&P.workState===It.Done&&Y0([s,l],c))){_context44.next=12;break;}a=p,o=this.setFullWork({workId:p,toolsType:y,opt:P});return _context44.abrupt("break",14);case 12:_context44.next=6;break;case 14:_context44.next=19;break;case 16:_context44.prev=16;_context44.t0=_context44["catch"](4);_iterator53.e(_context44.t0);case 19:_context44.prev=19;_iterator53.f();return _context44.finish(19);case 22:_context44.t1=a;if(!_context44.t1){_context44.next=32;break;}_context44.t2=o;if(!_context44.t2){_context44.next=28;break;}_context44.next=28;return o.consumeServiceAsync({isFullWork:!0,replaceId:o.getWorkId(),isDrawLabel:!1});case 28:_context44.next=30;return this.blurSelector({viewId:n,msgType:ot.Select,dataType:i,isSync:!0});case 30:_context44.next=32;return this._post({sp:[{type:ot.GetTextActive,toolsType:ut.Text,workId:a}]});case 32:case"end":return _context44.stop();}},_callee42,this,[[4,16,19,22]]);}));function checkTextActive(_x52){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var _this92=this;var e,n,i;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:e=this.workShapes.get(Nt),n=t.workId,i=t.msgType;if(!(e&&n&&e.selectIds&&e.selectIds.includes(n.toString()))){_context45.next=6;break;}i===ot.RemoveNode?e.selectIds=e.selectIds.filter(function(a){return a!==n.toString();}):this.effectSelectNodeData.add(t);_context45.next=5;return this.runEffectSelectWork(!0).then(function(){var a;(a=_this92.effectSelectNodeData)==null||a.clear();});case 5:return _context45.abrupt("return");case 6:return _context45.abrupt("return",t);case 7:case"end":return _context45.stop();}},_callee43,this);}));function colloctEffectSelectWork(_x53){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var _this93=this;var P,e,n,i,a,o,s,l,d,c,p,y;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:e=this.workShapes.get(Nt);if((P=e==null?void 0:e.selectIds)!=null&&P.length){_context46.next=3;break;}return _context46.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);a=i.updateSelectorOpt;o=i.willSerializeData;_context46.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=_context46.sent;l=/* @__PURE__ */new Map();s!=null&&s.selectIds&&(d=gm(e.selectIds,s.selectIds),s.selectIds.forEach(function(x){var v=_this93.vNodes.get(x);if(v){var _T41=v.toolsType,_f36=v.op,g=v.opt;l.set(x,{opt:g,toolsType:_T41,ops:(_f36==null?void 0:_f36.length)&&Qt(_f36)||void 0});}}),e.selectIds=s.selectIds);c=[],p=[];s!=null&&s.rect&&c.push({rect:bt(s.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:bt(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:ot.RemoveNode,removeIds:d,viewId:this.viewId});_context46.t0=y.render.length||y.sp.length;if(!_context46.t0){_context46.next=20;break;}_context46.next=20;return this._post(y);case 20:case"end":return _context46.stop();}},_callee44,this);}));function updateSelector(_x54){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(t){var i,e,n,a;return _regeneratorRuntime().wrap(function _callee45$(_context47){while(1)switch(_context47.prev=_context47.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)){_context47.next=6;break;}a=[];a.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync}));_context47.next=6;return this._post({render:(n==null?void 0:n.rect)&&[{rect:bt(n.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:bt(n.rect),drawCanvas:St.Bg,viewId:this.viewId}],sp:a});case 6:case"end":return _context47.stop();}},_callee45,this);}));function blurSelector(_x55){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 _callee46(){var t,a,e,n,i,o,_args48=arguments;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:t=_args48.length>0&&_args48[0]!==undefined?_args48[0]:!1;e=this.workShapes.get(Nt);if(e){_context48.next=4;break;}return _context48.abrupt("return");case 4:if(!(e&&!((a=e.selectIds)!=null&&a.length))){_context48.next=8;break;}_context48.next=7;return this.blurSelector();case 7:return _context48.abrupt("return");case 8:n=e.oldSelectRect,i=e.reRenderSelector();if(!i){_context48.next=13;break;}o=Pt(n,i)||i;_context48.next=13;return this._post({render:[{rect:bt(o),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:bt(o),drawCanvas:St.Bg,viewId:this.viewId}],sp:[{type:ot.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 _context48.stop();}},_callee46,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t){var i,a,o,s,l,d,c,e,n,_e$updateSelectIds,p,y,P;return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:e=this.workShapes.get(Nt),n=t.selectIds;if(n!=null&&n.length){_context49.next=5;break;}_context49.next=4;return this.blurSelector(t);case 4:return _context49.abrupt("return");case 5:if(e){_context49.next=10;break;}!this.setFullWork(t)&&t.workId&&((i=this.tmpOpt)==null?void 0:i.toolsType)===ut.Selector&&this.createWorkShape(t.workId.toString());_context49.next=9;return this.updateFullSelectWork(t);case 9:return _context49.abrupt("return");case 10:if(!(e&&n!=null&&n.length)){_context49.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:bt(p),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:bt(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:ot.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}));_context49.next=16;return this._post(P);case 16:case"end":return _context49.stop();}},_callee47,this);}));function updateFullSelectWork(_x56){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 _callee48(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:e=[];t.op&&e.push(t);n=[];if(t.rect){i=bt(t.rect);n.push({rect:i,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:i,drawCanvas:St.Bg,viewId:this.viewId});}_context50.t0=e.length||n.length;if(!_context50.t0){_context50.next=8;break;}_context50.next=8;return this._post({sp:e,render:n});case 8:case"end":return _context50.stop();}},_callee48,this);}));function drawBitMapEraser(_x57){return _drawBitMapEraser.apply(this,arguments);}return drawBitMapEraser;}()},{key:"drawBitMapEraserFull",value:function(){var _drawBitMapEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,e,n){var i,a,o,s,l,d,c,p,P,_iterator54,_step54,_step54$value,x,v,y,_P4;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:i=e.rect,a=e.willUpdateNodes,o=e.willDeleteNodes,s=e.scenePath,l=_objectWithoutProperties(e,_excluded3);d=i;c=t.getWorkId(),p=[_objectSpread(_objectSpread({},l),{},{workId:c,scenePath:s,updateNodeOpt:{useAnimation:!1},isSync:!0,nextTasks:[{type:ot.RemoveNode,removeIds:[c],viewId:this.viewId}]})];if(!(n&&p.push({type:ot.None,isLockSentEventCursor:n}),a!=null&&a.size||o!=null&&o.size)){_context51.next=9;break;}_context51.next=6;return t==null?void 0:t.reRenderEffectNodes({willDeleteNodes:o,willUpdateNodes:a,worker:this});case 6:P=_context51.sent;if(d=Pt(d,P),a!=null&&a.size){_iterator54=_createForOfIteratorHelper(a);try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){_step54$value=_slicedToArray(_step54.value,2),x=_step54$value[0],v=_step54$value[1];p.push({type:ot.UpdateNode,dataType:Mt.Local,opt:v.opt,workId:x,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}o!=null&&o.size&&p.push({type:ot.RemoveNode,removeIds:_toConsumableArray(o),viewId:this.thread.viewId});case 9:y=[];if(d){_P4=bt(d);y.push({rect:_P4,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:_P4,drawCanvas:St.Bg,viewId:this.viewId});}_context51.t0=p.length||y.length;if(!_context51.t0){_context51.next=15;break;}_context51.next=15;return this._post({sp:p,render:y});case 15:case"end":return _context51.stop();}},_callee49,this);}));function drawBitMapEraserFull(_x58,_x59,_x60){return _drawBitMapEraserFull.apply(this,arguments);}return drawBitMapEraserFull;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t,e){var i,a,o,n,s,l;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:n=(i=this.workShapes.get(t))==null?void 0:i.combineConsume();if(!n){_context52.next=6;break;}s={render:[],drawCount:e};if(n!=null&&n.rect){l=bt(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});}_context52.next=6;return this._post(s);case 6:case"end":return _context52.stop();}},_callee50,this);}));function drawPencilCombine(_x61,_x62){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t){var n,e;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:bt(t.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:bt(t.rect),drawCanvas:St.Bg,viewId:this.viewId}));_context53.next=4;return this._post(e);case 4:case"end":return _context53.stop();}},_callee51,this);}));function drawSelector(_x63){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilEraser",value:function(){var _drawPencilEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t,e){var _this94=this;var i,a,n,_iterator55,_step55,o,s;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:n=[];if((i=t.newWorkDatas)!=null&&i.size){_iterator55=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){o=_step55.value;s=o.workId.toString();this.batchEraserWorks.add(s),n.push({type:ot.FullWork,workId:s,ops:Qt(o.op),opt:o.opt,toolsType:o.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}delete t.newWorkDatas;}(a=t.removeIds)==null||a.forEach(function(o){_this94.batchEraserRemoveNodes.add(o);});e&&n.push({type:ot.None,isLockSentEventCursor:e});t.rect&&n.push(t);_context54.next=7;return this._post({sp:n});case 7:this.batchEraserCombine();case 8:case"end":return _context54.stop();}},_callee52,this);}));function drawPencilEraser(_x64,_x65){return _drawPencilEraser.apply(this,arguments);}return drawPencilEraser;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(t,e){var n,i;return _regeneratorRuntime().wrap(function _callee53$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:n=[],i=[];e&&n.push({type:ot.None,isLockSentEventCursor:e});t.removeIds&&n.push(t);t.rect&&i.push({rect:t.rect,isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:St.Bg,viewId:this.viewId});_context55.next=6;return this._post({sp:n,render:i});case 6:case"end":return _context55.stop();}},_callee53,this);}));function drawEraser(_x66,_x67){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_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({drawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context56.stop();}},_callee54,this);}));function drawShape(_x68){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t){return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_context57.next=2;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context57.stop();}},_callee55,this);}));function drawPencil(_x69){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(t,e){var i,a,n;return _regeneratorRuntime().wrap(function _callee56$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:n={drawCount:1/0,render:[],sp:[t]};e&&((i=n.sp)==null||i.push({type:ot.None,isLockSentEventCursor:e}));(a=n.render)==null||a.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});_context58.next=5;return this._post(n);case 5:case"end":return _context58.stop();}},_callee56,this);}));function drawPencilFull(_x70,_x71){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"updateBatchEraserCombineNode",value:function updateBatchEraserCombineNode(t,e){var _this95=this;var n=[];var i;var _iterator56=_createForOfIteratorHelper(e.keys()),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var a=_step56.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){_iterator56.e(err);}finally{_iterator56.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 _callee57(t){var e,_iterator57,_step57,n,i,a,o;return _regeneratorRuntime().wrap(function _callee57$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:_iterator57=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context59.prev=1;_iterator57.s();case 3:if((_step57=_iterator57.n()).done){_context59.next=23;break;}n=_step57.value;i=this.setFullWork(n);if(!i){_context59.next=21;break;}a=(e=i.getWorkId())==null?void 0:e.toString();if(!(i.toolsType===ut.Image)){_context59.next=13;break;}_context59.next=11;return i.consumeServiceAsync({isFullWork:!0,replaceId:a,worker:this});case 11:_context59.next=20;break;case 13:if(!(i.toolsType===ut.Text)){_context59.next=18;break;}_context59.next=16;return i.consumeServiceAsync({isFullWork:!0,replaceId:a});case 16:_context59.next=20;break;case 18:o=n.ops&&Me(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:_context59.next=3;break;case 23:_context59.next=28;break;case 25:_context59.prev=25;_context59.t0=_context59["catch"](1);_iterator57.e(_context59.t0);case 28:_context59.prev=28;_iterator57.f();return _context59.finish(28);case 31:_context59.next=33;return this.reRenderSelector(t);case 33:case"end":return _context59.stop();}},_callee57,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x72){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(t){var o,e,n,i,a,s,l;return _regeneratorRuntime().wrap(function _callee58$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:e=t.opt,n=t.toolsType,i=t.point,a=this.setFullWork({workId:we,toolsType:n,opt:e});if(!(a&&i)){_context60.next=8;break;}s=a.cursorHover(i),l={render:[]};_context60.t0=s&&s.type===ot.CursorHover&&s.rect;if(!_context60.t0){_context60.next=8;break;}(o=l.render)==null||o.push({rect:bt(s.rect),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:bt(s.rect),drawCanvas:St.Bg,viewId:this.viewId});_context60.next=8;return this._post(l);case 8:case"end":return _context60.stop();}},_callee58,this);}));function cursorHover(_x73){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(){var n,t,e;return _regeneratorRuntime().wrap(function _callee59$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:t=this.getWorkShape(we);_context61.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context61.t0){_context61.next=10;break;}e=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(we);_context61.t1=e;if(!_context61.t1){_context61.next=10;break;}_context61.next=10;return this._post({render:[{rect:bt(e),clearCanvas:St.Bg,isClear:!0,viewId:this.viewId},{rect:bt(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 _context61.stop();}},_callee59,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(Ri);var mm=/*#__PURE__*/function(){function mm(r){_classCallCheck(this,mm);et(this,"viewId");et(this,"vNodes");et(this,"fullLayer");et(this,"drawLayer");et(this,"workShapes",/* @__PURE__ */new Map());et(this,"selectorWorkShapes",/* @__PURE__ */new Map());et(this,"thread");et(this,"animationId");et(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());et(this,"runEffectId");et(this,"noAnimationRect");et(this,"syncUnitTime",re.syncOpt.interval);et(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 _callee60(r){return _regeneratorRuntime().wrap(function _callee60$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:this.activeWorkShape(r),this.runAnimation();case 1:case"end":return _context62.stop();}},_callee60,this);}));function consumeDraw(_x74){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 _callee61(r){var t,e,n;return _regeneratorRuntime().wrap(function _callee61$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:t=r.workId,e=t==null?void 0:t.toString();if(!e){_context63.next=10;break;}n=this.workShapes.get(e);if(!n){_context63.next=8;break;}this.workShapes["delete"](e);_context63.next=7;return this.removeNode(e,r,n==null?void 0:n.totalRect,!1);case 7:return _context63.abrupt("return");case 8:_context63.next=10;return this.removeNode(e,r);case 10:case"end":return _context63.stop();}},_callee61,this);}));function removeWork(_x75){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 _callee62(r,t,e){var n,o,i,a,_args64=arguments;return _regeneratorRuntime().wrap(function _callee62$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:n=_args64.length>3&&_args64[3]!==undefined?_args64[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);_context64.t0=i;if(!_context64.t0){_context64.next=12;break;}_context64.next=12;return this.post({render:[{rect:bt(i),isClear:!0,clearCanvas:n?St.Bg:St.ServiceFloat,workerType:n?void 0:Mt.Service,viewId:this.viewId},{rect:bt(i),drawCanvas:n?St.Bg:St.ServiceFloat,workerType:n?void 0:Mt.Service,viewId:this.viewId}]});case 12:case"end":return _context64.stop();}},_callee62,this);}));function removeNode(_x76,_x77,_x78){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(r){var y,P,x,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 _T42={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&&(_T42=this.setNodeKey(d,_T42,n,e)),(x=this.workShapes)==null||x.set(d,_T42);}var p=(v=this.workShapes)==null?void 0:v.get(d);i&&(p.type=i),o&&(p.animationWorkData=Me(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 _callee63(){var _this97=this;var n,i,a,o,s,l,d,c,p,y,P,x,v,T,f,g,u,m,M,E,A,w,O,L,b,I,R,W,z,K,k,q,U,G,Z,nt,r,t,e,_iterator58,_step58,_loop6;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:this.animationId=void 0;r=!1;t={render:[]},e=/* @__PURE__ */new Map();_iterator58=_createForOfIteratorHelper(this.workShapes.entries());_context66.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step58$value,rt,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$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:_step58$value=_slicedToArray(_step58.value,2),rt=_step58$value[0],tt=_step58$value[1];_context65.t0=tt.toolsType;_context65.next=_context65.t0===ut.Image?4:_context65.t0===ut.Text?11:_context65.t0===ut.Arrow?19:_context65.t0===ut.Straight?19:_context65.t0===ut.Rectangle?19:_context65.t0===ut.Ellipse?19:_context65.t0===ut.Star?19:_context65.t0===ut.Polygon?19:_context65.t0===ut.SpeechBalloon?19:_context65.t0===ut.Pencil?22:_context65.t0===ut.BitMapEraser?37:_context65.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}));_context65.next=8;return(a=tt.node)==null?void 0:a.consumeServiceAsync({isFullWork:!0,worker:_this97.thread});case 8:ht=_context65.sent;_this97.selectorWorkShapes.forEach(function(dt,B){var F;(F=dt.selectIds)!=null&&F.includes(rt)&&(_this97.willRunEffectSelectorIds.add(B),_this97.noAnimationRect=Pt(_this97.noAnimationRect,J),_this97.noAnimationRect=Pt(_this97.noAnimationRect,ht),_this97.runEffect());}),_this97.workShapes["delete"](rt),(o=t.render)==null||o.push({rect:ht,drawCanvas:St.Bg,viewId:_this97.viewId});return _context65.abrupt("break",50);case 11:if(!tt.node){_context65.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}));_context65.next=16;return tt.node.consumeServiceAsync({isFullWork:!0,replaceId:rt});case 16:_ht3=_context65.sent;_this97.selectorWorkShapes.forEach(function(dt,B){var F;(F=dt.selectIds)!=null&&F.includes(rt)&&(_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"](rt),(c=t.render)==null||c.push({rect:_ht3,drawCanvas:St.Bg,viewId:_this97.viewId});case 18:return _context65.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&&((x=t.render)==null||x.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(rt,{workState:_ht4?tt.ops?It.Done:It.Doing:It.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(rt)&&(_this97.willRunEffectSelectorIds.add(Y),_this97.noAnimationRect=Pt(_this97.noAnimationRect,_ht4),_this97.noAnimationRect=Pt(_this97.noAnimationRect,dt),_this97.noAnimationRect=Pt(_this97.noAnimationRect,B),_this97.runEffect());}),(T=tt.node)==null||T.clearTmpPoints(),_this97.workShapes["delete"](rt),(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 _context65.abrupt("break",50);case 22:if(!(!tt.useAnimation&&tt.ops)){_context65.next=28;break;}_J6=(u=tt.node)==null?void 0:u.consumeService({op:tt.animationWorkData||[],isFullWork:!0,replaceId:rt});_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(rt)&&(_this97.willRunEffectSelectorIds.add(B),_this97.noAnimationRect=Pt(_this97.noAnimationRect,_J6),_this97.runEffect());}),(A=tt.node)==null||A.clearTmpPoints(),_this97.workShapes["delete"](rt);_context65.next=36;break;case 28:if(!tt.useAnimation){_context65.next=36;break;}if(!tt.isDel){_context65.next=32;break;}(w=tt.node)==null||w.clearTmpPoints(),_this97.workShapes["delete"](rt);return _context65.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=(b=tt.node)==null?void 0:b.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(rt,{workState:_dt2===0?It.Start:_ht6===((R=tt.animationWorkData)==null?void 0:R.length)?It.Done:It.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(rt,{workState:It.Done,op:_B.filter(function(X,N){if(N%_J7!==_J7-1)return!0;}).slice(-2)});}r=!0;return _context65.abrupt("break",50);case 36:return _context65.abrupt("break",50);case 37:if(!tt.isDel){_context65.next=40;break;}(K=tt.node)==null||K.clearTmpPoints(),_this97.workShapes["delete"](rt);return _context65.abrupt("break",50);case 40:if(!(tt.ops&&(k=tt.animationWorkData)!=null&&k.length)){_context65.next=44;break;}_J8=tt.animationWorkData.slice(-3,-1);e.set(rt,{workState:It.Done,op:_J8}),tt.isDel=!0;return _context65.abrupt("break",50);case 44:if(!tt.useAnimation){_context65.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(rt,{workState:_dt3===0?It.Start:_ht7===((Z=tt.animationWorkData)==null?void 0:Z.length)?It.Done:It.Doing,op:_Y2});}}r=!0;return _context65.abrupt("break",50);case 49:return _context65.abrupt("break",50);case 50:case"end":return _context65.stop();}},_loop6);});_iterator58.s();case 7:if((_step58=_iterator58.n()).done){_context66.next=11;break;}return _context66.delegateYield(_loop6(),"t0",9);case 9:_context66.next=7;break;case 11:_context66.next=16;break;case 13:_context66.prev=13;_context66.t1=_context66["catch"](4);_iterator58.e(_context66.t1);case 16:_context66.prev=16;_iterator58.f();return _context66.finish(16);case 19:r&&this.runAnimation();e.size&&(t.sp=[],e.forEach(function(rt,tt){var J;(J=t.sp)==null||J.push({type:ot.Cursor,uid:tt.split(De)[0],op:rt.op,workState:rt.workState,viewId:_this97.viewId});}));_context66.t2=(nt=t.render)!=null&&nt.length;if(!_context66.t2){_context66.next=25;break;}_context66.next=25;return this.post(t);case 25:case"end":return _context66.stop();}},_callee63,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 _callee64(){var _this99=this;var r;return _regeneratorRuntime().wrap(function _callee64$(_context67){while(1)switch(_context67.prev=_context67.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);});_context67.t0=r;if(!_context67.t0){_context67.next=7;break;}_context67.next=7;return this.post({render:[{rect:bt(r),isClear:!0,clearCanvas:St.Bg,viewId:this.viewId},{rect:bt(r),drawCanvas:St.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context67.stop();}},_callee64,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(_Ri2){function vm(t){var _this100;_classCallCheck(this,vm);_this100=_callSuper(this,vm,[t]);et(_this100,"drawWorkActiveId");return _this100;}_inherits(vm,_Ri2);return _createClass(vm,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t){var i,e,n,a,o,s;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:e=this.setFullWork(t),n=t.ops&&Me(t.ops);if(!e){_context68.next=18;break;}s=(i=e.getWorkId())==null?void 0:i.toString();if(!(e.toolsType===ut.Image)){_context68.next=9;break;}_context68.next=6;return e.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 6:a=_context68.sent;_context68.next=16;break;case 9:if(!(e.toolsType===ut.Text)){_context68.next=15;break;}_context68.next=12;return e.consumeServiceAsync({isFullWork:!0,replaceId:s,isDrawLabel:!0});case 12:a=_context68.sent;_context68.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 _context68.abrupt("return",Pt(a,o));case 18:case"end":return _context68.stop();}},_callee65,this);}));function runFullWork(_x79){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 _iterator59=_createForOfIteratorHelper(this.workShapes.keys()),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var t=_step59.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator59.e(err);}finally{_iterator59.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 _callee66(t){var e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:e=t.workId,n=e==null?void 0:e.toString(),i=n&&this.workShapes.get(n);if(i){_context69.next=3;break;}return _context69.abrupt("return");case 3:_context69.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==n;if(!_context69.t0){_context69.next=8;break;}_context69.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:ot.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});_context69.t1=a;_context69.next=_context69.t1===ut.Arrow?13:_context69.t1===ut.Straight?13:_context69.t1===ut.Ellipse?13:_context69.t1===ut.Rectangle?13:_context69.t1===ut.Star?13:_context69.t1===ut.Polygon?13:_context69.t1===ut.SpeechBalloon?13:_context69.t1===ut.Pencil?19:25;break;case 13:_context69.t2=o;if(!_context69.t2){_context69.next=18;break;}this.drawCount++;_context69.next=18;return this.drawShape(o);case 18:return _context69.abrupt("break",25);case 19:_context69.t3=o;if(!_context69.t3){_context69.next=24;break;}this.drawCount++;_context69.next=24;return this.drawPencil(o,e==null?void 0:e.toString());case 24:return _context69.abrupt("break",25);case 25:case"end":return _context69.stop();}},_callee66,this);}));function consumeDraw(_x80){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:e=t.workId;if(!e){_context70.next=12;break;}n=e.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);i=this.workShapes.get(n);if(i){_context70.next=7;break;}return _context70.abrupt("return");case 7:_context70.t0=i.toolsType;_context70.next=_context70.t0===ut.Arrow?10:_context70.t0===ut.Straight?10:_context70.t0===ut.Ellipse?10:_context70.t0===ut.Pencil?10:_context70.t0===ut.Rectangle?10:_context70.t0===ut.Star?10:_context70.t0===ut.Polygon?10:_context70.t0===ut.SpeechBalloon?10:12;break;case 10:this.drawCount=0,this.fullLayer.removeAllChildren(),this.clearWorkShapeNodeCache(n);return _context70.abrupt("break",12);case 12:case"end":return _context70.stop();}},_callee67,this);}));function consumeDrawAll(_x81){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t){var e,n,i,a;return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context71.next=8;break;}i=this.removeNode(n);if(!i){_context71.next=8;break;}a=[];a.push({rect:bt(i),clearCanvas:St.Float,isClear:!0,viewId:this.viewId},{rect:bt(i),drawCanvas:St.Float,viewId:this.viewId});_context71.next=8;return this._post({render:a});case 8:case"end":return _context71.stop();}},_callee68,this);}));function removeWork(_x82){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 _callee69(t,e){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,workId:e,drawCanvas:St.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context72.stop();}},_callee69,this);}));function drawPencil(_x83,_x84){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(t){return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:_context73.next=2;return this._post({drawCount:this.drawCount,render:[{rect:(t==null?void 0:t.rect)&&bt(t.rect),isClear:!0,clearCanvas:St.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&bt(t.rect),drawCanvas:St.Float,viewId:this.viewId}]});case 2:case"end":return _context73.stop();}},_callee70,this);}));function drawShape(_x85){return _drawShape2.apply(this,arguments);}return drawShape;}()}]);}(Ri);var ym=/*#__PURE__*/function(){function ym(r){_classCallCheck(this,ym);et(this,"viewId");et(this,"vNodes");et(this,"topLayer");et(this,"thread");et(this,"post");et(this,"serviceWorkShapes",/* @__PURE__ */new Map());et(this,"localWorkShapes",/* @__PURE__ */new Map());et(this,"tmpOpt");et(this,"syncUnitTime",re.syncOpt.interval);et(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:It.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=It.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=It.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=Me(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 _callee71(){var _this101=this;var a,o,s,l,r,t,e,n,i,_iterator60,_step60,_step60$value,d,c,y,P,x,v,_iterator61,_step61,_step61$value,_d14,_c7,p,_y14,_P5,_x86,_v11;return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:this.animationId=void 0;r=!1;t=/* @__PURE__ */new Map(),e=[],n=[],i=[];_iterator60=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context74.prev=4;_iterator60.s();case 6:if((_step60=_iterator60.n()).done){_context74.next=20;break;}_step60$value=_slicedToArray(_step60.value,2),d=_step60$value[0],c=_step60$value[1];_context74.t0=c.toolsType;_context74.next=_context74.t0===ut.LaserPen?11:18;break;case 11:y=this.computNextAnimationIndex(c,8),P=Math.max(0,c.animationIndex||0),x=(c.animationWorkData||[]).slice(P,y);if((c.animationIndex||0)<y){v=(a=c.node)==null?void 0:a.consumeService({op:x,isFullWork:!1});c.totalRect=Pt(c.totalRect,v),c.animationIndex=y,x.length&&t.set(d,{workState:P===0?It.Start:y===((o=c.animationWorkData)==null?void 0:o.length)?It.Done:It.Doing,op:x.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)){_context74.next=16;break;}(s=c.node)==null||s.clearTmpPoints(),this.serviceWorkShapes["delete"](d);return _context74.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 _context74.abrupt("break",18);case 18:_context74.next=6;break;case 20:_context74.next=25;break;case 22:_context74.prev=22;_context74.t1=_context74["catch"](4);_iterator60.e(_context74.t1);case 25:_context74.prev=25;_iterator60.f();return _context74.finish(25);case 28:_iterator61=_createForOfIteratorHelper(this.localWorkShapes.entries());_context74.prev=29;_iterator61.s();case 31:if((_step61=_iterator61.n()).done){_context74.next=44;break;}_step61$value=_slicedToArray(_step61.value,2),_d14=_step61$value[0],_c7=_step61$value[1];p=_c7.result,_y14=_c7.toolsType,_P5=_c7.totalRect,_x86=_c7.isDel,_v11=_c7.workState;_context74.t2=_y14;_context74.next=_context74.t2===ut.LaserPen?37:42;break;case 37:if(!(_P5&&(n.push({isClear:!0,rect:_P5,clearCanvas:St.TopFloat,viewId:this.viewId}),e.push({rect:_P5,drawCanvas:St.TopFloat,viewId:this.viewId})),_x86)){_context74.next=40;break;}_c7.node.clearTmpPoints(),this.localWorkShapes["delete"](_d14),i.push({removeIds:[_d14.toString()],viewId:this.viewId,type:ot.RemoveNode});return _context74.abrupt("break",42);case 40:p&&((p.op||p.ops)&&i.push(p),_c7.result=void 0),!this.topLayer.getElementsByName(_d14.toString())[0]&&_v11===It.Done&&(_c7.isDel=!0,this.localWorkShapes.set(_d14,_c7)),r=!0;return _context74.abrupt("break",42);case 42:_context74.next=31;break;case 44:_context74.next=49;break;case 46:_context74.prev=46;_context74.t3=_context74["catch"](29);_iterator61.e(_context74.t3);case 49:_context74.prev=49;_iterator61.f();return _context74.finish(49);case 52:r&&this.runAnimation(),t.size&&t.forEach(function(d,c){i.push({type:ot.Cursor,uid:c.split(De)[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 _context74.stop();}},_callee71,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 qe=/* @__PURE__ */function(h){return h.Full="full",h.Sub="sub",h;}(qe||{});var Sm=/*#__PURE__*/function(){function Sm(r,t){_classCallCheck(this,Sm);et(this,"_self");et(this,"version",fi);et(this,"type");et(this,"hasPriorityDraw",!0);et(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 Di(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 _callee72(r){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_e16,n,i,a,o,_iterator62,_step62,l,_iterator63,_step63,_step63$value,_l8,d,c,_iterator64,_step64,_l9,s;return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:t=r.data;if(!t){_context75.next=56;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context75.prev=4;_iterator=_asyncIterator(t.values());case 6:_context75.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context75.sent).done)){_context75.next=40;break;}_e16=_step.value;n=_e16.msgType,i=_e16.viewId,a=_e16.tasksqueue,o=_e16.mainTasksqueueCount;if(!(n===ot.Console)){_context75.next=14;break;}console.log(_this103);return _context75.abrupt("continue",37);case 14:if(!(n===ot.Init)){_context75.next=17;break;}_this103.init(_e16);return _context75.abrupt("continue",37);case 17:if(!(_this103.type==="sub"&&(n===ot.PriorityWorker||n===ot.PriorityMainThreadWorker))){_context75.next=22;break;}n===ot.PriorityWorker?_this103.hasPriorityDraw=!0:n===ot.PriorityMainThreadWorker&&(_this103.hasPriorityDraw=!1);_iterator62=_createForOfIteratorHelper(_this103.workThreadMap.values());try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){l=_step62.value;l.setHasPriorityDraw(_this103.hasPriorityDraw);}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}return _context75.abrupt("continue",37);case 22:if(!(n===ot.TasksQueue&&a!=null&&a.size)){_context75.next=27;break;}_iterator63=_createForOfIteratorHelper(_this103.workThreadMap.entries());try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){_step63$value=_slicedToArray(_step63.value,2),_l8=_step63$value[0],d=_step63$value[1];c=a.get(_l8);c&&d.on(c);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}_this103.type==="full"&&Zt(o)&&_this103.post({workerTasksqueueCount:o});return _context75.abrupt("continue",37);case 27:if(!(i===Fi)){_context75.next=31;break;}_iterator64=_createForOfIteratorHelper(_this103.workThreadMap.values());try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){_l9=_step64.value;_l9.on(_e16),n===ot.Destroy&&_this103.workThreadMap["delete"](i);}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}return _context75.abrupt("continue",37);case 31:s=_this103.workThreadMap.get(i);_context75.t0=s;if(!_context75.t0){_context75.next=37;break;}_context75.next=36;return s.on(_e16);case 36:n===ot.Destroy&&_this103.workThreadMap["delete"](i);case 37:_iteratorAbruptCompletion=false;_context75.next=6;break;case 40:_context75.next=46;break;case 42:_context75.prev=42;_context75.t1=_context75["catch"](4);_didIteratorError=true;_iteratorError=_context75.t1;case 46:_context75.prev=46;_context75.prev=47;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context75.next=51;break;}_context75.next=51;return _iterator["return"]();case 51:_context75.prev=51;if(!_didIteratorError){_context75.next=54;break;}throw _iteratorError;case 54:return _context75.finish(51);case 55:return _context75.finish(46);case 56:case"end":return _context75.stop();}},_callee72,null,[[4,42,46,56],[47,,51,55]]);}));return function onmessage(_x87){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(_Ai){function xm(t,e,n){var _this104;_classCallCheck(this,xm);_this104=_callSuper(this,xm,[t,e,"full"/* Full */]);et(_this104,"type","full");et(_this104,"serviceDrawLayer");et(_this104,"localDrawLayer");et(_this104,"snapshotFullLayer");et(_this104,"methodBuilder");et(_this104,"localWork");et(_this104,"serviceWork");et(_this104,"_post");et(_this104,"taskUpdateCameraId");et(_this104,"debounceUpdateCameraId");et(_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 ki([wt.CopyNode,wt.SetColorNode,wt.DeleteNode,wt.RotateNode,wt.ScaleNode,wt.TranslateNode,wt.ZIndexNode,wt.SetFontStyle,wt.SetPoint,wt.SetLock,wt.SetShapeOpt]).registerForWorker(_this104),_this104.vNodes.init(_this104.fullLayer);return _this104;}_inherits(xm,_Ai);return _createClass(xm,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(){var _this105=this;var a,o,_this$combinePostData,t,e,n,s,_iterator65,_step65,l,d,i;return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,e=_objectWithoutProperties(_this$combinePostData,_excluded4);if(!(t!=null&&t.length)){_context76.next=28;break;}s=[];_iterator65=_createForOfIteratorHelper(t);_context76.prev=4;_iterator65.s();case 6:if((_step65=_iterator65.n()).done){_context76.next=19;break;}l=_step65.value;if(!l.rect){_context76.next=17;break;}if(!(l.rect=this.safariFixRect(Xt(l.rect),this.dpr),!l.rect)){_context76.next=11;break;}return _context76.abrupt("continue",17);case 11:if(!(l.drawCanvas&&l.rect&&l.rect.w>0&&l.rect.h>0)){_context76.next=16;break;}_context76.next=14;return this.getRectImageBitmap(l);case 14:d=_context76.sent;l.imageBitmap=d,n||(n=[]),n.push(d);case 16:s.push(l);case 17:_context76.next=6;break;case 19:_context76.next=24;break;case 21:_context76.prev=21;_context76.t0=_context76["catch"](4);_iterator65.e(_context76.t0);case 24:_context76.prev=24;_iterator65.f();return _context76.finish(24);case 27:e.render=s;case 28:i=(a=e.sp)==null?void 0:a.filter(function(s){return s.type!==ot.None||s.isLockSentEventCursor;});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 _context76.stop();}},_callee73,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 _callee74(t){var _this106=this;var e,n,i,a,o,s,l,d,_l10;return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context77.next=2;break;}return _context77.abrupt("return");case 2:e=t.msgType,n=t.dataType,i=t.workId,a=t.toolsType,o=t.workState,s=t.workIds;_context77.t0=e;_context77.next=_context77.t0===ot.AuthClear?6:_context77.t0===ot.CreateWork?9:_context77.t0===ot.DrawWork?11:_context77.t0===ot.Select?20:_context77.t0===ot.UpdateNode?27:_context77.t0===ot.FullWork?27:_context77.t0===ot.RemoveNode?29:_context77.t0===ot.GetTextActive?32:_context77.t0===ot.CursorHover?35:_context77.t0===ot.CursorBlur?38:_context77.t0===ot.GetVNodeInfo?41:43;break;case 6:l=t.clearUids,d=t.localUid;this.vNodes.setCanClearUids(l),this.vNodes.setLocalUid(d);return _context77.abrupt("break",43);case 9:a!==ut.LaserPen&&this.createLocalWork(t);return _context77.abrupt("break",43);case 11:_context77.t1=a!==ut.LaserPen;if(!_context77.t1){_context77.next=19;break;}if(!(o===It.Done&&n===Mt.Local)){_context77.next=18;break;}_context77.next=16;return this.consumeDrawAll(n,t);case 16:_context77.next=19;break;case 18:this.consumeDraw(n,t);case 19:return _context77.abrupt("break",43);case 20:if(!(i===Nt)){_context77.next=25;break;}_context77.next=23;return this.localWork.updateFullSelectWork(t);case 23:_context77.next=26;break;case 25:this.serviceWork.runSelectWork(t);case 26:return _context77.abrupt("return");case 27:this.consumeFull(n,t);return _context77.abrupt("return");case 29:_context77.next=31;return this.removeNode(t);case 31:return _context77.abrupt("return");case 32:_context77.next=34;return this.checkTextActive(t);case 34:return _context77.abrupt("return");case 35:_context77.next=37;return this.cursorHover(t);case 37:return _context77.abrupt("return");case 38:_context77.next=40;return this.cursorBlur();case 40:return _context77.abrupt("return");case 41:if(i&&s){_l10=s.map(function(d){return _this106.vNodes.get(d);});this.post({sp:[{type:ot.GetVNodeInfo,dataType:Mt.Worker,workId:i,vInfo:_l10}]});}return _context77.abrupt("break",43);case 43:_context77.next=45;return _superPropGet(xm,"on",this,3)([t]);case 45:case"end":return _context77.stop();}},_callee74,this);}));function on(_x88){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t){var _this107=this;var e,n,i,a,o,_iterator66,_step66,_loop7;return _regeneratorRuntime().wrap(function _callee75$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:e=t.dataType,n=t.workId,i=t.removeIds,a=[],o=i||[];if(!(n&&o.push(n.toString()),o.length)){_context79.next=20;break;}_iterator66=_createForOfIteratorHelper(o);_context79.prev=3;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var s;return _regeneratorRuntime().wrap(function _loop7$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:s=_step66.value;s===Nt?a.push(_this107.localWork.removeSelector(t,_this107)):e===Mt.Local?a.push(_this107.localWork.removeWork(t).then(function(){_this107.localWork.colloctEffectSelectWork(t),_this107.deleteCachedImagesByWorkId(s);})):e===Mt.Service&&a.push(_this107.serviceWork.removeWork(t).then(function(){_this107.localWork.colloctEffectSelectWork(t),_this107.deleteCachedImagesByWorkId(s);}));case 2:case"end":return _context78.stop();}},_loop7);});_iterator66.s();case 6:if((_step66=_iterator66.n()).done){_context79.next=10;break;}return _context79.delegateYield(_loop7(),"t0",8);case 8:_context79.next=6;break;case 10:_context79.next=15;break;case 12:_context79.prev=12;_context79.t1=_context79["catch"](3);_iterator66.e(_context79.t1);case 15:_context79.prev=15;_iterator66.f();return _context79.finish(15);case 18:_context79.next=20;return Promise.all(a);case 20:case"end":return _context79.stop();}},_callee75,null,[[3,12,15,18]]);}));function removeNode(_x89){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(t){var e;return _regeneratorRuntime().wrap(function _callee76$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:e=t.dataType;_context80.t0=e===Mt.Local;if(!_context80.t0){_context80.next=5;break;}_context80.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context80.stop();}},_callee76,this);}));function checkTextActive(_x90){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(){return _regeneratorRuntime().wrap(function _callee77$(_context81){while(1)switch(_context81.prev=_context81.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());_context81.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:ot.Clear}]});case 6:case"end":return _context81.stop();}},_callee77,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 _callee78(t,e){var n;return _regeneratorRuntime().wrap(function _callee78$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:_context82.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context82.sent;_context82.t0=n&&t===Mt.Local;if(!_context82.t0){_context82.next=7;break;}_context82.next=7;return this.localWork.consumeFull(n);case 7:n&&t===Mt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context82.stop();}},_callee78,this);}));function consumeFull(_x91,_x92){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t,e){var n;return _regeneratorRuntime().wrap(function _callee79$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:n=e.workId;_context83.t0=t===Mt.Local&&n;if(!_context83.t0){_context83.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context83.next=6;return this.localWork.consumeDraw(e,this.serviceWork);case 6:t===Mt.Service&&this.serviceWork.consumeDraw(e);case 7:case"end":return _context83.stop();}},_callee79,this);}));function consumeDraw(_x93,_x94){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t,e){var n;return _regeneratorRuntime().wrap(function _callee80$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:n=e.workId;_context84.t0=t===Mt.Local&&n;if(!_context84.t0){_context84.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context84.next=6;return this.localWork.consumeDrawAll(e,this.serviceWork);case 6:case"end":return _context84.stop();}},_callee80,this);}));function consumeDrawAll(_x95,_x96){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(t){return _regeneratorRuntime().wrap(function _callee81$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:_superPropGet(xm,"updateDpr",this,3)([t]);_context85.next=3;return this.post({render:[{isClearAll:!0,clearCanvas:St.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:St.Bg,viewId:this.viewId}]});case 3:case"end":return _context85.stop();}},_callee81,this);}));function updateDpr(_x97){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(t){var _this108=this;var a,e,n,i,o,p,_iterator67,_step67,_step67$value,y,P,s,_iterator68,_step68,_step68$value,_p8,_y19,_P9,l,d,_p4,_iterator69,_step69,_y15,c,_iterator70,_step70,_p5,_y16,_iterator71,_step71,_P6,_iterator72,_step72,_step72$value,_p7,_y18,_P8,x,v,_T44,_f38,g,u,m,M,_iterator73,_step73,_step73$value,_p6,_y17;return _regeneratorRuntime().wrap(function _callee82$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:e=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!oe(this.cameraOpt,n))){_context86.next=40;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);o=!!this.serviceDrawLayer.children.length;if(!i){_context86.next=30;break;}p=!1;_iterator67=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context86.prev=7;_iterator67.s();case 9:if((_step67=_iterator67.n()).done){_context86.next=19;break;}_step67$value=_slicedToArray(_step67.value,2),y=_step67$value[0],P=_step67$value[1];_context86.t0=P.toolsType;_context86.next=_context86.t0===ut.Text?14:_context86.t0===ut.BitMapEraser?14:_context86.t0===ut.PencilEraser?14:_context86.t0===ut.Eraser?14:_context86.t0===ut.Selector?14:_context86.t0===ut.LaserPen?14:15;break;case 14:return _context86.abrupt("break",17);case 15:y!==we&&y!==Nt&&(p=!0);return _context86.abrupt("break",17);case 17:_context86.next=9;break;case 19:_context86.next=24;break;case 21:_context86.prev=21;_context86.t1=_context86["catch"](7);_iterator67.e(_context86.t1);case 24:_context86.prev=24;_iterator67.f();return _context86.finish(24);case 27:if(!p){_context86.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this108.taskUpdateCameraId=void 0,_this108.updateCamera(t);},Cn);return _context86.abrupt("return");case 30:s=/* @__PURE__ */new Map();_iterator68=_createForOfIteratorHelper(this.vNodes.getNodesByType(ut.Text).entries());try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){_step68$value=_slicedToArray(_step68.value,2),_p8=_step68$value[0],_y19=_step68$value[1];_P9=_y19.rect;s.set(_p8,Xt(_P9));}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}l=new Set(s.keys());d=!1;if(this.localWork.hasSelector()){_p4=(a=this.localWork.getSelector())==null?void 0:a.selectIds;if(_p4){d=!0;_iterator69=_createForOfIteratorHelper(_p4);try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){_y15=_step69.value;l.add(_y15);}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}}}c=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator70=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){_p5=_step70.value;_y16=_p5.selectIds;if(_y16){c=!0;_iterator71=_createForOfIteratorHelper(_y16);try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){_P6=_step71.value;l.add(_P6);}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}}}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(l),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator72=_createForOfIteratorHelper(s.entries());try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){_step72$value=_slicedToArray(_step72.value,2),_p7=_step72$value[0],_y18=_step72$value[1];_P8=this.vNodes.get(_p7);if(_P8){x=_y18,v=_P8.rect,_T44=this.getSceneRect(),_f38=fr(x,_T44),g=fr(v,_T44);u=!1;if((_f38!==g||x.w!==v.w||x.h!==v.h||g===Te.intersect)&&(u=!0),u){m=_P8.toolsType,M=_P8.opt;m===ut.Text&&M.workState===It.Done&&this.debounceUpdateCache.add(_p7);}}}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}if(d&&this.localWork.reRenderSelector(),c){_iterator73=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){_step73$value=_slicedToArray(_step73.value,2),_p6=_step73$value[0],_y17=_step73$value[1];this.serviceWork.runSelectWork({workId:_p6,selectIds:_y17.selectIds,msgType:ot.Select,dataType:Mt.Service,viewId:this.viewId});}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}}this.debounceUpdateCameraId=setTimeout(function(){var y;_this108.debounceUpdateCameraId=void 0;var p=[];var _iterator74=_createForOfIteratorHelper(_this108.debounceUpdateCache.values()),_step74;try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){var _P7=_step74.value;if((y=_this108.fullLayer)==null?void 0:y.getElementsByName(_P7)[0]){var v=_this108.vNodes.get(_P7);if(v){var _T43=v.toolsType,_f37=v.opt,g=v.rect,u=_this108.localWork.setFullWork({toolsType:_T43,opt:_f37,workId:_P7});if(u){var m=_this108.getSceneRect(),M=fr(g,m);p.push(u.consumeServiceAsync({isFullWork:!0,replaceId:_P7,isDrawLabel:M!==Te.outside}));}}}_this108.debounceUpdateCache["delete"](_P7);}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}p.length?Promise.all(p).then(function(){var P=[];P.push({isClearAll:!0,clearCanvas:St.Bg,viewId:_this108.viewId},{isDrawAll:!0,drawCanvas:St.Bg,viewId:_this108.viewId}),P.length&&_this108.post({render:P}),_this108.vNodes.updateLowLevelNodesRect(),_this108.vNodes.clearHighLevelIds();}):(_this108.vNodes.updateLowLevelNodesRect(),_this108.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 _context86.stop();}},_callee82,this,[[7,21,24,27]]);}));function updateCamera(_x98){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 _callee83(t){return _regeneratorRuntime().wrap(function _callee83$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:_context87.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context87.stop();}},_callee83,this);}));function cursorHover(_x99){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(){return _regeneratorRuntime().wrap(function _callee84$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:_context88.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context88.stop();}},_callee84,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(xm,"destroy",this,3)([]);}}]);}(Ai);var Di=/*#__PURE__*/function(_Ai2){function Di(t,e,n){var _this109;_classCallCheck(this,Di);_this109=_callSuper(this,Di,[t,e,"sub"/* Sub */]);et(_this109,"type","sub");et(_this109,"_post");et(_this109,"topLayer");et(_this109,"snapshotFullLayer");et(_this109,"serviceWork");et(_this109,"localWork");et(_this109,"topLayerWork");_this109._post=n;var i=re.bufferSize.sub;_this109.topLayer=_this109.createLayer("topLayer",_this109.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:i}));var a={thread:_this109,viewId:_this109.viewId,vNodes:_this109.vNodes,fullLayer:_this109.fullLayer,topLayer:_this109.topLayer};_this109.localWork=new vm(a),_this109.topLayerWork=new ym(a),_this109.vNodes.init(_this109.fullLayer);return _this109;}_inherits(Di,_Ai2);return _createClass(Di,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(){var _this110=this;var a,o,s,_this$combinePostData2,t,e,n,l,_iterator75,_step75,_d15,_i11,_l11,d,_l12,_iterator76,_step76,_d16,c,i;return _regeneratorRuntime().wrap(function _callee85$(_context89){while(1)switch(_context89.prev=_context89.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=[];_iterator75=_createForOfIteratorHelper(e.workIds.values());try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){_d15=_step75.value;this.fullLayer.getElementsByName(_d15).forEach(function(c){c.id&&e.drawCount&&Number(c.id)<e.drawCount&&l.push(c);});}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}for(_i11=0,_l11=l;_i11<_l11.length;_i11++){d=_l11[_i11];d.remove(),d.disconnect();}}if(!(t!=null&&t.length)){_context89.next=29;break;}_l12=[];_iterator76=_createForOfIteratorHelper(t);_context89.prev=5;_iterator76.s();case 7:if((_step76=_iterator76.n()).done){_context89.next=20;break;}_d16=_step76.value;if(!_d16.rect){_context89.next=18;break;}if(!(_d16.rect=this.safariFixRect(Xt(_d16.rect),this.dpr),!_d16.rect)){_context89.next=12;break;}return _context89.abrupt("continue",18);case 12:if(!(_d16.drawCanvas&&_d16.rect&&_d16.rect.w>0&&_d16.rect.h>0)){_context89.next=17;break;}_context89.next=15;return this.getRectImageBitmap(_d16);case 15:c=_context89.sent;_d16.imageBitmap=c,n||(n=[]),n.push(c);case 17:_l12.push(_d16);case 18:_context89.next=7;break;case 20:_context89.next=25;break;case 22:_context89.prev=22;_context89.t0=_context89["catch"](5);_iterator76.e(_context89.t0);case 25:_context89.prev=25;_iterator76.f();return _context89.finish(25);case 28:e.render=_l12;case 29:i=(o=e.sp)==null?void 0:o.filter(function(l){return l.type!==ot.None;});i!=null&&i.length?e.sp=i.map(function(l){return _objectSpread(_objectSpread({},l),{},{viewId:_this110.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 _context89.stop();}},_callee85,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 _callee86(t){var e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee86$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.dataType,o=t.workState;_context90.t0=e;_context90.next=_context90.t0===ot.UpdateTools?4:_context90.t0===ot.CreateWork?9:_context90.t0===ot.DrawWork?11:_context90.t0===ot.RemoveNode?18:_context90.t0===ot.FullWork?21:_context90.t0===ot.Snapshot?26:_context90.t0===ot.BoundingBox?33:40;break;case 4:if(!(n&&this.topLayerWork.canUseTopLayer(n)&&i)){_context90.next=8;break;}s={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(s);return _context90.abrupt("return");case 8:return _context90.abrupt("break",40);case 9:this.createLocalWork(t);return _context90.abrupt("return");case 11:if(!(o===It.Done&&a===Mt.Local)){_context90.next=16;break;}_context90.next=14;return this.consumeDrawAll(a,t);case 14:_context90.next=17;break;case 16:this.consumeDraw(a,t);case 17:return _context90.abrupt("return");case 18:_context90.next=20;return this.removeNode(t);case 20:return _context90.abrupt("return");case 21:_context90.t1=n&&this.topLayerWork.canUseTopLayer(n);if(!_context90.t1){_context90.next=25;break;}_context90.next=25;return this.consumeDrawAll(a,t);case 25:return _context90.abrupt("return");case 26:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Qe?6e3:3e3}));_context90.t2=this.snapshotFullLayer;if(!_context90.t2){_context90.next=32;break;}_context90.next=31;return this.getSnapshot(t);case 31:this.snapshotFullLayer=void 0;case 32:return _context90.abrupt("return");case 33:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Qe?6e3:3e3}));_context90.t3=this.snapshotFullLayer;if(!_context90.t3){_context90.next=39;break;}_context90.next=38;return this.getBoundingRect(t);case 38:this.snapshotFullLayer=void 0;case 39:return _context90.abrupt("return");case 40:_context90.next=42;return _superPropGet(Di,"on",this,3)([t]);case 42:case"end":return _context90.stop();}},_callee86,this);}));function on(_x100){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(Di,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(t){var e;return _regeneratorRuntime().wrap(function _callee87$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:e=t.dataType;_context91.t0=e===Mt.Local;if(!_context91.t0){_context91.next=5;break;}_context91.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context91.stop();}},_callee87,this);}));function removeNode(_x101){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 _callee88(t,e){var n,i;return _regeneratorRuntime().wrap(function _callee88$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:n=e.workId,i=e.toolsType;if(!n){_context92.next=11;break;}if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context92.next=5;break;}t===Mt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(e)),this.topLayerWork.consumeDraw(e);return _context92.abrupt("return");case 5:_context92.t0=i&&this.localWork.canUseSubWorker(i);if(!_context92.t0){_context92.next=10;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(e);_context92.next=10;return this.localWork.consumeDraw(e);case 10:return _context92.abrupt("return");case 11:case"end":return _context92.stop();}},_callee88,this);}));function consumeDraw(_x102,_x103){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee89(t,e){var n,i,a,o;return _regeneratorRuntime().wrap(function _callee89$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:n=e.workId,i=e.toolsType,a=e.dataType;if(!n){_context93.next=8;break;}o=n.toString();if(!(i&&this.topLayerWork.canUseTopLayer(i))){_context93.next=6;break;}a===Mt.Local&&(this.topLayerWork.getWorkShape(o)||this.createLocalWork(e)),this.topLayerWork.consumeDrawAll(e);return _context93.abrupt("return");case 6:i&&this.localWork.canUseSubWorker(i)&&(this.localWork.getWorkShape(o)||_superPropGet(Di,"createLocalWork",this,3)([e]),this.localWork.consumeDrawAll(e));return _context93.abrupt("return");case 8:case"end":return _context93.stop();}},_callee89,this);}));function consumeDrawAll(_x104,_x105){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee90(){return _regeneratorRuntime().wrap(function _callee90$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:this.vNodes.clear();_superPropGet(Di,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.topLayer.removeAllChildren());_context94.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId}],sp:[{type:ot.Clear}]});case 5:case"end":return _context94.stop();}},_callee90,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(Di,"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:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee91$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:_superPropGet(Di,"updateDpr",this,3)([t]);e=!!this.topLayerWork.localWorkShapes.size,n=!!this.localWork.getWorkShapes().size,i=[];n&&i.push({isClearAll:!0,clearCanvas:St.Float,viewId:this.viewId});e&&i.push({isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId});_context95.t0=i.length;if(!_context95.t0){_context95.next=8;break;}_context95.next=8;return this.post({render:i});case 8:case"end":return _context95.stop();}},_callee91,this);}));function updateDpr(_x106){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92(t){var _this111=this;var e,n,i,a,_iterator77,_step77,_loop8;return _regeneratorRuntime().wrap(function _callee92$(_context97){while(1)switch(_context97.prev=_context97.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!oe(this.cameraOpt,n))){_context97.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)){_context97.next=21;break;}e.push({isClearAll:!0,clearCanvas:St.TopFloat,viewId:this.viewId});_iterator77=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context97.prev=6;_loop8=/*#__PURE__*/_regeneratorRuntime().mark(function _loop8(){var _step77$value,o,s,l;return _regeneratorRuntime().wrap(function _loop8$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:_step77$value=_slicedToArray(_step77.value,2),o=_step77$value[0],s=_step77$value[1];if(s.totalRect){_this111.topLayer.getElementsByName(o.toString()).forEach(function(d){var c=d.getBoundingClientRect(),p=bt({x:c.x,y:c.y,w:c.width,h:c.height});l=Pt(l,p);}),s.totalRect=l,_this111.topLayerWork.localWorkShapes.set(o,s);}case 2:case"end":return _context96.stop();}},_loop8);});_iterator77.s();case 9:if((_step77=_iterator77.n()).done){_context97.next=13;break;}return _context97.delegateYield(_loop8(),"t0",11);case 11:_context97.next=9;break;case 13:_context97.next=18;break;case 15:_context97.prev=15;_context97.t1=_context97["catch"](6);_iterator77.e(_context97.t1);case 18:_context97.prev=18;_iterator77.f();return _context97.finish(18);case 21:_context97.t2=e.length;if(!_context97.t2){_context97.next=25;break;}_context97.next=25;return this.post({render:e});case 25:case"end":return _context97.stop();}},_callee92,this,[[6,15,18,21]]);}));function updateCamera(_x107){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 _callee93(t){var e,n,i,a,o,s,l,_i12,_Object$entries,_Object$entries$_i,c,p,y,P,x,d;return _regeneratorRuntime().wrap(function _callee93$(_context98){while(1)switch(_context98.prev=_context98.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,o=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context98.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)){_context98.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)){_context98.next=18;break;}_context98.t0=p==null?void 0:p.type;_context98.next=_context98.t0===ot.UpdateNode?11:_context98.t0===ot.FullWork?11:18;break;case 11:y=p.opt;P=_objectSpread(_objectSpread({},p),{},{opt:y,workId:c,msgType:ot.FullWork,dataType:Mt.Service,viewId:this.viewId});_context98.next=15;return this.localWork.runFullWork(P);case 15:x=_context98.sent;l=Pt(l,x);return _context98.abrupt("break",18);case 18:_i12++;_context98.next=5;break;case 21:a&&o&&(d={resizeWidth:a,resizeHeight:o});_context98.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 _context98.stop();}},_callee93,this);}));function getSnapshot(_x108){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(t){var o,s,e,n,i,a;return _regeneratorRuntime().wrap(function _callee94$(_context99){while(1)switch(_context99.prev=_context99.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context99.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:St.None},!0,i);case 4:a=_context99.sent;a&&(this._post({sp:[{type:ot.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 _context99.stop();}},_callee94,this);}));function getSnapshotRender(_x109){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee95(t){var e,n,i,a,o,_i13,_Object$entries2,_Object$entries2$_i,s,l,d;return _regeneratorRuntime().wrap(function _callee95$(_context100){while(1)switch(_context100.prev=_context100.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context100.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)){_context100.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)){_context100.next=16;break;}_context100.t0=l==null?void 0:l.type;_context100.next=_context100.t0===ot.UpdateNode?11:_context100.t0===ot.FullWork?11:16;break;case 11:_context100.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},l),{},{workId:s,msgType:ot.FullWork,dataType:Mt.Service,viewId:this.viewId}));case 13:d=_context100.sent;o=Pt(o,d);return _context100.abrupt("break",16);case 16:_i13++;_context100.next=5;break;case 19:_context100.t1=o;if(!_context100.t1){_context100.next=23;break;}_context100.next=23;return this.post({sp:[{type:ot.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 _context100.stop();}},_callee95,this);}));function getBoundingRect(_x110){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(Ai);var Wn=self;Wn.full=new Sm(Wn,qe.Full);