@netless/appliance-plugin 1.1.17-beta.3 → 1.1.17-beta.4

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.
@@ -9,10 +9,10 @@ import Oi from "eventemitter2";
9
9
  import { cloneDeep as ft, isEqual as gt, isSet as Bt, debounce as Zi, isNumber as et, isBoolean as Yt, clone as Is, throttle as ne } from "lodash";
10
10
  import k, { useContext as Lt, useState as nt, useMemo as q, useEffect as yt, useRef as fe, useCallback as No } from "react";
11
11
  import Xi, { createPortal as Pn } from "react-dom";
12
- import Oe from "react-draggable";
12
+ import Re from "react-draggable";
13
13
  import { Resizable as Dn } from "re-resizable";
14
14
  const Jw = "/fullWorker.js", qw = "/subWorker.js";
15
- var ct = /* @__PURE__ */ ((a) => (a.selector = "selector", a.clicker = "clicker", a.laserPointer = "laserPointer", a.pencil = "pencil", a.rectangle = "rectangle", a.ellipse = "ellipse", a.shape = "shape", a.eraser = "eraser", a.pencilEraser = "pencilEraser", a.text = "text", a.straight = "straight", a.arrow = "arrow", a.hand = "hand", a.laserPen = "laserPen", a))(ct || {}), it = /* @__PURE__ */ ((a) => (a.Normal = "Normal", a.Stroke = "Stroke", a.Dotted = "Dotted", a.LongDotted = "LongDotted", a))(it || {}), ee = /* @__PURE__ */ ((a) => (a.Triangle = "triangle", a.Rhombus = "rhombus", a.Pentagram = "pentagram", a.SpeechBalloon = "speechBalloon", a.Star = "star", a.Polygon = "polygon", a))(ee || {}), B = /* @__PURE__ */ ((a) => (a.None = "None", a.ShowFloatBar = "ShowFloatBar", a.ZIndexFloatBar = "ZIndexFloatBar", a.DeleteNode = "DeleteNode", a.CopyNode = "CopyNode", a.ZIndexActive = "ZIndexActive", a.ZIndexNode = "ZIndexNode", a.RotateNode = "RotateNode", a.SetColorNode = "SetColorNode", a.TranslateNode = "TranslateNode", a.ScaleNode = "ScaleNode", a.OriginalEvent = "OriginalEvent", a.CreateScene = "CreateScene", a.ActiveCursor = "ActiveCursor", a.MoveCursor = "MoveCursor", a.CommandEditor = "CommandEditor", a.SetEditorData = "SetEditorData", a.SetFontStyle = "SetFontStyle", a.SetPoint = "SetPoint", a.SetLock = "SetLock", a.SetShapeOpt = "SetShapeOpt", a.CameraChange = "CameraChange", a.ActiveMethod = "ActiveMethod", a))(B || {}), st = /* @__PURE__ */ ((a) => (a.DisplayState = "DisplayState", a.MainEngine = "MainEngine", a.Cursor = "Cursor", a.BindMainView = "BindMainView", a))(st || {}), An = /* @__PURE__ */ ((a) => (a[a.MainView = 0] = "MainView", a[a.Plugin = 1] = "Plugin", a[a.Both = 2] = "Both", a))(An || {}), S = /* @__PURE__ */ ((a) => (a[a.Pencil = 1] = "Pencil", a[a.Eraser = 2] = "Eraser", a[a.PencilEraser = 3] = "PencilEraser", a[a.BitMapEraser = 4] = "BitMapEraser", a[a.Selector = 5] = "Selector", a[a.Clicker = 6] = "Clicker", a[a.Arrow = 7] = "Arrow", a[a.Hand = 8] = "Hand", a[a.LaserPen = 9] = "LaserPen", a[a.Text = 10] = "Text", a[a.Straight = 11] = "Straight", a[a.Rectangle = 12] = "Rectangle", a[a.Ellipse = 13] = "Ellipse", a[a.Star = 14] = "Star", a[a.Triangle = 15] = "Triangle", a[a.Rhombus = 16] = "Rhombus", a[a.Polygon = 17] = "Polygon", a[a.SpeechBalloon = 18] = "SpeechBalloon", a[a.Image = 19] = "Image", a))(S || {}), U = /* @__PURE__ */ ((a) => (a[a.Local = 1] = "Local", a[a.Service = 2] = "Service", a[a.Worker = 3] = "Worker", a))(U || {}), P = /* @__PURE__ */ ((a) => (a[a.Pending = 0] = "Pending", a[a.Start = 1] = "Start", a[a.Doing = 2] = "Doing", a[a.Done = 3] = "Done", a[a.Unwritable = 4] = "Unwritable", a))(P || {}), L = /* @__PURE__ */ ((a) => (a[a.None = 0] = "None", a[a.Init = 1] = "Init", a[a.UpdateCamera = 2] = "UpdateCamera", a[a.UpdateTools = 3] = "UpdateTools", a[a.CreateWork = 4] = "CreateWork", a[a.DrawWork = 5] = "DrawWork", a[a.FullWork = 6] = "FullWork", a[a.UpdateNode = 7] = "UpdateNode", a[a.RemoveNode = 8] = "RemoveNode", a[a.Clear = 9] = "Clear", a[a.Select = 10] = "Select", a[a.Destroy = 11] = "Destroy", a[a.Snapshot = 12] = "Snapshot", a[a.BoundingBox = 13] = "BoundingBox", a[a.Cursor = 14] = "Cursor", a[a.TextUpdate = 15] = "TextUpdate", a[a.GetTextActive = 16] = "GetTextActive", a[a.TasksQueue = 17] = "TasksQueue", a[a.CursorHover = 18] = "CursorHover", a[a.CursorBlur = 19] = "CursorBlur", a[a.Console = 20] = "Console", a[a.PriorityWorker = 21] = "PriorityWorker", a[a.PriorityMainThreadWorker = 22] = "PriorityMainThreadWorker", a[a.GetImageBitMap = 23] = "GetImageBitMap", a[a.AuthWriter = 24] = "AuthWriter", a[a.AuthReader = 25] = "AuthReader", a[a.AuthClear = 26] = "AuthClear", a[a.AuthPage = 27] = "AuthPage", a[a.GetVNodeInfo = 28] = "GetVNodeInfo", a[a.UpdateDpr = 29] = "UpdateDpr", a))(L || {}), Nt = /* @__PURE__ */ ((a) => (a[a.None = 0] = "None", a[a.Bg = 1] = "Bg", a[a.ServiceFloat = 2] = "ServiceFloat", a[a.Float = 3] = "Float", a[a.TopFloat = 4] = "TopFloat", a))(Nt || {}), si = /* @__PURE__ */ ((a) => (a[a.Cursor = 1] = "Cursor", a[a.TextCreate = 2] = "TextCreate", a))(si || {}), ni = /* @__PURE__ */ ((a) => (a[a.Top = 1] = "Top", a[a.Bottom = 2] = "Bottom", a))(ni || {}), lt = /* @__PURE__ */ ((a) => (a[a.none = 1] = "none", a[a.all = 2] = "all", a[a.both = 3] = "both", a[a.proportional = 4] = "proportional", a))(lt || {}), jn = /* @__PURE__ */ ((a) => (a[a.Pending = 0] = "Pending", a[a.Start = 1] = "Start", a[a.Doing = 2] = "Doing", a[a.Done = 3] = "Done", a[a.Unwritable = 4] = "Unwritable", a))(jn || {}), Ae = /* @__PURE__ */ ((a) => (a[a.inside = 0] = "inside", a[a.outside = 1] = "outside", a[a.intersect = 2] = "intersect", a))(Ae || {}), Ot = /* @__PURE__ */ ((a) => (a.renderPage = "renderPage", a.addPage = "addPage", a.deletePage = "deletePage", a.addElement = "addElement", a.deleteElement = "deleteElement", a.clearPage = "clearPage", a.clearViewScenePath = "clearViewScenePath", a.clearView = "clearView", a))(Ot || {}), se = /* @__PURE__ */ ((a) => (a.setAuth = "setAuth", a.setShow = "addShow", a.setHide = "setHide", a.setClear = "setClear", a))(se || {}), je = /* @__PURE__ */ ((a) => (a.Image = "image", a.Iconify = "iconify", a))(je || {});
15
+ var ct = /* @__PURE__ */ ((a) => (a.selector = "selector", a.clicker = "clicker", a.laserPointer = "laserPointer", a.pencil = "pencil", a.rectangle = "rectangle", a.ellipse = "ellipse", a.shape = "shape", a.eraser = "eraser", a.pencilEraser = "pencilEraser", a.text = "text", a.straight = "straight", a.arrow = "arrow", a.hand = "hand", a.laserPen = "laserPen", a))(ct || {}), it = /* @__PURE__ */ ((a) => (a.Normal = "Normal", a.Stroke = "Stroke", a.Dotted = "Dotted", a.LongDotted = "LongDotted", a))(it || {}), ee = /* @__PURE__ */ ((a) => (a.Triangle = "triangle", a.Rhombus = "rhombus", a.Pentagram = "pentagram", a.SpeechBalloon = "speechBalloon", a.Star = "star", a.Polygon = "polygon", a))(ee || {}), B = /* @__PURE__ */ ((a) => (a.None = "None", a.ShowFloatBar = "ShowFloatBar", a.ZIndexFloatBar = "ZIndexFloatBar", a.DeleteNode = "DeleteNode", a.CopyNode = "CopyNode", a.ZIndexActive = "ZIndexActive", a.ZIndexNode = "ZIndexNode", a.RotateNode = "RotateNode", a.SetColorNode = "SetColorNode", a.TranslateNode = "TranslateNode", a.ScaleNode = "ScaleNode", a.OriginalEvent = "OriginalEvent", a.CreateScene = "CreateScene", a.ActiveCursor = "ActiveCursor", a.MoveCursor = "MoveCursor", a.CommandEditor = "CommandEditor", a.SetEditorData = "SetEditorData", a.SetFontStyle = "SetFontStyle", a.SetPoint = "SetPoint", a.SetLock = "SetLock", a.SetShapeOpt = "SetShapeOpt", a.CameraChange = "CameraChange", a.ActiveMethod = "ActiveMethod", a))(B || {}), st = /* @__PURE__ */ ((a) => (a.DisplayState = "DisplayState", a.MainEngine = "MainEngine", a.Cursor = "Cursor", a.BindMainView = "BindMainView", a))(st || {}), An = /* @__PURE__ */ ((a) => (a[a.MainView = 0] = "MainView", a[a.Plugin = 1] = "Plugin", a[a.Both = 2] = "Both", a))(An || {}), S = /* @__PURE__ */ ((a) => (a[a.Pencil = 1] = "Pencil", a[a.Eraser = 2] = "Eraser", a[a.PencilEraser = 3] = "PencilEraser", a[a.BitMapEraser = 4] = "BitMapEraser", a[a.Selector = 5] = "Selector", a[a.Clicker = 6] = "Clicker", a[a.Arrow = 7] = "Arrow", a[a.Hand = 8] = "Hand", a[a.LaserPen = 9] = "LaserPen", a[a.Text = 10] = "Text", a[a.Straight = 11] = "Straight", a[a.Rectangle = 12] = "Rectangle", a[a.Ellipse = 13] = "Ellipse", a[a.Star = 14] = "Star", a[a.Triangle = 15] = "Triangle", a[a.Rhombus = 16] = "Rhombus", a[a.Polygon = 17] = "Polygon", a[a.SpeechBalloon = 18] = "SpeechBalloon", a[a.Image = 19] = "Image", a))(S || {}), U = /* @__PURE__ */ ((a) => (a[a.Local = 1] = "Local", a[a.Service = 2] = "Service", a[a.Worker = 3] = "Worker", a))(U || {}), P = /* @__PURE__ */ ((a) => (a[a.Pending = 0] = "Pending", a[a.Start = 1] = "Start", a[a.Doing = 2] = "Doing", a[a.Done = 3] = "Done", a[a.Unwritable = 4] = "Unwritable", a))(P || {}), L = /* @__PURE__ */ ((a) => (a[a.None = 0] = "None", a[a.Init = 1] = "Init", a[a.UpdateCamera = 2] = "UpdateCamera", a[a.UpdateTools = 3] = "UpdateTools", a[a.CreateWork = 4] = "CreateWork", a[a.DrawWork = 5] = "DrawWork", a[a.FullWork = 6] = "FullWork", a[a.UpdateNode = 7] = "UpdateNode", a[a.RemoveNode = 8] = "RemoveNode", a[a.Clear = 9] = "Clear", a[a.Select = 10] = "Select", a[a.Destroy = 11] = "Destroy", a[a.Snapshot = 12] = "Snapshot", a[a.BoundingBox = 13] = "BoundingBox", a[a.Cursor = 14] = "Cursor", a[a.TextUpdate = 15] = "TextUpdate", a[a.GetTextActive = 16] = "GetTextActive", a[a.TasksQueue = 17] = "TasksQueue", a[a.CursorHover = 18] = "CursorHover", a[a.CursorBlur = 19] = "CursorBlur", a[a.Console = 20] = "Console", a[a.PriorityWorker = 21] = "PriorityWorker", a[a.PriorityMainThreadWorker = 22] = "PriorityMainThreadWorker", a[a.GetImageBitMap = 23] = "GetImageBitMap", a[a.AuthWriter = 24] = "AuthWriter", a[a.AuthReader = 25] = "AuthReader", a[a.AuthClear = 26] = "AuthClear", a[a.AuthPage = 27] = "AuthPage", a[a.GetVNodeInfo = 28] = "GetVNodeInfo", a[a.UpdateDpr = 29] = "UpdateDpr", a))(L || {}), Nt = /* @__PURE__ */ ((a) => (a[a.None = 0] = "None", a[a.Bg = 1] = "Bg", a[a.ServiceFloat = 2] = "ServiceFloat", a[a.Float = 3] = "Float", a[a.TopFloat = 4] = "TopFloat", a))(Nt || {}), si = /* @__PURE__ */ ((a) => (a[a.Cursor = 1] = "Cursor", a[a.TextCreate = 2] = "TextCreate", a))(si || {}), ni = /* @__PURE__ */ ((a) => (a[a.Top = 1] = "Top", a[a.Bottom = 2] = "Bottom", a))(ni || {}), lt = /* @__PURE__ */ ((a) => (a[a.none = 1] = "none", a[a.all = 2] = "all", a[a.both = 3] = "both", a[a.proportional = 4] = "proportional", a))(lt || {}), jn = /* @__PURE__ */ ((a) => (a[a.Pending = 0] = "Pending", a[a.Start = 1] = "Start", a[a.Doing = 2] = "Doing", a[a.Done = 3] = "Done", a[a.Unwritable = 4] = "Unwritable", a))(jn || {}), je = /* @__PURE__ */ ((a) => (a[a.inside = 0] = "inside", a[a.outside = 1] = "outside", a[a.intersect = 2] = "intersect", a))(je || {}), Ot = /* @__PURE__ */ ((a) => (a.renderPage = "renderPage", a.addPage = "addPage", a.deletePage = "deletePage", a.addElement = "addElement", a.deleteElement = "deleteElement", a.clearPage = "clearPage", a.clearViewScenePath = "clearViewScenePath", a.clearView = "clearView", a))(Ot || {}), se = /* @__PURE__ */ ((a) => (a.setAuth = "setAuth", a.setShow = "addShow", a.setHide = "setHide", a.setClear = "setClear", a))(se || {}), Ee = /* @__PURE__ */ ((a) => (a.Image = "image", a.Iconify = "iconify", a))(Ee || {});
16
16
  const En = {
17
17
  linear: (a) => a,
18
18
  easeInQuad: (a) => a * a,
@@ -494,19 +494,19 @@ class F extends C {
494
494
  }
495
495
  }
