@netless/appliance-plugin 1.1.17-beta.7 → 1.1.17-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cdn/cdn.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="/fullWorker-RBFpuv.js",e="/subWorker-CCsxSe.js";exports.fullWorkerUrl=r;exports.subWorkerUrl=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="/fullWorker-Dma-pe.js",e="/subWorker-1KsgJX.js";exports.fullWorkerUrl=r;exports.subWorkerUrl=e;
@@ -1,4 +1,4 @@
1
- var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["render"],_excluded4=["render"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)o=s[r],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.includes(n))continue;t[n]=r[n];}return t;}function _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 ji=Object.defineProperty;var $i=function $i(h,r,t){return r in h?ji(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var tt=function tt(h,r,t){return $i(h,_typeof(r)!="symbol"?r+"":r,t);};var wt=/* @__PURE__ */function(h){return h.Normal="Normal",h.Stroke="Stroke",h.Dotted="Dotted",h.LongDotted="LongDotted",h;}(wt||{}),Lt=/* @__PURE__ */function(h){return h.None="None",h.ShowFloatBar="ShowFloatBar",h.ZIndexFloatBar="ZIndexFloatBar",h.DeleteNode="DeleteNode",h.CopyNode="CopyNode",h.ZIndexActive="ZIndexActive",h.ZIndexNode="ZIndexNode",h.RotateNode="RotateNode",h.SetColorNode="SetColorNode",h.TranslateNode="TranslateNode",h.ScaleNode="ScaleNode",h.OriginalEvent="OriginalEvent",h.CreateScene="CreateScene",h.ActiveCursor="ActiveCursor",h.MoveCursor="MoveCursor",h.CommandEditor="CommandEditor",h.SetEditorData="SetEditorData",h.SetFontStyle="SetFontStyle",h.SetPoint="SetPoint",h.SetLock="SetLock",h.SetShapeOpt="SetShapeOpt",h.CameraChange="CameraChange",h.ActiveMethod="ActiveMethod",h;}(Lt||{}),dt=/* @__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;}(dt||{}),Tt=/* @__PURE__ */function(h){return h[h.Local=1]="Local",h[h.Service=2]="Service",h[h.Worker=3]="Worker",h;}(Tt||{}),Ot=/* @__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;}(Ot||{}),st=/* @__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;}(st||{}),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||{}),bt=/* @__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;}(bt||{}),Qt=/* @__PURE__ */function(h){return h[h.inside=0]="inside",h[h.outside=1]="outside",h[h.intersect=2]="intersect",h;}(Qt||{}),Mr=/* @__PURE__ */function(h){return h.Image="image",h.Iconify="iconify",h;}(Mr||{});var ie=/*#__PURE__*/function(){function ie(){_classCallCheck(this,ie);tt(this,"localWork");tt(this,"serviceWork");tt(this,"threadEngine");}return _createClass(ie,[{key:"registerForWorker",value:function registerForWorker(r){return this.threadEngine=r,this.localWork=r.localWork,this.serviceWork=r.serviceWork,this;}}]);}();var zi=/*#__PURE__*/function(_ie){function zi(){var _this;_classCallCheck(this,zi);_this=_callSuper(this,zi,arguments);tt(_this,"emitEventType",Lt.CopyNode);return _this;}_inherits(zi,_ie);return _createClass(zi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.FullWork&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,e;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:e=t.workId;_context.t0=e;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(ie);var Be="++",Wt="selector",Gi="all";var Hi=/*#__PURE__*/function(_ie2){function Hi(){var _this2;_classCallCheck(this,Hi);_this2=_callSuper(this,Hi,arguments);tt(_this2,"emitEventType",Lt.SetColorNode);return _this2;}_inherits(Hi,_ie2);return _createClass(Hi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(t){var c,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===Wt&&n;if(!_context2.t0){_context2.next=5;break;}_context2.next=5;return(c=this.localWork)==null?void 0:c.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,c=n.render||[],m=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),l=_step2$value[0],p=_step2$value[1];s&&p.toolsType===dt.Text?m.push(_objectSpread(_objectSpread({},p),{},{workId:l,type:st.TextUpdate,dataType:Tt.Local,willSyncService:!0})):m.push(_objectSpread(_objectSpread({},p),{},{workId:l,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:c,sp:m};}}]);}(ie);var Ki=/*#__PURE__*/function(_ie3){function Ki(){var _this3;_classCallCheck(this,Ki);_this3=_callSuper(this,Ki,arguments);tt(_this3,"emitEventType",Lt.ZIndexNode);return _this3;}_inherits(Ki,_ie3);return _createClass(Ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.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===Wt&&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||[],c=n.sp||[];if(a&&c){var _iterator3=_createForOfIteratorHelper(i.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),m=_step3$value[0],l=_step3$value[1];c.push(_objectSpread(_objectSpread({},l),{},{workId:m,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:s,sp:c};}}]);}(ie);var Yi=/*#__PURE__*/function(_ie4){function Yi(){var _this4;_classCallCheck(this,Yi);_this4=_callSuper(this,Yi,arguments);tt(_this4,"emitEventType",Lt.TranslateNode);return _this4;}_inherits(Yi,_ie4);return _createClass(Yi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(t){var m,l,e,n,i,a,o,s,c;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,c=t.emitEventType;_context4.t0=e===Wt&&n;if(!_context4.t0){_context4.next=9;break;}if(!(n.workState===Ot.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Ot.Done)){_context4.next=8;break;}_context4.next=6;return(m=this.localWork)==null?void 0:m.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,isSync:!0,textUpdateForWoker:s,emitEventType:c,callback:this.updateSelectorCallback});case 6:_context4.next=9;break;case 8:n.workState===Ot.Done&&((l=this.localWork)==null||l.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,c=e.isSync,m=e.updateSelectorOpt,l=e.textUpdateForWoker,p=m.workState,y=n.render||[],P=n.sp||[];if(p===Ot.Start)return{sp:[],render:[]};var S=o==null?void 0:o.selectRect;if(s){P.push({type:st.Select,selectIds:a.selectIds,selectRect:S,willSyncService:!0,isSync:!0,points:p===Ot.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];l&&T.toolsType===dt.Text?P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:st.TextUpdate,dataType:Tt.Local,willSyncService:!0})):P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:y,sp:P};}}]);}(ie);var Vi=/*#__PURE__*/function(_ie5){function Vi(){var _this5;_classCallCheck(this,Vi);_this5=_callSuper(this,Vi,arguments);tt(_this5,"emitEventType",Lt.DeleteNode);return _this5;}_inherits(Vi,_ie5);return _createClass(Vi,[{key:"consume",value:function consume(){return!1;}}]);}(ie);var ki=/*#__PURE__*/function(_ie6){function ki(){var _this6;_classCallCheck(this,ki);_this6=_callSuper(this,ki,arguments);tt(_this6,"emitEventType",Lt.ScaleNode);return _this6;}_inherits(ki,_ie6);return _createClass(ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.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===Wt&&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,c=e.willSyncService,m=s.workState,l=n.render||[],p=n.sp||[],y=a==null?void 0:a.selectRect;if(m===Ot.Start)return{sp:[],render:[]};if(c){p.push({type:st.Select,selectIds:i.selectIds,selectRect:y,willSyncService:!0,isSync:!0,points:m===Ot.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],S=_step5$value[1];S.toolsType===dt.Text?p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:st.TextUpdate,dataType:Tt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:l,sp:p};}}]);}(ie);var Xi=/*#__PURE__*/function(_ie7){function Xi(){var _this7;_classCallCheck(this,Xi);_this7=_callSuper(this,Xi,arguments);tt(_this7,"emitEventType",Lt.RotateNode);return _this7;}_inherits(Xi,_ie7);return _createClass(Xi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t){var c,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===Wt&&n;if(!_context6.t0){_context6.next=5;break;}_context6.next=5;return(c=this.localWork)==null?void 0:c.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,c=e.willSyncService,m=e.willSerializeData,l=e.isSync,p=s.workState,y=n.render||[],P=n.sp||[],S=a==null?void 0:a.selectRect;if(c){m&&p===Ot.Done&&P.push({type:st.Select,selectIds:i.selectIds,selectRect:S,willSyncService:!0,isSync:l,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt,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:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:P};}}]);}(ie);var Ji=/*#__PURE__*/function(_ie8){function Ji(){var _this8;_classCallCheck(this,Ji);_this8=_callSuper(this,Ji,arguments);tt(_this8,"emitEventType",Lt.SetFontStyle);return _this8;}_inherits(Ji,_ie8);return _createClass(Ji,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var c,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===Wt&&n;if(!_context7.t0){_context7.next=5;break;}_context7.next=5;return(c=this.localWork)==null?void 0:c.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,c=e.isSync,m=e.updateSelectorOpt,l=e.textUpdateForWoker,p=n.render||[],y=n.sp||[],P=o==null?void 0:o.selectRect;if(s&&y){m.fontSize&&y.push({type:st.Select,selectIds:a.selectIds,selectRect:P,willSyncService:s,isSync:c,points:a.getChildrenPoints()});var _iterator7=_createForOfIteratorHelper(i.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),S=_step7$value[0],v=_step7$value[1];l&&v.toolsType===dt.Text?y.push(_objectSpread(_objectSpread({},v),{},{workId:S,type:st.TextUpdate,dataType:Tt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},v),{},{workId:S,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:p,sp:y};}}]);}(ie);var Zi=/*#__PURE__*/function(_ie9){function Zi(){var _this9;_classCallCheck(this,Zi);_this9=_callSuper(this,Zi,arguments);tt(_this9,"emitEventType",Lt.SetPoint);return _this9;}_inherits(Zi,_ie9);return _createClass(Zi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t){var c,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===Wt&&n;if(!_context8.t0){_context8.next=5;break;}_context8.next=5;return(c=this.localWork)==null?void 0:c.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,c=e.isSync,m=n.render||[],l=n.sp||[],p=o==null?void 0:o.selectRect;if(s&&l){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];l.push(_objectSpread(_objectSpread({},P),{},{workId:y,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}l.push({type:st.Select,selectIds:a.selectIds,selectRect:p,willSyncService:s,isSync:c,points:a.getChildrenPoints()});}return{render:m,sp:l};}}]);}(ie);var Qi=/*#__PURE__*/function(_ie10){function Qi(){var _this10;_classCallCheck(this,Qi);_this10=_callSuper(this,Qi,arguments);tt(_this10,"emitEventType",Lt.SetLock);return _this10;}_inherits(Qi,_ie10);return _createClass(Qi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.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===Wt&&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,c=e.isSync,m=e.updateSelectorOpt,l=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],S=_step9$value[1];p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}p.push({isLocked:m.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:st.Select,selectIds:a.selectIds,selectRect:y,willSyncService:s,isSync:c});}return{render:l,sp:p};}}]);}(ie);var qi=/*#__PURE__*/function(_ie11){function qi(){var _this11;_classCallCheck(this,qi);_this11=_callSuper(this,qi,arguments);tt(_this11,"emitEventType",Lt.SetShapeOpt);return _this11;}_inherits(qi,_ie11);return _createClass(qi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.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===Wt&&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||[],c=n.sp||[];if(a&&c){var _iterator10=_createForOfIteratorHelper(i.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),m=_step10$value[0],l=_step10$value[1];c.push(_objectSpread(_objectSpread({},l),{},{workId:m,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:s,sp:c};}}]);}(ie);var _i=/*#__PURE__*/function(){function _i(r){var _this12=this;_classCallCheck(this,_i);tt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this12.build(t)];}));}return _createClass(_i,[{key:"build",value:function build(r){switch(r){case Lt.TranslateNode:return new Yi();case Lt.ZIndexNode:return new Ki();case Lt.CopyNode:return new zi();case Lt.SetColorNode:return new Hi();case Lt.DeleteNode:return new Vi();case Lt.ScaleNode:return new ki();case Lt.RotateNode:return new Xi();case Lt.SetFontStyle:return new Ji();case Lt.SetPoint:return new Zi();case Lt.SetLock:return new Qi();case Lt.SetShapeOpt:return new qi();}}},{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 ts={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=["render"],_excluded4=["render"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)o=s[r],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.includes(n))continue;t[n]=r[n];}return t;}function _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 ji=Object.defineProperty;var $i=function $i(h,r,t){return r in h?ji(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var tt=function tt(h,r,t){return $i(h,_typeof(r)!="symbol"?r+"":r,t);};var wt=/* @__PURE__ */function(h){return h.Normal="Normal",h.Stroke="Stroke",h.Dotted="Dotted",h.LongDotted="LongDotted",h;}(wt||{}),Lt=/* @__PURE__ */function(h){return h.None="None",h.ShowFloatBar="ShowFloatBar",h.ZIndexFloatBar="ZIndexFloatBar",h.DeleteNode="DeleteNode",h.CopyNode="CopyNode",h.ZIndexActive="ZIndexActive",h.ZIndexNode="ZIndexNode",h.RotateNode="RotateNode",h.SetColorNode="SetColorNode",h.TranslateNode="TranslateNode",h.ScaleNode="ScaleNode",h.OriginalEvent="OriginalEvent",h.CreateScene="CreateScene",h.ActiveCursor="ActiveCursor",h.MoveCursor="MoveCursor",h.CommandEditor="CommandEditor",h.SetEditorData="SetEditorData",h.SetFontStyle="SetFontStyle",h.SetPoint="SetPoint",h.SetLock="SetLock",h.SetShapeOpt="SetShapeOpt",h.CameraChange="CameraChange",h.ActiveMethod="ActiveMethod",h.HidFloatBarBtn="HidFloatBarBtn",h;}(Lt||{}),dt=/* @__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;}(dt||{}),Tt=/* @__PURE__ */function(h){return h[h.Local=1]="Local",h[h.Service=2]="Service",h[h.Worker=3]="Worker",h;}(Tt||{}),Ot=/* @__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;}(Ot||{}),st=/* @__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;}(st||{}),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||{}),bt=/* @__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;}(bt||{}),Qt=/* @__PURE__ */function(h){return h[h.inside=0]="inside",h[h.outside=1]="outside",h[h.intersect=2]="intersect",h;}(Qt||{}),Mr=/* @__PURE__ */function(h){return h.Image="image",h.Iconify="iconify",h;}(Mr||{});var ie=/*#__PURE__*/function(){function ie(){_classCallCheck(this,ie);tt(this,"localWork");tt(this,"serviceWork");tt(this,"threadEngine");}return _createClass(ie,[{key:"registerForWorker",value:function registerForWorker(r){return this.threadEngine=r,this.localWork=r.localWork,this.serviceWork=r.serviceWork,this;}}]);}();var zi=/*#__PURE__*/function(_ie){function zi(){var _this;_classCallCheck(this,zi);_this=_callSuper(this,zi,arguments);tt(_this,"emitEventType",Lt.CopyNode);return _this;}_inherits(zi,_ie);return _createClass(zi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.FullWork&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,e;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:e=t.workId;_context.t0=e;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(ie);var Be="++",Wt="selector",Gi="all";var Hi=/*#__PURE__*/function(_ie2){function Hi(){var _this2;_classCallCheck(this,Hi);_this2=_callSuper(this,Hi,arguments);tt(_this2,"emitEventType",Lt.SetColorNode);return _this2;}_inherits(Hi,_ie2);return _createClass(Hi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(t){var c,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===Wt&&n;if(!_context2.t0){_context2.next=5;break;}_context2.next=5;return(c=this.localWork)==null?void 0:c.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,c=n.render||[],m=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),l=_step2$value[0],p=_step2$value[1];s&&p.toolsType===dt.Text?m.push(_objectSpread(_objectSpread({},p),{},{workId:l,type:st.TextUpdate,dataType:Tt.Local,willSyncService:!0})):m.push(_objectSpread(_objectSpread({},p),{},{workId:l,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return{render:c,sp:m};}}]);}(ie);var Ki=/*#__PURE__*/function(_ie3){function Ki(){var _this3;_classCallCheck(this,Ki);_this3=_callSuper(this,Ki,arguments);tt(_this3,"emitEventType",Lt.ZIndexNode);return _this3;}_inherits(Ki,_ie3);return _createClass(Ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.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===Wt&&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||[],c=n.sp||[];if(a&&c){var _iterator3=_createForOfIteratorHelper(i.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),m=_step3$value[0],l=_step3$value[1];c.push(_objectSpread(_objectSpread({},l),{},{workId:m,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:s,sp:c};}}]);}(ie);var Yi=/*#__PURE__*/function(_ie4){function Yi(){var _this4;_classCallCheck(this,Yi);_this4=_callSuper(this,Yi,arguments);tt(_this4,"emitEventType",Lt.TranslateNode);return _this4;}_inherits(Yi,_ie4);return _createClass(Yi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(t){var m,l,e,n,i,a,o,s,c;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,c=t.emitEventType;_context4.t0=e===Wt&&n;if(!_context4.t0){_context4.next=9;break;}if(!(n.workState===Ot.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Ot.Done)){_context4.next=8;break;}_context4.next=6;return(m=this.localWork)==null?void 0:m.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,isSync:!0,textUpdateForWoker:s,emitEventType:c,callback:this.updateSelectorCallback});case 6:_context4.next=9;break;case 8:n.workState===Ot.Done&&((l=this.localWork)==null||l.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,c=e.isSync,m=e.updateSelectorOpt,l=e.textUpdateForWoker,p=m.workState,y=n.render||[],P=n.sp||[];if(p===Ot.Start)return{sp:[],render:[]};var S=o==null?void 0:o.selectRect;if(s){P.push({type:st.Select,selectIds:a.selectIds,selectRect:S,willSyncService:!0,isSync:!0,points:p===Ot.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];l&&T.toolsType===dt.Text?P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:st.TextUpdate,dataType:Tt.Local,willSyncService:!0})):P.push(_objectSpread(_objectSpread({},T),{},{workId:v,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:y,sp:P};}}]);}(ie);var Vi=/*#__PURE__*/function(_ie5){function Vi(){var _this5;_classCallCheck(this,Vi);_this5=_callSuper(this,Vi,arguments);tt(_this5,"emitEventType",Lt.DeleteNode);return _this5;}_inherits(Vi,_ie5);return _createClass(Vi,[{key:"consume",value:function consume(){return!1;}}]);}(ie);var ki=/*#__PURE__*/function(_ie6){function ki(){var _this6;_classCallCheck(this,ki);_this6=_callSuper(this,ki,arguments);tt(_this6,"emitEventType",Lt.ScaleNode);return _this6;}_inherits(ki,_ie6);return _createClass(ki,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.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===Wt&&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,c=e.willSyncService,m=s.workState,l=n.render||[],p=n.sp||[],y=a==null?void 0:a.selectRect;if(m===Ot.Start)return{sp:[],render:[]};if(c){p.push({type:st.Select,selectIds:i.selectIds,selectRect:y,willSyncService:!0,isSync:!0,points:m===Ot.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],S=_step5$value[1];S.toolsType===dt.Text?p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:st.TextUpdate,dataType:Tt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:l,sp:p};}}]);}(ie);var Xi=/*#__PURE__*/function(_ie7){function Xi(){var _this7;_classCallCheck(this,Xi);_this7=_callSuper(this,Xi,arguments);tt(_this7,"emitEventType",Lt.RotateNode);return _this7;}_inherits(Xi,_ie7);return _createClass(Xi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t){var c,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===Wt&&n;if(!_context6.t0){_context6.next=5;break;}_context6.next=5;return(c=this.localWork)==null?void 0:c.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,c=e.willSyncService,m=e.willSerializeData,l=e.isSync,p=s.workState,y=n.render||[],P=n.sp||[],S=a==null?void 0:a.selectRect;if(c){m&&p===Ot.Done&&P.push({type:st.Select,selectIds:i.selectIds,selectRect:S,willSyncService:!0,isSync:l,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt,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:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:y,sp:P};}}]);}(ie);var Ji=/*#__PURE__*/function(_ie8){function Ji(){var _this8;_classCallCheck(this,Ji);_this8=_callSuper(this,Ji,arguments);tt(_this8,"emitEventType",Lt.SetFontStyle);return _this8;}_inherits(Ji,_ie8);return _createClass(Ji,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var c,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===Wt&&n;if(!_context7.t0){_context7.next=5;break;}_context7.next=5;return(c=this.localWork)==null?void 0:c.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,c=e.isSync,m=e.updateSelectorOpt,l=e.textUpdateForWoker,p=n.render||[],y=n.sp||[],P=o==null?void 0:o.selectRect;if(s&&y){m.fontSize&&y.push({type:st.Select,selectIds:a.selectIds,selectRect:P,willSyncService:s,isSync:c,points:a.getChildrenPoints()});var _iterator7=_createForOfIteratorHelper(i.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),S=_step7$value[0],v=_step7$value[1];l&&v.toolsType===dt.Text?y.push(_objectSpread(_objectSpread({},v),{},{workId:S,type:st.TextUpdate,dataType:Tt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},v),{},{workId:S,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return{render:p,sp:y};}}]);}(ie);var Zi=/*#__PURE__*/function(_ie9){function Zi(){var _this9;_classCallCheck(this,Zi);_this9=_callSuper(this,Zi,arguments);tt(_this9,"emitEventType",Lt.SetPoint);return _this9;}_inherits(Zi,_ie9);return _createClass(Zi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t){var c,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===Wt&&n;if(!_context8.t0){_context8.next=5;break;}_context8.next=5;return(c=this.localWork)==null?void 0:c.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,c=e.isSync,m=n.render||[],l=n.sp||[],p=o==null?void 0:o.selectRect;if(s&&l){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];l.push(_objectSpread(_objectSpread({},P),{},{workId:y,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}l.push({type:st.Select,selectIds:a.selectIds,selectRect:p,willSyncService:s,isSync:c,points:a.getChildrenPoints()});}return{render:m,sp:l};}}]);}(ie);var Qi=/*#__PURE__*/function(_ie10){function Qi(){var _this10;_classCallCheck(this,Qi);_this10=_callSuper(this,Qi,arguments);tt(_this10,"emitEventType",Lt.SetLock);return _this10;}_inherits(Qi,_ie10);return _createClass(Qi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.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===Wt&&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,c=e.isSync,m=e.updateSelectorOpt,l=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],S=_step9$value[1];p.push(_objectSpread(_objectSpread({},S),{},{workId:P,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}p.push({isLocked:m.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:st.Select,selectIds:a.selectIds,selectRect:y,willSyncService:s,isSync:c});}return{render:l,sp:p};}}]);}(ie);var qi=/*#__PURE__*/function(_ie11){function qi(){var _this11;_classCallCheck(this,qi);_this11=_callSuper(this,qi,arguments);tt(_this11,"emitEventType",Lt.SetShapeOpt);return _this11;}_inherits(qi,_ie11);return _createClass(qi,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===st.UpdateNode&&n===Tt.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===Wt&&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||[],c=n.sp||[];if(a&&c){var _iterator10=_createForOfIteratorHelper(i.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),m=_step10$value[0],l=_step10$value[1];c.push(_objectSpread(_objectSpread({},l),{},{workId:m,type:st.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}return{render:s,sp:c};}}]);}(ie);var _i=/*#__PURE__*/function(){function _i(r){var _this12=this;_classCallCheck(this,_i);tt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this12.build(t)];}));}return _createClass(_i,[{key:"build",value:function build(r){switch(r){case Lt.TranslateNode:return new Yi();case Lt.ZIndexNode:return new Ki();case Lt.CopyNode:return new zi();case Lt.SetColorNode:return new Hi();case Lt.DeleteNode:return new Vi();case Lt.ScaleNode:return new ki();case Lt.RotateNode:return new Xi();case Lt.SetFontStyle:return new Ji();case Lt.SetPoint:return new Zi();case Lt.SetLock:return new Qi();case Lt.SetShapeOpt:return new qi();}}},{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 ts={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
  *
@@ -396,7 +396,7 @@ _inherits(o,_e$default22);return _createClass(o,[{key:"texture",get:function get
396
396
  c=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
397
397
  n&&(c=="offset"||c=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
398
398
  i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||// Skip index properties.
399
- xc(c,s)))&&o.push(c);return o;}var _n=Oc,Ec=Object.prototype;function Cc(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Ec;return h===t;}var Ar=Cc;function Ac(h,r){return function(t){return h(r(t));};}var ti=Ac,Rc=ti,Ic=Rc(Object.keys,Object),wc=Ic,Lc=Ar,bc=wc,Dc=Object.prototype,Nc=Dc.hasOwnProperty;function Wc(h){if(!Lc(h))return bc(h);var r=[];for(var t in Object(h))Nc.call(h,t)&&t!="constructor"&&r.push(t);return r;}var Bc=Wc,Uc=Gn,Fc=Qn;function jc(h){return h!=null&&Fc(h.length)&&!Uc(h);}var Rr=jc,$c=_n,zc=Bc,Gc=Rr;function Hc(h){return Gc(h)?$c(h):zc(h);}var Ir=Hc,Kc=ar,Yc=Ir;function Vc(h,r){return h&&Kc(r,Yc(r),h);}var kc=Vc;function Xc(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Jc=Xc,Zc=pe,Qc=Ar,qc=Jc,_c=Object.prototype,tf=_c.hasOwnProperty;function ef(h){if(!Zc(h))return qc(h);var r=Qc(h),t=[];for(var e in h)e=="constructor"&&(r||!tf.call(h,e))||t.push(e);return t;}var rf=ef,nf=_n,sf=rf,of=Rr;function af(h){return of(h)?nf(h,!0):sf(h);}var wr=af,lf=ar,cf=wr;function ff(h,r){return h&&lf(r,cf(r),h);}var hf=ff,ke={exports:{}};ke.exports;(function(h,r){var t=se,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(c,m){if(m)return c.slice();var l=c.length,p=o?o(l):new c.constructor(l);return c.copy(p),p;}h.exports=s;})(ke,ke.exports);var uf=ke.exports;function df(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var pf=df;function gf(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 ei=gf;function mf(){return[];}var ri=mf,vf=ei,yf=ri,Sf=Object.prototype,xf=Sf.propertyIsEnumerable,rn=Object.getOwnPropertySymbols,Tf=rn?function(h){return h==null?[]:(h=Object(h),vf(rn(h),function(r){return xf.call(h,r);}));}:yf,Lr=Tf,Mf=ar,Pf=Lr;function Of(h,r){return Mf(h,Pf(h),r);}var Ef=Of;function Cf(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var br=Cf,Af=ti,Rf=Af(Object.getPrototypeOf,Object),ni=Rf,If=br,wf=ni,Lf=Lr,bf=ri,Df=Object.getOwnPropertySymbols,Nf=Df?function(h){for(var r=[];h;)If(r,Lf(h)),h=wf(h);return r;}:bf,ii=Nf,Wf=ar,Bf=ii;function Uf(h,r){return Wf(h,Bf(h),r);}var Ff=Uf,jf=br,$f=ze;function zf(h,r,t){var e=r(h);return $f(h)?e:jf(e,t(h));}var si=zf,Gf=si,Hf=Lr,Kf=Ir;function Yf(h){return Gf(h,Kf,Hf);}var oi=Yf,Vf=si,kf=ii,Xf=wr;function Jf(h){return Vf(h,Xf,kf);}var Zf=Jf,Qf=ve,qf=se,_f=Qf(qf,"DataView"),th=_f,eh=ve,rh=se,nh=eh(rh,"Promise"),ih=nh,sh=ve,oh=se,ah=sh(oh,"Set"),ai=ah,lh=ve,ch=se,fh=lh(ch,"WeakMap"),hh=fh,gr=th,mr=Or,vr=ih,yr=ai,Sr=hh,li=me,we=Hn,nn="[object Map]",uh="[object Object]",sn="[object Promise]",on="[object Set]",an="[object WeakMap]",ln="[object DataView]",dh=we(gr),ph=we(mr),gh=we(vr),mh=we(yr),vh=we(Sr),ge=li;(gr&&ge(new gr(new ArrayBuffer(1)))!=ln||mr&&ge(new mr())!=nn||vr&&ge(vr.resolve())!=sn||yr&&ge(new yr())!=on||Sr&&ge(new Sr())!=an)&&(ge=function ge(h){var r=li(h),t=r==uh?h.constructor:void 0,e=t?we(t):"";if(e)switch(e){case dh:return ln;case ph:return nn;case gh:return sn;case mh:return on;case vh:return an;}return r;});var cr=ge,yh=Object.prototype,Sh=yh.hasOwnProperty;function xh(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&Sh.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var Th=xh,Mh=se,Ph=Mh.Uint8Array,ci=Ph,cn=ci;function Oh(h){var r=new h.constructor(h.byteLength);return new cn(r).set(new cn(h)),r;}var Dr=Oh,Eh=Dr;function Ch(h,r){var t=r?Eh(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Ah=Ch,Rh=/\w*$/;function Ih(h){var r=new h.constructor(h.source,Rh.exec(h));return r.lastIndex=h.lastIndex,r;}var wh=Ih,fn=$e,hn=fn?fn.prototype:void 0,un=hn?hn.valueOf:void 0;function Lh(h){return un?Object(un.call(h)):{};}var bh=Lh,Dh=Dr;function Nh(h,r){var t=r?Dh(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var Wh=Nh,Bh=Dr,Uh=Ah,Fh=wh,jh=bh,$h=Wh,zh="[object Boolean]",Gh="[object Date]",Hh="[object Map]",Kh="[object Number]",Yh="[object RegExp]",Vh="[object Set]",kh="[object String]",Xh="[object Symbol]",Jh="[object ArrayBuffer]",Zh="[object DataView]",Qh="[object Float32Array]",qh="[object Float64Array]",_h="[object Int8Array]",tu="[object Int16Array]",eu="[object Int32Array]",ru="[object Uint8Array]",nu="[object Uint8ClampedArray]",iu="[object Uint16Array]",su="[object Uint32Array]";function ou(h,r,t){var e=h.constructor;switch(r){case Jh:return Bh(h);case zh:case Gh:return new e(+h);case Zh:return Uh(h,t);case Qh:case qh:case _h:case tu:case eu:case ru:case nu:case iu:case su:return $h(h,t);case Hh:return new e();case Kh:case kh:return new e(h);case Yh:return Fh(h);case Vh:return new e();case Xh:return jh(h);}}var au=ou,lu=pe,dn=Object.create,cu=/* @__PURE__ */function(){function h(){}return function(r){if(!lu(r))return{};if(dn)return dn(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),fu=cu,hu=fu,uu=ni,du=Ar;function pu(h){return typeof h.constructor=="function"&&!du(h)?hu(uu(h)):{};}var gu=pu,mu=cr,vu=oe,yu="[object Map]";function Su(h){return vu(h)&&mu(h)==yu;}var xu=Su,Tu=xu,Mu=lr,pn=Cr,gn=pn&&pn.isMap,Pu=gn?Mu(gn):Tu,Ou=Pu,Eu=cr,Cu=oe,Au="[object Set]";function Ru(h){return Cu(h)&&Eu(h)==Au;}var Iu=Ru,wu=Iu,Lu=lr,mn=Cr,vn=mn&&mn.isSet,bu=vn?Lu(vn):wu,fi=bu,Du=/* @__PURE__ */de(fi),Nu=Yn,Wu=sl,Bu=Xn,Uu=kc,Fu=hf,ju=uf,$u=pf,zu=Ef,Gu=Ff,Hu=oi,Ku=Zf,Yu=cr,Vu=Th,ku=au,Xu=gu,Ju=ze,Zu=Er,Qu=Ou,qu=pe,_u=fi,td=Ir,ed=wr,rd=1,nd=2,id=4,hi="[object Arguments]",sd="[object Array]",od="[object Boolean]",ad="[object Date]",ld="[object Error]",ui="[object Function]",cd="[object GeneratorFunction]",fd="[object Map]",hd="[object Number]",di="[object Object]",ud="[object RegExp]",dd="[object Set]",pd="[object String]",gd="[object Symbol]",md="[object WeakMap]",vd="[object ArrayBuffer]",yd="[object DataView]",Sd="[object Float32Array]",xd="[object Float64Array]",Td="[object Int8Array]",Md="[object Int16Array]",Pd="[object Int32Array]",Od="[object Uint8Array]",Ed="[object Uint8ClampedArray]",Cd="[object Uint16Array]",Ad="[object Uint32Array]",Ft={};Ft[hi]=Ft[sd]=Ft[vd]=Ft[yd]=Ft[od]=Ft[ad]=Ft[Sd]=Ft[xd]=Ft[Td]=Ft[Md]=Ft[Pd]=Ft[fd]=Ft[hd]=Ft[di]=Ft[ud]=Ft[dd]=Ft[pd]=Ft[gd]=Ft[Od]=Ft[Ed]=Ft[Cd]=Ft[Ad]=!0;Ft[ld]=Ft[ui]=Ft[md]=!1;function Ke(h,r,t,e,n,i){var a,o=r&rd,s=r&nd,c=r&id;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!qu(h))return h;var m=Ju(h);if(m){if(a=Vu(h),!o)return $u(h,a);}else{var l=Yu(h),p=l==ui||l==cd;if(Zu(h))return ju(h,o);if(l==di||l==hi||p&&!n){if(a=s||p?{}:Xu(h),!o)return s?Gu(h,Fu(a,h)):zu(h,Uu(a,h));}else{if(!Ft[l])return n?h:{};a=ku(h,l,o);}}i||(i=new Nu());var y=i.get(h);if(y)return y;i.set(h,a),_u(h)?h.forEach(function(v){a.add(Ke(v,r,t,v,h,i));}):Qu(h)&&h.forEach(function(v,T){a.set(T,Ke(v,r,t,T,h,i));});var P=c?s?Ku:Hu:s?ed:td,S=m?void 0:P(h);return Wu(S||h,function(v,T){S&&(T=v,v=h[T]),Bu(a,T,Ke(v,r,t,T,h,i));}),a;}var Rd=Ke,Id=Rd,wd=1,Ld=4;function bd(h){return Id(h,wd|Ld);}var Dd=bd,Vt=/* @__PURE__ */de(Dd);var pi="1.1.17-beta.7",Nd="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var h=window.__netlessUA||"";h+=" ".concat(Nd,"@").concat(pi),window.__netlessUA=h;}var te={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:600},bezier:{combineUnitTime:100},pencilEraser:{useBitMap:!0,maxImageWidth:1920,maxImageHeight:1920},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(ye(e),"L").concat(ye(n));var i="";for(var a=2,o=t-1;a<o;a++)e=h[a],n=h[a+1],i+=Se(e,n);return r?"M".concat(Se(h[0],h[1]),"Q").concat(ye(h[1])).concat(Se(h[1],h[2]),"T").concat(i).concat(Se(h[t-1],h[0])).concat(Se(h[0],h[1]),"Z"):"M".concat(ye(h[0]),"Q").concat(ye(h[1])).concat(Se(h[1],h[2])).concat(h.length>3?"T":"").concat(i,"L").concat(ye(h[t-1]));}var qt=/*#__PURE__*/function(){function qt(r){_classCallCheck(this,qt);tt(this,"maxImageWidth",te.pencilEraser.maxImageWidth);tt(this,"maxImageHeight",te.pencilEraser.maxImageHeight);tt(this,"syncUnitTime",te.syncOpt.interval);tt(this,"vNodes");tt(this,"drawLayer");tt(this,"fullLayer");tt(this,"workId");tt(this,"isDelete",!1);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(qt,[{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,c=r.zIndex,m=r.scale,l=r.angle,p=r.translate,y={};kt(c)&&(y.zIndex=c),s&&(y.pos=[s[0],s[1]]),m&&(y.scale=m),l&&(y.rotate=l),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-qt.SafeBorderPadding),y:Math.floor(P.y-qt.SafeBorderPadding),w:Math.floor(P.width+qt.SafeBorderPadding*2),h:Math.floor(P.height+qt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(r,t){var e=r.group,n=r.eraserlines,i=r.pos,a=r.layer,o=a.parent;if(!t)return;var c=(a.renderer.glRenderer||a.renderer.canvasRenderer).options.displayRatio,m=e.getBoundingClientRect(),l=m.width*c*a.worldScaling[0],p=m.height*c*a.worldScaling[1];var y=1;(l>this.maxImageWidth||p>this.maxImageHeight)&&(y=Math.min(this.maxImageWidth/l,this.maxImageHeight/p));var P=a.getAttribute("scale");P=[P[0]*y,P[1]*y];var S=a.parent.parent,v=a.getAttribute("translate"),T=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),S,{offscreen:o.offscreen,width:o.width,height:o.height,contextType:"2d",autoRender:!1,// desynchronized: true,
399
+ xc(c,s)))&&o.push(c);return o;}var _n=Oc,Ec=Object.prototype;function Cc(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Ec;return h===t;}var Ar=Cc;function Ac(h,r){return function(t){return h(r(t));};}var ti=Ac,Rc=ti,Ic=Rc(Object.keys,Object),wc=Ic,Lc=Ar,bc=wc,Dc=Object.prototype,Nc=Dc.hasOwnProperty;function Wc(h){if(!Lc(h))return bc(h);var r=[];for(var t in Object(h))Nc.call(h,t)&&t!="constructor"&&r.push(t);return r;}var Bc=Wc,Uc=Gn,Fc=Qn;function jc(h){return h!=null&&Fc(h.length)&&!Uc(h);}var Rr=jc,$c=_n,zc=Bc,Gc=Rr;function Hc(h){return Gc(h)?$c(h):zc(h);}var Ir=Hc,Kc=ar,Yc=Ir;function Vc(h,r){return h&&Kc(r,Yc(r),h);}var kc=Vc;function Xc(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Jc=Xc,Zc=pe,Qc=Ar,qc=Jc,_c=Object.prototype,tf=_c.hasOwnProperty;function ef(h){if(!Zc(h))return qc(h);var r=Qc(h),t=[];for(var e in h)e=="constructor"&&(r||!tf.call(h,e))||t.push(e);return t;}var rf=ef,nf=_n,sf=rf,of=Rr;function af(h){return of(h)?nf(h,!0):sf(h);}var wr=af,lf=ar,cf=wr;function ff(h,r){return h&&lf(r,cf(r),h);}var hf=ff,ke={exports:{}};ke.exports;(function(h,r){var t=se,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(c,m){if(m)return c.slice();var l=c.length,p=o?o(l):new c.constructor(l);return c.copy(p),p;}h.exports=s;})(ke,ke.exports);var uf=ke.exports;function df(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var pf=df;function gf(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 ei=gf;function mf(){return[];}var ri=mf,vf=ei,yf=ri,Sf=Object.prototype,xf=Sf.propertyIsEnumerable,rn=Object.getOwnPropertySymbols,Tf=rn?function(h){return h==null?[]:(h=Object(h),vf(rn(h),function(r){return xf.call(h,r);}));}:yf,Lr=Tf,Mf=ar,Pf=Lr;function Of(h,r){return Mf(h,Pf(h),r);}var Ef=Of;function Cf(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var br=Cf,Af=ti,Rf=Af(Object.getPrototypeOf,Object),ni=Rf,If=br,wf=ni,Lf=Lr,bf=ri,Df=Object.getOwnPropertySymbols,Nf=Df?function(h){for(var r=[];h;)If(r,Lf(h)),h=wf(h);return r;}:bf,ii=Nf,Wf=ar,Bf=ii;function Uf(h,r){return Wf(h,Bf(h),r);}var Ff=Uf,jf=br,$f=ze;function zf(h,r,t){var e=r(h);return $f(h)?e:jf(e,t(h));}var si=zf,Gf=si,Hf=Lr,Kf=Ir;function Yf(h){return Gf(h,Kf,Hf);}var oi=Yf,Vf=si,kf=ii,Xf=wr;function Jf(h){return Vf(h,Xf,kf);}var Zf=Jf,Qf=ve,qf=se,_f=Qf(qf,"DataView"),th=_f,eh=ve,rh=se,nh=eh(rh,"Promise"),ih=nh,sh=ve,oh=se,ah=sh(oh,"Set"),ai=ah,lh=ve,ch=se,fh=lh(ch,"WeakMap"),hh=fh,gr=th,mr=Or,vr=ih,yr=ai,Sr=hh,li=me,we=Hn,nn="[object Map]",uh="[object Object]",sn="[object Promise]",on="[object Set]",an="[object WeakMap]",ln="[object DataView]",dh=we(gr),ph=we(mr),gh=we(vr),mh=we(yr),vh=we(Sr),ge=li;(gr&&ge(new gr(new ArrayBuffer(1)))!=ln||mr&&ge(new mr())!=nn||vr&&ge(vr.resolve())!=sn||yr&&ge(new yr())!=on||Sr&&ge(new Sr())!=an)&&(ge=function ge(h){var r=li(h),t=r==uh?h.constructor:void 0,e=t?we(t):"";if(e)switch(e){case dh:return ln;case ph:return nn;case gh:return sn;case mh:return on;case vh:return an;}return r;});var cr=ge,yh=Object.prototype,Sh=yh.hasOwnProperty;function xh(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&Sh.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var Th=xh,Mh=se,Ph=Mh.Uint8Array,ci=Ph,cn=ci;function Oh(h){var r=new h.constructor(h.byteLength);return new cn(r).set(new cn(h)),r;}var Dr=Oh,Eh=Dr;function Ch(h,r){var t=r?Eh(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Ah=Ch,Rh=/\w*$/;function Ih(h){var r=new h.constructor(h.source,Rh.exec(h));return r.lastIndex=h.lastIndex,r;}var wh=Ih,fn=$e,hn=fn?fn.prototype:void 0,un=hn?hn.valueOf:void 0;function Lh(h){return un?Object(un.call(h)):{};}var bh=Lh,Dh=Dr;function Nh(h,r){var t=r?Dh(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var Wh=Nh,Bh=Dr,Uh=Ah,Fh=wh,jh=bh,$h=Wh,zh="[object Boolean]",Gh="[object Date]",Hh="[object Map]",Kh="[object Number]",Yh="[object RegExp]",Vh="[object Set]",kh="[object String]",Xh="[object Symbol]",Jh="[object ArrayBuffer]",Zh="[object DataView]",Qh="[object Float32Array]",qh="[object Float64Array]",_h="[object Int8Array]",tu="[object Int16Array]",eu="[object Int32Array]",ru="[object Uint8Array]",nu="[object Uint8ClampedArray]",iu="[object Uint16Array]",su="[object Uint32Array]";function ou(h,r,t){var e=h.constructor;switch(r){case Jh:return Bh(h);case zh:case Gh:return new e(+h);case Zh:return Uh(h,t);case Qh:case qh:case _h:case tu:case eu:case ru:case nu:case iu:case su:return $h(h,t);case Hh:return new e();case Kh:case kh:return new e(h);case Yh:return Fh(h);case Vh:return new e();case Xh:return jh(h);}}var au=ou,lu=pe,dn=Object.create,cu=/* @__PURE__ */function(){function h(){}return function(r){if(!lu(r))return{};if(dn)return dn(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),fu=cu,hu=fu,uu=ni,du=Ar;function pu(h){return typeof h.constructor=="function"&&!du(h)?hu(uu(h)):{};}var gu=pu,mu=cr,vu=oe,yu="[object Map]";function Su(h){return vu(h)&&mu(h)==yu;}var xu=Su,Tu=xu,Mu=lr,pn=Cr,gn=pn&&pn.isMap,Pu=gn?Mu(gn):Tu,Ou=Pu,Eu=cr,Cu=oe,Au="[object Set]";function Ru(h){return Cu(h)&&Eu(h)==Au;}var Iu=Ru,wu=Iu,Lu=lr,mn=Cr,vn=mn&&mn.isSet,bu=vn?Lu(vn):wu,fi=bu,Du=/* @__PURE__ */de(fi),Nu=Yn,Wu=sl,Bu=Xn,Uu=kc,Fu=hf,ju=uf,$u=pf,zu=Ef,Gu=Ff,Hu=oi,Ku=Zf,Yu=cr,Vu=Th,ku=au,Xu=gu,Ju=ze,Zu=Er,Qu=Ou,qu=pe,_u=fi,td=Ir,ed=wr,rd=1,nd=2,id=4,hi="[object Arguments]",sd="[object Array]",od="[object Boolean]",ad="[object Date]",ld="[object Error]",ui="[object Function]",cd="[object GeneratorFunction]",fd="[object Map]",hd="[object Number]",di="[object Object]",ud="[object RegExp]",dd="[object Set]",pd="[object String]",gd="[object Symbol]",md="[object WeakMap]",vd="[object ArrayBuffer]",yd="[object DataView]",Sd="[object Float32Array]",xd="[object Float64Array]",Td="[object Int8Array]",Md="[object Int16Array]",Pd="[object Int32Array]",Od="[object Uint8Array]",Ed="[object Uint8ClampedArray]",Cd="[object Uint16Array]",Ad="[object Uint32Array]",Ft={};Ft[hi]=Ft[sd]=Ft[vd]=Ft[yd]=Ft[od]=Ft[ad]=Ft[Sd]=Ft[xd]=Ft[Td]=Ft[Md]=Ft[Pd]=Ft[fd]=Ft[hd]=Ft[di]=Ft[ud]=Ft[dd]=Ft[pd]=Ft[gd]=Ft[Od]=Ft[Ed]=Ft[Cd]=Ft[Ad]=!0;Ft[ld]=Ft[ui]=Ft[md]=!1;function Ke(h,r,t,e,n,i){var a,o=r&rd,s=r&nd,c=r&id;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!qu(h))return h;var m=Ju(h);if(m){if(a=Vu(h),!o)return $u(h,a);}else{var l=Yu(h),p=l==ui||l==cd;if(Zu(h))return ju(h,o);if(l==di||l==hi||p&&!n){if(a=s||p?{}:Xu(h),!o)return s?Gu(h,Fu(a,h)):zu(h,Uu(a,h));}else{if(!Ft[l])return n?h:{};a=ku(h,l,o);}}i||(i=new Nu());var y=i.get(h);if(y)return y;i.set(h,a),_u(h)?h.forEach(function(v){a.add(Ke(v,r,t,v,h,i));}):Qu(h)&&h.forEach(function(v,T){a.set(T,Ke(v,r,t,T,h,i));});var P=c?s?Ku:Hu:s?ed:td,S=m?void 0:P(h);return Wu(S||h,function(v,T){S&&(T=v,v=h[T]),Bu(a,T,Ke(v,r,t,T,h,i));}),a;}var Rd=Ke,Id=Rd,wd=1,Ld=4;function bd(h){return Id(h,wd|Ld);}var Dd=bd,Vt=/* @__PURE__ */de(Dd);var pi="1.1.17-beta.8",Nd="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var h=window.__netlessUA||"";h+=" ".concat(Nd,"@").concat(pi),window.__netlessUA=h;}var te={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:600},bezier:{combineUnitTime:100},pencilEraser:{useBitMap:!0,maxImageWidth:1920,maxImageHeight:1920},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(ye(e),"L").concat(ye(n));var i="";for(var a=2,o=t-1;a<o;a++)e=h[a],n=h[a+1],i+=Se(e,n);return r?"M".concat(Se(h[0],h[1]),"Q").concat(ye(h[1])).concat(Se(h[1],h[2]),"T").concat(i).concat(Se(h[t-1],h[0])).concat(Se(h[0],h[1]),"Z"):"M".concat(ye(h[0]),"Q").concat(ye(h[1])).concat(Se(h[1],h[2])).concat(h.length>3?"T":"").concat(i,"L").concat(ye(h[t-1]));}var qt=/*#__PURE__*/function(){function qt(r){_classCallCheck(this,qt);tt(this,"maxImageWidth",te.pencilEraser.maxImageWidth);tt(this,"maxImageHeight",te.pencilEraser.maxImageHeight);tt(this,"syncUnitTime",te.syncOpt.interval);tt(this,"vNodes");tt(this,"drawLayer");tt(this,"fullLayer");tt(this,"workId");tt(this,"isDelete",!1);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(qt,[{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,c=r.zIndex,m=r.scale,l=r.angle,p=r.translate,y={};kt(c)&&(y.zIndex=c),s&&(y.pos=[s[0],s[1]]),m&&(y.scale=m),l&&(y.rotate=l),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-qt.SafeBorderPadding),y:Math.floor(P.y-qt.SafeBorderPadding),w:Math.floor(P.width+qt.SafeBorderPadding*2),h:Math.floor(P.height+qt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(r,t){var e=r.group,n=r.eraserlines,i=r.pos,a=r.layer,o=a.parent;if(!t)return;var c=(a.renderer.glRenderer||a.renderer.canvasRenderer).options.displayRatio,m=e.getBoundingClientRect(),l=m.width*c*a.worldScaling[0],p=m.height*c*a.worldScaling[1];var y=1;(l>this.maxImageWidth||p>this.maxImageHeight)&&(y=Math.min(this.maxImageWidth/l,this.maxImageHeight/p));var P=a.getAttribute("scale");P=[P[0]*y,P[1]*y];var S=a.parent.parent,v=a.getAttribute("translate"),T=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),S,{offscreen:o.offscreen,width:o.width,height:o.height,contextType:"2d",autoRender:!1,// desynchronized: true,
400
400
  bufferSize:500// depth: true,
401
401
  },P,v),f=e.cloneNode(!0);this.addEraserlines(f,n,i,!1),T.appendChild(f);var d=T.parent;d.render();var u=T.renderer.canvasRenderer,g=u.context;if(!g)return;var M=u.options.displayRatio,O=f.getBoundingClientRect(),A={x:O.x,y:O.y,w:O.width,h:O.height},L={x:0,y:0,w:S.width,h:S.height};if(We(A,L)===Qt.outside){_t(f,d),S.removeChild(d),this.isDelete=!0;return;}var w=Vt(A);w.x=Math.floor(Math.max(A.x,0)),w.y=Math.floor(Math.max(A.y,0)),w.w=Math.min(A.x+A.w,S.width)-w.x,w.h=Math.min(A.y+A.h,S.height)-w.y;var b=this.getGroupRect(w,M),I=b.x,R=b.y,W=b.w,z=b.h;var K=g.getImageData(I,R,W,z);if(this.isTransparentRectByCanvas(K)){_t(f,d),S.removeChild(d),this.isDelete=!0,K=null;return;}_t(e,o);var q=this.createSpriteNode({imageData:K,safariRect:w,originRect:A,worldScaling:T.worldScaling});q&&e.append(q),_t(f,d),S.removeChild(d),o.deleteTexture(K),K=null;}},{key:"createVmRenderNode",value:function createVmRenderNode(r,t,e,n,i){var a=e.width,o=e.height,s="bitMap-".concat(r),c=t.layer(s,e),m=new Zt({anchor:[0.5,0.5],pos:[a*0.5,o*0.5],size:[a,o],name:"viewport",id:r});return m.setAttribute("scale",n),m.setAttribute("translate",i),c.append(m),m;}},{key:"getGroupRect",value:function getGroupRect(r,t){var e=Math.floor(r.x*t),n=Math.floor(r.y*t),i=Math.floor(r.w*t),a=Math.floor(r.h*t);return{x:e,y:n,w:i,h:a};}},{key:"addEraserlines",value:function addEraserlines(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var _iterator13=_createForOfIteratorHelper(t),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var i=_step13.value;var a=i.thickness,o=i.op;var _iterator14=_createForOfIteratorHelper(o),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var s=_step14.value;var c=s.map(function(P,S){return S%2?P-e[1]:P-e[0];}),m=this.computEraserPoints(c,a),l=ae(m,!0),p={pos:[0,0],d:l,fillColor:"rgba(0,0,0,1)"},y=new le(p);y.addEventListener("beforerender",function(_ref165){var P=_ref165.detail;var S=P.context;n?S.blendFuncSeparate(S.ZERO,S.ZERO,S.ZERO,S.ZERO):S.globalCompositeOperation="destination-out";}),y.addEventListener("afterrender",function(_ref166){var P=_ref166.detail;var S=P.context;n?S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA):S.globalCompositeOperation="source-over";}),r.append(y);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}}},{key:"isTransparentRectByCanvas",value:function isTransparentRectByCanvas(r){var t=!0;for(var _e3=0;_e3<r.data.length;_e3+=4)if(r.data[_e3+3]!==0){t=!1;break;}return t;}},{key:"createSpriteNode",value:function createSpriteNode(r){var t=r.imageData,e=r.worldScaling,n=r.safariRect,i=r.originRect;var a;if(typeof OffscreenCanvas=="function"){a=new OffscreenCanvas(t.width,t.height);var m=a.getContext("2d");m&&m.putImageData(t,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){a=document.createElement("canvas"),a.width=t.width,a.height=t.height;var _m3=a.getContext("2d");_m3&&_m3.putImageData(t,0,0);}if(!a)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var o=[Math.floor(i.w/e[0]),Math.floor(i.h/e[1])],s=[Math.floor((n.x-i.x)/e[0]),Math.floor((n.y-i.y)/e[1]),Math.floor(n.w/e[0]),Math.floor(n.h/e[1])],c={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:o,texture:a,textureRect:s};return new jn(c);}},{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 c=void 0;if(o==r.length-2){var m=new xt(r[o-2],r[o-1]);c=_.Sub(s,m).uni(),i=s;}else{o===0&&(a=s);var _m4=new xt(r[o+2],r[o+3]);c=_.Sub(_m4,s).uni();}if(c){var _m5=_.Per(c).mul(t);e.push(xt.Sub(s,_m5)),n.push(xt.Add(s,_m5));}}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 a;if(!t){e&&r.append(e);return;}var n=r.getElementsByName(t);if(n.length){var _iterator15=_createForOfIteratorHelper(n),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var o=_step15.value;e?e0(e,o,r):(o.remove(),_Jt(o,r.parent));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}}else e&&r.append(e);this.fullLayer===r?(a=this.drawLayer)==null||a.getElementsByName(t).forEach(function(o){var s;o.remove(),_Jt(o,(s=_this61.drawLayer)==null?void 0:s.parent);}):this.fullLayer.getElementsByName(t).forEach(function(o){o.remove(),_Jt(o,_this61.fullLayer.parent);});}},{key:"removeDrawCountNodes",value:function removeDrawCountNodes(r,t){var e=[];r.getElementsByName(this.workId).forEach(function(n){n.id&&t&&Number(n.id)<t&&e.push(n);});for(var _i2=0,_e4=e;_i2<_e4.length;_i2++){var n=_e4[_i2];n.remove(),_Jt(n,r.parent);}}}],[{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,c=e.angle,m=e.originPoint,l=e.scenePoint,p=e.scale,y=e.pointMap,P=e.thickness;var S;var v=a&&Vt(a)||n.get(t.name);if(!v)return;kt(o)&&(t.setAttribute("zIndex",o),v.opt.zIndex=o);var T=t.parent;if(T){if(m&&p&&a){var d=[v.op[0],v.op[1]];zr(v.op,l,p,s);var u=[v.op[0],v.op[1]],g=[u[0]-d[0],u[1]-d[1]];if(v.centerPos=[v.centerPos[0]+g[0],v.centerPos[1]+g[1]],v.opt.translate=void 0,v.opt.scale=void 0,v.opt.eraserlines)for(var _i3=0,_Object$values=Object.values(v.opt.eraserlines);_i3<_Object$values.length;_i3++){var M=_Object$values[_i3];var O=M.op,A=M.thickness;M.thickness=A*Math.max(p[0],p[1]);for(var L=0;L<O.length;L++)Gr(O[L],l,p,s);}}else if(s){if(t.setAttribute("translate",s),v.opt.translate=s,a){var _d7=[s[0]*T.worldScaling[0],s[1]*T.worldScaling[1]];S=Tr(v.rect,_d7),v.rect=S;}else{var _d8=qt.getRectFromLayer(T,t.name);v.rect=_d8||v.rect;}}else if(kt(c))if(t.setAttribute("rotate",c),v.opt.rotate=c,a)S=Ii(v.rect,c),v.rect=S;else{var _d9=qt.getRectFromLayer(T,t.name);v.rect=_d9||v.rect;}if(y){var _d10=y.get(t.name);if(_d10)for(var _u10=0,_g10=0;_u10<v.op.length;_u10+=3,_g10++)v.op[_u10]=_d10[_g10][0],v.op[_u10+1]=_d10[_g10][1];}if(P&&(f=v==null?void 0:v.opt)!=null&&f.thickness&&(v.opt.thickness=P),i&&!(m&&p&&a)){if(s){var _d11=v.op.map(function(u,g){var M=g%3;return M===0?u+s[0]:M===1?u+s[1]:u;});if(v.op=_d11,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 _i4=0,_Object$values2=Object.values(v.opt.eraserlines);_i4<_Object$values2.length;_i4++){var _u11=_Object$values2[_i4];var _g11=_u11.op;for(var _M6=0;_M6<_g11.length;_M6++){var _O3=_g11[_M6].map(function(A,L){return L%2?A+s[1]:A+s[0];});_u11.op[_M6]=_O3;}}}else if(kt(c)){var _d12=v.op;if(kp(_d12,v.centerPos,c),v.op=_d12,v!=null&&v.opt&&(v.opt.rotate=void 0),v.opt.eraserlines)for(var _i5=0,_Object$values3=Object.values(v.opt.eraserlines);_i5<_Object$values3.length;_i5++){var _u12=_Object$values3[_i5];var _g12=_u12.op;for(var _M7=0;_M7<_g12.length;_M7++)Xp(_g12[_M7],v.centerPos,c);}}}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-qt.SafeBorderPadding),y:Math.floor(n.y-qt.SafeBorderPadding),w:Math.floor(n.width+qt.SafeBorderPadding*2),h:Math.floor(n.height+qt.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(r){var t=r.toolsType,e=r.opt,n=r.node,i=r.updateOpt,a=r.willSerializeData;return!!(a&&(i.angle||i.translate)||i.thickness&&e.thickness&&e.thickness!==i.thickness||i.strokeType&&e.strokeType&&e.strokeType!==i.strokeType||i.originPoint&&i.scenePoint&&i.scale||i.pointMap&&i.pointMap.has(n.name)||t===dt.Text&&(i.fontSize||i.translate||i.textInfos&&i.textInfos.get(n.name))||t===dt.Image&&(i.angle||i.translate||i.scale||i.strokeColor&&i.type===Mr.Iconify)||t===i.toolsType&&i.willRefresh||e.eraserlines&&e.eraserlines.length&&(i.strokeColor||i.fillColor));}}]);}();tt(qt,"SafeBorderPadding",10);var vt=qt;var Nr=Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50}),Object.freeze({width:48,height:74})]);var Wr={exports:{}};Wr.exports;(function(h){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(s,c){if(!i[s]){i[s]={};for(var m=0;m<s.length;m++)i[s][s.charAt(m)]=m;}return i[s][c];}var o={compressToBase64:function compressToBase64(s){if(s==null)return"";var c=o._compress(s,6,function(m){return e.charAt(m);});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"=";}},decompressFromBase64:function decompressFromBase64(s){return s==null?"":s==""?null:o._decompress(s.length,32,function(c){return a(e,s.charAt(c));});},compressToUTF16:function compressToUTF16(s){return s==null?"":o._compress(s,15,function(c){return t(c+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(s){return s==null?"":s==""?null:o._decompress(s.length,16384,function(c){return s.charCodeAt(c)-32;});},//compress into uint8array (UCS-2 big endian format)
402
402
  compressToUint8Array:function compressToUint8Array(s){for(var c=o.compress(s),m=new Uint8Array(c.length*2),l=0,p=c.length;l<p;l++){var y=c.charCodeAt(l);m[l*2]=y>>>8,m[l*2+1]=y%256;}return m;},//decompress from uint8array (UCS-2 big endian format)