@leafer-ui/draw 1.9.5 → 1.9.7
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/lib/draw.cjs +115 -87
- package/lib/draw.esm.js +116 -88
- package/lib/draw.esm.min.js +1 -1
- package/lib/draw.esm.min.js.map +1 -1
- package/lib/draw.min.cjs +1 -1
- package/lib/draw.min.cjs.map +1 -1
- package/package.json +6 -6
package/lib/draw.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineKey as t,decorateLeafAttr as e,attr as i,createDescriptor as s,Plugin as o,isObject as r,PathConvert as a,DataHelper as n,Debug as h,LeafData as _,isString as d,isUndefined as l,isArray as p,canvasSizeAttrs as u,UICreator as c,MathHelper as y,dataProcessor as g,dataType as v,surfaceType as f,opacityType as w,visibleType as x,sortType as S,maskType as m,eraserType as R,positionType as k,boundsType as B,scaleType as b,rotationType as A,scrollType as C,autoLayoutType as P,naturalBoundsType as F,affectRenderBoundsType as W,pathInputType as E,pathType as T,hitType as I,strokeType as D,cursorType as L,rewrite as z,Leaf as M,useModule as O,rewriteAble as N,pen as V,PathCorner as H,PathDrawer as Y,isNumber as U,registerUI as X,Branch as j,LeafList as J,Resource as q,getBoundsData as G,Creator as $,CanvasManager as K,WaitHelper as Q,LeaferEvent as Z,Bounds as tt,ResizeEvent as et,AutoBounds as it,Run as st,LayoutEvent as ot,RenderEvent as rt,WatchEvent as at,ImageManager as nt,BoundsHelper as ht,PathCommandDataHelper as _t,Platform as dt,PointHelper as lt,affectStrokeBoundsType as pt,getPointData as ut,LeaferImage as ct,ImageEvent as yt,Matrix as gt,PathCreator as vt}from"@leafer/core";export*from"@leafer/core";function ft(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}function wt(t){return e(t,t=>i({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function xt(t){return e(t,t=>i({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function St(){return(e,i)=>{const s="_"+i;t(e,i,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}function mt(e){return(i,o)=>{t(i,o,s(o,e))}}"function"==typeof SuppressedError&&SuppressedError;const Rt={},kt={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},Bt={number:(t,e)=>r(t)?"percent"===t.type?t.value*e:t.value:t},bt={},At={},Ct={},Pt={},Ft={},Wt={apply(){o.need("filter")}},Et={},Tt={setStyleName:()=>o.need("state"),set:()=>o.need("state")},It={list:{},register(t,e){It.list[t]=e},get:t=>It.list[t]},{parse:Dt,objectToCanvasData:Lt}=a,{stintSet:zt}=n,{hasTransparent:Mt}=kt,Ot={},Nt=h.get("UIData");class Vt extends _{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Nt.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Nt.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),d(t)||!t?(zt(this,"__isTransparentFill",Mt(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):r(t)&&this.__setPaint("fill",t)}setStroke(t){d(t)||!t?(zt(this,"__isTransparentStroke",Mt(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):r(t)&&this.__setPaint("stroke",t)}setPath(t){const e=d(t);e||t&&r(t[0])?(this.__setInput("path",t),this._path=e?Dt(t):Lt(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Ht(this,"shadow",t)}setInnerShadow(t){Ht(this,"innerShadow",t)}setFilter(t){Ht(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&At.compute("fill",this.__leaf),e&&At.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),l(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const i=this.__leaf.__layout;i.boxChanged||i.boxChange(),p(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Ot)):(this.__isStrokes=!0,this._stroke||(this._stroke=Ot))}__removePaint(t,e){e&&this.__removeInput(t),Ct.recycleImage(t,this),"fill"===t?(zt(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(zt(this,"__isAlphaPixelStroke",void 0),zt(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function Ht(t,e,i){t.__setInput(e,i),p(i)?(i.some(t=>!1===t.visible)&&(i=i.filter(t=>!1!==t.visible)),i.length||(i=void 0)):i=i&&!1!==i.visible?[i]:void 0,t["_"+e]=i}class Yt extends Vt{}class Ut extends Yt{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class Xt extends Yt{__getInputData(t,e){const i=super.__getInputData(t,e);return u.forEach(t=>delete i[t]),i}}class jt extends Ut{}class Jt extends Vt{get __usePathBox(){return this.points||this.__pathInputed}}class qt extends Vt{get __boxStroke(){return!this.__pathInputed}}class Gt extends Vt{get __boxStroke(){return!this.__pathInputed}}class $t extends Jt{}class Kt extends Vt{}class Qt extends Vt{get __pathInputed(){return 2}}class Zt extends Yt{}const te={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class ee extends Vt{get __useNaturalRatio(){return!1}setFontWeight(t){d(t)?(this.__setInput("fontWeight",t),t=te[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:s}=this;if(i)for(let t in s)i[t]=void 0;else i=e.__box=c.get("Rect",0);const o=e.__layout,r=i.__layout;s||(i.parent=e,i.__world=e.__world,r.boxBounds=o.boxBounds),i.set(t),r.strokeChanged&&o.strokeChange(),r.renderChanged&&o.renderChange(),i.__updateChange()}else i&&(e.__box=i.parent=null,i.destroy());this._boxStyle=t}}class ie extends qt{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(t,e){const i=super.__getInputData(t,e);return delete i.fill,i}}class se extends qt{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url=this.__leaf.canvas.toDataURL("image/png"),i}}const oe={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:s,__maxStrokeWidth:o}=i,r=this.__box;if((i.stroke||"all"===i.hitStroke)&&o&&"inside"!==s&&(e=t="center"===s?o/2:o,!i.__boxStroke)){const e=i.__isLinePath?0:10*t,s="none"===i.strokeCap?0:o;t+=Math.max(e,s)}return i.__useArrow&&(t+=5*o),r&&(t=Math.max(r.__layout.strokeSpread=r.__updateStrokeSpread(),t),e=r.__layout.strokeBoxSpread),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:o,filter:r,renderSpread:a}=this.__;e&&e.forEach(e=>t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur)),s&&(t=Math.max(t,s)),r&&(t+=Wt.getSpread(r)),a&&(t+=a);let n=t=Math.ceil(t);return i&&i.forEach(t=>n=Math.max(n,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)),o&&(n=Math.max(n,o)),this.__layout.renderShapeSpread=n,t+=this.__layout.strokeSpread||0,this.__box?Math.max(this.__box.__updateRenderSpread(),t):t}},re={getValidMove(t,e,i,s,o){const r=t.x+s.x,a=t.y+s.y,n=r+t.width,h=a+t.height,_=e.x+e.width,d=e.y+e.height;o||(s=Object.assign({},s));const l=t.width>e.width,p=t.height>e.height;return l&&"outer"!==i?r>e.x?s.x+=e.x-r:n<_&&(s.x+=_-n):r<e.x?s.x+=e.x-r:n>_&&(s.x+=_-n),p&&"outer"!==i?a>e.y?s.y+=e.y-a:h<d&&(s.y+=d-h):a<e.y?s.y+=e.y-a:h>d&&(s.y+=d-h),s.x=y.float(s.x),s.y=y.float(s.y),s},axisMove(t,e){const{draggable:i}=t;"x"===i&&(e.y=0),"y"===i&&(e.x=0)},limitMove(t,e){const{dragBounds:i,dragBoundsType:s}=t;i&&ae.getValidMove(t.__localBoxBounds,"parent"===i?t.parent.boxBounds:i,s,e,!0),ae.axisMove(t,e)}},ae=re,{stintSet:ne}=n,he={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);ne(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),ne(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:s}=t,o=t.innerShadow||t.blur||t.backgroundBlur||t.filter;ne(t,"__isFastShadow",e&&!o&&e.length<2&&!e[0].spread&&i&&!t.__isTransparentFill&&!(p(i)&&i.length>1)&&(this.useFastShadow||!s||s&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!o)}t.__checkSingle(),ne(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){_e(this,t,e)},__draw(t,e,i){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:o,stroke:r,__drawAfterFill:a,__fillAfterStroke:n,__isFastShadow:h}=s;if(this.__drawRenderPath(t),s.__useEffect&&!h){const h=At.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:_,innerShadow:d,filter:l}=s;_&&Ft.shadow(this,t,h),n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),o&&(s.__isFills?At.fills(o,this,t):At.fill(o,this,t)),a&&this.__drawAfterFill(t,e),d&&Ft.innerShadow(this,t,h),r&&!n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),l&&Wt.apply(l,this,this.__nowWorld,t,i,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),h){const e=s.shadow[0],{scaleX:i,scaleY:o}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*o,e.blur*i,kt.string(e.color))}o&&(s.__isFills?At.fills(o,this,t):At.fill(o,this,t)),h&&t.restore(),a&&this.__drawAfterFill(t,e),r&&!n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t))}}else s.__pathInputed?_e(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:s,stroke:o}=i;s&&!e.ignoreFill&&(i.__isAlphaPixelFill?At.fills(s,this,t):At.fill("#000000",this,t)),i.__isCanvas&&this.__drawAfterFill(t,e),o&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?At.strokes(o,this,t):At.stroke("#000000",this,t))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function _e(t,e,i){const{fill:s,stroke:o,__drawAfterFill:r,__fillAfterStroke:a}=t.__;t.__drawRenderPath(e),a&&At.stroke(o,t,e),s&&At.fill(s,t,e),r&&t.__drawAfterFill(e,i),o&&!a&&At.stroke(o,t,e)}const de={__drawFast(t,e){let{x:i,y:s,width:o,height:r}=this.__layout.boxBounds;const{fill:a,stroke:n,__drawAfterFill:h}=this.__;if(a&&(t.fillStyle=a,t.fillRect(i,s,o,r)),h&&this.__drawAfterFill(t,e),n){const{strokeAlign:a,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(n,h,this.__);const _=h/2;switch(a){case"center":t.strokeRect(0,0,o,r);break;case"inside":o-=h,r-=h,o<0||r<0?(t.save(),this.__clip(t,e),t.strokeRect(i+_,s+_,o,r),t.restore()):t.strokeRect(i+_,s+_,o,r);break;case"outside":t.strokeRect(i-_,s-_,o+h,r+h)}}}};var le;let pe=le=class extends M{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){y.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return V.set(this.path=t||[]),t||this.__drawPathByBox(V),V}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return d(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return o.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return o.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;return i||(V.set(i=[]),this.__drawPathByBox(V)),t?a.toCanvasData(i,!0):i}getPathString(t,e,i){return a.stringify(this.getPath(t,e),i)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||Et.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?H.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&bt.addArrows(this)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?Y.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:i,width:s,height:o}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:r}=this.__;t.roundRect(e,i,s,o,U(r)?[r]:r)}else t.rect(e,i,s,o)}drawImagePlaceholder(t,e){At.fill(this.__.placeholderColor,this,t)}animate(t,e,i,s){return this.set(t),o.need("animate")}killAnimate(t,e){}export(t,e){return o.need("export")}syncExport(t,e){return o.need("export")}clone(t){const e=n.clone(this.toJSON());return t&&Object.assign(e,t),le.one(e)}static one(t,e,i,s,o){return c.get(t.tag||this.prototype.__tag,t,e,i,s,o)}static registerUI(){X()(this)}static registerData(t){g(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};ft([g(Vt)],pe.prototype,"__",void 0),ft([St()],pe.prototype,"zoomLayer",void 0),ft([v("")],pe.prototype,"id",void 0),ft([v("")],pe.prototype,"name",void 0),ft([v("")],pe.prototype,"className",void 0),ft([f("pass-through")],pe.prototype,"blendMode",void 0),ft([w(1)],pe.prototype,"opacity",void 0),ft([x(!0)],pe.prototype,"visible",void 0),ft([f(!1)],pe.prototype,"locked",void 0),ft([f(!1)],pe.prototype,"dim",void 0),ft([f(!1)],pe.prototype,"dimskip",void 0),ft([S(0)],pe.prototype,"zIndex",void 0),ft([m(!1)],pe.prototype,"mask",void 0),ft([R(!1)],pe.prototype,"eraser",void 0),ft([k(0,!0)],pe.prototype,"x",void 0),ft([k(0,!0)],pe.prototype,"y",void 0),ft([B(100,!0)],pe.prototype,"width",void 0),ft([B(100,!0)],pe.prototype,"height",void 0),ft([b(1,!0)],pe.prototype,"scaleX",void 0),ft([b(1,!0)],pe.prototype,"scaleY",void 0),ft([A(0,!0)],pe.prototype,"rotation",void 0),ft([A(0,!0)],pe.prototype,"skewX",void 0),ft([A(0,!0)],pe.prototype,"skewY",void 0),ft([k(0,!0)],pe.prototype,"offsetX",void 0),ft([k(0,!0)],pe.prototype,"offsetY",void 0),ft([C(0,!0)],pe.prototype,"scrollX",void 0),ft([C(0,!0)],pe.prototype,"scrollY",void 0),ft([P()],pe.prototype,"origin",void 0),ft([P()],pe.prototype,"around",void 0),ft([v(!1)],pe.prototype,"lazy",void 0),ft([F(1)],pe.prototype,"pixelRatio",void 0),ft([W(0)],pe.prototype,"renderSpread",void 0),ft([E()],pe.prototype,"path",void 0),ft([T()],pe.prototype,"windingRule",void 0),ft([T(!0)],pe.prototype,"closed",void 0),ft([B(0)],pe.prototype,"padding",void 0),ft([B(!1)],pe.prototype,"lockRatio",void 0),ft([B()],pe.prototype,"widthRange",void 0),ft([B()],pe.prototype,"heightRange",void 0),ft([v(!1)],pe.prototype,"draggable",void 0),ft([v()],pe.prototype,"dragBounds",void 0),ft([v("auto")],pe.prototype,"dragBoundsType",void 0),ft([v(!1)],pe.prototype,"editable",void 0),ft([I(!0)],pe.prototype,"hittable",void 0),ft([I("path")],pe.prototype,"hitFill",void 0),ft([D("path")],pe.prototype,"hitStroke",void 0),ft([I(!1)],pe.prototype,"hitBox",void 0),ft([I(!0)],pe.prototype,"hitChildren",void 0),ft([I(!0)],pe.prototype,"hitSelf",void 0),ft([I()],pe.prototype,"hitRadius",void 0),ft([L("")],pe.prototype,"cursor",void 0),ft([f()],pe.prototype,"fill",void 0),ft([D(void 0,!0)],pe.prototype,"stroke",void 0),ft([D("inside")],pe.prototype,"strokeAlign",void 0),ft([D(1,!0)],pe.prototype,"strokeWidth",void 0),ft([D(!1)],pe.prototype,"strokeWidthFixed",void 0),ft([D("none")],pe.prototype,"strokeCap",void 0),ft([D("miter")],pe.prototype,"strokeJoin",void 0),ft([D()],pe.prototype,"dashPattern",void 0),ft([D(0)],pe.prototype,"dashOffset",void 0),ft([D(10)],pe.prototype,"miterLimit",void 0),ft([T(0)],pe.prototype,"cornerRadius",void 0),ft([T()],pe.prototype,"cornerSmoothing",void 0),ft([wt()],pe.prototype,"shadow",void 0),ft([wt()],pe.prototype,"innerShadow",void 0),ft([wt()],pe.prototype,"blur",void 0),ft([wt()],pe.prototype,"backgroundBlur",void 0),ft([wt()],pe.prototype,"grayscale",void 0),ft([wt()],pe.prototype,"filter",void 0),ft([f()],pe.prototype,"placeholderColor",void 0),ft([v(100)],pe.prototype,"placeholderDelay",void 0),ft([v({})],pe.prototype,"data",void 0),ft([z(M.prototype.reset)],pe.prototype,"reset",null),pe=le=ft([O(oe),O(he),N()],pe);let ue=class extends pe{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:i}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),i.forEach(t=>this.add(t)),t.children=i}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};var ce;ft([g(Yt)],ue.prototype,"__",void 0),ft([B(0)],ue.prototype,"width",void 0),ft([B(0)],ue.prototype,"height",void 0),ue=ft([O(j),X()],ue);const ye=h.get("Leafer");let ge=ce=class extends ue{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&q.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||G()}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),ce.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:s}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),i=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,n.assign(s,t));const o=this.canvas=$.canvas(s);this.__controllers.push(this.renderer=$.renderer(this,o,s),this.watcher=$.watcher(this,s),this.layouter=$.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),this.view=o.view,e||(this.selector=$.selector(this),this.interaction=$.interaction(this,o,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=$.hitCanvasManager()),this.canvasManager=new K,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(o),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),Q.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(Z.RESTART):this.emitLeafer(Z.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(Z.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=n.copyAttrs({},t,u);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:i}=this;i&&(i.addBlock(t?new tt(t):this.canvas.bounds),this.viewReady&&(e?i.render():i.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const i=n.copyAttrs({},this.canvas,u);e.resize(t),this.updateLazyBounds(),this.__onResize(new et(t,i))}__onResize(t){this.emitEvent(t),n.copyAttrs(this.__,t,u),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new it(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(u.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t&&(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren()))),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&u.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:i,canvas:s}=this,o=n.copyAttrs({},s,u);o[t]=i[t]=e,i.width&&i.height?s.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(o)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(Z.BEFORE_READY),this.emitLeafer(Z.READY),this.emitLeafer(Z.AFTER_READY),Q.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Z.VIEW_READY),Q.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:s,height:o,pixelRatio:r}=this;const a="box"===t?this.worldBoxBounds:this.__world;e||(s=Math.max(1,a.x+a.width)),i||(o=Math.max(1,a.y+a.height)),this.__doResize({width:s,height:o,pixelRatio:r})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Q.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(Z.VIEW_COMPLETED),Q.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let e=0;e<s.length;e++)if(s[e]===t){s.splice(e,1);break}}else s.push(t);this.requestRender()}zoom(t,e,i,s){return o.need("view")}getValidMove(t,e,i){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:i}=this.clientBounds;return{x:e+t.x,y:i+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new Z(t,this))}__listenEvents(){const t=st.start("FirstCreate "+this.innerName);this.once([[Z.START,()=>st.end(t)],[ot.START,this.updateLazyBounds,this],[rt.START,this.__onCreated,this],[rt.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[at.DATA,this.__onWatchData,this],[ot.END,this.__onLayoutEnd,this],[rt.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){ce.list.remove(this);try{this.stop(),this.emitLeafer(Z.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{nt.clearRecycled()},100)}catch(t){ye.error(t)}}};t?e():setTimeout(e)}};ge.list=new J,ft([g(Xt)],ge.prototype,"__",void 0),ft([B()],ge.prototype,"pixelRatio",void 0),ge=ce=ft([X()],ge);let ve=class extends pe{get __tag(){return"Rect"}};ft([g(qt)],ve.prototype,"__",void 0),ve=ft([O(de),N(),X()],ve);const{add:fe,includes:we,scroll:xe}=ht,Se=ve.prototype,me=ue.prototype;let Re=class extends ue{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const i=this.__,s=this.__layout,{renderBounds:o,boxBounds:r}=s,{overflow:a}=i,n=s.childrenRenderBounds||(s.childrenRenderBounds=G());super.__updateRenderBounds(n),(e=a.includes("scroll"))&&(fe(n,r),xe(n,i)),this.__updateRectRenderBounds(),t=!we(r,n),t&&"show"===a&&fe(o,n)}else this.__updateRectRenderBounds();n.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};ft([g(Ut)],Re.prototype,"__",void 0),ft([B(100)],Re.prototype,"width",void 0),ft([B(100)],Re.prototype,"height",void 0),ft([v(!1)],Re.prototype,"resizeChildren",void 0),ft([W("show")],Re.prototype,"overflow",void 0),ft([z(Se.__updateStrokeSpread)],Re.prototype,"__updateStrokeSpread",null),ft([z(Se.__updateRenderSpread)],Re.prototype,"__updateRectRenderSpread",null),ft([z(Se.__updateBoxBounds)],Re.prototype,"__updateRectBoxBounds",null),ft([z(Se.__updateStrokeBounds)],Re.prototype,"__updateStrokeBounds",null),ft([z(Se.__updateRenderBounds)],Re.prototype,"__updateRectRenderBounds",null),ft([z(Se.__updateChange)],Re.prototype,"__updateRectChange",null),ft([z(Se.__render)],Re.prototype,"__renderRect",null),ft([z(me.__render)],Re.prototype,"__renderGroup",null),Re=ft([N(),X()],Re);let ke=class extends Re{get __tag(){return"Frame"}get isFrame(){return!0}};ft([g(jt)],ke.prototype,"__",void 0),ft([f("#FFFFFF")],ke.prototype,"fill",void 0),ft([W("hide")],ke.prototype,"overflow",void 0),ke=ft([X()],ke);const{moveTo:Be,closePath:be,ellipse:Ae}=_t;let Ce=class extends pe{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:i,startAngle:s,endAngle:o}=this.__,r=t/2,a=e/2,n=this.__.path=[];i?(s||o?(i<1&&Ae(n,r,a,r*i,a*i,0,s,o,!1),Ae(n,r,a,r,a,0,o,s,!0),i<1&&be(n)):(i<1&&(Ae(n,r,a,r*i,a*i),Be(n,t,a)),Ae(n,r,a,r,a,0,360,0,!0)),dt.ellipseToCurve&&(this.__.path=this.getPath(!0))):s||o?(Be(n,r,a),Ae(n,r,a,r,a,0,s,o,!1),be(n)):Ae(n,r,a,r,a)}};ft([g(Gt)],Ce.prototype,"__",void 0),ft([T(0)],Ce.prototype,"innerRadius",void 0),ft([T(0)],Ce.prototype,"startAngle",void 0),ft([T(0)],Ce.prototype,"endAngle",void 0),Ce=ft([X()],Ce);const{moveTo:Pe,lineTo:Fe,drawPoints:We}=_t,{rotate:Ee,getAngle:Te,getDistance:Ie,defaultPoint:De}=lt;let Le=class extends pe{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i=ut();return t&&(i.x=t),e&&Ee(i,e),i}set toPoint(t){this.width=Ie(De,t),this.rotation=Te(De,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?We(e,t.points,t.curve,t.closed):(Pe(e,0,0),Fe(e,this.width,0))}};ft([g(Jt)],Le.prototype,"__",void 0),ft([pt("center")],Le.prototype,"strokeAlign",void 0),ft([B(0)],Le.prototype,"height",void 0),ft([T()],Le.prototype,"points",void 0),ft([T(0)],Le.prototype,"curve",void 0),ft([T(!1)],Le.prototype,"closed",void 0),Le=ft([X()],Le);const{sin:ze,cos:Me,PI:Oe}=Math,{moveTo:Ne,lineTo:Ve,closePath:He,drawPoints:Ye}=_t,Ue=Le.prototype;let Xe=class extends pe{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)Ye(e,t.points,t.curve,!0);else{const{width:i,height:s,sides:o}=t,r=i/2,a=s/2;Ne(e,r,0);for(let t=1;t<o;t++)Ve(e,r+r*ze(2*t*Oe/o),a-a*Me(2*t*Oe/o));He(e)}}__updateRenderPath(){}__updateBoxBounds(){}};ft([g($t)],Xe.prototype,"__",void 0),ft([T(3)],Xe.prototype,"sides",void 0),ft([T()],Xe.prototype,"points",void 0),ft([T(0)],Xe.prototype,"curve",void 0),ft([z(Ue.__updateRenderPath)],Xe.prototype,"__updateRenderPath",null),ft([z(Ue.__updateBoxBounds)],Xe.prototype,"__updateBoxBounds",null),Xe=ft([N(),X()],Xe);const{sin:je,cos:Je,PI:qe}=Math,{moveTo:Ge,lineTo:$e,closePath:Ke}=_t;let Qe=class extends pe{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s}=this.__,o=t/2,r=e/2,a=this.__.path=[];Ge(a,o,0);for(let t=1;t<2*i;t++)$e(a,o+(t%2==0?o:o*s)*je(t*qe/i),r-(t%2==0?r:r*s)*Je(t*qe/i));Ke(a)}};ft([g(Kt)],Qe.prototype,"__",void 0),ft([T(5)],Qe.prototype,"corners",void 0),ft([T(.382)],Qe.prototype,"innerRadius",void 0),Qe=ft([X()],Qe);let Ze=class extends ve{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return p(t)&&t[0].image}};ft([g(ie)],Ze.prototype,"__",void 0),ft([B("")],Ze.prototype,"url",void 0),Ze=ft([X()],Ze);const ti=Ze;let ei=class extends ve{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=$.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new ct({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new yt(yt.LOADED,{image:t}))})}draw(t,e,i,s){const o=new gt(t.worldTransform).invert(),r=new gt;e&&r.translate(e.x,e.y),i&&(U(i)?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),o.multiplyParent(r),t.__render(this.canvas,{matrix:o.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:s}=this.__,{view:o}=this.canvas;t.drawImage(o,0,0,o.width,o.height,0,0,i,s)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:i}=this.__;t.resize(this.__,i),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};ft([g(se)],ei.prototype,"__",void 0),ft([xt(100)],ei.prototype,"width",void 0),ft([xt(100)],ei.prototype,"height",void 0),ft([xt(1)],ei.prototype,"pixelRatio",void 0),ft([xt(!0)],ei.prototype,"smooth",void 0),ft([v(!1)],ei.prototype,"safeResize",void 0),ft([xt()],ei.prototype,"contextSettings",void 0),ei=ft([X()],ei);const{copyAndSpread:ii,includes:si,spread:oi,setList:ri}=ht;let ai=class extends pe{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:s,fontSize:o,fontWeight:r,italic:a,textCase:n,textOverflow:h,padding:_}=t;t.__lineHeight=Bt.number(e,o),t.__letterSpacing=Bt.number(i,o),t.__padding=_?y.fourNumber(_):void 0,t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*o)/2,t.__font=`${a?"italic ":""}${"small-caps"===n?"small-caps ":""}${"normal"!==r?r+" ":""}${o||12}px ${s||"caption"}`,t.__clipText="show"!==h&&!t.__autoSize,t.__textDrawData=Rt.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:s,padding:o,__autoWidth:r,__autoHeight:a}=t;this.__updateTextDrawData();const{bounds:h}=t.__textDrawData,_=e.boxBounds;if(e.contentBounds=h,t.__lineHeight<i&&oi(h,i/2),r||a){if(_.x=r?h.x:0,_.y=a?h.y:0,_.width=r?h.width:t.width,_.height=a?h.height:t.height,o){const[e,i,s,o]=t.__padding;r&&(_.x-=o,_.width+=i+o),a&&(_.y-=e,_.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();s&&(_.width+=.16*i),n.stintSet(this,"isOverflow",!si(_,h)),this.isOverflow?(ri(t.__textBoxBounds={},[_,h]),e.renderChanged=!0):t.__textBoxBounds=_}__onUpdateSize(){this.__box&&this.__box.__onUpdateSize(),super.__onUpdateSize()}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;ii(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,i){const s=this.__box;s&&(s.__nowWorld=this.__nowWorld,s.__draw(t,e,i)),this.textEditing&&!e.exporting||super.__draw(t,e,i)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};ft([g(ee)],ai.prototype,"__",void 0),ft([B(0)],ai.prototype,"width",void 0),ft([B(0)],ai.prototype,"height",void 0),ft([f()],ai.prototype,"boxStyle",void 0),ft([v(!1)],ai.prototype,"resizeFontSize",void 0),ft([f("#000000")],ai.prototype,"fill",void 0),ft([pt("outside")],ai.prototype,"strokeAlign",void 0),ft([I("all")],ai.prototype,"hitFill",void 0),ft([B("")],ai.prototype,"text",void 0),ft([B("")],ai.prototype,"placeholder",void 0),ft([B("caption")],ai.prototype,"fontFamily",void 0),ft([B(12)],ai.prototype,"fontSize",void 0),ft([B("normal")],ai.prototype,"fontWeight",void 0),ft([B(!1)],ai.prototype,"italic",void 0),ft([B("none")],ai.prototype,"textCase",void 0),ft([B("none")],ai.prototype,"textDecoration",void 0),ft([B(0)],ai.prototype,"letterSpacing",void 0),ft([B({type:"percent",value:1.5})],ai.prototype,"lineHeight",void 0),ft([B(0)],ai.prototype,"paraIndent",void 0),ft([B(0)],ai.prototype,"paraSpacing",void 0),ft([B("x")],ai.prototype,"writingMode",void 0),ft([B("left")],ai.prototype,"textAlign",void 0),ft([B("top")],ai.prototype,"verticalAlign",void 0),ft([B(!0)],ai.prototype,"autoSizeAlign",void 0),ft([B("normal")],ai.prototype,"textWrap",void 0),ft([B("show")],ai.prototype,"textOverflow",void 0),ft([f(!1)],ai.prototype,"textEditing",void 0),ai=ft([X()],ai);let ni=class extends pe{get __tag(){return"Path"}};ft([g(Qt)],ni.prototype,"__",void 0),ft([pt("center")],ni.prototype,"strokeAlign",void 0),ni=ft([X()],ni);let hi=class extends ue{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new ni(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,o,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,o){return this}ellipse(t,e,i,s,o,r,a,n){return this}arc(t,e,i,s,o,r){return this}arcTo(t,e,i,s,o){return this}drawEllipse(t,e,i,s,o,r,a,n){return this}drawArc(t,e,i,s,o,r){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};ft([g(Zt)],hi.prototype,"__",void 0),ft([(e,i)=>{t(e,i,{get(){return this.__path}})}],hi.prototype,"path",void 0),hi=ft([O(vt,["set","path","paint"]),X()],hi);export{Re as Box,Ut as BoxData,ei as Canvas,se as CanvasData,kt as ColorConvert,re as DragBoundsHelper,Ft as Effect,Ce as Ellipse,Gt as EllipseData,Et as Export,Wt as Filter,ke as Frame,jt as FrameData,ue as Group,Yt as GroupData,Ze as Image,ie as ImageData,ge as Leafer,Xt as LeaferData,Le as Line,Jt as LineData,ti as MyImage,At as Paint,Pt as PaintGradient,Ct as PaintImage,ni as Path,bt as PathArrow,Qt as PathData,hi as Pen,Zt as PenData,Xe as Polygon,$t as PolygonData,ve as Rect,qt as RectData,de as RectRender,Qe as Star,Kt as StarData,Tt as State,ai as Text,Rt as TextConvert,ee as TextData,It as Transition,pe as UI,oe as UIBounds,Vt as UIData,he as UIRender,Bt as UnitConvert,mt as createAttr,wt as effectType,xt as resizeType,St as zoomLayerType};
|
|
1
|
+
import{defineKey as t,decorateLeafAttr as e,attr as i,createDescriptor as s,Plugin as o,isObject as r,PathConvert as a,DataHelper as n,Debug as h,LeafData as _,isString as d,isUndefined as l,isArray as p,canvasSizeAttrs as u,UICreator as c,MathHelper as g,Bounds as y,dataProcessor as v,dataType as f,surfaceType as w,opacityType as x,visibleType as S,dimType as m,sortType as R,maskType as k,eraserType as B,positionType as b,boundsType as A,scaleType as C,rotationType as P,scrollType as F,autoLayoutType as W,naturalBoundsType as I,affectRenderBoundsType as T,pathInputType as D,pathType as E,hitType as L,strokeType as M,cursorType as z,rewrite as O,Leaf as N,useModule as V,rewriteAble as H,pen as Y,PathCorner as U,PathDrawer as j,isNumber as X,registerUI as J,Branch as q,LeafList as G,Resource as $,getBoundsData as K,Creator as Q,CanvasManager as Z,WaitHelper as tt,LeaferEvent as et,ResizeEvent as it,AutoBounds as st,Run as ot,LayoutEvent as rt,RenderEvent as at,WatchEvent as nt,ImageManager as ht,BoundsHelper as _t,PathCommandDataHelper as dt,Platform as lt,PointHelper as pt,affectStrokeBoundsType as ut,getPointData as ct,LeaferImage as gt,ImageEvent as yt,Matrix as vt,PathCreator as ft}from"@leafer/core";export*from"@leafer/core";function wt(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}function xt(t){return e(t,t=>i({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function St(t){return e(t,t=>i({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function mt(){return(e,i)=>{const s="_"+i;t(e,i,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}function Rt(e){return(i,o)=>{t(i,o,s(o,e))}}"function"==typeof SuppressedError&&SuppressedError;const kt={},Bt={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},bt={number:(t,e)=>r(t)?"percent"===t.type?t.value*e:t.value:t},At={},Ct={},Pt={},Ft={},Wt={},It={apply(){o.need("filter")}},Tt={},Dt={setStyleName:()=>o.need("state"),set:()=>o.need("state")},Et={list:{},register(t,e){Et.list[t]=e},get:t=>Et.list[t]},{parse:Lt,objectToCanvasData:Mt}=a,{stintSet:zt}=n,{hasTransparent:Ot}=Bt,Nt={},Vt=h.get("UIData");class Ht extends _{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Vt.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Vt.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),d(t)||!t?(zt(this,"__isTransparentFill",Ot(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):r(t)&&this.__setPaint("fill",t)}setStroke(t){d(t)||!t?(zt(this,"__isTransparentStroke",Ot(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):r(t)&&this.__setPaint("stroke",t)}setPath(t){const e=d(t);e||t&&r(t[0])?(this.__setInput("path",t),this._path=e?Lt(t):Mt(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Yt(this,"shadow",t)}setInnerShadow(t){Yt(this,"innerShadow",t)}setFilter(t){Yt(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&Ct.compute("fill",this.__leaf),e&&Ct.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),l(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const i=this.__leaf.__layout;i.boxChanged||i.boxChange(),p(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Nt)):(this.__isStrokes=!0,this._stroke||(this._stroke=Nt))}__removePaint(t,e){e&&this.__removeInput(t),Pt.recycleImage(t,this),"fill"===t?(zt(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(zt(this,"__isAlphaPixelStroke",void 0),zt(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function Yt(t,e,i){t.__setInput(e,i),p(i)?(i.some(t=>!1===t.visible)&&(i=i.filter(t=>!1!==t.visible)),i.length||(i=void 0)):i=i&&!1!==i.visible?[i]:void 0,t["_"+e]=i}class Ut extends Ht{}class jt extends Ut{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class Xt extends Ut{__getInputData(t,e){const i=super.__getInputData(t,e);return u.forEach(t=>delete i[t]),i}}class Jt extends jt{}class qt extends Ht{get __usePathBox(){return this.points||this.__pathInputed}}class Gt extends Ht{get __boxStroke(){return!this.__pathInputed}}class $t extends Ht{get __boxStroke(){return!this.__pathInputed}}class Kt extends qt{}class Qt extends Ht{}class Zt extends Ht{get __pathInputed(){return 2}}class te extends Ut{}const ee={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class ie extends Ht{get __useNaturalRatio(){return!1}setFontWeight(t){d(t)?(this.__setInput("fontWeight",t),t=ee[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:s}=this;if(i)for(let t in s)i[t]=void 0;else i=e.__box=c.get("Rect",0);const o=e.__layout,r=i.__layout;s||(i.parent=e,i.__world=e.__world,r.boxBounds=o.boxBounds),i.set(t),r.strokeChanged&&o.strokeChange()}else i&&(e.__box=i.parent=null,i.destroy());this._boxStyle=t}}class se extends Gt{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(t,e){const i=super.__getInputData(t,e);return delete i.fill,i}}class oe extends Gt{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url=this.__leaf.canvas.toDataURL("image/png"),i}}const re={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:s,__maxStrokeWidth:o}=i,r=this.__box;if((i.stroke||"all"===i.hitStroke)&&o&&"inside"!==s&&(e=t="center"===s?o/2:o,!i.__boxStroke)){const e=i.__isLinePath?0:10*t,s="none"===i.strokeCap?0:o;t+=Math.max(e,s)}return i.__useArrow&&(t+=5*o),r&&(t=Math.max(r.__layout.strokeSpread=r.__updateStrokeSpread(),t),e=r.__layout.strokeBoxSpread),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:o,filter:r,renderSpread:a}=this.__;e&&(t=Wt.getShadowSpread(this,e)),s&&(t=Math.max(t,s)),r&&(t+=It.getSpread(r)),a&&(t+=a);let n=t=Math.ceil(t);return i&&i.forEach(t=>n=Math.max(n,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)),o&&(n=Math.max(n,o)),this.__layout.renderShapeSpread=n,t+=this.__layout.strokeSpread||0,this.__box?Math.max(this.__box.__updateRenderSpread(),t):t}},{float:ae}=g,ne=new y,he=new y,_e=new y,de={limitMove(t,e){const{dragBounds:i,dragBoundsType:s}=t;i&&le.getValidMove(t.__localBoxBounds,le.getDragBounds(t),s,e,!0),le.axisMove(t,e)},limitScaleOf(t,e,i){const{dragBounds:s,dragBoundsType:o}=t;s&&le.getValidScaleOf(t.__localBoxBounds,le.getDragBounds(t),o,t.getLocalPointByInner(t.getInnerPointByBox(e)),i,!0)},axisMove(t,e){const{draggable:i}=t;"x"===i&&(e.y=0),"y"===i&&(e.x=0)},getDragBounds(t){const{dragBounds:e}=t;return"parent"===e?t.parent.boxBounds:e},isInnerMode:(t,e,i,s)=>"inner"===i||"auto"===i&&t[s]>e[s],getValidMove(t,e,i,s,o){const r=t.x+s.x,a=t.y+s.y,n=r+t.width,h=a+t.height,_=e.x+e.width,d=e.y+e.height;return o||(s=Object.assign({},s)),le.isInnerMode(t,e,i,"width")?r>e.x?s.x+=e.x-r:n<_&&(s.x+=_-n):r<e.x?s.x+=e.x-r:n>_&&(s.x+=_-n),le.isInnerMode(t,e,i,"height")?a>e.y?s.y+=e.y-a:h<d&&(s.y+=d-h):a<e.y?s.y+=e.y-a:h>d&&(s.y+=d-h),s.x=ae(s.x),s.y=ae(s.y),s},getValidScaleOf(t,e,i,s,o,r){let a,n;return r||(o=Object.assign({},o)),ne.set(t).scaleOf(s,o.x,o.y).unsign(),he.set(ne).add(e),_e.set(ne).intersect(e),a=le.isInnerMode(t,e,i,"width")?he.width/ne.width:_e.width/ne.width,n=le.isInnerMode(t,e,i,"height")?he.height/ne.height:_e.height/ne.height,o.x=ae(_e.width)?o.x*a:1,o.y=ae(_e.height)?o.y*n:1,o}},le=de,{stintSet:pe}=n,ue={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);pe(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),pe(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:s}=t,o=t.innerShadow||t.blur||t.backgroundBlur||t.filter;pe(t,"__isFastShadow",e&&!o&&e.length<2&&!e[0].spread&&!Wt.isTransformShadow(e[0])&&i&&!t.__isTransparentFill&&!(p(i)&&i.length>1)&&(this.useFastShadow||!s||s&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!o)}t.__checkSingle(),pe(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){ce(this,t,e)},__draw(t,e,i){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:o,stroke:r,__drawAfterFill:a,__fillAfterStroke:n,__isFastShadow:h}=s;if(this.__drawRenderPath(t),s.__useEffect&&!h){const h=Ct.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:_,innerShadow:d,filter:l}=s;_&&Wt.shadow(this,t,h),n&&(s.__isStrokes?Ct.strokes(r,this,t):Ct.stroke(r,this,t)),o&&(s.__isFills?Ct.fills(o,this,t):Ct.fill(o,this,t)),a&&this.__drawAfterFill(t,e),d&&Wt.innerShadow(this,t,h),r&&!n&&(s.__isStrokes?Ct.strokes(r,this,t):Ct.stroke(r,this,t)),l&&It.apply(l,this,this.__nowWorld,t,i,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(n&&(s.__isStrokes?Ct.strokes(r,this,t):Ct.stroke(r,this,t)),h){const e=s.shadow[0],{scaleX:i,scaleY:o}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*o,e.blur*i,Bt.string(e.color))}o&&(s.__isFills?Ct.fills(o,this,t):Ct.fill(o,this,t)),h&&t.restore(),a&&this.__drawAfterFill(t,e),r&&!n&&(s.__isStrokes?Ct.strokes(r,this,t):Ct.stroke(r,this,t))}}else s.__pathInputed?ce(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:s,stroke:o}=i;s&&!e.ignoreFill&&(i.__isAlphaPixelFill?Ct.fills(s,this,t):Ct.fill("#000000",this,t)),i.__isCanvas&&this.__drawAfterFill(t,e),o&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?Ct.strokes(o,this,t):Ct.stroke("#000000",this,t))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function ce(t,e,i){const{fill:s,stroke:o,__drawAfterFill:r,__fillAfterStroke:a}=t.__;t.__drawRenderPath(e),a&&Ct.stroke(o,t,e),s&&Ct.fill(s,t,e),r&&t.__drawAfterFill(e,i),o&&!a&&Ct.stroke(o,t,e)}const ge={__drawFast(t,e){let{x:i,y:s,width:o,height:r}=this.__layout.boxBounds;const{fill:a,stroke:n,__drawAfterFill:h}=this.__;if(a&&(t.fillStyle=a,t.fillRect(i,s,o,r)),h&&this.__drawAfterFill(t,e),n){const{strokeAlign:a,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(n,h,this.__);const _=h/2;switch(a){case"center":t.strokeRect(0,0,o,r);break;case"inside":o-=h,r-=h,o<0||r<0?(t.save(),this.__clip(t,e),t.strokeRect(i+_,s+_,o,r),t.restore()):t.strokeRect(i+_,s+_,o,r);break;case"outside":t.strokeRect(i-_,s-_,o+h,r+h)}}}};var ye;let ve=ye=class extends N{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){g.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return Y.set(this.path=t||[]),t||this.__drawPathByBox(Y),Y}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return d(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return o.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return o.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;return i||(Y.set(i=[]),this.__drawPathByBox(Y)),t?a.toCanvasData(i,!0):i}getPathString(t,e,i){return a.stringify(this.getPath(t,e),i)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||Tt.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?U.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&At.addArrows(this)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?j.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:i,width:s,height:o}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:r}=this.__;t.roundRect(e,i,s,o,X(r)?[r]:r)}else t.rect(e,i,s,o)}drawImagePlaceholder(t,e){Ct.fill(this.__.placeholderColor,this,t)}animate(t,e,i,s){return this.set(t),o.need("animate")}killAnimate(t,e){}export(t,e){return o.need("export")}syncExport(t,e){return o.need("export")}clone(t){const e=n.clone(this.toJSON());return t&&Object.assign(e,t),ye.one(e)}static one(t,e,i,s,o){return c.get(t.tag||this.prototype.__tag,t,e,i,s,o)}static registerUI(){J()(this)}static registerData(t){v(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};wt([v(Ht)],ve.prototype,"__",void 0),wt([mt()],ve.prototype,"zoomLayer",void 0),wt([f("")],ve.prototype,"id",void 0),wt([f("")],ve.prototype,"name",void 0),wt([f("")],ve.prototype,"className",void 0),wt([w("pass-through")],ve.prototype,"blendMode",void 0),wt([x(1)],ve.prototype,"opacity",void 0),wt([S(!0)],ve.prototype,"visible",void 0),wt([w(!1)],ve.prototype,"locked",void 0),wt([m(!1)],ve.prototype,"dim",void 0),wt([m(!1)],ve.prototype,"dimskip",void 0),wt([R(0)],ve.prototype,"zIndex",void 0),wt([k(!1)],ve.prototype,"mask",void 0),wt([B(!1)],ve.prototype,"eraser",void 0),wt([b(0,!0)],ve.prototype,"x",void 0),wt([b(0,!0)],ve.prototype,"y",void 0),wt([A(100,!0)],ve.prototype,"width",void 0),wt([A(100,!0)],ve.prototype,"height",void 0),wt([C(1,!0)],ve.prototype,"scaleX",void 0),wt([C(1,!0)],ve.prototype,"scaleY",void 0),wt([P(0,!0)],ve.prototype,"rotation",void 0),wt([P(0,!0)],ve.prototype,"skewX",void 0),wt([P(0,!0)],ve.prototype,"skewY",void 0),wt([b(0,!0)],ve.prototype,"offsetX",void 0),wt([b(0,!0)],ve.prototype,"offsetY",void 0),wt([F(0,!0)],ve.prototype,"scrollX",void 0),wt([F(0,!0)],ve.prototype,"scrollY",void 0),wt([W()],ve.prototype,"origin",void 0),wt([W()],ve.prototype,"around",void 0),wt([f(!1)],ve.prototype,"lazy",void 0),wt([I(1)],ve.prototype,"pixelRatio",void 0),wt([T(0)],ve.prototype,"renderSpread",void 0),wt([D()],ve.prototype,"path",void 0),wt([E()],ve.prototype,"windingRule",void 0),wt([E(!0)],ve.prototype,"closed",void 0),wt([A(0)],ve.prototype,"padding",void 0),wt([A(!1)],ve.prototype,"lockRatio",void 0),wt([A()],ve.prototype,"widthRange",void 0),wt([A()],ve.prototype,"heightRange",void 0),wt([f(!1)],ve.prototype,"draggable",void 0),wt([f()],ve.prototype,"dragBounds",void 0),wt([f("auto")],ve.prototype,"dragBoundsType",void 0),wt([f(!1)],ve.prototype,"editable",void 0),wt([L(!0)],ve.prototype,"hittable",void 0),wt([L("path")],ve.prototype,"hitFill",void 0),wt([M("path")],ve.prototype,"hitStroke",void 0),wt([L(!1)],ve.prototype,"hitBox",void 0),wt([L(!0)],ve.prototype,"hitChildren",void 0),wt([L(!0)],ve.prototype,"hitSelf",void 0),wt([L()],ve.prototype,"hitRadius",void 0),wt([z("")],ve.prototype,"cursor",void 0),wt([w()],ve.prototype,"fill",void 0),wt([M(void 0,!0)],ve.prototype,"stroke",void 0),wt([M("inside")],ve.prototype,"strokeAlign",void 0),wt([M(1,!0)],ve.prototype,"strokeWidth",void 0),wt([M(!1)],ve.prototype,"strokeWidthFixed",void 0),wt([M("none")],ve.prototype,"strokeCap",void 0),wt([M("miter")],ve.prototype,"strokeJoin",void 0),wt([M()],ve.prototype,"dashPattern",void 0),wt([M(0)],ve.prototype,"dashOffset",void 0),wt([M(10)],ve.prototype,"miterLimit",void 0),wt([E(0)],ve.prototype,"cornerRadius",void 0),wt([E()],ve.prototype,"cornerSmoothing",void 0),wt([xt()],ve.prototype,"shadow",void 0),wt([xt()],ve.prototype,"innerShadow",void 0),wt([xt()],ve.prototype,"blur",void 0),wt([xt()],ve.prototype,"backgroundBlur",void 0),wt([xt()],ve.prototype,"grayscale",void 0),wt([xt()],ve.prototype,"filter",void 0),wt([w()],ve.prototype,"placeholderColor",void 0),wt([f(100)],ve.prototype,"placeholderDelay",void 0),wt([f({})],ve.prototype,"data",void 0),wt([O(N.prototype.reset)],ve.prototype,"reset",null),ve=ye=wt([V(re),V(ue),H()],ve);let fe=class extends ve{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:i}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),i.forEach(t=>this.add(t)),t.children=i}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};var we;wt([v(Ut)],fe.prototype,"__",void 0),wt([A(0)],fe.prototype,"width",void 0),wt([A(0)],fe.prototype,"height",void 0),fe=wt([V(q),J()],fe);const xe=h.get("Leafer");let Se=we=class extends fe{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&$.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||K()}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),we.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:s}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),i=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,n.assign(s,t));const o=this.canvas=Q.canvas(s);this.__controllers.push(this.renderer=Q.renderer(this,o,s),this.watcher=Q.watcher(this,s),this.layouter=Q.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),this.view=o.view,e||(this.selector=Q.selector(this),this.interaction=Q.interaction(this,o,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=Q.hitCanvasManager()),this.canvasManager=new Z,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(o),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),tt.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(et.RESTART):this.emitLeafer(et.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(et.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=n.copyAttrs({},t,u);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:i}=this;i&&(i.addBlock(t?new y(t):this.canvas.bounds),this.viewReady&&(e?i.render():i.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const i=n.copyAttrs({},this.canvas,u);e.resize(t),this.updateLazyBounds(),this.__onResize(new it(t,i))}__onResize(t){this.emitEvent(t),n.copyAttrs(this.__,t,u),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new st(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(u.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(et.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&u.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:i,canvas:s}=this,o=n.copyAttrs({},s,u);o[t]=i[t]=e,i.width&&i.height?s.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(o)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(et.BEFORE_READY),this.emitLeafer(et.READY),this.emitLeafer(et.AFTER_READY),tt.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(et.VIEW_READY),tt.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:s,height:o,pixelRatio:r}=this;const a="box"===t?this.worldBoxBounds:this.__world;e||(s=Math.max(1,a.x+a.width)),i||(o=Math.max(1,a.y+a.height)),this.__doResize({width:s,height:o,pixelRatio:r})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){tt.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(et.VIEW_COMPLETED),tt.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let e=0;e<s.length;e++)if(s[e]===t){s.splice(e,1);break}}else s.push(t);this.requestRender()}zoom(t,e,i,s){return o.need("view")}getValidMove(t,e,i){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:i}=this.clientBounds;return{x:e+t.x,y:i+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new et(t,this))}__listenEvents(){const t=ot.start("FirstCreate "+this.innerName);this.once([[et.START,()=>ot.end(t)],[rt.START,this.updateLazyBounds,this],[at.START,this.__onCreated,this],[at.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[nt.DATA,this.__onWatchData,this],[rt.END,this.__onLayoutEnd,this],[at.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){we.list.remove(this);try{this.stop(),this.emitLeafer(et.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{ht.clearRecycled()},100)}catch(t){xe.error(t)}}};t?e():setTimeout(e)}};Se.list=new G,wt([v(Xt)],Se.prototype,"__",void 0),wt([A()],Se.prototype,"pixelRatio",void 0),wt([f("normal")],Se.prototype,"mode",void 0),Se=we=wt([J()],Se);let me=class extends ve{get __tag(){return"Rect"}};wt([v(Gt)],me.prototype,"__",void 0),me=wt([V(ge),H(),J()],me);const{add:Re,includes:ke,scroll:Be}=_t,be=me.prototype,Ae=fe.prototype;let Ce=class extends fe{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const i=this.__,s=this.__layout,{renderBounds:o,boxBounds:r}=s,{overflow:a}=i,n=s.childrenRenderBounds||(s.childrenRenderBounds=K());super.__updateRenderBounds(n),(e=a.includes("scroll"))&&(Re(n,r),Be(n,i)),this.__updateRectRenderBounds(),t=!ke(r,n),t&&"show"===a&&Re(o,n)}else this.__updateRectRenderBounds();n.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};wt([v(jt)],Ce.prototype,"__",void 0),wt([A(100)],Ce.prototype,"width",void 0),wt([A(100)],Ce.prototype,"height",void 0),wt([f(!1)],Ce.prototype,"resizeChildren",void 0),wt([T("show")],Ce.prototype,"overflow",void 0),wt([O(be.__updateStrokeSpread)],Ce.prototype,"__updateStrokeSpread",null),wt([O(be.__updateRenderSpread)],Ce.prototype,"__updateRectRenderSpread",null),wt([O(be.__updateBoxBounds)],Ce.prototype,"__updateRectBoxBounds",null),wt([O(be.__updateStrokeBounds)],Ce.prototype,"__updateStrokeBounds",null),wt([O(be.__updateRenderBounds)],Ce.prototype,"__updateRectRenderBounds",null),wt([O(be.__updateChange)],Ce.prototype,"__updateRectChange",null),wt([O(be.__render)],Ce.prototype,"__renderRect",null),wt([O(Ae.__render)],Ce.prototype,"__renderGroup",null),Ce=wt([H(),J()],Ce);let Pe=class extends Ce{get __tag(){return"Frame"}get isFrame(){return!0}};wt([v(Jt)],Pe.prototype,"__",void 0),wt([w("#FFFFFF")],Pe.prototype,"fill",void 0),wt([T("hide")],Pe.prototype,"overflow",void 0),Pe=wt([J()],Pe);const{moveTo:Fe,closePath:We,ellipse:Ie}=dt;let Te=class extends ve{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:i,startAngle:s,endAngle:o}=this.__,r=t/2,a=e/2,n=this.__.path=[];i?(s||o?(i<1&&Ie(n,r,a,r*i,a*i,0,s,o,!1),Ie(n,r,a,r,a,0,o,s,!0),i<1&&We(n)):(i<1&&(Ie(n,r,a,r*i,a*i),Fe(n,t,a)),Ie(n,r,a,r,a,0,360,0,!0)),lt.ellipseToCurve&&(this.__.path=this.getPath(!0))):s||o?(Fe(n,r,a),Ie(n,r,a,r,a,0,s,o,!1),We(n)):Ie(n,r,a,r,a)}};wt([v($t)],Te.prototype,"__",void 0),wt([E(0)],Te.prototype,"innerRadius",void 0),wt([E(0)],Te.prototype,"startAngle",void 0),wt([E(0)],Te.prototype,"endAngle",void 0),Te=wt([J()],Te);const{sin:De,cos:Ee,PI:Le}=Math,{moveTo:Me,lineTo:ze,closePath:Oe,drawPoints:Ne}=dt;let Ve=class extends ve{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)Ne(e,t.points,t.curve,!0);else{const{width:i,height:s,sides:o}=t,r=i/2,a=s/2;Me(e,r,0);for(let t=1;t<o;t++)ze(e,r+r*De(2*t*Le/o),a-a*Ee(2*t*Le/o));Oe(e)}}};wt([v(Kt)],Ve.prototype,"__",void 0),wt([E(3)],Ve.prototype,"sides",void 0),wt([E()],Ve.prototype,"points",void 0),wt([E(0)],Ve.prototype,"curve",void 0),Ve=wt([H(),J()],Ve);const{sin:He,cos:Ye,PI:Ue}=Math,{moveTo:je,lineTo:Xe,closePath:Je}=dt;let qe=class extends ve{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s}=this.__,o=t/2,r=e/2,a=this.__.path=[];je(a,o,0);for(let t=1;t<2*i;t++)Xe(a,o+(t%2==0?o:o*s)*He(t*Ue/i),r-(t%2==0?r:r*s)*Ye(t*Ue/i));Je(a)}};wt([v(Qt)],qe.prototype,"__",void 0),wt([E(5)],qe.prototype,"corners",void 0),wt([E(.382)],qe.prototype,"innerRadius",void 0),qe=wt([J()],qe);const{moveTo:Ge,lineTo:$e,drawPoints:Ke}=dt,{rotate:Qe,getAngle:Ze,getDistance:ti,defaultPoint:ei}=pt;let ii=class extends ve{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i=ct();return t&&(i.x=t),e&&Qe(i,e),i}set toPoint(t){this.width=ti(ei,t),this.rotation=Ze(ei,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?Ke(e,t.points,t.curve,t.closed):(Ge(e,0,0),$e(e,this.width,0))}};wt([v(qt)],ii.prototype,"__",void 0),wt([ut("center")],ii.prototype,"strokeAlign",void 0),wt([A(0)],ii.prototype,"height",void 0),wt([E()],ii.prototype,"points",void 0),wt([E(0)],ii.prototype,"curve",void 0),wt([E(!1)],ii.prototype,"closed",void 0),ii=wt([J()],ii);let si=class extends me{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return p(t)&&t[0].image}};wt([v(se)],si.prototype,"__",void 0),wt([A("")],si.prototype,"url",void 0),si=wt([J()],si);const oi=si;let ri=class extends me{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=Q.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new gt({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new yt(yt.LOADED,{image:t}))})}draw(t,e,i,s){const o=new vt(t.worldTransform).invert(),r=new vt;e&&r.translate(e.x,e.y),i&&(X(i)?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),o.multiplyParent(r),t.__render(this.canvas,{matrix:o.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:s}=this.__,{view:o}=this.canvas;t.drawImage(o,0,0,o.width,o.height,0,0,i,s)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:i}=this.__;t.resize(this.__,i),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};wt([v(oe)],ri.prototype,"__",void 0),wt([St(100)],ri.prototype,"width",void 0),wt([St(100)],ri.prototype,"height",void 0),wt([St(1)],ri.prototype,"pixelRatio",void 0),wt([St(!0)],ri.prototype,"smooth",void 0),wt([f(!1)],ri.prototype,"safeResize",void 0),wt([St()],ri.prototype,"contextSettings",void 0),ri=wt([J()],ri);const{copyAndSpread:ai,includes:ni,spread:hi,setList:_i}=_t;let di=class extends ve{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:s,fontSize:o,fontWeight:r,italic:a,textCase:n,textOverflow:h,padding:_}=t;t.__lineHeight=bt.number(e,o),t.__letterSpacing=bt.number(i,o),t.__padding=_?g.fourNumber(_):void 0,t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*o)/2,t.__font=`${a?"italic ":""}${"small-caps"===n?"small-caps ":""}${"normal"!==r?r+" ":""}${o||12}px ${s||"caption"}`,t.__clipText="show"!==h&&!t.__autoSize,t.__textDrawData=kt.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:s,padding:o,__autoWidth:r,__autoHeight:a}=t;this.__updateTextDrawData();const{bounds:h}=t.__textDrawData,_=e.boxBounds;if(e.contentBounds=h,t.__lineHeight<i&&hi(h,i/2),r||a){if(_.x=r?h.x:0,_.y=a?h.y:0,_.width=r?h.width:t.width,_.height=a?h.height:t.height,o){const[e,i,s,o]=t.__padding;r&&(_.x-=o,_.width+=i+o),a&&(_.y-=e,_.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();s&&(_.width+=.16*i),n.stintSet(this,"isOverflow",!ni(_,h)),this.isOverflow?(_i(t.__textBoxBounds={},[_,h]),e.renderChanged=!0):t.__textBoxBounds=_}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;ai(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,i){const s=this.__box;s&&(s.__nowWorld=this.__nowWorld,s.__draw(t,e,i)),this.textEditing&&!e.exporting||super.__draw(t,e,i)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};wt([v(ie)],di.prototype,"__",void 0),wt([A(0)],di.prototype,"width",void 0),wt([A(0)],di.prototype,"height",void 0),wt([w()],di.prototype,"boxStyle",void 0),wt([f(!1)],di.prototype,"resizeFontSize",void 0),wt([w("#000000")],di.prototype,"fill",void 0),wt([ut("outside")],di.prototype,"strokeAlign",void 0),wt([L("all")],di.prototype,"hitFill",void 0),wt([A("")],di.prototype,"text",void 0),wt([A("")],di.prototype,"placeholder",void 0),wt([A("caption")],di.prototype,"fontFamily",void 0),wt([A(12)],di.prototype,"fontSize",void 0),wt([A("normal")],di.prototype,"fontWeight",void 0),wt([A(!1)],di.prototype,"italic",void 0),wt([A("none")],di.prototype,"textCase",void 0),wt([A("none")],di.prototype,"textDecoration",void 0),wt([A(0)],di.prototype,"letterSpacing",void 0),wt([A({type:"percent",value:1.5})],di.prototype,"lineHeight",void 0),wt([A(0)],di.prototype,"paraIndent",void 0),wt([A(0)],di.prototype,"paraSpacing",void 0),wt([A("x")],di.prototype,"writingMode",void 0),wt([A("left")],di.prototype,"textAlign",void 0),wt([A("top")],di.prototype,"verticalAlign",void 0),wt([A(!0)],di.prototype,"autoSizeAlign",void 0),wt([A("normal")],di.prototype,"textWrap",void 0),wt([A("show")],di.prototype,"textOverflow",void 0),wt([w(!1)],di.prototype,"textEditing",void 0),di=wt([J()],di);let li=class extends ve{get __tag(){return"Path"}};wt([v(Zt)],li.prototype,"__",void 0),wt([ut("center")],li.prototype,"strokeAlign",void 0),li=wt([J()],li);let pi=class extends fe{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new li(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,o,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,o){return this}ellipse(t,e,i,s,o,r,a,n){return this}arc(t,e,i,s,o,r){return this}arcTo(t,e,i,s,o){return this}drawEllipse(t,e,i,s,o,r,a,n){return this}drawArc(t,e,i,s,o,r){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};wt([v(te)],pi.prototype,"__",void 0),wt([(e,i)=>{t(e,i,{get(){return this.__path}})}],pi.prototype,"path",void 0),pi=wt([V(ft,["set","path","paint"]),J()],pi);export{Ce as Box,jt as BoxData,ri as Canvas,oe as CanvasData,Bt as ColorConvert,de as DragBoundsHelper,Wt as Effect,Te as Ellipse,$t as EllipseData,Tt as Export,It as Filter,Pe as Frame,Jt as FrameData,fe as Group,Ut as GroupData,si as Image,se as ImageData,Se as Leafer,Xt as LeaferData,ii as Line,qt as LineData,oi as MyImage,Ct as Paint,Ft as PaintGradient,Pt as PaintImage,li as Path,At as PathArrow,Zt as PathData,pi as Pen,te as PenData,Ve as Polygon,Kt as PolygonData,me as Rect,Gt as RectData,ge as RectRender,qe as Star,Qt as StarData,Dt as State,di as Text,kt as TextConvert,ie as TextData,Et as Transition,ve as UI,re as UIBounds,Ht as UIData,ue as UIRender,bt as UnitConvert,Rt as createAttr,xt as effectType,St as resizeType,mt as zoomLayerType};
|
|
2
2
|
//# sourceMappingURL=draw.esm.min.js.map
|