@logicflow/extension 2.0.0-beta.2 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
1
 
2
- > @logicflow/extension@2.0.0-beta.2 prebuild /Users/r0ger1tlearn/WorkSpace/Github/DiDi/logicflow/packages/extension
2
+ > @logicflow/extension@2.0.0-beta.3 prebuild /Users/r0ger1tlearn/WorkSpace/Github/DiDi/logicflow/packages/extension
3
3
  > rss
4
4
 
5
5
  > [prebuild] run-s -s clean:build
6
6
  > [clean:build] rimraf dist es lib
7
7
 
8
- > @logicflow/extension@2.0.0-beta.2 build /Users/r0ger1tlearn/WorkSpace/Github/DiDi/logicflow/packages/extension
8
+ > @logicflow/extension@2.0.0-beta.3 build /Users/r0ger1tlearn/WorkSpace/Github/DiDi/logicflow/packages/extension
9
9
  > rss
10
10
 
11
11
  > [build] run-p -s build:dev build:umd
12
- > [build:umd] pnpm run --if-present build:less && rollup -c ../../rollup.config.js --bundleConfigAsCjs
13
12
  > [build:dev] pnpm run --if-present build:less && run-p -s build:cjs build:esm
13
+ > [build:umd] pnpm run --if-present build:less && rollup -c ../../rollup.config.js --bundleConfigAsCjs
14
14
  > [build:less] ./scripts/build-less
15
15
  > [build:less] ./scripts/build-less
16
16
  
@@ -23,12 +23,12 @@
23
23
  |  @logicflow/core: Core |
24
24
  | |
25
25
  | Destination: dist/index.min.js |
26
- | Bundle Size: 223.46 KB |
26
+ | Bundle Size: 223.45 KB |
27
27
  | Minified Size: 221.57 KB |
28
- | GZipped Size: 65.59 KB |
28
+ | GZipped Size: 65.58 KB |
29
29
  | |
30
30
  +------------------------------------+
31
31
  (!) Broken sourcemap
32
32
  https://rollupjs.org/troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect
33
33
  Plugins that transform code (such as "terser") should generate accompanying sourcemaps.
34
- created dist/index.min.js in 6.2s
34
+ created dist/index.min.js in 5.3s
package/dist/index.min.js CHANGED
@@ -8,5 +8,5 @@
8
8
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
9
9
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
10
10
  */