496
496
  var _e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
497
- function Re(a) {
497
+ function We(a) {
498
498
  return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
499
499
  }
500
- var Rn = typeof _e == "object" && _e && _e.Object === Object && _e, So = Rn, Wn = So, Yn = typeof self == "object" && self && self.Object === Object && self, Un = Wn || Yn || Function("return this")(), te = Un, Bn = te, Fn = Bn.Symbol, Je = Fn, Ns = Je, To = Object.prototype, Vn = To.hasOwnProperty, $n = To.toString, $e = Ns ? Ns.toStringTag : void 0;
500
+ var Rn = typeof _e == "object" && _e && _e.Object === Object && _e, So = Rn, Wn = So, Yn = typeof self == "object" && self && self.Object === Object && self, Un = Wn || Yn || Function("return this")(), te = Un, Bn = te, Fn = Bn.Symbol, Je = Fn, Ns = Je, To = Object.prototype, Vn = To.hasOwnProperty, $n = To.toString, He = Ns ? Ns.toStringTag : void 0;
501
501
  function Hn(a) {
502
- var i = Vn.call(a, $e), t = a[$e];
502
+ var i = Vn.call(a, He), t = a[He];
503
503
  try {
504
- a[$e] = void 0;
504
+ a[He] = void 0;
505
505
  var e = !0;
506
506
  } catch {
507
507
  }
508
508
  var s = $n.call(a);
509
- return e && (i ? a[$e] = t : delete a[$e]), s;
509
+ return e && (i ? a[He] = t : delete a[He]), s;
510
510
  }
511
511
  var Qn = Hn, Gn = Object.prototype, Zn = Gn.toString;
512
512
  function Xn(a) {
@@ -525,7 +525,7 @@ function rr(a) {
525
525
  return typeof a == "number" || or(a) && sr(a) == nr;
526
526
  }
527
527
  var ar = rr;
528
- const Rt = /* @__PURE__ */ Re(ar);
528
+ const Rt = /* @__PURE__ */ We(ar);
529
529
  function cr() {
530
530
  this.__data__ = [], this.size = 0;
531
531
  }
@@ -563,19 +563,19 @@ function kr(a, i) {
563
563
  return e < 0 ? (++this.size, t.push([a, i])) : t[e][1] = i, this;
564
564
  }
565
565
  var Cr = kr, xr = lr, br = Mr, Lr = vr, zr = Sr, Pr = Cr;
566
- function We(a) {
566
+ function Ye(a) {
567
567
  var i = -1, t = a == null ? 0 : a.length;
568
568
  for (this.clear(); ++i < t; ) {
569
569
  var e = a[i];
570
570
  this.set(e[0], e[1]);
571
571
  }
572
572
  }
573
- We.prototype.clear = xr;
574
- We.prototype.delete = br;
575
- We.prototype.get = Lr;
576
- We.prototype.has = zr;
577
- We.prototype.set = Pr;
578
- var wi = We, Dr = wi;
573
+ Ye.prototype.clear = xr;
574
+ Ye.prototype.delete = br;
575
+ Ye.prototype.get = Lr;
576
+ Ye.prototype.has = zr;
577
+ Ye.prototype.set = Pr;
578
+ var wi = Ye, Dr = wi;
579
579
  function Ar() {
580
580
  this.__data__ = new Dr(), this.size = 0;
581
581
  }
@@ -672,19 +672,19 @@ function Va(a, i) {
672
672
  return this.size += this.has(a) ? 0 : 1, t[a] = Ba && i === void 0 ? Fa : i, this;
673
673
  }
674
674
  var $a = Va, Ha = xa, Qa = La, Ga = Ea, Za = Ua, Xa = $a;
675
- function Ye(a) {
675
+ function Ue(a) {
676
676
  var i = -1, t = a == null ? 0 : a.length;
677
677
  for (this.clear(); ++i < t; ) {
678
678
  var e = a[i];
679
679
  this.set(e[0], e[1]);
680
680
  }
681
681
  }
682
- Ye.prototype.clear = Ha;
683
- Ye.prototype.delete = Qa;
684
- Ye.prototype.get = Ga;
685
- Ye.prototype.has = Za;
686
- Ye.prototype.set = Xa;
687
- var Ja = Ye, xs = Ja, qa = wi, Ka = qi;
682
+ Ue.prototype.clear = Ha;
683
+ Ue.prototype.delete = Qa;
684
+ Ue.prototype.get = Ga;
685
+ Ue.prototype.has = Za;
686
+ Ue.prototype.set = Xa;
687
+ var Ja = Ue, xs = Ja, qa = wi, Ka = qi;
688
688
  function _a() {
689
689
  this.size = 0, this.__data__ = {
690
690
  hash: new xs(),
@@ -721,19 +721,19 @@ function gc(a, i) {
721
721
  return t.set(a, i), this.size += t.size == e ? 0 : 1, this;
722
722
  }
723
723
  var yc = gc, Mc = tc, mc = ac, wc = hc, vc = pc, Ic = yc;
724
- function Ue(a) {
724
+ function Be(a) {
725
725
  var i = -1, t = a == null ? 0 : a.length;
726
726
  for (this.clear(); ++i < t; ) {
727
727
  var e = a[i];
728
728
  this.set(e[0], e[1]);
729
729
  }
730
730
  }
731
- Ue.prototype.clear = Mc;
732
- Ue.prototype.delete = mc;
733
- Ue.prototype.get = wc;
734
- Ue.prototype.has = vc;
735
- Ue.prototype.set = Ic;
736
- var xo = Ue, Nc = wi, Sc = qi, Tc = xo, kc = 200;
731
+ Be.prototype.clear = Mc;
732
+ Be.prototype.delete = mc;
733
+ Be.prototype.get = wc;
734
+ Be.prototype.has = vc;
735
+ Be.prototype.set = Ic;
736
+ var xo = Be, Nc = wi, Sc = qi, Tc = xo, kc = 200;
737
737
  function Cc(a, i) {
738
738
  var t = this.__data__;
739
739
  if (t instanceof Nc) {
@@ -745,16 +745,16 @@ function Cc(a, i) {
745
745
  return t.set(a, i), this.size = t.size, this;
746
746
  }
747
747
  var xc = Cc, bc = wi, Lc = jr, zc = Or, Pc = Wr, Dc = Ur, Ac = xc;
748
- function Be(a) {
748
+ function Fe(a) {
749
749
  var i = this.__data__ = new bc(a);
750
750
  this.size = i.size;
751
751
  }
752
- Be.prototype.clear = Lc;
753
- Be.prototype.delete = zc;
754
- Be.prototype.get = Pc;
755
- Be.prototype.has = Dc;
756
- Be.prototype.set = Ac;
757
- var bo = Be;
752
+ Fe.prototype.clear = Lc;
753
+ Fe.prototype.delete = zc;
754
+ Fe.prototype.get = Pc;
755
+ Fe.prototype.has = Dc;
756
+ Fe.prototype.set = Ac;
757
+ var bo = Fe;
758
758
  function jc(a, i) {
759
759
  for (var t = -1, e = a == null ? 0 : a.length; ++t < e && i(a[t], t, a) !== !1; )
760
760
  ;
@@ -981,9 +981,9 @@ var Vo = vu, Iu = Fo, Nu = Bo, Su = ss;
981
981
  function Tu(a) {
982
982
  return Iu(a, Su, Nu);
983
983
  }
984
- var ku = Tu, Cu = Se, xu = te, bu = Cu(xu, "DataView"), Lu = bu, zu = Se, Pu = te, Du = zu(Pu, "Promise"), Au = Du, ju = Se, Eu = te, Ou = ju(Eu, "Set"), $o = Ou, Ru = Se, Wu = te, Yu = Ru(Wu, "WeakMap"), Uu = Yu, Ri = Lu, Wi = qi, Yi = Au, Ui = $o, Bi = Uu, Ho = Ne, Fe = Co, As = "[object Map]", Bu = "[object Object]", js = "[object Promise]", Es = "[object Set]", Os = "[object WeakMap]", Rs = "[object DataView]", Fu = Fe(Ri), Vu = Fe(Wi), $u = Fe(Yi), Hu = Fe(Ui), Qu = Fe(Bi), Me = Ho;
984
+ var ku = Tu, Cu = Se, xu = te, bu = Cu(xu, "DataView"), Lu = bu, zu = Se, Pu = te, Du = zu(Pu, "Promise"), Au = Du, ju = Se, Eu = te, Ou = ju(Eu, "Set"), $o = Ou, Ru = Se, Wu = te, Yu = Ru(Wu, "WeakMap"), Uu = Yu, Ri = Lu, Wi = qi, Yi = Au, Ui = $o, Bi = Uu, Ho = Ne, Ve = Co, As = "[object Map]", Bu = "[object Object]", js = "[object Promise]", Es = "[object Set]", Os = "[object WeakMap]", Rs = "[object DataView]", Fu = Ve(Ri), Vu = Ve(Wi), $u = Ve(Yi), Hu = Ve(Ui), Qu = Ve(Bi), Me = Ho;
985
985
  (Ri && Me(new Ri(new ArrayBuffer(1))) != Rs || Wi && Me(new Wi()) != As || Yi && Me(Yi.resolve()) != js || Ui && Me(new Ui()) != Es || Bi && Me(new Bi()) != Os) && (Me = function(a) {
986
- var i = Ho(a), t = i == Bu ? a.constructor : void 0, e = t ? Fe(t) : "";
986
+ var i = Ho(a), t = i == Bu ? a.constructor : void 0, e = t ? Ve(t) : "";
987
987
  if (e)
988
988
  switch (e) {
989
989
  case Fu:
@@ -1087,7 +1087,7 @@ function sp(a) {
1087
1087
  return ep(a) && tp(a) == ip;
1088
1088
  }
1089
1089
  var op = sp, np = op, rp = Si, Hs = _i, Qs = Hs && Hs.isSet, ap = Qs ? rp(Qs) : np, Go = ap;
1090
- const cp = /* @__PURE__ */ Re(Go);
1090
+ const cp = /* @__PURE__ */ We(Go);
1091
1091
  var lp = bo, hp = Ec, up = Po, dp = Sh, pp = Uh, fp = Bh, gp = Vh, yp = tu, Mp = pu, mp = Vo, wp = ku, vp = Ti, Ip = Ju, Np = Od, Sp = $d, Tp = qe, kp = Ki, Cp = _d, xp = ge, bp = Go, Lp = is, zp = ss, Pp = 1, Dp = 2, Ap = 4, Zo = "[object Arguments]", jp = "[object Array]", Ep = "[object Boolean]", Op = "[object Date]", Rp = "[object Error]", Xo = "[object Function]", Wp = "[object GeneratorFunction]", Yp = "[object Map]", Up = "[object Number]", Jo = "[object Object]", Bp = "[object RegExp]", Fp = "[object Set]", Vp = "[object String]", $p = "[object Symbol]", Hp = "[object WeakMap]", Qp = "[object ArrayBuffer]", Gp = "[object DataView]", Zp = "[object Float32Array]", Xp = "[object Float64Array]", Jp = "[object Int8Array]", qp = "[object Int16Array]", Kp = "[object Int32Array]", _p = "[object Uint8Array]", tf = "[object Uint8ClampedArray]", ef = "[object Uint16Array]", sf = "[object Uint32Array]", vt = {};
1092
1092
  vt[Zo] = vt[jp] = vt[Qp] = vt[Gp] = vt[Ep] = vt[Op] = vt[Zp] = vt[Xp] = vt[Jp] = vt[qp] = vt[Kp] = vt[Yp] = vt[Up] = vt[Jo] = vt[Bp] = vt[Fp] = vt[Vp] = vt[$p] = vt[_p] = vt[tf] = vt[ef] = vt[sf] = !0;
1093
1093
  vt[Rp] = vt[Xo] = vt[Hp] = !1;
@@ -1133,7 +1133,7 @@ function cf(a) {
1133
1133
  return nf(a, rf | af);
1134
1134
  }
1135
1135
  var lf = cf;
1136
- const zt = /* @__PURE__ */ Re(lf), qo = "1.1.17-beta.3", hf = "@netless/appliance-plugin", as = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1136
+ const zt = /* @__PURE__ */ We(lf), qo = "1.1.17-beta.4", hf = "@netless/appliance-plugin", as = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1137
1137
  if (typeof window < "u") {
1138
1138
  let a = window.__netlessUA || "";
1139
1139
  a += ` ${hf}@${qo}`, window.__netlessUA = a;
@@ -1287,7 +1287,7 @@ const Vt = class Vt {
1287
1287
  w: p.width,
1288
1288
  h: p.height
1289
1289
  };
1290
- if (mn(b, z) === Ae.outside) {
1290
+ if (mn(b, z) === je.outside) {
1291
1291
  Qt(v, N), p.removeChild(N), this.isDelete = !0;
1292
1292
  return;
1293
1293
  }
@@ -1527,7 +1527,7 @@ const Vt = class Vt {
1527
1527
  }
1528
1528
  static isWillRefresh(i) {
1529
1529
  const { toolsType: t, opt: e, node: s, updateOpt: o, willSerializeData: n } = i;
1530
- return !!(n && (o.angle || o.translate) || o.thickness && e.thickness && e.thickness !== o.thickness || o.strokeType && e.strokeType && e.strokeType !== o.strokeType || o.originPoint && o.scenePoint && o.scale || o.pointMap && o.pointMap.has(s.name) || t === S.Text && (o.fontSize || o.translate || o.textInfos && o.textInfos.get(s.name)) || t === S.Image && (o.angle || o.translate || o.scale || o.strokeColor && o.type === je.Iconify) || t === o.toolsType && o.willRefresh || e.eraserlines && e.eraserlines.length && (o.strokeColor || o.fillColor));
1530
+ return !!(n && (o.angle || o.translate) || o.thickness && e.thickness && e.thickness !== o.thickness || o.strokeType && e.strokeType && e.strokeType !== o.strokeType || o.originPoint && o.scenePoint && o.scale || o.pointMap && o.pointMap.has(s.name) || t === S.Text && (o.fontSize || o.translate || o.textInfos && o.textInfos.get(s.name)) || t === S.Image && (o.angle || o.translate || o.scale || o.strokeColor && o.type === Ee.Iconify) || t === o.toolsType && o.willRefresh || e.eraserlines && e.eraserlines.length && (o.strokeColor || o.fillColor));
1531
1531
  }
1532
1532
  };
1533
1533
  y(Vt, "SafeBorderPadding", 10);
@@ -2202,7 +2202,7 @@ class _o extends W {
2202
2202
  }), s.length && s.forEach((o) => o.remove()), e;
2203
2203
  }
2204
2204
  }
2205
- const Le = class Le extends W {
2205
+ const ze = class ze extends W {
2206
2206
  constructor(t, e) {
2207
2207
  super(t);
2208
2208
  y(this, "canRotate", !1);
@@ -2225,7 +2225,7 @@ const Le = class Le extends W {
2225
2225
  super.setWorkOptions(t);
2226
2226
  }
2227
2227
  createEraserRect(t) {
2228
- const e = t[0] * this.worldScaling[0] + this.worldPosition[0], s = t[1] * this.worldScaling[1] + this.worldPosition[1], { width: o, height: n } = Le.eraserSizes[this.workOptions.thickness];
2228
+ const e = t[0] * this.worldScaling[0] + this.worldPosition[0], s = t[1] * this.worldScaling[1] + this.worldPosition[1], { width: o, height: n } = ze.eraserSizes[this.workOptions.thickness];
2229
2229
  this.eraserRect = {
2230
2230
  x: e - o * 0.5,
2231
2231
  y: s - n * 0.5,
@@ -2236,7 +2236,7 @@ const Le = class Le extends W {
2236
2236
  computRectCenterPoints() {
2237
2237
  const t = this.tmpPoints.slice(-2);
2238
2238
  if (this.tmpPoints.length === 4) {
2239
- const e = new C(this.tmpPoints[0], this.tmpPoints[1]), s = new C(this.tmpPoints[2], this.tmpPoints[3]), o = C.Sub(s, e).uni(), n = C.Dist(e, s), { width: r, height: c } = Le.eraserSizes[this.workOptions.thickness], l = Math.min(r, c), u = Math.round(n / l);
2239
+ const e = new C(this.tmpPoints[0], this.tmpPoints[1]), s = new C(this.tmpPoints[2], this.tmpPoints[3]), o = C.Sub(s, e).uni(), n = C.Dist(e, s), { width: r, height: c } = ze.eraserSizes[this.workOptions.thickness], l = Math.min(r, c), u = Math.round(n / l);
2240
2240
  if (u > 1) {
2241
2241
  const h = [];
2242
2242
  for (let d = 0; d < u; d++) {
@@ -2249,7 +2249,7 @@ const Le = class Le extends W {
2249
2249
  return t;
2250
2250
  }
2251
2251
  isNear(t, e) {
2252
- const s = new C(t[0], t[1]), o = new C(e[0], e[1]), { width: n, height: r } = Le.eraserSizes[this.workOptions.thickness];
2252
+ const s = new C(t[0], t[1]), o = new C(e[0], e[1]), { width: n, height: r } = ze.eraserSizes[this.workOptions.thickness];
2253
2253
  return C.Dist(s, o) < Math.hypot(n, r) * 0.5;
2254
2254
  }
2255
2255
  remove(t) {
@@ -2333,8 +2333,8 @@ const Le = class Le extends W {
2333
2333
  }
2334
2334
  };
2335
2335
  // 来源于white-sdk
2336
- y(Le, "eraserSizes", cs);
2337
- let li = Le;
2336
+ y(ze, "eraserSizes", cs);
2337
+ let li = ze;
2338
2338
  const $t = "++", H = "selector", Li = "all";
2339
2339
  var uf = "__lodash_hash_undefined__";
2340
2340
  function df(a) {
@@ -2509,7 +2509,7 @@ function dg(a, i) {
2509
2509
  return ug(a, i);
2510
2510
  }
2511
2511
  var pg = dg;
2512
- const Ie = /* @__PURE__ */ Re(pg), Mi = class Mi extends W {
2512
+ const Ie = /* @__PURE__ */ We(pg), Mi = class Mi extends W {
2513
2513
  constructor(t) {
2514
2514
  super(t);
2515
2515
  y(this, "toolsType", S.Selector);
@@ -3216,7 +3216,7 @@ class on extends W {
3216
3216
  w: Math.floor(f.width),
3217
3217
  h: Math.floor(f.height)
3218
3218
  };
3219
- if (mn(h, g) !== Ae.outside) {
3219
+ if (mn(h, g) !== je.outside) {
3220
3220
  const M = dt(h, this.oldRect);
3221
3221
  return this.oldRect = h, {
3222
3222
  rect: M,
@@ -4243,7 +4243,7 @@ function Mg(a) {
4243
4243
  return a === !0 || a === !1 || gg(a) && fg(a) == yg;
4244
4244
  }
4245
4245
  var mg = Mg;
4246
- const be = /* @__PURE__ */ Re(mg);
4246
+ const Le = /* @__PURE__ */ We(mg);
4247
4247
  class ln extends W {
4248
4248
  constructor(t) {
4249
4249
  super(t);
@@ -4505,7 +4505,7 @@ const de = class de extends W {
4505
4505
  const s = this.workId.toString(), { fontColor: o, fontBgColor: n, bold: r, italic: c, lineThrough: l, underline: u, zIndex: h } = t, d = (g = this.vNodes) == null ? void 0 : g.get(s);
4506
4506
  if (!d)
4507
4507
  return;
4508
- o && (d.opt.fontColor = o), n && (d.opt.fontBgColor = n), r && (d.opt.bold = r), c && (d.opt.italic = c), be(l) && (d.opt.lineThrough = l), be(u) && (d.opt.underline = u), Rt(h) && (d.opt.zIndex = h), this.oldRect = d.rect;
4508
+ o && (d.opt.fontColor = o), n && (d.opt.fontBgColor = n), r && (d.opt.bold = r), c && (d.opt.italic = c), Le(l) && (d.opt.lineThrough = l), Le(u) && (d.opt.underline = u), Rt(h) && (d.opt.zIndex = h), this.oldRect = d.rect;
4509
4509
  const f = await this.draw({
4510
4510
  workId: s,
4511
4511
  layer: this.fullLayer,
@@ -4634,7 +4634,7 @@ const de = class de extends W {
4634
4634
  });
4635
4635
  })), r && m.fontBgColor && (m.fontBgColor = r, e.children.forEach((x) => {
4636
4636
  x.tagName === "GROUP" && x.setAttribute("bgcolor", r);
4637
- })), f && (m.bold = f), g && (m.italic = g), be(p) && (m.lineThrough = p), be(M) && (m.underline = M), I && (m.fontSize = I), u && h && d && n && m.boxPoint) {
4637
+ })), f && (m.bold = f), g && (m.italic = g), Le(p) && (m.lineThrough = p), Le(M) && (m.underline = M), I && (m.fontSize = I), u && h && d && n && m.boxPoint) {
4638
4638
  const x = v == null ? void 0 : v.get(e.name);
4639
4639
  if (x) {
4640
4640
  const { fontSize: O, boxSize: E } = x;
@@ -4687,7 +4687,7 @@ const de = class de extends W {
4687
4687
  // 4k
4688
4688
  y(de, "textImageSnippetSize", 1024 * 4), y(de, "SafeBorderPadding", 30);
4689
4689
  let di = de;
4690
- const ze = class ze extends W {
4690
+ const Pe = class Pe extends W {
4691
4691
  constructor(t, e) {
4692
4692
  super(t);
4693
4693
  y(this, "canRotate", !1);
@@ -4705,7 +4705,7 @@ const ze = class ze extends W {
4705
4705
  consumeService() {
4706
4706
  }
4707
4707
  createEraserRect(t) {
4708
- const e = t[0] * this.worldScaling[0] + this.worldPosition[0], s = t[1] * this.worldScaling[1] + this.worldPosition[1], { width: o, height: n } = ze.eraserSizes[this.workOptions.thickness];
4708
+ const e = t[0] * this.worldScaling[0] + this.worldPosition[0], s = t[1] * this.worldScaling[1] + this.worldPosition[1], { width: o, height: n } = Pe.eraserSizes[this.workOptions.thickness];
4709
4709
  this.eraserRect = {
4710
4710
  x: e - o * 0.5,
4711
4711
  y: s - n * 0.5,
@@ -4716,7 +4716,7 @@ const ze = class ze extends W {
4716
4716
  computRectCenterPoints() {
4717
4717
  const t = this.tmpPoints.slice(-2);
4718
4718
  if (this.tmpPoints.length === 4) {
4719
- const e = new C(this.tmpPoints[0], this.tmpPoints[1]), s = new C(this.tmpPoints[2], this.tmpPoints[3]), o = C.Sub(s, e).uni(), n = C.Dist(e, s), { width: r, height: c } = ze.eraserSizes[this.workOptions.thickness], l = Math.min(r, c), u = Math.round(n / l);
4719
+ const e = new C(this.tmpPoints[0], this.tmpPoints[1]), s = new C(this.tmpPoints[2], this.tmpPoints[3]), o = C.Sub(s, e).uni(), n = C.Dist(e, s), { width: r, height: c } = Pe.eraserSizes[this.workOptions.thickness], l = Math.min(r, c), u = Math.round(n / l);
4720
4720
  if (u > 1) {
4721
4721
  const h = [];
4722
4722
  for (let d = 0; d < u; d++) {
@@ -4729,7 +4729,7 @@ const ze = class ze extends W {
4729
4729
  return t;
4730
4730
  }
4731
4731
  isNear(t, e) {
4732
- const s = new C(t[0], t[1]), o = new C(e[0], e[1]), { width: n, height: r } = ze.eraserSizes[this.workOptions.thickness];
4732
+ const s = new C(t[0], t[1]), o = new C(e[0], e[1]), { width: n, height: r } = Pe.eraserSizes[this.workOptions.thickness];
4733
4733
  return C.Dist(s, o) < Math.hypot(n, r) * 0.5;
4734
4734
  }
4735
4735
  cutPolyline(t, e) {
@@ -4894,9 +4894,9 @@ const ze = class ze extends W {
4894
4894
  }
4895
4895
  };
4896
4896
  // 来源于white-sdk
4897
- y(ze, "eraserSizes", cs);
4898
- let pi = ze;
4899
- const Pe = class Pe extends W {
4897
+ y(Pe, "eraserSizes", cs);
4898
+ let pi = Pe;
4899
+ const De = class De extends W {
4900
4900
  constructor(t) {
4901
4901
  super(t);
4902
4902
  y(this, "canRotate", !1);
@@ -4919,7 +4919,7 @@ const Pe = class Pe extends W {
4919
4919
  return {
4920
4920
  type: L.None
4921
4921
  };
4922
- const { thickness: t } = this.workOptions, { width: e, height: s } = Pe.eraserSizes[t], o = Math.max(e, s) / this.worldScaling[0], n = this.drawLayer || this.fullLayer, r = this.workId, c = {
4922
+ const { thickness: t } = this.workOptions, { width: e, height: s } = De.eraserSizes[t], o = Math.max(e, s) / this.worldScaling[0], n = this.drawLayer || this.fullLayer, r = this.workId, c = {
4923
4923
  name: r
4924
4924
  };
4925
4925
  return {
@@ -5022,7 +5022,7 @@ const Pe = class Pe extends W {
5022
5022
  type: L.None,
5023
5023
  ...this.baseConsumeResult
5024
5024
  };
5025
- const { thickness: u } = this.workOptions, { width: h, height: d } = Pe.eraserSizes[u], f = Math.max(h, d) / this.worldScaling[0], g = this.tmpPoints.length, p = this.tmpPoints[this.tmpPoints.length - 1], M = this.updateTempPoints(l, f), I = this.tmpPoints[this.tmpPoints.length - 1];
5025
+ const { thickness: u } = this.workOptions, { width: h, height: d } = De.eraserSizes[u], f = Math.max(h, d) / this.worldScaling[0], g = this.tmpPoints.length, p = this.tmpPoints[this.tmpPoints.length - 1], M = this.updateTempPoints(l, f), I = this.tmpPoints[this.tmpPoints.length - 1];
5026
5026
  if (g === this.tmpPoints.length && I.equalsXY(p.x, p.y))
5027
5027
  return {
5028
5028
  type: L.None,
@@ -5078,7 +5078,7 @@ const Pe = class Pe extends W {
5078
5078
  pos: [0, 0],
5079
5079
  anchor: [0.5, 0.5],
5080
5080
  zIndex: 9999,
5081
- bgcolor: "rgba(136,136,136,0.3)"
5081
+ bgcolor: this.workOptions.eraserColor
5082
5082
  }), h = this.computEraserPointLines(s), d = [];
5083
5083
  for (const f of h)
5084
5084
  d.push({ op: f, thickness: n });
@@ -5086,7 +5086,7 @@ const Pe = class Pe extends W {
5086
5086
  const { thickness: g, op: p } = f, M = p.reduce((w, m, x, b) => x > 0 && b[x - 1][0] === m[0] && b[x - 1][1] === m[1] ? w : w.concat(m[0], m[1]), []), I = this.computEraserPoints(M, g), v = ce(I, !0), N = {
5087
5087
  pos: [0, 0],
5088
5088
  d: v,
5089
- fillColor: "rgba(136,136,136,0.3)"
5089
+ fillColor: this.workOptions.eraserColor
5090
5090
  }, T = new he(N);
5091
5091
  u.append(T), u.seal();
5092
5092
  }
@@ -5112,7 +5112,7 @@ const Pe = class Pe extends W {
5112
5112
  type: L.None,
5113
5113
  ...this.baseConsumeResult
5114
5114
  };
5115
- const { thickness: s } = this.workOptions, { width: o, height: n } = Pe.eraserSizes[s], r = Math.max(o, n) / this.worldScaling[0], { willDeleteNodes: c, willUpdateNodes: l, rect: u } = this.getChangeNodes(r, e);
5115
+ const { thickness: s } = this.workOptions, { width: o, height: n } = De.eraserSizes[s], r = Math.max(o, n) / this.worldScaling[0], { willDeleteNodes: c, willUpdateNodes: l, rect: u } = this.getChangeNodes(r, e);
5116
5116
  if (c.size === 0 && l.size === 0)
5117
5117
  return {
5118
5118
  type: L.FullWork,
@@ -5139,8 +5139,8 @@ const Pe = class Pe extends W {
5139
5139
  }
5140
5140
  };
5141
5141
  // 来源于white-sdk
5142
- y(Pe, "eraserSizes", cs);
5143
- let fi = Pe;
5142
+ y(De, "eraserSizes", cs);
5143
+ let fi = De;
5144
5144
  function hn(a) {
5145
5145
  switch (a) {
5146
5146
  case S.Arrow:
@@ -5288,7 +5288,7 @@ class wg {
5288
5288
  name: i,
5289
5289
  rect: t.rect
5290
5290
  };
5291
- t.rect && (e.rect = zt(t.rect)), t.op && FM(t.op) && (e.op = zt(t.op)), t.canRotate && (e.canRotate = t.canRotate), t.scaleType && (e.scaleType = t.scaleType), t.opt && (e.opt = zt(t.opt)), t.toolsType && (e.toolsType = t.toolsType), t.centerPos && (e.centerPos = zt(t.centerPos)), be(t.isSelected) && (e.isSelected = t.isSelected), e.rect ? this.curNodeMap.set(i, e) : this.curNodeMap.delete(i);
5291
+ t.rect && (e.rect = zt(t.rect)), t.op && FM(t.op) && (e.op = zt(t.op)), t.canRotate && (e.canRotate = t.canRotate), t.scaleType && (e.scaleType = t.scaleType), t.opt && (e.opt = zt(t.opt)), t.toolsType && (e.toolsType = t.toolsType), t.centerPos && (e.centerPos = zt(t.centerPos)), Le(t.isSelected) && (e.isSelected = t.isSelected), e.rect ? this.curNodeMap.set(i, e) : this.curNodeMap.delete(i);
5292
5292
  }
5293
5293
  selected(i) {
5294
5294
  this.setInfo(i, { isSelected: !0 });
@@ -5509,7 +5509,7 @@ class vg {
5509
5509
  if (!r || !c || !l || !u)
5510
5510
  return;
5511
5511
  let d = r;
5512
- if (c === je.Iconify) {
5512
+ if (c === Ee.Iconify) {
5513
5513
  const [M, I] = this.getIconSize(l, u, this.dpr);
5514
5514
  d = `${r}?width=${M}&height=${I}&color=${h}`;
5515
5515
  }
@@ -5846,7 +5846,7 @@ function ty(a, i, t) {
5846
5846
  });
5847
5847
  }
5848
5848
  var ey = ty;
5849
- const fs = /* @__PURE__ */ Re(ey);
5849
+ const fs = /* @__PURE__ */ We(ey);
5850
5850
  function iy(a) {
5851
5851
  return a;
5852
5852
  }
@@ -6753,7 +6753,7 @@ class Ze extends W {
6753
6753
  if (!p) return;
6754
6754
  const M = e.parent;
6755
6755
  if (M) {
6756
- if (g && (p.opt.strokeColor = g), Rt(f) && (e.setAttribute("zIndex", f), p.opt.zIndex = f), be(d) && (p.opt.locked = d), c && l && u && r) {
6756
+ if (g && (p.opt.strokeColor = g), Rt(f) && (e.setAttribute("zIndex", f), p.opt.zIndex = f), Le(d) && (p.opt.locked = d), c && l && u && r) {
6757
6757
  const { centerX: I, centerY: v, width: N, height: T, uniformScale: w } = p.opt, m = w !== !1 ? [u[0], u[0]] : u, x = [I, v], b = [I, v];
6758
6758
  ys(b, l, m, r);
6759
6759
  const z = [b[0] - x[0], b[1] - x[1]];
@@ -6958,7 +6958,7 @@ const Xt = (a, i) => new Promise(function(t) {
6958
6958
  }), le = (a) => {
6959
6959
  const i = (a == null ? void 0 : a.webkitBackingStorePixelRatio) || (a == null ? void 0 : a.mozBackingStorePixelRatio) || (a == null ? void 0 : a.msBackingStorePixelRatio) || (a == null ? void 0 : a.oBackingStorePixelRatio) || (a == null ? void 0 : a.backingStorePixelRatio) || 1;
6960
6960
  return Math.max(1, (window.devicePixelRatio || 1) / i);
6961
- }, mn = (a, i) => a.x + a.w < i.x || a.x > i.x + i.w || a.y + a.h < i.y || a.y > i.y + i.h ? Ae.outside : a.x >= i.x && a.y >= i.y && a.x + a.w <= i.x + i.w && a.y + a.h <= i.y + i.h ? Ae.inside : Ae.intersect;
6961
+ }, mn = (a, i) => a.x + a.w < i.x || a.x > i.x + i.w || a.y + a.h < i.y || a.y > i.y + i.h ? je.outside : a.x >= i.x && a.y >= i.y && a.x + a.w <= i.x + i.w && a.y + a.h <= i.y + i.h ? je.inside : je.intersect;
6962
6962
  function XM(a) {
6963
6963
  let i = 0;
6964
6964
  for (let t = 0; t < a.length; t++) {
@@ -7326,11 +7326,13 @@ const kt = class kt extends JM {
7326
7326
  e === void 0 ? delete c[o][n][t] : (c[o] || (c[o] = {}), c[o][n] || (c[o][n] = {}), c[o][n][t] = e), this.runSyncService(s);
7327
7327
  }
7328
7328
  runSyncService(t) {
7329
- this.asyncClockState || (this.asyncClockState = !0, setTimeout(() => {
7330
- t.isSync ? (this.asyncClockState = !1, this.syncSerivice(t)) : Xt(() => {
7329
+ this.asyncClockState || (this.asyncClockState = !0, t.isSync && setTimeout(() => {
7330
+ this.asyncClockState = !1, this.syncSerivice(t);
7331
+ }, 0), setTimeout(() => {
7332
+ Xt(() => {
7331
7333
  this.asyncClockState = !1, this.syncSerivice(t);
7332
7334
  }, kt.syncInterval);
7333
- }, t != null && t.isSync ? 0 : kt.syncInterval));
7335
+ }, kt.syncInterval));
7334
7336
  }
7335
7337
  syncSerivice(t = {
7336
7338
  storage: this.storage
@@ -7693,23 +7695,24 @@ let me = Ut;
7693
7695
  class KM {
7694
7696
  constructor(i) {
7695
7697
  y(this, "internalMsgEmitter");
7698
+ y(this, "publicMsgEmitter");
7696
7699
  y(this, "control");
7697
7700
  y(this, "editors");
7698
7701
  y(this, "activeId");
7699
7702
  y(this, "proxyMap");
7700
7703
  y(this, "taskqueue", /* @__PURE__ */ new Map());
7701
- const { control: t, internalMsgEmitter: e } = i;
7702
- this.control = t, this.internalMsgEmitter = e;
7703
- const s = /* @__PURE__ */ new Map();
7704
+ const { control: t, internalMsgEmitter: e, publicMsgEmitter: s } = i;
7705
+ this.control = t, this.internalMsgEmitter = e, this.publicMsgEmitter = s;
7706
+ const o = /* @__PURE__ */ new Map();
7704
7707
  this.proxyMap = new me();
7705
- const o = this, n = me.interceptors.set;
7706
- me.interceptors.set = function(c, l) {
7707
- return o.interceptors.set(c, l), n.call(this, c, l);
7708
+ const n = this, r = me.interceptors.set;
7709
+ me.interceptors.set = function(l, u) {
7710
+ return n.interceptors.set(l, u), r.call(this, l, u);
7708
7711
  };
7709
- const r = me.interceptors.delete;
7710
- me.interceptors.delete = function(c, l) {
7711
- return o.interceptors.delete(c, l), r.call(this, c);
7712
- }, this.editors = this.proxyMap.createProxy(s);
7712
+ const c = me.interceptors.delete;
7713
+ me.interceptors.delete = function(l, u) {
7714
+ return n.interceptors.delete(l, u), c.call(this, l);
7715
+ }, this.editors = this.proxyMap.createProxy(o);
7713
7716
  }
7714
7717
  get collector() {
7715
7718
  return this.control.collector;
@@ -8178,6 +8181,9 @@ class qt {
8178
8181
  y(this, "emtType");
8179
8182
  y(this, "control");
8180
8183
  y(this, "mainEngine");
8184
+ y(this, "collectListener", (i, t) => {
8185
+ this.collect(i, t);
8186
+ });
8181
8187
  }
8182
8188
  static dispatch(i, t, e) {
8183
8189
  var s;
@@ -8187,10 +8193,10 @@ class qt {
8187
8193
  return this.control.collector;
8188
8194
  }
8189
8195
  registerForMainEngine(i, t) {
8190
- return this.emtType = i, this.control = t, this.mainEngine = t.worker, this.mainEngine.internalMsgEmitter.on([this.emtType, this.emitEventType], this.collect.bind(this)), this;
8196
+ return this.emtType = i, this.control = t, this.mainEngine = t.worker, this.mainEngine.internalMsgEmitter.on([this.emtType, this.emitEventType], this.collectListener), this;
8191
8197
  }
8192
8198
  destroy() {
8193
- this.emtType && this.mainEngine && this.mainEngine.internalMsgEmitter.off([this.emtType, this.emitEventType], this.collect.bind(this));
8199
+ this.emtType && this.mainEngine && this.mainEngine.internalMsgEmitter.off([this.emtType, this.emitEventType], this.collectListener);
8194
8200
  }
8195
8201
  collectForLocalWorker(i, t) {
8196
8202
  var e, s, o;
@@ -8429,7 +8435,7 @@ function Ke(a, i, t) {
8429
8435
  function Pt(a, i = 1) {
8430
8436
  return "rgba(" + parseInt("0x" + a.slice(1, 3)) + "," + parseInt("0x" + a.slice(3, 5)) + "," + parseInt("0x" + a.slice(5, 7)) + "," + i + ")";
8431
8437
  }
8432
- function He(a, i, t, e = 1) {
8438
+ function xe(a, i, t, e = 1) {
8433
8439
  return `rgba(${a},${i},${t},${e})`;
8434
8440
  }
8435
8441
  function ki(a) {
@@ -9592,7 +9598,7 @@ class Mm extends ym {
9592
9598
  }
9593
9599
  async useMainThread() {
9594
9600
  console.info("no OffscreenCanvas");
9595
- const { MainThreadManagerImpl: t } = await import("./index-C7EVuWrK.mjs");
9601
+ const { MainThreadManagerImpl: t } = await import("./index-79ksEO92.mjs");
9596
9602
  this.mainThread = new t(this);
9597
9603
  }
9598
9604
  async on() {
@@ -10634,7 +10640,7 @@ class Mm extends ym {
10634
10640
  if (t && n) {
10635
10641
  const c = Date.now();
10636
10642
  bt.InternalMsgEmitter.emit("addUndoTicker", c, t);
10637
- const l = { ...e, type: je.Iconify };
10643
+ const l = { ...e, type: Ee.Iconify };
10638
10644
  this.zIndexNodeMethod && (this.zIndexNodeMethod.addMaxLayer(t), l.zIndex = this.zIndexNodeMethod.getMaxZIndex(t)), this.taskBatchData.add({
10639
10645
  msgType: L.FullWork,
10640
10646
  dataType: U.Local,
@@ -10662,7 +10668,7 @@ class Mm extends ym {
10662
10668
  }
10663
10669
  const c = Date.now();
10664
10670
  bt.InternalMsgEmitter.emit("addUndoTicker", c, t);
10665
- const l = { ...e, type: je.Image };
10671
+ const l = { ...e, type: Ee.Image };
10666
10672
  this.zIndexNodeMethod && (this.zIndexNodeMethod.addMaxLayer(t), l.zIndex = this.zIndexNodeMethod.getMaxZIndex(t)), this.taskBatchData.add({
10667
10673
  msgType: L.FullWork,
10668
10674
  dataType: U.Local,
@@ -10689,7 +10695,7 @@ class Mm extends ym {
10689
10695
  if (h && h.toolsType === S.Image && h.opt.uuid === e) {
10690
10696
  const d = Date.now();
10691
10697
  bt.InternalMsgEmitter.emit("addUndoTicker", d, t);
10692
- const f = (r = this.collector) != null && r.isOwn(u) ? (c = this.collector) == null ? void 0 : c.getLocalId(u) : u, g = { ...h.opt, locked: s, type: je.Image };
10698
+ const f = (r = this.collector) != null && r.isOwn(u) ? (c = this.collector) == null ? void 0 : c.getLocalId(u) : u, g = { ...h.opt, locked: s, type: Ee.Image };
10693
10699
  this.taskBatchData.add({
10694
10700
  msgType: L.FullWork,
10695
10701
  dataType: U.Local,
@@ -11721,13 +11727,13 @@ const we = class we {
11721
11727
  toolsOpt: {}
11722
11728
  };
11723
11729
  const e = {
11724
- strokeColor: He(t.strokeColor[0], t.strokeColor[1], t.strokeColor[2], t.strokeOpacity || 1),
11730
+ strokeColor: xe(t.strokeColor[0], t.strokeColor[1], t.strokeColor[2], t.strokeOpacity || 1),
11725
11731
  thickness: t.strokeWidth,
11726
11732
  isOpacity: (t == null ? void 0 : t.strokeOpacity) && t.strokeOpacity < 1 || (t == null ? void 0 : t.fillOpacity) && t.fillOpacity < 1 || (t == null ? void 0 : t.textOpacity) && t.textOpacity < 1 || (t == null ? void 0 : t.textBgOpacity) && t.textBgOpacity < 1 || !1
11727
11733
  };
11728
11734
  switch (i) {
11729
11735
  case S.Text:
11730
- e.fontFamily = window.getComputedStyle(document.documentElement).getPropertyValue("font-family"), e.fontSize = (t == null ? void 0 : t.textSizeOverride) || (t == null ? void 0 : t.textSize) || Number(window.getComputedStyle(document.body).fontSize), e.textAlign = (t == null ? void 0 : t.textAlign) || "left", e.verticalAlign = (t == null ? void 0 : t.verticalAlign) || "middle", e.fontColor = (t == null ? void 0 : t.textColor) && He(t.textColor[0], t.textColor[1], t.textColor[2], t.textOpacity || 1) || e.strokeColor || "rgba(0,0,0,1)", e.fontBgColor = Array.isArray(t == null ? void 0 : t.textBgColor) && He(t.textBgColor[0], t.textBgColor[1], t.textBgColor[2], t.textBgOpacity || 1) || "transparent", e.bold = (t == null ? void 0 : t.bold) && "bold" || void 0, e.italic = (t == null ? void 0 : t.italic) && "italic" || void 0, e.underline = (t == null ? void 0 : t.underline) || void 0, e.lineThrough = (t == null ? void 0 : t.lineThrough) || void 0, e.text = "", e.strokeColor = void 0;
11736
+ e.fontFamily = window.getComputedStyle(document.documentElement).getPropertyValue("font-family"), e.fontSize = (t == null ? void 0 : t.textSizeOverride) || (t == null ? void 0 : t.textSize) || Number(window.getComputedStyle(document.body).fontSize), e.textAlign = (t == null ? void 0 : t.textAlign) || "left", e.verticalAlign = (t == null ? void 0 : t.verticalAlign) || "middle", e.fontColor = (t == null ? void 0 : t.textColor) && xe(t.textColor[0], t.textColor[1], t.textColor[2], t.textOpacity || 1) || e.strokeColor || "rgba(0,0,0,1)", e.fontBgColor = Array.isArray(t == null ? void 0 : t.textBgColor) && xe(t.textBgColor[0], t.textBgColor[1], t.textBgColor[2], t.textBgOpacity || 1) || "transparent", e.bold = (t == null ? void 0 : t.bold) && "bold" || void 0, e.italic = (t == null ? void 0 : t.italic) && "italic" || void 0, e.underline = (t == null ? void 0 : t.underline) || void 0, e.lineThrough = (t == null ? void 0 : t.lineThrough) || void 0, e.text = "", e.strokeColor = void 0;
11731
11737
  break;
11732
11738
  case S.Pencil:
11733
11739
  e.strokeType = (t == null ? void 0 : t.strokeType) || it.Normal;
@@ -11735,7 +11741,7 @@ const we = class we {
11735
11741
  case S.PencilEraser:
11736
11742
  case S.BitMapEraser:
11737
11743
  case S.Eraser:
11738
- e.thickness = Math.min(4, Math.max(1, Math.floor(t.pencilEraserSize || 1))) - 1;
11744
+ e.thickness = Math.min(4, Math.max(1, Math.floor(t.pencilEraserSize || 1))) - 1, i === S.BitMapEraser && (e.eraserColor = t.eraserColor && xe(t.eraserColor[0], t.eraserColor[1], t.eraserColor[2], t.eraserOpacity || 0.3) || "rgba(136,136,136,0.3)");
11739
11745
  break;
11740
11746
  case S.LaserPen:
11741
11747
  e.duration = (t == null ? void 0 : t.duration) || 1, t != null && t.strokeType && (t == null ? void 0 : t.strokeType) === it.Stroke ? e.strokeType = it.Normal : e.strokeType = (t == null ? void 0 : t.strokeType) || it.Normal;
@@ -11749,7 +11755,7 @@ const we = class we {
11749
11755
  case S.Star:
11750
11756
  case S.Polygon:
11751
11757
  case S.SpeechBalloon:
11752
- t != null && t.strokeType && (t == null ? void 0 : t.strokeType) === it.Stroke ? e.strokeType = it.Normal : e.strokeType = (t == null ? void 0 : t.strokeType) || it.Normal, i === S.Star && (t.shapeType === ee.Pentagram ? (e.vertices = 10, e.innerVerticeStep = 2, e.innerRatio = 0.4) : t != null && t.vertices && (t != null && t.innerVerticeStep) && (t != null && t.innerRatio) && (e.vertices = t.vertices, e.innerVerticeStep = t.innerVerticeStep, e.innerRatio = t.innerRatio)), i === S.Polygon && (t.shapeType === ee.Triangle ? e.vertices = 3 : t.shapeType === ee.Rhombus ? e.vertices = 4 : t.vertices && (e.vertices = t.vertices)), e.fillColor = (t == null ? void 0 : t.fillColor) && He(t.fillColor[0], t.fillColor[1], t.fillColor[2], t == null ? void 0 : t.fillOpacity) || "transparent", i === S.SpeechBalloon && (e.placement = t.placement || "bottomLeft");
11758
+ t != null && t.strokeType && (t == null ? void 0 : t.strokeType) === it.Stroke ? e.strokeType = it.Normal : e.strokeType = (t == null ? void 0 : t.strokeType) || it.Normal, i === S.Star && (t.shapeType === ee.Pentagram ? (e.vertices = 10, e.innerVerticeStep = 2, e.innerRatio = 0.4) : t != null && t.vertices && (t != null && t.innerVerticeStep) && (t != null && t.innerRatio) && (e.vertices = t.vertices, e.innerVerticeStep = t.innerVerticeStep, e.innerRatio = t.innerRatio)), i === S.Polygon && (t.shapeType === ee.Triangle ? e.vertices = 3 : t.shapeType === ee.Rhombus ? e.vertices = 4 : t.vertices && (e.vertices = t.vertices)), e.fillColor = (t == null ? void 0 : t.fillColor) && xe(t.fillColor[0], t.fillColor[1], t.fillColor[2], t == null ? void 0 : t.fillOpacity) || "transparent", i === S.SpeechBalloon && (e.placement = t.placement || "bottomLeft");
11753
11759
  break;
11754
11760
  }
11755
11761
  return {
@@ -11908,7 +11914,7 @@ const we = class we {
11908
11914
  insertIconify(i, t) {
11909
11915
  var s;
11910
11916
  if (this.viewContainerManager.getView(i) && this.room) {
11911
- const o = this.room.state.memberState, n = He(o.strokeColor[0], o.strokeColor[1], o.strokeColor[2], o.strokeOpacity || 1);
11917
+ const o = this.room.state.memberState, n = xe(o.strokeColor[0], o.strokeColor[1], o.strokeColor[2], o.strokeOpacity || 1);
11912
11918
  (s = this.worker) == null || s.insertIconify(i, { ...t, strokeColor: n });
11913
11919
  }
11914
11920
  }
@@ -11961,23 +11967,23 @@ const ve = class ve {
11961
11967
  this.tickStartStorerCache = new Map(Object.entries(ft(n)));
11962
11968
  }
11963
11969
  }
11964
- undoTickerEndSync(i, t, e) {
11965
- var s, o;
11970
+ undoTickerEndSync(i, t, e, s = !0) {
11971
+ var o, n;
11966
11972
  if (i === this.undoTickerId && e === this.scenePath && t === this.viewId && this.tickStartStorerCache) {
11967
- const n = ((s = this.collector) == null ? void 0 : s.storage[t]) && ((o = this.collector) == null ? void 0 : o.storage[t][e]) || {}, r = this.diffFun(
11973
+ const r = ((o = this.collector) == null ? void 0 : o.storage[t]) && ((n = this.collector) == null ? void 0 : n.storage[t][e]) || {}, c = this.diffFun(
11968
11974
  this.tickStartStorerCache,
11969
- new Map(Object.entries(n))
11975
+ new Map(Object.entries(r))
11970
11976
  );
11971
- r.size && (this.undoStack.push({
11977
+ c.size && (this.undoStack.push({
11972
11978
  id: i,
11973
11979
  type: 2,
11974
- data: ft(r),
11980
+ data: ft(c),
11975
11981
  scenePath: e
11976
- }), this.undoStack.length > ve.MaxStackLength && this.undoStack.shift(), this.emitter.emit("onCanUndoStepsUpdate", this.undoStack.length)), this.redoStack.length && (this.redoStack.length = 0, this.emitter.emit("onCanRedoStepsUpdate", this.redoStack.length)), this.isTicking = !1, this.scenePath = void 0, this.tickStartStorerCache = void 0, this.undoTickerId = void 0, this.excludeIds.clear();
11982
+ }), this.undoStack.length > ve.MaxStackLength && this.undoStack.shift(), s && this.emitter.emit("onCanUndoStepsUpdate", this.undoStack.length + 1)), this.redoStack.length && (this.redoStack.length = 0, this.emitter.emit("onCanRedoStepsUpdate", this.redoStack.length)), this.isTicking = !1, this.scenePath = void 0, this.tickStartStorerCache = void 0, this.undoTickerId = void 0, this.excludeIds.clear();
11977
11983
  }
11978
11984
  }
11979
11985
  undo(i) {
11980
- this.undoTickerId && this.tickStartStorerCache && this.scenePath && this.undoTickerEndSync(this.undoTickerId, this.viewId, this.scenePath);
11986
+ this.undoTickerId && this.tickStartStorerCache && this.scenePath && this.undoTickerEndSync(this.undoTickerId, this.viewId, this.scenePath, !1);
11981
11987
  let t = this.undoStack.length - 1;
11982
11988
  for (; t >= 0; ) {
11983
11989
  if (this.undoStack[t].scenePath === i) {
@@ -12215,7 +12221,7 @@ let yi = ve;
12215
12221
  function Sm(a) {
12216
12222
  return a instanceof TouchEvent || a instanceof window.TouchEvent || (a == null ? void 0 : a.touches) && (a == null ? void 0 : a.touches.length) || (a == null ? void 0 : a.changedTouches) && (a == null ? void 0 : a.changedTouches.length);
12217
12223
  }
12218
- function Ee(a) {
12224
+ function Oe(a) {
12219
12225
  return Sm(a) && (a.touches && a.touches.length === 1 || a.changedTouches && a.changedTouches.length === 1);
12220
12226
  }
12221
12227
  function wn(a) {
@@ -12236,16 +12242,16 @@ class Ge {
12236
12242
  y(this, "control");
12237
12243
  y(this, "mainView");
12238
12244
  y(this, "appViews", /* @__PURE__ */ new Map());
12245
+ y(this, "undoTickerStart", (i, t) => {
12246
+ const e = this.getView(t);
12247
+ e && e.displayer && e.focusScenePath && e.displayer.commiter.undoTickerStart(i, e.focusScenePath);
12248
+ });
12249
+ y(this, "addExcludeIds", (i, t) => {
12250
+ const e = this.getView(t);
12251
+ e && e.displayer && e.focusScenePath && e.displayer.commiter.addExcludeIds(i);
12252
+ });
12239
12253
  const { control: t, internalMsgEmitter: e } = i;
12240
- this.control = t, this.internalMsgEmitter = e, this.internalMsgEmitter.on("addUndoTicker", this.undoTickerStart.bind(this)), this.internalMsgEmitter.on("excludeIds", this.addExcludeIds.bind(this));
12241
- }
12242
- undoTickerStart(i, t) {
12243
- const e = this.getView(t);
12244
- e && e.displayer && e.focusScenePath && e.displayer.commiter.undoTickerStart(i, e.focusScenePath);
12245
- }
12246
- addExcludeIds(i, t) {
12247
- const e = this.getView(t);
12248
- e && e.displayer && e.focusScenePath && e.displayer.commiter.addExcludeIds(i);
12254
+ this.control = t, this.internalMsgEmitter = e, this.internalMsgEmitter.on("addUndoTicker", this.undoTickerStart), this.internalMsgEmitter.on("excludeIds", this.addExcludeIds);
12249
12255
  }
12250
12256
  undo() {
12251
12257
  const i = this.focuedView;
@@ -12330,7 +12336,7 @@ class Ge {
12330
12336
  /** 销毁 */
12331
12337
  destroy() {
12332
12338
  var i;
12333
- this.internalMsgEmitter.removeAllListeners("addUndoTicker"), this.internalMsgEmitter.removeAllListeners("excludeIds"), (i = this.mainView) == null || i.displayer.destroy(), this.control.destroyMiniMap(Mt), this.appViews.forEach((t) => {
12339
+ this.internalMsgEmitter.off("addUndoTicker", this.undoTickerStart), this.internalMsgEmitter.off("excludeIds", this.addExcludeIds), (i = this.mainView) == null || i.displayer.destroy(), this.control.destroyMiniMap(Mt), this.appViews.forEach((t) => {
12334
12340
  this.destroyAppView(t.id, !0), this.control.worker.destroyViewWorker(t.id), this.control.destroyMiniMap(t.id);
12335
12341
  });
12336
12342
  }
@@ -12464,7 +12470,7 @@ class Tm {
12464
12470
  y(this, "touchstart", (i) => {
12465
12471
  var t;
12466
12472
  if (this.active) {
12467
- if (!Ee(i)) {
12473
+ if (!Oe(i)) {
12468
12474
  this.control.worker.unWritable(), this.viewId && this.control.worker.removeDrawingWork(this.viewId);
12469
12475
  return;
12470
12476
  }
@@ -12481,7 +12487,7 @@ class Tm {
12481
12487
  });
12482
12488
  y(this, "touchmove", (i) => {
12483
12489
  if (this.active) {
12484
- if (!Ee(i)) {
12490
+ if (!Oe(i)) {
12485
12491
  this.control.worker.unWritable(), this.control.worker.removeDrawingWork(this.viewId);
12486
12492
  return;
12487
12493
  }
@@ -12493,7 +12499,7 @@ class Tm {
12493
12499
  });
12494
12500
  y(this, "touchend", (i) => {
12495
12501
  if (this.active) {
12496
- if (!Ee(i) || !this.control.worker.isAbled()) {
12502
+ if (!Oe(i) || !this.control.worker.isAbled()) {
12497
12503
  this.control.worker.unWritable(), this.control.worker.removeDrawingWork(this.viewId);
12498
12504
  return;
12499
12505
  }
@@ -12621,7 +12627,7 @@ class vn {
12621
12627
  y(this, "touchstart", (i) => {
12622
12628
  var e;
12623
12629
  if (!this.active) return;
12624
- if (!Ee(i)) {
12630
+ if (!Oe(i)) {
12625
12631
  this.control.worker.unWritable(), this.viewId && this.control.worker.removeDrawingWork(this.viewId);
12626
12632
  return;
12627
12633
  }
@@ -12635,7 +12641,7 @@ class vn {
12635
12641
  });
12636
12642
  y(this, "touchmove", (i) => {
12637
12643
  if (!this.active) return;
12638
- if (!Ee(i)) {
12644
+ if (!Oe(i)) {
12639
12645
  this.control.worker.unWritable(), this.viewId && this.control.worker.removeDrawingWork(this.viewId);
12640
12646
  return;
12641
12647
  }
@@ -12644,7 +12650,7 @@ class vn {
12644
12650
  });
12645
12651
  y(this, "touchend", (i) => {
12646
12652
  if (!this.active) return;
12647
- if (!Ee(i) || !this.control.worker.isAbled()) {
12653
+ if (!Oe(i) || !this.control.worker.isAbled()) {
12648
12654
  this.control.worker.unWritable(), this.control.worker.removeDrawingWork(this.viewId);
12649
12655
  return;
12650
12656
  }
@@ -12932,7 +12938,7 @@ const Ym = (a) => {
12932
12938
  }
12933
12939
  ),
12934
12940
  /* @__PURE__ */ k.createElement("div", { className: "range-opacity" }, /* @__PURE__ */ k.createElement(
12935
- Oe,
12941
+ Re,
12936
12942
  {
12937
12943
  bounds: "parent",
12938
12944
  axis: "x",
@@ -12993,7 +12999,7 @@ const Ym = (a) => {
12993
12999
  }
12994
13000
  ),
12995
13001
  /* @__PURE__ */ k.createElement("div", { className: "range-opacity" }, /* @__PURE__ */ k.createElement(
12996
- Oe,
13002
+ Re,
12997
13003
  {
12998
13004
  bounds: "parent",
12999
13005
  axis: "x",
@@ -13521,7 +13527,7 @@ const Ym = (a) => {
13521
13527
  80,
13522
13528
  144,
13523
13529
  288
13524
- ]), xe = [
13530
+ ]), be = [
13525
13531
  "top",
13526
13532
  "topLeft",
13527
13533
  "topRight",
@@ -13764,7 +13770,7 @@ const Ym = (a) => {
13764
13770
  },
13765
13771
  /* @__PURE__ */ k.createElement("div", { className: "range-number-color" }),
13766
13772
  /* @__PURE__ */ k.createElement("div", { className: "range-number" }, /* @__PURE__ */ k.createElement(
13767
- Oe,
13773
+ Re,
13768
13774
  {
13769
13775
  bounds: "parent",
13770
13776
  axis: "x",
@@ -13778,7 +13784,7 @@ const Ym = (a) => {
13778
13784
  );
13779
13785
  }, nw = (a) => {
13780
13786
  const { icon: i, value: t, onChangeHandler: e, style: s } = a, [o, n] = nt(0), [r, c] = nt(), l = fe(null), u = No((f) => {
13781
- f >= xe.length && (f = 0), f < 0 && (f = xe.length - 1), n(f), e(xe[f]), c(!1), l.current && (l.current.value = xe[f]);
13787
+ f >= be.length && (f = 0), f < 0 && (f = be.length - 1), n(f), e(be[f]), c(!1), l.current && (l.current.value = be[f]);
13782
13788
  }, [e]), h = q(() => {
13783
13789
  if (s && s.bottom) {
13784
13790
  const f = {};
@@ -13786,9 +13792,9 @@ const Ym = (a) => {
13786
13792
  }
13787
13793
  }, [s]);
13788
13794
  yt(() => {
13789
- t && (n(xe.indexOf(t)), l.current && (l.current.value = t));
13795
+ t && (n(be.indexOf(t)), l.current && (l.current.value = t));
13790
13796
  }, [t]);
13791
- const d = q(() => r ? /* @__PURE__ */ k.createElement(rw, { options: xe, onClickHandler: u, style: h }) : null, [r, u, h]);
13797
+ const d = q(() => r ? /* @__PURE__ */ k.createElement(rw, { options: be, onClickHandler: u, style: h }) : null, [r, u, h]);
13792
13798
  return /* @__PURE__ */ k.createElement("div", { className: "button input-button" }, /* @__PURE__ */ k.createElement("img", { src: At(i) }), /* @__PURE__ */ k.createElement(
13793
13799
  "input",
13794
13800
  {
@@ -14325,8 +14331,8 @@ const Ym = (a) => {
14325
14331
  if (pt.length > 1)
14326
14332
  for (let Dt = 1; Dt < pt.length; Dt++) {
14327
14333
  let Kt = pt[Dt];
14328
- const Ve = document.createElement("div");
14329
- d.fontBgColor && (Ve.style.backgroundColor = d.fontBgColor), Dt === pt.length - 1 && (ye = Kt.length, Kt = Kt.concat(ht)), Kt === "" ? Ve.innerHTML = "<br/>" : Ve.innerText = Kt, X.appendChild(Ve), Dt === pt.length - 1 && (St = Ve.childNodes[0]);
14334
+ const $e = document.createElement("div");
14335
+ d.fontBgColor && ($e.style.backgroundColor = d.fontBgColor), Dt === pt.length - 1 && (ye = Kt.length, Kt = Kt.concat(ht)), Kt === "" ? $e.innerHTML = "<br/>" : $e.innerText = Kt, X.appendChild($e), Dt === pt.length - 1 && (St = $e.childNodes[0]);
14330
14336
  }
14331
14337
  if (Tt.length) {
14332
14338
  Tt.reverse();
@@ -14443,21 +14449,21 @@ class gw extends Sn {
14443
14449
  }));
14444
14450
  }
14445
14451
  handleKeyUp(t) {
14452
+ var o, n;
14446
14453
  const e = this.getInnerText(t.nativeEvent.target), s = this.props.activeTextId;
14447
14454
  if (s) {
14448
- const o = this.props.manager.control.textEditorManager.get(s), n = Jt(e), r = P.Doing, c = [t.nativeEvent.target.offsetWidth, t.nativeEvent.target.offsetHeight];
14449
- (!o || o && (o.opt.text !== n || !gt(o.opt.boxSize, c) || !gt(o.opt.workState, r))) && this.updateOptInfo({
14450
- activeTextId: s,
14451
- update: {
14452
- text: n,
14453
- boxSize: c,
14454
- workState: r
14455
- },
14456
- syncData: {
14457
- canSync: !0,
14458
- canWorker: !0
14459
- }
14460
- });
14455
+ const r = this.props.manager.control.textEditorManager.get(s), c = Jt(e), l = P.Doing, u = [t.nativeEvent.target.offsetWidth, t.nativeEvent.target.offsetHeight];
14456
+ if (!r || r && (r.opt.text !== c || !gt(r.opt.boxSize, u) || !gt(r.opt.workState, l))) {
14457
+ if (t.nativeEvent.isComposing)
14458
+ return;
14459
+ const h = s && ft(((o = this.props.manager.control.textEditorManager) == null ? void 0 : o.get(s)) || ((n = this.props.editors) == null ? void 0 : n.get(s)));
14460
+ h && h.opt && (h.opt = {
14461
+ ...h.opt,
14462
+ text: c,
14463
+ boxSize: u,
14464
+ workState: l
14465
+ }, h.canSync = !0, h.canWorker = !0, this.props.manager.control.textEditorManager.updateForViewEdited(s, h)), this.props.manager.control.textEditorManager.publicMsgEmitter.emit("textChange", s, t.nativeEvent.target, e, h);
14466
+ }
14461
14467
  }
14462
14468
  }
14463
14469
  handleFocus(t) {
@@ -14657,7 +14663,7 @@ const yw = () => {
14657
14663
  );
14658
14664
  }, 100, { trailing: !0 });
14659
14665
  return /* @__PURE__ */ k.createElement(
14660
- Oe,
14666
+ Re,
14661
14667
  {
14662
14668
  disabled: p,
14663
14669
  position: r,
@@ -14740,7 +14746,7 @@ const yw = () => {
14740
14746
  ));
14741
14747
  }, 100, { trailing: !1 }), N = q(() => !!((i == null ? void 0 : i.scaleType) === lt.none && (i != null && i.canLock)), [i]), T = (w) => (w.stopPropagation(), w.cancelable && w.preventDefault(), (r == null ? void 0 : r.x) === (i == null ? void 0 : i.x) && (r == null ? void 0 : r.y) === (i == null ? void 0 : i.y) && s(w), !1);
14742
14748
  return /* @__PURE__ */ k.createElement(
14743
- Oe,
14749
+ Re,
14744
14750
  {
14745
14751
  disabled: h,
14746
14752
  position: l,
@@ -15003,7 +15009,7 @@ const yw = () => {
15003
15009
  }
15004
15010
  };
15005
15011
  return /* @__PURE__ */ k.createElement(
15006
- Oe,
15012
+ Re,
15007
15013
  {
15008
15014
  disabled: d,
15009
15015
  position: c,
@@ -16038,7 +16044,7 @@ const Y = class Y extends mo {
16038
16044
  },
16039
16045
  usePlugin: (p) => {
16040
16046
  var M;
16041
- Y.logger.info("[ApplianceMultiPlugin] usePlugin"), (M = Y.currentManager) == null || M.usePlugin(p);
16047
+ Y.logger.info("[ApplianceMultiPlugin] usePlugin", p.kind), (M = Y.currentManager) == null || M.usePlugin(p);
16042
16048
  },
16043
16049
  getDisableDeviceInputs() {
16044
16050
  if (Y.logger.info("[ApplianceMultiPlugin] getDisableDeviceInputs"), Y.currentManager && _(s))
@@ -16555,7 +16561,7 @@ const R = class R extends mo {
16555
16561
  },
16556
16562
  usePlugin: (g) => {
16557
16563
  var p;
16558
- R.logger.info("[ApplianceSinglePlugin] usePlugin"), (p = R.currentManager) == null || p.usePlugin(g);
16564
+ R.logger.info("[ApplianceSinglePlugin] usePlugin", g.kind), (p = R.currentManager) == null || p.usePlugin(g);
16559
16565
  },
16560
16566
  getDisableDeviceInputs() {
16561
16567
  if (R.logger.info("[ApplianceSinglePlugin] getDisableDeviceInputs"), R.currentManager && _(t))
@@ -16679,20 +16685,20 @@ y(R, "kind", "appliance-aids-single-plugin"), y(R, "cursorAdapter"), y(R, "curre
16679
16685
  n.init(), R.logger.info("[ApplianceSinglePlugin] refresh ApplianceSingleManager object"), R.currentManager = n, _(t) && t.logger.info(`[ApplianceSinglePlugin] use ${as}`);
16680
16686
  });
16681
16687
  let yo = R;
16682
- const De = class De extends k.Component {
16688
+ const Ae = class Ae extends k.Component {
16683
16689
  constructor() {
16684
16690
  super(...arguments);
16685
16691
  y(this, "mainViewRef", null);
16686
16692
  }
16687
16693
  componentDidMount() {
16688
- De.emiter || (De.emiter = Zt.InternalMsgEmitter), De.emiter.emit(st.BindMainView, this.mainViewRef);
16694
+ Ae.emiter || (Ae.emiter = Zt.InternalMsgEmitter), Ae.emiter.emit(st.BindMainView, this.mainViewRef);
16689
16695
  }
16690
16696
  render() {
16691
16697
  return /* @__PURE__ */ k.createElement(k.Fragment, null, this.props.children, /* @__PURE__ */ k.createElement("div", { className: "appliance-plugin-main-view-displayer", ref: (t) => this.mainViewRef = t }));
16692
16698
  }
16693
16699
  };
16694
- y(De, "emiter");
16695
- let Mo = De;
16700
+ y(Ae, "emiter");
16701
+ let Mo = Ae;
16696
16702
  class _w extends Im {
16697
16703
  constructor(t) {
16698
16704
  super();
@@ -16887,9 +16893,9 @@ export {
16887
16893
  fs as h,
16888
16894
  BM as i,
16889
16895
  B as j,
16890
- je as k,
16896
+ Ee as k,
16891
16897
  mn as l,
16892
- Ae as m,
16898
+ je as m,
16893
16899
  dt as n,
16894
16900
  Ie as o,
16895
16901
  Rt as p,