@leafer-in/editor 2.2.11 → 2.3.0
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/dist/editor.cjs +20 -4
- package/dist/editor.esm.js +21 -5
- package/dist/editor.esm.min.js +1 -1
- package/dist/editor.esm.min.js.map +1 -1
- package/dist/editor.js +20 -4
- package/dist/editor.min.cjs +1 -1
- package/dist/editor.min.cjs.map +1 -1
- package/dist/editor.min.js +1 -1
- package/dist/editor.min.js.map +1 -1
- package/package.json +6 -6
- package/src/decorator/data.ts +19 -6
- package/src/display/EditBox.ts +4 -0
- package/types/index.d.ts +1 -0
package/dist/editor.cjs
CHANGED
|
@@ -121,7 +121,23 @@ function targetAttr(fn) {
|
|
|
121
121
|
if (t.config) {
|
|
122
122
|
const isSelect = key === "target";
|
|
123
123
|
if (isSelect) {
|
|
124
|
-
const {beforeSelect: beforeSelect} = t.config;
|
|
124
|
+
const {beforeSelect: beforeSelect, skipNested: skipNested} = t.config;
|
|
125
|
+
if (draw.isArray(value)) {
|
|
126
|
+
if (skipNested) {
|
|
127
|
+
const first = value[0];
|
|
128
|
+
if (value.some(item => item.__level !== first.__level)) {
|
|
129
|
+
value.sort((a, b) => a.__level - b.__level);
|
|
130
|
+
const firstLevel = value[0].__level, filterValue = [];
|
|
131
|
+
value.forEach(item => {
|
|
132
|
+
if (!filterValue.length || !filterValue.some(parent => draw.LeafHelper.hasParent(item, parent, firstLevel))) filterValue.push(item);
|
|
133
|
+
});
|
|
134
|
+
value = filterValue;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (value.length > 1 && value.some(item => item.locked || item.editable === "single")) {
|
|
138
|
+
value = value.filter(item => !(item.locked || item.editable === "single"));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
125
141
|
if (beforeSelect) {
|
|
126
142
|
const check = beforeSelect({
|
|
127
143
|
target: value
|
|
@@ -129,9 +145,6 @@ function targetAttr(fn) {
|
|
|
129
145
|
if (draw.isObject(check)) value = check; else if (check === false) return;
|
|
130
146
|
}
|
|
131
147
|
if (t.hasDimOthers) t.cancelDimOthers();
|
|
132
|
-
if (draw.isArray(value) && value.length > 1 && value.some(item => item.locked || item.editable === "single")) {
|
|
133
|
-
value = value.filter(item => !(item.locked || item.editable === "single"));
|
|
134
|
-
}
|
|
135
148
|
if (t.single) {
|
|
136
149
|
delete t.element.syncEventer;
|
|
137
150
|
delete t.element.__world.ignorePixelSnap;
|
|
@@ -1457,6 +1470,9 @@ class EditBox extends draw.Group {
|
|
|
1457
1470
|
this.widgets.push(new item(this));
|
|
1458
1471
|
});
|
|
1459
1472
|
}
|
|
1473
|
+
getWidget(name) {
|
|
1474
|
+
return this.widgets.find(item => item.tag === name);
|
|
1475
|
+
}
|
|
1460
1476
|
loadWidgets() {
|
|
1461
1477
|
this.widgets.forEach(item => item.onLoad());
|
|
1462
1478
|
}
|
package/dist/editor.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Event, isArray, Group, Matrix, defineKey, isNull, isUndefined, isObject, DataHelper, MatrixHelper, BoundsHelper, LeafBoundsHelper, getMatrixData, getBoundsData, surfaceType, UI, ColorConvert, isString, Paint, Rect, Bounds, LeafList, Direction9, AroundHelper, MathHelper, PointHelper, isNumber, Box, Debug, ResizeEvent, getPointData, Text,
|
|
1
|
+
import { Event, isArray, Group, Matrix, defineKey, isNull, isUndefined, LeafHelper, isObject, DataHelper, MatrixHelper, BoundsHelper, LeafBoundsHelper, getMatrixData, getBoundsData, surfaceType, UI, ColorConvert, isString, Paint, Rect, Bounds, LeafList, Direction9, AroundHelper, MathHelper, PointHelper, isNumber, Box, Debug, ResizeEvent, getPointData, Text, PropertyEvent, Plugin, RenderEvent, LeaferEvent, Creator, dataType } from "@leafer-ui/draw";
|
|
2
2
|
|
|
3
3
|
import { PointerEvent, DragEvent, MoveEvent, ZoomEvent, DragBoundsHelper, KeyEvent, RotateEvent, useModule } from "@leafer-ui/core";
|
|
4
4
|
|
|
@@ -119,7 +119,23 @@ function targetAttr(fn) {
|
|
|
119
119
|
if (t.config) {
|
|
120
120
|
const isSelect = key === "target";
|
|
121
121
|
if (isSelect) {
|
|
122
|
-
const {beforeSelect: beforeSelect} = t.config;
|
|
122
|
+
const {beforeSelect: beforeSelect, skipNested: skipNested} = t.config;
|
|
123
|
+
if (isArray(value)) {
|
|
124
|
+
if (skipNested) {
|
|
125
|
+
const first = value[0];
|
|
126
|
+
if (value.some(item => item.__level !== first.__level)) {
|
|
127
|
+
value.sort((a, b) => a.__level - b.__level);
|
|
128
|
+
const firstLevel = value[0].__level, filterValue = [];
|
|
129
|
+
value.forEach(item => {
|
|
130
|
+
if (!filterValue.length || !filterValue.some(parent => LeafHelper.hasParent(item, parent, firstLevel))) filterValue.push(item);
|
|
131
|
+
});
|
|
132
|
+
value = filterValue;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (value.length > 1 && value.some(item => item.locked || item.editable === "single")) {
|
|
136
|
+
value = value.filter(item => !(item.locked || item.editable === "single"));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
123
139
|
if (beforeSelect) {
|
|
124
140
|
const check = beforeSelect({
|
|
125
141
|
target: value
|
|
@@ -127,9 +143,6 @@ function targetAttr(fn) {
|
|
|
127
143
|
if (isObject(check)) value = check; else if (check === false) return;
|
|
128
144
|
}
|
|
129
145
|
if (t.hasDimOthers) t.cancelDimOthers();
|
|
130
|
-
if (isArray(value) && value.length > 1 && value.some(item => item.locked || item.editable === "single")) {
|
|
131
|
-
value = value.filter(item => !(item.locked || item.editable === "single"));
|
|
132
|
-
}
|
|
133
146
|
if (t.single) {
|
|
134
147
|
delete t.element.syncEventer;
|
|
135
148
|
delete t.element.__world.ignorePixelSnap;
|
|
@@ -1455,6 +1468,9 @@ class EditBox extends Group {
|
|
|
1455
1468
|
this.widgets.push(new item(this));
|
|
1456
1469
|
});
|
|
1457
1470
|
}
|
|
1471
|
+
getWidget(name) {
|
|
1472
|
+
return this.widgets.find(item => item.tag === name);
|
|
1473
|
+
}
|
|
1458
1474
|
loadWidgets() {
|
|
1459
1475
|
this.widgets.forEach(item => item.onLoad());
|
|
1460
1476
|
}
|
package/dist/editor.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Event as t,isArray as e,Group as i,Matrix as s,defineKey as o,isNull as r,isUndefined as n,isObject as a,DataHelper as h,MatrixHelper as l,BoundsHelper as d,LeafBoundsHelper as g,getMatrixData as c,getBoundsData as u,surfaceType as f,UI as p,ColorConvert as m,isString as E,Paint as v,Rect as w,Bounds as b,LeafList as y,Direction9 as k,AroundHelper as L,MathHelper as x,PointHelper as T,isNumber as O,Box as S,Debug as _,ResizeEvent as B,getPointData as C,Text as M,LeafHelper as R,PropertyEvent as P,Plugin as V,RenderEvent as H,LeaferEvent as D,Creator as A,dataType as I}from"@leafer-ui/draw";import{PointerEvent as F,DragEvent as W,MoveEvent as z,ZoomEvent as Z,DragBoundsHelper as X,KeyEvent as Y,RotateEvent as G,useModule as U}from"@leafer-ui/core";import"@leafer-in/resize";function K(t,e,i,s){var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(r<3?o(n):r>3?o(e,i,n):o(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n}function j(t){return t?e(t)?t:[t]:[]}"function"==typeof SuppressedError&&SuppressedError;class N extends t{get list(){return j(this.value)}get oldList(){return j(this.oldValue)}constructor(t,e){super(t),e&&Object.assign(this,e)}}N.BEFORE_SELECT="editor.before_select",N.SELECT="editor.select",N.AFTER_SELECT="editor.after_select",N.BEFORE_HOVER="editor.before_hover",N.HOVER="editor.hover";const $=(t,e)=>t.parent.children.indexOf(t)-e.parent.children.indexOf(e),q=(t,e)=>e.parent.children.indexOf(e)-t.parent.children.indexOf(t),J={group(t,e,o){t.sort(q);const{app:r,parent:n}=t[0];let a;a=o&&o.add?o:new i(o),n.addAt(a,n.children.indexOf(t[0])),t.sort($);const h=new s(e.worldTransform);return h.divideParent(n.scrollWorldTransform),a.setTransform(h),a.editable=!0,a.hitChildren=!1,r.lockLayout(),t.forEach(t=>t.dropTo(a)),r.unlockLayout(),a},ungroup(t){const{app:e}=t[0],i=[];return e.lockLayout(),t.forEach(t=>{if(t.isBranch){const{parent:e,children:s}=t;for(;s.length;)i.push(s[0]),s[0].dropTo(e,e.children.indexOf(t));t.isBranchLeaf?i.push(t):t.remove()}else i.push(t)}),e.unlockLayout(),i},toTop(t){t.sort($),t.forEach(t=>{t.parent&&t.parent.add(t)})},toBottom(t){t.sort(q),t.forEach(t=>{t.parent&&t.parent.addAt(t,0)})},mergeMaskConfig(t,e){},getSiblingMaskElements(t){}};function Q(t){return(i,s)=>{const r="_"+s;o(i,s,{get(){return this[r]},set(i){const o=this[r];if(o!==i){const n=this;if(n.config){const t="target"===s;if(t){const{beforeSelect:t}=n.config;if(t){const e=t({target:i});if(a(e))i=e;else if(!1===e)return}n.hasDimOthers&&n.cancelDimOthers(),e(i)&&i.length>1&&i.some(t=>t.locked||"single"===t.editable)&&(i=i.filter(t=>!(t.locked||"single"===t.editable))),n.single&&(delete n.element.syncEventer,delete n.element.__world.ignorePixelSnap)}const r=t?N.BEFORE_SELECT:N.BEFORE_HOVER;this.hasEvent(r)&&this.emitEvent(new N(r,{editor:n,value:i,oldValue:o}))}this[r]=i,t(this,o)}}})}}function tt(){return(t,e)=>{o(t,e,{get(){const t=this,{config:e,userConfig:i,configKeepKeys:s}=t,o=e?h.clone(e):{};if(s)for(let t in i)s.includes(t)||(o[t]=i[t]);return t.preMergedConfig&&t.preMergedConfig(o),s&&s.forEach(t=>{i[t]&&Object.assign(o[t],i[t])}),t.mergedConfig=o}})}}const{abs:et}=Math,{copy:it}=l,{setListWithFn:st}=d,{worldBounds:ot}=g,rt=c(),nt=u();class at extends p{constructor(){super(),this.list=[],this.visible=0,this.hittable=!1,this.strokeAlign="center"}setTarget(t,e){e&&this.set(e),this.target=t,this.update()}update(t){const{list:e}=this;e.length?(st(nt,e,ot),t&&this.set(t),this.set(nt),this.visible=!0,this.forceUpdate("surface")):this.visible=0}__draw(t,e){const{list:i}=this;if(i.length){let s;const o=this.__,{stroke:r,strokeWidth:n,fill:a}=o,{bounds:h}=e;for(let l=0;l<i.length;l++){s=i[l];const{worldTransform:d,worldRenderBounds:g}=s;if(g.width&&g.height&&(!h||h.hit(g,e.matrix))){const i=et(d.scaleX),h=et(d.scaleY);switch(it(rt,d),rt.half=n%2,t.setWorld(rt,e.matrix),t.beginPath(),this.strokePathType){case"box":const{boxBounds:e}=s.__layout;t.rect(e.x,e.y,e.width,e.height);break;case"stroke":const{strokeBounds:i}=s.__layout;t.rect(i.x,i.y,i.width,i.height);break;case"path":s.__drawPath(t);break;default:s.__.__useArrow?s.__drawPath(t):s.__.__pathForRender?s.__drawRenderPath(t):s.__drawPathByBox(t)}if(o.strokeWidth=n/Math.max(i,h),o.shadow){const e=o.shadow[0],{scaleX:i,scaleY:s}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*s,e.blur*i,m.string(e.color))}r&&(E(r)?v.stroke(r,this,t,e):v.strokes(r,this,t,e)),a&&(E(a)?v.fill(a,this,t,e):v.fills(a,this,t,e)),o.shadow&&t.restore()}}o.strokeWidth=n}}destroy(){this.target=null,super.destroy()}}K([Q(function(t){const i=t.target;t.list=i?e(i)?i:[i]:[]})],at.prototype,"target",void 0),K([f("render-path")],at.prototype,"strokePathType",void 0);class ht extends i{constructor(t){super(t),this.strokeArea=new w({strokeAlign:"center"}),this.fillArea=new w,this.visible=0,this.hittable=!1,this.addMany(this.fillArea,this.strokeArea)}setStyle(t,e){const{visible:i,stroke:s,strokeWidth:o}=t;this.visible=i,this.strokeArea.reset(Object.assign({stroke:s,strokeWidth:o},e||{})),this.fillArea.reset({visible:!e,fill:s,opacity:.2})}setBounds(t){this.strokeArea.set(t),this.fillArea.set(t)}}const lt={findOne:t=>t.list.find(t=>t.editable),findByBounds(t,e,i="hit"){const s=[];return dt([t],s,e,i),s}};function dt(t,e,i,s){let o,r,n;for(let a=0,h=t.length;a<h;a++)if(o=t[a],r=o.__,r.hittable&&r.visible&&!r.locked&&i.hit(o.__world)){if(r.editable&&"single"!==r.editable)if(o.isFrame){if(i.includes(o.__layout.boxBounds,o.__world)){e.push(o);continue}}else if(n=i[s](o.__layout.boxBounds,o.__world)&&r.hitSelf,o.isBranch){if(!r.hitChildren||n&&o.children.every(t=>!t.editable)){n&&e.push(o);continue}}else n&&e.push(o);o.isBranch&&dt(o.children,e,i,s)}}const{findOne:gt,findByBounds:ct}=lt;class ut extends i{get dragging(){return!!this.originList}get running(){const{editor:t,app:e}=this;return this.hittable&&t.visible&&t.hittable&&t.mergeConfig.selector&&e&&"normal"===e.mode}get isMoveMode(){const{app:t}=this;return t&&t.interaction.moveMode}constructor(t){super(),this.hoverStroker=new at,this.targetStroker=new at,this.bounds=new b,this.selectArea=new ht,this.__eventIds=[],this.editor=t,this.addMany(this.targetStroker,this.hoverStroker,this.selectArea),this.__listenEvents()}onHover(){const{editor:t}=this;if(!this.running||this.dragging||t.dragging)this.hoverStroker.target=null;else{const{hoverTarget:e,mergeConfig:i}=t,s=Object.assign({},i);e&&e.editConfig&&Object.assign(s,e.editConfig);const{stroke:o,strokeWidth:r,hover:n,hoverStyle:a,hoverPathType:h}=s;this.hoverStroker.setTarget(n?e:null,Object.assign({stroke:o,strokeWidth:r,strokePathType:h},a||{}))}}onSelect(){if(this.running){const{editor:t}=this;let{list:e}=t;const i=J.getSiblingMaskElements(t);i&&(e=i.concat(e)),this.targetStroker.setTarget(e),this.hoverStroker.target=null}}update(){this.hoverStroker.update();const{stroke:t,strokeWidth:e,selectedPathType:i,selectedStyle:s}=this.editor.mergedConfig;this.targetStroker.update(Object.assign({stroke:t,strokeWidth:e&&Math.max(1,e/2),strokePathType:i},s||{}))}onPointerMove(t){const{app:e,editor:i}=this;if(this.running&&!this.isMoveMode&&e.interaction.canHover&&!e.interaction.dragging){const e=this.findUI(t);i.hoverTarget=i.hasItem(e)?null:e}this.isMoveMode&&(i.hoverTarget=null)}onBeforeDown(t){if(t.multiTouch)return;const{select:e}=this.editor.mergeConfig;"press"===e&&(this.app.config.mobile?this.waitSelect=()=>this.checkAndSelect(t):this.checkAndSelect(t))}onTap(t){if(t.multiTouch)return;const{editor:e}=this,{select:i,selectKeep:s}=e.mergeConfig;"tap"===i?this.checkAndSelect(t):this.waitSelect&&this.waitSelect(),this.needRemoveItem?e.removeItem(this.needRemoveItem):this.isMoveMode&&(s||(e.target=null))}checkAndSelect(t){if(this.needRemoveItem=null,this.allowSelect(t)){const{editor:e}=this,i=this.findUI(t);i?(this.isMultipleSelect(t)?e.hasItem(i)?this.needRemoveItem=i:e.addItem(i):e.target=i,t.path.needUpdate=!0):this.allow(t.target)&&(this.isHoldMultipleSelectKey(t)||this.editor.mergedConfig.selectKeep||(e.target=null))}}onDragStart(t){if(!t.multiTouch&&(this.waitSelect&&this.waitSelect(),this.allowDrag(t))){const{editor:e}=this,{stroke:i,area:s}=e.mergeConfig,{x:o,y:r}=t.getInnerPoint(this);this.bounds.set(o,r),this.selectArea.setStyle({visible:!0,stroke:i,x:o,y:r},s),this.selectArea.setBounds(this.bounds.get()),this.originList=e.leafList.clone()}}onDrag(t){if(!t.multiTouch){if(this.editor.dragging)return this.onDragEnd(t);if(this.dragging){const{editor:e}=this,i=t.getInnerTotal(this),s=this.bounds.clone().unsign(),o=new y(ct(e.app,s,"includes"===e.mergedConfig.boxSelect?"includes":"hit"));if(this.bounds.width=i.x,this.bounds.height=i.y,this.selectArea.setBounds(s.get()),o.length){const t=[];this.originList.forEach(e=>{o.has(e)||t.push(e)}),o.forEach(e=>{this.originList.has(e)||t.push(e)}),(t.length!==e.list.length||e.list.some((e,i)=>e!==t[i]))&&(e.target=t)}else e.target=this.originList.list}}}onDragEnd(t){t.multiTouch||this.dragging&&(this.originList=null,this.selectArea.visible=0)}onAutoMove(t){if(this.dragging){const{x:e,y:i}=t.getLocalMove(this);this.bounds.x+=e,this.bounds.y+=i}}allow(t){return t.leafer!==this.editor.leafer}allowDrag(t){const{boxSelect:e,multipleSelect:i}=this.editor.mergeConfig;return!(!(this.running&&i&&e)||t.target.draggable)&&(!this.editor.editing&&this.allow(t.target)||this.isHoldMultipleSelectKey(t)&&!gt(t.path))}allowSelect(t){return this.running&&!this.isMoveMode&&!t.middle}findDeepOne(t){const e={exclude:new y(this.editor.editBox.rect)};return gt(t.target.leafer.interaction.findPath(t,e))}findUI(t){return this.isMultipleSelect(t)?this.findDeepOne(t):gt(t.path)}isMultipleSelect(t){const{multipleSelect:e,continuousSelect:i}=this.editor.mergeConfig;return e&&(this.isHoldMultipleSelectKey(t)||i)}isHoldMultipleSelectKey(t){const{multipleSelectKey:e}=this.editor.mergedConfig;return e?t.isHoldKeys(e):t.shiftKey}__listenEvents(){const{editor:t}=this;t.waitLeafer(()=>{const{app:e}=t;e.selector.proxy=t,this.__eventIds=[t.on_([[N.HOVER,this.onHover,this],[N.SELECT,this.onSelect,this]]),e.on_([[F.MOVE,this.onPointerMove,this],[F.BEFORE_DOWN,this.onBeforeDown,this],[F.TAP,this.onTap,this],[W.START,this.onDragStart,this,!0],[W.DRAG,this.onDrag,this],[W.END,this.onDragEnd,this],[z.MOVE,this.onAutoMove,this],[[Z.ZOOM,z.MOVE],()=>{this.editor.hoverTarget=null}]])]})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=this.originList=this.needRemoveItem=null,this.__removeListenEvents(),super.destroy()}}const{topLeft:ft,top:pt,topRight:mt,right:Et,bottomRight:vt,bottom:wt,bottomLeft:bt,left:yt}=k,{toPoint:kt}=L,{within:Lt,sign:xt}=x,{abs:Tt}=Math,Ot={getScaleData(t,e,i,s,o,r,n,a){let h,l,d={},g=1,c=1;const{widthRange:u,heightRange:f,dragBounds:p,worldTransform:m,boxBounds:E}=t,{width:v,height:w}=e,b=Tt(m.scaleX),y=Tt(m.scaleY),k=t.scaleX/e.scaleX,L=t.scaleY/e.scaleY,x=xt(k),T=xt(L),S=a?k:x*E.width/v,_=a?L:T*E.height/w;if(O(s))g=c=Math.sqrt(s);else{r&&(s.x*=2,s.y*=2),s.x*=a?k:x,s.y*=a?L:T;const t=(-s.y+w)/w,e=(s.x+v)/v,n=(s.y+w)/w,d=(-s.x+v)/v;switch(i){case pt:c=t,h="bottom";break;case Et:g=e,h="left";break;case wt:c=n,h="top";break;case yt:g=d,h="right";break;case ft:c=t,g=d,h="bottom-right";break;case mt:c=t,g=e,h="bottom-left";break;case vt:c=n,g=e,h="top-left";break;case bt:c=n,g=d,h="top-right"}if(o)if("corner"===o&&i%2)o=!1;else switch(i){case pt:case wt:g=c;break;case yt:case Et:c=g;break;default:l=Math.sqrt(Tt(g*c)),g=xt(g)*l,c=xt(c)*l}}const B=1!==g,C=1!==c;if(B&&(g/=S),C&&(c/=_),n||(g<0&&(g=1/E.width/b),c<0&&(c=1/E.height/y)),kt(r||h,E,d,!0),p){const e={x:g,y:c};X.limitScaleOf(t,d,e,o),g=e.x,c=e.y}if(B&&u){const e=E.width*t.scaleX;g=Lt(e*g,u)/e}if(C&&f){const e=E.height*t.scaleY;c=Lt(e*c,f)/e}const M=b*E.width,R=y*E.height;return B&&Tt(g*M)<1&&(g=1*xt(g)/M),C&&Tt(c*R)<1&&(c=1*xt(c)/R),o&&g!==c&&(l=Math.min(Tt(g),Tt(c)),g=xt(g)*l,c=xt(c)*l),isFinite(g)||(g=1),isFinite(c)||(c=1),{origin:d,scaleX:g,scaleY:c,direction:i,lockRatio:o,around:r}},getRotateData(t,e,i,s,o){let r,n={};switch(e){case ft:r="bottom-right";break;case mt:r="bottom-left";break;case vt:r="top-left";break;case bt:r="top-right";break;default:r="center"}return kt(o||r,t.boxBounds,n,!0),{origin:n,rotation:T.getRotation(s,t.getWorldPointByBox(n),i)}},getSkewData(t,e,i,s){let o,r,n={},a=0,h=0;switch(e){case pt:case ft:r={x:.5,y:0},o="bottom",a=1;break;case wt:case vt:r={x:.5,y:1},o="top",a=1;break;case yt:case bt:r={x:0,y:.5},o="right",h=1;break;case Et:case mt:r={x:1,y:.5},o="left",h=1}const{boxBounds:l}=t,{width:d,height:g}=l;r.x=r.x*d,r.y=r.y*g,kt(s||o,l,n,!0);const c=T.getRotation(r,n,{x:r.x+(a?i.x:0),y:r.y+(h?i.y:0)});return a?a=-c:h=c,{origin:n,skewX:a,skewY:h}},getAround:(t,e)=>e&&!t?"center":t,getRotateDirection:(t,e,i=8)=>((t=(t+Math.round(e/(360/i)))%i)<0&&(t+=i),t),getFlipDirection(t,e,i){if(e)switch(t){case yt:t=Et;break;case ft:t=mt;break;case bt:t=vt;break;case Et:t=yt;break;case mt:t=ft;break;case vt:t=bt}if(i)switch(t){case pt:t=wt;break;case ft:t=bt;break;case mt:t=vt;break;case wt:t=pt;break;case bt:t=ft;break;case vt:t=mt}return t}},St={};function _t(t){const{moveCursor:e,moveable:i}=t.mergeConfig;t.canUse&&(t.rect.cursor=i?e:void 0)}function Bt(t,e){return'"data:image/svg+xml,'+encodeURIComponent(t.replace("{{rotation}}",e.toString()))+'"'}class Ct extends S{constructor(t){super(t),this.useFastShadow=!0}}const Mt=["top","right","bottom","left"],Rt=void 0,Pt=_.get("EditBox");class Vt extends i{get mergeConfig(){const{config:t}=this,{mergeConfig:e,editBox:i}=this.editor;return this.mergedConfig=t&&i!==this?Object.assign(Object.assign({},e),t):e}get target(){return this._target||this.editor.element}set target(t){this._target=t}get single(){return!!this._target||this.editor.single}get transformTool(){return this._transformTool||this.editor}set transformTool(t){this._transformTool=t}get flipped(){return this.flippedX||this.flippedY}get flippedX(){return this.scaleX<0}get flippedY(){return this.scaleY<0}get flippedOne(){return this.scaleX*this.scaleY<0}get canUse(){return this.app&&this.editor.editing}get canGesture(){if(!this.canUse)return!1;const{moveable:t,resizeable:e,rotateable:i}=this.mergeConfig;return E(t)||E(e)||E(i)}get canDragLimitAnimate(){return this.moving&&this.mergeConfig.dragLimitAnimate&&this.target.dragBounds}constructor(t){super(),this.view=new i,this.rect=new Ct({name:"rect",hitFill:"all",hitStroke:"none",strokeAlign:"center",hitRadius:5}),this.circle=new Ct({name:"circle",strokeAlign:"center",around:"center",cursor:"crosshair",hitRadius:5}),this.buttons=new i({around:"center",hitSelf:!1,visible:0}),this.resizePoints=[],this.rotatePoints=[],this.resizeLines=[],this.dragStartData={},this.__eventIds=[],this.widgets=[],this.editor=t,this.visible=!1,this.create(),this.__listenEvents(),this.createWidgets()}create(){let t,e,i;const{view:s,resizePoints:o,rotatePoints:r,resizeLines:n,rect:a,circle:h,buttons:l}=this,d=["bottom-right","bottom","bottom-left","left","top-left","top","top-right","right"];for(let s=0;s<8;s++)t=new Ct({name:"rotate-point",around:d[s],width:15,height:15,hitFill:"all"}),r.push(t),this.listenPointEvents(t,"rotate",s),s%2&&(e=new Ct({name:"resize-line",around:"center",width:10,height:10,hitFill:"all"}),n.push(e),this.listenPointEvents(e,"resize",s)),i=new Ct({name:"resize-point",hitRadius:5}),o.push(i),this.listenPointEvents(i,"resize",s);this.listenPointEvents(h,"rotate",2),this.listenPointEvents(a,"move",8),s.add([...r,a,h,l,...n,...o]),this.add(s)}showView(){this.view.opacity=1,this.update()}hideView(){this.view.opacity=0}load(){const{target:t,mergeConfig:e,single:i,rect:s,circle:o,resizePoints:n,resizeLines:a}=this,{stroke:l,strokeWidth:d,ignorePixelSnap:g}=e,c=this.getPointsStyle(),u=this.getMiddlePointsStyle(),f=this.getResizeLinesStyle();let p;this.visible=!t.locked;for(let t=0;t<8;t++)p=n[t],p.children.length&&p.clear(),p.set(this.getPointStyle(t%2?u[(t-1)/2%u.length]:c[t/2%c.length])),p.rotation=(t-(t%2?1:0))/2*90,t%2&&a[(t-1)/2].set(Object.assign({pointType:"resize",rotation:(t-1)/2*90},f[(t-1)/2%f.length]||{}));o.set(this.getPointStyle(e.circle||e.rotatePoint||c[0])),s.set(Object.assign({stroke:l,strokeWidth:d,opacity:1,editConfig:Rt},e.rect||{}));const m=r(e.rectThrough)?i:e.rectThrough;s.hittable=!m,m&&this.addBottomList(),i&&h.stintSet(t.__world,"ignorePixelSnap",g),this.updateMoveCursor(),this.loadWidgets()}update(){const{editor:t,target:e}=this;if(!e)return;const{x:i,y:s,scaleX:o,scaleY:r,rotation:n,skewX:a,skewY:h,width:l,height:d}=e.getLayoutBounds("box",t,!0);this.visible=!this.target.locked,this.set({x:i,y:s,scaleX:o,scaleY:r,rotation:n,skewX:a,skewY:h}),this.updateBounds({x:0,y:0,width:l,height:d}),this.updateWidgets()}unload(){this.unloadWidgets(),this.visible=!1,this.removeBottomList()}addBottomList(){const{target:t,rect:e}=this;t.syncEventer=e,this.app.interaction.bottomList=[{target:e,proxy:t}]}removeBottomList(){this.app&&(this.rect.syncEventer=this.app.interaction.bottomList=null)}updateBounds(t){const{editor:e,target:i,mergeConfig:s,single:o,rect:r,circle:a,buttons:h,resizePoints:l,rotatePoints:g,resizeLines:c}=this,{editMask:u}=e,{middlePoint:f,resizeable:p,rotateable:m,hideOnSmall:E,editBox:v,editBoxType:w,mask:b,dimOthers:y,bright:k,spread:x,hideRotatePoints:T,hideResizeLines:S}=s;if("stroke"===w){const{scaleX:e,scaleY:s}=i.worldTransform,{strokeBoxSpread:o}=i.__layout;o&&d.spread(t,[o*Math.abs(s),o*Math.abs(e)])}if(x&&d.spread(t,x),this.rectBounds=t,u.visible=!!b||0,n(y)&&n(k)?e.hasDimOthers&&e.cancelDimOthers():(e.setDimOthers(y),e.setBright(!!y||k),e.hasDimOthers=!0),this.view.worldOpacity){const{width:e,height:i}=t,n=O(E)?E:10,d=this.showPoints=v&&!(E&&e<n&&i<n);let u,w,b,y={};for(let s=0;s<8;s++)L.toPoint(L.directionData[s],t,y),w=l[s],u=g[s],w.set(y),u.set(y),w.visible=d&&!(!p&&!m),u.visible=d&&m&&p&&!T,s%2&&(b=c[(s-1)/2],b.set(y),b.visible=w.visible&&!S,w.visible&&(w.visible=!!f),u.visible&&(u.visible=!!f),(s+1)/2%2?(b.width=e+b.height,E&&2*w.width>e&&(w.visible=!1)):(b.width=i+b.height,E&&2*w.width>i&&(w.visible=!1)));a.visible=d&&m&&!(!s.circle&&!s.rotatePoint),a.visible&&this.layoutCircle(),r.path&&(r.path=null),r.set(Object.assign(Object.assign({},t),{visible:!o||v})),h.visible=d&&h.children.length>0||0,h.visible&&this.layoutButtons()}else r.set(t)}layoutCircle(){const{circleDirection:t,circleMargin:e,buttonsMargin:i,buttonsDirection:s,middlePoint:o}=this.mergedConfig,r=Mt.indexOf(t||(this.buttons.children.length&&"bottom"===s?"top":"bottom"));this.setButtonPosition(this.circle,r,e||i,!!o)}layoutButtons(){const{buttons:t}=this,{buttonsDirection:e,buttonsFixed:i,buttonsMargin:s,middlePoint:o}=this.mergedConfig,{flippedX:r,flippedY:n}=this;let a=Mt.indexOf(e);(a%2&&r||(a+1)%2&&n)&&i&&(a=(a+2)%4);const h=i?Ot.getRotateDirection(a,this.flippedOne?this.rotation:-this.rotation,4):a;this.setButtonPosition(t,h,s,!!o),i&&(t.rotation=90*(h-a)),t.scaleX=r?-1:1,t.scaleY=n?-1:1}setButtonPosition(t,e,i,s){const o=this.resizePoints[2*e+1],r=e%2,n=e&&3!==e?1:-1,a=(i+(e%2?(s?o.width:0)+t.boxBounds.width:(s?o.height:0)+t.boxBounds.height)/2)*n;r?(t.x=o.x+a,t.y=o.y):(t.x=o.x,t.y=o.y+a)}getPointStyle(t){const{stroke:e,strokeWidth:i,pointFill:s,pointSize:o,pointRadius:r}=this.mergedConfig,n={fill:s,stroke:e,strokeWidth:i,around:"center",strokeAlign:"center",opacity:1,width:o,height:o,cornerRadius:r,offsetX:0,offsetY:0,editConfig:Rt};return t?Object.assign(n,t):n}getPointsStyle(){const{point:t}=this.mergedConfig;return e(t)?t:[t]}getMiddlePointsStyle(){const{middlePoint:t}=this.mergedConfig;return e(t)?t:t?[t]:this.getPointsStyle()}getResizeLinesStyle(){const{resizeLine:t}=this.mergedConfig;return e(t)?t:[t]}updateMoveCursor(){_t(this)}updatePointCursor(t){!function(t,e){const{enterPoint:i,dragging:s,skewing:o,resizing:r,flippedX:n,flippedY:a}=t;if(!i||!t.editor.editing||!t.canUse)return;if("rect"===i.name)return _t(t);if("circle"===i.name)return;let{rotation:h}=t;const{pointType:l}=i,{moveCursor:d,resizeCursor:g,rotateCursor:c,skewCursor:u,moveable:f,resizeable:p,rotateable:m,skewable:E}=t.mergeConfig;if("move"===l)return i.cursor=d,void(f||(i.visible=!1));if("button"===l)return void(i.cursor||(i.cursor="pointer"));let v=l.includes("resize");v&&m&&(t.isHoldRotateKey(e)||!p)&&(v=!1);const w=E&&!v&&("resize-line"===i.name||"skew"===l),b=s?o?u:r?g:c:w?u:v?g:c;h+=45*(Ot.getFlipDirection(i.direction,n,a)+1),h=2*Math.round(x.formatRotation(h,!0)/2);const{url:y,x:k,y:L}=b,T=y+h;St[T]?i.cursor=St[T]:St[T]=i.cursor={url:Bt(y,h),x:k,y:L}}(this,t)}onDragStart(t){this.dragging=!0;const e=this.dragPoint=t.current,{pointType:i}=e,{moveable:s,resizeable:o,rotateable:r,skewable:n,onCopy:a}=this.mergeConfig;"move"===i?(t.altKey&&a&&a()&&this.editor.single&&this.app.interaction.replaceDownTarget(this.target),s&&(this.moving=!0),this.moving&&this.widgetsMoveStart(t)):(i.includes("rotate")||this.isHoldRotateKey(t)||!o?(r&&(this.rotating=!0),"resize-rotate"===i?o&&(this.resizing=!0):"resize-line"===e.name&&(n&&(this.skewing=!0),this.rotating=!1)):"resize"===i&&o&&(this.resizing=!0),"skew"===i&&n&&(this.skewing=!0)),this.onTransformStart(t)}onDrag(t){const{transformTool:e,moving:i,resizing:s,rotating:o,skewing:r}=this;if(i)e.onMove(t),this.widgetsMove(t);else if(s||o||r){const i=t.current;i.pointType&&(this.enterPoint=i),o&&e.onRotate(t),s&&e.onScale(t),r&&e.onSkew(t)}this.updatePointCursor(t)}onDragEnd(t){this.moving&&this.widgetsMoveEnd(t),this.onTransformEnd(t),this.dragPoint=null}onTransformStart(t){const{hideOnMove:e}=this.mergedConfig;(this.moving||this.gesturing)&&(this.editor.opacity=e?0:1),this.resizing&&(B.resizingKeys=this.editor.leafList.keys);const{dragStartData:i,target:s}=this;i.x=t.x,i.y=t.y,i.totalOffset=C(),i.point={x:s.x,y:s.y},i.bounds=Object.assign({},s.getLayoutBounds("box","local")),i.rotation=s.rotation}onTransformEnd(t){this.canDragLimitAnimate&&(t instanceof W||t instanceof z)&&this.transformTool.onMove(t),this.resizing&&(B.resizingKeys=null),this.dragging=this.gesturing=this.moving=this.resizing=this.rotating=this.skewing=!1,this.editor.opacity=1,this.editor.update()}onMove(t){if(this.canGesture&&"drag"!==t.moveType&&(t.stop(),E(this.mergedConfig.moveable)))switch(this.gesturing=this.moving=!0,t.type){case z.START:this.onTransformStart(t),this.widgetsMoveStart(t);break;case z.END:this.onTransformEnd(t),this.widgetsMoveEnd(t);break;default:this.transformTool.onMove(t),this.widgetsMove(t)}}onScale(t){if(this.canGesture&&(t.stop(),E(this.mergedConfig.resizeable)))switch(this.gesturing=this.resizing=!0,t.type){case Z.START:this.onTransformStart(t);break;case Z.END:this.onTransformEnd(t);break;default:this.transformTool.onScale(t)}}onRotate(t){if(this.canGesture&&(t.stop(),E(this.mergedConfig.rotateable)))switch(this.gesturing=this.rotating=!0,t.type){case Z.START:this.onTransformStart(t);break;case Z.END:this.onTransformEnd(t);break;default:this.transformTool.onRotate(t)}}isHoldRotateKey(t){const{rotateKey:e}=this.mergedConfig;return e?t.isHoldKeys(e):t.metaKey||t.ctrlKey}onKey(t){this.updatePointCursor(t)}onArrow(t){if(this.canUse){let e=0,i=0;switch(t.code){case"ArrowDown":i=1;break;case"ArrowUp":i=-1;break;case"ArrowLeft":e=-1;break;case"ArrowRight":e=1}if(e||i){const{keyEvent:s,arrowStep:o,arrowFastStep:r}=this.mergeConfig;if(s){const s=t.shiftKey?r:o;this.transformTool.move(e*s,i*s)}}}}onDoubleTap(t){const{openInner:e,preventEditInner:i}=this.mergeConfig;"double"!==e||i||this.openInner(t)}onLongPress(t){const{openInner:e,preventEditInner:i}=this.mergeConfig;"long"===e&&i&&this.openInner(t)}openInner(t){const{editor:e,target:i}=this;if(this.single){if(i.locked)return;if(i.isBranch&&!i.editInner){if(i.textBox){const{children:t}=i,s=t.find(t=>t.editable&&t instanceof M)||t.find(t=>t instanceof M);if(s)return e.openInnerEditor(s)}e.openGroup(i),e.target=e.selector.findDeepOne(t)}else e.openInnerEditor()}}listenPointEvents(t,e,i){t.direction=i,t.pointType=e,this.__eventIds.push(t.on_([[W.START,this.onDragStart,this],[W.DRAG,this.onDrag,this],[W.END,this.onDragEnd,this],[F.ENTER,e=>{this.enterPoint=t,this.updatePointCursor(e)}],[F.LEAVE,()=>{this.enterPoint=null}]]))}__listenEvents(){const{rect:t,editor:e,__eventIds:i}=this;i.push(t.on_([[F.DOUBLE_TAP,this.onDoubleTap,this],[F.LONG_PRESS,this.onLongPress,this]])),this.waitLeafer(()=>{i.push(e.app.on_([[[Y.HOLD,Y.UP],this.onKey,this],[Y.DOWN,this.onArrow,this],[[z.START,z.BEFORE_MOVE,z.END],this.onMove,this,!0],[[Z.START,Z.BEFORE_ZOOM,Z.END],this.onScale,this,!0],[[G.START,G.BEFORE_ROTATE,G.END],this.onRotate,this,!0]]))})}__removeListenEvents(){this.off_(this.__eventIds)}static registerWidget(t){const{tag:e}=t.prototype;Vt.WidgetList[e]&&Pt.repeat(e),Vt.WidgetList[e]=t}createWidgets(){Object.values(Vt.WidgetList).forEach(t=>{this.widgets.push(new t(this))})}loadWidgets(){this.widgets.forEach(t=>t.onLoad())}updateWidgets(){this.widgets.forEach(t=>t.onUpdate())}unloadWidgets(){this.widgets.forEach(t=>t.onUnload())}widgetsMoveStart(t){this.widgets.forEach(e=>e.onMove&&e.onMoveStart(t))}widgetsMove(t){this.widgets.forEach(e=>e.onMove&&e.onMove(t))}widgetsMoveEnd(t){this.widgets.forEach(e=>e.onMove&&e.onMoveEnd(t))}destroyWidgets(){this.widgets.forEach(t=>t.onDestroy())}destroy(){this.editor=null,this.__removeListenEvents(),this.destroyWidgets(),super.destroy()}}Vt.WidgetList={};const Ht={x:0,y:0,width:1e5,height:1e5};class Dt extends p{constructor(t){super(),this.editor=t,this.hittable=!1,this.visible=0}__updateWorldBounds(){Object.assign(this.__local,Ht),Object.assign(this.__world,Ht)}__draw(t,e){const{editor:i}=this,{mask:s}=i.mergedConfig;if(s&&i.editing){if(t.fillWorld(t.bounds,!0===s?"rgba(0,0,0,0.8)":s),e.bounds&&!e.bounds.hit(i.editBox.rect.__world,e.matrix))return;t.saveBlendMode("destination-out"),e=Object.assign(Object.assign({},e),{shape:!0}),i.list.forEach(i=>{i.__render(t,e);const{parent:s}=i;s&&s.textBox&&s.__renderShape(t,e)}),t.restoreBlendMode()}}destroy(){this.editor=null,super.destroy()}}const At='\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1.5"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>\n<feBlend mode="normal" in="SourceGraphic" result="shape"/>',It={editSize:"size",keyEvent:!0,stroke:"#836DFF",strokeWidth:2,pointFill:"#FFFFFF",pointSize:10,pointRadius:16,rotateGap:45,arrowStep:1,arrowFastStep:10,buttonsDirection:"bottom",buttonsMargin:12,hideOnSmall:!0,moveCursor:"move",resizeCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate({{rotation}},12,12)">\n<path d="M7.5 8.0H8.5V5.9L6.8 7.2L7.5 8.0ZM3 11.4L2.3 10.6L1.3 11.4L2.3 12.2L3 11.4ZM7.5 10.4H6.5V11.4H7.5V10.4ZM16.5 10.4V11.4H17.5V10.4H16.5ZM16.5 8.0L17.1 7.2L15.5 5.9V8.0H16.5ZM21 11.4L21.6 12.2L22.6 11.4L21.6 10.6L21 11.4ZM16.5 14.9H15.5V16.9L17.1 15.7L16.5 14.9ZM16.5 12.4H17.5V11.4H16.5V12.4ZM7.5 12.4V11.4H6.5V12.4H7.5ZM7.5 14.9L6.8 15.7L8.5 16.9V14.9H7.5ZM6.8 7.2L2.3 10.6L3.6 12.2L8.1 8.7L6.8 7.2ZM8.5 10.4V8.0H6.5V10.4H8.5ZM16.5 9.4H7.5V11.4H16.5V9.4ZM17.5 10.4V8.0H15.5V10.4H17.5ZM15.8 8.7L20.3 12.2L21.6 10.6L17.1 7.2L15.8 8.7ZM20.3 10.6L15.8 14.1L17.1 15.7L21.6 12.2L20.3 10.6ZM17.5 14.9V12.4H15.5V14.9H17.5ZM7.5 13.4H16.5V11.4H7.5V13.4ZM8.5 14.9V12.4H6.5V14.9H8.5ZM2.3 12.2L6.8 15.7L8.1 14.1L3.6 10.6L2.3 12.2Z" fill="white"/>\n<path fill-rule="evenodd" d="M3 11.4L7.5 8.0V10.4H16.5V8.0L21 11.4L16.5 14.9V12.4H7.5V14.9L3 11.4Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="3.9" width="27.2" height="16.9" filterUnits="userSpaceOnUse">\n${At}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},rotateCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(135,12,12),rotate({{rotation}},12,12)">\n<path d="M20.4 8H21.4L20.8 7.1L17.3 2.6L17 2.1L16.6 2.6L13.1 7.1L12.5 8H13.5H15.4C14.9 11.8 11.8 14.9 8 15.4V13.5V12.5L7.1 13.1L2.6 16.6L2.1 17L2.6 17.3L7.1 20.8L8 21.4V20.4V18.4C13.5 17.9 17.9 13.5 18.4 8H20.4Z" stroke="white"/>\n<path fill-rule="evenodd" d="M17 3L20.4 7.5H17.9C17.7 13.1 13.1 17.7 7.5 17.9V20.4L3 17L7.5 13.5V15.9C12.0 15.7 15.7 12.0 15.9 7.5H13.5L17 3Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="-0.6" width="27.1" height="27.1" filterUnits="userSpaceOnUse">\n${At}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},skewCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(90,12,12),rotate({{rotation}},12,12)">\n<path d="M21 10.4L21 11.4L23.8 11.4L21.6 9.6L21 10.4ZM17 10.4V11.4L17 11.4L17 10.4ZM15.5 6L16.1 5.2L14.5 3.9V6H15.5ZM15.5 8.4V9.4H16.5V8.4H15.5ZM6 8.4V7.4H5V8.4H6ZM6 10.4H5V11.4H6V10.4ZM7 14.4V13.4L7 13.4L7 14.4ZM3 14.4L3 13.4L0.1 13.4L2.3 15.2L3 14.4ZM8.5 18.9L7.8 19.7L9.5 21.0V18.9H8.5ZM8.5 16.4V15.4H7.5V16.4H8.5ZM19 16.4V17.4H20V16.4H19ZM19 14.4H20V13.4H19V14.4ZM21 9.4L17 9.4L17 11.4L21 11.4L21 9.4ZM14.8 6.7L20.3 11.2L21.6 9.6L16.1 5.2L14.8 6.7ZM16.5 8.4V6H14.5V8.4H16.5ZM6 9.4H15.5V7.4H6V9.4ZM7 10.4V8.4H5V10.4H7ZM15.5 9.4H6V11.4H15.5V9.4ZM17 9.4H15.5V11.4H17V9.4ZM7 15.4H8.5V13.4H7V15.4ZM3 15.4L7 15.4L7 13.4L3 13.4L3 15.4ZM9.1 18.1L3.6 13.6L2.3 15.2L7.8 19.7L9.1 18.1ZM7.5 16.4V18.9H9.5V16.4H7.5ZM19 15.4H8.5V17.4H19V15.4ZM18 14.4V16.4H20V14.4H18ZM8.5 15.4H19V13.4H8.5V15.4Z" fill="white"/>\n<path fill-rule="evenodd" d="M17 10.4L21 10.4L15.5 6V8.4H6V10.4H15.5H17ZM8.5 14.4H7L3 14.4L8.5 18.9V16.4H19V14.4H8.5Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter x="-2.8" y="1.9" width="29.6" height="23.1" filterUnits="userSpaceOnUse" >\n${At}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},selector:!0,editBox:!0,editBoxType:"box",hover:!0,select:"press",openInner:"double",multipleSelect:!0,boxSelect:!0,moveable:!0,resizeable:!0,flipable:!0,rotateable:!0,skewable:!0},Ft=new b;function Wt(t){const{simulateTarget:e,list:i}=t,{zoomLayer:s}=i[0].leafer;e.safeChange(()=>{Ft.setListWithFn(i,t=>t.getBounds("box","page")),0===Ft.width&&(Ft.width=.1),0===Ft.height&&(Ft.height=.1),e.reset(Ft.get())}),s.add(e)}const zt=_.get("EditToolCreator");function Zt(){return t=>{Yt.register(t)}}const Xt=Zt,Yt={EditTool:"EditTool",LineEditTool:"LineEditTool",PointsEditTool:"PointsEditTool",list:{},register(t,e){const{tag:i}=t.prototype;e||(e=i),Gt[e]&&zt.repeat(e),Gt[e]=t},get:(t,e)=>new Gt[t](e)},{list:Gt}=Yt;class Ut extends N{constructor(t,e){super(t,e)}}Ut.BEFORE_OPEN="innerEditor.before_open",Ut.OPEN="innerEditor.open",Ut.BEFORE_CLOSE="innerEditor.before_close",Ut.CLOSE="innerEditor.close";class Kt extends N{constructor(t,e){super(t,e)}}Kt.BEFORE_GROUP="editor.before_group",Kt.GROUP="editor.group",Kt.BEFORE_UNGROUP="editor.before_ungroup",Kt.UNGROUP="editor.ungroup",Kt.BEFORE_OPEN="editor.before_open_group",Kt.OPEN="editor.open_group",Kt.BEFORE_CLOSE="editor.before_close_group",Kt.CLOSE="editor.close_group";const{updateMatrix:jt}=R,Nt={x:1,y:1,scaleX:1,scaleY:1,rotation:1,skewX:1,skewY:1},$t="top-left";class qt extends w{get __tag(){return"SimulateElement"}constructor(t){super(),this.checkChange=!0,this.canChange=!0,this.visible=this.hittable=!1,this.skipJSON=!0,this.on(P.CHANGE,e=>{if(this.checkChange&&Nt[e.attrName]){const{attrName:i,newValue:o,oldValue:r}=e,n="s"===i[0]?(o||1)/(r||1):(o||0)-(r||0);this.canChange=!1;const a=this.__;a[i]=r,jt(this.parent),jt(this);const h=new s(this.__world);switch(a[i]=o,this.__layout.rotationChange(),jt(this),this.changedTransform=new s(this.__world).divide(h),i){case"x":t.move(n,0);break;case"y":t.move(0,n);break;case"rotation":t.rotateOf($t,n);break;case"scaleX":t.scaleOf($t,n,1);break;case"scaleY":t.scaleOf($t,1,n);break;case"skewX":t.skewOf($t,n,0);break;case"skewY":t.skewOf($t,0,n)}this.canChange=!0}})}safeChange(t){this.canChange&&(this.checkChange=!1,t(),this.checkChange=!0)}}class Jt extends N{constructor(t,e){super(t,e)}}Jt.BEFORE_MOVE="editor.before_move",Jt.MOVE="editor.move";class Qt extends N{constructor(t,e){super(t,e)}}Qt.BEFORE_SCALE="editor.before_scale",Qt.SCALE="editor.scale";class te extends N{constructor(t,e){super(t,e)}}te.BEFORE_ROTATE="editor.before_rotate",te.ROTATE="editor.rotate";class ee extends N{constructor(t,e){super(t,e)}}ee.BEFORE_SKEW="editor.before_skew",ee.SKEW="editor.skew";class ie{onMove(t){const{target:e,mergeConfig:i,dragStartData:s}=this.editBox;let o,{dragLimitAnimate:r}=i;const n=t.type===z.END||t.type===W.END,a=E(e.draggable),h=!r||n||a,l={x:t.totalX,y:t.totalY};t instanceof z&&T.move(l,e.getWorldPointByLocal(s.totalOffset,null,!0)),t.shiftKey&&(Math.abs(l.x)>Math.abs(l.y)?l.y=0:l.x=0),o=W.getValidMove(e,s.point,l,h),(o.x||o.y)&&(r&&!a&&n?R.animateMove(this,o,O(r)?r:.3):this.move(o))}onScale(t){const{target:e,mergeConfig:i,single:s,dragStartData:o}=this.editBox;let r,{around:n,lockRatio:a,flipable:h,editSize:l}=i;t instanceof Z?(n||(n=e.getBoxPoint(t)),r=t.totalScale):r=t.getInnerTotal(e);const{direction:d}=t.current;(t.shiftKey||e.lockRatio)&&(a=!0);const g=Ot.getScaleData(e,o.bounds,d,r,a,Ot.getAround(n,t.altKey),h,!s||"scale"===l),c=e.x,u=e.y;t instanceof W&&this.editTool&&this.editTool.onScaleWithDrag?(g.drag=t,this.scaleWithDrag(g)):this.scaleOf(g.origin,g.scaleX,g.scaleY),T.move(o.totalOffset,e.x-c,e.y-u)}onRotate(t){const{target:e,mergeConfig:i,dragStartData:s}=this.editBox,{around:o,rotateAround:r,rotateGap:n,diagonalRotateKey:a}=i,{direction:h}=t.current;let l,d;if(t instanceof G)d=t.rotation,l=r?L.getPoint(r,e.boxBounds):e.getBoxPoint(t);else{const i=a?t.isHoldKeys(a):t.shiftKey,n=Ot.getRotateData(e,h,t,s,i?null:r||e.around||e.origin||o||"center");d=s.rotation+n.rotation-e.rotation,l=n.origin}if(d=x.float(x.getGapRotation(d,n,e.rotation),2),!d)return;const g=e.x,c=e.y;this.rotateOf(l,d),T.move(s.totalOffset,e.x-g,e.y-c)}onSkew(t){const{target:e,mergeConfig:i}=this.editBox,{around:s}=i,{origin:o,skewX:r,skewY:n}=Ot.getSkewData(e,t.current.direction,t.getInnerMove(e),Ot.getAround(s,t.altKey));(r||n)&&this.skewOf(o,r,n)}move(t,e=0){if(!this.checkTransform("moveable"))return;a(t)&&(e=t.y,t=t.x);const{target:i,mergeConfig:s,single:o,editor:r}=this.editBox,{beforeMove:n}=s;if(n){const s=n({target:i,x:t,y:e});if(a(s))t=s.x,e=s.y;else if(!1===s)return}const h=i.getWorldPointByLocal({x:t,y:e},null,!0);o||i.safeChange(()=>i.move(t,e));const l={target:i,editor:r,moveX:h.x,moveY:h.y};this.emitEvent(new Jt(Jt.BEFORE_MOVE,l));const d=new Jt(Jt.MOVE,l);this.doMove(d),this.emitEvent(d)}scaleWithDrag(t){if(!this.checkTransform("resizeable"))return;const{target:e,mergeConfig:i,editor:s}=this.editBox,{beforeScale:o}=i;if(o){const{origin:i,scaleX:s,scaleY:r,drag:n}=t;if(!1===o({target:e,drag:n,origin:i,scaleX:s,scaleY:r}))return}t=Object.assign(Object.assign({},t),{target:e,editor:s,worldOrigin:e.getWorldPoint(t.origin)}),this.emitEvent(new Qt(Qt.BEFORE_SCALE,t));const r=new Qt(Qt.SCALE,t);this.editTool.onScaleWithDrag(r),this.emitEvent(r)}scaleOf(t,e,i=e,s){if(!this.checkTransform("resizeable"))return;const{target:o,mergeConfig:r,single:n,editor:h}=this.editBox,{beforeScale:l}=r;if(l){const s=l({target:o,origin:t,scaleX:e,scaleY:i});if(a(s))e=s.scaleX,i=s.scaleY;else if(!1===s)return}const d=this.getWorldOrigin(t),g=!n&&this.getChangedTransform(()=>o.safeChange(()=>o.scaleOf(t,e,i))),c={target:o,editor:h,worldOrigin:d,scaleX:e,scaleY:i,transform:g};this.emitEvent(new Qt(Qt.BEFORE_SCALE,c));const u=new Qt(Qt.SCALE,c);this.doScale(u),this.emitEvent(u)}flip(t){if(!this.checkTransform("resizeable"))return;const{target:e,single:i,editor:o}=this.editBox,r=this.getWorldOrigin("center"),n=i?new s(R.getFlipTransform(e,t)):this.getChangedTransform(()=>e.safeChange(()=>e.flip(t))),a={target:e,editor:o,worldOrigin:r,scaleX:"x"===t?-1:1,scaleY:"y"===t?-1:1,transform:n};this.emitEvent(new Qt(Qt.BEFORE_SCALE,a));const h=new Qt(Qt.SCALE,a);this.doScale(h),this.emitEvent(h)}rotateOf(t,e){if(!this.checkTransform("rotateable"))return;const{target:i,mergeConfig:s,single:o,editor:r}=this.editBox,{beforeRotate:n}=s;if(n){const s=n({target:i,origin:t,rotation:e});if(O(s))e=s;else if(!1===s)return}const a=this.getWorldOrigin(t),h=!o&&this.getChangedTransform(()=>i.safeChange(()=>i.rotateOf(t,e))),l={target:i,editor:r,worldOrigin:a,rotation:e,transform:h};this.emitEvent(new te(te.BEFORE_ROTATE,l));const d=new te(te.ROTATE,l);this.doRotate(d),this.emitEvent(d)}skewOf(t,e,i=0,s){if(!this.checkTransform("skewable"))return;const{target:o,mergeConfig:r,single:n,editor:h}=this.editBox,{beforeSkew:l}=r;if(l){const s=l({target:o,origin:t,skewX:e,skewY:i});if(a(s))e=s.skewX,i=s.skewY;else if(!1===s)return}const d=this.getWorldOrigin(t),g=!n&&this.getChangedTransform(()=>o.safeChange(()=>o.skewOf(t,e,i))),c={target:o,editor:h,worldOrigin:d,skewX:e,skewY:i,transform:g};this.emitEvent(new ee(ee.BEFORE_SKEW,c));const u=new ee(ee.SKEW,c);this.doSkew(u),this.emitEvent(u)}doMove(t){this.editTool.onMove(t)}doScale(t){this.editTool.onScale(t)}doRotate(t){this.editTool.onRotate(t)}doSkew(t){this.editTool.onSkew(t)}checkTransform(t){const{target:e,mergeConfig:i}=this.editBox;return e&&!e.locked&&i[t]}getWorldOrigin(t){const{target:e}=this.editBox;return e.getWorldPoint(R.getInnerOrigin(e,t))}getChangedTransform(t){const{target:e,single:i}=this.editBox;if(!i&&!e.canChange)return e.changedTransform;const o=new s(e.worldTransform);return t(),new s(e.worldTransform).divide(o)}emitEvent(t,e){this.editBox.editor.emitEvent(t,e)}}let se=class extends i{get list(){return this.leafList.list}get dragHoverExclude(){return[this.editBox.rect]}get editing(){return!!this.list.length}get groupOpening(){return!!this.openedGroupList.length}get multiple(){return this.list.length>1}get single(){return 1===this.list.length}get dragPoint(){return this.editBox.dragPoint}get dragging(){return this.editBox.dragging}get gesturing(){return this.editBox.gesturing}get moving(){return this.editBox.moving}get resizing(){return this.editBox.resizing}get rotating(){return this.editBox.rotating}get skewing(){return this.editBox.skewing}get element(){return this.multiple?this.simulateTarget:this.list[0]}get buttons(){return this.editBox.buttons}get targetLeafer(){const t=this.list[0];return t&&t.leafer}constructor(t,e){super(e),this.leafList=new y,this.openedGroupList=new y,this.simulateTarget=new qt(this),this.editBox=new Vt(this),this.editToolList={},this.selector=new ut(this),this.editMask=new Dt(this),this.targetEventIds=[];let i=h.clone(It);t&&(i=h.default(t,i)),this.mergedConfig=this.config=i,this.addMany(this.editMask,this.selector,this.editBox),V.has("resize")||(this.config.editSize="scale")}select(t){this.target=t}cancel(){this.target=null}hasItem(t){return this.leafList.has(t)}getItem(t){return this.list[t||0]}addItem(t){this.hasItem(t)||t.locked||(this.leafList.add(t),this.target=this.leafList.list)}removeItem(t){this.hasItem(t)&&(this.leafList.remove(t),this.target=this.leafList.list)}shiftItem(t){this.hasItem(t)?this.removeItem(t):this.addItem(t)}setDimOthers(t,i="dim",s){if(!s){const{dimTarget:t,targetLeafer:i}=this;s=t?e(t)?t:[t]:[i]}s[0]&&s[0][i]!==(t||!1)&&s.forEach(e=>h.stintSet(e,i,t))}setBright(t){this.setDimOthers(t,"bright",this.list)}cancelDimOthers(){this.setDimOthers(!1),this.setBright(!1),this.hasDimOthers=void 0}update(){if(this.editing){if(!this.element.parent)return this.cancel();this.innerEditing?this.innerEditor.update():this.editTool.update(),this.selector.update()}}updateEditBox(){this.multiple&&Wt(this),this.update()}getEditTool(t){return this.editToolList[t]=this.editToolList[t]||Yt.get(t,this)}updateEditTool(){if(this.unloadEditTool(),this.editing){const t=this.element;let e=t.editOuter||"EditTool";const{beforeEditOuter:i}=this.mergeConfig;if(i){const s=i({target:t,name:e});if(E(s))e=s;else if(!1===s)return}if(Yt.list[e]){const i=this.editTool=this.getEditTool(e);this.editBox.load(),i.editTarget=t,i.load(),this.update()}}}unloadEditTool(t){let e=this.editTool;e&&(t||this.editBox.unload(),e.unload(),t||(this.editTool=null),e.editTarget=null)}getEditSize(t){return this.mergeConfig.editSize}onMove(t){}onScale(t){}onRotate(t){}onSkew(t){}move(t,e=0){}scaleWithDrag(t){}scaleOf(t,e,i=e,s){}flip(t){}rotateOf(t,e){}skewOf(t,e,i=0,s){}checkTransform(t){}getWorldOrigin(t){}getChangedTransform(t){}group(t){return this.multiple&&(this.emitGroupEvent(Kt.BEFORE_GROUP),this.target=J.group(this.list,this.element,t),this.emitGroupEvent(Kt.GROUP,this.target)),this.target}ungroup(){const{list:t}=this;return t.length&&(t.forEach(t=>t.isBranch&&this.emitGroupEvent(Kt.BEFORE_UNGROUP,t)),this.target=J.ungroup(t),t.forEach(t=>t.isBranch&&this.emitGroupEvent(Kt.UNGROUP,t))),this.list}openGroup(t){this.emitGroupEvent(Kt.BEFORE_OPEN,t),this.openedGroupList.add(t),t.hitChildren=!0,this.emitGroupEvent(Kt.OPEN,t)}closeGroup(t){this.emitGroupEvent(Kt.BEFORE_CLOSE,t),this.openedGroupList.remove(t),t.hitChildren=!1,this.emitGroupEvent(Kt.CLOSE,t)}checkOpenedGroups(){const t=this.openedGroupList;if(t.length){let{list:e}=t;this.editing?(e=[],t.forEach(t=>this.list.every(e=>!R.hasParent(e,t))&&e.push(t))):e=[...e],e.forEach(t=>this.closeGroup(t))}this.editing&&!this.selector.dragging&&this.checkDeepSelect()}checkDeepSelect(){let t,{list:e}=this;for(let i=0;i<e.length;i++)for(t=e[i].parent;t&&!t.hitChildren;)this.openGroup(t),t=t.parent}emitGroupEvent(t,e){const i=new Kt(t,{editTarget:e});this.emitEvent(i),e&&e.emitEvent(i)}getInnerEditor(t){return this.editToolList[t]=this.editToolList[t]||Yt.get(t,this)}openInnerEditor(t,e,i){let s;if(E(e)?s=e:i||(i=e),t&&i&&(this.target=t),this.single){t||(t=this.element),s||(s=t.editInner);const{beforeEditInner:e}=this.mergeConfig;if(e){const i=e({target:t,name:s});if(E(i))s=i;else if(!1===i)return}Yt.list[s]&&(this.unloadEditTool(!0),this.innerEditing=!0,this.innerEditor=this.getInnerEditor(s),this.innerEditor.editTarget=t,this.emitInnerEvent(Ut.BEFORE_OPEN),this.innerEditor.load(),this.emitInnerEvent(Ut.OPEN))}}closeInnerEditor(t){this.innerEditing&&(this.innerEditing=!1,this.emitInnerEvent(Ut.BEFORE_CLOSE),this.innerEditor.unload(),this.emitInnerEvent(Ut.CLOSE),t||this.updateEditTool(),this.innerEditor=this.innerEditor.editTarget=null)}emitInnerEvent(t){const{innerEditor:e}=this,{editTarget:i}=e,s=new Ut(t,{editTarget:i,innerEditor:e});this.emitEvent(s),i.emitEvent(s)}lock(){this.list.forEach(t=>t.locked=!0),this.update()}unlock(){this.list.forEach(t=>t.locked=!1),this.update()}toTop(){this.list.length&&(J.toTop(this.list),this.leafList.update())}toBottom(){this.list.length&&(J.toBottom(this.list),this.leafList.update())}onAppRenderStart(t){(this.targetChanged=t.children.some(t=>t!==this.leafer&&t.renderer.changed))&&this.editBox.forceRender()}onRenderStart(){this.targetChanged&&this.update()}onChildScroll(){this.multiple&&this.updateEditBox()}listenTargetEvents(){if(!this.targetEventIds.length){const{app:t,leafer:e,targetLeafer:i,editMask:s}=this;this.targetEventIds=[e.on_(H.START,this.onRenderStart,this),i&&i.on_(P.SCROLL,this.onChildScroll,this),t.on_(H.CHILD_START,this.onAppRenderStart,this),t.on_(D.UPDATE_MODE,t=>{t.mode&&"normal"!==t.mode&&this.cancel()})],s.visible&&s.forceRender()}}removeTargetEvents(){const{targetEventIds:t,editMask:e}=this;t.length&&(this.off_(t),e.visible&&e.forceRender())}destroy(){this.destroyed||(this.target=this.hoverTarget=null,Object.values(this.editToolList).forEach(t=>t.destroy()),this.simulateTarget.destroy(),this.editToolList={},this.simulateTarget=this.editTool=this.innerEditor=null,super.destroy())}};K([(t,e)=>{o(t,e,{get(){const{config:t,element:e,dragPoint:i,editBox:s,editTool:o,innerEditor:a,app:h}=this,l=Object.assign({},t);if(a?a.editConfig&&Object.assign(l,a.editConfig):o&&o.editConfig&&Object.assign(l,o.editConfig),e&&e.mask&&J.mergeMaskConfig(l,this),e&&e.editConfig){let{editConfig:t}=e;(t.hover||t.hoverStyle||t.hoverPathType)&&(t=Object.assign({},t),delete t.hover,delete t.hoverStyle,delete t.hoverPathType),Object.assign(l,t)}return s.config&&Object.assign(l,s.config),i&&(i.editConfig&&Object.assign(l,i.editConfig),"font-size"===l.editSize&&(l.lockRatio=!0),"resize-rotate"===i.pointType&&(l.around||(l.around="center"),r(l.lockRatio)&&(l.lockRatio=!0))),n(l.dragLimitAnimate)&&(l.dragLimitAnimate=h&&h.config.pointer.dragLimitAnimate),this.mergedConfig=l}})}],se.prototype,"mergeConfig",void 0),K([Q(function(t,e){const{target:i}=t;i?(t.leafList=i instanceof y?i:new y(i),t.multiple&&Wt(t)):(t.simulateTarget.remove(),t.leafList.reset()),t.closeInnerEditor(!0),t.unloadEditTool();const s={editor:t,value:i,oldValue:e};t.emitEvent(new N(N.SELECT,s)),t.checkOpenedGroups(),t.editing?t.waitLeafer(()=>{t.updateEditTool(),t.listenTargetEvents()}):(t.updateEditTool(),t.removeTargetEvents()),t.emitEvent(new N(N.AFTER_SELECT,s))})],se.prototype,"target",void 0),K([Q(function(t,e){t.emitEvent(new N(N.HOVER,{editor:t,value:t.hoverTarget,oldValue:e}))})],se.prototype,"hoverTarget",void 0),se=K([U(ie,["editBox","editTool","emitEvent"])],se);const{abs:oe}=Math,{scale:re}=T;class ne{static registerInnerEditor(){Yt.register(this)}get tag(){return"InnerEditor"}get mode(){return"focus"}get userConfig(){return this.editBox.mergeConfig[this.tag]||{}}get editBox(){return this._editBox||this.editor.editBox}set editBox(t){this._editBox=t}constructor(t){this.configKeepKeys=["editBox"],this.eventIds=[],this.editor=t,this.create()}getEditBoxPoint(t,e){const i=e?t:{x:t.x,y:t.y},{scaleX:s,scaleY:o}=this.editTarget.worldTransform;return re(i,oe(s),oe(o)),i}getEditTargetPoint(t,e){const i=e?t:{x:t.x,y:t.y},{scaleX:s,scaleY:o}=this.editTarget.worldTransform;return re(i,Math.abs(1/s),oe(1/o)),i}onCreate(){}create(){this.view=new i,this.onCreate()}showView(){this.view.opacity=1}hideView(){this.view.opacity=0}onLoad(){}load(){const{editor:t}=this;t&&(t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!1),this.onLoad())}onUpdate(){}update(){this.editor&&(this.updateEditBoxConfig(),this.editBox.update(),this.onUpdate())}onUnload(){}unload(){const{editor:t}=this;t&&(this.unloadEditBoxConfig(),t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!0),this.onUnload())}updateEditBoxConfig(){const{mergeConfig:t}=this;t&&(this.editBox.config=t.editBox)}unloadEditBoxConfig(){this.editBox.config=void 0}onDestroy(){}destroy(){this.onDestroy(),this.editor&&(this.view&&this.view.destroy(),this.eventIds&&this.editor.off_(this.eventIds),this.editor=this.view=this.eventIds=null)}}K([tt()],ne.prototype,"mergeConfig",void 0);let ae=class extends ne{static registerEditTool(t,e){Yt.register(this,t),e&&o(this.prototype,"tag",{get:()=>t})}get tag(){return"EditTool"}onMove(t){if(this.isMotionElement&&this.onMoveMotion(t))return;if(this.isFlowElement&&this.onMoveFlow(t))return;const{moveX:e,moveY:i,editor:s}=t,{app:o,list:r}=s;o.lockLayout(),r.forEach(t=>{t.moveWorld(e,i)}),o.unlockLayout()}onScale(t){if(this.isFlowElement&&this.onScaleFlow(t))return;const{scaleX:e,scaleY:i,transform:s,worldOrigin:o,editor:r}=t,{app:n,list:a}=r;n.lockLayout(),a.forEach(t=>{const n="scale"!==r.getEditSize(t);s?t.transformWorld(s,n,!1):t.scaleOfWorld(o,e,i,n,!1)}),n.unlockLayout()}onRotate(t){if(this.isFlowElement&&this.onRotateFlow(t))return;const{rotation:e,transform:i,worldOrigin:s,editor:o}=t,{app:r,list:n}=o;r.lockLayout(),n.forEach(t=>{const r="scale"!==o.getEditSize(t);i?t.transformWorld(i,r,!1):t.rotateOfWorld(s,e)}),r.unlockLayout()}onSkew(t){if(this.isFlowElement&&this.onSkewFlow(t))return;const{skewX:e,skewY:i,transform:s,worldOrigin:o,editor:r}=t,{app:n,list:a}=r;n.lockLayout(),a.forEach(t=>{const n="scale"!==r.getEditSize(t);s?t.transformWorld(s,n,!1):t.skewOfWorld(o,e,i,n)}),n.unlockLayout()}load(){this.editor&&(this.editBox.view.visible=!0,this.onLoad())}unload(){this.editor&&(this.editBox.view.visible=!1,this.unloadEditBoxConfig(),this.onUnload())}};ae=K([Zt()],ae);const{left:he,right:le}=k,{move:de,copy:ge,toNumberPoints:ce}=T;let ue=class extends ae{constructor(){super(...arguments),this.scaleOfEvent=!0}get tag(){return"LineEditTool"}onScaleWithDrag(t){const{drag:e,direction:i,lockRatio:s,around:o}=t,r=t.target,n=i===he;if(r.pathInputed){const{path:t}=r.__,{from:i,to:a}=this.getFromToByPath(t);this.dragPoint(i,a,n,o,this.getInnerMove(r,e,s)),t[1]=i.x,t[2]=i.y,t[4]=a.x,t[5]=a.y,r.path=t}else if(r.points){const{points:t}=r,{from:i,to:a}=this.getFromToByPoints(t);this.dragPoint(i,a,n,o,this.getInnerMove(r,e,s)),t[0]=i.x,t[1]=i.y,t[2]=a.x,t[3]=a.y,r.points=t}else{const t=C(),{toPoint:i}=r;r.rotation=0,this.dragPoint(t,i,n,o,this.getInnerMove(r,e,s)),r.getLocalPointByInner(t,null,null,!0),r.getLocalPointByInner(i,null,null,!0),r.x=t.x,r.y=t.y,r.getInnerPointByLocal(i,null,null,!0),r.toPoint=i}}getInnerMove(t,e,i){const s=e.getInnerMove(t);return i&&(Math.abs(s.x)>Math.abs(s.y)?s.y=0:s.x=0),s}getFromToByPath(t){return{from:{x:t[1],y:t[2]},to:{x:t[4],y:t[5]}}}getFromToByPoints(t){const e=ce(t);return{from:{x:e[0],y:e[1]},to:{x:e[2],y:e[3]}}}dragPoint(t,e,i,s,o){const{x:r,y:n}=o;i?(de(t,r,n),s&&de(e,-r,-n)):(s&&de(t,-r,-n),de(e,r,n))}onSkew(t){}onUpdate(){const{editBox:t}=this,{rotatePoints:e,resizeLines:i,resizePoints:s,rect:o}=t,r=t.target;let n,a;if(r.pathInputed?n=this.getFromToByPath(r.__.path):r.points&&(n=this.getFromToByPoints(r.__.points)),n){const{from:i,to:a}=n;r.innerToWorld(i,i,!1,t),r.innerToWorld(a,a,!1,t);const{x:h,y:l}=t.rectBounds;o.pen.clearPath().moveTo(i.x-h,i.y-l).lineTo(a.x-h,a.y-l),ge(s[7],i),ge(e[7],i),ge(s[3],a),ge(e[3],a)}for(let t=0;t<8;t++)t<4&&(i[t].visible=!1),a=t===he||t===le,s[t].visible=a,e[t].visible=!n&&a}};ue=K([Zt()],ue),V.add("editor","resize"),A.editor=function(t,e){const i=new se(t);return e&&e.sky.add(e.editor=i),i},S.addAttr("textBox",!1,I),p.addAttr("editConfig",void 0,I),p.addAttr("editOuter",t=>{t.updateLayout();const{EditTool:e,LineEditTool:i,PointsEditTool:s}=Yt,o=t.pathInputed||t.isPointsMode?s:t.tag+"EditTool",r=Yt.list[o];return!t.__.__isLinePath||o==s&&r?r?o:e:i},I),p.addAttr("editInner","PathEditor",I),i.addAttr("editInner","",I),M.addAttr("editInner","TextEditor",I),p.setEditConfig=function(t){this.changeAttr("editConfig",t)},p.setEditOuter=function(t){this.changeAttr("editOuter",t)},p.setEditInner=function(t){this.changeAttr("editInner",t)};export{Vt as EditBox,Ot as EditDataHelper,Ct as EditPoint,ut as EditSelect,lt as EditSelectHelper,ae as EditTool,Yt as EditToolCreator,se as Editor,N as EditorEvent,Kt as EditorGroupEvent,J as EditorHelper,Jt as EditorMoveEvent,te as EditorRotateEvent,Qt as EditorScaleEvent,ee as EditorSkewEvent,ne as InnerEditor,Ut as InnerEditorEvent,ue as LineEditTool,ht as SelectArea,at as Stroker,ie as TransformTool,tt as editToolMergeConfigAttr,Zt as registerEditTool,Xt as registerInnerEditor};
|
|
1
|
+
import{Event as t,isArray as e,Group as i,Matrix as s,defineKey as o,isNull as r,isUndefined as n,LeafHelper as a,isObject as h,DataHelper as l,MatrixHelper as d,BoundsHelper as g,LeafBoundsHelper as c,getMatrixData as u,getBoundsData as f,surfaceType as p,UI as m,ColorConvert as E,isString as v,Paint as w,Rect as b,Bounds as y,LeafList as k,Direction9 as L,AroundHelper as x,MathHelper as T,PointHelper as O,isNumber as S,Box as _,Debug as B,ResizeEvent as C,getPointData as M,Text as P,PropertyEvent as R,Plugin as V,RenderEvent as H,LeaferEvent as D,Creator as A,dataType as I}from"@leafer-ui/draw";import{PointerEvent as F,DragEvent as W,MoveEvent as z,ZoomEvent as Z,DragBoundsHelper as X,KeyEvent as Y,RotateEvent as G,useModule as U}from"@leafer-ui/core";import"@leafer-in/resize";function K(t,e,i,s){var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(r<3?o(n):r>3?o(e,i,n):o(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n}function j(t){return t?e(t)?t:[t]:[]}"function"==typeof SuppressedError&&SuppressedError;class N extends t{get list(){return j(this.value)}get oldList(){return j(this.oldValue)}constructor(t,e){super(t),e&&Object.assign(this,e)}}N.BEFORE_SELECT="editor.before_select",N.SELECT="editor.select",N.AFTER_SELECT="editor.after_select",N.BEFORE_HOVER="editor.before_hover",N.HOVER="editor.hover";const $=(t,e)=>t.parent.children.indexOf(t)-e.parent.children.indexOf(e),q=(t,e)=>e.parent.children.indexOf(e)-t.parent.children.indexOf(t),J={group(t,e,o){t.sort(q);const{app:r,parent:n}=t[0];let a;a=o&&o.add?o:new i(o),n.addAt(a,n.children.indexOf(t[0])),t.sort($);const h=new s(e.worldTransform);return h.divideParent(n.scrollWorldTransform),a.setTransform(h),a.editable=!0,a.hitChildren=!1,r.lockLayout(),t.forEach(t=>t.dropTo(a)),r.unlockLayout(),a},ungroup(t){const{app:e}=t[0],i=[];return e.lockLayout(),t.forEach(t=>{if(t.isBranch){const{parent:e,children:s}=t;for(;s.length;)i.push(s[0]),s[0].dropTo(e,e.children.indexOf(t));t.isBranchLeaf?i.push(t):t.remove()}else i.push(t)}),e.unlockLayout(),i},toTop(t){t.sort($),t.forEach(t=>{t.parent&&t.parent.add(t)})},toBottom(t){t.sort(q),t.forEach(t=>{t.parent&&t.parent.addAt(t,0)})},mergeMaskConfig(t,e){},getSiblingMaskElements(t){}};function Q(t){return(i,s)=>{const r="_"+s;o(i,s,{get(){return this[r]},set(i){const o=this[r];if(o!==i){const n=this;if(n.config){const t="target"===s;if(t){const{beforeSelect:t,skipNested:s}=n.config;if(e(i)){if(s){const t=i[0];if(i.some(e=>e.__level!==t.__level)){i.sort((t,e)=>t.__level-e.__level);const t=i[0].__level,e=[];i.forEach(i=>{e.length&&e.some(e=>a.hasParent(i,e,t))||e.push(i)}),i=e}}i.length>1&&i.some(t=>t.locked||"single"===t.editable)&&(i=i.filter(t=>!(t.locked||"single"===t.editable)))}if(t){const e=t({target:i});if(h(e))i=e;else if(!1===e)return}n.hasDimOthers&&n.cancelDimOthers(),n.single&&(delete n.element.syncEventer,delete n.element.__world.ignorePixelSnap)}const r=t?N.BEFORE_SELECT:N.BEFORE_HOVER;this.hasEvent(r)&&this.emitEvent(new N(r,{editor:n,value:i,oldValue:o}))}this[r]=i,t(this,o)}}})}}function tt(){return(t,e)=>{o(t,e,{get(){const t=this,{config:e,userConfig:i,configKeepKeys:s}=t,o=e?l.clone(e):{};if(s)for(let t in i)s.includes(t)||(o[t]=i[t]);return t.preMergedConfig&&t.preMergedConfig(o),s&&s.forEach(t=>{i[t]&&Object.assign(o[t],i[t])}),t.mergedConfig=o}})}}const{abs:et}=Math,{copy:it}=d,{setListWithFn:st}=g,{worldBounds:ot}=c,rt=u(),nt=f();class at extends m{constructor(){super(),this.list=[],this.visible=0,this.hittable=!1,this.strokeAlign="center"}setTarget(t,e){e&&this.set(e),this.target=t,this.update()}update(t){const{list:e}=this;e.length?(st(nt,e,ot),t&&this.set(t),this.set(nt),this.visible=!0,this.forceUpdate("surface")):this.visible=0}__draw(t,e){const{list:i}=this;if(i.length){let s;const o=this.__,{stroke:r,strokeWidth:n,fill:a}=o,{bounds:h}=e;for(let l=0;l<i.length;l++){s=i[l];const{worldTransform:d,worldRenderBounds:g}=s;if(g.width&&g.height&&(!h||h.hit(g,e.matrix))){const i=et(d.scaleX),h=et(d.scaleY);switch(it(rt,d),rt.half=n%2,t.setWorld(rt,e.matrix),t.beginPath(),this.strokePathType){case"box":const{boxBounds:e}=s.__layout;t.rect(e.x,e.y,e.width,e.height);break;case"stroke":const{strokeBounds:i}=s.__layout;t.rect(i.x,i.y,i.width,i.height);break;case"path":s.__drawPath(t);break;default:s.__.__useArrow?s.__drawPath(t):s.__.__pathForRender?s.__drawRenderPath(t):s.__drawPathByBox(t)}if(o.strokeWidth=n/Math.max(i,h),o.shadow){const e=o.shadow[0],{scaleX:i,scaleY:s}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*s,e.blur*i,E.string(e.color))}r&&(v(r)?w.stroke(r,this,t,e):w.strokes(r,this,t,e)),a&&(v(a)?w.fill(a,this,t,e):w.fills(a,this,t,e)),o.shadow&&t.restore()}}o.strokeWidth=n}}destroy(){this.target=null,super.destroy()}}K([Q(function(t){const i=t.target;t.list=i?e(i)?i:[i]:[]})],at.prototype,"target",void 0),K([p("render-path")],at.prototype,"strokePathType",void 0);class ht extends i{constructor(t){super(t),this.strokeArea=new b({strokeAlign:"center"}),this.fillArea=new b,this.visible=0,this.hittable=!1,this.addMany(this.fillArea,this.strokeArea)}setStyle(t,e){const{visible:i,stroke:s,strokeWidth:o}=t;this.visible=i,this.strokeArea.reset(Object.assign({stroke:s,strokeWidth:o},e||{})),this.fillArea.reset({visible:!e,fill:s,opacity:.2})}setBounds(t){this.strokeArea.set(t),this.fillArea.set(t)}}const lt={findOne:t=>t.list.find(t=>t.editable),findByBounds(t,e,i="hit"){const s=[];return dt([t],s,e,i),s}};function dt(t,e,i,s){let o,r,n;for(let a=0,h=t.length;a<h;a++)if(o=t[a],r=o.__,r.hittable&&r.visible&&!r.locked&&i.hit(o.__world)){if(r.editable&&"single"!==r.editable)if(o.isFrame){if(i.includes(o.__layout.boxBounds,o.__world)){e.push(o);continue}}else if(n=i[s](o.__layout.boxBounds,o.__world)&&r.hitSelf,o.isBranch){if(!r.hitChildren||n&&o.children.every(t=>!t.editable)){n&&e.push(o);continue}}else n&&e.push(o);o.isBranch&&dt(o.children,e,i,s)}}const{findOne:gt,findByBounds:ct}=lt;class ut extends i{get dragging(){return!!this.originList}get running(){const{editor:t,app:e}=this;return this.hittable&&t.visible&&t.hittable&&t.mergeConfig.selector&&e&&"normal"===e.mode}get isMoveMode(){const{app:t}=this;return t&&t.interaction.moveMode}constructor(t){super(),this.hoverStroker=new at,this.targetStroker=new at,this.bounds=new y,this.selectArea=new ht,this.__eventIds=[],this.editor=t,this.addMany(this.targetStroker,this.hoverStroker,this.selectArea),this.__listenEvents()}onHover(){const{editor:t}=this;if(!this.running||this.dragging||t.dragging)this.hoverStroker.target=null;else{const{hoverTarget:e,mergeConfig:i}=t,s=Object.assign({},i);e&&e.editConfig&&Object.assign(s,e.editConfig);const{stroke:o,strokeWidth:r,hover:n,hoverStyle:a,hoverPathType:h}=s;this.hoverStroker.setTarget(n?e:null,Object.assign({stroke:o,strokeWidth:r,strokePathType:h},a||{}))}}onSelect(){if(this.running){const{editor:t}=this;let{list:e}=t;const i=J.getSiblingMaskElements(t);i&&(e=i.concat(e)),this.targetStroker.setTarget(e),this.hoverStroker.target=null}}update(){this.hoverStroker.update();const{stroke:t,strokeWidth:e,selectedPathType:i,selectedStyle:s}=this.editor.mergedConfig;this.targetStroker.update(Object.assign({stroke:t,strokeWidth:e&&Math.max(1,e/2),strokePathType:i},s||{}))}onPointerMove(t){const{app:e,editor:i}=this;if(this.running&&!this.isMoveMode&&e.interaction.canHover&&!e.interaction.dragging){const e=this.findUI(t);i.hoverTarget=i.hasItem(e)?null:e}this.isMoveMode&&(i.hoverTarget=null)}onBeforeDown(t){if(t.multiTouch)return;const{select:e}=this.editor.mergeConfig;"press"===e&&(this.app.config.mobile?this.waitSelect=()=>this.checkAndSelect(t):this.checkAndSelect(t))}onTap(t){if(t.multiTouch)return;const{editor:e}=this,{select:i,selectKeep:s}=e.mergeConfig;"tap"===i?this.checkAndSelect(t):this.waitSelect&&this.waitSelect(),this.needRemoveItem?e.removeItem(this.needRemoveItem):this.isMoveMode&&(s||(e.target=null))}checkAndSelect(t){if(this.needRemoveItem=null,this.allowSelect(t)){const{editor:e}=this,i=this.findUI(t);i?(this.isMultipleSelect(t)?e.hasItem(i)?this.needRemoveItem=i:e.addItem(i):e.target=i,t.path.needUpdate=!0):this.allow(t.target)&&(this.isHoldMultipleSelectKey(t)||this.editor.mergedConfig.selectKeep||(e.target=null))}}onDragStart(t){if(!t.multiTouch&&(this.waitSelect&&this.waitSelect(),this.allowDrag(t))){const{editor:e}=this,{stroke:i,area:s}=e.mergeConfig,{x:o,y:r}=t.getInnerPoint(this);this.bounds.set(o,r),this.selectArea.setStyle({visible:!0,stroke:i,x:o,y:r},s),this.selectArea.setBounds(this.bounds.get()),this.originList=e.leafList.clone()}}onDrag(t){if(!t.multiTouch){if(this.editor.dragging)return this.onDragEnd(t);if(this.dragging){const{editor:e}=this,i=t.getInnerTotal(this),s=this.bounds.clone().unsign(),o=new k(ct(e.app,s,"includes"===e.mergedConfig.boxSelect?"includes":"hit"));if(this.bounds.width=i.x,this.bounds.height=i.y,this.selectArea.setBounds(s.get()),o.length){const t=[];this.originList.forEach(e=>{o.has(e)||t.push(e)}),o.forEach(e=>{this.originList.has(e)||t.push(e)}),(t.length!==e.list.length||e.list.some((e,i)=>e!==t[i]))&&(e.target=t)}else e.target=this.originList.list}}}onDragEnd(t){t.multiTouch||this.dragging&&(this.originList=null,this.selectArea.visible=0)}onAutoMove(t){if(this.dragging){const{x:e,y:i}=t.getLocalMove(this);this.bounds.x+=e,this.bounds.y+=i}}allow(t){return t.leafer!==this.editor.leafer}allowDrag(t){const{boxSelect:e,multipleSelect:i}=this.editor.mergeConfig;return!(!(this.running&&i&&e)||t.target.draggable)&&(!this.editor.editing&&this.allow(t.target)||this.isHoldMultipleSelectKey(t)&&!gt(t.path))}allowSelect(t){return this.running&&!this.isMoveMode&&!t.middle}findDeepOne(t){const e={exclude:new k(this.editor.editBox.rect)};return gt(t.target.leafer.interaction.findPath(t,e))}findUI(t){return this.isMultipleSelect(t)?this.findDeepOne(t):gt(t.path)}isMultipleSelect(t){const{multipleSelect:e,continuousSelect:i}=this.editor.mergeConfig;return e&&(this.isHoldMultipleSelectKey(t)||i)}isHoldMultipleSelectKey(t){const{multipleSelectKey:e}=this.editor.mergedConfig;return e?t.isHoldKeys(e):t.shiftKey}__listenEvents(){const{editor:t}=this;t.waitLeafer(()=>{const{app:e}=t;e.selector.proxy=t,this.__eventIds=[t.on_([[N.HOVER,this.onHover,this],[N.SELECT,this.onSelect,this]]),e.on_([[F.MOVE,this.onPointerMove,this],[F.BEFORE_DOWN,this.onBeforeDown,this],[F.TAP,this.onTap,this],[W.START,this.onDragStart,this,!0],[W.DRAG,this.onDrag,this],[W.END,this.onDragEnd,this],[z.MOVE,this.onAutoMove,this],[[Z.ZOOM,z.MOVE],()=>{this.editor.hoverTarget=null}]])]})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=this.originList=this.needRemoveItem=null,this.__removeListenEvents(),super.destroy()}}const{topLeft:ft,top:pt,topRight:mt,right:Et,bottomRight:vt,bottom:wt,bottomLeft:bt,left:yt}=L,{toPoint:kt}=x,{within:Lt,sign:xt}=T,{abs:Tt}=Math,Ot={getScaleData(t,e,i,s,o,r,n,a){let h,l,d={},g=1,c=1;const{widthRange:u,heightRange:f,dragBounds:p,worldTransform:m,boxBounds:E}=t,{width:v,height:w}=e,b=Tt(m.scaleX),y=Tt(m.scaleY),k=t.scaleX/e.scaleX,L=t.scaleY/e.scaleY,x=xt(k),T=xt(L),O=a?k:x*E.width/v,_=a?L:T*E.height/w;if(S(s))g=c=Math.sqrt(s);else{r&&(s.x*=2,s.y*=2),s.x*=a?k:x,s.y*=a?L:T;const t=(-s.y+w)/w,e=(s.x+v)/v,n=(s.y+w)/w,d=(-s.x+v)/v;switch(i){case pt:c=t,h="bottom";break;case Et:g=e,h="left";break;case wt:c=n,h="top";break;case yt:g=d,h="right";break;case ft:c=t,g=d,h="bottom-right";break;case mt:c=t,g=e,h="bottom-left";break;case vt:c=n,g=e,h="top-left";break;case bt:c=n,g=d,h="top-right"}if(o)if("corner"===o&&i%2)o=!1;else switch(i){case pt:case wt:g=c;break;case yt:case Et:c=g;break;default:l=Math.sqrt(Tt(g*c)),g=xt(g)*l,c=xt(c)*l}}const B=1!==g,C=1!==c;if(B&&(g/=O),C&&(c/=_),n||(g<0&&(g=1/E.width/b),c<0&&(c=1/E.height/y)),kt(r||h,E,d,!0),p){const e={x:g,y:c};X.limitScaleOf(t,d,e,o),g=e.x,c=e.y}if(B&&u){const e=E.width*t.scaleX;g=Lt(e*g,u)/e}if(C&&f){const e=E.height*t.scaleY;c=Lt(e*c,f)/e}const M=b*E.width,P=y*E.height;return B&&Tt(g*M)<1&&(g=1*xt(g)/M),C&&Tt(c*P)<1&&(c=1*xt(c)/P),o&&g!==c&&(l=Math.min(Tt(g),Tt(c)),g=xt(g)*l,c=xt(c)*l),isFinite(g)||(g=1),isFinite(c)||(c=1),{origin:d,scaleX:g,scaleY:c,direction:i,lockRatio:o,around:r}},getRotateData(t,e,i,s,o){let r,n={};switch(e){case ft:r="bottom-right";break;case mt:r="bottom-left";break;case vt:r="top-left";break;case bt:r="top-right";break;default:r="center"}return kt(o||r,t.boxBounds,n,!0),{origin:n,rotation:O.getRotation(s,t.getWorldPointByBox(n),i)}},getSkewData(t,e,i,s){let o,r,n={},a=0,h=0;switch(e){case pt:case ft:r={x:.5,y:0},o="bottom",a=1;break;case wt:case vt:r={x:.5,y:1},o="top",a=1;break;case yt:case bt:r={x:0,y:.5},o="right",h=1;break;case Et:case mt:r={x:1,y:.5},o="left",h=1}const{boxBounds:l}=t,{width:d,height:g}=l;r.x=r.x*d,r.y=r.y*g,kt(s||o,l,n,!0);const c=O.getRotation(r,n,{x:r.x+(a?i.x:0),y:r.y+(h?i.y:0)});return a?a=-c:h=c,{origin:n,skewX:a,skewY:h}},getAround:(t,e)=>e&&!t?"center":t,getRotateDirection:(t,e,i=8)=>((t=(t+Math.round(e/(360/i)))%i)<0&&(t+=i),t),getFlipDirection(t,e,i){if(e)switch(t){case yt:t=Et;break;case ft:t=mt;break;case bt:t=vt;break;case Et:t=yt;break;case mt:t=ft;break;case vt:t=bt}if(i)switch(t){case pt:t=wt;break;case ft:t=bt;break;case mt:t=vt;break;case wt:t=pt;break;case bt:t=ft;break;case vt:t=mt}return t}},St={};function _t(t){const{moveCursor:e,moveable:i}=t.mergeConfig;t.canUse&&(t.rect.cursor=i?e:void 0)}function Bt(t,e){return'"data:image/svg+xml,'+encodeURIComponent(t.replace("{{rotation}}",e.toString()))+'"'}class Ct extends _{constructor(t){super(t),this.useFastShadow=!0}}const Mt=["top","right","bottom","left"],Pt=void 0,Rt=B.get("EditBox");class Vt extends i{get mergeConfig(){const{config:t}=this,{mergeConfig:e,editBox:i}=this.editor;return this.mergedConfig=t&&i!==this?Object.assign(Object.assign({},e),t):e}get target(){return this._target||this.editor.element}set target(t){this._target=t}get single(){return!!this._target||this.editor.single}get transformTool(){return this._transformTool||this.editor}set transformTool(t){this._transformTool=t}get flipped(){return this.flippedX||this.flippedY}get flippedX(){return this.scaleX<0}get flippedY(){return this.scaleY<0}get flippedOne(){return this.scaleX*this.scaleY<0}get canUse(){return this.app&&this.editor.editing}get canGesture(){if(!this.canUse)return!1;const{moveable:t,resizeable:e,rotateable:i}=this.mergeConfig;return v(t)||v(e)||v(i)}get canDragLimitAnimate(){return this.moving&&this.mergeConfig.dragLimitAnimate&&this.target.dragBounds}constructor(t){super(),this.view=new i,this.rect=new Ct({name:"rect",hitFill:"all",hitStroke:"none",strokeAlign:"center",hitRadius:5}),this.circle=new Ct({name:"circle",strokeAlign:"center",around:"center",cursor:"crosshair",hitRadius:5}),this.buttons=new i({around:"center",hitSelf:!1,visible:0}),this.resizePoints=[],this.rotatePoints=[],this.resizeLines=[],this.dragStartData={},this.__eventIds=[],this.widgets=[],this.editor=t,this.visible=!1,this.create(),this.__listenEvents(),this.createWidgets()}create(){let t,e,i;const{view:s,resizePoints:o,rotatePoints:r,resizeLines:n,rect:a,circle:h,buttons:l}=this,d=["bottom-right","bottom","bottom-left","left","top-left","top","top-right","right"];for(let s=0;s<8;s++)t=new Ct({name:"rotate-point",around:d[s],width:15,height:15,hitFill:"all"}),r.push(t),this.listenPointEvents(t,"rotate",s),s%2&&(e=new Ct({name:"resize-line",around:"center",width:10,height:10,hitFill:"all"}),n.push(e),this.listenPointEvents(e,"resize",s)),i=new Ct({name:"resize-point",hitRadius:5}),o.push(i),this.listenPointEvents(i,"resize",s);this.listenPointEvents(h,"rotate",2),this.listenPointEvents(a,"move",8),s.add([...r,a,h,l,...n,...o]),this.add(s)}showView(){this.view.opacity=1,this.update()}hideView(){this.view.opacity=0}load(){const{target:t,mergeConfig:e,single:i,rect:s,circle:o,resizePoints:n,resizeLines:a}=this,{stroke:h,strokeWidth:d,ignorePixelSnap:g}=e,c=this.getPointsStyle(),u=this.getMiddlePointsStyle(),f=this.getResizeLinesStyle();let p;this.visible=!t.locked;for(let t=0;t<8;t++)p=n[t],p.children.length&&p.clear(),p.set(this.getPointStyle(t%2?u[(t-1)/2%u.length]:c[t/2%c.length])),p.rotation=(t-(t%2?1:0))/2*90,t%2&&a[(t-1)/2].set(Object.assign({pointType:"resize",rotation:(t-1)/2*90},f[(t-1)/2%f.length]||{}));o.set(this.getPointStyle(e.circle||e.rotatePoint||c[0])),s.set(Object.assign({stroke:h,strokeWidth:d,opacity:1,editConfig:Pt},e.rect||{}));const m=r(e.rectThrough)?i:e.rectThrough;s.hittable=!m,m&&this.addBottomList(),i&&l.stintSet(t.__world,"ignorePixelSnap",g),this.updateMoveCursor(),this.loadWidgets()}update(){const{editor:t,target:e}=this;if(!e)return;const{x:i,y:s,scaleX:o,scaleY:r,rotation:n,skewX:a,skewY:h,width:l,height:d}=e.getLayoutBounds("box",t,!0);this.visible=!this.target.locked,this.set({x:i,y:s,scaleX:o,scaleY:r,rotation:n,skewX:a,skewY:h}),this.updateBounds({x:0,y:0,width:l,height:d}),this.updateWidgets()}unload(){this.unloadWidgets(),this.visible=!1,this.removeBottomList()}addBottomList(){const{target:t,rect:e}=this;t.syncEventer=e,this.app.interaction.bottomList=[{target:e,proxy:t}]}removeBottomList(){this.app&&(this.rect.syncEventer=this.app.interaction.bottomList=null)}updateBounds(t){const{editor:e,target:i,mergeConfig:s,single:o,rect:r,circle:a,buttons:h,resizePoints:l,rotatePoints:d,resizeLines:c}=this,{editMask:u}=e,{middlePoint:f,resizeable:p,rotateable:m,hideOnSmall:E,editBox:v,editBoxType:w,mask:b,dimOthers:y,bright:k,spread:L,hideRotatePoints:T,hideResizeLines:O}=s;if("stroke"===w){const{scaleX:e,scaleY:s}=i.worldTransform,{strokeBoxSpread:o}=i.__layout;o&&g.spread(t,[o*Math.abs(s),o*Math.abs(e)])}if(L&&g.spread(t,L),this.rectBounds=t,u.visible=!!b||0,n(y)&&n(k)?e.hasDimOthers&&e.cancelDimOthers():(e.setDimOthers(y),e.setBright(!!y||k),e.hasDimOthers=!0),this.view.worldOpacity){const{width:e,height:i}=t,n=S(E)?E:10,g=this.showPoints=v&&!(E&&e<n&&i<n);let u,w,b,y={};for(let s=0;s<8;s++)x.toPoint(x.directionData[s],t,y),w=l[s],u=d[s],w.set(y),u.set(y),w.visible=g&&!(!p&&!m),u.visible=g&&m&&p&&!T,s%2&&(b=c[(s-1)/2],b.set(y),b.visible=w.visible&&!O,w.visible&&(w.visible=!!f),u.visible&&(u.visible=!!f),(s+1)/2%2?(b.width=e+b.height,E&&2*w.width>e&&(w.visible=!1)):(b.width=i+b.height,E&&2*w.width>i&&(w.visible=!1)));a.visible=g&&m&&!(!s.circle&&!s.rotatePoint),a.visible&&this.layoutCircle(),r.path&&(r.path=null),r.set(Object.assign(Object.assign({},t),{visible:!o||v})),h.visible=g&&h.children.length>0||0,h.visible&&this.layoutButtons()}else r.set(t)}layoutCircle(){const{circleDirection:t,circleMargin:e,buttonsMargin:i,buttonsDirection:s,middlePoint:o}=this.mergedConfig,r=Mt.indexOf(t||(this.buttons.children.length&&"bottom"===s?"top":"bottom"));this.setButtonPosition(this.circle,r,e||i,!!o)}layoutButtons(){const{buttons:t}=this,{buttonsDirection:e,buttonsFixed:i,buttonsMargin:s,middlePoint:o}=this.mergedConfig,{flippedX:r,flippedY:n}=this;let a=Mt.indexOf(e);(a%2&&r||(a+1)%2&&n)&&i&&(a=(a+2)%4);const h=i?Ot.getRotateDirection(a,this.flippedOne?this.rotation:-this.rotation,4):a;this.setButtonPosition(t,h,s,!!o),i&&(t.rotation=90*(h-a)),t.scaleX=r?-1:1,t.scaleY=n?-1:1}setButtonPosition(t,e,i,s){const o=this.resizePoints[2*e+1],r=e%2,n=e&&3!==e?1:-1,a=(i+(e%2?(s?o.width:0)+t.boxBounds.width:(s?o.height:0)+t.boxBounds.height)/2)*n;r?(t.x=o.x+a,t.y=o.y):(t.x=o.x,t.y=o.y+a)}getPointStyle(t){const{stroke:e,strokeWidth:i,pointFill:s,pointSize:o,pointRadius:r}=this.mergedConfig,n={fill:s,stroke:e,strokeWidth:i,around:"center",strokeAlign:"center",opacity:1,width:o,height:o,cornerRadius:r,offsetX:0,offsetY:0,editConfig:Pt};return t?Object.assign(n,t):n}getPointsStyle(){const{point:t}=this.mergedConfig;return e(t)?t:[t]}getMiddlePointsStyle(){const{middlePoint:t}=this.mergedConfig;return e(t)?t:t?[t]:this.getPointsStyle()}getResizeLinesStyle(){const{resizeLine:t}=this.mergedConfig;return e(t)?t:[t]}updateMoveCursor(){_t(this)}updatePointCursor(t){!function(t,e){const{enterPoint:i,dragging:s,skewing:o,resizing:r,flippedX:n,flippedY:a}=t;if(!i||!t.editor.editing||!t.canUse)return;if("rect"===i.name)return _t(t);if("circle"===i.name)return;let{rotation:h}=t;const{pointType:l}=i,{moveCursor:d,resizeCursor:g,rotateCursor:c,skewCursor:u,moveable:f,resizeable:p,rotateable:m,skewable:E}=t.mergeConfig;if("move"===l)return i.cursor=d,void(f||(i.visible=!1));if("button"===l)return void(i.cursor||(i.cursor="pointer"));let v=l.includes("resize");v&&m&&(t.isHoldRotateKey(e)||!p)&&(v=!1);const w=E&&!v&&("resize-line"===i.name||"skew"===l),b=s?o?u:r?g:c:w?u:v?g:c;h+=45*(Ot.getFlipDirection(i.direction,n,a)+1),h=2*Math.round(T.formatRotation(h,!0)/2);const{url:y,x:k,y:L}=b,x=y+h;St[x]?i.cursor=St[x]:St[x]=i.cursor={url:Bt(y,h),x:k,y:L}}(this,t)}onDragStart(t){this.dragging=!0;const e=this.dragPoint=t.current,{pointType:i}=e,{moveable:s,resizeable:o,rotateable:r,skewable:n,onCopy:a}=this.mergeConfig;"move"===i?(t.altKey&&a&&a()&&this.editor.single&&this.app.interaction.replaceDownTarget(this.target),s&&(this.moving=!0),this.moving&&this.widgetsMoveStart(t)):(i.includes("rotate")||this.isHoldRotateKey(t)||!o?(r&&(this.rotating=!0),"resize-rotate"===i?o&&(this.resizing=!0):"resize-line"===e.name&&(n&&(this.skewing=!0),this.rotating=!1)):"resize"===i&&o&&(this.resizing=!0),"skew"===i&&n&&(this.skewing=!0)),this.onTransformStart(t)}onDrag(t){const{transformTool:e,moving:i,resizing:s,rotating:o,skewing:r}=this;if(i)e.onMove(t),this.widgetsMove(t);else if(s||o||r){const i=t.current;i.pointType&&(this.enterPoint=i),o&&e.onRotate(t),s&&e.onScale(t),r&&e.onSkew(t)}this.updatePointCursor(t)}onDragEnd(t){this.moving&&this.widgetsMoveEnd(t),this.onTransformEnd(t),this.dragPoint=null}onTransformStart(t){const{hideOnMove:e}=this.mergedConfig;(this.moving||this.gesturing)&&(this.editor.opacity=e?0:1),this.resizing&&(C.resizingKeys=this.editor.leafList.keys);const{dragStartData:i,target:s}=this;i.x=t.x,i.y=t.y,i.totalOffset=M(),i.point={x:s.x,y:s.y},i.bounds=Object.assign({},s.getLayoutBounds("box","local")),i.rotation=s.rotation}onTransformEnd(t){this.canDragLimitAnimate&&(t instanceof W||t instanceof z)&&this.transformTool.onMove(t),this.resizing&&(C.resizingKeys=null),this.dragging=this.gesturing=this.moving=this.resizing=this.rotating=this.skewing=!1,this.editor.opacity=1,this.editor.update()}onMove(t){if(this.canGesture&&"drag"!==t.moveType&&(t.stop(),v(this.mergedConfig.moveable)))switch(this.gesturing=this.moving=!0,t.type){case z.START:this.onTransformStart(t),this.widgetsMoveStart(t);break;case z.END:this.onTransformEnd(t),this.widgetsMoveEnd(t);break;default:this.transformTool.onMove(t),this.widgetsMove(t)}}onScale(t){if(this.canGesture&&(t.stop(),v(this.mergedConfig.resizeable)))switch(this.gesturing=this.resizing=!0,t.type){case Z.START:this.onTransformStart(t);break;case Z.END:this.onTransformEnd(t);break;default:this.transformTool.onScale(t)}}onRotate(t){if(this.canGesture&&(t.stop(),v(this.mergedConfig.rotateable)))switch(this.gesturing=this.rotating=!0,t.type){case Z.START:this.onTransformStart(t);break;case Z.END:this.onTransformEnd(t);break;default:this.transformTool.onRotate(t)}}isHoldRotateKey(t){const{rotateKey:e}=this.mergedConfig;return e?t.isHoldKeys(e):t.metaKey||t.ctrlKey}onKey(t){this.updatePointCursor(t)}onArrow(t){if(this.canUse){let e=0,i=0;switch(t.code){case"ArrowDown":i=1;break;case"ArrowUp":i=-1;break;case"ArrowLeft":e=-1;break;case"ArrowRight":e=1}if(e||i){const{keyEvent:s,arrowStep:o,arrowFastStep:r}=this.mergeConfig;if(s){const s=t.shiftKey?r:o;this.transformTool.move(e*s,i*s)}}}}onDoubleTap(t){const{openInner:e,preventEditInner:i}=this.mergeConfig;"double"!==e||i||this.openInner(t)}onLongPress(t){const{openInner:e,preventEditInner:i}=this.mergeConfig;"long"===e&&i&&this.openInner(t)}openInner(t){const{editor:e,target:i}=this;if(this.single){if(i.locked)return;if(i.isBranch&&!i.editInner){if(i.textBox){const{children:t}=i,s=t.find(t=>t.editable&&t instanceof P)||t.find(t=>t instanceof P);if(s)return e.openInnerEditor(s)}e.openGroup(i),e.target=e.selector.findDeepOne(t)}else e.openInnerEditor()}}listenPointEvents(t,e,i){t.direction=i,t.pointType=e,this.__eventIds.push(t.on_([[W.START,this.onDragStart,this],[W.DRAG,this.onDrag,this],[W.END,this.onDragEnd,this],[F.ENTER,e=>{this.enterPoint=t,this.updatePointCursor(e)}],[F.LEAVE,()=>{this.enterPoint=null}]]))}__listenEvents(){const{rect:t,editor:e,__eventIds:i}=this;i.push(t.on_([[F.DOUBLE_TAP,this.onDoubleTap,this],[F.LONG_PRESS,this.onLongPress,this]])),this.waitLeafer(()=>{i.push(e.app.on_([[[Y.HOLD,Y.UP],this.onKey,this],[Y.DOWN,this.onArrow,this],[[z.START,z.BEFORE_MOVE,z.END],this.onMove,this,!0],[[Z.START,Z.BEFORE_ZOOM,Z.END],this.onScale,this,!0],[[G.START,G.BEFORE_ROTATE,G.END],this.onRotate,this,!0]]))})}__removeListenEvents(){this.off_(this.__eventIds)}static registerWidget(t){const{tag:e}=t.prototype;Vt.WidgetList[e]&&Rt.repeat(e),Vt.WidgetList[e]=t}createWidgets(){Object.values(Vt.WidgetList).forEach(t=>{this.widgets.push(new t(this))})}getWidget(t){return this.widgets.find(e=>e.tag===t)}loadWidgets(){this.widgets.forEach(t=>t.onLoad())}updateWidgets(){this.widgets.forEach(t=>t.onUpdate())}unloadWidgets(){this.widgets.forEach(t=>t.onUnload())}widgetsMoveStart(t){this.widgets.forEach(e=>e.onMove&&e.onMoveStart(t))}widgetsMove(t){this.widgets.forEach(e=>e.onMove&&e.onMove(t))}widgetsMoveEnd(t){this.widgets.forEach(e=>e.onMove&&e.onMoveEnd(t))}destroyWidgets(){this.widgets.forEach(t=>t.onDestroy())}destroy(){this.editor=null,this.__removeListenEvents(),this.destroyWidgets(),super.destroy()}}Vt.WidgetList={};const Ht={x:0,y:0,width:1e5,height:1e5};class Dt extends m{constructor(t){super(),this.editor=t,this.hittable=!1,this.visible=0}__updateWorldBounds(){Object.assign(this.__local,Ht),Object.assign(this.__world,Ht)}__draw(t,e){const{editor:i}=this,{mask:s}=i.mergedConfig;if(s&&i.editing){if(t.fillWorld(t.bounds,!0===s?"rgba(0,0,0,0.8)":s),e.bounds&&!e.bounds.hit(i.editBox.rect.__world,e.matrix))return;t.saveBlendMode("destination-out"),e=Object.assign(Object.assign({},e),{shape:!0}),i.list.forEach(i=>{i.__render(t,e);const{parent:s}=i;s&&s.textBox&&s.__renderShape(t,e)}),t.restoreBlendMode()}}destroy(){this.editor=null,super.destroy()}}const At='\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1.5"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>\n<feBlend mode="normal" in="SourceGraphic" result="shape"/>',It={editSize:"size",keyEvent:!0,stroke:"#836DFF",strokeWidth:2,pointFill:"#FFFFFF",pointSize:10,pointRadius:16,rotateGap:45,arrowStep:1,arrowFastStep:10,buttonsDirection:"bottom",buttonsMargin:12,hideOnSmall:!0,moveCursor:"move",resizeCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate({{rotation}},12,12)">\n<path d="M7.5 8.0H8.5V5.9L6.8 7.2L7.5 8.0ZM3 11.4L2.3 10.6L1.3 11.4L2.3 12.2L3 11.4ZM7.5 10.4H6.5V11.4H7.5V10.4ZM16.5 10.4V11.4H17.5V10.4H16.5ZM16.5 8.0L17.1 7.2L15.5 5.9V8.0H16.5ZM21 11.4L21.6 12.2L22.6 11.4L21.6 10.6L21 11.4ZM16.5 14.9H15.5V16.9L17.1 15.7L16.5 14.9ZM16.5 12.4H17.5V11.4H16.5V12.4ZM7.5 12.4V11.4H6.5V12.4H7.5ZM7.5 14.9L6.8 15.7L8.5 16.9V14.9H7.5ZM6.8 7.2L2.3 10.6L3.6 12.2L8.1 8.7L6.8 7.2ZM8.5 10.4V8.0H6.5V10.4H8.5ZM16.5 9.4H7.5V11.4H16.5V9.4ZM17.5 10.4V8.0H15.5V10.4H17.5ZM15.8 8.7L20.3 12.2L21.6 10.6L17.1 7.2L15.8 8.7ZM20.3 10.6L15.8 14.1L17.1 15.7L21.6 12.2L20.3 10.6ZM17.5 14.9V12.4H15.5V14.9H17.5ZM7.5 13.4H16.5V11.4H7.5V13.4ZM8.5 14.9V12.4H6.5V14.9H8.5ZM2.3 12.2L6.8 15.7L8.1 14.1L3.6 10.6L2.3 12.2Z" fill="white"/>\n<path fill-rule="evenodd" d="M3 11.4L7.5 8.0V10.4H16.5V8.0L21 11.4L16.5 14.9V12.4H7.5V14.9L3 11.4Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="3.9" width="27.2" height="16.9" filterUnits="userSpaceOnUse">\n${At}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},rotateCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(135,12,12),rotate({{rotation}},12,12)">\n<path d="M20.4 8H21.4L20.8 7.1L17.3 2.6L17 2.1L16.6 2.6L13.1 7.1L12.5 8H13.5H15.4C14.9 11.8 11.8 14.9 8 15.4V13.5V12.5L7.1 13.1L2.6 16.6L2.1 17L2.6 17.3L7.1 20.8L8 21.4V20.4V18.4C13.5 17.9 17.9 13.5 18.4 8H20.4Z" stroke="white"/>\n<path fill-rule="evenodd" d="M17 3L20.4 7.5H17.9C17.7 13.1 13.1 17.7 7.5 17.9V20.4L3 17L7.5 13.5V15.9C12.0 15.7 15.7 12.0 15.9 7.5H13.5L17 3Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="-0.6" width="27.1" height="27.1" filterUnits="userSpaceOnUse">\n${At}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},skewCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(90,12,12),rotate({{rotation}},12,12)">\n<path d="M21 10.4L21 11.4L23.8 11.4L21.6 9.6L21 10.4ZM17 10.4V11.4L17 11.4L17 10.4ZM15.5 6L16.1 5.2L14.5 3.9V6H15.5ZM15.5 8.4V9.4H16.5V8.4H15.5ZM6 8.4V7.4H5V8.4H6ZM6 10.4H5V11.4H6V10.4ZM7 14.4V13.4L7 13.4L7 14.4ZM3 14.4L3 13.4L0.1 13.4L2.3 15.2L3 14.4ZM8.5 18.9L7.8 19.7L9.5 21.0V18.9H8.5ZM8.5 16.4V15.4H7.5V16.4H8.5ZM19 16.4V17.4H20V16.4H19ZM19 14.4H20V13.4H19V14.4ZM21 9.4L17 9.4L17 11.4L21 11.4L21 9.4ZM14.8 6.7L20.3 11.2L21.6 9.6L16.1 5.2L14.8 6.7ZM16.5 8.4V6H14.5V8.4H16.5ZM6 9.4H15.5V7.4H6V9.4ZM7 10.4V8.4H5V10.4H7ZM15.5 9.4H6V11.4H15.5V9.4ZM17 9.4H15.5V11.4H17V9.4ZM7 15.4H8.5V13.4H7V15.4ZM3 15.4L7 15.4L7 13.4L3 13.4L3 15.4ZM9.1 18.1L3.6 13.6L2.3 15.2L7.8 19.7L9.1 18.1ZM7.5 16.4V18.9H9.5V16.4H7.5ZM19 15.4H8.5V17.4H19V15.4ZM18 14.4V16.4H20V14.4H18ZM8.5 15.4H19V13.4H8.5V15.4Z" fill="white"/>\n<path fill-rule="evenodd" d="M17 10.4L21 10.4L15.5 6V8.4H6V10.4H15.5H17ZM8.5 14.4H7L3 14.4L8.5 18.9V16.4H19V14.4H8.5Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter x="-2.8" y="1.9" width="29.6" height="23.1" filterUnits="userSpaceOnUse" >\n${At}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},selector:!0,editBox:!0,editBoxType:"box",hover:!0,select:"press",openInner:"double",multipleSelect:!0,boxSelect:!0,moveable:!0,resizeable:!0,flipable:!0,rotateable:!0,skewable:!0},Ft=new y;function Wt(t){const{simulateTarget:e,list:i}=t,{zoomLayer:s}=i[0].leafer;e.safeChange(()=>{Ft.setListWithFn(i,t=>t.getBounds("box","page")),0===Ft.width&&(Ft.width=.1),0===Ft.height&&(Ft.height=.1),e.reset(Ft.get())}),s.add(e)}const zt=B.get("EditToolCreator");function Zt(){return t=>{Yt.register(t)}}const Xt=Zt,Yt={EditTool:"EditTool",LineEditTool:"LineEditTool",PointsEditTool:"PointsEditTool",list:{},register(t,e){const{tag:i}=t.prototype;e||(e=i),Gt[e]&&zt.repeat(e),Gt[e]=t},get:(t,e)=>new Gt[t](e)},{list:Gt}=Yt;class Ut extends N{constructor(t,e){super(t,e)}}Ut.BEFORE_OPEN="innerEditor.before_open",Ut.OPEN="innerEditor.open",Ut.BEFORE_CLOSE="innerEditor.before_close",Ut.CLOSE="innerEditor.close";class Kt extends N{constructor(t,e){super(t,e)}}Kt.BEFORE_GROUP="editor.before_group",Kt.GROUP="editor.group",Kt.BEFORE_UNGROUP="editor.before_ungroup",Kt.UNGROUP="editor.ungroup",Kt.BEFORE_OPEN="editor.before_open_group",Kt.OPEN="editor.open_group",Kt.BEFORE_CLOSE="editor.before_close_group",Kt.CLOSE="editor.close_group";const{updateMatrix:jt}=a,Nt={x:1,y:1,scaleX:1,scaleY:1,rotation:1,skewX:1,skewY:1},$t="top-left";class qt extends b{get __tag(){return"SimulateElement"}constructor(t){super(),this.checkChange=!0,this.canChange=!0,this.visible=this.hittable=!1,this.skipJSON=!0,this.on(R.CHANGE,e=>{if(this.checkChange&&Nt[e.attrName]){const{attrName:i,newValue:o,oldValue:r}=e,n="s"===i[0]?(o||1)/(r||1):(o||0)-(r||0);this.canChange=!1;const a=this.__;a[i]=r,jt(this.parent),jt(this);const h=new s(this.__world);switch(a[i]=o,this.__layout.rotationChange(),jt(this),this.changedTransform=new s(this.__world).divide(h),i){case"x":t.move(n,0);break;case"y":t.move(0,n);break;case"rotation":t.rotateOf($t,n);break;case"scaleX":t.scaleOf($t,n,1);break;case"scaleY":t.scaleOf($t,1,n);break;case"skewX":t.skewOf($t,n,0);break;case"skewY":t.skewOf($t,0,n)}this.canChange=!0}})}safeChange(t){this.canChange&&(this.checkChange=!1,t(),this.checkChange=!0)}}class Jt extends N{constructor(t,e){super(t,e)}}Jt.BEFORE_MOVE="editor.before_move",Jt.MOVE="editor.move";class Qt extends N{constructor(t,e){super(t,e)}}Qt.BEFORE_SCALE="editor.before_scale",Qt.SCALE="editor.scale";class te extends N{constructor(t,e){super(t,e)}}te.BEFORE_ROTATE="editor.before_rotate",te.ROTATE="editor.rotate";class ee extends N{constructor(t,e){super(t,e)}}ee.BEFORE_SKEW="editor.before_skew",ee.SKEW="editor.skew";class ie{onMove(t){const{target:e,mergeConfig:i,dragStartData:s}=this.editBox;let o,{dragLimitAnimate:r}=i;const n=t.type===z.END||t.type===W.END,h=v(e.draggable),l=!r||n||h,d={x:t.totalX,y:t.totalY};t instanceof z&&O.move(d,e.getWorldPointByLocal(s.totalOffset,null,!0)),t.shiftKey&&(Math.abs(d.x)>Math.abs(d.y)?d.y=0:d.x=0),o=W.getValidMove(e,s.point,d,l),(o.x||o.y)&&(r&&!h&&n?a.animateMove(this,o,S(r)?r:.3):this.move(o))}onScale(t){const{target:e,mergeConfig:i,single:s,dragStartData:o}=this.editBox;let r,{around:n,lockRatio:a,flipable:h,editSize:l}=i;t instanceof Z?(n||(n=e.getBoxPoint(t)),r=t.totalScale):r=t.getInnerTotal(e);const{direction:d}=t.current;(t.shiftKey||e.lockRatio)&&(a=!0);const g=Ot.getScaleData(e,o.bounds,d,r,a,Ot.getAround(n,t.altKey),h,!s||"scale"===l),c=e.x,u=e.y;t instanceof W&&this.editTool&&this.editTool.onScaleWithDrag?(g.drag=t,this.scaleWithDrag(g)):this.scaleOf(g.origin,g.scaleX,g.scaleY),O.move(o.totalOffset,e.x-c,e.y-u)}onRotate(t){const{target:e,mergeConfig:i,dragStartData:s}=this.editBox,{around:o,rotateAround:r,rotateGap:n,diagonalRotateKey:a}=i,{direction:h}=t.current;let l,d;if(t instanceof G)d=t.rotation,l=r?x.getPoint(r,e.boxBounds):e.getBoxPoint(t);else{const i=a?t.isHoldKeys(a):t.shiftKey,n=Ot.getRotateData(e,h,t,s,i?null:r||e.around||e.origin||o||"center");d=s.rotation+n.rotation-e.rotation,l=n.origin}if(d=T.float(T.getGapRotation(d,n,e.rotation),2),!d)return;const g=e.x,c=e.y;this.rotateOf(l,d),O.move(s.totalOffset,e.x-g,e.y-c)}onSkew(t){const{target:e,mergeConfig:i}=this.editBox,{around:s}=i,{origin:o,skewX:r,skewY:n}=Ot.getSkewData(e,t.current.direction,t.getInnerMove(e),Ot.getAround(s,t.altKey));(r||n)&&this.skewOf(o,r,n)}move(t,e=0){if(!this.checkTransform("moveable"))return;h(t)&&(e=t.y,t=t.x);const{target:i,mergeConfig:s,single:o,editor:r}=this.editBox,{beforeMove:n}=s;if(n){const s=n({target:i,x:t,y:e});if(h(s))t=s.x,e=s.y;else if(!1===s)return}const a=i.getWorldPointByLocal({x:t,y:e},null,!0);o||i.safeChange(()=>i.move(t,e));const l={target:i,editor:r,moveX:a.x,moveY:a.y};this.emitEvent(new Jt(Jt.BEFORE_MOVE,l));const d=new Jt(Jt.MOVE,l);this.doMove(d),this.emitEvent(d)}scaleWithDrag(t){if(!this.checkTransform("resizeable"))return;const{target:e,mergeConfig:i,editor:s}=this.editBox,{beforeScale:o}=i;if(o){const{origin:i,scaleX:s,scaleY:r,drag:n}=t;if(!1===o({target:e,drag:n,origin:i,scaleX:s,scaleY:r}))return}t=Object.assign(Object.assign({},t),{target:e,editor:s,worldOrigin:e.getWorldPoint(t.origin)}),this.emitEvent(new Qt(Qt.BEFORE_SCALE,t));const r=new Qt(Qt.SCALE,t);this.editTool.onScaleWithDrag(r),this.emitEvent(r)}scaleOf(t,e,i=e,s){if(!this.checkTransform("resizeable"))return;const{target:o,mergeConfig:r,single:n,editor:a}=this.editBox,{beforeScale:l}=r;if(l){const s=l({target:o,origin:t,scaleX:e,scaleY:i});if(h(s))e=s.scaleX,i=s.scaleY;else if(!1===s)return}const d=this.getWorldOrigin(t),g=!n&&this.getChangedTransform(()=>o.safeChange(()=>o.scaleOf(t,e,i))),c={target:o,editor:a,worldOrigin:d,scaleX:e,scaleY:i,transform:g};this.emitEvent(new Qt(Qt.BEFORE_SCALE,c));const u=new Qt(Qt.SCALE,c);this.doScale(u),this.emitEvent(u)}flip(t){if(!this.checkTransform("resizeable"))return;const{target:e,single:i,editor:o}=this.editBox,r=this.getWorldOrigin("center"),n=i?new s(a.getFlipTransform(e,t)):this.getChangedTransform(()=>e.safeChange(()=>e.flip(t))),h={target:e,editor:o,worldOrigin:r,scaleX:"x"===t?-1:1,scaleY:"y"===t?-1:1,transform:n};this.emitEvent(new Qt(Qt.BEFORE_SCALE,h));const l=new Qt(Qt.SCALE,h);this.doScale(l),this.emitEvent(l)}rotateOf(t,e){if(!this.checkTransform("rotateable"))return;const{target:i,mergeConfig:s,single:o,editor:r}=this.editBox,{beforeRotate:n}=s;if(n){const s=n({target:i,origin:t,rotation:e});if(S(s))e=s;else if(!1===s)return}const a=this.getWorldOrigin(t),h=!o&&this.getChangedTransform(()=>i.safeChange(()=>i.rotateOf(t,e))),l={target:i,editor:r,worldOrigin:a,rotation:e,transform:h};this.emitEvent(new te(te.BEFORE_ROTATE,l));const d=new te(te.ROTATE,l);this.doRotate(d),this.emitEvent(d)}skewOf(t,e,i=0,s){if(!this.checkTransform("skewable"))return;const{target:o,mergeConfig:r,single:n,editor:a}=this.editBox,{beforeSkew:l}=r;if(l){const s=l({target:o,origin:t,skewX:e,skewY:i});if(h(s))e=s.skewX,i=s.skewY;else if(!1===s)return}const d=this.getWorldOrigin(t),g=!n&&this.getChangedTransform(()=>o.safeChange(()=>o.skewOf(t,e,i))),c={target:o,editor:a,worldOrigin:d,skewX:e,skewY:i,transform:g};this.emitEvent(new ee(ee.BEFORE_SKEW,c));const u=new ee(ee.SKEW,c);this.doSkew(u),this.emitEvent(u)}doMove(t){this.editTool.onMove(t)}doScale(t){this.editTool.onScale(t)}doRotate(t){this.editTool.onRotate(t)}doSkew(t){this.editTool.onSkew(t)}checkTransform(t){const{target:e,mergeConfig:i}=this.editBox;return e&&!e.locked&&i[t]}getWorldOrigin(t){const{target:e}=this.editBox;return e.getWorldPoint(a.getInnerOrigin(e,t))}getChangedTransform(t){const{target:e,single:i}=this.editBox;if(!i&&!e.canChange)return e.changedTransform;const o=new s(e.worldTransform);return t(),new s(e.worldTransform).divide(o)}emitEvent(t,e){this.editBox.editor.emitEvent(t,e)}}let se=class extends i{get list(){return this.leafList.list}get dragHoverExclude(){return[this.editBox.rect]}get editing(){return!!this.list.length}get groupOpening(){return!!this.openedGroupList.length}get multiple(){return this.list.length>1}get single(){return 1===this.list.length}get dragPoint(){return this.editBox.dragPoint}get dragging(){return this.editBox.dragging}get gesturing(){return this.editBox.gesturing}get moving(){return this.editBox.moving}get resizing(){return this.editBox.resizing}get rotating(){return this.editBox.rotating}get skewing(){return this.editBox.skewing}get element(){return this.multiple?this.simulateTarget:this.list[0]}get buttons(){return this.editBox.buttons}get targetLeafer(){const t=this.list[0];return t&&t.leafer}constructor(t,e){super(e),this.leafList=new k,this.openedGroupList=new k,this.simulateTarget=new qt(this),this.editBox=new Vt(this),this.editToolList={},this.selector=new ut(this),this.editMask=new Dt(this),this.targetEventIds=[];let i=l.clone(It);t&&(i=l.default(t,i)),this.mergedConfig=this.config=i,this.addMany(this.editMask,this.selector,this.editBox),V.has("resize")||(this.config.editSize="scale")}select(t){this.target=t}cancel(){this.target=null}hasItem(t){return this.leafList.has(t)}getItem(t){return this.list[t||0]}addItem(t){this.hasItem(t)||t.locked||(this.leafList.add(t),this.target=this.leafList.list)}removeItem(t){this.hasItem(t)&&(this.leafList.remove(t),this.target=this.leafList.list)}shiftItem(t){this.hasItem(t)?this.removeItem(t):this.addItem(t)}setDimOthers(t,i="dim",s){if(!s){const{dimTarget:t,targetLeafer:i}=this;s=t?e(t)?t:[t]:[i]}s[0]&&s[0][i]!==(t||!1)&&s.forEach(e=>l.stintSet(e,i,t))}setBright(t){this.setDimOthers(t,"bright",this.list)}cancelDimOthers(){this.setDimOthers(!1),this.setBright(!1),this.hasDimOthers=void 0}update(){if(this.editing){if(!this.element.parent)return this.cancel();this.innerEditing?this.innerEditor.update():this.editTool.update(),this.selector.update()}}updateEditBox(){this.multiple&&Wt(this),this.update()}getEditTool(t){return this.editToolList[t]=this.editToolList[t]||Yt.get(t,this)}updateEditTool(){if(this.unloadEditTool(),this.editing){const t=this.element;let e=t.editOuter||"EditTool";const{beforeEditOuter:i}=this.mergeConfig;if(i){const s=i({target:t,name:e});if(v(s))e=s;else if(!1===s)return}if(Yt.list[e]){const i=this.editTool=this.getEditTool(e);this.editBox.load(),i.editTarget=t,i.load(),this.update()}}}unloadEditTool(t){let e=this.editTool;e&&(t||this.editBox.unload(),e.unload(),t||(this.editTool=null),e.editTarget=null)}getEditSize(t){return this.mergeConfig.editSize}onMove(t){}onScale(t){}onRotate(t){}onSkew(t){}move(t,e=0){}scaleWithDrag(t){}scaleOf(t,e,i=e,s){}flip(t){}rotateOf(t,e){}skewOf(t,e,i=0,s){}checkTransform(t){}getWorldOrigin(t){}getChangedTransform(t){}group(t){return this.multiple&&(this.emitGroupEvent(Kt.BEFORE_GROUP),this.target=J.group(this.list,this.element,t),this.emitGroupEvent(Kt.GROUP,this.target)),this.target}ungroup(){const{list:t}=this;return t.length&&(t.forEach(t=>t.isBranch&&this.emitGroupEvent(Kt.BEFORE_UNGROUP,t)),this.target=J.ungroup(t),t.forEach(t=>t.isBranch&&this.emitGroupEvent(Kt.UNGROUP,t))),this.list}openGroup(t){this.emitGroupEvent(Kt.BEFORE_OPEN,t),this.openedGroupList.add(t),t.hitChildren=!0,this.emitGroupEvent(Kt.OPEN,t)}closeGroup(t){this.emitGroupEvent(Kt.BEFORE_CLOSE,t),this.openedGroupList.remove(t),t.hitChildren=!1,this.emitGroupEvent(Kt.CLOSE,t)}checkOpenedGroups(){const t=this.openedGroupList;if(t.length){let{list:e}=t;this.editing?(e=[],t.forEach(t=>this.list.every(e=>!a.hasParent(e,t))&&e.push(t))):e=[...e],e.forEach(t=>this.closeGroup(t))}this.editing&&!this.selector.dragging&&this.checkDeepSelect()}checkDeepSelect(){let t,{list:e}=this;for(let i=0;i<e.length;i++)for(t=e[i].parent;t&&!t.hitChildren;)this.openGroup(t),t=t.parent}emitGroupEvent(t,e){const i=new Kt(t,{editTarget:e});this.emitEvent(i),e&&e.emitEvent(i)}getInnerEditor(t){return this.editToolList[t]=this.editToolList[t]||Yt.get(t,this)}openInnerEditor(t,e,i){let s;if(v(e)?s=e:i||(i=e),t&&i&&(this.target=t),this.single){t||(t=this.element),s||(s=t.editInner);const{beforeEditInner:e}=this.mergeConfig;if(e){const i=e({target:t,name:s});if(v(i))s=i;else if(!1===i)return}Yt.list[s]&&(this.unloadEditTool(!0),this.innerEditing=!0,this.innerEditor=this.getInnerEditor(s),this.innerEditor.editTarget=t,this.emitInnerEvent(Ut.BEFORE_OPEN),this.innerEditor.load(),this.emitInnerEvent(Ut.OPEN))}}closeInnerEditor(t){this.innerEditing&&(this.innerEditing=!1,this.emitInnerEvent(Ut.BEFORE_CLOSE),this.innerEditor.unload(),this.emitInnerEvent(Ut.CLOSE),t||this.updateEditTool(),this.innerEditor=this.innerEditor.editTarget=null)}emitInnerEvent(t){const{innerEditor:e}=this,{editTarget:i}=e,s=new Ut(t,{editTarget:i,innerEditor:e});this.emitEvent(s),i.emitEvent(s)}lock(){this.list.forEach(t=>t.locked=!0),this.update()}unlock(){this.list.forEach(t=>t.locked=!1),this.update()}toTop(){this.list.length&&(J.toTop(this.list),this.leafList.update())}toBottom(){this.list.length&&(J.toBottom(this.list),this.leafList.update())}onAppRenderStart(t){(this.targetChanged=t.children.some(t=>t!==this.leafer&&t.renderer.changed))&&this.editBox.forceRender()}onRenderStart(){this.targetChanged&&this.update()}onChildScroll(){this.multiple&&this.updateEditBox()}listenTargetEvents(){if(!this.targetEventIds.length){const{app:t,leafer:e,targetLeafer:i,editMask:s}=this;this.targetEventIds=[e.on_(H.START,this.onRenderStart,this),i&&i.on_(R.SCROLL,this.onChildScroll,this),t.on_(H.CHILD_START,this.onAppRenderStart,this),t.on_(D.UPDATE_MODE,t=>{t.mode&&"normal"!==t.mode&&this.cancel()})],s.visible&&s.forceRender()}}removeTargetEvents(){const{targetEventIds:t,editMask:e}=this;t.length&&(this.off_(t),e.visible&&e.forceRender())}destroy(){this.destroyed||(this.target=this.hoverTarget=null,Object.values(this.editToolList).forEach(t=>t.destroy()),this.simulateTarget.destroy(),this.editToolList={},this.simulateTarget=this.editTool=this.innerEditor=null,super.destroy())}};K([(t,e)=>{o(t,e,{get(){const{config:t,element:e,dragPoint:i,editBox:s,editTool:o,innerEditor:a,app:h}=this,l=Object.assign({},t);if(a?a.editConfig&&Object.assign(l,a.editConfig):o&&o.editConfig&&Object.assign(l,o.editConfig),e&&e.mask&&J.mergeMaskConfig(l,this),e&&e.editConfig){let{editConfig:t}=e;(t.hover||t.hoverStyle||t.hoverPathType)&&(t=Object.assign({},t),delete t.hover,delete t.hoverStyle,delete t.hoverPathType),Object.assign(l,t)}return s.config&&Object.assign(l,s.config),i&&(i.editConfig&&Object.assign(l,i.editConfig),"font-size"===l.editSize&&(l.lockRatio=!0),"resize-rotate"===i.pointType&&(l.around||(l.around="center"),r(l.lockRatio)&&(l.lockRatio=!0))),n(l.dragLimitAnimate)&&(l.dragLimitAnimate=h&&h.config.pointer.dragLimitAnimate),this.mergedConfig=l}})}],se.prototype,"mergeConfig",void 0),K([Q(function(t,e){const{target:i}=t;i?(t.leafList=i instanceof k?i:new k(i),t.multiple&&Wt(t)):(t.simulateTarget.remove(),t.leafList.reset()),t.closeInnerEditor(!0),t.unloadEditTool();const s={editor:t,value:i,oldValue:e};t.emitEvent(new N(N.SELECT,s)),t.checkOpenedGroups(),t.editing?t.waitLeafer(()=>{t.updateEditTool(),t.listenTargetEvents()}):(t.updateEditTool(),t.removeTargetEvents()),t.emitEvent(new N(N.AFTER_SELECT,s))})],se.prototype,"target",void 0),K([Q(function(t,e){t.emitEvent(new N(N.HOVER,{editor:t,value:t.hoverTarget,oldValue:e}))})],se.prototype,"hoverTarget",void 0),se=K([U(ie,["editBox","editTool","emitEvent"])],se);const{abs:oe}=Math,{scale:re}=O;class ne{static registerInnerEditor(){Yt.register(this)}get tag(){return"InnerEditor"}get mode(){return"focus"}get userConfig(){return this.editBox.mergeConfig[this.tag]||{}}get editBox(){return this._editBox||this.editor.editBox}set editBox(t){this._editBox=t}constructor(t){this.configKeepKeys=["editBox"],this.eventIds=[],this.editor=t,this.create()}getEditBoxPoint(t,e){const i=e?t:{x:t.x,y:t.y},{scaleX:s,scaleY:o}=this.editTarget.worldTransform;return re(i,oe(s),oe(o)),i}getEditTargetPoint(t,e){const i=e?t:{x:t.x,y:t.y},{scaleX:s,scaleY:o}=this.editTarget.worldTransform;return re(i,Math.abs(1/s),oe(1/o)),i}onCreate(){}create(){this.view=new i,this.onCreate()}showView(){this.view.opacity=1}hideView(){this.view.opacity=0}onLoad(){}load(){const{editor:t}=this;t&&(t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!1),this.onLoad())}onUpdate(){}update(){this.editor&&(this.updateEditBoxConfig(),this.editBox.update(),this.onUpdate())}onUnload(){}unload(){const{editor:t}=this;t&&(this.unloadEditBoxConfig(),t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!0),this.onUnload())}updateEditBoxConfig(){const{mergeConfig:t}=this;t&&(this.editBox.config=t.editBox)}unloadEditBoxConfig(){this.editBox.config=void 0}onDestroy(){}destroy(){this.onDestroy(),this.editor&&(this.view&&this.view.destroy(),this.eventIds&&this.editor.off_(this.eventIds),this.editor=this.view=this.eventIds=null)}}K([tt()],ne.prototype,"mergeConfig",void 0);let ae=class extends ne{static registerEditTool(t,e){Yt.register(this,t),e&&o(this.prototype,"tag",{get:()=>t})}get tag(){return"EditTool"}onMove(t){if(this.isMotionElement&&this.onMoveMotion(t))return;if(this.isFlowElement&&this.onMoveFlow(t))return;const{moveX:e,moveY:i,editor:s}=t,{app:o,list:r}=s;o.lockLayout(),r.forEach(t=>{t.moveWorld(e,i)}),o.unlockLayout()}onScale(t){if(this.isFlowElement&&this.onScaleFlow(t))return;const{scaleX:e,scaleY:i,transform:s,worldOrigin:o,editor:r}=t,{app:n,list:a}=r;n.lockLayout(),a.forEach(t=>{const n="scale"!==r.getEditSize(t);s?t.transformWorld(s,n,!1):t.scaleOfWorld(o,e,i,n,!1)}),n.unlockLayout()}onRotate(t){if(this.isFlowElement&&this.onRotateFlow(t))return;const{rotation:e,transform:i,worldOrigin:s,editor:o}=t,{app:r,list:n}=o;r.lockLayout(),n.forEach(t=>{const r="scale"!==o.getEditSize(t);i?t.transformWorld(i,r,!1):t.rotateOfWorld(s,e)}),r.unlockLayout()}onSkew(t){if(this.isFlowElement&&this.onSkewFlow(t))return;const{skewX:e,skewY:i,transform:s,worldOrigin:o,editor:r}=t,{app:n,list:a}=r;n.lockLayout(),a.forEach(t=>{const n="scale"!==r.getEditSize(t);s?t.transformWorld(s,n,!1):t.skewOfWorld(o,e,i,n)}),n.unlockLayout()}load(){this.editor&&(this.editBox.view.visible=!0,this.onLoad())}unload(){this.editor&&(this.editBox.view.visible=!1,this.unloadEditBoxConfig(),this.onUnload())}};ae=K([Zt()],ae);const{left:he,right:le}=L,{move:de,copy:ge,toNumberPoints:ce}=O;let ue=class extends ae{constructor(){super(...arguments),this.scaleOfEvent=!0}get tag(){return"LineEditTool"}onScaleWithDrag(t){const{drag:e,direction:i,lockRatio:s,around:o}=t,r=t.target,n=i===he;if(r.pathInputed){const{path:t}=r.__,{from:i,to:a}=this.getFromToByPath(t);this.dragPoint(i,a,n,o,this.getInnerMove(r,e,s)),t[1]=i.x,t[2]=i.y,t[4]=a.x,t[5]=a.y,r.path=t}else if(r.points){const{points:t}=r,{from:i,to:a}=this.getFromToByPoints(t);this.dragPoint(i,a,n,o,this.getInnerMove(r,e,s)),t[0]=i.x,t[1]=i.y,t[2]=a.x,t[3]=a.y,r.points=t}else{const t=M(),{toPoint:i}=r;r.rotation=0,this.dragPoint(t,i,n,o,this.getInnerMove(r,e,s)),r.getLocalPointByInner(t,null,null,!0),r.getLocalPointByInner(i,null,null,!0),r.x=t.x,r.y=t.y,r.getInnerPointByLocal(i,null,null,!0),r.toPoint=i}}getInnerMove(t,e,i){const s=e.getInnerMove(t);return i&&(Math.abs(s.x)>Math.abs(s.y)?s.y=0:s.x=0),s}getFromToByPath(t){return{from:{x:t[1],y:t[2]},to:{x:t[4],y:t[5]}}}getFromToByPoints(t){const e=ce(t);return{from:{x:e[0],y:e[1]},to:{x:e[2],y:e[3]}}}dragPoint(t,e,i,s,o){const{x:r,y:n}=o;i?(de(t,r,n),s&&de(e,-r,-n)):(s&&de(t,-r,-n),de(e,r,n))}onSkew(t){}onUpdate(){const{editBox:t}=this,{rotatePoints:e,resizeLines:i,resizePoints:s,rect:o}=t,r=t.target;let n,a;if(r.pathInputed?n=this.getFromToByPath(r.__.path):r.points&&(n=this.getFromToByPoints(r.__.points)),n){const{from:i,to:a}=n;r.innerToWorld(i,i,!1,t),r.innerToWorld(a,a,!1,t);const{x:h,y:l}=t.rectBounds;o.pen.clearPath().moveTo(i.x-h,i.y-l).lineTo(a.x-h,a.y-l),ge(s[7],i),ge(e[7],i),ge(s[3],a),ge(e[3],a)}for(let t=0;t<8;t++)t<4&&(i[t].visible=!1),a=t===he||t===le,s[t].visible=a,e[t].visible=!n&&a}};ue=K([Zt()],ue),V.add("editor","resize"),A.editor=function(t,e){const i=new se(t);return e&&e.sky.add(e.editor=i),i},_.addAttr("textBox",!1,I),m.addAttr("editConfig",void 0,I),m.addAttr("editOuter",t=>{t.updateLayout();const{EditTool:e,LineEditTool:i,PointsEditTool:s}=Yt,o=t.pathInputed||t.isPointsMode?s:t.tag+"EditTool",r=Yt.list[o];return!t.__.__isLinePath||o==s&&r?r?o:e:i},I),m.addAttr("editInner","PathEditor",I),i.addAttr("editInner","",I),P.addAttr("editInner","TextEditor",I),m.setEditConfig=function(t){this.changeAttr("editConfig",t)},m.setEditOuter=function(t){this.changeAttr("editOuter",t)},m.setEditInner=function(t){this.changeAttr("editInner",t)};export{Vt as EditBox,Ot as EditDataHelper,Ct as EditPoint,ut as EditSelect,lt as EditSelectHelper,ae as EditTool,Yt as EditToolCreator,se as Editor,N as EditorEvent,Kt as EditorGroupEvent,J as EditorHelper,Jt as EditorMoveEvent,te as EditorRotateEvent,Qt as EditorScaleEvent,ee as EditorSkewEvent,ne as InnerEditor,Ut as InnerEditorEvent,ue as LineEditTool,ht as SelectArea,at as Stroker,ie as TransformTool,tt as editToolMergeConfigAttr,Zt as registerEditTool,Xt as registerInnerEditor};
|
|
2
2
|
//# sourceMappingURL=editor.esm.min.js.map
|