11
- var lf,cf,df=4294967295,hf=Array.prototype,pf=Object.prototype.hasOwnProperty,ff=Dt?Dt.iterator:void 0,vf=Math.max,gf=Math.min,yf=function(t){return function(e,n,r){if(null==r){var i=le(n),o=i&&ni(n),a=o&&o.length&&Jl(n,o);(a?a.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}}(ld);cn.after=Zp.after,cn.ary=Zp.ary,cn.assign=ef.assign,cn.assignIn=ef.assignIn,cn.assignInWith=ef.assignInWith,cn.assignWith=ef.assignWith,cn.at=ef.at,cn.before=Zp.before,cn.bind=Zp.bind,cn.bindAll=of.bindAll,cn.bindKey=Zp.bindKey,cn.castArray=Kp.castArray,cn.chain=nf.chain,cn.chunk=Vp.chunk,cn.compact=Vp.compact,cn.concat=Vp.concat,cn.cond=of.cond,cn.conforms=of.conforms,cn.constant=of.constant,cn.countBy=Yp.countBy,cn.create=ef.create,cn.curry=Zp.curry,cn.curryRight=Zp.curryRight,cn.debounce=Zp.debounce,cn.defaults=ef.defaults,cn.defaultsDeep=ef.defaultsDeep,cn.defer=Zp.defer,cn.delay=Zp.delay,cn.difference=Vp.difference,cn.differenceBy=Vp.differenceBy,cn.differenceWith=Vp.differenceWith,cn.drop=Vp.drop,cn.dropRight=Vp.dropRight,cn.dropRightWhile=Vp.dropRightWhile,cn.dropWhile=Vp.dropWhile,cn.fill=Vp.fill,cn.filter=Yp.filter,cn.flatMap=Yp.flatMap,cn.flatMapDeep=Yp.flatMapDeep,cn.flatMapDepth=Yp.flatMapDepth,cn.flatten=Vp.flatten,cn.flattenDeep=Vp.flattenDeep,cn.flattenDepth=Vp.flattenDepth,cn.flip=Zp.flip,cn.flow=of.flow,cn.flowRight=of.flowRight,cn.fromPairs=Vp.fromPairs,cn.functions=ef.functions,cn.functionsIn=ef.functionsIn,cn.groupBy=Yp.groupBy,cn.initial=Vp.initial,cn.intersection=Vp.intersection,cn.intersectionBy=Vp.intersectionBy,cn.intersectionWith=Vp.intersectionWith,cn.invert=ef.invert,cn.invertBy=ef.invertBy,cn.invokeMap=Yp.invokeMap,cn.iteratee=of.iteratee,cn.keyBy=Yp.keyBy,cn.keys=ni,cn.keysIn=ef.keysIn,cn.map=Yp.map,cn.mapKeys=ef.mapKeys,cn.mapValues=ef.mapValues,cn.matches=of.matches,cn.matchesProperty=of.matchesProperty,cn.memoize=Zp.memoize,cn.merge=ef.merge,cn.mergeWith=ef.mergeWith,cn.method=of.method,cn.methodOf=of.methodOf,cn.mixin=yf,cn.negate=hd,cn.nthArg=of.nthArg,cn.omit=ef.omit,cn.omitBy=ef.omitBy,cn.once=Zp.once,cn.orderBy=Yp.orderBy,cn.over=of.over,cn.overArgs=Zp.overArgs,cn.overEvery=of.overEvery,cn.overSome=of.overSome,cn.partial=Zp.partial,cn.partialRight=Zp.partialRight,cn.partition=Yp.partition,cn.pick=ef.pick,cn.pickBy=ef.pickBy,cn.property=of.property,cn.propertyOf=of.propertyOf,cn.pull=Vp.pull,cn.pullAll=Vp.pullAll,cn.pullAllBy=Vp.pullAllBy,cn.pullAllWith=Vp.pullAllWith,cn.pullAt=Vp.pullAt,cn.range=of.range,cn.rangeRight=of.rangeRight,cn.rearg=Zp.rearg,cn.reject=Yp.reject,cn.remove=Vp.remove,cn.rest=Zp.rest,cn.reverse=Vp.reverse,cn.sampleSize=Yp.sampleSize,cn.set=ef.set,cn.setWith=ef.setWith,cn.shuffle=Yp.shuffle,cn.slice=Vp.slice,cn.sortBy=Yp.sortBy,cn.sortedUniq=Vp.sortedUniq,cn.sortedUniqBy=Vp.sortedUniqBy,cn.split=rf.split,cn.spread=Zp.spread,cn.tail=Vp.tail,cn.take=Vp.take,cn.takeRight=Vp.takeRight,cn.takeRightWhile=Vp.takeRightWhile,cn.takeWhile=Vp.takeWhile,cn.tap=nf.tap,cn.throttle=Zp.throttle,cn.thru=hp,cn.toArray=Kp.toArray,cn.toPairs=ef.toPairs,cn.toPairsIn=ef.toPairsIn,cn.toPath=of.toPath,cn.toPlainObject=Kp.toPlainObject,cn.transform=ef.transform,cn.unary=Zp.unary,cn.union=Vp.union,cn.unionBy=Vp.unionBy,cn.unionWith=Vp.unionWith,cn.uniq=Vp.uniq,cn.uniqBy=Vp.uniqBy,cn.uniqWith=Vp.uniqWith,cn.unset=ef.unset,cn.unzip=Vp.unzip,cn.unzipWith=Vp.unzipWith,cn.update=ef.update,cn.updateWith=ef.updateWith,cn.values=ef.values,cn.valuesIn=ef.valuesIn,cn.without=Vp.without,cn.words=rf.words,cn.wrap=Zp.wrap,cn.xor=Vp.xor,cn.xorBy=Vp.xorBy,cn.xorWith=Vp.xorWith,cn.zip=Vp.zip,cn.zipObject=Vp.zipObject,cn.zipObjectDeep=Vp.zipObjectDeep,cn.zipWith=Vp.zipWith,cn.entries=ef.toPairs,cn.entriesIn=ef.toPairsIn,cn.extend=ef.assignIn,cn.extendWith=ef.assignInWith,yf(cn,cn),cn.add=$p.add,cn.attempt=of.attempt,cn.camelCase=rf.camelCase,cn.capitalize=rf.capitalize,cn.ceil=$p.ceil,cn.clamp=Jp,cn.clone=Kp.clone,cn.cloneDeep=Kp.cloneDeep,cn.cloneDeepWith=Kp.cloneDeepWith,cn.cloneWith=Kp.cloneWith,cn.conformsTo=Kp.conformsTo,cn.deburr=rf.deburr,cn.defaultTo=of.defaultTo,cn.divide=$p.divide,cn.endsWith=rf.endsWith,cn.eq=Kp.eq,cn.escape=rf.escape,cn.escapeRegExp=rf.escapeRegExp,cn.every=Yp.every,cn.find=Yp.find,cn.findIndex=Vp.findIndex,cn.findKey=ef.findKey,cn.findLast=Yp.findLast,cn.findLastIndex=Vp.findLastIndex,cn.findLastKey=ef.findLastKey,cn.floor=$p.floor,cn.forEach=Yp.forEach,cn.forEachRight=Yp.forEachRight,cn.forIn=ef.forIn,cn.forInRight=ef.forInRight,cn.forOwn=ef.forOwn,cn.forOwnRight=ef.forOwnRight,cn.get=ef.get,cn.gt=Kp.gt,cn.gte=Kp.gte,cn.has=ef.has,cn.hasIn=ef.hasIn,cn.head=Vp.head,cn.identity=xe,cn.includes=Yp.includes,cn.indexOf=Vp.indexOf,cn.inRange=Qp,cn.invoke=ef.invoke,cn.isArguments=Kp.isArguments,cn.isArray=Jt,cn.isArrayBuffer=Kp.isArrayBuffer,cn.isArrayLike=Kp.isArrayLike,cn.isArrayLikeObject=Kp.isArrayLikeObject,cn.isBoolean=Kp.isBoolean,cn.isBuffer=Kp.isBuffer,cn.isDate=Kp.isDate,cn.isElement=Kp.isElement,cn.isEmpty=Kp.isEmpty,cn.isEqual=Kp.isEqual,cn.isEqualWith=Kp.isEqualWith,cn.isError=Kp.isError,cn.isFinite=Kp.isFinite,cn.isFunction=Kp.isFunction,cn.isInteger=Kp.isInteger,cn.isLength=Kp.isLength,cn.isMap=Kp.isMap,cn.isMatch=Kp.isMatch,cn.isMatchWith=Kp.isMatchWith,cn.isNaN=Kp.isNaN,cn.isNative=Kp.isNative,cn.isNil=Kp.isNil,cn.isNull=Kp.isNull,cn.isNumber=Kp.isNumber,cn.isObject=le,cn.isObjectLike=Kp.isObjectLike,cn.isPlainObject=Kp.isPlainObject,cn.isRegExp=Kp.isRegExp,cn.isSafeInteger=Kp.isSafeInteger,cn.isSet=Kp.isSet,cn.isString=Kp.isString,cn.isSymbol=Kp.isSymbol,cn.isTypedArray=Kp.isTypedArray,cn.isUndefined=Kp.isUndefined,cn.isWeakMap=Kp.isWeakMap,cn.isWeakSet=Kp.isWeakSet,cn.join=Vp.join,cn.kebabCase=rf.kebabCase,cn.last=cl,cn.lastIndexOf=Vp.lastIndexOf,cn.lowerCase=rf.lowerCase,cn.lowerFirst=rf.lowerFirst,cn.lt=Kp.lt,cn.lte=Kp.lte,cn.max=$p.max,cn.maxBy=$p.maxBy,cn.mean=$p.mean,cn.meanBy=$p.meanBy,cn.min=$p.min,cn.minBy=$p.minBy,cn.stubArray=of.stubArray,cn.stubFalse=of.stubFalse,cn.stubObject=of.stubObject,cn.stubString=of.stubString,cn.stubTrue=of.stubTrue,cn.multiply=$p.multiply,cn.nth=Vp.nth,cn.noop=of.noop,cn.now=qp,cn.pad=rf.pad,cn.padEnd=rf.padEnd,cn.padStart=rf.padStart,cn.parseInt=rf.parseInt,cn.random=tf,cn.reduce=Yp.reduce,cn.reduceRight=Yp.reduceRight,cn.repeat=rf.repeat,cn.replace=rf.replace,cn.result=ef.result,cn.round=$p.round,cn.sample=Yp.sample,cn.size=Yp.size,cn.snakeCase=rf.snakeCase,cn.some=Yp.some,cn.sortedIndex=Vp.sortedIndex,cn.sortedIndexBy=Vp.sortedIndexBy,cn.sortedIndexOf=Vp.sortedIndexOf,cn.sortedLastIndex=Vp.sortedLastIndex,cn.sortedLastIndexBy=Vp.sortedLastIndexBy,cn.sortedLastIndexOf=Vp.sortedLastIndexOf,cn.startCase=rf.startCase,cn.startsWith=rf.startsWith,cn.subtract=$p.subtract,cn.sum=$p.sum,cn.sumBy=$p.sumBy,cn.template=rf.template,cn.times=of.times,cn.toFinite=Kp.toFinite,cn.toInteger=be,cn.toLength=Kp.toLength,cn.toLower=rf.toLower,cn.toNumber=Kp.toNumber,cn.toSafeInteger=Kp.toSafeInteger,cn.toString=Kp.toString,cn.toUpper=rf.toUpper,cn.trim=rf.trim,cn.trimEnd=rf.trimEnd,cn.trimStart=rf.trimStart,cn.truncate=rf.truncate,cn.unescape=rf.unescape,cn.uniqueId=of.uniqueId,cn.upperCase=rf.upperCase,cn.upperFirst=rf.upperFirst,cn.each=Yp.forEach,cn.eachRight=Yp.forEachRight,cn.first=Vp.head,yf(cn,(lf={},ks(cn,(function(t,e){pf.call(cn.prototype,e)||(lf[e]=t)})),lf),{chain:!1}),cn.VERSION="4.17.21",(cn.templateSettings=rf.templateSettings).imports._=cn,wn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){cn[t].placeholder=cn})),wn(["drop","take"],(function(t,e){Qe.prototype[t]=function(n){n=void 0===n?1:vf(be(n),0);var r=this.__filtered__&&!e?new Qe(this):this.clone();return r.__filtered__?r.__takeCount__=gf(n,r.__takeCount__):r.__views__.push({size:gf(n,df),type:t+(r.__dir__<0?"Right":"")}),r},Qe.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),wn(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Qe.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:As(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),wn(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Qe.prototype[t]=function(){return this[n](1).value()[0]}})),wn(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Qe.prototype[t]=function(){return this.__filtered__?new Qe(this):this[n](1)}})),Qe.prototype.compact=function(){return this.filter(xe)},Qe.prototype.find=function(t){return this.filter(t).head()},Qe.prototype.findLast=function(t){return this.reverse().find(t)},Qe.prototype.invokeMap=Mr((function(t,e){return"function"==typeof t?new Qe(this):this.map((function(n){return Tc(n,t,e)}))})),Qe.prototype.reject=function(t){return this.filter(hd(As(t)))},Qe.prototype.slice=function(t,e){t=be(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Qe(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=be(e))<0?n.dropRight(-e):n.take(e-t)),n)},Qe.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Qe.prototype.toArray=function(){return this.take(df)},ks(Qe.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=cn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(cn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,u=e instanceof Qe,s=a[0],l=u||Jt(e),c=function(t){var e=i.apply(cn,Di([t],a));return r&&d?e[0]:e};l&&n&&"function"==typeof s&&1!=s.length&&(u=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,f=u&&!h;if(!o&&l){e=f?e:new Qe(this);var v=t.apply(e,a);return v.__actions__.push({func:hp,args:[c],thisArg:void 0}),new an(v,d)}return p&&f?t.apply(this,a):(v=this.thru(c),p?r?v.value()[0]:v.value():v)})})),wn(["pop","push","shift","sort","splice","unshift"],(function(t){var e=hf[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);cn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Jt(i)?i:[],t)}return this[n]((function(n){return e.apply(Jt(n)?n:[],t)}))}})),ks(Qe.prototype,(function(t,e){var n=cn[e];if(n){var r=n.name+"";pf.call(nn,r)||(nn[r]=[]),nn[r].push({name:e,func:n})}})),nn[Zn(void 0,2).name]=[{name:"wrapper",func:void 0}],Qe.prototype.clone=function(){var t=new Qe(this.__wrapped__);return t.__actions__=un(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=un(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=un(this.__views__),t},Qe.prototype.reverse=function(){if(this.__filtered__){var t=new Qe(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Qe.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Jt(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=uf(e,t+a);break;case"takeRight":t=af(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,u=o.end,s=u-a,l=r?u:a-1,c=this.__iteratees__,d=c.length,h=0,p=sf(s,this.__takeCount__);if(!n||!r&&i==s&&p==s)return vp(t,this.__actions__);var f=[];t:for(;s--&&h<p;){for(var v=-1,g=t[l+=e];++v<d;){var y=c[v],m=y.iteratee,b=y.type,x=m(g);if(2==b)g=x;else if(!x){if(1==b)continue t;break t}}f[h++]=g}return f},cn.prototype.at=nf.at,cn.prototype.chain=nf.wrapperChain,cn.prototype.commit=nf.commit,cn.prototype.next=nf.next,cn.prototype.plant=nf.plant,cn.prototype.reverse=nf.reverse,cn.prototype.toJSON=cn.prototype.valueOf=cn.prototype.value=nf.value,cn.prototype.first=cn.prototype.head,ff&&(cn.prototype[ff]=nf.toIterator),cf={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},"function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout;var mf=0;function bf(t,e,n,r,i,o){e||(e={});var a,u,s=e;if("ref"in s)for(u in s={},e)"ref"==u?a=e[u]:s[u]=e[u];var l={type:t,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mf,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof t&&(a=t.defaultProps))for(u in a)void 0===s[u]&&(s[u]=a[u]);return cf.vnode&&cf.vnode(l),l}var xf=e.LogicFlowUtil.StepDrag,_f=function(t){function n(n){var r=t.call(this)||this;return r.updatePosition=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.x,a=i.y;r.nodeModel.x=o+e/2,r.nodeModel.y=a+n/2,r.nodeModel.moveText(e/2,n/2)},r.getResize=function(t){var e=t.index,n=t.deltaX,r=t.deltaY,i=t.width,o=t.height,a=t.PCTResizeInfo,u=t.pct,s=void 0===u?1:u,l=t.freezeWidth,c=void 0!==l&&l,d=t.freezeHeight,h=void 0!==d&&d,p={width:i,height:o,deltaX:n,deltaY:r};if(a){var f=0,v=0;switch(e){case 0:v=(-1*n-r)/4;break;case 1:v=(n-r)/4;break;case 2:v=(n+r)/4;break;case 3:v=(-1*n+r)/4}0!==v&&(f=Math.round(v/a.ResizeBasis.basisHeight*1e5)/1e3),a.ResizePCT.widthPCT=Math.max(Math.min(a.ResizePCT.widthPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit),a.ResizePCT.heightPCT=Math.max(Math.min(a.ResizePCT.heightPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit);var g=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),y=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=i-g,r=o-y;break;case 1:n=g-i,r=o-y;break;case 2:n=g-i,r=y-o;break;case 3:n=i-g,r=y-o}return p.width=g,p.height=y,p.deltaX=n/s,p.deltaY=r/s,p}switch(e){case 0:p.width=c?i:i-n*s,p.height=h?o:o-r*s;break;case 1:p.width=c?i:i+n*s,p.height=h?o:o-r*s;break;case 2:p.width=c?i:i+n*s,p.height=h?o:o+r*s;break;case 3:p.width=c?i:i-n*s,p.height=h?o:o+r*s}return p},r.updateEdgePointByAnchors=function(){var t=r.nodeModel,e=t.id,n=t.anchors,i=r.getNodeEdges(e);i.sourceEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),i.targetEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},r.updateRect=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.x,a=i.y,u=i.width,s=i.height,l=i.radius,c=i.PCTResizeInfo,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,g=r.index,y=h===f,m=p===v,b=r.getResize({index:g,deltaX:e,deltaY:n,width:u,height:s,PCTResizeInfo:c,pct:1,freezeWidth:y,freezeHeight:m});if(b.width<h||b.width>f||b.height<p||b.height>v)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:y?0:b.deltaX,deltaY:m?0:b.deltaY}),r.nodeModel.width=b.width,r.nodeModel.height=b.height,r.nodeModel.setProperties({nodeSize:{width:b.width,height:b.height}});var x={x:o,y:a,width:u,height:s,radius:l},_={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:l};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:x,afterNode:_})}},r.updateEllipse=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.rx,a=i.ry,u=i.x,s=i.y,l=i.PCTResizeInfo,c=r.index,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,g=d.maxHeight,y=h===f,m=p===g,b=o,x=a,_=r.getResize({index:c,deltaX:e,deltaY:n,width:b,height:x,PCTResizeInfo:l,pct:.5,freezeWidth:y,freezeHeight:m});if(_.width<h/2||_.width>f/2||_.height<p/2||_.height>g/2)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:y?0:_.deltaX,deltaY:m?0:_.deltaY}),r.nodeModel.rx=_.width,r.nodeModel.ry=_.height,r.nodeModel.setProperties({nodeSize:{rx:_.width,ry:_.height}});var w={x:u,y:s},M={rx:_.width,ry:_.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:v(v({},w),{rx:o,ry:a}),afterNode:M})}},r.updateDiamond=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.rx,a=i.ry,u=i.x,s=i.y,l=i.PCTResizeInfo,c=r.index,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,g=h===f,y=p===v,m=o,b=a,x=r.getResize({index:c,deltaX:e,deltaY:n,width:m,height:b,PCTResizeInfo:l,pct:.5,freezeWidth:g,freezeHeight:y});if(x.width<h/2||x.width>f/2||x.height<p/2||x.height>v/2)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:g?0:x.deltaX,deltaY:y?0:x.deltaY}),r.nodeModel.rx=x.width,r.nodeModel.ry=x.height,r.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var _={x:u,y:s,rx:o,ry:a},w={rx:x.width,ry:x.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:_,afterNode:w})}},r.eventEmit=function(t){var e=t.beforeNode,n=t.afterNode,i=r.nodeModel,o=i.id,a=i.modelType,u=i.type,s=v({id:o,modelType:a,type:u},e),l=v({id:o,modelType:a,type:u},n);r.graphModel.eventCenter.emit("node:resize",{oldNodeSize:s,newNodeSize:l})},r.onDragging=function(t){var n,i=t.deltaX,o=t.deltaY,a=r.graphModel.transformModel,u=r.nodeModel.modelType;i=(n=m(a.fixDeltaXY(i,o),2))[0],o=n[1],u===e.ModelType.RECT_NODE||u===e.ModelType.HTML_NODE?r.updateRect({deltaX:i,deltaY:o}):u===e.ModelType.ELLIPSE_NODE?r.updateEllipse({deltaX:i,deltaY:o}):u===e.ModelType.DIAMOND_NODE&&r.updateDiamond({deltaX:i,deltaY:o})},r.onDragEnd=function(){var t=r.graphModel.gridSize,e=void 0===t?1:t,n=e*Math.round(r.nodeModel.x/e),i=e*Math.round(r.nodeModel.y/e);r.nodeModel.moveTo(n,i),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new xf({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return f(n,t),n.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],r=[],i=0;i<e.length;i++){var o=e[i];o.sourceNodeId===t?n.push(o):e[i].targetNodeId===t&&r.push(o)}return{sourceEdges:n,targetEdges:r}},n.prototype.render=function(){var t=this.props,n=t.x,r=t.y,i=t.index,o=t.model.getControlPointStyle();return bf("g",{className:"lf-resize-control-".concat(i),children:bf(e.Rect,v({className:"lf-node-control",x:n,y:r},o,{onMouseDown:this.dragHandler.handleMouseDown}))})},n}(e.Component),wf=function(t){function n(){var e=t.call(this)||this;return e.state={},e}return f(n,t),n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.x,i=e.y,o=e.width,a=e.height,u={minX:r-o/2,minY:i-a/2,maxX:r+o/2,maxY:i+a/2},s=u.minX,l=u.minY,c=u.maxX,d=u.maxY;return[{x:s,y:l},{x:c,y:l},{x:c,y:d},{x:s,y:d}].map((function(t,r){return bf(_f,v({index:r},t,{model:e,graphModel:n}))}))},n.prototype.getGroupSolid=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getResizeOutlineStyle();return bf(e.Rect,v({},a,{x:n,y:r,width:i,height:o}))},n.prototype.render=function(){return bf("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},n}(e.Component),Mf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.EllipseNodeModel),Ef=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(e.EllipseNode),Nf={type:"ellipse",view:Ef,model:Mf},Sf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.DiamondNodeModel),Af=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.points,r=t.getNodeStyle();return bf("g",{children:bf(e.Polygon,v({},r,{points:n}))})},n.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},n}(e.DiamondNode),Pf={type:"diamond",view:Af,model:Sf},Of=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.HtmlNodeModel),Tf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.HtmlNode),Cf={type:"html",view:Tf,model:Of},kf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.RectNodeModel),jf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.RectNode),If={type:"rect",view:jf,model:kf},Rf={pluginName:"nodeResize",step:0,install:function(t){t.register(Nf),t.register(Pf),t.register(Cf),t.register(If)}},Df=function(t){function e(){var e=t.apply(this,b([],m(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return f(e,t),e.prototype.initNodeData=function(e){var n=this;t.prototype.initNodeData.call(this,e);var r=[];Array.isArray(e.children)&&(r=e.children),this.children=new Set(r),this.width=500,this.height=300,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=-1e4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,void 0===this.properties.isFolded&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout((function(){n.isFolded&&n.foldGroup(n.isFolded)}))},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.foldGroup=function(t){var e=this;if(t!==this.isFolded){this.setProperty("isFolded",t),this.isFolded=t,t?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var n=b(b([],m(this.incoming.edges),!1),m(this.outgoing.edges),!1);this.children.forEach((function(r){var i=e.graphModel.getElement(r);if(i){var o=i.isFolded;if(i.isGroup&&!i.isFolded&&i.foldGroup(t),i.isGroup&&!t){var a=e.childrenLastFoldStatus[r];void 0!==a&&a!==i.isFolded&&i.foldGroup(a)}e.childrenLastFoldStatus[r]=!!o,i.visible=!t;var u=i.incoming.edges,s=i.outgoing.edges;n=b(b(b([],m(n),!1),m(u),!1),m(s),!1)}})),this.foldEdge(t,n)}},e.prototype.getAnchorStyle=function(e){var n=t.prototype.getAnchorStyle.call(this,e);return n.stroke="transparent",n.fill="transparent",n.hover.fill="transparent",n.hover.stroke="transparent",n},e.prototype.foldEdge=function(t,e){var n=this;e.forEach((function(e,r){var i=e.id,o=e.sourceNodeId,a=e.targetNodeId,u=e.startPoint,s=e.endPoint,l=e.type,c=e.text,d=e.getProperties(),h={id:"".concat(i,"__").concat(r),sourceNodeId:o,targetNodeId:a,startPoint:u,endPoint:s,type:l,properties:d,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var p=n.graphModel.group.getNodeGroup(a);p||(p=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(o);f||(f=n.graphModel.getNodeModelById(o)),t&&!1!==e.visible&&(n.children.has(o)||n.id===o?(h.startPoint=void 0,h.sourceNodeId=n.id):(h.endPoint=void 0,h.targetNodeId=n.id),p.id===n.id&&f.id===n.id||n.createVirtualEdge(h),e.visible=!1),t||!1!==e.visible||(p&&p.isGroup&&p.isFolded?(h.targetNodeId=p.id,h.endPoint=void 0,n.createVirtualEdge(h)):f&&f.isGroup&&f.isFolded?(h.sourceNodeId=f.id,h.startPoint=void 0,n.createVirtualEdge(h)):e.visible=!0)}))},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isFoldedEdge=!0},e.prototype.isInRange=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;return e>=this.x-this.width/2&&r<=this.x+this.width/2&&n>=this.y-this.height/2&&i<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;return{x:e>=this.x-this.width/2&&r<=this.x+this.width/2,y:n>=this.y-this.height/2&&i<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(t){this.setProperty("groupAddable",t)},e.prototype.addChild=function(t){this.children.add(t),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(t){this.children.delete(t),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this);n.children=[],this.children.forEach((function(t){var r=e.graphModel.getNodeModelById(t);r&&!r.virtual&&n.children.push(t)}));var r=n.properties;return null==r||delete r.groupAddable,null==r||delete r.isFolded,n},e.prototype.getHistoryData=function(){var e=t.prototype.getData.call(this);e.children=b([],m(this.children),!1),e.isGroup=!0;var n=e.properties;return null==n||delete n.groupAddable,(null==n?void 0:n.isFolded)&&(e.x=e.x+this.unfoldedWidth/2-this.foldedWidth/2,e.y=e.y+this.unfoldedHeight/2-this.foldedHeight/2),e},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.toBack=function(){this.zIndex--},e}(kf),Lf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,r=e.properties;return n&&!r.isFolded?t.prototype.getControlGroup.call(this):null},n.prototype.getAddableShape=function(){var t=this.props.model,n=t.width,r=t.height,i=t.x,o=t.y,a=t.radius,u=t.properties,s=t.getAddableOutlineStyle;if(!u.groupAddable)return null;var l=this.props.model.getNodeStyle().strokeWidth,c=void 0===l?0:l,d=s(),h=n+c+8,p=r+c+8;return e.h("rect",v(v({},d),{width:h,height:p,x:i-h/2,y:o-p/2,rx:a,ry:a}))},n.prototype.getFoldIcon=function(){var t=this.props.model,n=t.x-t.width/2+5,r=t.y-t.height/2+5;if(!t.foldable)return null;var i=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," M").concat(n+7,",").concat(r+2," ").concat(n+7,",").concat(r+10):"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:t.x-t.width/2+5,y:t.y-t.height/2+5,onClick:function(){t.foldGroup(!t.properties.isFolded)}}),i])},n.prototype.getResizeShape=function(){return e.h("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},n}(jf),Bf={type:"group",view:Lf,model:Df},zf=-1e4,Wf=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=zf,this.nodeGroupMap=new Map,this.graphRendered=function(t){var e=t.data;e&&e.nodes&&(e.nodes.forEach((function(t){t.children&&t.children.forEach((function(e){n.nodeGroupMap.set(e,t.id)}))})),n.checkAndCorrectTopGroupZIndex(e.nodes))},this.appendNodeToGroup=function(t){var e=t.data,r=n.nodeGroupMap.get(e.id);if(r){var i=n.lf.getNodeModelById(r);i.removeChild(e.id),n.nodeGroupMap.delete(e.id),i.setAllowAppendChild(!1)}var o=n.lf.getNodeModelById(e.id),a=null==o?void 0:o.getBounds();if(a&&o){var u=n.getGroup(a,e);if(o.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!u)return;if(!u.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:u.getData(),node:e});u.addChild(e.id),n.nodeGroupMap.set(e.id,u.id),u.setAllowAppendChild(!1)}},this.deleteGroupChild=function(t){var e=t.data;e.children&&e.children.forEach((function(t){n.nodeGroupMap.delete(t),n.lf.deleteNode(t)}));var r=n.nodeGroupMap.get(e.id);r&&(n.lf.getNodeModelById(r).removeChild(e.id),n.nodeGroupMap.delete(e.id))},this.setActiveGroup=function(t){var e=t.data,r=n.lf.getNodeModelById(e.id),i=null==r?void 0:r.getBounds();if(r&&i){var o=n.getGroup(i,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!o||r.isGroup&&o.id===e.id)return;if(!o.isAllowAppendIn(e))return;n.activeGroup=o,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=zf;return t.isGroup&&(e=Math.max(e,t.zIndex)),t.children&&t.children.forEach((function(t){"object"==typeof t&&(t=t.id);var r=n.lf.getNodeModelById(t);if(null==r?void 0:r.isGroup){var i=n.findNodeAndChildMaxZIndex(r);e=Math.max(i,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=zf;if(t.forEach((function(t){var r=n.lf.getNodeModelById(t.id);if(r){var i=n.findNodeAndChildMaxZIndex(r);i>e&&(e=i)}})),!(n.topGroupZIndex>=e)){for(var r=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),i=n.topGroupZIndex,o=0;o<r.length;o++){var a=r[o];a.zIndex>i&&(i=a.zIndex)}n.topGroupZIndex=i}},this.nodeSelected=function(t){var e=t.data,r=t.isMultiple,i=t.isSelected,o=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(o),n.topGroupZIndex>-1e3){n.topGroupZIndex=zf;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),u=0,s=0;s<a.length;s++){var l=a[s];l.zIndex!==u&&(n.topGroupZIndex++,u=l.zIndex),l.setZIndex(n.topGroupZIndex)}}if(r&&i)if(null==o?void 0:o.isGroup)o.children.forEach((function(t){var e=n.lf.graphModel.getElement(t);null==e||e.setSelected(!1)}));else{var c=n.nodeGroupMap.get(e.id);if(c){var d=n.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==o||o.setSelected(!1))}}},this.toFrontGroup=function(t){t&&t.isGroup&&(n.topGroupZIndex++,t.setZIndex(n.topGroupZIndex),t.children&&t.children.forEach((function(t){var e=n.lf.getNodeModelById(t);n.toFrontGroup(e)})))},e.register(Bf),this.lf=e,e.graphModel.addNodeMoveRules((function(t,r,i){if(t.isGroup){var o=n.getNodeAllChild(t);return e.graphModel.moveNodes(o,r,i,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var u=t.getBounds(),s=u.x1,l=u.y1,c=u.x2,d=u.y2;return a.isAllowMoveTo({x1:s+r,y1:l+i,x2:c+r,y2:d+i})}return!0})),e.graphModel.group=this,e.on("node:add,node:drop,node:dnd-add",this.appendNodeToGroup),e.on("node:delete",this.deleteGroupChild),e.on("node:dnd-drag,node:drag",this.setActiveGroup),e.on("node:click",this.nodeSelected),e.on("graph:rendered",this.graphRendered),e.addElements=function(t,r){var i=t.nodes,o=t.edges,a={},u={nodes:[],edges:[]},s=[];return gl(i,(function(t){var i=t.id,o=t.children,l=g(t,["children"]),c=e.addNode(l);if(!c)return{nodes:[],edges:[]};i&&(a[i]=c.id),u.nodes.push(c);var d=n.createAllChildNodes(a,o,c,r).edgesArray;s.push.apply(s,b([],m(d),!1))})),s.forEach((function(t){n.createEdgeModel(t,a,r)})),gl(o,(function(t){var e=n.createEdgeModel(t,a,0);u.edges.push(e)})),u}}return t.prototype.createAllChildNodes=function(t,n,r,i){var o=this,a=this.lf,u=[],s=[],l=[];null==n||n.forEach((function(n){var c=a.getNodeModelById(n);if(c){var d=c.x,h=c.y,p=c.properties,f=c.type,g=c.text,y=c.rotate,x=c.children,_=e.EventType.NODE_GROUP_COPY||"node:group-copy-add",w=a.addNode({x:d+i,y:h+i,properties:p,type:f,text:v(v({},g),{x:g.x+i,y:g.y+i}),rotate:y},_);if(r.addChild(w.id),t[n]=w.id,l.push(w),c.incoming.edges.forEach((function(t){s.push(t)})),c.outgoing.edges.forEach((function(t){s.push(t)})),x instanceof Set){var M=o.createAllChildNodes(t,x,w,i),E=M.nodesArray,N=M.edgesArray;l.push.apply(l,b([],m(E),!1)),u.push.apply(u,b([],m(N),!1))}}}));var c=s.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:l,edgesArray:u.concat(c)}},t.prototype.createEdgeModel=function(t,e,n){var r=this.lf,i=t.sourceNodeId,o=t.targetNodeId;e[i]&&(i=e[i]),e[o]&&(o=e[o]);var a=t.type,u=t.startPoint,s=t.endPoint,l=t.pointsList,c=t.text,d={x:((null==u?void 0:u.x)||0)+n,y:((null==u?void 0:u.y)||0)+n},h={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},p=[];l&&l.length>0&&(p=l.map((function(t){return t.x+=n,t.y+=n,t})));var f=c;return c&&"string"!=typeof c&&(f.x=c.x+n,f.y=c.y+n),r.graphModel.addEdge({type:a,startPoint:d,endPoint:h,sourceNodeId:i,targetNodeId:o,pointsList:p,text:f})},t.prototype.getNodeAllChild=function(t){var e=this,n=[];return t.children&&t.children.forEach((function(t){n.push(t);var r=e.lf.getNodeModelById(t);(null==r?void 0:r.isGroup)&&(n=n.concat(e.getNodeAllChild(r)))})),n},t.prototype.getGroup=function(t,e){var n=this.lf.graphModel.nodes.filter((function(n){return n.isGroup&&n.isInRange(t)&&n.id!==e.id}));if(0!==n.length){if(1===n.length)return n[0];for(var r=n[n.length-1],i=n.length-2;i>=0;i--)n[i].zIndex>r.zIndex&&(r=n[i]);return r}},t.prototype.getNodeGroup=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="group",t}();function Ff(){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getFoldIcon=function(){var t=this.props.model,n=t,r=n.x,i=n.y,o=n.width,a=n.height,u=n.properties,s=n.foldable,l=t.x-t.width/2+5,c=t.y-t.height/2+5;if(!s)return null;var d=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u.isFolded?"M ".concat(l+3,",").concat(c+6," ").concat(l+11,",").concat(c+6," M").concat(l+7,",").concat(c+2," ").concat(l+7,",").concat(c+10):"M ".concat(l+3,",").concat(c+6," ").concat(l+11,",").concat(c+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:r-o/2+5,y:i-a/2+5,onClick:function(e){var n,r;null===(r=(n=e.stopPropagation()(t)).foldGroup)||void 0===r||r.call(n,!u.isFolded)}}),d])},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getNodeStyle(),u=v(v({},a),{x:n-i/2,y:r-o/2,width:i,height:o,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return e.h("g",{},[e.h("rect",v({},u)),this.getFoldIcon()])},n}(Lf),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.foldable=!0,this.resizable=!0,this.width=400,this.height=200,this.resetWidthHeight(),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.resetWidthHeight=function(){var t,e,n=null===(t=this.properties.iniProp)||void 0===t?void 0:t.width,r=null===(e=this.properties.iniProp)||void 0===e?void 0:e.height;n&&(this.width=n),r&&(this.height=r)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke="#989891",e.strokeWidth=1,e.strokeDasharray="3 3",this.isSelected&&(e.stroke="rgb(124, 15, 255)"),this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.addChild=function(e){var n=this.graphModel.getElement(e);null==n||n.setProperties({parent:this.id}),t.prototype.addChild.call(this,e)},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="#000",e.fill="#fff",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(Df);return{type:"bpmn:subProcess",view:t,model:n}}function Gf(t){var e=kt("bpmn:serviceTask",Et),n=kt("bpmn:userTask",Nt);t.register(e),t.register(n),t.register(Ff()),function(t){function e(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=t.id,u=n-i/2,s=n+i/2,l=r-o/2,c=r+o/2,d=e.x,h=e.y;return d>u-5&&d<s+5&&h>l-5&&h<c+5&&!(d>u+5&&d<s-5&&h>l+5&&h<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var r,i,o=n.data;if("bpmn:boundaryEvent"===o.type){var a=t.graphModel.nodes;try{for(var u=y(a),s=u.next();!s.done;s=u.next()){var l=s.value;l.isTaskNode&&(e(l,o)?l.setTouching(!0):l.setTouching(!1))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var r,i,o=n.data,a=o.type,u=o.id;if("bpmn:boundaryEvent"===a){var s=t.graphModel.nodes;try{for(var l=y(s),c=l.next();!c.done;c=l.next()){var d,h=c.value;if(h.isTaskNode)if(null!==(d=e(h,o))){var p=t.graphModel.getNodeModelById(u),f=t.graphModel.getNodeModelById(d),v=p.properties.attachedToRef;return v&&v!==d&&t.graphModel.getNodeModelById(v).deleteBoundaryEvent(u),void f.addBoundaryEvent(u)}}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,r){if(e.isTaskNode){var i=e.boundaryEvents;return t.graphModel.moveNodes(i,n,r,!0),!0}return!0}))}(t)}function Hf(t){var n=function(e){function n(n,r){n.id||(n.id="Flow_".concat(ht()));var i=v(v(v({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=i,e.call(this,n,r)||this}return f(n,e),n.extendKey="SequenceFlowModel",n}(e.PolylineEdgeModel),r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getStartArrow=function(){return this.props.model.properties.isDefaultFlow?e.h("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):e.h("path",{d:""})},n.extendKey="SequenceFlowEdge",n}(e.PolylineEdge);return{type:"bpmn:sequenceFlow",view:r,model:n}}var Xf=Hf();var Uf=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:bt,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function Vf(t){function e(e){e.forEach((function(e){var n,r;n=e.nodes,r=e.definition,n.forEach((function(e){(null==t?void 0:t[e])||(t[e]=new Map);var n=null==t?void 0:t[e];r.forEach((function(t){n.set(t.type,t)}))}))}))}return function(){return[t,e]}}var Yf=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=Vf(e.definition);var n=m(e.useDefinition(),2),r=n[0],i=n[1];console.log("_definition",r),i(Uf),function(t){t.register(gt(t)),t.register(ft(t)),t.register(vt(t)),t.register(mt(t)),t.register(yt(t))}(e),function(t){var e=Tt("bpmn:exclusiveGateway",_t),n=Tt("bpmn:parallelGateway",wt),r=Tt("bpmn:inclusiveGateway",Mt);t.register(e),t.register(r),t.register(n)}(e),function(t){t.register(Xf)}(e),Gf(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),qf=40,Zf=40,Kf=40,$f=40,Jf=100,Qf=80,tv=100,ev=80,nv=100,rv=80,iv=100,ov=80,av=100,uv=80,sv=100,lv=80,cv=100,dv=80,hv=100,pv=80,fv=function(){};(fv.ObjTree=function(){return this}).VERSION="0.23",fv.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',fv.ObjTree.prototype.attr_prefix="-",fv.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},fv.ObjTree.prototype.parseHTTP=function(t,e,n){var r,i={};for(var o in e)i[o]=e[o];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,u=n,s=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),u(e,t),s&&s(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(l=new HTTP.Request(i))&&(r=l.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var l;(l=new Ajax.Request(t,i))&&(r=l.transport)}return n?r:r&&r.responseXML&&r.responseXML.documentElement?this.parseDOM(r.responseXML.documentElement):void 0},fv.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!==t.nodeType){var r={};r[t.nodeName]=n,n=r}return n}},fv.ObjTree.prototype.parseElement=function(t){if(7!==t.nodeType){if(3===t.nodeType||4===t.nodeType||8===t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var r=0;r<t.attributes.length;r++){if("string"==typeof(u=t.attributes[r].nodeName)){var i=t.attributes[r].nodeValue;try{i=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[r].nodeValue}null!=i&&(void 0===n[u=this.attr_prefix+u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}if(t.childNodes&&t.childNodes.length){var o=!0;e&&(o=!1);for(r=0;r<t.childNodes.length&&o;r++){var a=t.childNodes[r].nodeType;3!==a&&4!==a&&8!==a&&(o=!1)}if(o){e||(e="");for(r=0;r<t.childNodes.length;r++)e+=t.childNodes[r].nodeValue}else{e||(e={});for(r=0;r<t.childNodes.length;r++){var u;if("string"==typeof(u=t.childNodes[r].nodeName))(i=this.parseElement(t.childNodes[r]))&&(void 0===n[u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}else null===e&&(e={});return e}},fv.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(1===n&&(t[e]=[]),t[e][t[e].length]=r):1===n?t[e]=r:2===n?t[e]=[t[e],r]:t[e][t[e].length]=r},fv.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},fv.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(uc(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?void 0===o||null==o?n[n.length]="<".concat(i," />"):"object"==typeof o&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):n[n.length]="object"==typeof o?this.hash_to_xml(i,o):this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var a=r.join(""),u=n.join("");return void 0===t||null==t||(u=n.length>0?u.match(/\n/)?"<".concat(t).concat(a,">\n").concat(u,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(u,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),u},fv.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];void 0===i||null==i?n[n.length]="<".concat(t," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},fv.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"===t?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,">\n")},fv.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function vv(t){return Object.prototype.toString.call(t)}function gv(t){return" ".repeat(t)}function yv(t){return"[object Object]"===vv(t)?Object.keys(t).reduce((function(e,n){var r=n;return"-"===n.charAt(0)&&(r=n.substring(1)),e[r]=yv(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return yv(t)})):t}var mv,bv="\t\n";function xv(t,e,n){var r=gv(n),i="",o=bv+r;if("-json"===e)return"";if("#text"===e)return o+t;if("#cdata-section"===e)return"".concat(o,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(o,"\x3c!--").concat(t,"--\x3e");if("-"==="".concat(e).charAt(0))return" ".concat(e.substring(1),'="').concat(function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(yv(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))i+=t.map((function(t){return xv(t,e,n+1)})).join("");else if("[object Object]"===vv(t)){var a=Object.keys(t),u="",s=t["-json"]?bv+gv(n+1)+t["-json"]:"";i+="".concat(0===n?"":o,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?u+=xv(t[e],e,n+1):s+=xv(t[e],e,n+1)})),i+=u+(""!==s?">".concat(s).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"}(mv||(mv={}));var _v=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],wv=["properties","startPoint","endPoint","pointsList"],Mv={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},Ev=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var r=e[n],i=r.in,o=r.out;i&&(t[n].in=i),o&&(t[n].out=o)}else t[n]=e[n]})),t},Nv={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,r=e.condition;return r?"cdata"===n?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(r,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(r,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&r?">".concat("<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(n,">"),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,r,i,o=t,a=e["-id"],u="",s="";try{for(var l=y(Object.keys(e)),c=l.next();!c.done;c=l.next()){var d=c.value;d.includes("bpmn:")&&(u=m(d.split(":"),2)[1],s=null===(i=e[d])||void 0===i?void 0:i["#text"])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return{"-definitionId":a,"-definitionType":o,"-timerType":u,"-timerValue":s}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function Sv(t){var e=null!=t?t:{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(b(b([],m(wv),!1),m(n||[]),!1)),a={in:new Set(b(b([],m(Mv.in),!1),m((null==r?void 0:r.in)||[]),!1)),out:new Set(b(b([],m(Mv.out),!1),m((null==r?void 0:r.out)||[]),!1))};return Nv=Ev(Nv,i),function(t){var e=t.nodes,n=t.edges;return function t(r,i){var u,s;if(1!==(null==r?void 0:r.flag)){var l;if((l=Nv[r.type])&&l.out){var c=l.out(r),d=Object.keys(c);d.length>0&&d.forEach((function(t){r[t]=c[t]}))}(null==r?void 0:r.children)&&(r.children=r.children.map((function(t){return e.find((function(e){return e.id===t}))||n.find((function(e){return e.id===t}))||{}})));var h={};if("string"==typeof r)return r;if(Array.isArray(r))return r.map((function(e){return t(e,"")})).filter((function(t){return null!=t}));try{for(var p=y(Object.entries(r)),f=p.next();!f.done;f=p.next()){var v=m(f.value,2),g=v[0],b=v[1];if(1===(null==b?void 0:b.flag))return;var x=[i,g].filter((function(t){return t})).join(".");a.out.has(x)||("object"!=typeof b?0===g.indexOf("-")||["#text","#cdata-section","#comment"].includes(g)?h[g]=b:h["-".concat(g)]=b:o.has(x)?h["-".concat(g)]=t(b,x):h[g]=t(b,x))}}catch(t){u={error:t}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(u)throw u.error}}return h}}(t,"")}}function Av(t){var e,n,r={};try{for(var i=y(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=m(o.value,2),u=a[0],s=a[1];0===u.indexOf("-")?r[u.substring(1)]=yv(s):"string"==typeof s?r[u]=s:"[object Object]"===Object.prototype.toString.call(s)?r[u]=Av(s):Array.isArray(s)?r[u]=s.map((function(t){return Av(t)})):r[u]=s}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function Pv(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,r=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":r};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,r=100,i=80,o=t.x,a=t.y,u=jv.shapeConfigMap.get(t.type);u&&(r=u.width,i=u.height),o-=r/2,a-=i/2;var s={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":o,"-y":a,"-width":r,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),s}))}var Ov=["bpmn:incoming","bpmn:outgoing"];function Tv(t,e){var n=[],r=[],i=new Map,o=null!=e?e:{},a=o.transformer,u=o.excludeFields,s={in:new Set(b(b([],m(Mv.in),!1),m((null==u?void 0:u.in)||[]),!1)),out:new Set(b(b([],m(Mv.out),!1),m((null==u?void 0:u.out)||[]),!1))};Nv=Ev(Nv,a);var l,c,d=t["bpmn:definitions"];if(d){var h=d["bpmn:process"];l=h,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||Ov.includes(e)||(h[e]||(h[e]=[]),!Array.isArray(h[e])&&(h[e]=[h[e]]),Array.isArray(t[e])?(n=h[e]).push.apply(n,b([],m(t[e]),!1)):h[e].push(t[e]),Array.isArray(t[e])?t[e].forEach((function(n){!e.includes("Flow")&&t["-children"].push(n["-id"])})):!e.includes("Flow")&&t["-children"].push(t[e]["-id"]),delete t[e])}))}if("bpmn:subProcess"===t){var n=h[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;i.set(t["-id"],t),Array.isArray(t)?t.forEach((function(t){e(t)})):"object"==typeof t&&(n=t,Object.keys(n).forEach((function(t){var r,i;if(t.includes("bpmn:")){var o={};Nv[t]&&Nv[t].in?(o=null===(i=(r=Nv[t]).in)||void 0===i?void 0:i.call(r,t,cn.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(o)).length>0&&a.forEach((function(t){Reflect.set(n,t,o[t])}))}})))}e(h[t])},function(t){if(0===t.indexOf("bpmn:")){var e=h[t];if("bpmn:sequenceFlow"===t){var o=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var r;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(kv(r,t))}));else{var r=void 0;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(kv(r,t))}return n}(e,o)}else{var a=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var u=h[t],s=function(t){var e=t["-attachedToRef"],n=i.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(u)?u.forEach((function(t){s(t)})):s(u)}n=n.concat(function(t,e,n){var r=[];if(Array.isArray(t))t.forEach((function(t){var i=Cv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}));else{var i=Cv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}return r}(e,a,t))}}}],c.forEach((function(t){try{Object.keys(l).forEach((function(e){try{t(e)}catch(t){console.error(t)}}))}catch(t){console.error(t)}}))}var p=function(t,e,n){Object.keys(t).forEach((function(r){var i=n?"".concat(n,".").concat(r):r;e.has(i)?delete t[r]:"object"==typeof t[r]&&p(t[r],e,i)}))};return n.forEach((function(t){var n,r;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,o=t.type;i[o]&&(t.type=i[o])}p(t,s.in,"")})),r.forEach((function(t){var n,r;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,o=t.type;i[o]&&(t.type=i[o])}p(t,s.in,"")})),{nodes:n,edges:r}}function Cv(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],a=n["-name"],u=jv.shapeConfigMap.get(e);u&&(r+=u.width/2,i+=u.height/2);var s,l={};if(Object.entries(n).forEach((function(t){var e=m(t,2),n=e[0],r=e[1];_v.includes(n)||(l[n]=r)})),l=Av(l),a&&(s={x:r,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];s.x=Number(c["-x"])+Number(c["-width"])/2,s.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return o&&(d.children=o),s&&(d.text=s),d}function kv(t,e){var n,r=e["-name"];if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split("\n").forEach((function(t){o<t.length&&(o=t.length)})),n={value:r,x:Number(i["-x"])+10*o/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=m(t,2),n=e[0],r=e[1];_v.includes(n)||(a[n]=r)})),a=Av(a);var u=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),s={id:e["-id"],type:mv.FLOW,pointsList:u,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(s.text=n),s}var jv=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var r,i,o=v({},n.processAttributes);!function(t,e,n){var r,i=new Map,o=Sv(n)(e);o.nodes.forEach((function(e){var n=e["-id"],r=e["-type"],o=e.text,a=e.children,u=g(e,["-id","-type","text","children"]),s={"-id":n};(null==o?void 0:o["-value"])&&(s["-name"]=o["-value"]),u["-json"]&&(s["-json"]=u["-json"]),u["-properties"]&&Object.assign(s,u["-properties"]),a&&(s.children=a),t[r]||(t[r]=[]),t[r].push(s),i.set(n,s)}));var a=o.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],r=t["-targetNodeId"],o=t.text,a=g(t,["-id","-sourceNodeId","-targetNodeId","text"]),u=i.get(r);u["bpmn:incoming"]||(u["bpmn:incoming"]=[]),u["bpmn:incoming"].push(e);var s={"-id":e,"-sourceRef":n,"-targetRef":r};return(null==o?void 0:o["-value"])&&(s["-name"]=o["-value"]),a["-json"]&&(s["-json"]=a["-json"]),a["-properties"]&&Object.assign(s,a["-properties"]),s}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,r=i.get(e);r["bpmn:outgoing"]||(r["bpmn:outgoing"]=[]),r["bpmn:outgoing"].push(n)})),null===(r=t["bpmn:subProcess"])||void 0===r||r.forEach((function(e){var n={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},r=[];e.children.forEach((function(r){var o,a=i.get(r["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var u=null===(o=t[r["-type"]])||void 0===o?void 0:o.findIndex((function(t){return t["-id"]===r["-id"]}));u>=0&&t[r["-type"]].splice(u,1),i.delete(r["-id"]),e[r["-type"]]||(e[r["-type"]]=[]),e[r["-type"]].push(a)}));var o=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){o.has(t)&&r.push(t)}));for(var u,s=function(t){var n=a.findIndex((function(e){return e["-id"]===r[t]}));n>=0?(e["bpmn:sequenceFlow"]||(e["bpmn:sequenceFlow"]=[]),e["bpmn:sequenceFlow"].push(a[n]),a.splice(n,1)):t++,u=t},l=0;l<r.length;)s(l),l=u;delete e.children})),t[mv.FLOW]=a}(o,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":o["-id"]};Pv(a,t);var u=n.definitionAttributes;u["bpmn:process"]=o,u["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var s={"bpmn:definitions":u};if(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.out){var l=null===(i=null==e?void 0:e.mapping)||void 0===i?void 0:i.out,c=function(t){Array.isArray(t)&&t.forEach((function(t){return c(t)})),"object"==typeof t&&Object.keys(t).forEach((function(e){var n;(n=l[e])?(t[n]=cn.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(s)}return s},this.adapterIn=function(t,e){if(t)return Tv(t,e)},e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();jv.shapeConfigMap.set(mv.START,{width:qf,height:Zf}),jv.shapeConfigMap.set(mv.END,{width:Kf,height:$f}),jv.shapeConfigMap.set(mv.INTERMEDIATE_CATCH,{width:tv,height:ev}),jv.shapeConfigMap.set(mv.INTERMEDIATE_THROW,{width:tv,height:ev}),jv.shapeConfigMap.set(mv.BOUNDARY,{width:Jf,height:Qf}),jv.shapeConfigMap.set(mv.PARALLEL_GATEWAY,{width:nv,height:rv}),jv.shapeConfigMap.set(mv.INCLUSIVE_GATEWAY,{width:iv,height:ov}),jv.shapeConfigMap.set(mv.EXCLUSIVE_GATEWAY,{width:av,height:uv}),jv.shapeConfigMap.set(mv.SYSTEM,{width:sv,height:lv}),jv.shapeConfigMap.set(mv.USER,{width:cv,height:dv}),jv.shapeConfigMap.set(mv.SUBPROCESS,{width:hv,height:pv});var Iv,Rv=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,r=(e=t,(new fv.ObjTree).parseXML(e));return n.adapterIn(r,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=xv(t[n],n,0);return e}(n.adapterOut(t,n.props))};var r=e.lf,i=e.props;return r.adapterIn=n.adapterXmlIn,r.adapterOut=n.adapterXmlOut,n.props=i,n}return f(e,t),e.pluginName="BPMNAdapter",e}(jv),Dv=function(){function t(t){var e=t.lf,n=this;this.fileName="snapshot.png",this.lf=e,this.customCssRules="",this.useGlobalRules=!0,e.getSnapshot=function(t,e){n.getSnapshot(t,e)},e.getSnapshotBlob=function(t){return n.getSnapshotBlob(t)},e.getSnapshotBase64=function(t){return n.getSnapshotBase64(t)}}return t.prototype.getSvgRootElement=function(t){return t.container.querySelector(".lf-canvas-overlay")},t.prototype.triggerDownload=function(t){var e=new MouseEvent("click",{view:document.defaultView,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",this.fileName),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(e)},t.prototype.removeAnchor=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,r=0;r<n;r++){var i=e[r];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-anchor")>-1&&(t.removeChild(t.childNodes[r]),n--,r--)}},t.prototype.removeRotateControl=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,r=0;r<n;r++){var i=e[r];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-rotate-control")>-1&&(t.removeChild(t.childNodes[r]),n--,r--)}},t.prototype.getSnapshot=function(t,e){var n=this;this.fileName=t||"logic-flow.".concat(Date.now(),".png");var r=this.getSvgRootElement(this.lf);this.getCanvasData(r,e).then((function(t){var e=t.toDataURL("image/png").replace("image/png","image/octet-stream");n.triggerDownload(e)}))},t.prototype.getSnapshotBase64=function(t){var e=this,n=this.getSvgRootElement(this.lf);return new Promise((function(r){e.getCanvasData(n,t).then((function(t){var e=t.toDataURL("image/png");r({data:e,width:t.width,height:t.height})}))}))},t.prototype.getSnapshotBlob=function(t){var e=this,n=this.getSvgRootElement(this.lf);return new Promise((function(r){e.getCanvasData(n,t).then((function(t){t.toBlob((function(e){r({data:e,width:t.width,height:t.height})}),"image/png")}))}))},t.prototype.getClassRules=function(){var t="";if(this.useGlobalRules)for(var e=document.styleSheets,n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.cssRules.length;i++)t+=r.cssRules[i].cssText;return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){var n,r=this,i=t.cloneNode(!0),o=i.lastChild,a=null===(n=null==o?void 0:o.childNodes)||void 0===n?void 0:n.length;if(a)for(var u=0;u<a;u++){var s=null==o?void 0:o.childNodes[u],l=s.classList&&Array.from(s.classList);if(l&&l.indexOf("lf-base")<0)null==o||o.removeChild(o.childNodes[u]),a--,u--;else{var c=null==o?void 0:o.childNodes[u];c&&c.childNodes.forEach((function(t){var e=t;r.removeAnchor(e.firstChild),r.removeRotateControl(e.firstChild)}))}}var d=window.devicePixelRatio||1;d<1&&(d=1);var h=document.createElement("canvas"),p=this.lf.graphModel.rootEl.querySelector(".lf-base").getBoundingClientRect(),f=this.lf.container.querySelector(".lf-canvas-overlay").getBoundingClientRect(),v=p.x-f.x,g=p.y-f.y,y=this.lf.graphModel.transformModel,m=y.SCALE_X,b=y.SCALE_Y,x=y.TRANSLATE_X,_=y.TRANSLATE_Y;i.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-v+x)*(1/m)+10,", ").concat((-g+_)*(1/b)+10,")");var w=Math.ceil(p.width/m),M=Math.ceil(p.height/b);h.style.width="".concat(w,"px"),h.style.height="".concat(M,"px"),h.width=w*d+80,h.height=M*d+80;var E=h.getContext("2d");E&&(E.clearRect(0,0,h.width,h.height),E.scale(d,d),e?(E.fillStyle=e,E.fillRect(0,0,w*d+80,M*d+80)):E.clearRect(0,0,w,M));var N=new Image,S=document.createElement("style");S.innerHTML=this.getClassRules();var A=document.createElement("foreignObject");return A.appendChild(S),i.appendChild(A),new Promise((function(t){N.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(N,{resizeWidth:h.width,resizeHeight:h.height}).then((function(e){null==E||E.drawImage(e,0,0),t(h)})):(null==E||E.drawImage(N,0,0),t(h))}catch(e){null==E||E.drawImage(N,0,0),t(h)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(i)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");N.src=e}))},t.pluginName="snapshot",t}(),Lv={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},Bv={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function zv(t){switch(t){case"bpmn:sequenceFlow":return Lv.SEQUENCE_FLOW;case"bpmn:startEvent":return Lv.START_EVENT;case"bpmn:endEvent":return Lv.END_EVENT;case"bpmn:userTask":return Lv.USER_TASK;case"bpmn:exclusiveGateway":return Lv.EXCLUSIVE_GATEWAY;default:return t}}!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Iv||(Iv={}));var Wv=function(t,e,n,r){return void 0===r&&(r=0),Hv(t,e,n)<=r};function Fv(t){return t*t}function Gv(t,e){return Fv(t.x-e.x)+Fv(t.y-e.y)}var Hv=function(t,e,n){return Math.sqrt(function(t,e,n){var r=Gv(e,n);if(0===r)return Gv(t,e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return i=Math.max(0,Math.min(1,i)),Gv(t,{x:e.x+i*(n.x-e.x),y:e.y+i*(n.y-e.y)})}(t,e,n))},Xv=function(t,e,n){var r=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{minX:e-r/2,minY:n-i/2,maxX:e+r/2,maxY:n+i/2,x:e,y:n,width:r,height:i,centerX:e,centerY:n}}(t),i=function(t,e){var n;return t.x===e.x?n=Iv.VERTICAL:t.y===e.y&&(n=Iv.HORIZONTAL),n}(e,n),o=Math.max(e.x,n.x),a=Math.min(e.x,n.x),u=Math.max(e.y,n.y),s=Math.min(e.y,n.y),l=t.x,c=t.y,d=t.width,h=t.height;if(i===Iv.HORIZONTAL){if(o>=r.maxX&&a<=r.minX)return{startCrossPoint:{x:e.x>n.x?l+d/2:l-d/2,y:e.y},endCrossPoint:{x:e.x>n.x?l-d/2:l+d/2,y:e.y}}}else if(i===Iv.VERTICAL&&u>=r.maxY&&s<=r.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+h/2:c-h/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-h/2:c+h/2}}},Uv=function(t,e,n){void 0===n&&(n=0);for(var r=t.x,i=t.y,o=e.pointsList,a=0;a<o.length-1;a++)if(Wv({x:r,y:i},o[a],o[a+1],n)){var u=Xv(t,o[a],o[a+1]);if(u)return{crossIndex:a+1,crossPoints:u}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},Vv=function(){function t(t){var e=t.lf;this._lf=e,this.deviation=20,this.dndAdd=!0,this.dropAdd=!0,this.eventHandler()}return t.prototype.eventHandler=function(){var t=this;this.dndAdd&&this._lf.on("node:dnd-add",(function(e){var n=e.data;t.insetNode(n)})),this.dropAdd&&this._lf.on("node:drop",(function(e){for(var n=e.data,r=t._lf.graphModel.edges,i=n.id,o=!0,a=0;a<r.length;a++)if(r[a].sourceNodeId===i||r[a].targetNodeId===i){o=!1;break}o&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,n,r,i,o){var a=this._lf.getNodeModelById(t),u=this._lf.getNodeModelById(n),s=a.getAnchorInfo(r),l=u.getAnchorInfo(i),c=a.isAllowConnectedAsSource(o,s,l),d=u.isAllowConnectedAsTarget(o,s,l),h=e.formateAnchorConnectValidateData(c),p=h.isAllPass,f=h.msg,v=e.formateAnchorConnectValidateData(d),g=v.isAllPass;return{isPass:p&&g,sourceMsg:f,targetMsg:v.msg}},t.prototype.insetNode=function(t){var n=this,r=this._lf.graphModel.edges,i=this._lf.getNodeModelById(t.id),o=null==i?void 0:i.getDefaultAnchor();if(!o||0===o.length)this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(i)for(var a=0;a<r.length;a++){var u=Uv(i,r[a],this.deviation),s=u.crossIndex,l=u.crossPoints;if(s>=0){var c=r[a],d=c.sourceNodeId,h=c.targetNodeId,p=c.id,f=c.type,v=c.pointsList,g=c.sourceAnchorId,y=c.targetAnchorId,x=ju(v[0]),_=ju(l.startCrossPoint);this._lf.deleteEdge(p);var w=this.checkRuleBeforeInsetNode(d,h,g,y,t);if(this._lf.addEdge({type:f,sourceNodeId:d,targetNodeId:t.id,startPoint:x,endPoint:_,pointsList:b(b([],m(v.slice(0,s)),!1),[l.startCrossPoint],!1)}),this._lf.addEdge({type:f,sourceNodeId:t.id,targetNodeId:h,startPoint:ju(l.endCrossPoint),endPoint:ju(v[v.length-1]),pointsList:b([l.endCrossPoint],m(v.slice(s)),!1)}),w.isPass)break;this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:w.targetMsg||w.sourceMsg}),setTimeout((function(){n._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),Yv=function(){function t(t){var e=t.lf,n=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){n.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){n.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){n.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){n.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){n.lf.redo()}}],this.lf=e}return t.prototype.render=function(t,e){this.destroy();var n=this.getControlTool();this.toolEl=n,e.appendChild(n),this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},t.prototype.addItem=function(t){this.controlItems.push(t)},t.prototype.removeItem=function(t){var e=this.controlItems.findIndex((function(e){return e.key===t}));return-1==e?null:this.controlItems.splice(e,1)[0]},t.prototype.getControlTool=function(){var t=this,e="lf-control-item",n="lf-control-item disabled",r=document.createElement("div"),i=[];return r.className="lf-control",this.controlItems.forEach((function(r){var o=document.createElement("div"),a=document.createElement("i"),u=document.createElement("span");switch(o.className=n,r.onClick&&(o.onclick=r.onClick.bind(null,t.lf)),r.onMouseEnter&&(o.onmouseenter=r.onMouseEnter.bind(null,t.lf)),r.onMouseLeave&&(o.onmouseleave=r.onMouseLeave.bind(null,t.lf)),a.className=r.iconClass,u.className="lf-control-text",u.title=r.title,u.innerText=r.text,o.append(a,u),r.text){case"上一步":t.lf.on("history:change",(function(t){var r=t.data.undoAble;o.className=r?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var r=t.data.redoAble;o.className=r?e:n}));break;default:o.className=e}i.push(o)})),r.append.apply(r,b([],m(i),!1)),r},t.pluginName="control",t}(),qv="lf:defaultNodeMenu",Zv="lf:defaultEdgeMenu",Kv="lf:defaultGraphMenu",$v="lf:defaultSelectionMenu",Jv=function(){function t(t){var e=t.lf,n=this;this.lf=e,e.options.isSilentMode||(this.__menuDOM=document.createElement("ul"),this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(t){n.setMenuConfig(t)},this.lf.addMenuConfig=function(t){n.addMenuConfig(t)},this.lf.setMenuByType=function(t){n.setMenuByType(t)})}return t.prototype.init=function(){var t,e,n,r,i=this,o=[{text:"删除",callback:function(t){i.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){i.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set(qv,o);var a=[{text:"删除",callback:function(t){i.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(Zv,a),null===(n=this.menuTypeMap)||void 0===n||n.set(Kv,[]);var u=[{text:"删除",callback:function(t){i.lf.clearSelectElements(),t.edges.forEach((function(t){return i.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return i.lf.deleteNode(t.id)}))}}];null===(r=this.menuTypeMap)||void 0===r||r.set($v,u)},t.prototype.render=function(t,e){var n=this;t.options.isSilentMode||(this.__container=e,this.__currentData=null,this.__menuDOM&&(this.__menuDOM.className="lf-menu",e.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(t){t.stopPropagation();for(var e=t.target;-1===Array.from(e.classList).indexOf("lf-menu-item")&&-1===Array.from(e.classList).indexOf("lf-menu");)e=null==e?void 0:e.parentElement;Array.from(e.classList).indexOf("lf-menu-item")>-1?(e.onclickCallback(n.__currentData),n.__menuDOM&&(n.__menuDOM.style.display="none"),n.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!")}),!0)),this.lf.on("node:contextmenu",(function(t){var e,r,i=t.data,o=t.position,a=t.e,u=o.domOverlayPosition,s=u.x,l=u.y,c=i.id,d=n.lf.graphModel.getNodeModelById(c);if(d){var h=[],p=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(d.type);h=d&&d.menu&&Array.isArray(d.menu)?d.menu:p||(null===(r=n.menuTypeMap)||void 0===r?void 0:r.get(qv)),n.__currentData=i,n.showMenu(s,l,h,{width:d.width,height:d.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,r,i,o,a=t.data,u=t.position,s=t.e,l=u.domOverlayPosition,c=l.x,d=l.y,h=a.id,p=n.lf.graphModel.getEdgeModelById(h);if(p){var f=[],v=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(p.type))&&void 0!==r?r:[];f=p&&p.menu&&Array.isArray(p.menu)?p.menu:v||(null!==(o=null===(i=n.menuTypeMap)||void 0===i?void 0:i.get(Zv))&&void 0!==o?o:[]),n.__currentData=a,n.showMenu(c,d,f,{width:p.width,height:p.height,clientX:s.clientX,clientY:s.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,r,i=t.position,o=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(Kv))&&void 0!==r?r:[],a=i.domOverlayPosition,u=a.x,s=a.y;n.showMenu(u,s,o)})),this.lf.on("selection:contextmenu",(function(t){var e,r=t.data,i=t.position,o=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get($v),a=i.domOverlayPosition,u=a.x,s=a.y;n.__currentData=r,n.showMenu(u,s,o)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"})))},t.prototype.destroy=function(){var t;this.__menuDOM&&(null===(t=null==this?void 0:this.__container)||void 0===t||t.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.prototype.showMenu=function(t,e,n,r){if(n&&n.length){var i=this.__menuDOM;if(i){if(i.innerHTML="",i.append.apply(i,b([],m(this.__getMenuDom(n)),!1)),!i.children.length)return;if(i.style.display="block",!r)return i.style.top="".concat(e,"px"),void(i.style.left="".concat(t,"px"));var o=r.width,a=r.height,u=r.clientX,s=r.clientY,l=this.lf.graphModel,c=i.offsetWidth,d=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=h-u,f=l.rootEl.getBoundingClientRect(),v=f.left+f.width;v<h&&(p=v-u),p<c&&(d=!1),i.style.left="".concat(d?t:t-o,"px");var g=i.offsetHeight,y=!0,x=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,_=x-s,w=f.top+f.height;w<x&&(_=w-s),_<g&&(y=!1),i.style.top="".concat(y?e:e-a,"px")}}},t.prototype.setMenuByType=function(t){var e;t.type&&t.menu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(t.type,t.menu))},t.prototype.__getMenuDom=function(t){var e=[];return t&&t.length>0&&t.forEach((function(t){var n=document.createElement("li");if(t.className?n.className="lf-menu-item ".concat(t.className):n.className="lf-menu-item",!0===t.icon){var r=document.createElement("span");r.className="lf-menu-item-icon",n.appendChild(r)}var i=document.createElement("span");i.className="lf-menu-item-text",t.text&&(i.innerText=t.text),n.appendChild(i),n.onclickCallback=t.callback,e.push(n)})),e},t.prototype.setMenuConfig=function(t){var e,n,r;t&&(void 0!==t.nodeMenu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(qv,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(Zv,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(r=this.menuTypeMap)||void 0===r||r.set(Kv,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,r,i,o,a,u,s,l;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get(qv))&&void 0!==n?n:[];null===(r=this.menuTypeMap)||void 0===r||r.set(qv,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(o=null===(i=this.menuTypeMap)||void 0===i?void 0:i.get(Zv))&&void 0!==o?o:[];null===(a=this.menuTypeMap)||void 0===a||a.set(Zv,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(s=null===(u=this.menuTypeMap)||void 0===u?void 0:u.get(Kv))&&void 0!==s?s:[];null===(l=this.menuTypeMap)||void 0===l||l.set(Kv,c.concat(t.graphMenu))}}},t.prototype.changeMenuItem=function(t,e){if("add"===t)this.addMenuConfig(e);else{if("reset"!==t)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.setMenuConfig(e)}},t.pluginName="menu",t}(),Qv="menu-common",tg=function(){function t(t){var e=t.lf,n=this;this.menuTypeMap=new Map,this.listenDelete=function(){n.hideContextMenu()},this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(Qv,[]),this.lf.setContextMenuByType=function(t,e){n.setContextMenuByType(t,e)},this.lf.setContextMenuItems=function(t){n.setContextMenuItems(t)},this.lf.showContextMenu=function(t){n.showContextMenu(t)},this.lf.hideContextMenu=function(){n.hideContextMenu()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("node:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("edge:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("blank:click",(function(){n.hideContextMenu()}))},t.prototype.setContextMenuByType=function(t,e){this.menuTypeMap.set(t,e)},t.prototype.hideContextMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},t.prototype.showContextMenu=function(t){t&&t.id?(this._activeData=t,this.createContextMenu()):console.warn("请检查传入的参数")},t.prototype.setContextMenuItems=function(t){this.menuTypeMap.set(Qv,t)},t.prototype.getContextMenuPosition=function(){var t=this._activeData,e=this.lf.graphModel.getElement(t.id);if(e){var n,r;if("edge"===e.BaseType){n=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER;var i=e.getData();n=Math.max(i.startPoint.x,n),r=Math.min(i.startPoint.y,r),n=Math.max(i.endPoint.x,n),r=Math.min(i.endPoint.y,r),i.pointsList&&i.pointsList.forEach((function(t){n=Math.max(t.x,n),r=Math.min(t.y,r)}))}return"node"===e.BaseType&&(n=t.x+e.width/2,r=t.y-e.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([n,r])}},t.prototype.createContextMenu=function(){var t=this;if(!this.lf.options.isSilentMode){var e=b(b([],m(this.menuTypeMap.get(this._activeData.type)||[]),!1),m(this.menuTypeMap.get(Qv)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var r=document.createElement("div");r.className="lf-context-item";var i=document.createElement("img");i.src=e.icon,i.className="lf-context-img",e.className&&(r.className="".concat(r.className," ").concat(e.className)),i.addEventListener("click",(function(){t.hideContextMenu(),e.callback?e.callback(t._activeData):t.addNode({sourceId:t._activeData.id,x:t._activeData.x,y:t._activeData.y,properties:e.properties,type:e.type})})),r.appendChild(i),n.appendChild(r)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(n),this.showMenu()}},t.prototype.addNode=function(t,e){var n=void 0!==e;void 0===e&&(e=t.y);var r=this.lf.getNodeModelById(t.sourceId);if(r){var i=t.x-r.width+200,o=e-t.y/2-20,a=t.x+r.width+200,u=e+t.y/2+20;if(this.lf.getAreaElement([i,o],[a,u]).length)return e+=100,void this.addNode(t,e);if(t.type){var s=this.lf.addNode({type:t.type,x:t.x+200,y:e,properties:t.properties}),l=void 0,c=void 0;n&&(l={x:t.x,y:t.y+r.height/2},c={x:s.x-s.width/2,y:s.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:s.id,startPoint:l,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=m(t,2),n=e[0],r=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top="".concat(r,"px"),this.__menuDOM.style.left="".concat(n+10,"px"),this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}},t.pluginName="contextMenu",t}(),eg=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.lf.setPatternItems=function(t){n.setPatternItems(t)}}return t.prototype.render=function(t,e){var n=this;this.destroy(),this.shapeList&&0!==this.shapeList.length?(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(t){var e;null===(e=n.panelEl)||void 0===e||e.appendChild(n.createDndItem(t))})),e.appendChild(this.panelEl),this.domContainer=e):this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(t){this.shapeList=t,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(t){var e=this,n=document.createElement("div");n.className=t.className?"lf-dnd-item ".concat(t.className):"lf-dnd-item";var r=document.createElement("div");if(r.className="lf-dnd-shape",t.icon&&(r.style.backgroundImage="url(".concat(t.icon,")")),n.appendChild(r),t.label){var i=document.createElement("div");i.innerText=t.label,i.className="lf-dnd-text",n.appendChild(i)}return t.disabled?(n.classList.add("disabled"),n.onmousedown=function(){t.callback&&t.callback(e.lf,e.domContainer)},n):(n.onmousedown=function(){t.type&&e.lf.dnd.startDrag({type:t.type,properties:t.properties,text:t.text}),t.callback&&t.callback(e.lf,e.domContainer)},n.ondblclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:n,data:t})},n.onclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:n,data:t})},n.oncontextmenu=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:n,data:t})},n)},t.pluginName="dndPanel",t}(),ng=function(){function t(t){var e=t.lf,n=this;this.disabled=!0,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.draw=function(t){var e=n.lf.getPointByClient(t.clientX,t.clientY).domOverlayPosition,r=e.x,i=e.y;if(n.endPoint={x:r,y:i},n.startPoint){var o=n.startPoint,a=o.x,u=o.y,s=a,l=u,c=r-a,d=i-u;r<a&&(s=r,c=a-r),i<u&&(l=i,d=u-i),n.wrapper&&(n.wrapper.style.left="".concat(s,"px"),n.wrapper.style.top="".concat(l,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(d,"px"))}},this.drawOff=function(){var t;if(document.removeEventListener("mousemove",n.draw),document.removeEventListener("mouseup",n.drawOff),n.wrapper&&(n.wrapper.oncontextmenu=null,null===(t=n.container)||void 0===t||t.removeChild(n.wrapper)),n.startPoint&&n.endPoint){var e=n.startPoint,r=e.x,i=e.y,o=n.endPoint,a=o.x,u=o.y,s=[Math.min(r,a),Math.min(i,u)],l=[Math.max(r,a),Math.max(i,u)];if(n.lf.emit("selection:selected-area",{topLeft:s,bottomRight:l}),Math.abs(a-r)<10&&Math.abs(u-i)<10)return;var c=n.lf.graphModel.getAreaElement(s,l,n.isWholeEdge,n.isWholeNode,!0),d=n.lf.graphModel.group;c.forEach((function(t){d&&d.getNodeGroup(t.id)||n.lf.selectElementById(t.id,!0)})),n.lf.emit("selection:selected",c)}},this.lf=e;var r=e.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=r,e.openSelectionSelect=function(){n.openSelectionSelect()},e.closeSelectionSelect=function(){n.closeSelectionSelect()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("blank:mousedown",(function(r){var i=r.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===i.button)){var o=t.getPointByClient(i.clientX,i.clientY).domOverlayPosition,a=o.x,u=o.y;n.startPoint={x:a,y:u},n.endPoint={x:a,y:u};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(t){t.preventDefault()},s.style.top="".concat(n.startPoint.y,"px"),s.style.left="".concat(n.startPoint.x,"px"),e.appendChild(s),n.wrapper=s,document.addEventListener("mousemove",n.draw),document.addEventListener("mouseup",n.drawOff)}}))},t.prototype.setSelectionSense=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.isWholeEdge=t,this.isWholeNode=e},t.prototype.openSelectionSelect=function(){this.lf.getEditConfig().stopMoveGraph||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},t.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),rg=function(){function t(t){var e=t.lf,n=t.LogicFlow,r=t.options,i=this;this.width=200,this.height=150,this.scale=1,this.translateX=0,this.translateY=0,this.showEdge=!1,this.viewPortTop=0,this.viewPortLeft=0,this.viewPortWidth=150,this.viewPortHeight=75,this.isShow=!1,this.isShowHeader=!1,this.isShowCloseIcon=!1,this.headerTitle="导航",this.disabledPlugins=["miniMap","control","selectionSelect"],this.render=function(t,e){i.container=e,i.lf.on("history:change",(function(){i.isShow&&i.setView()})),i.lf.on("graph:transform",(function(){i.isShow&&i.setView(!1)}))},this.show=function(t,e){i.isShow||(i.createMiniMap(t,e),i.setView()),i.isShow=!0},this.hide=function(){i.isShow&&(i.removeMiniMap(),i.lf.emit("miniMap:close",{})),i.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(i.leftPosition=t.left,i.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(i.topPosition=t.top,i.bottomPosition=t.bottom);else switch(t){case"left-top":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=0,i.bottomPosition=void 0;break;case"right-top":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=0,i.bottomPosition=void 0;break;case"left-bottom":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=void 0,i.bottomPosition=0;break;case"right-bottom":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=void 0,i.bottomPosition=0}i.updateMiniMapPosition()},this.reset=function(){i.lf.resetTranslate(),i.lf.resetZoom()},this.setShowEdge=function(t){i.showEdge!==t&&(i.showEdge=t,i.setView())},this.startDrag=function(t){document.addEventListener("mousemove",i.drag),document.addEventListener("mouseup",i.drop);var e=t.x,n=t.y;i.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,r=(e-i.startPosition.x)/i.scale,o=(n-i.startPosition.y)/i.scale,a=i.viewPortLeft+r+i.viewPortWidth/i.scale/2,u=i.viewPortTop+o+i.viewPortHeight/i.scale/2;i.startPosition={x:e,y:n},i.lf.focusOn({coordinate:{x:a,y:u}})},this.drop=function(){document.removeEventListener("mousemove",i.drag),document.removeEventListener("mouseup",i.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,r=i.translateX+e/i.scale,o=i.translateY+n/i.scale;i.lf.focusOn({coordinate:{x:r,y:o}})},this.lf=e,this.LFCtor=n,r&&r.MiniMap&&this.setOption(r.MiniMap),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var o={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=o,this.elementAreaBounds=o,this.viewPortBounds=o,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,r=t.height,i=void 0===r?220:r,o=t.showEdge,a=void 0!==o&&o,u=t.isShowHeader,s=void 0!==u&&u,l=t.isShowCloseIcon,c=void 0!==l&&l,d=t.leftPosition,h=t.topPosition,p=t.rightPosition,f=void 0===p?0:p,v=t.bottomPosition,g=void 0===v?0:v,y=t.headerTitle,m=void 0===y?"导航":y;this.width=n,this.height=i,this.showEdge=a,this.isShowHeader=s,this.isShowCloseIcon=c,this.leftPosition=d,this.rightPosition=void 0!==d?void 0:f,this.topPosition=h,this.bottomPosition=void 0!==h?void 0:g,this.headerTitle=m},t.prototype.initMiniMap=function(){var t=document.createElement("div");t.className="lf-mini-map-graph",t.style.width="".concat(this.width,"px"),t.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:t,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins}),this.miniMapWrap=t,this.createViewPort(),t.addEventListener("click",this.mapClick)},t.prototype.createMiniMap=function(t,e){var n,r=document.createElement("div");this.miniMapContainer=r,r.appendChild(this.miniMapWrap),r.style.position="absolute",void 0===t&&void 0===e||(this.leftPosition=t||0,this.topPosition=e||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),r.className="lf-mini-map",this.isShowCloseIcon||r.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||r.classList.add("lf-mini-map-no-header"),null===(n=this.container)||void 0===n||n.appendChild(r),this.miniMapWrap.appendChild(this.viewport);var i=document.createElement("div");i.className="lf-mini-map-header",i.innerText=this.headerTitle,r.appendChild(i);var o=document.createElement("span");o.className="lf-mini-map-close",o.addEventListener("click",this.hide),r.appendChild(o)},t.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var t=this.miniMapContainer.style;void 0!==this.rightPosition?(t.right="".concat(this.rightPosition,"px"),t.left=""):(t.left="".concat(this.leftPosition,"px"),t.right=""),void 0!==this.bottomPosition?(t.bottom="".concat(this.bottomPosition,"px"),t.top=""):(t.top="".concat(this.topPosition,"px"),t.bottom="")}},t.prototype.removeMiniMap=function(){var t;this.miniMapContainer&&(null===(t=this.container)||void 0===t||t.removeChild(this.miniMapContainer))},t.prototype.updateBounds=function(t){t&&this.updateElementAreaBounds(t),this.updateViewPortBounds(),this.bounds={left:Math.min(this.elementAreaBounds.left,this.viewPortBounds.left),right:Math.max(this.elementAreaBounds.right,this.viewPortBounds.right),top:Math.min(this.elementAreaBounds.top,this.viewPortBounds.top),bottom:Math.max(this.elementAreaBounds.bottom,this.viewPortBounds.bottom)}},t.prototype.updateElementAreaBounds=function(t){var e={left:0,right:0,top:0,bottom:0},n=t.nodes;n&&n.length>0&&n.forEach((function(t){var n,r,i=t.x,o=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,u=null!==(r=t.height)&&void 0!==r?r:200,s=i-a/2,l=i+a/2,c=o-u/2,d=o+u/2;e.left=Math.min(s,e.left),e.right=Math.max(l,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(d,e.bottom)})),this.elementAreaBounds=e},t.prototype.updateViewPortBounds=function(){var t=this.lf.getTransform(),e=t.TRANSLATE_X,n=t.TRANSLATE_Y,r=t.SCALE_X,i=t.SCALE_Y,o=this.lf.graphModel,a=o.width,u=o.height;this.viewPortBounds={left:-e/r,right:(-e+a)/r,top:-n/i,bottom:(-n+u)/i}},t.prototype.resetData=function(t){var e=t.nodes,n=t.edges;return e.forEach((function(t){t.text=void 0})),this.showEdge&&n.forEach((function(t){t.text=void 0})),{nodes:e,edges:this.showEdge?n:[]}},t.prototype.setView=function(t){var e,n;if(void 0===t&&(t=!0),t){var r=this.lf.getGraphRawData(),i=this.resetData(r),o=this.lf.viewMap,a=this.lf.graphModel.modelMap,u=this.lfMap.viewMap;try{for(var s=y(o.keys()),l=s.next();!l.done;l=s.next()){var c=l.value;u.has(c)||this.lfMap.register({type:c,view:o.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}this.lfMap.render(i),this.updateBounds(i)}else this.updateBounds();var d=this.bounds,h=d.left,p=d.top,f=d.right-h,v=d.bottom-p,g=this.width/f,m=this.height/v,b=Math.min(g,m);this.scale=b;var x=h-(this.width/b-f)/2,_=p-(this.height/b-v)/2;if(this.lfMap.graphModel.transformModel.translate(-x+this.translateX,-_+this.translateY),this.translateX=x,this.translateY=_,this.miniMapWrap.firstChild){var w=this.miniMapWrap.firstChild.style;w.pointerEvents="none",w.transform="matrix(".concat(b,", 0, 0, ").concat(b,", 0, 0)"),w.transformOrigin="left top",w.height="".concat(this.height/b,"px"),w.width="".concat(this.width/b,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,r=e.TRANSLATE_Y,i=e.SCALE_X,o=e.SCALE_Y,a=this.lf.graphModel,u=a.width,s=a.height;this.viewPortLeft=-n/i,this.viewPortTop=-r/o,this.viewPortWidth=u/i*this.scale,this.viewPortHeight=s/o*this.scale,t.width="".concat(this.viewPortWidth,"px"),t.height="".concat(this.viewPortHeight,"px"),t.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),t.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},t.prototype.createViewPort=function(){var t=document.createElement("div");t.className="lf-minimap-viewport",t.addEventListener("mousedown",this.startDrag),t.addEventListener("click",(function(t){t.stopPropagation()})),this.viewport=t},t.pluginName="miniMap",t}(),ig={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function og(t,e,n,r){var i,o="",a="";t[0]===e[0]?o=t[1]>e[1]?"t":"b":t[1]===e[1]&&(o=t[0]>e[0]?"l":"r"),e[0]===n[0]?a=e[1]>n[1]?"t":"b":e[1]===n[1]&&(a=e[0]>n[0]?"l":"r");var u=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||.2*r,s="".concat(o).concat(a),l=ig[s]||"-",c="L ".concat(t[0]," ").concat(t[1]);if("-"===l)c+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var d=m(function(t,e,n,r){var i=[t[0],t[1]],o=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(i[1]+=r,o[0]+=r):"lb"===e&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return"tl"===e?(i[1]+=r,o[0]-=r):"rb"===e&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return"br"===e?(i[1]-=r,o[0]+=r):"lt"===e&&(i[0]+=r,o[1]-=r),[i,o];case"br":return"bl"===e?(i[1]-=r,o[0]-=r):"rt"===e&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}(e,s,l,u),2),h=d[0],p=d[1];h&&p&&(c+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(p[0]," ").concat(p[1]),i=m(p,2),e[0]=i[0],e[1]=i[1])}return c}function ag(t,e){var n=0,r="";if(2===t.length)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){r+=og(t[n-1],t[n],t[1+n++],e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}var ug=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getEdge=function(){var t=this.props.model,n=t.points,r=t.isAnimation,i=t.arrowConfig,o=t.radius,a=void 0===o?5:o,u=t.getEdgeStyle(),s=t.getEdgeAnimationStyle(),l=function(t){for(var e=t,n=1;n<e.length-1;){var r=m(e[n-1],2),i=r[0],o=r[1],a=m(e[n],2),u=a[0],s=a[1],l=m(e[n+1],2),c=l[0],d=l[1];i===u&&u===c||o===s&&s===d?e.splice(n,1):n++}return e}(n.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),c=ag(l,a),d=v(v(v({style:r?s:{}},u),i),{fill:"none"});return e.h("path",v({d:c},d))},n}(e.PolylineEdge),sg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(e.PolylineEdgeModel),lg=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.paths=[],e.getPathes=function(){if(!n.startNodeType)throw new Error("需要预先指定开始节点类型");return n.getPathes()},e.setRawPaths=function(t){n.setPathes(t)},e.getRawPathes=function(){return n.paths},e.setStartNodeType=function(t){n.startNodeType=t}}return t.prototype.setPathes=function(t){this.paths=t.map((function(t){return{routeId:t.routeId,name:t.name,elements:t.elements,type:t.type,similarElement:null,weight:0}}))},t.prototype.getPathes=function(){var t=this,e=this.lf.getGraphRawData(),n=new Map,r=[];e.nodes.forEach((function(e){n.set(e.id,{id:e.id,data:e,nextNodes:[]}),e.type===t.startNodeType&&r.push(e.id)})),e.edges.forEach((function(t){var e=n.get(t.sourceNodeId);null==e||e.nextNodes.push(t.targetNodeId)}));var i=[];return r.forEach((function(e){var r=n.get(e);r&&(i=i.concat(t.findPathElements(r,n,[])))})),this.getNewPathes(i)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var r=b([],m(n),!1);if(r.push(t.id),0===t.nextNodes.length)return[r];for(var i=[],o=0;o<t.nextNodes.length;o++){var a=e.get(t.nextNodes[o]),u=void 0;if(a){var s=r.indexOf(a.id);u=-1!==s?[b(b([],m(r.slice(s)),!1),[a.id],!1)]:this.findPathElements(a,e,b([],m(r),!1)),i=i.concat(u)}}return i},t.prototype.getNewPathes=function(t){var e=this,n=[],r=new Set;t.forEach((function(t){console.log("elements",t);var i=e.getNewId("path"),o=e.getNewId("路径"),a=e.isLoopPath(t),u=t.join(",");r.has(u)||(r.add(u),n.push({routeId:i,name:o,elements:t,type:a,weight:0,similarElement:""}))}));var i=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<i.length;n++){var r=i[n],o=e.similar2Path(b([],m(t.elements),!1),b([],m(r.elements),!1));o>t.weight&&r.weight<=o&&(t.weight=o,t.similarElement=r,o===r.weight&&r.similarElement?(r.similarElement.similarElement=null,r.similarElement.weight=0,r.similarElement=null,r.weight=0):(r.similarElement=t,r.weight=o))}})),n.forEach((function(t){t.similarElement&&t.similarElement.similarElement===t&&(t.routeId=t.similarElement.routeId,t.name=t.similarElement.name),delete t.similarElement,delete t.weight})),this.setPathes(n),n},t.prototype.similar2Path=function(t,e){var n=0,r=t.length+e.length;t.sort(),e.sort();for(var i=t.shift(),o=e.shift();void 0!==i&&void 0!==o;)i===o?(n++,i=t.shift(),o=e.shift()):i<o?i=t.shift():i>o&&(o=e.shift());return n/r*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(w())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),cg=-1,dg=0,hg=1,pg=function(){function t(t){var e=t.lf,n=this;this.levelHeight=[],this.newNodeMap=new Map,this.lf=e,this.trunk=[],e.layout=function(t){var e=n.lf.getGraphRawData();n.lf.setStartNodeType(t);var r=n.lf.getPathes();return n.levelHeight=[],n.newNodeMap=new Map,n.layout(e,r)}}return t.prototype.layout=function(t,e){var n=this,r=[];e.forEach((function(t){var e=t.elements;e.length>r.length?r=e:e.length===r.length&&JSON.stringify(e)===JSON.stringify(n.trunk)&&(r=n.trunk)})),this.trunk=r;for(var i=this.formatData(t),o={nodes:[],edges:[]},a=r.length-1;a>=0;a--)this.setNodePosition(r[a],i,o,a,1);this.lf.graphModel.graphDataToModel(o)},t.prototype.setNodePosition=function(t,e,n,r,i){var o=this,a=e[t],u=a.text,s=a.type,l=a.next,c=a.properties,d=160*r+40,h=120*i,p={id:t,x:d,text:u,y:h,type:s,properties:c};return u&&"object"==typeof u&&(p.text=v(v({},u),{x:d+u.x,y:h+u.y})),this.newNodeMap.set(p.id,{x:p.x,y:p.y,type:s}),n.nodes.push(p),a.isFixed=!0,this.addLevelHeight(r,1),l&&l.length>0&&l.forEach((function(i){if(!e[i.nodeId].isFixed){var a=o.getLevelHeight(r+1);o.addLevelHeight(r,1),o.setNodePosition(i.nodeId,e,n,r+1,a+1)}n.edges.push(v({id:i.edgeId,type:i.edgeType,sourceNodeId:t,targetNodeId:i.nodeId,properties:i.properties,text:i.text},o.getEdgeDataPoints(t,i.nodeId)))})),p},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),r=this.newNodeMap.get(e),i=this.getShape(t),o=i.width,a=i.height,u=this.getShape(e),s=u.width,l=u.height,c=this.getRelativePosition(n,r),d={x:n.x,y:n.y},h={x:r.x,y:r.y};switch(c){case dg:d.x=n.x+o/2,h.x=r.x-s/2;break;case cg:d.y=n.y+a/2,h.x=r.x-s/2;break;case hg:d.x=n.x+o/2,h.y=r.y+l/2}return{startPoint:d,endPoint:h}},t.prototype.getRelativePosition=function(t,e){var n=t.y,r=e.y;return n<r?-1:n===r?0:1},t.prototype.getShape=function(t){var e,n,r=this.lf.getNodeModelById(t);return{height:null!==(e=null==r?void 0:r.height)&&void 0!==e?e:0,width:null!==(n=null==r?void 0:r.width)&&void 0!==n?n:0}},t.prototype.formatData=function(t){var e=t.nodes.reduce((function(t,e){var n=e.type,r=e.properties,i=e.text,o=e.x,a=e.y;return i&&"object"==typeof i&&(i.x=i.x-o,i.y=i.y-a),t[e.id]={type:n,properties:r,text:i,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,r=t.targetNodeId,i=t.id,o=t.properties,a=t.text,u=a;"object"==typeof a&&(u=a.value),e[n].next.push({edgeId:i,nodeId:r,edgeType:t.type,properties:o,text:u}),e[r].prev.push({edgeId:i,nodeId:n,properties:o,text:u})})),e},t.prototype.addLevelHeight=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var r=this.levelHeight[t];r||(r={positiveHeight:0,negativeHeight:0},this.levelHeight[t]=r),n?r.negativeHeight-=e:r.positiveHeight+=e},t.prototype.getLevelHeight=function(t,e){void 0===e&&(e=!1);var n=this.levelHeight[t];return n?e?n.negativeHeight:n.positiveHeight:0},t.pluginName="AutoLayout",t}(),fg=function(t,e){var n=[],r=[],i=function(t,r,o){o&&r.unshift.apply(r,b([],m(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==o?void 0:o.id}).map((function(t){return t.id}))),!1)),r.includes(t.id)?n.push(r):(r.unshift(t.id),t.incoming.nodes.length?t.incoming.nodes.forEach((function(e){i(e,r.slice(),t)})):n.push(r))},o=function(t,n,i){i&&n.push.apply(n,b([],m(e.getEdgeModels({sourceNodeId:null==i?void 0:i.id,targetNodeId:t.id}).map((function(t){return t.id}))),!1)),n.includes(t.id)?r.push(n):(n.push(t.id),t.outgoing.nodes.length?t.outgoing.nodes.forEach((function(e){o(e,n.slice(),t)})):r.push(n))};return i(t,[]),o(t,[]),b([],m(new Set(b(b([],m(n.flat()),!1),m(r.flat()),!1))),!1)},vg=function(){function t(t){var e=t.lf;this.mode="path",this.manual=!1,this.tempStyles={},this.lf=e}return t.prototype.setMode=function(t){this.mode=t},t.prototype.setManual=function(t){this.manual=t},t.prototype.highlightSingle=function(t){var e=this.lf.getModelById(t);"node"===(null==e?void 0:e.BaseType)?e.updateStyles(this.tempStyles[t]):"edge"===(null==e?void 0:e.BaseType)&&(e.updateStyles(this.tempStyles[t]),e.sourceNode.updateStyles(this.tempStyles[e.sourceNode.id]),e.targetNode.updateStyles(this.tempStyles[e.targetNode.id]))},t.prototype.highlightPath=function(t){var e=this,n=function(t,e){var n=e.getModelById(t);return fg("node"===(null==n?void 0:n.BaseType)?n:null==n?void 0:n.targetNode,e)}(t,this.lf);n.forEach((function(t){var n;null===(n=e.lf.getModelById(t))||void 0===n||n.updateStyles(e.tempStyles[t])}))},t.prototype.highlight=function(t,e){var n=this;(void 0===e&&(e=this.mode),this.manual)||(Object.keys(this.tempStyles).length&&this.restoreHighlight(),Object.values(this.lf.graphModel.modelsMap).forEach((function(t){var e="node"===t.BaseType?t.getNodeStyle():t.getEdgeStyle();n.tempStyles[t.id]=v({},e),t.setStyles({opacity:.1})})),{single:this.highlightSingle.bind(this),path:this.highlightPath.bind(this)}[e](t))},t.prototype.restoreHighlight=function(){var t=this;Object.keys(this.tempStyles).length&&(Object.values(this.lf.graphModel.modelsMap).forEach((function(e){var n,r=null!==(n=t.tempStyles[e.id])&&void 0!==n?n:{};e.updateStyles(v({},r))})),this.tempStyles={})},t.prototype.render=function(){var t=this;this.lf.on("node:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("edge:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("node:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("edge:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("history:change",this.restoreHighlight.bind(this))},t.prototype.destroy=function(){},t.pluginName="highlight",t}();t.AutoLayout=pg,t.BPMNAdapter=Rv,t.BPMNBaseAdapter=jv,t.BPMNElements=Yf,t.BoundaryEventFactory=yt,t.BpmnAdapter=ut,t.BpmnElement=F,t.BpmnXmlAdapter=st,t.ContextMenu=tg,t.Control=Yv,t.CurvedEdge=ug,t.CurvedEdgeModel=sg,t.DiamondResize=Pf,t.DiamondResizeModel=Sf,t.DiamondResizeView=Af,t.DndPanel=eg,t.EllipseResize=Nf,t.EllipseResizeModel=Mf,t.EllipseResizeView=Ef,t.EndEventFactory=ft,t.EndEventModel=S,t.EndEventView=A,t.ExclusiveGatewayModel=k,t.ExclusiveGatewayView=j,t.FlowPath=lg,t.GatewayNodeFactory=Tt,t.Group=Wf,t.GroupNode=Lf,t.GroupNodeModel=Df,t.Highlight=vg,t.HtmlResize=Cf,t.HtmlResizeModel=Of,t.HtmlResizeView=Tf,t.InsertNodeInPolyline=Vv,t.IntermediateCatchEventFactory=vt,t.IntermediateThrowEventFactory=mt,t.Menu=Jv,t.MiniMap=rg,t.NodeResize=Rf,t.RectResize=If,t.RectResizeModel=kf,t.RectResizeView=jf,t.SelectionSelect=ng,t.SequenceFlowModel=O,t.SequenceFlowView=T,t.ServiceTaskModel=R,t.ServiceTaskView=D,t.Snapshot=Dv,t.StartEventFactory=gt,t.StartEventModel=M,t.StartEventView=E,t.SubProcessFactory=Ff,t.TaskNodeFactory=kt,t.UserTaskModel=B,t.UserTaskView=z,t.bpmnUtils=pt,t.convertNormalToXml=Sv,t.convertXmlToNormal=Av,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=ag,t.handleAttributes=V,t.icons=Ot,t.lfJson2Xml=Z,t.lfXml2Json=J,t.multiInstanceIcon=Ct,t.sequenceFlowFactory=Hf,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===Lv.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,r=t.properties,i=t.key,o=t.type,a=r.text,u=r.name,s=r.startPoint,l=r.endPoint,c=r.pointsList,d={id:i,type:Bv[o],sourceNodeId:e[0],targetNodeId:n[0],text:a||u,properties:{}};s&&(d.startPoint=JSON.parse(s)),l&&(d.endPoint=JSON.parse(l)),c&&(d.pointsList=JSON.parse(c));var h=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===h.indexOf(e)&&(d.properties[e]=t.properties[e])})),d}(t);e.edges.push(n)}else{var r=function(t){var e=t.properties,n=t.key,r=t.type,i=t.bounds,o=e.x,a=e.y,u=e.text;if(void 0===o){var s=m(i,2),l=s[0],c=l.x,d=l.y,h=s[1];o=(c+h.x)/2,a=(d+h.y)/2}var p={id:n,type:Bv[r],x:o,y:a,text:u,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(p.properties[e]=t.properties[e])})),p}(t);e.nodes.push(r)}})),e},t.toNormalJson=nt,t.toTurboData=function(t){var e=new Map,n={flowElementList:[]};return t.nodes.forEach((function(t){var r=function(t){var e=t.id,n=t.type,r=t.x,i=t.y,o=t.text,a=void 0===o?"":o,u=t.properties;return{incoming:[],outgoing:[],dockers:[],type:zv(n),properties:v(v({},u),{name:a&&a.value||"",x:r,y:i,text:a}),key:e}}(t);n.flowElementList.push(r),e.set(t.id,r)})),t.edges.forEach((function(t){var r=function(t){var e=t.id,n=t.type,r=t.sourceNodeId,i=t.targetNodeId,o=t.startPoint,a=t.endPoint,u=t.pointsList,s=t.text,l=void 0===s?"":s,c=t.properties;return{incoming:[r],outgoing:[i],type:zv(n),dockers:[],properties:v(v({},c),{name:l&&l.value||"",text:l,startPoint:JSON.stringify(o),endPoint:JSON.stringify(a),pointsList:JSON.stringify(u)}),key:e}}(t);e.get(t.sourceNodeId).outgoing.push(r.key),e.get(t.targetNodeId).incoming.push(r.key),n.flowElementList.push(r)})),n},t.toXmlJson=et,t.useDefinition=Vf}));
11
+ var lf,cf,df=4294967295,hf=Array.prototype,pf=Object.prototype.hasOwnProperty,ff=Dt?Dt.iterator:void 0,vf=Math.max,gf=Math.min,yf=function(t){return function(e,n,r){if(null==r){var i=le(n),o=i&&ni(n),a=o&&o.length&&Jl(n,o);(a?a.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}}(ld);cn.after=Zp.after,cn.ary=Zp.ary,cn.assign=ef.assign,cn.assignIn=ef.assignIn,cn.assignInWith=ef.assignInWith,cn.assignWith=ef.assignWith,cn.at=ef.at,cn.before=Zp.before,cn.bind=Zp.bind,cn.bindAll=of.bindAll,cn.bindKey=Zp.bindKey,cn.castArray=Kp.castArray,cn.chain=nf.chain,cn.chunk=Vp.chunk,cn.compact=Vp.compact,cn.concat=Vp.concat,cn.cond=of.cond,cn.conforms=of.conforms,cn.constant=of.constant,cn.countBy=Yp.countBy,cn.create=ef.create,cn.curry=Zp.curry,cn.curryRight=Zp.curryRight,cn.debounce=Zp.debounce,cn.defaults=ef.defaults,cn.defaultsDeep=ef.defaultsDeep,cn.defer=Zp.defer,cn.delay=Zp.delay,cn.difference=Vp.difference,cn.differenceBy=Vp.differenceBy,cn.differenceWith=Vp.differenceWith,cn.drop=Vp.drop,cn.dropRight=Vp.dropRight,cn.dropRightWhile=Vp.dropRightWhile,cn.dropWhile=Vp.dropWhile,cn.fill=Vp.fill,cn.filter=Yp.filter,cn.flatMap=Yp.flatMap,cn.flatMapDeep=Yp.flatMapDeep,cn.flatMapDepth=Yp.flatMapDepth,cn.flatten=Vp.flatten,cn.flattenDeep=Vp.flattenDeep,cn.flattenDepth=Vp.flattenDepth,cn.flip=Zp.flip,cn.flow=of.flow,cn.flowRight=of.flowRight,cn.fromPairs=Vp.fromPairs,cn.functions=ef.functions,cn.functionsIn=ef.functionsIn,cn.groupBy=Yp.groupBy,cn.initial=Vp.initial,cn.intersection=Vp.intersection,cn.intersectionBy=Vp.intersectionBy,cn.intersectionWith=Vp.intersectionWith,cn.invert=ef.invert,cn.invertBy=ef.invertBy,cn.invokeMap=Yp.invokeMap,cn.iteratee=of.iteratee,cn.keyBy=Yp.keyBy,cn.keys=ni,cn.keysIn=ef.keysIn,cn.map=Yp.map,cn.mapKeys=ef.mapKeys,cn.mapValues=ef.mapValues,cn.matches=of.matches,cn.matchesProperty=of.matchesProperty,cn.memoize=Zp.memoize,cn.merge=ef.merge,cn.mergeWith=ef.mergeWith,cn.method=of.method,cn.methodOf=of.methodOf,cn.mixin=yf,cn.negate=hd,cn.nthArg=of.nthArg,cn.omit=ef.omit,cn.omitBy=ef.omitBy,cn.once=Zp.once,cn.orderBy=Yp.orderBy,cn.over=of.over,cn.overArgs=Zp.overArgs,cn.overEvery=of.overEvery,cn.overSome=of.overSome,cn.partial=Zp.partial,cn.partialRight=Zp.partialRight,cn.partition=Yp.partition,cn.pick=ef.pick,cn.pickBy=ef.pickBy,cn.property=of.property,cn.propertyOf=of.propertyOf,cn.pull=Vp.pull,cn.pullAll=Vp.pullAll,cn.pullAllBy=Vp.pullAllBy,cn.pullAllWith=Vp.pullAllWith,cn.pullAt=Vp.pullAt,cn.range=of.range,cn.rangeRight=of.rangeRight,cn.rearg=Zp.rearg,cn.reject=Yp.reject,cn.remove=Vp.remove,cn.rest=Zp.rest,cn.reverse=Vp.reverse,cn.sampleSize=Yp.sampleSize,cn.set=ef.set,cn.setWith=ef.setWith,cn.shuffle=Yp.shuffle,cn.slice=Vp.slice,cn.sortBy=Yp.sortBy,cn.sortedUniq=Vp.sortedUniq,cn.sortedUniqBy=Vp.sortedUniqBy,cn.split=rf.split,cn.spread=Zp.spread,cn.tail=Vp.tail,cn.take=Vp.take,cn.takeRight=Vp.takeRight,cn.takeRightWhile=Vp.takeRightWhile,cn.takeWhile=Vp.takeWhile,cn.tap=nf.tap,cn.throttle=Zp.throttle,cn.thru=hp,cn.toArray=Kp.toArray,cn.toPairs=ef.toPairs,cn.toPairsIn=ef.toPairsIn,cn.toPath=of.toPath,cn.toPlainObject=Kp.toPlainObject,cn.transform=ef.transform,cn.unary=Zp.unary,cn.union=Vp.union,cn.unionBy=Vp.unionBy,cn.unionWith=Vp.unionWith,cn.uniq=Vp.uniq,cn.uniqBy=Vp.uniqBy,cn.uniqWith=Vp.uniqWith,cn.unset=ef.unset,cn.unzip=Vp.unzip,cn.unzipWith=Vp.unzipWith,cn.update=ef.update,cn.updateWith=ef.updateWith,cn.values=ef.values,cn.valuesIn=ef.valuesIn,cn.without=Vp.without,cn.words=rf.words,cn.wrap=Zp.wrap,cn.xor=Vp.xor,cn.xorBy=Vp.xorBy,cn.xorWith=Vp.xorWith,cn.zip=Vp.zip,cn.zipObject=Vp.zipObject,cn.zipObjectDeep=Vp.zipObjectDeep,cn.zipWith=Vp.zipWith,cn.entries=ef.toPairs,cn.entriesIn=ef.toPairsIn,cn.extend=ef.assignIn,cn.extendWith=ef.assignInWith,yf(cn,cn),cn.add=$p.add,cn.attempt=of.attempt,cn.camelCase=rf.camelCase,cn.capitalize=rf.capitalize,cn.ceil=$p.ceil,cn.clamp=Jp,cn.clone=Kp.clone,cn.cloneDeep=Kp.cloneDeep,cn.cloneDeepWith=Kp.cloneDeepWith,cn.cloneWith=Kp.cloneWith,cn.conformsTo=Kp.conformsTo,cn.deburr=rf.deburr,cn.defaultTo=of.defaultTo,cn.divide=$p.divide,cn.endsWith=rf.endsWith,cn.eq=Kp.eq,cn.escape=rf.escape,cn.escapeRegExp=rf.escapeRegExp,cn.every=Yp.every,cn.find=Yp.find,cn.findIndex=Vp.findIndex,cn.findKey=ef.findKey,cn.findLast=Yp.findLast,cn.findLastIndex=Vp.findLastIndex,cn.findLastKey=ef.findLastKey,cn.floor=$p.floor,cn.forEach=Yp.forEach,cn.forEachRight=Yp.forEachRight,cn.forIn=ef.forIn,cn.forInRight=ef.forInRight,cn.forOwn=ef.forOwn,cn.forOwnRight=ef.forOwnRight,cn.get=ef.get,cn.gt=Kp.gt,cn.gte=Kp.gte,cn.has=ef.has,cn.hasIn=ef.hasIn,cn.head=Vp.head,cn.identity=xe,cn.includes=Yp.includes,cn.indexOf=Vp.indexOf,cn.inRange=Qp,cn.invoke=ef.invoke,cn.isArguments=Kp.isArguments,cn.isArray=Jt,cn.isArrayBuffer=Kp.isArrayBuffer,cn.isArrayLike=Kp.isArrayLike,cn.isArrayLikeObject=Kp.isArrayLikeObject,cn.isBoolean=Kp.isBoolean,cn.isBuffer=Kp.isBuffer,cn.isDate=Kp.isDate,cn.isElement=Kp.isElement,cn.isEmpty=Kp.isEmpty,cn.isEqual=Kp.isEqual,cn.isEqualWith=Kp.isEqualWith,cn.isError=Kp.isError,cn.isFinite=Kp.isFinite,cn.isFunction=Kp.isFunction,cn.isInteger=Kp.isInteger,cn.isLength=Kp.isLength,cn.isMap=Kp.isMap,cn.isMatch=Kp.isMatch,cn.isMatchWith=Kp.isMatchWith,cn.isNaN=Kp.isNaN,cn.isNative=Kp.isNative,cn.isNil=Kp.isNil,cn.isNull=Kp.isNull,cn.isNumber=Kp.isNumber,cn.isObject=le,cn.isObjectLike=Kp.isObjectLike,cn.isPlainObject=Kp.isPlainObject,cn.isRegExp=Kp.isRegExp,cn.isSafeInteger=Kp.isSafeInteger,cn.isSet=Kp.isSet,cn.isString=Kp.isString,cn.isSymbol=Kp.isSymbol,cn.isTypedArray=Kp.isTypedArray,cn.isUndefined=Kp.isUndefined,cn.isWeakMap=Kp.isWeakMap,cn.isWeakSet=Kp.isWeakSet,cn.join=Vp.join,cn.kebabCase=rf.kebabCase,cn.last=cl,cn.lastIndexOf=Vp.lastIndexOf,cn.lowerCase=rf.lowerCase,cn.lowerFirst=rf.lowerFirst,cn.lt=Kp.lt,cn.lte=Kp.lte,cn.max=$p.max,cn.maxBy=$p.maxBy,cn.mean=$p.mean,cn.meanBy=$p.meanBy,cn.min=$p.min,cn.minBy=$p.minBy,cn.stubArray=of.stubArray,cn.stubFalse=of.stubFalse,cn.stubObject=of.stubObject,cn.stubString=of.stubString,cn.stubTrue=of.stubTrue,cn.multiply=$p.multiply,cn.nth=Vp.nth,cn.noop=of.noop,cn.now=qp,cn.pad=rf.pad,cn.padEnd=rf.padEnd,cn.padStart=rf.padStart,cn.parseInt=rf.parseInt,cn.random=tf,cn.reduce=Yp.reduce,cn.reduceRight=Yp.reduceRight,cn.repeat=rf.repeat,cn.replace=rf.replace,cn.result=ef.result,cn.round=$p.round,cn.sample=Yp.sample,cn.size=Yp.size,cn.snakeCase=rf.snakeCase,cn.some=Yp.some,cn.sortedIndex=Vp.sortedIndex,cn.sortedIndexBy=Vp.sortedIndexBy,cn.sortedIndexOf=Vp.sortedIndexOf,cn.sortedLastIndex=Vp.sortedLastIndex,cn.sortedLastIndexBy=Vp.sortedLastIndexBy,cn.sortedLastIndexOf=Vp.sortedLastIndexOf,cn.startCase=rf.startCase,cn.startsWith=rf.startsWith,cn.subtract=$p.subtract,cn.sum=$p.sum,cn.sumBy=$p.sumBy,cn.template=rf.template,cn.times=of.times,cn.toFinite=Kp.toFinite,cn.toInteger=be,cn.toLength=Kp.toLength,cn.toLower=rf.toLower,cn.toNumber=Kp.toNumber,cn.toSafeInteger=Kp.toSafeInteger,cn.toString=Kp.toString,cn.toUpper=rf.toUpper,cn.trim=rf.trim,cn.trimEnd=rf.trimEnd,cn.trimStart=rf.trimStart,cn.truncate=rf.truncate,cn.unescape=rf.unescape,cn.uniqueId=of.uniqueId,cn.upperCase=rf.upperCase,cn.upperFirst=rf.upperFirst,cn.each=Yp.forEach,cn.eachRight=Yp.forEachRight,cn.first=Vp.head,yf(cn,(lf={},ks(cn,(function(t,e){pf.call(cn.prototype,e)||(lf[e]=t)})),lf),{chain:!1}),cn.VERSION="4.17.21",(cn.templateSettings=rf.templateSettings).imports._=cn,wn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){cn[t].placeholder=cn})),wn(["drop","take"],(function(t,e){Qe.prototype[t]=function(n){n=void 0===n?1:vf(be(n),0);var r=this.__filtered__&&!e?new Qe(this):this.clone();return r.__filtered__?r.__takeCount__=gf(n,r.__takeCount__):r.__views__.push({size:gf(n,df),type:t+(r.__dir__<0?"Right":"")}),r},Qe.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),wn(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Qe.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:As(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),wn(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Qe.prototype[t]=function(){return this[n](1).value()[0]}})),wn(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Qe.prototype[t]=function(){return this.__filtered__?new Qe(this):this[n](1)}})),Qe.prototype.compact=function(){return this.filter(xe)},Qe.prototype.find=function(t){return this.filter(t).head()},Qe.prototype.findLast=function(t){return this.reverse().find(t)},Qe.prototype.invokeMap=Mr((function(t,e){return"function"==typeof t?new Qe(this):this.map((function(n){return Tc(n,t,e)}))})),Qe.prototype.reject=function(t){return this.filter(hd(As(t)))},Qe.prototype.slice=function(t,e){t=be(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Qe(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=be(e))<0?n.dropRight(-e):n.take(e-t)),n)},Qe.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Qe.prototype.toArray=function(){return this.take(df)},ks(Qe.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=cn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(cn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,u=e instanceof Qe,s=a[0],l=u||Jt(e),c=function(t){var e=i.apply(cn,Di([t],a));return r&&d?e[0]:e};l&&n&&"function"==typeof s&&1!=s.length&&(u=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,f=u&&!h;if(!o&&l){e=f?e:new Qe(this);var v=t.apply(e,a);return v.__actions__.push({func:hp,args:[c],thisArg:void 0}),new an(v,d)}return p&&f?t.apply(this,a):(v=this.thru(c),p?r?v.value()[0]:v.value():v)})})),wn(["pop","push","shift","sort","splice","unshift"],(function(t){var e=hf[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);cn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Jt(i)?i:[],t)}return this[n]((function(n){return e.apply(Jt(n)?n:[],t)}))}})),ks(Qe.prototype,(function(t,e){var n=cn[e];if(n){var r=n.name+"";pf.call(nn,r)||(nn[r]=[]),nn[r].push({name:e,func:n})}})),nn[Zn(void 0,2).name]=[{name:"wrapper",func:void 0}],Qe.prototype.clone=function(){var t=new Qe(this.__wrapped__);return t.__actions__=un(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=un(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=un(this.__views__),t},Qe.prototype.reverse=function(){if(this.__filtered__){var t=new Qe(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Qe.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Jt(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=uf(e,t+a);break;case"takeRight":t=af(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,u=o.end,s=u-a,l=r?u:a-1,c=this.__iteratees__,d=c.length,h=0,p=sf(s,this.__takeCount__);if(!n||!r&&i==s&&p==s)return vp(t,this.__actions__);var f=[];t:for(;s--&&h<p;){for(var v=-1,g=t[l+=e];++v<d;){var y=c[v],m=y.iteratee,b=y.type,x=m(g);if(2==b)g=x;else if(!x){if(1==b)continue t;break t}}f[h++]=g}return f},cn.prototype.at=nf.at,cn.prototype.chain=nf.wrapperChain,cn.prototype.commit=nf.commit,cn.prototype.next=nf.next,cn.prototype.plant=nf.plant,cn.prototype.reverse=nf.reverse,cn.prototype.toJSON=cn.prototype.valueOf=cn.prototype.value=nf.value,cn.prototype.first=cn.prototype.head,ff&&(cn.prototype[ff]=nf.toIterator),cf={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},"function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout;var mf=0;function bf(t,e,n,r,i,o){e||(e={});var a,u,s=e;if("ref"in s)for(u in s={},e)"ref"==u?a=e[u]:s[u]=e[u];var l={type:t,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mf,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof t&&(a=t.defaultProps))for(u in a)void 0===s[u]&&(s[u]=a[u]);return cf.vnode&&cf.vnode(l),l}var xf=e.LogicFlowUtil.StepDrag,_f=function(t){function n(n){var r=t.call(this)||this;return r.updatePosition=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.x,a=i.y;r.nodeModel.x=o+e/2,r.nodeModel.y=a+n/2,r.nodeModel.moveText(e/2,n/2)},r.getResize=function(t){var e=t.index,n=t.deltaX,r=t.deltaY,i=t.width,o=t.height,a=t.PCTResizeInfo,u=t.pct,s=void 0===u?1:u,l=t.freezeWidth,c=void 0!==l&&l,d=t.freezeHeight,h=void 0!==d&&d,p={width:i,height:o,deltaX:n,deltaY:r};if(a){var f=0,v=0;switch(e){case 0:v=(-1*n-r)/4;break;case 1:v=(n-r)/4;break;case 2:v=(n+r)/4;break;case 3:v=(-1*n+r)/4}0!==v&&(f=Math.round(v/a.ResizeBasis.basisHeight*1e5)/1e3),a.ResizePCT.widthPCT=Math.max(Math.min(a.ResizePCT.widthPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit),a.ResizePCT.heightPCT=Math.max(Math.min(a.ResizePCT.heightPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit);var g=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),y=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=i-g,r=o-y;break;case 1:n=g-i,r=o-y;break;case 2:n=g-i,r=y-o;break;case 3:n=i-g,r=y-o}return p.width=g,p.height=y,p.deltaX=n/s,p.deltaY=r/s,p}switch(e){case 0:p.width=c?i:i-n*s,p.height=h?o:o-r*s;break;case 1:p.width=c?i:i+n*s,p.height=h?o:o-r*s;break;case 2:p.width=c?i:i+n*s,p.height=h?o:o+r*s;break;case 3:p.width=c?i:i-n*s,p.height=h?o:o+r*s}return p},r.updateEdgePointByAnchors=function(){var t=r.nodeModel,e=t.id,n=t.anchors,i=r.getNodeEdges(e);i.sourceEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),i.targetEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},r.updateRect=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.x,a=i.y,u=i.width,s=i.height,l=i.radius,c=i.PCTResizeInfo,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,g=r.index,y=h===f,m=p===v,b=r.getResize({index:g,deltaX:e,deltaY:n,width:u,height:s,PCTResizeInfo:c,pct:1,freezeWidth:y,freezeHeight:m});if(b.width<h||b.width>f||b.height<p||b.height>v)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:y?0:b.deltaX,deltaY:m?0:b.deltaY}),r.nodeModel.width=b.width,r.nodeModel.height=b.height,r.nodeModel.setProperties({nodeSize:{width:b.width,height:b.height}});var x={x:o,y:a,width:u,height:s,radius:l},_={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:l};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:x,afterNode:_})}},r.updateEllipse=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.rx,a=i.ry,u=i.x,s=i.y,l=i.PCTResizeInfo,c=r.index,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,g=d.maxHeight,y=h===f,m=p===g,b=o,x=a,_=r.getResize({index:c,deltaX:e,deltaY:n,width:b,height:x,PCTResizeInfo:l,pct:.5,freezeWidth:y,freezeHeight:m});if(_.width<h/2||_.width>f/2||_.height<p/2||_.height>g/2)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:y?0:_.deltaX,deltaY:m?0:_.deltaY}),r.nodeModel.rx=_.width,r.nodeModel.ry=_.height,r.nodeModel.setProperties({nodeSize:{rx:_.width,ry:_.height}});var w={x:u,y:s},M={rx:_.width,ry:_.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:v(v({},w),{rx:o,ry:a}),afterNode:M})}},r.updateDiamond=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.rx,a=i.ry,u=i.x,s=i.y,l=i.PCTResizeInfo,c=r.index,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,g=h===f,y=p===v,m=o,b=a,x=r.getResize({index:c,deltaX:e,deltaY:n,width:m,height:b,PCTResizeInfo:l,pct:.5,freezeWidth:g,freezeHeight:y});if(x.width<h/2||x.width>f/2||x.height<p/2||x.height>v/2)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:g?0:x.deltaX,deltaY:y?0:x.deltaY}),r.nodeModel.rx=x.width,r.nodeModel.ry=x.height,r.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var _={x:u,y:s,rx:o,ry:a},w={rx:x.width,ry:x.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:_,afterNode:w})}},r.eventEmit=function(t){var e=t.beforeNode,n=t.afterNode,i=r.nodeModel,o=i.id,a=i.modelType,u=i.type,s=v({id:o,modelType:a,type:u},e),l=v({id:o,modelType:a,type:u},n);r.graphModel.eventCenter.emit("node:resize",{oldNodeSize:s,newNodeSize:l})},r.onDragging=function(t){var n,i=t.deltaX,o=t.deltaY,a=r.graphModel.transformModel,u=r.nodeModel.modelType;i=(n=m(a.fixDeltaXY(i,o),2))[0],o=n[1],u===e.ModelType.RECT_NODE||u===e.ModelType.HTML_NODE?r.updateRect({deltaX:i,deltaY:o}):u===e.ModelType.ELLIPSE_NODE?r.updateEllipse({deltaX:i,deltaY:o}):u===e.ModelType.DIAMOND_NODE&&r.updateDiamond({deltaX:i,deltaY:o})},r.onDragEnd=function(){var t=r.graphModel.gridSize,e=void 0===t?1:t,n=e*Math.round(r.nodeModel.x/e),i=e*Math.round(r.nodeModel.y/e);r.nodeModel.moveTo(n,i),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new xf({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return f(n,t),n.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],r=[],i=0;i<e.length;i++){var o=e[i];o.sourceNodeId===t?n.push(o):e[i].targetNodeId===t&&r.push(o)}return{sourceEdges:n,targetEdges:r}},n.prototype.render=function(){var t=this.props,n=t.x,r=t.y,i=t.index,o=t.model.getControlPointStyle();return bf("g",{className:"lf-resize-control-".concat(i),children:bf(e.Rect,v({className:"lf-node-control",x:n,y:r},o,{onMouseDown:this.dragHandler.handleMouseDown}))})},n}(e.Component),wf=function(t){function n(){var e=t.call(this)||this;return e.state={},e}return f(n,t),n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.x,i=e.y,o=e.width,a=e.height,u={minX:r-o/2,minY:i-a/2,maxX:r+o/2,maxY:i+a/2},s=u.minX,l=u.minY,c=u.maxX,d=u.maxY;return[{x:s,y:l},{x:c,y:l},{x:c,y:d},{x:s,y:d}].map((function(t,r){return bf(_f,v({index:r},t,{model:e,graphModel:n}))}))},n.prototype.getGroupSolid=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getResizeOutlineStyle();return bf(e.Rect,v({},a,{x:n,y:r,width:i,height:o}))},n.prototype.render=function(){return bf("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},n}(e.Component),Mf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.EllipseNodeModel),Ef=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(e.EllipseNode),Nf={type:"ellipse",view:Ef,model:Mf},Sf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.DiamondNodeModel),Af=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.points,r=t.getNodeStyle();return bf("g",{children:bf(e.Polygon,v({},r,{points:n}))})},n.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},n}(e.DiamondNode),Pf={type:"diamond",view:Af,model:Sf},Of=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.HtmlNodeModel),Tf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.HtmlNode),Cf={type:"html",view:Tf,model:Of},kf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.RectNodeModel),jf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.RectNode),If={type:"rect",view:jf,model:kf},Rf={pluginName:"nodeResize",step:0,install:function(t){t.register(Nf),t.register(Pf),t.register(Cf),t.register(If)}},Df=function(t){function e(){var e=t.apply(this,b([],m(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return f(e,t),e.prototype.initNodeData=function(e){var n=this;t.prototype.initNodeData.call(this,e);var r=[];Array.isArray(e.children)&&(r=e.children),this.children=new Set(r),this.width=500,this.height=300,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=-1e4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,void 0===this.properties.isFolded&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout((function(){n.isFolded&&n.foldGroup(n.isFolded)}))},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.foldGroup=function(t){var e=this;if(t!==this.isFolded){this.setProperty("isFolded",t),this.isFolded=t,t?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var n=b(b([],m(this.incoming.edges),!1),m(this.outgoing.edges),!1);this.children.forEach((function(r){var i=e.graphModel.getElement(r);if(i){var o=i.isFolded;if(i.isGroup&&!i.isFolded&&i.foldGroup(t),i.isGroup&&!t){var a=e.childrenLastFoldStatus[r];void 0!==a&&a!==i.isFolded&&i.foldGroup(a)}e.childrenLastFoldStatus[r]=!!o,i.visible=!t;var u=i.incoming.edges,s=i.outgoing.edges;n=b(b(b([],m(n),!1),m(u),!1),m(s),!1)}})),this.foldEdge(t,n)}},e.prototype.getAnchorStyle=function(e){var n=t.prototype.getAnchorStyle.call(this,e);return n.stroke="transparent",n.fill="transparent",n.hover.fill="transparent",n.hover.stroke="transparent",n},e.prototype.foldEdge=function(t,e){var n=this;e.forEach((function(e,r){var i=e.id,o=e.sourceNodeId,a=e.targetNodeId,u=e.startPoint,s=e.endPoint,l=e.type,c=e.text,d=e.getProperties(),h={id:"".concat(i,"__").concat(r),sourceNodeId:o,targetNodeId:a,startPoint:u,endPoint:s,type:l,properties:d,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var p=n.graphModel.group.getNodeGroup(a);p||(p=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(o);f||(f=n.graphModel.getNodeModelById(o)),t&&!1!==e.visible&&(n.children.has(o)||n.id===o?(h.startPoint=void 0,h.sourceNodeId=n.id):(h.endPoint=void 0,h.targetNodeId=n.id),p.id===n.id&&f.id===n.id||n.createVirtualEdge(h),e.visible=!1),t||!1!==e.visible||(p&&p.isGroup&&p.isFolded?(h.targetNodeId=p.id,h.endPoint=void 0,n.createVirtualEdge(h)):f&&f.isGroup&&f.isFolded?(h.sourceNodeId=f.id,h.startPoint=void 0,n.createVirtualEdge(h)):e.visible=!0)}))},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isFoldedEdge=!0},e.prototype.isInRange=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;return e>=this.x-this.width/2&&r<=this.x+this.width/2&&n>=this.y-this.height/2&&i<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;return{x:e>=this.x-this.width/2&&r<=this.x+this.width/2,y:n>=this.y-this.height/2&&i<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(t){this.setProperty("groupAddable",t)},e.prototype.addChild=function(t){this.children.add(t),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(t){this.children.delete(t),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this);n.children=[],this.children.forEach((function(t){var r=e.graphModel.getNodeModelById(t);r&&!r.virtual&&n.children.push(t)}));var r=n.properties;return null==r||delete r.groupAddable,null==r||delete r.isFolded,n},e.prototype.getHistoryData=function(){var e=t.prototype.getData.call(this);e.children=b([],m(this.children),!1),e.isGroup=!0;var n=e.properties;return null==n||delete n.groupAddable,(null==n?void 0:n.isFolded)&&(e.x=e.x+this.unfoldedWidth/2-this.foldedWidth/2,e.y=e.y+this.unfoldedHeight/2-this.foldedHeight/2),e},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.toBack=function(){this.zIndex--},e}(kf),Lf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,r=e.properties;return n&&!r.isFolded?t.prototype.getControlGroup.call(this):null},n.prototype.getAddableShape=function(){var t=this.props.model,n=t.width,r=t.height,i=t.x,o=t.y,a=t.radius,u=t.properties,s=t.getAddableOutlineStyle;if(!u.groupAddable)return null;var l=this.props.model.getNodeStyle().strokeWidth,c=void 0===l?0:l,d=s(),h=n+c+8,p=r+c+8;return e.h("rect",v(v({},d),{width:h,height:p,x:i-h/2,y:o-p/2,rx:a,ry:a}))},n.prototype.getFoldIcon=function(){var t=this.props.model,n=t.x-t.width/2+5,r=t.y-t.height/2+5;if(!t.foldable)return null;var i=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," M").concat(n+7,",").concat(r+2," ").concat(n+7,",").concat(r+10):"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:t.x-t.width/2+5,y:t.y-t.height/2+5,onClick:function(){t.foldGroup(!t.properties.isFolded)}}),i])},n.prototype.getResizeShape=function(){return e.h("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},n}(jf),Bf={type:"group",view:Lf,model:Df},zf=-1e4,Wf=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=zf,this.nodeGroupMap=new Map,this.graphRendered=function(t){var e=t.data;e&&e.nodes&&(e.nodes.forEach((function(t){t.children&&t.children.forEach((function(e){n.nodeGroupMap.set(e,t.id)}))})),n.checkAndCorrectTopGroupZIndex(e.nodes))},this.appendNodeToGroup=function(t){var e=t.data,r=n.nodeGroupMap.get(e.id);if(r){var i=n.lf.getNodeModelById(r);i.removeChild(e.id),n.nodeGroupMap.delete(e.id),i.setAllowAppendChild(!1)}var o=n.lf.getNodeModelById(e.id),a=null==o?void 0:o.getBounds();if(a&&o){var u=n.getGroup(a,e);if(o.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!u)return;if(!u.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:u.getData(),node:e});u.addChild(e.id),n.nodeGroupMap.set(e.id,u.id),u.setAllowAppendChild(!1)}},this.deleteGroupChild=function(t){var e=t.data;e.children&&e.children.forEach((function(t){n.nodeGroupMap.delete(t),n.lf.deleteNode(t)}));var r=n.nodeGroupMap.get(e.id);r&&(n.lf.getNodeModelById(r).removeChild(e.id),n.nodeGroupMap.delete(e.id))},this.setActiveGroup=function(t){var e=t.data,r=n.lf.getNodeModelById(e.id),i=null==r?void 0:r.getBounds();if(r&&i){var o=n.getGroup(i,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!o||r.isGroup&&o.id===e.id)return;if(!o.isAllowAppendIn(e))return;n.activeGroup=o,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=zf;return t.isGroup&&(e=Math.max(e,t.zIndex)),t.children&&t.children.forEach((function(t){"object"==typeof t&&(t=t.id);var r=n.lf.getNodeModelById(t);if(null==r?void 0:r.isGroup){var i=n.findNodeAndChildMaxZIndex(r);e=Math.max(i,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=zf;if(t.forEach((function(t){var r=n.lf.getNodeModelById(t.id);if(r){var i=n.findNodeAndChildMaxZIndex(r);i>e&&(e=i)}})),!(n.topGroupZIndex>=e)){for(var r=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),i=n.topGroupZIndex,o=0;o<r.length;o++){var a=r[o];a.zIndex>i&&(i=a.zIndex)}n.topGroupZIndex=i}},this.nodeSelected=function(t){var e=t.data,r=t.isMultiple,i=t.isSelected,o=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(o),n.topGroupZIndex>-1e3){n.topGroupZIndex=zf;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),u=0,s=0;s<a.length;s++){var l=a[s];l.zIndex!==u&&(n.topGroupZIndex++,u=l.zIndex),l.setZIndex(n.topGroupZIndex)}}if(r&&i)if(null==o?void 0:o.isGroup)o.children.forEach((function(t){var e=n.lf.graphModel.getElement(t);null==e||e.setSelected(!1)}));else{var c=n.nodeGroupMap.get(e.id);if(c){var d=n.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==o||o.setSelected(!1))}}},this.toFrontGroup=function(t){t&&t.isGroup&&(n.topGroupZIndex++,t.setZIndex(n.topGroupZIndex),t.children&&t.children.forEach((function(t){var e=n.lf.getNodeModelById(t);n.toFrontGroup(e)})))},e.register(Bf),this.lf=e,e.graphModel.addNodeMoveRules((function(t,r,i){if(t.isGroup){var o=n.getNodeAllChild(t);return e.graphModel.moveNodes(o,r,i,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var u=t.getBounds(),s=u.x1,l=u.y1,c=u.x2,d=u.y2;return a.isAllowMoveTo({x1:s+r,y1:l+i,x2:c+r,y2:d+i})}return!0})),e.graphModel.group=this,e.on("node:add,node:drop,node:dnd-add",this.appendNodeToGroup),e.on("node:delete",this.deleteGroupChild),e.on("node:dnd-drag,node:drag",this.setActiveGroup),e.on("node:click",this.nodeSelected),e.on("graph:rendered",this.graphRendered),e.addElements=function(t,r){var i=t.nodes,o=t.edges,a={},u={nodes:[],edges:[]},s=[];return gl(i,(function(t){var i=t.id,o=t.children,l=g(t,["children"]),c=e.addNode(l);if(!c)return{nodes:[],edges:[]};i&&(a[i]=c.id),u.nodes.push(c);var d=n.createAllChildNodes(a,o,c,r).edgesArray;s.push.apply(s,b([],m(d),!1))})),s.forEach((function(t){n.createEdgeModel(t,a,r)})),gl(o,(function(t){var e=n.createEdgeModel(t,a,0);u.edges.push(e)})),u}}return t.prototype.createAllChildNodes=function(t,n,r,i){var o=this,a=this.lf,u=[],s=[],l=[];null==n||n.forEach((function(n){var c=a.getNodeModelById(n);if(c){var d=c.x,h=c.y,p=c.properties,f=c.type,g=c.text,y=c.rotate,x=c.children,_=e.EventType.NODE_GROUP_COPY||"node:group-copy-add",w=a.addNode({x:d+i,y:h+i,properties:p,type:f,text:v(v({},g),{x:g.x+i,y:g.y+i}),rotate:y},_);if(r.addChild(w.id),t[n]=w.id,l.push(w),c.incoming.edges.forEach((function(t){s.push(t)})),c.outgoing.edges.forEach((function(t){s.push(t)})),x instanceof Set){var M=o.createAllChildNodes(t,x,w,i),E=M.nodesArray,N=M.edgesArray;l.push.apply(l,b([],m(E),!1)),u.push.apply(u,b([],m(N),!1))}}}));var c=s.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:l,edgesArray:u.concat(c)}},t.prototype.createEdgeModel=function(t,e,n){var r=this.lf,i=t.sourceNodeId,o=t.targetNodeId;e[i]&&(i=e[i]),e[o]&&(o=e[o]);var a=t.type,u=t.startPoint,s=t.endPoint,l=t.pointsList,c=t.text,d={x:((null==u?void 0:u.x)||0)+n,y:((null==u?void 0:u.y)||0)+n},h={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},p=[];l&&l.length>0&&(p=l.map((function(t){return t.x+=n,t.y+=n,t})));var f=c;return c&&"string"!=typeof c&&(f.x=c.x+n,f.y=c.y+n),r.graphModel.addEdge({type:a,startPoint:d,endPoint:h,sourceNodeId:i,targetNodeId:o,pointsList:p,text:f})},t.prototype.getNodeAllChild=function(t){var e=this,n=[];return t.children&&t.children.forEach((function(t){n.push(t);var r=e.lf.getNodeModelById(t);(null==r?void 0:r.isGroup)&&(n=n.concat(e.getNodeAllChild(r)))})),n},t.prototype.getGroup=function(t,e){var n=this.lf.graphModel.nodes.filter((function(n){return n.isGroup&&n.isInRange(t)&&n.id!==e.id}));if(0!==n.length){if(1===n.length)return n[0];for(var r=n[n.length-1],i=n.length-2;i>=0;i--)n[i].zIndex>r.zIndex&&(r=n[i]);return r}},t.prototype.getNodeGroup=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="group",t}();function Ff(){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getFoldIcon=function(){var t=this.props.model,n=t,r=n.x,i=n.y,o=n.width,a=n.height,u=n.properties,s=n.foldable,l=t.x-t.width/2+5,c=t.y-t.height/2+5;if(!s)return null;var d=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u.isFolded?"M ".concat(l+3,",").concat(c+6," ").concat(l+11,",").concat(c+6," M").concat(l+7,",").concat(c+2," ").concat(l+7,",").concat(c+10):"M ".concat(l+3,",").concat(c+6," ").concat(l+11,",").concat(c+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:r-o/2+5,y:i-a/2+5,onClick:function(e){var n,r;null===(r=(n=e.stopPropagation()(t)).foldGroup)||void 0===r||r.call(n,!u.isFolded)}}),d])},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getNodeStyle(),u=v(v({},a),{x:n-i/2,y:r-o/2,width:i,height:o,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return e.h("g",{},[e.h("rect",v({},u)),this.getFoldIcon()])},n}(Lf),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.foldable=!0,this.resizable=!0,this.width=400,this.height=200,this.resetWidthHeight(),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.resetWidthHeight=function(){var t,e,n=null===(t=this.properties.iniProp)||void 0===t?void 0:t.width,r=null===(e=this.properties.iniProp)||void 0===e?void 0:e.height;n&&(this.width=n),r&&(this.height=r)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke="#989891",e.strokeWidth=1,e.strokeDasharray="3 3",this.isSelected&&(e.stroke="rgb(124, 15, 255)"),this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.addChild=function(e){var n=this.graphModel.getElement(e);null==n||n.setProperties({parent:this.id}),t.prototype.addChild.call(this,e)},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="#000",e.fill="#fff",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(Df);return{type:"bpmn:subProcess",view:t,model:n}}function Gf(t){var e=kt("bpmn:serviceTask",Et),n=kt("bpmn:userTask",Nt);t.register(e),t.register(n),t.register(Ff()),function(t){function e(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=t.id,u=n-i/2,s=n+i/2,l=r-o/2,c=r+o/2,d=e.x,h=e.y;return d>u-5&&d<s+5&&h>l-5&&h<c+5&&!(d>u+5&&d<s-5&&h>l+5&&h<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var r,i,o=n.data;if("bpmn:boundaryEvent"===o.type){var a=t.graphModel.nodes;try{for(var u=y(a),s=u.next();!s.done;s=u.next()){var l=s.value;l.isTaskNode&&(e(l,o)?l.setTouching(!0):l.setTouching(!1))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var r,i,o=n.data,a=o.type,u=o.id;if("bpmn:boundaryEvent"===a){var s=t.graphModel.nodes;try{for(var l=y(s),c=l.next();!c.done;c=l.next()){var d,h=c.value;if(h.isTaskNode)if(null!==(d=e(h,o))){var p=t.graphModel.getNodeModelById(u),f=t.graphModel.getNodeModelById(d),v=p.properties.attachedToRef;return v&&v!==d&&t.graphModel.getNodeModelById(v).deleteBoundaryEvent(u),void f.addBoundaryEvent(u)}}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,r){if(e.isTaskNode){var i=e.boundaryEvents;return t.graphModel.moveNodes(i,n,r,!0),!0}return!0}))}(t)}function Hf(t){var n=function(e){function n(n,r){n.id||(n.id="Flow_".concat(ht()));var i=v(v(v({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=i,e.call(this,n,r)||this}return f(n,e),n.extendKey="SequenceFlowModel",n}(e.PolylineEdgeModel),r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getStartArrow=function(){return this.props.model.properties.isDefaultFlow?e.h("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):e.h("path",{d:""})},n.extendKey="SequenceFlowEdge",n}(e.PolylineEdge);return{type:"bpmn:sequenceFlow",view:r,model:n}}var Xf=Hf();var Uf=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:bt,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function Vf(t){function e(e){e.forEach((function(e){var n,r;n=e.nodes,r=e.definition,n.forEach((function(e){(null==t?void 0:t[e])||(t[e]=new Map);var n=null==t?void 0:t[e];r.forEach((function(t){n.set(t.type,t)}))}))}))}return function(){return[t,e]}}var Yf=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=Vf(e.definition);var n=m(e.useDefinition(),2),r=n[0],i=n[1];console.log("_definition",r),i(Uf),function(t){t.register(gt(t)),t.register(ft(t)),t.register(vt(t)),t.register(mt(t)),t.register(yt(t))}(e),function(t){var e=Tt("bpmn:exclusiveGateway",_t),n=Tt("bpmn:parallelGateway",wt),r=Tt("bpmn:inclusiveGateway",Mt);t.register(e),t.register(r),t.register(n)}(e),function(t){t.register(Xf)}(e),Gf(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),qf=40,Zf=40,Kf=40,$f=40,Jf=100,Qf=80,tv=100,ev=80,nv=100,rv=80,iv=100,ov=80,av=100,uv=80,sv=100,lv=80,cv=100,dv=80,hv=100,pv=80,fv=function(){};(fv.ObjTree=function(){return this}).VERSION="0.23",fv.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',fv.ObjTree.prototype.attr_prefix="-",fv.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},fv.ObjTree.prototype.parseHTTP=function(t,e,n){var r,i={};for(var o in e)i[o]=e[o];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,u=n,s=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),u(e,t),s&&s(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(l=new HTTP.Request(i))&&(r=l.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var l;(l=new Ajax.Request(t,i))&&(r=l.transport)}return n?r:r&&r.responseXML&&r.responseXML.documentElement?this.parseDOM(r.responseXML.documentElement):void 0},fv.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!==t.nodeType){var r={};r[t.nodeName]=n,n=r}return n}},fv.ObjTree.prototype.parseElement=function(t){if(7!==t.nodeType){if(3===t.nodeType||4===t.nodeType||8===t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var r=0;r<t.attributes.length;r++){if("string"==typeof(u=t.attributes[r].nodeName)){var i=t.attributes[r].nodeValue;try{i=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[r].nodeValue}null!=i&&(void 0===n[u=this.attr_prefix+u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}if(t.childNodes&&t.childNodes.length){var o=!0;e&&(o=!1);for(r=0;r<t.childNodes.length&&o;r++){var a=t.childNodes[r].nodeType;3!==a&&4!==a&&8!==a&&(o=!1)}if(o){e||(e="");for(r=0;r<t.childNodes.length;r++)e+=t.childNodes[r].nodeValue}else{e||(e={});for(r=0;r<t.childNodes.length;r++){var u;if("string"==typeof(u=t.childNodes[r].nodeName))(i=this.parseElement(t.childNodes[r]))&&(void 0===n[u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}else null===e&&(e={});return e}},fv.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(1===n&&(t[e]=[]),t[e][t[e].length]=r):1===n?t[e]=r:2===n?t[e]=[t[e],r]:t[e][t[e].length]=r},fv.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},fv.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(uc(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?void 0===o||null==o?n[n.length]="<".concat(i," />"):"object"==typeof o&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):n[n.length]="object"==typeof o?this.hash_to_xml(i,o):this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var a=r.join(""),u=n.join("");return void 0===t||null==t||(u=n.length>0?u.match(/\n/)?"<".concat(t).concat(a,">\n").concat(u,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(u,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),u},fv.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];void 0===i||null==i?n[n.length]="<".concat(t," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},fv.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"===t?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,">\n")},fv.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function vv(t){return Object.prototype.toString.call(t)}function gv(t){return" ".repeat(t)}function yv(t){return"[object Object]"===vv(t)?Object.keys(t).reduce((function(e,n){var r=n;return"-"===n.charAt(0)&&(r=n.substring(1)),e[r]=yv(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return yv(t)})):t}var mv,bv="\t\n";function xv(t,e,n){var r=gv(n),i="",o=bv+r;if("-json"===e)return"";if("#text"===e)return o+t;if("#cdata-section"===e)return"".concat(o,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(o,"\x3c!--").concat(t,"--\x3e");if("-"==="".concat(e).charAt(0))return" ".concat(e.substring(1),'="').concat(function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(yv(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))i+=t.map((function(t){return xv(t,e,n+1)})).join("");else if("[object Object]"===vv(t)){var a=Object.keys(t),u="",s=t["-json"]?bv+gv(n+1)+t["-json"]:"";i+="".concat(0===n?"":o,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?u+=xv(t[e],e,n+1):s+=xv(t[e],e,n+1)})),i+=u+(""!==s?">".concat(s).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"}(mv||(mv={}));var _v=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],wv=["properties","startPoint","endPoint","pointsList"],Mv={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},Ev=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var r=e[n],i=r.in,o=r.out;i&&(t[n].in=i),o&&(t[n].out=o)}else t[n]=e[n]})),t},Nv={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,r=e.condition;return r?"cdata"===n?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(r,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(r,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&r?">".concat("<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(n,">"),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,r,i,o=t,a=e["-id"],u="",s="";try{for(var l=y(Object.keys(e)),c=l.next();!c.done;c=l.next()){var d=c.value;d.includes("bpmn:")&&(u=m(d.split(":"),2)[1],s=null===(i=e[d])||void 0===i?void 0:i["#text"])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return{"-definitionId":a,"-definitionType":o,"-timerType":u,"-timerValue":s}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function Sv(t){var e=null!=t?t:{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(b(b([],m(wv),!1),m(n||[]),!1)),a={in:new Set(b(b([],m(Mv.in),!1),m((null==r?void 0:r.in)||[]),!1)),out:new Set(b(b([],m(Mv.out),!1),m((null==r?void 0:r.out)||[]),!1))};return Nv=Ev(Nv,i),function(t){var e=t.nodes,n=t.edges;return function t(r,i){var u,s;if(1!==(null==r?void 0:r.flag)){var l;if((l=Nv[r.type])&&l.out){var c=l.out(r),d=Object.keys(c);d.length>0&&d.forEach((function(t){r[t]=c[t]}))}(null==r?void 0:r.children)&&(r.children=r.children.map((function(t){return e.find((function(e){return e.id===t}))||n.find((function(e){return e.id===t}))||{}})));var h={};if("string"==typeof r)return r;if(Array.isArray(r))return r.map((function(e){return t(e,"")})).filter((function(t){return null!=t}));try{for(var p=y(Object.entries(r)),f=p.next();!f.done;f=p.next()){var v=m(f.value,2),g=v[0],b=v[1];if(1===(null==b?void 0:b.flag))return;var x=[i,g].filter((function(t){return t})).join(".");a.out.has(x)||("object"!=typeof b?0===g.indexOf("-")||["#text","#cdata-section","#comment"].includes(g)?h[g]=b:h["-".concat(g)]=b:o.has(x)?h["-".concat(g)]=t(b,x):h[g]=t(b,x))}}catch(t){u={error:t}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(u)throw u.error}}return h}}(t,"")}}function Av(t){var e,n,r={};try{for(var i=y(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=m(o.value,2),u=a[0],s=a[1];0===u.indexOf("-")?r[u.substring(1)]=yv(s):"string"==typeof s?r[u]=s:"[object Object]"===Object.prototype.toString.call(s)?r[u]=Av(s):Array.isArray(s)?r[u]=s.map((function(t){return Av(t)})):r[u]=s}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function Pv(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,r=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":r};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,r=100,i=80,o=t.x,a=t.y,u=jv.shapeConfigMap.get(t.type);u&&(r=u.width,i=u.height),o-=r/2,a-=i/2;var s={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":o,"-y":a,"-width":r,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),s}))}var Ov=["bpmn:incoming","bpmn:outgoing"];function Tv(t,e){var n=[],r=[],i=new Map,o=null!=e?e:{},a=o.transformer,u=o.excludeFields,s={in:new Set(b(b([],m(Mv.in),!1),m((null==u?void 0:u.in)||[]),!1)),out:new Set(b(b([],m(Mv.out),!1),m((null==u?void 0:u.out)||[]),!1))};Nv=Ev(Nv,a);var l,c,d=t["bpmn:definitions"];if(d){var h=d["bpmn:process"];l=h,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||Ov.includes(e)||(h[e]||(h[e]=[]),!Array.isArray(h[e])&&(h[e]=[h[e]]),Array.isArray(t[e])?(n=h[e]).push.apply(n,b([],m(t[e]),!1)):h[e].push(t[e]),Array.isArray(t[e])?t[e].forEach((function(n){!e.includes("Flow")&&t["-children"].push(n["-id"])})):!e.includes("Flow")&&t["-children"].push(t[e]["-id"]),delete t[e])}))}if("bpmn:subProcess"===t){var n=h[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;i.set(t["-id"],t),Array.isArray(t)?t.forEach((function(t){e(t)})):"object"==typeof t&&(n=t,Object.keys(n).forEach((function(t){var r,i;if(t.includes("bpmn:")){var o={};Nv[t]&&Nv[t].in?(o=null===(i=(r=Nv[t]).in)||void 0===i?void 0:i.call(r,t,cn.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(o)).length>0&&a.forEach((function(t){Reflect.set(n,t,o[t])}))}})))}e(h[t])},function(t){if(0===t.indexOf("bpmn:")){var e=h[t];if("bpmn:sequenceFlow"===t){var o=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var r;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(kv(r,t))}));else{var r=void 0;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(kv(r,t))}return n}(e,o)}else{var a=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var u=h[t],s=function(t){var e=t["-attachedToRef"],n=i.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(u)?u.forEach((function(t){s(t)})):s(u)}n=n.concat(function(t,e,n){var r=[];if(Array.isArray(t))t.forEach((function(t){var i=Cv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}));else{var i=Cv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}return r}(e,a,t))}}}],c.forEach((function(t){try{Object.keys(l).forEach((function(e){try{t(e)}catch(t){console.error(t)}}))}catch(t){console.error(t)}}))}var p=function(t,e,n){Object.keys(t).forEach((function(r){var i=n?"".concat(n,".").concat(r):r;e.has(i)?delete t[r]:"object"==typeof t[r]&&p(t[r],e,i)}))};return n.forEach((function(t){var n,r;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,o=t.type;i[o]&&(t.type=i[o])}p(t,s.in,"")})),r.forEach((function(t){var n,r;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,o=t.type;i[o]&&(t.type=i[o])}p(t,s.in,"")})),{nodes:n,edges:r}}function Cv(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],a=n["-name"],u=jv.shapeConfigMap.get(e);u&&(r+=u.width/2,i+=u.height/2);var s,l={};if(Object.entries(n).forEach((function(t){var e=m(t,2),n=e[0],r=e[1];_v.includes(n)||(l[n]=r)})),l=Av(l),a&&(s={x:r,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];s.x=Number(c["-x"])+Number(c["-width"])/2,s.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return o&&(d.children=o),s&&(d.text=s),d}function kv(t,e){var n,r=e["-name"];if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split("\n").forEach((function(t){o<t.length&&(o=t.length)})),n={value:r,x:Number(i["-x"])+10*o/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=m(t,2),n=e[0],r=e[1];_v.includes(n)||(a[n]=r)})),a=Av(a);var u=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),s={id:e["-id"],type:mv.FLOW,pointsList:u,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(s.text=n),s}var jv=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var r,i,o=v({},n.processAttributes);!function(t,e,n){var r,i=new Map,o=Sv(n)(e);o.nodes.forEach((function(e){var n=e["-id"],r=e["-type"],o=e.text,a=e.children,u=g(e,["-id","-type","text","children"]),s={"-id":n};(null==o?void 0:o["-value"])&&(s["-name"]=o["-value"]),u["-json"]&&(s["-json"]=u["-json"]),u["-properties"]&&Object.assign(s,u["-properties"]),a&&(s.children=a),t[r]||(t[r]=[]),t[r].push(s),i.set(n,s)}));var a=o.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],r=t["-targetNodeId"],o=t.text,a=g(t,["-id","-sourceNodeId","-targetNodeId","text"]),u=i.get(r);u["bpmn:incoming"]||(u["bpmn:incoming"]=[]),u["bpmn:incoming"].push(e);var s={"-id":e,"-sourceRef":n,"-targetRef":r};return(null==o?void 0:o["-value"])&&(s["-name"]=o["-value"]),a["-json"]&&(s["-json"]=a["-json"]),a["-properties"]&&Object.assign(s,a["-properties"]),s}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,r=i.get(e);r["bpmn:outgoing"]||(r["bpmn:outgoing"]=[]),r["bpmn:outgoing"].push(n)})),null===(r=t["bpmn:subProcess"])||void 0===r||r.forEach((function(e){var n={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},r=[];e.children.forEach((function(r){var o,a=i.get(r["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var u=null===(o=t[r["-type"]])||void 0===o?void 0:o.findIndex((function(t){return t["-id"]===r["-id"]}));u>=0&&t[r["-type"]].splice(u,1),i.delete(r["-id"]),e[r["-type"]]||(e[r["-type"]]=[]),e[r["-type"]].push(a)}));var o=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){o.has(t)&&r.push(t)}));for(var u,s=function(t){var n=a.findIndex((function(e){return e["-id"]===r[t]}));n>=0?(e["bpmn:sequenceFlow"]||(e["bpmn:sequenceFlow"]=[]),e["bpmn:sequenceFlow"].push(a[n]),a.splice(n,1)):t++,u=t},l=0;l<r.length;)s(l),l=u;delete e.children})),t[mv.FLOW]=a}(o,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":o["-id"]};Pv(a,t);var u=n.definitionAttributes;u["bpmn:process"]=o,u["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var s={"bpmn:definitions":u};if(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.out){var l=null===(i=null==e?void 0:e.mapping)||void 0===i?void 0:i.out,c=function(t){Array.isArray(t)&&t.forEach((function(t){return c(t)})),"object"==typeof t&&Object.keys(t).forEach((function(e){var n;(n=l[e])?(t[n]=cn.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(s)}return s},this.adapterIn=function(t,e){if(t)return Tv(t,e)},e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();jv.shapeConfigMap.set(mv.START,{width:qf,height:Zf}),jv.shapeConfigMap.set(mv.END,{width:Kf,height:$f}),jv.shapeConfigMap.set(mv.INTERMEDIATE_CATCH,{width:tv,height:ev}),jv.shapeConfigMap.set(mv.INTERMEDIATE_THROW,{width:tv,height:ev}),jv.shapeConfigMap.set(mv.BOUNDARY,{width:Jf,height:Qf}),jv.shapeConfigMap.set(mv.PARALLEL_GATEWAY,{width:nv,height:rv}),jv.shapeConfigMap.set(mv.INCLUSIVE_GATEWAY,{width:iv,height:ov}),jv.shapeConfigMap.set(mv.EXCLUSIVE_GATEWAY,{width:av,height:uv}),jv.shapeConfigMap.set(mv.SYSTEM,{width:sv,height:lv}),jv.shapeConfigMap.set(mv.USER,{width:cv,height:dv}),jv.shapeConfigMap.set(mv.SUBPROCESS,{width:hv,height:pv});var Iv,Rv=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,r=(e=t,(new fv.ObjTree).parseXML(e));return n.adapterIn(r,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=xv(t[n],n,0);return e}(n.adapterOut(t,n.props))};var r=e.lf,i=e.props;return r.adapterIn=n.adapterXmlIn,r.adapterOut=n.adapterXmlOut,n.props=i,n}return f(e,t),e.pluginName="BPMNAdapter",e}(jv),Dv=function(){function t(t){var e=t.lf,n=this;this.fileName="snapshot.png",this.lf=e,this.customCssRules="",this.useGlobalRules=!0,e.getSnapshot=function(t,e){n.getSnapshot(t,e)},e.getSnapshotBlob=function(t){return n.getSnapshotBlob(t)},e.getSnapshotBase64=function(t){return n.getSnapshotBase64(t)}}return t.prototype.getSvgRootElement=function(t){return t.container.querySelector(".lf-canvas-overlay")},t.prototype.triggerDownload=function(t){var e=new MouseEvent("click",{view:document.defaultView,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",this.fileName),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(e)},t.prototype.removeAnchor=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,r=0;r<n;r++){var i=e[r];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-anchor")>-1&&(t.removeChild(t.childNodes[r]),n--,r--)}},t.prototype.removeRotateControl=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,r=0;r<n;r++){var i=e[r];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-rotate-control")>-1&&(t.removeChild(t.childNodes[r]),n--,r--)}},t.prototype.getSnapshot=function(t,e){var n=this;this.fileName=t||"logic-flow.".concat(Date.now(),".png");var r=this.getSvgRootElement(this.lf);this.getCanvasData(r,e).then((function(t){var e=t.toDataURL("image/png").replace("image/png","image/octet-stream");n.triggerDownload(e)}))},t.prototype.getSnapshotBase64=function(t){var e=this,n=this.getSvgRootElement(this.lf);return new Promise((function(r){e.getCanvasData(n,t).then((function(t){var e=t.toDataURL("image/png");r({data:e,width:t.width,height:t.height})}))}))},t.prototype.getSnapshotBlob=function(t){var e=this,n=this.getSvgRootElement(this.lf);return new Promise((function(r){e.getCanvasData(n,t).then((function(t){t.toBlob((function(e){r({data:e,width:t.width,height:t.height})}),"image/png")}))}))},t.prototype.getClassRules=function(){var t="";if(this.useGlobalRules)for(var e=document.styleSheets,n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.cssRules.length;i++)t+=r.cssRules[i].cssText;return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){var n,r=this,i=t.cloneNode(!0),o=i.lastChild,a=null===(n=null==o?void 0:o.childNodes)||void 0===n?void 0:n.length;if(a)for(var u=0;u<a;u++){var s=null==o?void 0:o.childNodes[u],l=s.classList&&Array.from(s.classList);if(l&&l.indexOf("lf-base")<0)null==o||o.removeChild(o.childNodes[u]),a--,u--;else{var c=null==o?void 0:o.childNodes[u];c&&c.childNodes.forEach((function(t){var e=t;r.removeAnchor(e.firstChild),r.removeRotateControl(e.firstChild)}))}}var d=window.devicePixelRatio||1;d<1&&(d=1);var h=document.createElement("canvas"),p=this.lf.graphModel.rootEl.querySelector(".lf-base").getBoundingClientRect(),f=this.lf.container.querySelector(".lf-canvas-overlay").getBoundingClientRect(),v=p.x-f.x,g=p.y-f.y,y=this.lf.graphModel.transformModel,m=y.SCALE_X,b=y.SCALE_Y,x=y.TRANSLATE_X,_=y.TRANSLATE_Y;i.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-v+x)*(1/m)+10,", ").concat((-g+_)*(1/b)+10,")");var w=Math.ceil(p.width/m),M=Math.ceil(p.height/b);h.style.width="".concat(w,"px"),h.style.height="".concat(M,"px"),h.width=w*d+80,h.height=M*d+80;var E=h.getContext("2d");E&&(E.clearRect(0,0,h.width,h.height),E.scale(d,d),e?(E.fillStyle=e,E.fillRect(0,0,w*d+80,M*d+80)):E.clearRect(0,0,w,M));var N=new Image,S=document.createElement("style");S.innerHTML=this.getClassRules();var A=document.createElement("foreignObject");return A.appendChild(S),i.appendChild(A),new Promise((function(t){N.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(N,{resizeWidth:h.width,resizeHeight:h.height}).then((function(e){null==E||E.drawImage(e,0,0),t(h)})):(null==E||E.drawImage(N,0,0),t(h))}catch(e){null==E||E.drawImage(N,0,0),t(h)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(i)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");N.src=e}))},t.pluginName="snapshot",t}(),Lv={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},Bv={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function zv(t){switch(t){case"bpmn:sequenceFlow":return Lv.SEQUENCE_FLOW;case"bpmn:startEvent":return Lv.START_EVENT;case"bpmn:endEvent":return Lv.END_EVENT;case"bpmn:userTask":return Lv.USER_TASK;case"bpmn:exclusiveGateway":return Lv.EXCLUSIVE_GATEWAY;default:return t}}!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Iv||(Iv={}));var Wv=function(t,e,n,r){return void 0===r&&(r=0),Hv(t,e,n)<=r};function Fv(t){return t*t}function Gv(t,e){return Fv(t.x-e.x)+Fv(t.y-e.y)}var Hv=function(t,e,n){return Math.sqrt(function(t,e,n){var r=Gv(e,n);if(0===r)return Gv(t,e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return i=Math.max(0,Math.min(1,i)),Gv(t,{x:e.x+i*(n.x-e.x),y:e.y+i*(n.y-e.y)})}(t,e,n))},Xv=function(t,e,n){var r=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{minX:e-r/2,minY:n-i/2,maxX:e+r/2,maxY:n+i/2,x:e,y:n,width:r,height:i,centerX:e,centerY:n}}(t),i=function(t,e){var n;return t.x===e.x?n=Iv.VERTICAL:t.y===e.y&&(n=Iv.HORIZONTAL),n}(e,n),o=Math.max(e.x,n.x),a=Math.min(e.x,n.x),u=Math.max(e.y,n.y),s=Math.min(e.y,n.y),l=t.x,c=t.y,d=t.width,h=t.height;if(i===Iv.HORIZONTAL){if(o>=r.maxX&&a<=r.minX)return{startCrossPoint:{x:e.x>n.x?l+d/2:l-d/2,y:e.y},endCrossPoint:{x:e.x>n.x?l-d/2:l+d/2,y:e.y}}}else if(i===Iv.VERTICAL&&u>=r.maxY&&s<=r.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+h/2:c-h/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-h/2:c+h/2}}},Uv=function(t,e,n){void 0===n&&(n=0);for(var r=t.x,i=t.y,o=e.pointsList,a=0;a<o.length-1;a++)if(Wv({x:r,y:i},o[a],o[a+1],n)){var u=Xv(t,o[a],o[a+1]);if(u)return{crossIndex:a+1,crossPoints:u}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},Vv=function(){function t(t){var e=t.lf;this._lf=e,this.deviation=20,this.dndAdd=!0,this.dropAdd=!0,this.eventHandler()}return t.prototype.eventHandler=function(){var t=this;this.dndAdd&&this._lf.on("node:dnd-add",(function(e){var n=e.data;t.insetNode(n)})),this.dropAdd&&this._lf.on("node:drop",(function(e){for(var n=e.data,r=t._lf.graphModel.edges,i=n.id,o=!0,a=0;a<r.length;a++)if(r[a].sourceNodeId===i||r[a].targetNodeId===i){o=!1;break}o&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,n,r,i,o){var a=this._lf.getNodeModelById(t),u=this._lf.getNodeModelById(n),s=a.getAnchorInfo(r),l=u.getAnchorInfo(i),c=a.isAllowConnectedAsSource(o,s,l),d=u.isAllowConnectedAsTarget(o,s,l),h=e.formatAnchorConnectValidateData(c),p=h.isAllPass,f=h.msg,v=e.formatAnchorConnectValidateData(d),g=v.isAllPass;return{isPass:p&&g,sourceMsg:f,targetMsg:v.msg}},t.prototype.insetNode=function(t){var n=this,r=this._lf.graphModel.edges,i=this._lf.getNodeModelById(t.id),o=null==i?void 0:i.getDefaultAnchor();if(!o||0===o.length)this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(i)for(var a=0;a<r.length;a++){var u=Uv(i,r[a],this.deviation),s=u.crossIndex,l=u.crossPoints;if(s>=0){var c=r[a],d=c.sourceNodeId,h=c.targetNodeId,p=c.id,f=c.type,v=c.pointsList,g=c.sourceAnchorId,y=c.targetAnchorId,x=ju(v[0]),_=ju(l.startCrossPoint);this._lf.deleteEdge(p);var w=this.checkRuleBeforeInsetNode(d,h,g,y,t);if(this._lf.addEdge({type:f,sourceNodeId:d,targetNodeId:t.id,startPoint:x,endPoint:_,pointsList:b(b([],m(v.slice(0,s)),!1),[l.startCrossPoint],!1)}),this._lf.addEdge({type:f,sourceNodeId:t.id,targetNodeId:h,startPoint:ju(l.endCrossPoint),endPoint:ju(v[v.length-1]),pointsList:b([l.endCrossPoint],m(v.slice(s)),!1)}),w.isPass)break;this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:w.targetMsg||w.sourceMsg}),setTimeout((function(){n._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),Yv=function(){function t(t){var e=t.lf,n=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){n.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){n.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){n.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){n.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){n.lf.redo()}}],this.lf=e}return t.prototype.render=function(t,e){this.destroy();var n=this.getControlTool();this.toolEl=n,e.appendChild(n),this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},t.prototype.addItem=function(t){this.controlItems.push(t)},t.prototype.removeItem=function(t){var e=this.controlItems.findIndex((function(e){return e.key===t}));return-1==e?null:this.controlItems.splice(e,1)[0]},t.prototype.getControlTool=function(){var t=this,e="lf-control-item",n="lf-control-item disabled",r=document.createElement("div"),i=[];return r.className="lf-control",this.controlItems.forEach((function(r){var o=document.createElement("div"),a=document.createElement("i"),u=document.createElement("span");switch(o.className=n,r.onClick&&(o.onclick=r.onClick.bind(null,t.lf)),r.onMouseEnter&&(o.onmouseenter=r.onMouseEnter.bind(null,t.lf)),r.onMouseLeave&&(o.onmouseleave=r.onMouseLeave.bind(null,t.lf)),a.className=r.iconClass,u.className="lf-control-text",u.title=r.title,u.innerText=r.text,o.append(a,u),r.text){case"上一步":t.lf.on("history:change",(function(t){var r=t.data.undoAble;o.className=r?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var r=t.data.redoAble;o.className=r?e:n}));break;default:o.className=e}i.push(o)})),r.append.apply(r,b([],m(i),!1)),r},t.pluginName="control",t}(),qv="lf:defaultNodeMenu",Zv="lf:defaultEdgeMenu",Kv="lf:defaultGraphMenu",$v="lf:defaultSelectionMenu",Jv=function(){function t(t){var e=t.lf,n=this;this.lf=e,e.options.isSilentMode||(this.__menuDOM=document.createElement("ul"),this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(t){n.setMenuConfig(t)},this.lf.addMenuConfig=function(t){n.addMenuConfig(t)},this.lf.setMenuByType=function(t){n.setMenuByType(t)})}return t.prototype.init=function(){var t,e,n,r,i=this,o=[{text:"删除",callback:function(t){i.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){i.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set(qv,o);var a=[{text:"删除",callback:function(t){i.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(Zv,a),null===(n=this.menuTypeMap)||void 0===n||n.set(Kv,[]);var u=[{text:"删除",callback:function(t){i.lf.clearSelectElements(),t.edges.forEach((function(t){return i.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return i.lf.deleteNode(t.id)}))}}];null===(r=this.menuTypeMap)||void 0===r||r.set($v,u)},t.prototype.render=function(t,e){var n=this;t.options.isSilentMode||(this.__container=e,this.__currentData=null,this.__menuDOM&&(this.__menuDOM.className="lf-menu",e.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(t){t.stopPropagation();for(var e=t.target;-1===Array.from(e.classList).indexOf("lf-menu-item")&&-1===Array.from(e.classList).indexOf("lf-menu");)e=null==e?void 0:e.parentElement;Array.from(e.classList).indexOf("lf-menu-item")>-1?(e.onclickCallback(n.__currentData),n.__menuDOM&&(n.__menuDOM.style.display="none"),n.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!")}),!0)),this.lf.on("node:contextmenu",(function(t){var e,r,i=t.data,o=t.position,a=t.e,u=o.domOverlayPosition,s=u.x,l=u.y,c=i.id,d=n.lf.graphModel.getNodeModelById(c);if(d){var h=[],p=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(d.type);h=d&&d.menu&&Array.isArray(d.menu)?d.menu:p||(null===(r=n.menuTypeMap)||void 0===r?void 0:r.get(qv)),n.__currentData=i,n.showMenu(s,l,h,{width:d.width,height:d.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,r,i,o,a=t.data,u=t.position,s=t.e,l=u.domOverlayPosition,c=l.x,d=l.y,h=a.id,p=n.lf.graphModel.getEdgeModelById(h);if(p){var f=[],v=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(p.type))&&void 0!==r?r:[];f=p&&p.menu&&Array.isArray(p.menu)?p.menu:v||(null!==(o=null===(i=n.menuTypeMap)||void 0===i?void 0:i.get(Zv))&&void 0!==o?o:[]),n.__currentData=a,n.showMenu(c,d,f,{width:p.width,height:p.height,clientX:s.clientX,clientY:s.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,r,i=t.position,o=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(Kv))&&void 0!==r?r:[],a=i.domOverlayPosition,u=a.x,s=a.y;n.showMenu(u,s,o)})),this.lf.on("selection:contextmenu",(function(t){var e,r=t.data,i=t.position,o=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get($v),a=i.domOverlayPosition,u=a.x,s=a.y;n.__currentData=r,n.showMenu(u,s,o)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"})))},t.prototype.destroy=function(){var t;this.__menuDOM&&(null===(t=null==this?void 0:this.__container)||void 0===t||t.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.prototype.showMenu=function(t,e,n,r){if(n&&n.length){var i=this.__menuDOM;if(i){if(i.innerHTML="",i.append.apply(i,b([],m(this.__getMenuDom(n)),!1)),!i.children.length)return;if(i.style.display="block",!r)return i.style.top="".concat(e,"px"),void(i.style.left="".concat(t,"px"));var o=r.width,a=r.height,u=r.clientX,s=r.clientY,l=this.lf.graphModel,c=i.offsetWidth,d=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=h-u,f=l.rootEl.getBoundingClientRect(),v=f.left+f.width;v<h&&(p=v-u),p<c&&(d=!1),i.style.left="".concat(d?t:t-o,"px");var g=i.offsetHeight,y=!0,x=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,_=x-s,w=f.top+f.height;w<x&&(_=w-s),_<g&&(y=!1),i.style.top="".concat(y?e:e-a,"px")}}},t.prototype.setMenuByType=function(t){var e;t.type&&t.menu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(t.type,t.menu))},t.prototype.__getMenuDom=function(t){var e=[];return t&&t.length>0&&t.forEach((function(t){var n=document.createElement("li");if(t.className?n.className="lf-menu-item ".concat(t.className):n.className="lf-menu-item",!0===t.icon){var r=document.createElement("span");r.className="lf-menu-item-icon",n.appendChild(r)}var i=document.createElement("span");i.className="lf-menu-item-text",t.text&&(i.innerText=t.text),n.appendChild(i),n.onclickCallback=t.callback,e.push(n)})),e},t.prototype.setMenuConfig=function(t){var e,n,r;t&&(void 0!==t.nodeMenu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(qv,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(Zv,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(r=this.menuTypeMap)||void 0===r||r.set(Kv,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,r,i,o,a,u,s,l;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get(qv))&&void 0!==n?n:[];null===(r=this.menuTypeMap)||void 0===r||r.set(qv,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(o=null===(i=this.menuTypeMap)||void 0===i?void 0:i.get(Zv))&&void 0!==o?o:[];null===(a=this.menuTypeMap)||void 0===a||a.set(Zv,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(s=null===(u=this.menuTypeMap)||void 0===u?void 0:u.get(Kv))&&void 0!==s?s:[];null===(l=this.menuTypeMap)||void 0===l||l.set(Kv,c.concat(t.graphMenu))}}},t.prototype.changeMenuItem=function(t,e){if("add"===t)this.addMenuConfig(e);else{if("reset"!==t)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.setMenuConfig(e)}},t.pluginName="menu",t}(),Qv="menu-common",tg=function(){function t(t){var e=t.lf,n=this;this.menuTypeMap=new Map,this.listenDelete=function(){n.hideContextMenu()},this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(Qv,[]),this.lf.setContextMenuByType=function(t,e){n.setContextMenuByType(t,e)},this.lf.setContextMenuItems=function(t){n.setContextMenuItems(t)},this.lf.showContextMenu=function(t){n.showContextMenu(t)},this.lf.hideContextMenu=function(){n.hideContextMenu()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("node:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("edge:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("blank:click",(function(){n.hideContextMenu()}))},t.prototype.setContextMenuByType=function(t,e){this.menuTypeMap.set(t,e)},t.prototype.hideContextMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},t.prototype.showContextMenu=function(t){t&&t.id?(this._activeData=t,this.createContextMenu()):console.warn("请检查传入的参数")},t.prototype.setContextMenuItems=function(t){this.menuTypeMap.set(Qv,t)},t.prototype.getContextMenuPosition=function(){var t=this._activeData,e=this.lf.graphModel.getElement(t.id);if(e){var n,r;if("edge"===e.BaseType){n=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER;var i=e.getData();n=Math.max(i.startPoint.x,n),r=Math.min(i.startPoint.y,r),n=Math.max(i.endPoint.x,n),r=Math.min(i.endPoint.y,r),i.pointsList&&i.pointsList.forEach((function(t){n=Math.max(t.x,n),r=Math.min(t.y,r)}))}return"node"===e.BaseType&&(n=t.x+e.width/2,r=t.y-e.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([n,r])}},t.prototype.createContextMenu=function(){var t=this;if(!this.lf.options.isSilentMode){var e=b(b([],m(this.menuTypeMap.get(this._activeData.type)||[]),!1),m(this.menuTypeMap.get(Qv)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var r=document.createElement("div");r.className="lf-context-item";var i=document.createElement("img");i.src=e.icon,i.className="lf-context-img",e.className&&(r.className="".concat(r.className," ").concat(e.className)),i.addEventListener("click",(function(){t.hideContextMenu(),e.callback?e.callback(t._activeData):t.addNode({sourceId:t._activeData.id,x:t._activeData.x,y:t._activeData.y,properties:e.properties,type:e.type})})),r.appendChild(i),n.appendChild(r)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(n),this.showMenu()}},t.prototype.addNode=function(t,e){var n=void 0!==e;void 0===e&&(e=t.y);var r=this.lf.getNodeModelById(t.sourceId);if(r){var i=t.x-r.width+200,o=e-t.y/2-20,a=t.x+r.width+200,u=e+t.y/2+20;if(this.lf.getAreaElement([i,o],[a,u]).length)return e+=100,void this.addNode(t,e);if(t.type){var s=this.lf.addNode({type:t.type,x:t.x+200,y:e,properties:t.properties}),l=void 0,c=void 0;n&&(l={x:t.x,y:t.y+r.height/2},c={x:s.x-s.width/2,y:s.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:s.id,startPoint:l,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=m(t,2),n=e[0],r=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top="".concat(r,"px"),this.__menuDOM.style.left="".concat(n+10,"px"),this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}},t.pluginName="contextMenu",t}(),eg=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.lf.setPatternItems=function(t){n.setPatternItems(t)}}return t.prototype.render=function(t,e){var n=this;this.destroy(),this.shapeList&&0!==this.shapeList.length?(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(t){var e;null===(e=n.panelEl)||void 0===e||e.appendChild(n.createDndItem(t))})),e.appendChild(this.panelEl),this.domContainer=e):this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(t){this.shapeList=t,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(t){var e=this,n=document.createElement("div");n.className=t.className?"lf-dnd-item ".concat(t.className):"lf-dnd-item";var r=document.createElement("div");if(r.className="lf-dnd-shape",t.icon&&(r.style.backgroundImage="url(".concat(t.icon,")")),n.appendChild(r),t.label){var i=document.createElement("div");i.innerText=t.label,i.className="lf-dnd-text",n.appendChild(i)}return t.disabled?(n.classList.add("disabled"),n.onmousedown=function(){t.callback&&t.callback(e.lf,e.domContainer)},n):(n.onmousedown=function(){t.type&&e.lf.dnd.startDrag({type:t.type,properties:t.properties,text:t.text}),t.callback&&t.callback(e.lf,e.domContainer)},n.ondblclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:n,data:t})},n.onclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:n,data:t})},n.oncontextmenu=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:n,data:t})},n)},t.pluginName="dndPanel",t}(),ng=function(){function t(t){var e=t.lf,n=this;this.disabled=!0,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.draw=function(t){var e=n.lf.getPointByClient(t.clientX,t.clientY).domOverlayPosition,r=e.x,i=e.y;if(n.endPoint={x:r,y:i},n.startPoint){var o=n.startPoint,a=o.x,u=o.y,s=a,l=u,c=r-a,d=i-u;r<a&&(s=r,c=a-r),i<u&&(l=i,d=u-i),n.wrapper&&(n.wrapper.style.left="".concat(s,"px"),n.wrapper.style.top="".concat(l,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(d,"px"))}},this.drawOff=function(){var t;if(document.removeEventListener("mousemove",n.draw),document.removeEventListener("mouseup",n.drawOff),n.wrapper&&(n.wrapper.oncontextmenu=null,null===(t=n.container)||void 0===t||t.removeChild(n.wrapper)),n.startPoint&&n.endPoint){var e=n.startPoint,r=e.x,i=e.y,o=n.endPoint,a=o.x,u=o.y,s=[Math.min(r,a),Math.min(i,u)],l=[Math.max(r,a),Math.max(i,u)];if(n.lf.emit("selection:selected-area",{topLeft:s,bottomRight:l}),Math.abs(a-r)<10&&Math.abs(u-i)<10)return;var c=n.lf.graphModel.getAreaElement(s,l,n.isWholeEdge,n.isWholeNode,!0),d=n.lf.graphModel.group;c.forEach((function(t){d&&d.getNodeGroup(t.id)||n.lf.selectElementById(t.id,!0)})),n.lf.emit("selection:selected",c)}},this.lf=e;var r=e.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=r,e.openSelectionSelect=function(){n.openSelectionSelect()},e.closeSelectionSelect=function(){n.closeSelectionSelect()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("blank:mousedown",(function(r){var i=r.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===i.button)){var o=t.getPointByClient(i.clientX,i.clientY).domOverlayPosition,a=o.x,u=o.y;n.startPoint={x:a,y:u},n.endPoint={x:a,y:u};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(t){t.preventDefault()},s.style.top="".concat(n.startPoint.y,"px"),s.style.left="".concat(n.startPoint.x,"px"),e.appendChild(s),n.wrapper=s,document.addEventListener("mousemove",n.draw),document.addEventListener("mouseup",n.drawOff)}}))},t.prototype.setSelectionSense=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.isWholeEdge=t,this.isWholeNode=e},t.prototype.openSelectionSelect=function(){this.lf.getEditConfig().stopMoveGraph||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},t.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),rg=function(){function t(t){var e=t.lf,n=t.LogicFlow,r=t.options,i=this;this.width=200,this.height=150,this.scale=1,this.translateX=0,this.translateY=0,this.showEdge=!1,this.viewPortTop=0,this.viewPortLeft=0,this.viewPortWidth=150,this.viewPortHeight=75,this.isShow=!1,this.isShowHeader=!1,this.isShowCloseIcon=!1,this.headerTitle="导航",this.disabledPlugins=["miniMap","control","selectionSelect"],this.render=function(t,e){i.container=e,i.lf.on("history:change",(function(){i.isShow&&i.setView()})),i.lf.on("graph:transform",(function(){i.isShow&&i.setView(!1)}))},this.show=function(t,e){i.isShow||(i.createMiniMap(t,e),i.setView()),i.isShow=!0},this.hide=function(){i.isShow&&(i.removeMiniMap(),i.lf.emit("miniMap:close",{})),i.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(i.leftPosition=t.left,i.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(i.topPosition=t.top,i.bottomPosition=t.bottom);else switch(t){case"left-top":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=0,i.bottomPosition=void 0;break;case"right-top":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=0,i.bottomPosition=void 0;break;case"left-bottom":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=void 0,i.bottomPosition=0;break;case"right-bottom":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=void 0,i.bottomPosition=0}i.updateMiniMapPosition()},this.reset=function(){i.lf.resetTranslate(),i.lf.resetZoom()},this.setShowEdge=function(t){i.showEdge!==t&&(i.showEdge=t,i.setView())},this.startDrag=function(t){document.addEventListener("mousemove",i.drag),document.addEventListener("mouseup",i.drop);var e=t.x,n=t.y;i.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,r=(e-i.startPosition.x)/i.scale,o=(n-i.startPosition.y)/i.scale,a=i.viewPortLeft+r+i.viewPortWidth/i.scale/2,u=i.viewPortTop+o+i.viewPortHeight/i.scale/2;i.startPosition={x:e,y:n},i.lf.focusOn({coordinate:{x:a,y:u}})},this.drop=function(){document.removeEventListener("mousemove",i.drag),document.removeEventListener("mouseup",i.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,r=i.translateX+e/i.scale,o=i.translateY+n/i.scale;i.lf.focusOn({coordinate:{x:r,y:o}})},this.lf=e,this.LFCtor=n,r&&r.MiniMap&&this.setOption(r.MiniMap),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var o={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=o,this.elementAreaBounds=o,this.viewPortBounds=o,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,r=t.height,i=void 0===r?220:r,o=t.showEdge,a=void 0!==o&&o,u=t.isShowHeader,s=void 0!==u&&u,l=t.isShowCloseIcon,c=void 0!==l&&l,d=t.leftPosition,h=t.topPosition,p=t.rightPosition,f=void 0===p?0:p,v=t.bottomPosition,g=void 0===v?0:v,y=t.headerTitle,m=void 0===y?"导航":y;this.width=n,this.height=i,this.showEdge=a,this.isShowHeader=s,this.isShowCloseIcon=c,this.leftPosition=d,this.rightPosition=void 0!==d?void 0:f,this.topPosition=h,this.bottomPosition=void 0!==h?void 0:g,this.headerTitle=m},t.prototype.initMiniMap=function(){var t=document.createElement("div");t.className="lf-mini-map-graph",t.style.width="".concat(this.width,"px"),t.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:t,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins}),this.miniMapWrap=t,this.createViewPort(),t.addEventListener("click",this.mapClick)},t.prototype.createMiniMap=function(t,e){var n,r=document.createElement("div");this.miniMapContainer=r,r.appendChild(this.miniMapWrap),r.style.position="absolute",void 0===t&&void 0===e||(this.leftPosition=t||0,this.topPosition=e||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),r.className="lf-mini-map",this.isShowCloseIcon||r.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||r.classList.add("lf-mini-map-no-header"),null===(n=this.container)||void 0===n||n.appendChild(r),this.miniMapWrap.appendChild(this.viewport);var i=document.createElement("div");i.className="lf-mini-map-header",i.innerText=this.headerTitle,r.appendChild(i);var o=document.createElement("span");o.className="lf-mini-map-close",o.addEventListener("click",this.hide),r.appendChild(o)},t.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var t=this.miniMapContainer.style;void 0!==this.rightPosition?(t.right="".concat(this.rightPosition,"px"),t.left=""):(t.left="".concat(this.leftPosition,"px"),t.right=""),void 0!==this.bottomPosition?(t.bottom="".concat(this.bottomPosition,"px"),t.top=""):(t.top="".concat(this.topPosition,"px"),t.bottom="")}},t.prototype.removeMiniMap=function(){var t;this.miniMapContainer&&(null===(t=this.container)||void 0===t||t.removeChild(this.miniMapContainer))},t.prototype.updateBounds=function(t){t&&this.updateElementAreaBounds(t),this.updateViewPortBounds(),this.bounds={left:Math.min(this.elementAreaBounds.left,this.viewPortBounds.left),right:Math.max(this.elementAreaBounds.right,this.viewPortBounds.right),top:Math.min(this.elementAreaBounds.top,this.viewPortBounds.top),bottom:Math.max(this.elementAreaBounds.bottom,this.viewPortBounds.bottom)}},t.prototype.updateElementAreaBounds=function(t){var e={left:0,right:0,top:0,bottom:0},n=t.nodes;n&&n.length>0&&n.forEach((function(t){var n,r,i=t.x,o=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,u=null!==(r=t.height)&&void 0!==r?r:200,s=i-a/2,l=i+a/2,c=o-u/2,d=o+u/2;e.left=Math.min(s,e.left),e.right=Math.max(l,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(d,e.bottom)})),this.elementAreaBounds=e},t.prototype.updateViewPortBounds=function(){var t=this.lf.getTransform(),e=t.TRANSLATE_X,n=t.TRANSLATE_Y,r=t.SCALE_X,i=t.SCALE_Y,o=this.lf.graphModel,a=o.width,u=o.height;this.viewPortBounds={left:-e/r,right:(-e+a)/r,top:-n/i,bottom:(-n+u)/i}},t.prototype.resetData=function(t){var e=t.nodes,n=t.edges;return e.forEach((function(t){t.text=void 0})),this.showEdge&&n.forEach((function(t){t.text=void 0})),{nodes:e,edges:this.showEdge?n:[]}},t.prototype.setView=function(t){var e,n;if(void 0===t&&(t=!0),t){var r=this.lf.getGraphRawData(),i=this.resetData(r),o=this.lf.viewMap,a=this.lf.graphModel.modelMap,u=this.lfMap.viewMap;try{for(var s=y(o.keys()),l=s.next();!l.done;l=s.next()){var c=l.value;u.has(c)||this.lfMap.register({type:c,view:o.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}this.lfMap.render(i),this.updateBounds(i)}else this.updateBounds();var d=this.bounds,h=d.left,p=d.top,f=d.right-h,v=d.bottom-p,g=this.width/f,m=this.height/v,b=Math.min(g,m);this.scale=b;var x=h-(this.width/b-f)/2,_=p-(this.height/b-v)/2;if(this.lfMap.graphModel.transformModel.translate(-x+this.translateX,-_+this.translateY),this.translateX=x,this.translateY=_,this.miniMapWrap.firstChild){var w=this.miniMapWrap.firstChild.style;w.pointerEvents="none",w.transform="matrix(".concat(b,", 0, 0, ").concat(b,", 0, 0)"),w.transformOrigin="left top",w.height="".concat(this.height/b,"px"),w.width="".concat(this.width/b,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,r=e.TRANSLATE_Y,i=e.SCALE_X,o=e.SCALE_Y,a=this.lf.graphModel,u=a.width,s=a.height;this.viewPortLeft=-n/i,this.viewPortTop=-r/o,this.viewPortWidth=u/i*this.scale,this.viewPortHeight=s/o*this.scale,t.width="".concat(this.viewPortWidth,"px"),t.height="".concat(this.viewPortHeight,"px"),t.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),t.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},t.prototype.createViewPort=function(){var t=document.createElement("div");t.className="lf-minimap-viewport",t.addEventListener("mousedown",this.startDrag),t.addEventListener("click",(function(t){t.stopPropagation()})),this.viewport=t},t.pluginName="miniMap",t}(),ig={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function og(t,e,n,r){var i,o="",a="";t[0]===e[0]?o=t[1]>e[1]?"t":"b":t[1]===e[1]&&(o=t[0]>e[0]?"l":"r"),e[0]===n[0]?a=e[1]>n[1]?"t":"b":e[1]===n[1]&&(a=e[0]>n[0]?"l":"r");var u=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||.2*r,s="".concat(o).concat(a),l=ig[s]||"-",c="L ".concat(t[0]," ").concat(t[1]);if("-"===l)c+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var d=m(function(t,e,n,r){var i=[t[0],t[1]],o=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(i[1]+=r,o[0]+=r):"lb"===e&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return"tl"===e?(i[1]+=r,o[0]-=r):"rb"===e&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return"br"===e?(i[1]-=r,o[0]+=r):"lt"===e&&(i[0]+=r,o[1]-=r),[i,o];case"br":return"bl"===e?(i[1]-=r,o[0]-=r):"rt"===e&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}(e,s,l,u),2),h=d[0],p=d[1];h&&p&&(c+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(p[0]," ").concat(p[1]),i=m(p,2),e[0]=i[0],e[1]=i[1])}return c}function ag(t,e){var n=0,r="";if(2===t.length)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){r+=og(t[n-1],t[n],t[1+n++],e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}var ug=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getEdge=function(){var t=this.props.model,n=t.points,r=t.isAnimation,i=t.arrowConfig,o=t.radius,a=void 0===o?5:o,u=t.getEdgeStyle(),s=t.getEdgeAnimationStyle(),l=function(t){for(var e=t,n=1;n<e.length-1;){var r=m(e[n-1],2),i=r[0],o=r[1],a=m(e[n],2),u=a[0],s=a[1],l=m(e[n+1],2),c=l[0],d=l[1];i===u&&u===c||o===s&&s===d?e.splice(n,1):n++}return e}(n.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),c=ag(l,a),d=v(v(v({style:r?s:{}},u),i),{fill:"none"});return e.h("path",v({d:c},d))},n}(e.PolylineEdge),sg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(e.PolylineEdgeModel),lg=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.paths=[],e.getPathes=function(){if(!n.startNodeType)throw new Error("需要预先指定开始节点类型");return n.getPathes()},e.setRawPaths=function(t){n.setPathes(t)},e.getRawPathes=function(){return n.paths},e.setStartNodeType=function(t){n.startNodeType=t}}return t.prototype.setPathes=function(t){this.paths=t.map((function(t){return{routeId:t.routeId,name:t.name,elements:t.elements,type:t.type,similarElement:null,weight:0}}))},t.prototype.getPathes=function(){var t=this,e=this.lf.getGraphRawData(),n=new Map,r=[];e.nodes.forEach((function(e){n.set(e.id,{id:e.id,data:e,nextNodes:[]}),e.type===t.startNodeType&&r.push(e.id)})),e.edges.forEach((function(t){var e=n.get(t.sourceNodeId);null==e||e.nextNodes.push(t.targetNodeId)}));var i=[];return r.forEach((function(e){var r=n.get(e);r&&(i=i.concat(t.findPathElements(r,n,[])))})),this.getNewPathes(i)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var r=b([],m(n),!1);if(r.push(t.id),0===t.nextNodes.length)return[r];for(var i=[],o=0;o<t.nextNodes.length;o++){var a=e.get(t.nextNodes[o]),u=void 0;if(a){var s=r.indexOf(a.id);u=-1!==s?[b(b([],m(r.slice(s)),!1),[a.id],!1)]:this.findPathElements(a,e,b([],m(r),!1)),i=i.concat(u)}}return i},t.prototype.getNewPathes=function(t){var e=this,n=[],r=new Set;t.forEach((function(t){console.log("elements",t);var i=e.getNewId("path"),o=e.getNewId("路径"),a=e.isLoopPath(t),u=t.join(",");r.has(u)||(r.add(u),n.push({routeId:i,name:o,elements:t,type:a,weight:0,similarElement:""}))}));var i=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<i.length;n++){var r=i[n],o=e.similar2Path(b([],m(t.elements),!1),b([],m(r.elements),!1));o>t.weight&&r.weight<=o&&(t.weight=o,t.similarElement=r,o===r.weight&&r.similarElement?(r.similarElement.similarElement=null,r.similarElement.weight=0,r.similarElement=null,r.weight=0):(r.similarElement=t,r.weight=o))}})),n.forEach((function(t){t.similarElement&&t.similarElement.similarElement===t&&(t.routeId=t.similarElement.routeId,t.name=t.similarElement.name),delete t.similarElement,delete t.weight})),this.setPathes(n),n},t.prototype.similar2Path=function(t,e){var n=0,r=t.length+e.length;t.sort(),e.sort();for(var i=t.shift(),o=e.shift();void 0!==i&&void 0!==o;)i===o?(n++,i=t.shift(),o=e.shift()):i<o?i=t.shift():i>o&&(o=e.shift());return n/r*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(w())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),cg=-1,dg=0,hg=1,pg=function(){function t(t){var e=t.lf,n=this;this.levelHeight=[],this.newNodeMap=new Map,this.lf=e,this.trunk=[],e.layout=function(t){var e=n.lf.getGraphRawData();n.lf.setStartNodeType(t);var r=n.lf.getPathes();return n.levelHeight=[],n.newNodeMap=new Map,n.layout(e,r)}}return t.prototype.layout=function(t,e){var n=this,r=[];e.forEach((function(t){var e=t.elements;e.length>r.length?r=e:e.length===r.length&&JSON.stringify(e)===JSON.stringify(n.trunk)&&(r=n.trunk)})),this.trunk=r;for(var i=this.formatData(t),o={nodes:[],edges:[]},a=r.length-1;a>=0;a--)this.setNodePosition(r[a],i,o,a,1);this.lf.graphModel.graphDataToModel(o)},t.prototype.setNodePosition=function(t,e,n,r,i){var o=this,a=e[t],u=a.text,s=a.type,l=a.next,c=a.properties,d=160*r+40,h=120*i,p={id:t,x:d,text:u,y:h,type:s,properties:c};return u&&"object"==typeof u&&(p.text=v(v({},u),{x:d+u.x,y:h+u.y})),this.newNodeMap.set(p.id,{x:p.x,y:p.y,type:s}),n.nodes.push(p),a.isFixed=!0,this.addLevelHeight(r,1),l&&l.length>0&&l.forEach((function(i){if(!e[i.nodeId].isFixed){var a=o.getLevelHeight(r+1);o.addLevelHeight(r,1),o.setNodePosition(i.nodeId,e,n,r+1,a+1)}n.edges.push(v({id:i.edgeId,type:i.edgeType,sourceNodeId:t,targetNodeId:i.nodeId,properties:i.properties,text:i.text},o.getEdgeDataPoints(t,i.nodeId)))})),p},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),r=this.newNodeMap.get(e),i=this.getShape(t),o=i.width,a=i.height,u=this.getShape(e),s=u.width,l=u.height,c=this.getRelativePosition(n,r),d={x:n.x,y:n.y},h={x:r.x,y:r.y};switch(c){case dg:d.x=n.x+o/2,h.x=r.x-s/2;break;case cg:d.y=n.y+a/2,h.x=r.x-s/2;break;case hg:d.x=n.x+o/2,h.y=r.y+l/2}return{startPoint:d,endPoint:h}},t.prototype.getRelativePosition=function(t,e){var n=t.y,r=e.y;return n<r?-1:n===r?0:1},t.prototype.getShape=function(t){var e,n,r=this.lf.getNodeModelById(t);return{height:null!==(e=null==r?void 0:r.height)&&void 0!==e?e:0,width:null!==(n=null==r?void 0:r.width)&&void 0!==n?n:0}},t.prototype.formatData=function(t){var e=t.nodes.reduce((function(t,e){var n=e.type,r=e.properties,i=e.text,o=e.x,a=e.y;return i&&"object"==typeof i&&(i.x=i.x-o,i.y=i.y-a),t[e.id]={type:n,properties:r,text:i,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,r=t.targetNodeId,i=t.id,o=t.properties,a=t.text,u=a;"object"==typeof a&&(u=a.value),e[n].next.push({edgeId:i,nodeId:r,edgeType:t.type,properties:o,text:u}),e[r].prev.push({edgeId:i,nodeId:n,properties:o,text:u})})),e},t.prototype.addLevelHeight=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var r=this.levelHeight[t];r||(r={positiveHeight:0,negativeHeight:0},this.levelHeight[t]=r),n?r.negativeHeight-=e:r.positiveHeight+=e},t.prototype.getLevelHeight=function(t,e){void 0===e&&(e=!1);var n=this.levelHeight[t];return n?e?n.negativeHeight:n.positiveHeight:0},t.pluginName="AutoLayout",t}(),fg=function(t,e){var n=[],r=[],i=function(t,r,o){o&&r.unshift.apply(r,b([],m(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==o?void 0:o.id}).map((function(t){return t.id}))),!1)),r.includes(t.id)?n.push(r):(r.unshift(t.id),t.incoming.nodes.length?t.incoming.nodes.forEach((function(e){i(e,r.slice(),t)})):n.push(r))},o=function(t,n,i){i&&n.push.apply(n,b([],m(e.getEdgeModels({sourceNodeId:null==i?void 0:i.id,targetNodeId:t.id}).map((function(t){return t.id}))),!1)),n.includes(t.id)?r.push(n):(n.push(t.id),t.outgoing.nodes.length?t.outgoing.nodes.forEach((function(e){o(e,n.slice(),t)})):r.push(n))};return i(t,[]),o(t,[]),b([],m(new Set(b(b([],m(n.flat()),!1),m(r.flat()),!1))),!1)},vg=function(){function t(t){var e=t.lf;this.mode="path",this.manual=!1,this.tempStyles={},this.lf=e}return t.prototype.setMode=function(t){this.mode=t},t.prototype.setManual=function(t){this.manual=t},t.prototype.highlightSingle=function(t){var e=this.lf.getModelById(t);"node"===(null==e?void 0:e.BaseType)?e.updateStyles(this.tempStyles[t]):"edge"===(null==e?void 0:e.BaseType)&&(e.updateStyles(this.tempStyles[t]),e.sourceNode.updateStyles(this.tempStyles[e.sourceNode.id]),e.targetNode.updateStyles(this.tempStyles[e.targetNode.id]))},t.prototype.highlightPath=function(t){var e=this,n=function(t,e){var n=e.getModelById(t);return fg("node"===(null==n?void 0:n.BaseType)?n:null==n?void 0:n.targetNode,e)}(t,this.lf);n.forEach((function(t){var n;null===(n=e.lf.getModelById(t))||void 0===n||n.updateStyles(e.tempStyles[t])}))},t.prototype.highlight=function(t,e){var n=this;(void 0===e&&(e=this.mode),this.manual)||(Object.keys(this.tempStyles).length&&this.restoreHighlight(),Object.values(this.lf.graphModel.modelsMap).forEach((function(t){var e="node"===t.BaseType?t.getNodeStyle():t.getEdgeStyle();n.tempStyles[t.id]=v({},e),t.setStyles({opacity:.1})})),{single:this.highlightSingle.bind(this),path:this.highlightPath.bind(this)}[e](t))},t.prototype.restoreHighlight=function(){var t=this;Object.keys(this.tempStyles).length&&(Object.values(this.lf.graphModel.modelsMap).forEach((function(e){var n,r=null!==(n=t.tempStyles[e.id])&&void 0!==n?n:{};e.updateStyles(v({},r))})),this.tempStyles={})},t.prototype.render=function(){var t=this;this.lf.on("node:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("edge:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("node:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("edge:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("history:change",this.restoreHighlight.bind(this))},t.prototype.destroy=function(){},t.pluginName="highlight",t}();t.AutoLayout=pg,t.BPMNAdapter=Rv,t.BPMNBaseAdapter=jv,t.BPMNElements=Yf,t.BoundaryEventFactory=yt,t.BpmnAdapter=ut,t.BpmnElement=F,t.BpmnXmlAdapter=st,t.ContextMenu=tg,t.Control=Yv,t.CurvedEdge=ug,t.CurvedEdgeModel=sg,t.DiamondResize=Pf,t.DiamondResizeModel=Sf,t.DiamondResizeView=Af,t.DndPanel=eg,t.EllipseResize=Nf,t.EllipseResizeModel=Mf,t.EllipseResizeView=Ef,t.EndEventFactory=ft,t.EndEventModel=S,t.EndEventView=A,t.ExclusiveGatewayModel=k,t.ExclusiveGatewayView=j,t.FlowPath=lg,t.GatewayNodeFactory=Tt,t.Group=Wf,t.GroupNode=Lf,t.GroupNodeModel=Df,t.Highlight=vg,t.HtmlResize=Cf,t.HtmlResizeModel=Of,t.HtmlResizeView=Tf,t.InsertNodeInPolyline=Vv,t.IntermediateCatchEventFactory=vt,t.IntermediateThrowEventFactory=mt,t.Menu=Jv,t.MiniMap=rg,t.NodeResize=Rf,t.RectResize=If,t.RectResizeModel=kf,t.RectResizeView=jf,t.SelectionSelect=ng,t.SequenceFlowModel=O,t.SequenceFlowView=T,t.ServiceTaskModel=R,t.ServiceTaskView=D,t.Snapshot=Dv,t.StartEventFactory=gt,t.StartEventModel=M,t.StartEventView=E,t.SubProcessFactory=Ff,t.TaskNodeFactory=kt,t.UserTaskModel=B,t.UserTaskView=z,t.bpmnUtils=pt,t.convertNormalToXml=Sv,t.convertXmlToNormal=Av,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=ag,t.handleAttributes=V,t.icons=Ot,t.lfJson2Xml=Z,t.lfXml2Json=J,t.multiInstanceIcon=Ct,t.sequenceFlowFactory=Hf,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===Lv.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,r=t.properties,i=t.key,o=t.type,a=r.text,u=r.name,s=r.startPoint,l=r.endPoint,c=r.pointsList,d={id:i,type:Bv[o],sourceNodeId:e[0],targetNodeId:n[0],text:a||u,properties:{}};s&&(d.startPoint=JSON.parse(s)),l&&(d.endPoint=JSON.parse(l)),c&&(d.pointsList=JSON.parse(c));var h=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===h.indexOf(e)&&(d.properties[e]=t.properties[e])})),d}(t);e.edges.push(n)}else{var r=function(t){var e=t.properties,n=t.key,r=t.type,i=t.bounds,o=e.x,a=e.y,u=e.text;if(void 0===o){var s=m(i,2),l=s[0],c=l.x,d=l.y,h=s[1];o=(c+h.x)/2,a=(d+h.y)/2}var p={id:n,type:Bv[r],x:o,y:a,text:u,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(p.properties[e]=t.properties[e])})),p}(t);e.nodes.push(r)}})),e},t.toNormalJson=nt,t.toTurboData=function(t){var e=new Map,n={flowElementList:[]};return t.nodes.forEach((function(t){var r=function(t){var e=t.id,n=t.type,r=t.x,i=t.y,o=t.text,a=void 0===o?"":o,u=t.properties;return{incoming:[],outgoing:[],dockers:[],type:zv(n),properties:v(v({},u),{name:a&&a.value||"",x:r,y:i,text:a}),key:e}}(t);n.flowElementList.push(r),e.set(t.id,r)})),t.edges.forEach((function(t){var r=function(t){var e=t.id,n=t.type,r=t.sourceNodeId,i=t.targetNodeId,o=t.startPoint,a=t.endPoint,u=t.pointsList,s=t.text,l=void 0===s?"":s,c=t.properties;return{incoming:[r],outgoing:[i],type:zv(n),dockers:[],properties:v(v({},c),{name:l&&l.value||"",text:l,startPoint:JSON.stringify(o),endPoint:JSON.stringify(a),pointsList:JSON.stringify(u)}),key:e}}(t);e.get(t.sourceNodeId).outgoing.push(r.key),e.get(t.targetNodeId).incoming.push(r.key),n.flowElementList.push(r)})),n},t.toXmlJson=et,t.useDefinition=Vf}));
12
12
  //# sourceMappingURL=index.min.js.map
@@ -23,7 +23,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
23
23
  }
24
24
  return to.concat(ar || Array.prototype.slice.call(from));
25
25
  };
26
- import { EventType, formateAnchorConnectValidateData, } from '@logicflow/core';
26
+ import { EventType, formatAnchorConnectValidateData, } from '@logicflow/core';
27
27
  import { cloneDeep } from 'lodash-es';
28
28
  import { isNodeInSegment } from './edge';
29
29
  var InsertNodeInPolyline = /** @class */ (function () {
@@ -81,8 +81,8 @@ var InsertNodeInPolyline = /** @class */ (function () {
81
81
  // TODO: nodeData 与 isAllowConnectedAsSource 方法需要的类型 BaseNodeModel 不一致,少了 target 属性等,需要验证是否可用。
82
82
  var sourceRuleResultData = sourceNodeModel.isAllowConnectedAsSource(nodeData, sourceAnchorInfo, targetAnchorInfo);
83
83
  var targetRuleResultData = targetNodeModel.isAllowConnectedAsTarget(nodeData, sourceAnchorInfo, targetAnchorInfo);
84
- var _a = formateAnchorConnectValidateData(sourceRuleResultData), isSourcePass = _a.isAllPass, sourceMsg = _a.msg;
85
- var _b = formateAnchorConnectValidateData(targetRuleResultData), isTargetPass = _b.isAllPass, targetMsg = _b.msg;
84
+ var _a = formatAnchorConnectValidateData(sourceRuleResultData), isSourcePass = _a.isAllPass, sourceMsg = _a.msg;
85
+ var _b = formatAnchorConnectValidateData(targetRuleResultData), isTargetPass = _b.isAllPass, targetMsg = _b.msg;
86
86
  return {
87
87
  isPass: isSourcePass && isTargetPass,
88
88
  sourceMsg: sourceMsg,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/insert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AS,IAAI,WAAW,CAAC,SAAS;qBACpD,CACF,CAAA;oBACD,+BAA+B;oBAC/B,UAAU,CAAC;wBACT,KAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;oBACjB,CAAC,EAAE,GAAG,CAAC,CAAA;oBACP,MAAK;gBACP,CAAC;qBAAM,CAAC;oBACN,MAAK;gBACP,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IA3KM,+BAAU,GAAG,sBAAsB,CAAA;IA4K5C,2BAAC;CAAA,AA7KD,IA6KC;SA7KY,oBAAoB;AA+KjC,eAAe,oBAAoB,CAAA"}
@@ -84,8 +84,8 @@ var InsertNodeInPolyline = /** @class */ (function () {
84
84
  // TODO: nodeData 与 isAllowConnectedAsSource 方法需要的类型 BaseNodeModel 不一致,少了 target 属性等,需要验证是否可用。
85
85
  var sourceRuleResultData = sourceNodeModel.isAllowConnectedAsSource(nodeData, sourceAnchorInfo, targetAnchorInfo);
86
86
  var targetRuleResultData = targetNodeModel.isAllowConnectedAsTarget(nodeData, sourceAnchorInfo, targetAnchorInfo);
87
- var _a = (0, core_1.formateAnchorConnectValidateData)(sourceRuleResultData), isSourcePass = _a.isAllPass, sourceMsg = _a.msg;
88
- var _b = (0, core_1.formateAnchorConnectValidateData)(targetRuleResultData), isTargetPass = _b.isAllPass, targetMsg = _b.msg;
87
+ var _a = (0, core_1.formatAnchorConnectValidateData)(sourceRuleResultData), isSourcePass = _a.isAllPass, sourceMsg = _a.msg;
88
+ var _b = (0, core_1.formatAnchorConnectValidateData)(targetRuleResultData), isTargetPass = _b.isAllPass, targetMsg = _b.msg;
89
89
  return {
90
90
  isPass: isSourcePass && isTargetPass,
91
91
  sourceMsg: sourceMsg,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/insert-node-in-polyline/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAKwB;AACxB,uCAAqC;AACrC,+BAAwC;AAIxC;IA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;IACH,CAAC;IA3KM,+BAAU,GAAG,sBAAsB,CAAA;IA4K5C,2BAAC;CAAA,AA7KD,IA6KC;AA7KY,oDAAoB;AA+KjC,kBAAe,oBAAoB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logicflow/extension",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "LogicFlow Extensions",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -20,12 +20,15 @@
20
20
  "author": "Logicflow-Team",
21
21
  "license": "Apache-2.0",
22
22
  "peerDependencies": {
23
- "@logicflow/core": "2.0.0-beta.2"
23
+ "@logicflow/core": "2.0.0-beta.3"
24
24
  },
25
25
  "dependencies": {
26
+ "lodash-es": "^4.17.21",
26
27
  "@antv/hierarchy": "^0.6.11",
27
- "preact": "^10.17.1",
28
- "@logicflow/core": "2.0.0-beta.2"
28
+ "@logicflow/core": "2.0.0-beta.3"
29
+ },
30
+ "devDependencies": {
31
+ "preact": "^10.17.1"
29
32
  },
30
33
  "scripts": {
31
34
  "clean:turbo": "rss",
@@ -2,7 +2,7 @@ import LogicFlow, {
2
2
  BaseNodeModel,
3
3
  PolylineEdgeModel,
4
4
  EventType,
5
- formateAnchorConnectValidateData,
5
+ formatAnchorConnectValidateData,
6
6
  } from '@logicflow/core'
7
7
  import { cloneDeep } from 'lodash-es'
8
8
  import { isNodeInSegment } from './edge'
@@ -85,9 +85,9 @@ export class InsertNodeInPolyline {
85
85
  )
86
86
 
87
87
  const { isAllPass: isSourcePass, msg: sourceMsg } =
88
- formateAnchorConnectValidateData(sourceRuleResultData)
88
+ formatAnchorConnectValidateData(sourceRuleResultData)
89
89
  const { isAllPass: isTargetPass, msg: targetMsg } =
90
- formateAnchorConnectValidateData(targetRuleResultData)
90
+ formatAnchorConnectValidateData(targetRuleResultData)
91
91
 
92
92
  return {
93
93
  isPass: isSourcePass && isTargetPass,