vue-safe-force-graph 2.0.52 → 2.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -276,7 +276,15 @@ app.use(Graph)
276
276
  | handle-data-loaded | 图加载数据完成后 的事件通知。会返回图中所有的节点数据 | `<ForceGraphByCanvas :graph-api="graphApi" :module="module" :start-node="startNode" @handle-data-loaded="handleDataLoaded" @custom-contextmenu-click="handleContextmenu" @handle-select-node="handleSelectNode" />` |
277
277
  | custom-contextmenu-click | 自定义右键菜单的点击事件。返回 **eventName** 事件名 、**customConfig**、 **当前点击的nodes** 节点的整个数据, 所有节点**allNodes** | 如上 |
278
278
  | handle-select-node | 选择节点事件 | 如上 |
279
- | controlOperation | 操作控制,传入node数据和对应api操作。如显示隐藏按钮 | 示例如下 |
279
+ | | | |
280
+
281
+ ## 方法
282
+
283
+ | 方法名 | 说明 | 参数 |
284
+ | ------------------ | ------------------------------------------------------------ | ---- |
285
+ | controlOperation | 操作控制,传入node数据和对应api操作。如显示隐藏按钮,示例如下 | |
286
+ | handleCustomSelect | 选择节点 | |
287
+ | | | |
280
288
 
281
289
  ##### controlOperation示例
282
290
 
@@ -315,6 +323,16 @@ function hideNode() {
315
323
  - `un_fix_nodes`取消固定节点
316
324
  - `delete_node`删除节点
317
325
 
326
+
327
+
328
+ ##### handleCustomSelect
329
+
330
+ ```
331
+ const handleHighLight = () => {
332
+ forceGraph.value.handleCustomSelect('include', 'id', ['xxxs0'])
333
+ }
334
+ ```
335
+
318
336
  ### 图标加载方式
319
337
 
320
338
  图标icon图片有2中加载方式:1从cdn中加载,2打包为base64到npm包中加载。
@@ -40363,7 +40363,7 @@ const NAe = /* @__PURE__ */ ln(qTe, [["render", OAe], ["__scopeId", "data-v-eb4f
40363
40363
  utime: "2019-05-06 15:08:10",
40364
40364
  children: []
40365
40365
  }
40366
- ], PAe = "vue-safe-force-graph", RAe = "2.0.52", LAe = "force_graph in security area", DAe = "jason zhang", MAe = "./lib/vue-safe-force-graph.js", FAe = "./lib/vue-safe-force-graph.umd.cjs", $Ae = "module", BAe = [
40366
+ ], PAe = "vue-safe-force-graph", RAe = "2.0.53", LAe = "force_graph in security area", DAe = "jason zhang", MAe = "./lib/vue-safe-force-graph.js", FAe = "./lib/vue-safe-force-graph.umd.cjs", $Ae = "module", BAe = [
40367
40367
  "/lib/"
40368
40368
  ], UAe = {
40369
40369
  ".": {
@@ -141,5 +141,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
141
141
  \v\f\r                 \u2028\u2029\uFEFF`,sO=Ke("".replace),T3e=RegExp("^["+Tw+"]+"),A3e=RegExp("(^|[^"+Tw+"])["+Tw+"]+$"),Aw=function(e){return function(t){var n=N3e(k3e(t));return 1&e&&(n=sO(n,T3e,"")),2&e&&(n=sO(n,A3e,"$1")),n}},O3e={start:Aw(1),end:Aw(2),trim:Aw(3)},I3e=pt,R3e=wt,aO=Ge,lO=S3e,cO=Ke,P3e=wh,dO=Yt,L3e=Zp,B3e=_s,D3e=ih,uO=d1,M3e=ze,F3e=Pa.f,$3e=Ra.f,z3e=Rn.f,U3e=oO,j3e=O3e.trim,Vp="Number",El=aO[Vp];lO[Vp];var Ow=El.prototype,q3e=aO.TypeError,H3e=cO("".slice),eg=cO("".charCodeAt),G3e=function(e){var t,n,r,o,a,l,c,d,u=uO(e,"number");if(D3e(u))throw new q3e("Cannot convert a Symbol value to a number");if(typeof u=="string"&&u.length>2){if(u=j3e(u),(t=eg(u,0))===43||t===45){if((n=eg(u,2))===88||n===120)return NaN}else if(t===48){switch(eg(u,1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+u}for(l=(a=H3e(u,2)).length,c=0;c<l;c++)if((d=eg(a,c))<48||d>o)return NaN;return parseInt(a,r)}}return+u},Iw=P3e(Vp,!El(" 0o1")||!El("0b1")||El("+0x1")),tg=function(e){var t,n=arguments.length<1?0:El(function(r){var o=uO(r,"number");return typeof o=="bigint"?o:G3e(o)}(e));return B3e(Ow,t=this)&&M3e(function(){U3e(t)})?L3e(Object(n),this,tg):n};tg.prototype=Ow,Iw&&(Ow.constructor=tg),I3e({global:!0,constructor:!0,wrap:!0,forced:Iw},{Number:tg}),Iw&&function(e,t){for(var n,r=R3e?F3e(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;r.length>o;o++)dO(t,n=r[o])&&!dO(e,n)&&z3e(e,n,$3e(t,n))}(lO[Vp],El);var W3e=Li,K3e=xr,Y3e=_o,J3e=RangeError,X3e=pt,Rw=Ke,Q3e=Li,Z3e=oO,V3e=function(e){var t=K3e(Y3e(this)),n="",r=W3e(e);if(r<0||r===1/0)throw new J3e("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n},fO=ze,e4e=RangeError,hO=String,pO=Math.floor,Pw=Rw(V3e),gO=Rw("".slice),Ud=Rw(1 .toFixed),xl=function(e,t,n){return t===0?n:t%2==1?xl(e,t-1,n*e):xl(e*e,t/2,n)},kl=function(e,t,n){for(var r=-1,o=n;++r<6;)o+=t*e[r],e[r]=o%1e7,o=pO(o/1e7)},Lw=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=pO(r/t),r=r%t*1e7},mO=function(e){for(var t=6,n="";--t>=0;)if(n!==""||t===0||e[t]!==0){var r=hO(e[t]);n=n===""?r:n+Pw("0",7-r.length)+r}return n};X3e({target:"Number",proto:!0,forced:fO(function(){return Ud(8e-5,3)!=="0.000"||Ud(.9,0)!=="1"||Ud(1.255,2)!=="1.25"||Ud(0xde0b6b3a7640080,0)!=="1000000000000000128"})||!fO(function(){Ud({})})},{toFixed:function(e){var t,n,r,o,a=Z3e(this),l=Q3e(e),c=[0,0,0,0,0,0],d="",u="0";if(l<0||l>20)throw new e4e("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return hO(a);if(a<0&&(d="-",a=-a),a>1e-21)if(t=function(f){for(var p=0,h=f;h>=4096;)p+=12,h/=4096;for(;h>=2;)p+=1,h/=2;return p}(a*xl(2,69,1))-69,n=t<0?a*xl(2,-t,1):a/xl(2,t,1),n*=4503599627370496,(t=52-t)>0){for(kl(c,0,n),r=l;r>=7;)kl(c,1e7,0),r-=7;for(kl(c,xl(10,r,1),0),r=t-1;r>=23;)Lw(c,1<<23),r-=23;Lw(c,1<<r),kl(c,1,1),Lw(c,2),u=mO(c)}else kl(c,0,n),kl(c,1<<-t,0),u=mO(c)+Pw("0",l);return u=l>0?d+((o=u.length)<=l?"0."+Pw("0",l-o)+u:gO(u,0,o-l)+"."+gO(u,o-l)):d+u}});var vO=function(e,t){if(PerformanceObserver)if((PerformanceObserver.supportedEntryTypes||[]).includes(e))try{new PerformanceObserver(function(n){n&&t(n)}).observe({type:e,buffered:!0})}catch(n){t("err")}else t("err");else t("err")},Qt=function(e){var t=Math.min(Math.max(e,0),15e3);return Number.isNaN(t)?0:t%1!=0?Number(t.toFixed(2)):t},t4e=Er.filter;pt({target:"Array",proto:!0,forced:!Fh("filter")},{filter:function(e){return t4e(this,e,arguments.length>1?arguments[1]:void 0)}});var n4e=function(){function e(t){Yf(this,e),Ai(this,"performanceData",{fcp:0,fp:0,lcp:0}),Ai(this,"commit",function(){}),this.webCoreIns=t}return Jf(e,[{key:"init",value:function(){try{if(!((t=window.performance)&&t.getEntriesByType&&t.timing))return;this.calcPerformanceTime()}catch(n){}var t}},{key:"calcNavigation",value:function(t){}},{key:"calcPerformanceTime",value:function(){var t=this;Promise.all([new Promise(function(n,r){var o=window.performance.timing,a=null;window.addEventListener("load",function l(){if(o.loadEventEnd>0){clearTimeout(a);var c=Qt(o.unloadEnd-o.unloadStart),d=Qt(o.redirectStart-o.redirectEnd),u=Qt(o.domainLookupStart-o.fetchStart),f=Qt(o.domainLookupEnd-o.domainLookupStart),p=Qt(o.connectEnd-o.connectStart),h=Qt(o.secureConnectionStart==0?0:o.connectEnd-o.secureConnectionStart),m=Qt(o.responseStart-o.requestStart),b=Qt(o.domInteractive-o.fetchStart),w=Qt(o.responseEnd-o.responseStart),_=Qt(o.domContentLoadedEventEnd-o.fetchStart),C=Qt(o.domInteractive-o.responseEnd),k=Qt(o.loadEventStart-o.domContentLoadedEventEnd),S=Qt(o.loadEventEnd-o.loadEventStart),E=Qt(o.loadEventEnd-o.fetchStart);n({unloadTime:c,redirectTime:d,appCacheTime:u,dnsTime:f,tcpTime:p,sslTime:h,ttfb:m,contentTime:w,domParseTime:C,tti:b,domReadyTime:_,loadEventTime:S,loadFinishTime:E,loadResourceTime:k,resource:""})}else a=setTimeout(l,100)},!1)}),new Promise(function(n,r){vO("paint",function(o){var a=0,l=0;if(o!=="err"){var c,d=Xv(o.getEntries());try{for(d.s();!(c=d.n()).done;){var u=c.value,f=u.name,p=u.startTime;f==="first-paint"&&(a=Qt(p)),f==="first-contentful-paint"&&(l=Qt(p))}}catch(h){d.e(h)}finally{d.f()}}n({fp:a,fcp:l})})}).catch(function(n){return console.log(n)}),new Promise(function(n,r){vO("largest-contentful-paint",function(o){if(o=="err")n({lcp:0});else{var a,l=Xv(o.getEntries());try{for(l.s();!(a=l.n()).done;){var c=a.value;n({lcp:Qt(c.startTime)})}}catch(d){l.e(d)}finally{l.f()}}})}).catch(function(n){return console.log(n)})]).then(function(){var n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).reduce(function(r,o){return qc(qc({},r),o)},t.performanceData);n.type="performance",t.webCoreIns.commit(n)}).catch(function(n){console.log(n)})}},{key:"calcResourceTime",value:function(){}}]),e}(),r4e=["SCRIPT","STYLE","META","HEAD"];function Bw(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document.body,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!e||n>r||r4e.indexOf(e.tagName)>-1||o&&t>o)return n;var a=function(l,c){if(!c||!document.querySelector(l.tagName))return 0;var d=l.getBoundingClientRect(),u=d.top,f=d.height;return u>window.innerHeight||f<=0?0:1/Math.pow(2,c-1)}(e,t);return[].reduceRight.call(e.children,function(l,c){return Bw(c,t+1,l,r,o)},n+a)}var yO,Dw,Mw=ze,Fw=Ge.RegExp,$w=Mw(function(){var e=Fw("a","y");return e.lastIndex=2,e.exec("abcd")!==null}),i4e=$w||Mw(function(){return!Fw("a","y").sticky}),o4e=$w||Mw(function(){var e=Fw("^r","gy");return e.lastIndex=2,e.exec("str")!==null}),s4e={BROKEN_CARET:o4e,MISSED_STICKY:i4e,UNSUPPORTED_Y:$w},a4e=ze,l4e=Ge.RegExp,c4e=a4e(function(){var e=l4e(".","s");return!(e.dotAll&&e.test(`
142
142
  `)&&e.flags==="s")}),d4e=ze,u4e=Ge.RegExp,f4e=d4e(function(){var e=u4e("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),Nl=Ot,ng=Ke,h4e=xr,p4e=Lx,g4e=s4e,m4e=Ia,v4e=nn.get,y4e=c4e,b4e=f4e,w4e=Vv("native-string-replace",String.prototype.replace),rg=RegExp.prototype.exec,zw=rg,_4e=ng("".charAt),C4e=ng("".indexOf),S4e=ng("".replace),Uw=ng("".slice),jw=(Dw=/b*/g,Nl(rg,yO=/a/,"a"),Nl(rg,Dw,"a"),yO.lastIndex!==0||Dw.lastIndex!==0),bO=g4e.BROKEN_CARET,qw=/()??/.exec("")[1]!==void 0;(jw||qw||bO||y4e||b4e)&&(zw=function(e){var t,n,r,o,a,l,c,d=this,u=v4e(d),f=h4e(e),p=u.raw;if(p)return p.lastIndex=d.lastIndex,t=Nl(zw,p,f),d.lastIndex=p.lastIndex,t;var h=u.groups,m=bO&&d.sticky,b=Nl(p4e,d),w=d.source,_=0,C=f;if(m&&(b=S4e(b,"y",""),C4e(b,"g")===-1&&(b+="g"),C=Uw(f,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&_4e(f,d.lastIndex-1)!==`
143
143
  `)&&(w="(?: "+w+")",C=" "+C,_++),n=new RegExp("^(?:"+w+")",b)),qw&&(n=new RegExp("^"+w+"$(?!\\s)",b)),jw&&(r=d.lastIndex),o=Nl(rg,m?n:d,C),m?o?(o.input=Uw(o.input,_),o[0]=Uw(o[0],_),o.index=d.lastIndex,d.lastIndex+=o[0].length):d.lastIndex=0:jw&&o&&(d.lastIndex=d.global?o.index+o[0].length:r),qw&&o&&o.length>1&&Nl(w4e,o[0],n,function(){for(a=1;a<arguments.length-2;a++)arguments[a]===void 0&&(o[a]=void 0)}),o&&h)for(o.groups=l=m4e(null),a=0;a<h.length;a++)l[(c=h[a])[0]]=o[c[1]];return o});var ig=zw;pt({target:"RegExp",proto:!0,forced:/./.exec!==ig},{exec:ig});var wO=Jc,_O=Pn,E4e=ig,CO=ze,SO=dt,x4e=Oi,k4e=SO("species"),Hw=RegExp.prototype,N4e=Y1.charAt,EO=Ot,T4e=tn,A4e=ht,O4e=Ii,I4e=ig,R4e=TypeError,P4e=Ot,L4e=function(e,t,n,r){var o=SO(e),a=!CO(function(){var u={};return u[o]=function(){return 7},""[e](u)!==7}),l=a&&!CO(function(){var u=!1,f=/a/;return e==="split"&&((f={}).constructor={},f.constructor[k4e]=function(){return f},f.flags="",f[o]=/./[o]),f.exec=function(){return u=!0,null},f[o](""),!u});if(!a||!l||n){var c=wO(/./[o]),d=t(o,""[e],function(u,f,p,h,m){var b=wO(u),w=f.exec;return w===E4e||w===Hw.exec?a&&!m?{done:!0,value:c(f,p,h)}:{done:!0,value:b(p,f,h)}:{done:!1}});_O(String.prototype,e,d[0]),_O(Hw,o,d[1])}r&&x4e(Hw[o],"sham",!0)},B4e=tn,D4e=ys,M4e=Ss,Gw=xr,F4e=_o,$4e=oh,z4e=function(e,t,n){return t+(n?N4e(e,t).length:1)},xO=function(e,t){var n=e.exec;if(A4e(n)){var r=EO(n,e,t);return r!==null&&T4e(r),r}if(O4e(e)==="RegExp")return EO(I4e,e,t);throw new R4e("RegExp#exec called on incompatible receiver")};L4e("match",function(e,t,n){return[function(r){var o=F4e(this),a=D4e(r)?void 0:$4e(r,e);return a?P4e(a,r,o):new RegExp(r)[e](Gw(o))},function(r){var o=B4e(this),a=Gw(r),l=n(t,o,a);if(l.done)return l.value;if(!o.global)return xO(o,a);var c=o.unicode;o.lastIndex=0;for(var d,u=[],f=0;(d=xO(o,a))!==null;){var p=Gw(d[0]);u[f]=p,p===""&&(o.lastIndex=z4e(a,M4e(o.lastIndex),c)),f++}return f===0?null:u}]});var xn,Tl,og,Ww={exports:{}},kO=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined",U4e=kO,Kw=wt,mn=Ge,NO=ht,sg=At,Do=Yt,Yw=Ri,j4e=Ta,q4e=Oi,Jw=Pn,H4e=Eo,G4e=_s,ag=ed,Al=La,W4e=dt,K4e=th,TO=nn.enforce,Y4e=nn.get,lg=mn.Int8Array,Xw=lg&&lg.prototype,AO=mn.Uint8ClampedArray,OO=AO&&AO.prototype,ti=lg&&ag(lg),Ir=Xw&&ag(Xw),J4e=Object.prototype,Qw=mn.TypeError,IO=W4e("toStringTag"),Zw=K4e("TYPED_ARRAY_TAG"),cg="TypedArrayConstructor",zi=U4e&&!!Al&&Yw(mn.opera)!=="Opera",RO=!1,Ui={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Vw={BigInt64Array:8,BigUint64Array:8},PO=function(e){var t=ag(e);if(sg(t)){var n=Y4e(t);return n&&Do(n,cg)?n[cg]:PO(t)}},LO=function(e){if(!sg(e))return!1;var t=Yw(e);return Do(Ui,t)||Do(Vw,t)};for(xn in Ui)(og=(Tl=mn[xn])&&Tl.prototype)?TO(og)[cg]=Tl:zi=!1;for(xn in Vw)(og=(Tl=mn[xn])&&Tl.prototype)&&(TO(og)[cg]=Tl);if((!zi||!NO(ti)||ti===Function.prototype)&&(ti=function(){throw new Qw("Incorrect invocation")},zi))for(xn in Ui)mn[xn]&&Al(mn[xn],ti);if((!zi||!Ir||Ir===J4e)&&(Ir=ti.prototype,zi))for(xn in Ui)mn[xn]&&Al(mn[xn].prototype,Ir);if(zi&&ag(OO)!==Ir&&Al(OO,Ir),Kw&&!Do(Ir,IO))for(xn in RO=!0,H4e(Ir,IO,{configurable:!0,get:function(){return sg(this)?this[Zw]:void 0}}),Ui)mn[xn]&&q4e(mn[xn],Zw,xn);var Re={NATIVE_ARRAY_BUFFER_VIEWS:zi,TYPED_ARRAY_TAG:RO&&Zw,aTypedArray:function(e){if(LO(e))return e;throw new Qw("Target is not a typed array")},aTypedArrayConstructor:function(e){if(NO(e)&&(!Al||G4e(ti,e)))return e;throw new Qw(j4e(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(Kw){if(n)for(var o in Ui){var a=mn[o];if(a&&Do(a.prototype,e))try{delete a.prototype[e]}catch(l){try{a.prototype[e]=t}catch(c){}}}Ir[e]&&!n||Jw(Ir,e,n?t:zi&&Xw[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(Kw){if(Al){if(n){for(r in Ui)if((o=mn[r])&&Do(o,e))try{delete o[e]}catch(a){}}if(ti[e]&&!n)return;try{return Jw(ti,e,n?t:zi&&ti[e]||t)}catch(a){}}for(r in Ui)!(o=mn[r])||o[e]&&!n||Jw(o,e,t)}},getTypedArrayConstructor:PO,isView:function(e){if(!sg(e))return!1;var t=Yw(e);return t==="DataView"||Do(Ui,t)||Do(Vw,t)},isTypedArray:LO,TypedArray:ti,TypedArrayPrototype:Ir},BO=Ge,e_=ze,X4e=kw,Q4e=Re.NATIVE_ARRAY_BUFFER_VIEWS,Z4e=BO.ArrayBuffer,Us=BO.Int8Array,V4e=!Q4e||!e_(function(){Us(1)})||!e_(function(){new Us(-1)})||!X4e(function(e){new Us,new Us(null),new Us(1.5),new Us(e)},!0)||e_(function(){return new Us(new Z4e(2),1,void 0).length!==1}),e8e=Li,t8e=Ss,n8e=RangeError,DO=function(e){if(e===void 0)return 0;var t=e8e(e),n=t8e(t);if(t!==n)throw new n8e("Wrong length or index");return n},r8e=Math.sign||function(e){var t=+e;return t===0||t!=t?t:t<0?-1:1},i8e=r8e,o8e=Math.abs,MO=2220446049250313e-31,FO=1/MO,s8e=function(e,t,n,r){var o=+e,a=o8e(o),l=i8e(o);if(a<r)return l*function(u){return u+FO-FO}(a/r/t)*r*t;var c=(1+t/MO)*a,d=c-(c-a);return d>n||d!=d?l*(1/0):l*d},a8e=Math.fround||function(e){return s8e(e,11920928955078125e-23,34028234663852886e22,11754943508222875e-54)},l8e=Array,c8e=Math.abs,ji=Math.pow,d8e=Math.floor,u8e=Math.log,f8e=Math.LN2,h8e={pack:function(e,t,n){var r,o,a,l=l8e(n),c=8*n-t-1,d=(1<<c)-1,u=d>>1,f=t===23?ji(2,-24)-ji(2,-77):0,p=e<0||e===0&&1/e<0?1:0,h=0;for((e=c8e(e))!=e||e===1/0?(o=e!=e?1:0,r=d):(r=d8e(u8e(e)/f8e),e*(a=ji(2,-r))<1&&(r--,a*=2),(e+=r+u>=1?f/a:f*ji(2,1-u))*a>=2&&(r++,a/=2),r+u>=d?(o=0,r=d):r+u>=1?(o=(e*a-1)*ji(2,t),r+=u):(o=e*ji(2,u-1)*ji(2,t),r=0));t>=8;)l[h++]=255&o,o/=256,t-=8;for(r=r<<t|o,c+=t;c>0;)l[h++]=255&r,r/=256,c-=8;return l[--h]|=128*p,l},unpack:function(e,t){var n,r=e.length,o=8*r-t-1,a=(1<<o)-1,l=a>>1,c=o-7,d=r-1,u=e[d--],f=127&u;for(u>>=7;c>0;)f=256*f+e[d--],c-=8;for(n=f&(1<<-c)-1,f>>=-c,c+=t;c>0;)n=256*n+e[d--],c-=8;if(f===0)f=1-l;else{if(f===a)return n?NaN:u?-1/0:1/0;n+=ji(2,t),f-=l}return(u?-1:1)*n*ji(2,f-t)}},p8e=Sr,$O=Qc,g8e=Ln,zO=function(e){for(var t=p8e(this),n=g8e(t),r=arguments.length,o=$O(r>1?arguments[1]:void 0,n),a=r>2?arguments[2]:void 0,l=a===void 0?n:$O(a,n);l>o;)t[o++]=e;return t},dg=Ge,t_=Ke,n_=wt,m8e=kO,v8e=Oi,y8e=Eo,UO=iy,r_=ze,ug=xs,b8e=Li,w8e=Ss,fg=DO,_8e=a8e,jO=h8e,C8e=ed,qO=La,S8e=zO,E8e=xo,x8e=Zp,k8e=V9,HO=So,i_=nn,N8e=Cs.PROPER,GO=Cs.CONFIGURABLE,Ol="ArrayBuffer",hg="DataView",Il="prototype",WO="Wrong index",KO=i_.getterFor(Ol),jd=i_.getterFor(hg),YO=i_.set,Rr=dg[Ol],Pr=Rr,Rl=Pr&&Pr[Il],qi=dg[hg],js=qi&&qi[Il],JO=Object.prototype,T8e=dg.Array,pg=dg.RangeError,A8e=t_(S8e),O8e=t_([].reverse),XO=jO.pack,QO=jO.unpack,ZO=function(e){return[255&e]},VO=function(e){return[255&e,e>>8&255]},eI=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},tI=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},I8e=function(e){return XO(_8e(e),23,4)},R8e=function(e){return XO(e,52,8)},gg=function(e,t,n){y8e(e[Il],t,{configurable:!0,get:function(){return n(this)[t]}})},Mo=function(e,t,n,r){var o=jd(e),a=fg(n),l=!!r;if(a+t>o.byteLength)throw new pg(WO);var c=o.bytes,d=a+o.byteOffset,u=E8e(c,d,d+t);return l?u:O8e(u)},Fo=function(e,t,n,r,o,a){var l=jd(e),c=fg(n),d=r(+o),u=!!a;if(c+t>l.byteLength)throw new pg(WO);for(var f=l.bytes,p=c+l.byteOffset,h=0;h<t;h++)f[p+h]=d[u?h:t-h-1]};if(m8e){var nI=N8e&&Rr.name!==Ol;r_(function(){Rr(1)})&&r_(function(){new Rr(-1)})&&!r_(function(){return new Rr,new Rr(1.5),new Rr(NaN),Rr.length!==1||nI&&!GO})?nI&&GO&&v8e(Rr,"name",Ol):((Pr=function(e){return ug(this,Rl),x8e(new Rr(fg(e)),this,Pr)})[Il]=Rl,Rl.constructor=Pr,k8e(Pr,Rr)),qO&&C8e(js)!==JO&&qO(js,JO);var mg=new qi(new Pr(2)),rI=t_(js.setInt8);mg.setInt8(0,2147483648),mg.setInt8(1,2147483649),!mg.getInt8(0)&&mg.getInt8(1)||UO(js,{setInt8:function(e,t){rI(this,e,t<<24>>24)},setUint8:function(e,t){rI(this,e,t<<24>>24)}},{unsafe:!0})}else Rl=(Pr=function(e){ug(this,Rl);var t=fg(e);YO(this,{type:Ol,bytes:A8e(T8e(t),0),byteLength:t}),n_||(this.byteLength=t,this.detached=!1)})[Il],js=(qi=function(e,t,n){ug(this,js),ug(e,Rl);var r=KO(e),o=r.byteLength,a=b8e(t);if(a<0||a>o)throw new pg("Wrong offset");if(a+(n=n===void 0?o-a:w8e(n))>o)throw new pg("Wrong length");YO(this,{type:hg,buffer:e,byteLength:n,byteOffset:a,bytes:r.bytes}),n_||(this.buffer=e,this.byteLength=n,this.byteOffset=a)})[Il],n_&&(gg(Pr,"byteLength",KO),gg(qi,"buffer",jd),gg(qi,"byteLength",jd),gg(qi,"byteOffset",jd)),UO(js,{getInt8:function(e){return Mo(this,1,e)[0]<<24>>24},getUint8:function(e){return Mo(this,1,e)[0]},getInt16:function(e){var t=Mo(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Mo(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return tI(Mo(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return tI(Mo(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return QO(Mo(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return QO(Mo(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){Fo(this,1,e,ZO,t)},setUint8:function(e,t){Fo(this,1,e,ZO,t)},setInt16:function(e,t){Fo(this,2,e,VO,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){Fo(this,2,e,VO,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){Fo(this,4,e,eI,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){Fo(this,4,e,eI,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){Fo(this,4,e,I8e,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){Fo(this,8,e,R8e,t,arguments.length>2&&arguments[2])}});HO(Pr,Ol),HO(qi,hg);var P8e={ArrayBuffer:Pr,DataView:qi},L8e=At,B8e=Math.floor,D8e=Number.isInteger||function(e){return!L8e(e)&&isFinite(e)&&B8e(e)===e},M8e=Li,F8e=RangeError,$8e=function(e){var t=M8e(e);if(t<0)throw new F8e("The argument can't be less than 0");return t},z8e=RangeError,iI=function(e,t){var n=$8e(e);if(n%t)throw new z8e("Wrong offset");return n},U8e=Math.round,j8e=Ri,q8e=d1,H8e=TypeError,oI=function(e){var t=q8e(e,"number");if(typeof t=="number")throw new H8e("Can't convert number to bigint");return BigInt(t)},G8e=Pi,W8e=Ot,K8e=tA,Y8e=Sr,J8e=Ln,X8e=Eh,Q8e=id,Z8e=V1,V8e=function(e){var t=j8e(e);return t==="BigInt64Array"||t==="BigUint64Array"},e6e=Re.aTypedArrayConstructor,t6e=oI,n6e=Ln,sI=function(e,t,n){for(var r=0,o=arguments.length>2?n:n6e(t),a=new e(o);o>r;)a[r]=t[r++];return a},aI=pt,lI=Ge,cI=Ot,r6e=wt,i6e=V4e,qd=Re,dI=P8e,uI=xs,o6e=Aa,Hd=Oi,s6e=D8e,a6e=Ss,fI=DO,o_=iI,l6e=function(e){var t=U8e(e);return t<0?0:t>255?255:255&t},hI=sh,Gd=Yt,c6e=Ri,s_=At,d6e=ih,u6e=Ia,f6e=_s,vg=La,h6e=Pa.f,pI=function(e){var t,n,r,o,a,l,c,d,u=K8e(this),f=Y8e(e),p=arguments.length,h=p>1?arguments[1]:void 0,m=h!==void 0,b=Q8e(f);if(b&&!Z8e(b))for(d=(c=X8e(f,b)).next,f=[];!(l=W8e(d,c)).done;)f.push(l.value);for(m&&p>2&&(h=G8e(h,arguments[2])),n=J8e(f),r=new(e6e(u))(n),o=V8e(r),t=0;n>t;t++)a=m?h(f[t],t):f[t],r[t]=o?t6e(a):+a;return r},p6e=Er.forEach,g6e=iw,m6e=Eo,gI=Rn,mI=Ra,vI=sI,v6e=Zp,a_=nn.get,y6e=nn.set,b6e=nn.enforce,yI=gI.f,w6e=mI.f,l_=lI.RangeError,bI=dI.ArrayBuffer,_6e=bI.prototype,C6e=dI.DataView,yg=qd.NATIVE_ARRAY_BUFFER_VIEWS,wI=qd.TYPED_ARRAY_TAG,_I=qd.TypedArray,Wd=qd.TypedArrayPrototype,c_=qd.isTypedArray,bg="BYTES_PER_ELEMENT",d_="Wrong length",wg=function(e,t){m6e(e,t,{configurable:!0,get:function(){return a_(this)[t]}})},CI=function(e){var t;return f6e(_6e,e)||(t=c6e(e))==="ArrayBuffer"||t==="SharedArrayBuffer"},SI=function(e,t){return c_(e)&&!d6e(t)&&t in e&&s6e(+t)&&t>=0},EI=function(e,t){return t=hI(t),SI(e,t)?o6e(2,e[t]):w6e(e,t)},xI=function(e,t,n){return t=hI(t),!(SI(e,t)&&s_(n)&&Gd(n,"value"))||Gd(n,"get")||Gd(n,"set")||n.configurable||Gd(n,"writable")&&!n.writable||Gd(n,"enumerable")&&!n.enumerable?yI(e,t,n):(e[t]=n.value,e)};r6e?(yg||(mI.f=EI,gI.f=xI,wg(Wd,"buffer"),wg(Wd,"byteOffset"),wg(Wd,"byteLength"),wg(Wd,"length")),aI({target:"Object",stat:!0,forced:!yg},{getOwnPropertyDescriptor:EI,defineProperty:xI}),Ww.exports=function(e,t,n){var r=e.match(/\d+/)[0]/8,o=e+(n?"Clamped":"")+"Array",a="get"+e,l="set"+e,c=lI[o],d=c,u=d&&d.prototype,f={},p=function(m,b){yI(m,b,{get:function(){return function(w,_){var C=a_(w);return C.view[a](_*r+C.byteOffset,!0)}(this,b)},set:function(w){return function(_,C,k){var S=a_(_);S.view[l](C*r+S.byteOffset,n?l6e(k):k,!0)}(this,b,w)},enumerable:!0})};yg?i6e&&(d=t(function(m,b,w,_){return uI(m,u),v6e(s_(b)?CI(b)?_!==void 0?new c(b,o_(w,r),_):w!==void 0?new c(b,o_(w,r)):new c(b):c_(b)?vI(d,b):cI(pI,d,b):new c(fI(b)),m,d)}),vg&&vg(d,_I),p6e(h6e(c),function(m){m in d||Hd(d,m,c[m])}),d.prototype=u):(d=t(function(m,b,w,_){uI(m,u);var C,k,S,E=0,T=0;if(s_(b)){if(!CI(b))return c_(b)?vI(d,b):cI(pI,d,b);C=b,T=o_(w,r);var A=b.byteLength;if(_===void 0){if(A%r)throw new l_(d_);if((k=A-T)<0)throw new l_(d_)}else if((k=a6e(_)*r)+T>A)throw new l_(d_);S=k/r}else S=fI(b),C=new bI(k=S*r);for(y6e(m,{buffer:C,byteOffset:T,byteLength:k,length:S,view:new C6e(C)});E<S;)p(m,E++)}),vg&&vg(d,_I),u=d.prototype=u6e(Wd)),u.constructor!==d&&Hd(u,"constructor",d),b6e(u).TypedArrayConstructor=d,wI&&Hd(u,wI,o);var h=d!==c;f[o]=d,aI({global:!0,constructor:!0,forced:h,sham:!yg},f),bg in d||Hd(d,bg,r),bg in u||Hd(u,bg,r),g6e(o)}):Ww.exports=function(){},(0,Ww.exports)("Uint8",function(e){return function(t,n,r){return e(this,t,n,r)}});var kI=Ta,S6e=TypeError,E6e=Sr,u_=Qc,x6e=Ln,k6e=function(e,t){if(!delete e[t])throw new S6e("Cannot delete property "+kI(t)+" of "+kI(e))},N6e=Math.min,T6e=[].copyWithin||function(e,t){var n=E6e(this),r=x6e(n),o=u_(e,r),a=u_(t,r),l=arguments.length>2?arguments[2]:void 0,c=N6e((l===void 0?r:u_(l,r))-a,r-o),d=1;for(a<o&&o<a+c&&(d=-1,a+=c-1,o+=c-1);c-- >0;)a in n?n[o]=n[a]:k6e(n,o),o+=d,a+=d;return n},NI=Re,A6e=Ke(T6e),O6e=NI.aTypedArray;(0,NI.exportTypedArrayMethod)("copyWithin",function(e,t){return A6e(O6e(this),e,t,arguments.length>2?arguments[2]:void 0)});var I6e=Er.every,R6e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("every",function(e){return I6e(R6e(this),e,arguments.length>1?arguments[1]:void 0)});var P6e=zO,L6e=oI,B6e=Ri,D6e=Ot,M6e=ze,F6e=Re.aTypedArray,$6e=Re.exportTypedArrayMethod,z6e=Ke("".slice);$6e("fill",function(e){var t=arguments.length;F6e(this);var n=z6e(B6e(this),0,3)==="Big"?L6e(e):+e;return D6e(P6e,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},M6e(function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),e!==1}));var U6e=rA,j6e=Re.aTypedArrayConstructor,q6e=Re.getTypedArrayConstructor,_g=function(e){return j6e(U6e(e,q6e(e)))},H6e=sI,G6e=_g,W6e=Er.filter,K6e=function(e,t){return H6e(G6e(e),t)},Y6e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("filter",function(e){var t=W6e(Y6e(this),e,arguments.length>1?arguments[1]:void 0);return K6e(this,t)});var J6e=Er.find,X6e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("find",function(e){return J6e(X6e(this),e,arguments.length>1?arguments[1]:void 0)});var Q6e=Er.findIndex,Z6e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("findIndex",function(e){return Q6e(Z6e(this),e,arguments.length>1?arguments[1]:void 0)});var V6e=Er.forEach,e5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("forEach",function(e){V6e(e5e(this),e,arguments.length>1?arguments[1]:void 0)});var t5e=mh.includes,n5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("includes",function(e){return t5e(n5e(this),e,arguments.length>1?arguments[1]:void 0)});var r5e=mh.indexOf,i5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("indexOf",function(e){return r5e(i5e(this),e,arguments.length>1?arguments[1]:void 0)});var o5e=Ge,s5e=ze,f_=Ke,TI=Re,h_=hE,p_=dt("iterator"),AI=o5e.Uint8Array,a5e=f_(h_.values),l5e=f_(h_.keys),c5e=f_(h_.entries),g_=TI.aTypedArray,Cg=TI.exportTypedArrayMethod,Pl=AI&&AI.prototype,Sg=!s5e(function(){Pl[p_].call([1])}),OI=!!Pl&&Pl.values&&Pl[p_]===Pl.values&&Pl.values.name==="values",II=function(){return a5e(g_(this))};Cg("entries",function(){return c5e(g_(this))},Sg),Cg("keys",function(){return l5e(g_(this))},Sg),Cg("values",II,Sg||!OI,{name:"values"}),Cg(p_,II,Sg||!OI,{name:"values"});var d5e=Re.aTypedArray,u5e=Re.exportTypedArrayMethod,f5e=Ke([].join);u5e("join",function(e){return f5e(d5e(this),e)});var h5e=zp,p5e=Bi,g5e=Li,m5e=Ln,v5e=P9,y5e=Math.min,m_=[].lastIndexOf,RI=!!m_&&1/[1].lastIndexOf(1,-0)<0,b5e=v5e("lastIndexOf"),w5e=RI||!b5e?function(e){if(RI)return h5e(m_,this,arguments)||0;var t=p5e(this),n=m5e(t),r=n-1;for(arguments.length>1&&(r=y5e(r,g5e(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:m_,_5e=zp,C5e=w5e,S5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("lastIndexOf",function(e){var t=arguments.length;return _5e(C5e,S5e(this),t>1?[e,arguments[1]]:[e])});var E5e=Er.map,x5e=_g,k5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("map",function(e){return E5e(k5e(this),e,arguments.length>1?arguments[1]:void 0,function(t,n){return new(x5e(t))(n)})});var N5e=Kr,T5e=Sr,A5e=ph,O5e=Ln,I5e=TypeError,PI=function(e){return function(t,n,r,o){var a=T5e(t),l=A5e(a),c=O5e(a);N5e(n);var d=e?c-1:0,u=e?-1:1;if(r<2)for(;;){if(d in l){o=l[d],d+=u;break}if(d+=u,e?d<0:c<=d)throw new I5e("Reduce of empty array with no initial value")}for(;e?d>=0:c>d;d+=u)d in l&&(o=n(o,l[d],d,a));return o}},LI={left:PI(!1),right:PI(!0)},R5e=LI.left,P5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("reduce",function(e){var t=arguments.length;return R5e(P5e(this),e,t,t>1?arguments[1]:void 0)});var L5e=LI.right,B5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("reduceRight",function(e){var t=arguments.length;return L5e(B5e(this),e,t,t>1?arguments[1]:void 0)});var D5e=Re.aTypedArray,M5e=Re.exportTypedArrayMethod,F5e=Math.floor;M5e("reverse",function(){for(var e,t=this,n=D5e(t).length,r=F5e(n/2),o=0;o<r;)e=t[o],t[o++]=t[--n],t[n]=e;return t});var BI=Ge,DI=Ot,v_=Re,$5e=Ln,z5e=iI,U5e=Sr,MI=ze,j5e=BI.RangeError,y_=BI.Int8Array,FI=y_&&y_.prototype,$I=FI&&FI.set,q5e=v_.aTypedArray,H5e=v_.exportTypedArrayMethod,b_=!MI(function(){var e=new Uint8ClampedArray(2);return DI($I,e,{length:1,0:3},1),e[1]!==3}),G5e=b_&&v_.NATIVE_ARRAY_BUFFER_VIEWS&&MI(function(){var e=new y_(2);return e.set(1),e.set("2",1),e[0]!==0||e[1]!==2});H5e("set",function(e){q5e(this);var t=z5e(arguments.length>1?arguments[1]:void 0,1),n=U5e(e);if(b_)return DI($I,this,n,t);var r=this.length,o=$5e(n),a=0;if(o+t>r)throw new j5e("Wrong length");for(;a<o;)this[t+a]=n[a++]},!b_||G5e);var W5e=_g,K5e=xo,Y5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("slice",function(e,t){for(var n=K5e(Y5e(this),e,t),r=W5e(this),o=0,a=n.length,l=new r(a);a>o;)l[o]=n[o++];return l},ze(function(){new Int8Array(1).slice()}));var J5e=Er.some,X5e=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("some",function(e){return J5e(X5e(this),e,arguments.length>1?arguments[1]:void 0)});var zI=bs.match(/firefox\/(\d+)/i),Q5e=!!zI&&+zI[1],Z5e=/MSIE|Trident/.test(bs),UI=bs.match(/AppleWebKit\/(\d+)\./),V5e=!!UI&&+UI[1],eCe=Jc,w_=ze,tCe=Kr,nCe=jE,jI=Q5e,rCe=Z5e,qI=Kc,HI=V5e,iCe=Re.aTypedArray,oCe=Re.exportTypedArrayMethod,Kd=Ge.Uint16Array,Ll=Kd&&eCe(Kd.prototype.sort),sCe=!(!Ll||w_(function(){Ll(new Kd(2),null)})&&w_(function(){Ll(new Kd(2),{})})),GI=!!Ll&&!w_(function(){if(qI)return qI<74;if(jI)return jI<67;if(rCe)return!0;if(HI)return HI<602;var e,t,n=new Kd(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(Ll(n,function(o,a){return(o/4|0)-(a/4|0)}),e=0;e<516;e++)if(n[e]!==r[e])return!0});oCe("sort",function(e){return e!==void 0&&tCe(e),GI?Ll(this,e):nCe(iCe(this),function(t){return function(n,r){return t!==void 0?+t(n,r)||0:r!=r?-1:n!=n?1:n===0&&r===0?1/n>0&&1/r<0?1:-1:n>r}}(e))},!GI||sCe);var aCe=Ss,WI=Qc,lCe=_g,cCe=Re.aTypedArray;(0,Re.exportTypedArrayMethod)("subarray",function(e,t){var n=cCe(this),r=n.length,o=WI(e,r);return new(lCe(n))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,aCe((t===void 0?r:WI(t,r))-o))});var dCe=zp,KI=Re,__=ze,YI=xo,Eg=Ge.Int8Array,JI=KI.aTypedArray,uCe=KI.exportTypedArrayMethod,XI=[].toLocaleString,fCe=!!Eg&&__(function(){XI.call(new Eg(1))});uCe("toLocaleString",function(){return dCe(XI,fCe?YI(JI(this)):JI(this),YI(arguments))},__(function(){return[1,2].toLocaleString()!==new Eg([1,2]).toLocaleString()})||!__(function(){Eg.prototype.toLocaleString.call([1,2])}));var hCe=Re.exportTypedArrayMethod,pCe=ze,gCe=Ke,QI=Ge.Uint8Array,mCe=QI&&QI.prototype||{},xg=[].toString,vCe=gCe([].join);pCe(function(){xg.call({})})&&(xg=function(){return vCe(this)});var yCe=mCe.toString!==xg;hCe("toString",xg,yCe);var bCe=0,C_={},wCe=function(e){if(!e)return Promise.reject("empty url");var t=C_[e];return t?Promise.resolve(t):new Promise(function(n,r){var o=document.createElement("script");if(o.id="script".concat(bCe++),o.src=e,o.async="async",o.src.indexOf("http")!==0)throw Error("load-script只能加载http/https协议的url,当前协议是".concat(location.protocol));o.onerror=function(a){$("#".concat(o.id)).remove(),r(a)},o.readyState?o.onreadystatechange=function(a){o.readyState!="loaded"&&o.readyState!="complete"||(o.onreadystatechange=null,C_[e]=a,n(a))}:o.onload=function(a){C_[e]=a,n(a)},document.body.appendChild(o)})};function _Ce(e,t){return ZI.apply(this,arguments)}function ZI(){return(ZI=Hc(Cr().mark(function e(t,n){var r,o,a;return Cr().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,wCe("https://html2canvas.hertzen.com/dist/html2canvas.min.js");case 2:return l.next=4,html2canvas(document.body,{useCORS:!0});case 4:return r=l.sent,o=r.toDataURL("image/jpeg",.3),a=CCe(o),l.next=9,SCe(a,t,n);case 9:return l.abrupt("return",l.sent);case 10:case"end":return l.stop()}},e)}))).apply(this,arguments)}function CCe(e){for(var t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]),o=r.length,a=new Uint8Array(o);o--;)a[o]=r.charCodeAt(o);return new Blob([a],{type:n})}function SCe(e,t,n){return VI.apply(this,arguments)}function VI(){return(VI=Hc(Cr().mark(function e(t,n,r){var o,a;return Cr().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return(o=new FormData).append("filename",t,"".concat(r,".png")),o.append("https",1),l.next=5,n("//qapm.360.cn/api/upload/uploadImg",{method:"POST",body:o,keepalive:!0}).then(function(c){return c.json()});case 5:return a=l.sent,l.abrupt("return",a);case 7:case"end":return l.stop()}},e)}))).apply(this,arguments)}var ECe=function(){function e(n){Yf(this,e),Ai(this,"isLoaded",!1),Ai(this,"timer",null),Ai(this,"whiteCount",0),Ai(this,"maxLoopNumber",2),Ai(this,"isReport",!1),this.webCoreIns=n;var r=n.config.whiteScreenConfig||{},o=r.target,a=r.score,l=a===void 0?1.5:a;r.screenshot;var c=r.domDepth,d=c===void 0?6:c;this.target=o,this.score=l,this.screenshot=!1,this.domDepth=d,this.fetch=n.fetch}var t;return Jf(e,[{key:"init",value:function(){var n=this;window.addEventListener("load",function(){n.isLoaded=!0,n.handle()}),window.addEventListener("error",function(){n.isLoaded&&(n.whiteCount=n.maxLoopNumber,n.handle())})}},{key:"getTarget",value:function(){var n;try{n=this.target?document.querySelector(this.target):document.body}catch(r){console.log("sdk入参target有误:",this.target)}return n||console.log("sdk入参target有误:",this.target),n||document.body}},{key:"handle",value:function(){var n=Bw(this.getTarget(),0,0,this.score,this.domDepth);this.whiteCount+=1,n<=this.score?this.openLoopToJudge(n):this.whiteCount=0}},{key:"openLoopToJudge",value:function(n){var r=this;this.whiteCount>=this.maxLoopNumber?this.commit(n):this.timer=setTimeout(function(){var o=Bw(r.target,0,0,r.score,r.domDepth);r.whiteCount+=1,o<=r.score?(clearTimeout(r.timer),r.timer=null,r.openLoopToJudge(o)):(clearTimeout(r.timer),r.timer=null,r.whiteCount=0)},1e3)}},{key:"commit",value:(t=Hc(Cr().mark(function n(r){return Cr().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!this.isReport){o.next=2;break}return o.abrupt("return");case 2:this.isReport=!0,this.screenshot&&_Ce(this.fetch,this.webCoreIns.sid),this.webCoreIns.commit({type:"whiteScreen",score:r});case 5:case"end":return o.stop()}},n,this)})),function(n){return t.apply(this,arguments)})}]),e}(),eR={exports:{}},tR={},xCe=Ii,kCe=Bi,nR=Pa.f,NCe=xo,rR=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];tR.f=function(e){return rR&&xCe(e)==="Window"?function(t){try{return nR(t)}catch(n){return NCe(rR)}}(e):nR(kCe(e))};var TCe=ze(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),ACe=ze,OCe=At,ICe=Ii,iR=TCe,kg=Object.isExtensible,RCe=ACe(function(){kg(1)})||iR?function(e){return!!OCe(e)&&(!iR||ICe(e)!=="ArrayBuffer")&&(!kg||kg(e))}:kg,PCe=!ze(function(){return Object.isExtensible(Object.preventExtensions({}))}),LCe=pt,BCe=Ke,DCe=dh,MCe=At,S_=Yt,FCe=Rn.f,oR=Pa,$Ce=tR,E_=RCe,zCe=PCe,sR=!1,Hi=th("meta"),UCe=0,x_=function(e){FCe(e,Hi,{value:{objectID:"O"+UCe++,weakData:{}}})},jCe=eR.exports={enable:function(){jCe.enable=function(){},sR=!0;var e=oR.f,t=BCe([].splice),n={};n[Hi]=1,e(n).length&&(oR.f=function(r){for(var o=e(r),a=0,l=o.length;a<l;a++)if(o[a]===Hi){t(o,a,1);break}return o},LCe({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:$Ce.f}))},fastKey:function(e,t){if(!MCe(e))return typeof e=="symbol"?e:(typeof e=="string"?"S":"P")+e;if(!S_(e,Hi)){if(!E_(e))return"F";if(!t)return"E";x_(e)}return e[Hi].objectID},getWeakData:function(e,t){if(!S_(e,Hi)){if(!E_(e))return!0;if(!t)return!1;x_(e)}return e[Hi].weakData},onFreeze:function(e){return zCe&&sR&&E_(e)&&!S_(e,Hi)&&x_(e),e}};DCe[Hi]=!0;var aR=eR.exports,qCe=pt,HCe=Ge,GCe=Ke,lR=wh,WCe=Pn,KCe=aR,YCe=Qp,JCe=xs,XCe=ht,QCe=ys,k_=At,N_=ze,ZCe=kw,VCe=So,eSe=Zp,cR=Ia,tSe=Eo,dR=iy,nSe=Pi,rSe=xs,iSe=ys,oSe=Qp,sSe=G1,uR=Ch,aSe=iw,Yd=wt,fR=aR.fastKey,hR=nn.set,T_=nn.getterFor,lSe={getConstructor:function(e,t,n,r){var o=e(function(u,f){rSe(u,a),hR(u,{type:t,index:cR(null),first:void 0,last:void 0,size:0}),Yd||(u.size=0),iSe(f)||oSe(f,u[r],{that:u,AS_ENTRIES:n})}),a=o.prototype,l=T_(t),c=function(u,f,p){var h,m,b=l(u),w=d(u,f);return w?w.value=p:(b.last=w={index:m=fR(f,!0),key:f,value:p,previous:h=b.last,next:void 0,removed:!1},b.first||(b.first=w),h&&(h.next=w),Yd?b.size++:u.size++,m!=="F"&&(b.index[m]=w)),u},d=function(u,f){var p,h=l(u),m=fR(f);if(m!=="F")return h.index[m];for(p=h.first;p;p=p.next)if(p.key===f)return p};return dR(a,{clear:function(){for(var u=l(this),f=u.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),f=f.next;u.first=u.last=void 0,u.index=cR(null),Yd?u.size=0:this.size=0},delete:function(u){var f=this,p=l(f),h=d(f,u);if(h){var m=h.next,b=h.previous;delete p.index[h.index],h.removed=!0,b&&(b.next=m),m&&(m.previous=b),p.first===h&&(p.first=m),p.last===h&&(p.last=b),Yd?p.size--:f.size--}return!!h},forEach:function(u){for(var f,p=l(this),h=nSe(u,arguments.length>1?arguments[1]:void 0);f=f?f.next:p.first;)for(h(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(u){return!!d(this,u)}}),dR(a,n?{get:function(u){var f=d(this,u);return f&&f.value},set:function(u,f){return c(this,u===0?0:u,f)}}:{add:function(u){return c(this,u=u===0?0:u,u)}}),Yd&&tSe(a,"size",{configurable:!0,get:function(){return l(this).size}}),o},setStrong:function(e,t,n){var r=t+" Iterator",o=T_(t),a=T_(r);sSe(e,t,function(l,c){hR(this,{type:r,target:l,state:o(l),kind:c,last:void 0})},function(){for(var l=a(this),c=l.kind,d=l.last;d&&d.removed;)d=d.previous;return l.target&&(l.last=d=d?d.next:l.state.first)?uR(c==="keys"?d.key:c==="values"?d.value:[d.key,d.value],!1):(l.target=void 0,uR(void 0,!0))},n?"entries":"values",!n,!0),aSe(t)}},cSe=function(e,t,n){var r=e.indexOf("Map")!==-1,o=e.indexOf("Weak")!==-1,a=r?"set":"add",l=HCe[e],c=l&&l.prototype,d=l,u={},f=function(_){var C=GCe(c[_]);WCe(c,_,_==="add"?function(k){return C(this,k===0?0:k),this}:_==="delete"?function(k){return!(o&&!k_(k))&&C(this,k===0?0:k)}:_==="get"?function(k){return o&&!k_(k)?void 0:C(this,k===0?0:k)}:_==="has"?function(k){return!(o&&!k_(k))&&C(this,k===0?0:k)}:function(k,S){return C(this,k===0?0:k,S),this})};if(lR(e,!XCe(l)||!(o||c.forEach&&!N_(function(){new l().entries().next()}))))d=n.getConstructor(t,e,r,a),KCe.enable();else if(lR(e,!0)){var p=new d,h=p[a](o?{}:-0,1)!==p,m=N_(function(){p.has(1)}),b=ZCe(function(_){new l(_)}),w=!o&&N_(function(){for(var _=new l,C=5;C--;)_[a](C,C);return!_.has(-0)});b||((d=t(function(_,C){JCe(_,c);var k=eSe(new l,_,d);return QCe(C)||YCe(C,k[a],{that:k,AS_ENTRIES:r}),k})).prototype=c,c.constructor=d),(m||w)&&(f("delete"),f("has"),r&&f("get")),(w||h)&&f(a),o&&c.clear&&delete c.clear}return u[e]=d,qCe({global:!0,constructor:!0,forced:d!==l},u),VCe(d,e),o||n.setStrong(d,e,r),d};cSe("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},lSe);var dSe=pt,pR=N1,uSe=gh,fSe=At,gR=Qc,hSe=Ln,pSe=Bi,gSe=ey,mSe=dt,vSe=xo,ySe=Fh("slice"),bSe=mSe("species"),A_=Array,wSe=Math.max;dSe({target:"Array",proto:!0,forced:!ySe},{slice:function(e,t){var n,r,o,a=pSe(this),l=hSe(a),c=gR(e,l),d=gR(t===void 0?l:t,l);if(pR(a)&&(n=a.constructor,(uSe(n)&&(n===A_||pR(n.prototype))||fSe(n)&&(n=n[bSe])===null)&&(n=void 0),n===A_||n===void 0))return vSe(a,c,d);for(r=new(n===void 0?A_:n)(wSe(d-c,0)),o=0;c<d;c++,o++)c in a&&gSe(r,o,a[c]);return r.length=o,r}});var O_,_Se=pt,CSe=Jc,SSe=Ra.f,ESe=Ss,mR=xr,xSe=tO,kSe=_o,NSe=nO,TSe=CSe("".slice),ASe=Math.min,vR=NSe("endsWith");_Se({target:"String",proto:!0,forced:!!(vR||(O_=SSe(String.prototype,"endsWith"),!O_||O_.writable))&&!vR},{endsWith:function(e){var t=mR(kSe(this));xSe(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,o=n===void 0?r:ASe(ESe(n),r),a=mR(e);return TSe(t,o-a.length,o)===a}});var Ng,Jd,OSe=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Tg="js",Xd="resource",yR="unhandledrejection",Ag="cors",bR="vue",wR="react",_R={exports:{}},CR={exports:{}};Ng="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jd={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&Jd.rotl(e,8)|4278255360&Jd.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=Jd.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(Ng.charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)r!=0&&t.push((Ng.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|Ng.indexOf(e.charAt(n))>>>6-2*r);return t}},CR.exports=Jd;var ISe=CR.exports,I_={utf8:{stringToBytes:function(e){return I_.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(I_.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},SR=I_,RSe=function(e){return e!=null&&(ER(e)||function(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ER(t.slice(0,0))}(e)||!!e._isBuffer)};function ER(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}(function(){var e=ISe,t=SR.utf8,n=RSe,r=SR.bin,o=function(a,l){a.constructor==String?a=l&&l.encoding==="binary"?r.stringToBytes(a):t.stringToBytes(a):n(a)?a=Array.prototype.slice.call(a,0):Array.isArray(a)||a.constructor===Uint8Array||(a=a.toString());for(var c=e.bytesToWords(a),d=8*a.length,u=1732584193,f=-271733879,p=-1732584194,h=271733878,m=0;m<c.length;m++)c[m]=16711935&(c[m]<<8|c[m]>>>24)|4278255360&(c[m]<<24|c[m]>>>8);c[d>>>5]|=128<<d%32,c[14+(d+64>>>9<<4)]=d;var b=o._ff,w=o._gg,_=o._hh,C=o._ii;for(m=0;m<c.length;m+=16){var k=u,S=f,E=p,T=h;u=b(u,f,p,h,c[m+0],7,-680876936),h=b(h,u,f,p,c[m+1],12,-389564586),p=b(p,h,u,f,c[m+2],17,606105819),f=b(f,p,h,u,c[m+3],22,-1044525330),u=b(u,f,p,h,c[m+4],7,-176418897),h=b(h,u,f,p,c[m+5],12,1200080426),p=b(p,h,u,f,c[m+6],17,-1473231341),f=b(f,p,h,u,c[m+7],22,-45705983),u=b(u,f,p,h,c[m+8],7,1770035416),h=b(h,u,f,p,c[m+9],12,-1958414417),p=b(p,h,u,f,c[m+10],17,-42063),f=b(f,p,h,u,c[m+11],22,-1990404162),u=b(u,f,p,h,c[m+12],7,1804603682),h=b(h,u,f,p,c[m+13],12,-40341101),p=b(p,h,u,f,c[m+14],17,-1502002290),u=w(u,f=b(f,p,h,u,c[m+15],22,1236535329),p,h,c[m+1],5,-165796510),h=w(h,u,f,p,c[m+6],9,-1069501632),p=w(p,h,u,f,c[m+11],14,643717713),f=w(f,p,h,u,c[m+0],20,-373897302),u=w(u,f,p,h,c[m+5],5,-701558691),h=w(h,u,f,p,c[m+10],9,38016083),p=w(p,h,u,f,c[m+15],14,-660478335),f=w(f,p,h,u,c[m+4],20,-405537848),u=w(u,f,p,h,c[m+9],5,568446438),h=w(h,u,f,p,c[m+14],9,-1019803690),p=w(p,h,u,f,c[m+3],14,-187363961),f=w(f,p,h,u,c[m+8],20,1163531501),u=w(u,f,p,h,c[m+13],5,-1444681467),h=w(h,u,f,p,c[m+2],9,-51403784),p=w(p,h,u,f,c[m+7],14,1735328473),u=_(u,f=w(f,p,h,u,c[m+12],20,-1926607734),p,h,c[m+5],4,-378558),h=_(h,u,f,p,c[m+8],11,-2022574463),p=_(p,h,u,f,c[m+11],16,1839030562),f=_(f,p,h,u,c[m+14],23,-35309556),u=_(u,f,p,h,c[m+1],4,-1530992060),h=_(h,u,f,p,c[m+4],11,1272893353),p=_(p,h,u,f,c[m+7],16,-155497632),f=_(f,p,h,u,c[m+10],23,-1094730640),u=_(u,f,p,h,c[m+13],4,681279174),h=_(h,u,f,p,c[m+0],11,-358537222),p=_(p,h,u,f,c[m+3],16,-722521979),f=_(f,p,h,u,c[m+6],23,76029189),u=_(u,f,p,h,c[m+9],4,-640364487),h=_(h,u,f,p,c[m+12],11,-421815835),p=_(p,h,u,f,c[m+15],16,530742520),u=C(u,f=_(f,p,h,u,c[m+2],23,-995338651),p,h,c[m+0],6,-198630844),h=C(h,u,f,p,c[m+7],10,1126891415),p=C(p,h,u,f,c[m+14],15,-1416354905),f=C(f,p,h,u,c[m+5],21,-57434055),u=C(u,f,p,h,c[m+12],6,1700485571),h=C(h,u,f,p,c[m+3],10,-1894986606),p=C(p,h,u,f,c[m+10],15,-1051523),f=C(f,p,h,u,c[m+1],21,-2054922799),u=C(u,f,p,h,c[m+8],6,1873313359),h=C(h,u,f,p,c[m+15],10,-30611744),p=C(p,h,u,f,c[m+6],15,-1560198380),f=C(f,p,h,u,c[m+13],21,1309151649),u=C(u,f,p,h,c[m+4],6,-145523070),h=C(h,u,f,p,c[m+11],10,-1120210379),p=C(p,h,u,f,c[m+2],15,718787259),f=C(f,p,h,u,c[m+9],21,-343485551),u=u+k>>>0,f=f+S>>>0,p=p+E>>>0,h=h+T>>>0}return e.endian([u,f,p,h])};o._ff=function(a,l,c,d,u,f,p){var h=a+(l&c|~l&d)+(u>>>0)+p;return(h<<f|h>>>32-f)+l},o._gg=function(a,l,c,d,u,f,p){var h=a+(l&d|c&~d)+(u>>>0)+p;return(h<<f|h>>>32-f)+l},o._hh=function(a,l,c,d,u,f,p){var h=a+(l^c^d)+(u>>>0)+p;return(h<<f|h>>>32-f)+l},o._ii=function(a,l,c,d,u,f,p){var h=a+(c^(l|~d))+(u>>>0)+p;return(h<<f|h>>>32-f)+l},o._blocksize=16,o._digestsize=16,_R.exports=function(a,l){if(a==null)throw new Error("Illegal argument "+a);var c=e.wordsToBytes(o(a,l));return l&&l.asBytes?c:l&&l.asString?r.bytesToString(c):e.bytesToHex(c)}})();var PSe=xse(_R.exports);function LSe(e){var t=e.match(OSe);return t?{filename:t[2],functionName:t[1]||"",lineno:parseInt(t[3],10)||void 0,colno:parseInt(t[4],10)||void 0}:{}}function Og(e){var t=(e||{stack:""}).stack;if(!t)return[];var n,r=[],o=Xv(t.split(`
144
- `).slice(1));try{for(o.s();!(n=o.n()).done;){var a=LSe(n.value);a&&r.push(a)}}catch(l){o.e(l)}finally{o.f()}return r.slice(0,10)}var Bl=function(e){return PSe(e).toString()},R_=function(e){return e instanceof ErrorEvent?e.message==="Script error."?Ag:Tg:Xd},BSe=function(){function e(t){Yf(this,e),Ai(this,"errorIdSet",new Set),this.webCoreIns=t,this.errorIdSet=new Set}return Jf(e,[{key:"init",value:function(){var t;if(this.initJsError(),this.initResourceError(),this.initPromiseError(),this.initCorsError(),(t=window.__QAPM__)!==null&&t!==void 0&&(t=t.q)!==null&&t!==void 0&&t.length){var n={error:this.onJSError.bind(this),reject:this.onPromiseError.bind(this)};window.__QAPM__.q.forEach(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=r.type,a=r.event,l=n[o];l&&l(a)}),window.__QAPM__.q=[]}}},{key:"initJsError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onJSError(n)},!0)}},{key:"initResourceError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onResourceError(n)},!0)}},{key:"initPromiseError",value:function(){var t=this;window.addEventListener("unhandledrejection",function(n){return t.onPromiseError(n)},!0)}},{key:"initCorsError",value:function(){var t=this;window.addEventListener("error",function(n){return function(r){if(R_(r)===Ag){var o={errorType:Ag,errorMessage:r.message,errorSummary:"CorsError",errorId:Bl("".concat(Ag,"-").concat(r.message))};t.commit(o)}}(n)},!0)}},{key:"onResourceError",value:function(t){if(R_(t)===Xd){var n=t.target||t.srcElement,r=n.src||n.href,o=JSON.stringify(Xd+": "+r||"UnKnown Resource"),a={errorType:Xd,errorMessage:o,errorSummary:"ResourceError",errorId:Bl("".concat(Xd,"-").concat(o))};this.commit(a)}}},{key:"onJSError",value:function(t){var n,r;if(R_(t)===Tg){var o=JSON.stringify(t.message),a=function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unknown";if(!c)return d;try{var u=new URL(c);return u.pathname&&u.pathname.endsWith(".js")?c:d}catch(f){return c}}(t.filename,(n=this.webCoreIns.config)===null||n===void 0?void 0:n.appKey),l={errorType:Tg,errorMessage:o,errorSummary:t.error&&((r=t.error)===null||r===void 0?void 0:r.name)||"UnKnown",errorStack:JSON.stringify(Og(t.error)),errorId:Bl("".concat(Tg,"-").concat(o,"-").concat(a))};this.commit(l)}}},{key:"onPromiseError",value:function(t){var n,r,o=JSON.stringify(((n=t.reason)===null||n===void 0?void 0:n.message)||t.reason||"UnKnown"),a=((r=t.reason)===null||r===void 0?void 0:r.name)||"UnKnown",l={errorType:yR,errorMessage:o,errorSummary:a,errorStack:JSON.stringify(Og(t.reason)),errorId:Bl("".concat(yR,"-").concat(o,"-").concat(a))};this.commit(l)}},{key:"onVueError",value:function(t,n,r){var o=JSON.stringify(t.message),a={errorType:bR,errorMessage:o,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Og(t)),errorId:Bl("".concat(bR,"-").concat(o,"-").concat(t.name))};this.commit(a)}},{key:"onReactError",value:function(t,n){var r=JSON.stringify(t.message),o={errorType:wR,errorMessage:r,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Og(t)),errorId:Bl("".concat(wR,"-").concat(r,"-").concat(t.name))};console.log(o),this.commit(o)}},{key:"commit",value:function(t){var n=t.errorId;this.errorIdSet.has(n)||(this.errorIdSet.add(n),this.webCoreIns.commit(qc({type:"error"},t)))}}]),e}(),DSe=function(e){function t(){var o,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Yf(this,t),(o=Sse(this,t,[a])).config=a,o.isReport()?(o.PerformancePluginInstance=new n4e(Gc(o)),o.WhiteScreenPluginInstance=new ECe(Gc(o)),o.ErrorPluginInstance=new BSe(Gc(o)),o.plugins=[o.PerformancePluginInstance,o.WhiteScreenPluginInstance,o.ErrorPluginInstance],o.init(),jS(t,t,Dl,Gc(o)),o):$S(o)}var n,r;return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(a&&a.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),a&&Jv(o,a)}(t,Cwe),Jf(t,[{key:"isReport",value:function(){var o=this.isIE(),a=this.calcRatio();return this.config.appKey&&a&&!o}},{key:"init",value:(r=Hc(Cr().mark(function o(){return Cr().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:this.initTime(this.mixed()),this.plugins.forEach(function(l){l.init()});case 2:case"end":return a.stop()}},o,this)})),function(){return r.apply(this,arguments)})},{key:"mixed",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=this.uid(),l=this.getTime(),c=l.time,d=l.date,u=this.getUA(),f=window.location,p=f.host,h=f.origin,m=f.pathname;return qc(qc({uid:a,sid:this.sid,url:window.location.href,host:p,fullPath:h+m,sdkVersion:this.sdkVersion,createDate:d,appKey:this.config.appKey,createTime:c,appVersion:this.appVersion,env:this.env},u),o)}},{key:"commit",value:(n=Hc(Cr().mark(function o(a){var l,c;return Cr().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:l=this.mixed(a),c=new URL("".concat(window.location.protocol,"//").concat(this.host,"/log.gif")),Object.entries(l).map(function(u){var f=Ese(u,2),p=f[0],h=f[1];c.searchParams.set(p,h)}),new Image().src=c.toString();case 5:case"end":return d.stop()}},o,this)})),function(o){return n.apply(this,arguments)})}],[{key:"install",value:function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Qf(t,t,Dl)||(o.config.errorHandler=function(l,c,d){Qf(t,t,Dl).ErrorPluginInstance.onVueError(l,c,d),console.error(l)},jS(t,t,Dl,new t(a)))}},{key:"sendError",value:function(o){Qf(t,t,Dl)?Qf(t,t,Dl).ErrorPluginInstance.onReactError(o):console.error("QAPM: 请先初始化 QAPM!")}}]),t}(),Dl={writable:!0,value:null};const NNe="",TNe="",MSe={components:{InfoFilled:Pm,ArrowRight:Im},mixins:[jr],inject:["hasLevel"],props:{axis:{required:!0,type:Object,default:()=>({x:0,y:0})},show:{required:!0,type:Boolean,default:!1},nodeInfo:{required:!0,type:Array,default:()=>[]},menuOptions:{required:!0,type:Array,default:()=>[]},border:{type:Boolean,required:!1,default:!0},itemWidth:{type:Number,required:!1,default:206},itemHeight:{type:Number,required:!1,default:36},itemSize:{type:Number,required:!1,default:14},offset:{type:Object,required:!1,default:()=>({x:6,y:2})},borderWidth:{type:Number,required:!1,default:6},history:{type:Object,required:!0,default:()=>{}},moduleDetail:{type:Object,required:!0,default:()=>{}}},emits:["contextmenu-click"],data(){return{checkedItems:{},globalMenus:JZ,maxMulti:6}},computed:{checkboxMenu(){return this.nodeInfo.length>1?[]:this.menuOptions},canGoDetail(){var e,t,n,r;return((t=(e=this.moduleDetail)==null?void 0:e.config)==null?void 0:t.jumpDetail)&&((r=this.moduleDetail)==null?void 0:r.config.jumpRule[(n=this.nodeInfo[0])==null?void 0:n.type])},systemMenu(){var r,o,a,l,c,d,u;const e=[];if(this.nodeInfo.length===1){const f=this.nodeInfo[0];f.type!=="aggregation"&&f.type!=="nodeType"&&(e.push(iv),(r=this.history.keyNodeIds)!=null&&r.some(_=>_===f.id)||(e.push(av),(a=(o=this.moduleDetail)==null?void 0:o.config)!=null&&a.hideCollectMenu||e.push(f.collect?sv:ov),e.push(f.textProp==="name"?tv:ev),f.label&&e.push(f.textProp==="label"?nv:rv)),this.canGoDetail&&e.push(Y5)),e.push(f.fx?V0:Z0);const p=this.history.dataNow.links.some(w=>w.source.id===f.id&&w.target.type==="aggregation"),b=this.history.dataNow.links.filter(w=>w.source.id===f.id).map(w=>w.target).some(w=>{let _=0;return this.history.dataNow.links.map(C=>{C.source.id===w.id&&_++}),_===0});p||f.type==="aggregation"?e.push(G5):b&&e.push(H5),b&&e.push(q5),e.push(lv)}else this.nodeInfo.length>1?(e.push(av,iv),e.push(this.nodeInfo.some(p=>!p.collect)?ov:sv),this.nodeInfo.some(p=>p.label)&&e.push(this.nodeInfo.some(p=>p.textProp!=="label")?rv:nv),e.push(this.nodeInfo.some(p=>p.textProp!=="name")?ev:tv),e.push(this.nodeInfo.some(p=>!p.fx)?Z0:V0),e.push(lv)):this.nodeInfo.length===0&&(this.history.dataNow.nodes.some(p=>p.label)&&e.push(this.history.dataNow.nodes.some(p=>p.textProp!=="label")?z5:$5),e.push(this.history.dataNow.nodes.some(p=>p.textProp!=="name")?M5:F5),e.push(this.history.dataNow.nodes.some(p=>!p.fx)?B5:D5),this.history.currentIndex>0&&e.push(U5),this.history.currentIndex<this.history.length-1&&e.push(j5));const t=(l=this.nodeInfo[0])==null?void 0:l.type,n=(u=(d=(c=this.nodeInfo[0])==null?void 0:c.detail)==null?void 0:d.info)==null?void 0:u.extraNodeContextMenus;return t!=="nodeType"&&(n!=null&&n.length)&&(n.forEach(f=>{f.icon||(f.icon="button_edit_label")}),e.push(...n)),e},totalHeight(){let e=this.menuOptions.length*(this.itemHeight+5)+10+44+48+5,t=this.systemMenu.length*(this.itemHeight+5)+10+44+5;return e=this.menuOptions.length===0?0:44,t=this.systemMenu.length===0?0:44,e+t},axisComputed(){const e=document.getElementsByClassName("d3-container")[0],t=this.axis.top-e.offsetTop;return{top:(t<e.offsetHeight/2?Math.min(t+this.offset.y,Math.max(e.offsetHeight-this.totalHeight,e.getBoundingClientRect().top)):Math.max(t+this.offset.y,this.totalHeight+e.getBoundingClientRect().top))+"px",left:this.axis.left+this.offset.x+"px",transform:`translate(${this.axis.left>e.offsetWidth/2?"-100%":"0%"}, ${t>e.offsetHeight/2?"-100%":"0%"})`}},liStyle(){return{width:this.itemWidth+"px",height:this.itemHeight+"px",lineHeight:this.itemHeight+"px",fontSize:this.itemSize+"px"}},firstLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*2>=e},secondLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*3>=e},checkedItemsFinal(){return Object.keys(this.checkedItems).filter(e=>this.checkedItems[e]).map(e=>this.checkedItems[e])},haveInterface(){let e=!1;return this.menuOptions.map(t=>{t.type===1&&(e=!0)}),e}},watch:{show(){this.checkedItems={}}},methods:{handleCollapse(){},isSystemItem(e){return e.type===2},isExternalItem(e){return e.type===3},hasChildren(e){var t;return((t=e==null?void 0:e.children)==null?void 0:t.length)>0},onCheck(e,t){this.checkedItems[t.name]=e.currentTarget.checked?t:!1},secondBorderCheck(e,t=0){const n=document.body.offsetWidth,r=document.body.offsetHeight,o=this.axis.top+(e+t)*this.itemHeight;return{width:this.itemWidth*2+60+"px",left:this.axis.left+this.itemWidth*2>=n?"-100%":"100%",top:r>=o?0:"auto",bottom:r<o?0:"auto"}},thirdBorderCheck(e,t,n,r){const o=document.body.offsetWidth,a=document.body.offsetHeight,l=this.secondBorderCheck(e,n).top;let c;const d=(t+r)*this.itemHeight,u=d>180?180:d;return l===0?c=this.axis.top+e*this.itemHeight+u:c=this.axis.top-e*this.itemHeight+u,{left:this.axis.left+this.itemWidth*3>=o?"-100%":"100%",bottom:a>=c?0:"auto",top:a<c?0:"auto"}},handleClick(e,t){if(!t){if(en({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),e.has_child>0)return!1;be(this,"contextmenu-click",{nodes:this.nodeInfo,api:e})}},handleDataClick(e,t){en({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),be(this,"contextmenu-click",{nodes:this.nodeInfo,api:t,dataApi:e}),this.checkedItems={}}}},Ml=e=>(s.pushScopeId("data-v-dd8dd8d0"),e=e(),s.popScopeId(),e),FSe={"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden",display:"none"}},$Se=[Ml(()=>s.createElementVNode("symbol",{id:"icon-arrow-right",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{d:"M288.791335 65.582671l446.41733 446.417329-446.41733 446.417329z"})],-1))],zSe={class:"cm-list"},USe={class:"cm-ul"},jSe={class:"hd"},qSe=["src"],HSe={class:"bd"},GSe={class:"cm-ul cm-ul-level1"},WSe=["title"],KSe=Ml(()=>s.createElementVNode("svg",{class:"icon","aria-hidden":"true"},[s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"})],-1)),YSe=["title","onClick"],JSe=["title","onClick"],XSe={key:0,class:"icon","aria-hidden":"true"},QSe=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],ZSe=["title","onClick"],VSe=["src"],e9e=Ml(()=>s.createElementVNode("div",{class:"bd"},null,-1)),t9e=["title","onClick"],n9e={key:0,class:"fas el-icon-fa-cog"},r9e={key:1,class:"fas el-icon-fa-external-link-alt"},i9e={class:"text-wrapper"},o9e=["src"],s9e=["src"],a9e={key:3,class:"shortcut"},l9e={key:2,class:"icon","aria-hidden":"true"},c9e=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],d9e=["title","onClick"],u9e={key:1,class:"icon","aria-hidden":"true"},f9e=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],h9e=["title","onClick"];function p9e(e,t,n,r,o,a){const l=s.resolveComponent("ArrowRight"),c=Qe,d=s.resolveComponent("InfoFilled"),u=Gn;return n.show?(s.openBlock(),s.createElementBlock("div",{key:0,class:"cm-container",style:s.normalizeStyle(a.axisComputed),onClick:t[1]||(t[1]=s.withModifiers((...f)=>a.handleCollapse&&a.handleCollapse(...f),["stop"]))},[(s.openBlock(),s.createElementBlock("svg",FSe,$Se)),s.createElementVNode("div",zSe,[s.createElementVNode("ul",USe,[a.checkboxMenu.length>0?(s.openBlock(),s.createElementBlock("li",{key:0,class:"cm-li data-opt-wrapper",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",jSe,[s.createElementVNode("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,qSe),s.createTextVNode("按关系分类拓线"),s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),s.createElementVNode("div",HSe,[s.createElementVNode("ul",GSe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.checkboxMenu,(f,p)=>(s.openBlock(),s.createElementBlock("li",{key:p,class:"cm-li context-one",style:s.normalizeStyle(a.liStyle)},[a.hasChildren(f)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["cm-item",a.firstLeft?"cm-left":""]),title:f.namec},[s.createElementVNode("span",null,s.toDisplayString(f.namec),1),KSe],10,WSe)):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["cm-item",a.firstLeft?"cm-left":""]),title:f.namec,onClick:s.withModifiers(h=>a.handleDataClick(f,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(f.namec),1)],10,YSe)),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("ul",{key:2,class:"cm-ul cm-ul-level2",style:s.normalizeStyle(a.secondBorderCheck(p,f.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.children,(h,m)=>(s.openBlock(),s.createElementBlock("li",{key:m,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",a.secondLeft?"cm-left":""]),title:h.namec,onClick:s.withModifiers(b=>a.handleDataClick(h,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(h.namec),1),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("svg",XSe,QSe)):s.createCommentVNode("",!0)],10,JSe),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level3",style:s.normalizeStyle(a.thirdBorderCheck(p,m,f.children.length,h.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.children,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:w,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:"cm-item",title:b.namec,onClick:s.withModifiers(_=>a.handleDataClick(b,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(b.namec),1)],8,ZSe)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))])])],4)):n.nodeInfo.length>1&&n.nodeInfo.length<o.maxMulti?(s.openBlock(),s.createElementBlock("li",{key:1,class:"cm-li data-opt-wrapper data-opt-all",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:"hd",onClick:t[0]||(t[0]=s.withModifiers(f=>a.handleDataClick(null,o.globalMenus.expandNode),["stop"]))},[s.createElementVNode("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,VSe),s.createTextVNode("展开全部关系 ")]),e9e],4)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.systemMenu,(f,p)=>(s.openBlock(),s.createElementBlock("li",{key:p,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{"cm-left":a.firstLeft,disabled:f.disabled}]),title:f.namec,onClick:s.withModifiers(h=>a.handleClick(f,f.disabled),["stop"])},[a.isSystemItem(f)?(s.openBlock(),s.createElementBlock("i",n9e)):a.isExternalItem(f)?(s.openBlock(),s.createElementBlock("i",r9e)):s.createCommentVNode("",!0),s.createElementVNode("div",i9e,[f.icon?(s.openBlock(),s.createElementBlock("img",{key:0,src:e.imgPath["./public/d3svg1/button18/"+f.icon+".svg"],class:"t-icon"},null,8,o9e)):(s.openBlock(),s.createElementBlock("img",{key:1,src:e.imgPath["./public/d3svg1/button18/button_"+f.name+".svg"],class:"t-icon"},null,8,s9e)),f.tooltip?(s.openBlock(),s.createBlock(u,{key:2,class:"el-icon-info",effect:"dark",content:f.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(f.namec),1),f.shortcut?(s.openBlock(),s.createElementBlock("span",a9e,s.toDisplayString(f.shortcut),1)):s.createCommentVNode("",!0)]),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("svg",l9e,c9e)):s.createCommentVNode("",!0)],10,t9e),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level2",style:s.normalizeStyle(a.secondBorderCheck(p,f.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.children,(h,m)=>(s.openBlock(),s.createElementBlock("li",{key:m,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{"cm-left":a.secondLeft,disabled:f.disabled||h.disabled}]),title:h.namec,onClick:s.withModifiers(b=>a.handleClick(h,f.disabled||h.disabled),["stop"])},[h.tooltip?(s.openBlock(),s.createBlock(u,{key:0,class:"el-icon-info",effect:"dark",content:h.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(h.namec),1),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("svg",u9e,f9e)):s.createCommentVNode("",!0)],10,d9e),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level3",style:s.normalizeStyle(a.thirdBorderCheck(p,m,f.children.length,h.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.children,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:w,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{disabled:f.disabled||h.disabled||b.disabled}]),title:b.namec,onClick:s.withModifiers(_=>a.handleClick(b,f.disabled||h.disabled||b.disabled),["stop"])},[b.tooltip?(s.openBlock(),s.createBlock(u,{key:0,class:"el-icon-info",effect:"dark",content:b.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(b.namec),1)],10,h9e)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))])])],4)):s.createCommentVNode("",!0)}const g9e=Bt(MSe,[["render",p9e],["__scopeId","data-v-dd8dd8d0"]]),PNe="",LNe="",BNe="",DNe="",m9e={name:"Popover",components:{ForceGraphSvgIcon:ls},mixins:[jr],inject:["levelList","hasLevel"],props:{showPopover:{type:Boolean,default:!1},mousePosition:{type:Object,default:()=>({left:0,top:0})},nodeInfo:{type:Object,default:()=>{}},type:{type:String,default:"node"},moduleDetail:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},darkMode:{type:Boolean,default:!0},history:{type:Object,default:()=>({})},customTooltip:{type:Function}},data(){return{isFunction:du,showSelf:!1,onPop:!1,position:null,aggregationList:[]}},computed:{show(){return this.showPopover||this.showSelf},name(){var e,t,n;return((n=(t=(e=this.nodeInfo)==null?void 0:e.detail)==null?void 0:t.info)==null?void 0:n.name)||this.nodeInfo.name},isNormalNode(){return this.nodeInfo.type!=="nodeType"&&this.nodeInfo.type!=="aggregation"},isNodeTypeNode(){return this.nodeInfo.type==="nodeType"},isAggregateNode(){return this.nodeInfo.type==="aggregation"},fieldMapThisType(){var e;return this.moduleDetail.detail_field_map&&this.moduleDetail.detail_field_map[`${(e=this.nodeInfo)==null?void 0:e.type}_detail_info`]},canGoDetail(){return["nodeType","aggregation","family","org","report","vul","thumbprint_md5","email","cert_https"].indexOf(this.nodeInfo.type)<0}},watch:{mousePosition(){setTimeout(()=>{var c,d,u;const e=this.mousePosition.left>document.body.offsetWidth/2,t=this.mousePosition.top>document.body.offsetHeight/2,n=(c=document.getElementsByClassName("popover-container")[0])==null?void 0:c.offsetHeight,r=(d=document.getElementsByClassName("d3-container")[0])==null?void 0:d.offsetHeight,o=(u=document.getElementsByClassName("d3-container")[0])==null?void 0:u.getBoundingClientRect().top;let a;t?a=Math.max(this.mousePosition.top,n+o)+5:a=Math.min(this.mousePosition.top,Math.max(r-n,o))-5;const l={left:(e?this.mousePosition.left+2:this.mousePosition.right-2)+"px",top:a+"px",transform:`translate(${e?"-100%":"0%"}, ${t?"-100%":"0%"})`};this.position=l},100)},nodeInfo:{handler:function(){var t;const e=(((t=this.nodeInfo)==null?void 0:t.list)||[]).map(n=>{var o,a,l;const r=n.detail;return ue(ae({},n),{name:((o=r==null?void 0:r.info)==null?void 0:o.name)||n.name,level:((l=(a=r==null?void 0:r.info)==null?void 0:a.basic)==null?void 0:l.level)||""})});e==null||e.sort((n,r)=>{var l,c;const o=(l=this.levelList.find(d=>d.level===n.level))==null?void 0:l.dangerNumber;return((c=this.levelList.find(d=>d.level===r.level))==null?void 0:c.dangerNumber)-o}),this.aggregationList=e},immediate:!0}},methods:{handleMouseEnter(){this.showSelf=!0},handleMouseLeave(){this.showSelf=!1},isSomething(e){return j0(e)},getTypeZh(e){var n,r,o;let t=e;if(e==="nodeType")t="关系节点";else for(const a in(n=this.moduleDetail)==null?void 0:n.nodes)if(e===((r=this.moduleDetail)==null?void 0:r.nodes[a].name)){t=(o=this.moduleDetail)==null?void 0:o.nodes[a].namec;break}return t},getLevelClass(e){return sf(e,this.levelList)},getColorStyle(e){return cs(e,this.levelList,this.darkMode)},getNodeTypeChildNum(e){var o;const t=(o=this.data)==null?void 0:o.links,n=[],r=[];return t==null||t.map(a=>{a.source.id===e&&(n.push(a.target.id),a.target.detail&&UQ(a.target.detail.info.basic.level,this.levelList)&&r.push(a.target.id))}),{allChildNum:n.length,dangerChildNum:r.length}},canShowField(e){const t=this.hasFieldValue(e);return!(t===void 0||e.hide_hover||e.hide_empty&&!t)},hasFieldValue(e){const t=this.nodeInfo.detail&&this.nodeInfo.detail.info&&this.nodeInfo.detail.info.basic[e.prop];if(t===null)return;const n=Array.isArray(t);return n&&t.length>0||!n&&t!==""&&t!=="无"},getFieldValue(e){const t=this.nodeInfo.detail.info.basic[e.prop],n=Array.isArray(t),r=this.isSomething(t);let o="-";return r&&(n?o=t.length?t.join("|"):"-":o=t||"-"),o},formatTags(e){return df(uf(e))},addToGraph(e){const t={type:"addFromAggregation",addOne:{nodes:[e],links:[{source:this.nodeInfo.relationId,target:e.id}]}};if(this.aggregationList=this.aggregationList.filter(n=>n.id!==e.id),this.history.updateAggregationNode(this.aggregationList,this.nodeInfo.id),this.history.pushState(t),this.aggregationList.length)be(qe,"emitDataLoaded");else{const n=this.nodeInfo,r={deleteOne:{nodes:[n],links:[{source:n.relationId,target:n.id}]},type:"aggregation"};setTimeout(()=>{this.history.pushState(r),be(qe,"emitDataLoaded")},0)}}}},Fl=e=>(s.pushScopeId("data-v-eb4f1bf9"),e=e(),s.popScopeId(),e),v9e={key:0},y9e=["innerHTML"],b9e={key:1,class:"node-info-container"},w9e={class:"popover-block popover-header"},_9e={key:0,class:"popover-collect"},C9e={key:1,class:"row-item"},S9e={class:"label"},E9e={key:2,class:"row-item"},x9e=Fl(()=>s.createElementVNode("div",{class:"label"},"关系节点:",-1)),k9e={class:"value"},N9e={class:"node-type-info"},T9e={class:"name"},A9e={key:3,class:"row-item"},O9e=Fl(()=>s.createElementVNode("div",{class:"label"},"备注:",-1)),I9e={class:"value"},R9e={class:"popover-block popover-fields"},P9e={key:0,class:"node-detail top-border"},L9e={key:0,class:"row-item"},B9e=Fl(()=>s.createElementVNode("div",{class:"label"},"危险级别:",-1)),D9e=["title"],M9e={key:1,class:"row-item row-item-tag"},F9e=Fl(()=>s.createElementVNode("div",{class:"label"},"标签:",-1)),$9e={class:"value"},z9e={class:"graph-tags-box"},U9e=Fl(()=>s.createElementVNode("br",null,null,-1)),j9e={key:0,class:"row-item"},q9e={class:"label"},H9e=["title"],G9e={key:1,class:"node-statistics top-border"},W9e={class:"row-item node-num"},K9e=Fl(()=>s.createElementVNode("div",{class:"label"},"拓展节点统计:",-1)),Y9e={class:"value"},J9e={key:0},X9e={class:"danger"},Q9e={key:2,class:"node-aggregation"},Z9e={class:"aggregation-title"},V9e={class:"aggregation-box"},eEe={key:2,class:"node-info-container"},tEe={class:"popover-fields"},nEe={class:"top"};function rEe(e,t,n,r,o,a){const l=s.resolveComponent("force-graph-svg-icon"),c=Gn,d=xc,u=CX,f=is,p=_X;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["popover-container",a.show?"show-popover":"hide-popover"]),style:s.normalizeStyle(o.position),onMouseenter:t[0]||(t[0]=(...h)=>a.handleMouseEnter&&a.handleMouseEnter(...h)),onMouseleave:t[1]||(t[1]=(...h)=>a.handleMouseLeave&&a.handleMouseLeave(...h))},[s.createElementVNode("div",null,[n.customTooltip&&o.isFunction(n.customTooltip)?(s.openBlock(),s.createElementBlock("div",v9e,[s.createElementVNode("div",{innerHTML:n.customTooltip({nodeInfo:n.nodeInfo,data:n.data,moduleDetail:n.moduleDetail})},null,8,y9e)])):n.type==="node"?(s.openBlock(),s.createElementBlock("div",b9e,[s.createElementVNode("div",w9e,[n.nodeInfo.collect?(s.openBlock(),s.createElementBlock("div",_9e,[s.createVNode(c,{content:"已收藏","popper-class":"el-tooltip-gray",placement:"left"},{default:s.withCtx(()=>[s.createVNode(l,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/star.svg"]},null,8,["icon-class"])]),_:1})])):s.createCommentVNode("",!0),a.isNormalNode?(s.openBlock(),s.createElementBlock("div",C9e,[s.createElementVNode("div",S9e,s.toDisplayString(a.getTypeZh(n.nodeInfo.type))+":",1),s.createElementVNode("div",{class:s.normalizeClass(["value",{"star-next":n.nodeInfo.collect}])},s.toDisplayString(a.name),3)])):s.createCommentVNode("",!0),a.isNodeTypeNode?(s.openBlock(),s.createElementBlock("div",E9e,[x9e,s.createElementVNode("div",k9e,[s.createElementVNode("div",N9e,[s.createElementVNode("div",T9e,s.toDisplayString(n.nodeInfo.name),1)])])])):s.createCommentVNode("",!0),n.nodeInfo.label?(s.openBlock(),s.createElementBlock("div",A9e,[O9e,s.createElementVNode("div",I9e,s.toDisplayString(n.nodeInfo.label),1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",R9e,[a.isNormalNode&&n.nodeInfo.detail?(s.openBlock(),s.createElementBlock("div",P9e,[a.canGoDetail&&a.hasLevel?(s.openBlock(),s.createElementBlock("div",L9e,[B9e,s.createElementVNode("div",{class:s.normalizeClass(["value level",a.getLevelClass(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level)]),title:n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"},s.toDisplayString(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"),11,D9e)])):s.createCommentVNode("",!0),n.nodeInfo.detail&&n.nodeInfo.detail.tags&&n.nodeInfo.detail.tags.length>0?(s.openBlock(),s.createElementBlock("div",M9e,[F9e,s.createElementVNode("div",$9e,[s.createElementVNode("div",z9e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.formatTags(n.nodeInfo.detail.tags),(h,m)=>(s.openBlock(),s.createBlock(c,{key:m,"popper-class":"el-tooltip-gray"},{content:s.withCtx(()=>[s.createElementVNode("div",null,[s.createTextVNode(s.toDisplayString(h.name===h.desc?h.name:h.name+":"+h.desc)+" ",1),h.disabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[U9e,s.createTextVNode(" 标签状态:失效 ")],64)):s.createCommentVNode("",!0)])]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createVNode(d,{class:s.normalizeClass(["graph-tag-one",`${h.type||"unknown"} ${h.disabled?"tag-disable":""}`]),type:h.type||"info"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(h.name),1)]),_:2},1032,["class","type"])])]),_:2},1024))),128))])])])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.fieldMapThisType,(h,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[a.canShowField(h)?(s.openBlock(),s.createElementBlock("div",j9e,[s.createElementVNode("div",q9e,s.toDisplayString(h.zh)+":",1),s.createElementVNode("div",{class:s.normalizeClass(["value",{red:h.prop==="virus_name"}]),title:n.nodeInfo.detail.info.basic[m]},s.toDisplayString(a.getFieldValue(h)),11,H9e)])):s.createCommentVNode("",!0)],64))),256))])):s.createCommentVNode("",!0),a.isNodeTypeNode?(s.openBlock(),s.createElementBlock("div",G9e,[s.createElementVNode("div",W9e,[K9e,s.createElementVNode("div",Y9e,[a.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum>0?(s.openBlock(),s.createElementBlock("span",J9e,[s.createElementVNode("span",X9e,s.toDisplayString(a.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum),1),s.createTextVNode("/")])):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.getNodeTypeChildNum(n.nodeInfo.id).allChildNum),1)])])])):s.createCommentVNode("",!0),a.isAggregateNode?(s.openBlock(),s.createElementBlock("div",Q9e,[s.createElementVNode("div",Z9e,"聚合节点 ("+s.toDisplayString(o.aggregationList.length)+"个)",1),s.createElementVNode("div",V9e,[s.createVNode(p,{data:o.aggregationList,style:{width:"100%"}},{default:s.withCtx(()=>[s.createVNode(u,{prop:"name","min-width":"200",label:"名称"}),s.createVNode(u,{sortable:"",prop:"type",label:"类型"}),s.createVNode(u,{sortable:"",prop:"level",width:"80",label:"级别"},{default:s.withCtx(h=>[s.createElementVNode("span",{style:s.normalizeStyle({color:a.getColorStyle(h.row.level)})},s.toDisplayString(h.row.level||"--"),5)]),_:1}),s.createVNode(u,{label:"操作"},{default:s.withCtx(h=>[s.createVNode(f,{class:"add-to-graph-btn",type:"primary",text:"",size:"small",onClick:m=>a.addToGraph(h.row)},{default:s.withCtx(()=>[s.createTextVNode(" 添加到图谱 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])):s.createCommentVNode("",!0)])])):(s.openBlock(),s.createElementBlock("div",eEe,[s.createElementVNode("div",tEe,[s.createElementVNode("div",nEe,s.toDisplayString(n.nodeInfo.apiName),1)])]))])],38)}const iEe=Bt(m9e,[["render",rEe],["__scopeId","data-v-eb4f1bf9"]]),oEe=[{id:52,product_id:0,name:"copy",namec:"复制",parent_id:0,has_child:0,status:0,type:2,path:"0-52",pos:65,ctime:"0000-00-00 00:00:00",utime:"2019-06-04 16:49:38",children:[]},{id:62,product_id:0,name:"release_aggregation",namec:"释放聚合顶点",parent_id:0,has_child:0,status:0,is_sys:0,is_detail:0,type:2,path:"0-62",pos:1,ctime:"0000-00-00 00:00:00",utime:"2019-05-06 15:08:10",children:[]}],sEe={name:"vue-safe-force-graph",version:"2.0.52",description:"force_graph in security area",author:"jason zhang",module:"./lib/vue-safe-force-graph.js",main:"./lib/vue-safe-force-graph.umd.cjs",type:"module",files:["/lib/"],exports:{".":{import:"./lib/vue-safe-force-graph.js",require:"./lib/vue-safe-force-graph.umd.cjs"},"./*":"./*"},scripts:{dev:"vite","dev:base64":"vite --mode development_base64",lib:"vite build","lib:base64":"vite build --mode production_base64",patch:'npm version patch -m "Upgrade to %s "',"patch:base64":'npm version patch -m "Upgrade to %s for base64"',p:"npm run patch && npm run lib && npm publish","p:base64":"npm run patch:base64 && npm run lib:base64 && npm publish",lint:"eslint --ext .js,.vue src",lintFix:"eslint --fix --ext .js,.vue src",imageToCdn:"node qcdn.cjs",imageToBase64:"node qcdn.cjs --buildtype=base64",changelog:"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},dependencies:{"@element-plus/icons-vue":"^2.1.0","@q/qapm":"^1.1.5","csv-parse":"^5.0.4",d3:"^7.8.5","d3-lasso":"0.0.5","element-plus":"^2.3.0",json2csv:"^5.0.7",konva:"^9.2.0","lodash-es":"^4.17.21","mime-types":"^2.1.35",minimist:"^1.2.6","radar-js-analytic-sdk":"^2.2.6",vue:"^3.2.47","vue-clipboard3":"^2.0.0","vue-router":"^4.1.6","vue-virtual-scroller":"^2.0.0-beta.8"},devDependencies:{"@babel/core":"^7.23.3","@babel/preset-env":"^7.23.3","@originjs/vite-plugin-commonjs":"^1.0.3","@q/qcdn":"^3.2.2","@vitejs/plugin-vue":"^4.1.0",axios:"^0.21.1","babel-eslint":"^10.1.0",eslint:"^7.32.0","eslint-plugin-vue":"^8.0.3",imageinfo:"^1.0.4",qs:"^6.10.1","rollup-plugin-visualizer":"^5.9.0",sass:"^1.62.0","unplugin-auto-import":"^0.15.2","unplugin-vue-components":"^0.24.1",vite:"^4.3.1"},browserslist:["> 1%","last 2 versions"],engines:{node:">=8.9",npm:">= 3.0.0"},license:"MIT"},ZNe="",VNe="",eTe="",{toClipboard:aEe}=ff(),lEe="Arial,Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif",ni=1,cEe=["ip","intranet","internet"],P_=20,cr={},dEe={name:"ForceGraphRenderByCanvas",components:{Popover:iEe,NodeContextmenu:g9e},mixins:[jr],provide:function(){return{levelList:this.levelList}},props:{data:{type:Object,default:()=>({nodes:[],links:[]})},history:{type:Object,default:()=>({})},linkDistance:{type:Number,default:120},strength:{type:Number,default:-600},isThreatPath:{type:Boolean,default:!1},requestGraphData:{type:Boolean,default:!1},moduleDetail:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}},alphaDecay:{type:Number,default:.0228},alphaMin:{type:Number,default:.001},darkMode:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},nodeWidth:{type:Number},startNodeWidth:{type:Number},nodeTypeScale:{type:Number,default:1},nodeTypeList:{type:Array,default:()=>[]},manualTickNumber:{type:Number,default:500},startNodeAnimation:{type:Boolean,default:!0},customTooltip:{type:Function}},emits:["handle-select-node","custom-contextmenu-click","flagFiles","updateSelection"],data(){return{prefix:"./public/",iconAllLoaded:!1,iconSize:{},iconFiles:{},flagFiles:{},highlightRule:{},nodesRange:null,mousePosition:{left:0,top:0},hoverNodePosition:{},uniqueClass:"",showPopover:!1,popoverTimer:null,popoverType:"",popoverContent:{},popoverNode:{},showContextMenu:!1,contextMenuNode:{},menuOptions:[],isDragging:!1,originTransform:null,dragNodeFix:!1,destroyed:!1,actKey:va()?"metaKey":"ctrlKey",levelHeight:100,actNum:0,scriptNow:null,scriptInited:!1,canAct:!1,isKeyUp:!0,initTimes:0,resizeObserver:null,canvasElement:null,stage:s.shallowRef(null),layer:s.shallowRef(null),nodesGroup:s.shallowRef({}),linksGroup:s.shallowRef({}),grab:s.shallowRef(null),simulation:s.shallowRef(null),nodes:s.shallowRef(null),links:s.shallowRef(null),hoveredNode:s.shallowRef(null),mouseDownNode:s.shallowRef(null),selectionRect:null,selection:[],scale:ni,mousedownPos:null,mousedownNode:null,mouseupNode:null,dragLine:null,darkBgRect:null,inited:!1,hasSimulation:!1,nodesLength:0,ticking:!1,anim1:null,anim2:null,anim3:null}},computed:{isAutoTick(){var e;return((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber},iconSizeComputed(){const e=a$(this.iconSize);return this.nodeTypeList.forEach(t=>{e[t]=this.iconSize[t]*this.nodeTypeScale}),e},contextMenuNodes(){return this.contextMenuNode.id?this.selection.some(e=>e.id===this.contextMenuNode.id)?[...this.selection]:[this.contextMenuNode]:[]},showContextMenuFlag(){return this.requestGraphData?this.showContextMenu:!1}},watch:{data:{handler:function(){const e=this.nodesLength!==this.data.nodes.length;this.nodes=this.data.nodes,this.links=this.data.links,this.nodesLength=this.data.nodes.length,this.update(e)},deep:!0},moduleDetail:{handler:function(e){return Oe(this,null,function*(){e!=null&&e.nodes&&!this.iconAllLoaded&&(yield this.loadIcons(),this.initForceGraph(),setTimeout(()=>{this.update()},50))})},deep:!0,immediate:!0},darkMode:{handler:function(e){return Oe(this,null,function*(){const t=e?"dark":"light";setTimeout(()=>{this.update(),this.isThreatPath?document.querySelectorAll(`.${this.uniqueClass}.render-container`)[0].setAttribute("data-theme",t):(document.querySelectorAll(`.${this.uniqueClass}.render-container`)[0].setAttribute("data-theme",t),document.getElementsByClassName(this.uniqueClass+" render-container")[0].parentElement.parentElement.setAttribute("data-theme",t))},200)})},immediate:!0}},created(){On("graph created time",Date.now()),wi.setProject("QH_10542_1724").getTrack(),localStorage.getItem("showSafeForceGraphLog")&&On("组件版本: "+sEe.version),this.isThreatPath||this.initKeyEvent(),this.uniqueClass="unique"+new Date().getTime()+Math.floor(Math.random()*1e5)},mounted(){return Oe(this,null,function*(){new DSe({appKey:"fe-force-graph",ratio:50}),this.initForceGraph(),zQ(this.levelList),!this.isThreatPath&&(uo(qe,"buttonClick",e=>{On(e,"buttonClick msg"),this.handleContextMenuClick(e)}),uo(qe,"relationClick",e=>{this.handleContextMenuClick(e)}),uo(qe,"sendNodesRange",(e,t)=>{e!==void 0&&(this.nodesRange=e,this.updateNodeStyle())}))})},beforeUnmount(){fo(qe,"buttonClick"),fo(qe,"relationClick"),fo(qe,"sendNodesRange"),this.unbindKeyEvent(),this.resetAll(),On("destroy")},methods:{initForceGraph(){return Oe(this,null,function*(){if(this.inited)return;const e=this.$refs.canvasContainer;let t=e.clientWidth,n=e.clientHeight;this.resizeObserver=new ResizeObserver(o=>{for(const a of o){if(t=a.contentRect.width,n=a.contentRect.height,On(`新宽度: ${t}px, 新高度: ${n}px`),t===0||n===0)return;this.stage.width(t),this.stage.height(n),this.layer&&this.layer.batchDraw(),this.hasSimulation&&this.updateSimulation()}}),this.resizeObserver.observe(e),document.addEventListener("click",this.hideContextMenu,!1),this.nodes=this.data.nodes,this.links=this.data.links,this.stage=new tt.Stage({container:e,width:t,height:n,scaleX:ni,scaleY:ni}),this.layer=new tt.Layer,this.grab=new tt.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab);const r=this.layer.getCanvas()._canvas;this.canvasElement=r,this.stage.on("mousemove",o=>{if(!this.mousedownNode||!o.evt[this.actKey]){if(this.resetMouseVars(),this.selectionRect&&o.evt.altKey){const a=this.stage.getPointerPosition(),l=(a.x-this.stage.x())/this.scale,c=(a.y-this.stage.y())/this.scale,d=l-this.selectionRect.x(),u=c-this.selectionRect.y();this.selectionRect.width(d),this.selectionRect.height(u),this.stage.batchDraw()}}else{const a=this.stage.getPointerPosition(),l=this.stage.scaleX(),c=(a.x-this.stage.x())/l,d=(a.y-this.stage.y())/l;this.dragLine.points([this.mousedownPos.x,this.mousedownPos.y,c,d]),this.layer.batchDraw()}}),this.stage.on("wheel",o=>{o.evt.preventDefault();const a=1.1,l=this.scale,c=o.evt.deltaY<0?l*a:l/a;this.scale=c;const d=this.stage.getPointerPosition(),u=this.stage.position(),f=d.x-(d.x-u.x)*(c/l),p=d.y-(d.y-u.y)*(c/l);this.stage.setAttrs({scaleX:c,scaleY:c,x:f,y:p}),this.layer.batchDraw()}),this.stage.on("mousedown",o=>{const a=o.target;if(a&&a.nodeType==="Stage"?this.stage.setDraggable(!0):this.stage.setDraggable(!1),o.evt.altKey){this.stage.setDraggable(!1);const l=this.stage.scaleX(),c=this.stage.getPointerPosition(),d=(c.x-this.stage.x())/l,u=(c.y-this.stage.y())/l;this.selectionRect=new tt.Rect({x:d,y:u,width:0,height:0,stroke:"rgb(80, 80, 80)",strokeWidth:2}),this.layer.add(this.selectionRect),this.stage.batchDraw()}}),this.stage.on("mouseup",o=>{if(this.stage.setDraggable(!1),this.selectionRect&&o.evt.altKey){const a=this.selectionRect.x(),l=this.selectionRect.y(),c=this.selectionRect.width(),d=this.selectionRect.height();this.selection=this.nodes.filter(u=>{const f={x:u.x,y:u.y},p=Math.min(a,a+c),h=Math.max(a,a+c),m=Math.min(l,l+d),b=Math.max(l,l+d);return f.x>=p&&f.x<=h&&f.y>=m&&f.y<=b}),this.updateSelection(),this.selectionRect.destroy(),this.selectionRect=null}}),this.stage.on("contextmenu",this.handleGlobalContextMenu),this.stage.on("click",o=>{o.target&&o.target.nodeType==="Stage"&&this.handleDeselectNode(o)}),this.setSimulation(),this.stage.add(this.layer),this.stage.draw(),this.update(),this.inited=!0})},setSimulation(){var n;if(this.hasSimulation||!((n=this.nodes)!=null&&n.length))return;const e=this.stage.width()/(2*ni),t=this.stage.height()/(2*ni);this.hasSimulation=!0,this.simulation=bse(this.nodes).force("link",ise(this.links).id(r=>r.id).distance(this.linkDistance).strength(1)).force("charge",wse().strength(this.strength)).force("x",_se()).force("y",Cse()).force("center",CS(e,t)).alphaDecay(this.alphaDecay).alphaMin(this.alphaMin).stop(),this.nodeWidth&&this.simulation.force("collision",nse().radius(this.nodeWidth/2)),this.isAutoTick?(this.simulation.alpha(1).restart(),this.simulation.on("tick",this.ticked)):(this.simulation.on("tick",null),this.sendManualTick()),this.simulation.on("end",()=>{On("simulation end time",Date.now()),this.isThreatPath&&this.centerAndZoom(1)})},sendManualTick(){var e;On("sendManualTick",(e=this.nodes)==null?void 0:e.length),!this.ticking&&(this.ticking=!0,this.doClearCanvas(),this.simulation.alphaDecay(this.alphaDecay*2),this.simulation.alphaMin(this.alphaMin*5),this.simulation.alpha(1).restart(),setTimeout(()=>{console.time("tick");for(let t=0,n=Math.ceil(Math.log(this.simulation.alphaMin())/Math.log(1-this.simulation.alphaDecay()));t<n;++t)On("tick"),this.simulation.tick();console.timeEnd("tick"),this.ticking=!1,this.update(),this.centerAndZoom()},1e3))},update(e=!1){return Oe(this,null,function*(){var t,n,r;!this.iconAllLoaded&&((n=(t=this.moduleDetail)==null?void 0:t.nodes)!=null&&n.length)&&(yield this.loadIcons()),!this.destroyed&&(r=this.nodes)!=null&&r.length&&(this.initScript(),On("update"),e&&this.updateSimulation(),this.doClearCanvas(),this.paintLinks(),this.paintNodes(),this.updateSelection(),this.ticked(),this.actNum===9&&setTimeout(()=>{this.centerAndZoom(.8)},200))})},doClearCanvas(){this.nodesGroup={},this.linksGroup={},this.layer.destroyChildren(),this.grab=new tt.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab)},paintNodes(){const e=this.stage.width()/2,t=this.stage.height()/2,n=this.selection.map(r=>r.id);this.nodes.forEach(r=>Oe(this,null,function*(){var _,C,k,S,E,T,A,I,O,F,R,j,M,q,X,V,z,U,H,G,D,se,ne;const o=(C=(_=r.detail)==null?void 0:_.info)==null?void 0:C.icon_img;let a;r.type==="nodeType"?a=this.iconSizeComputed[r.icon]||this.iconSizeComputed.node_type:a=this.iconSize[r.icon]||this.iconSize[r.type]||24,r.startNode&&this.startNodeWidth&&(a=this.startNodeWidth);const l=((E=(S=(k=r==null?void 0:r.detail)==null?void 0:k.info)==null?void 0:S.basic)==null?void 0:E.level)||"",c=(I=(A=(T=r==null?void 0:r.detail)==null?void 0:T.info)==null?void 0:A.basic)==null?void 0:I.flag;let d;try{d=yield this.getNodeImage(r)}catch(K){console.log(K)}this.nodesGroup[r.id]&&((O=this.nodesGroup[r.id])==null||O.destroy());const u=new tt.Group({name:"nodeGroup",opacity:1,id:`${r.id}`,x:r.x?r.x:e,y:r.y?r.y:t,draggable:!0,visible:r.show});if(n.includes(r.id)&&u.addName("isSelected"),r.startNode&&this.startNodeAnimation){const K=cs(l,this.levelList,this.darkMode),Y=new tt.Circle({x:0,y:0,radius:20,fill:K,opacity:0}),re=new tt.Circle({x:0,y:0,radius:20,fill:K,opacity:0}),oe=new tt.Circle({x:0,y:0,radius:20,fill:K,opacity:0});u.add(Y),u.add(re),u.add(oe);const B=(W,ee)=>new tt.Animation(function(ce){const fe=ce.time;if(fe%ee/ee===0)return!1;const Ne=.5-.5*(fe%ee)/ee,_e=40*(fe%ee)/ee;W.radius(_e||0),W.opacity(Ne)},this.layer);(F=this.anim1)==null||F.stop(),(R=this.anim2)==null||R.stop(),(j=this.anim3)==null||j.stop(),this.anim1=B(Y,1500),this.anim2=B(re,1500),this.anim3=B(oe,1500),(M=this.anim1)==null||M.start(),setTimeout(()=>{this.anim2.start()},500),setTimeout(()=>{this.anim3.start()},1e3)}else if(r.startNode&&!this.startNodeAnimation){const K=cs(l,this.levelList,this.darkMode),Y=new tt.Circle({x:0,y:0,radius:20,fill:K,opacity:this.startNodeAnimation?0:.3});u.add(Y)}if(!o&&(r.type==="ip"||r.type==="internet"||r.type==="country"||r.type==="target_country")){const K=cs(l,this.levelList,this.darkMode),Y=new tt.Circle({x:0,y:0,fill:this.darkMode?"#182628":"#fff",radius:a/2,stroke:K,strokeWidth:2});u.add(Y)}if(d){const K=c||(X=(q=r==null?void 0:r.detail)==null?void 0:q.info)!=null&&X.inner_country?20:a,Y=d&&new tt.Image({x:0,y:0,offsetX:K/2,offsetY:K/2,image:d,width:K,height:K,draggable:!1});u.add(Y)}if(!o&&r.detail&&r.type==="md5"){const K=((U=(z=(V=r.detail.info)==null?void 0:V.basic)==null?void 0:z.file_type)==null?void 0:U.toUpperCase())||"MD5",Y=new tt.Text({name:"md5Text",x:0,y:0,text:K,fontSize:4,fontWeight:700,fontFamily:lEe,fill:this.darkMode?"#182628":"#fff",align:"center",listening:!1});Y.x(Y.x()-Y.width()/2),u.add(Y)}const f=r.textProp||"name",p=f==="name"?((G=(H=r==null?void 0:r.detail)==null?void 0:H.info)==null?void 0:G.name)||r.name:r[f];let h=p.length>14&&!cEe.includes(r.type)?p.slice(0,7)+"..."+p.slice(-7):p;h=JQ(h);const m=new tt.Text({offsetY:a/2,name:"konvaText",x:0,y:a+8,text:h,fontSize:12,fontFamily:"Calibri",fill:this.darkMode?"#cdd9da":"#000",align:"center",listening:!1,visible:!!r.textProp});m.x(m.x()-m.width()/2),u.add(m);const b=new tt.Circle({name:"border",x:0,y:0,radius:a/2,fill:"#5c6271",opacity:.4,visible:!1});if(u.add(b),(se=(D=r.detail)==null?void 0:D.tags)!=null&&se.length){const K=new tt.Circle({x:((a/2||14)+5)*Math.sin(60*Math.PI/180),y:-((a/2||14)+5)*Math.cos(60*Math.PI/180),radius:3,fill:"#9300ff",listening:!1});u.add(K)}if(r.type!=="nodeType"&&r.type!=="aggregation"){var w=new tt.Circle({name:"collect",x:((a/2||14)+5)*Math.sin(0*Math.PI/180),y:-((a/2||14)+5)*Math.cos(0*Math.PI/180),radius:3,fill:"#ffad00",visible:!!r.collect});u.add(w)}if(r.label){const K=new tt.Circle({x:((a/2||14)+5)*Math.sin(30*Math.PI/180),y:-((a/2||14)+5)*Math.cos(30*Math.PI/180),radius:3,fill:"#0099ff",listening:!1});u.add(K)}if(r.type==="nodeType"&&r.showTotal){const K=(a/2||14)+5,Y=70*Math.PI/180,re=K*Math.sin(Y),oe=-K*Math.cos(Y),B=new tt.Circle({x:re,y:oe,radius:10,fill:"#1890ff",stroke:"white",strokeWidth:2,listening:!1});u.add(B);const W=new tt.Text({x:re,y:oe,text:`${((ne=r==null?void 0:r.children)==null?void 0:ne.length)||0}`,fontSize:10,fontFamily:"Calibri",fill:"#fff",align:"center",verticalAlign:"middle",listening:!1});W.offsetX(W.width()/2),W.offsetY(W.height()/2),u.add(W)}u.on("dragstart",(K,Y)=>{K.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(.3).restart(),this.isDragging=!0)}),u.on("dragmove",K=>{if(!K.evt[this.actKey]){var Y=this.simulation.nodes().find(re=>re.id===r.id);Y&&(Y.x=u.x(),Y.fx=u.x(),Y.y=u.y(),Y.fy=u.y(),this.links.forEach(re=>{const oe=this.linksGroup[`${re.source.id}-${re.target.id}`],B=oe==null?void 0:oe.findOne(".konvaLine"),W=oe==null?void 0:oe.findOne(".linkArrow"),ee=oe==null?void 0:oe.findOne(".edgeLabel");let ce,fe,ye,Ne;if(re.source.id===Y.id){if(!this.nodesGroup[re.target.id])return;ce=Y.x,fe=this.nodesGroup[re.target.id].x(),ye=Y.y,Ne=this.nodesGroup[re.target.id].y(),B.points([ce,ye,fe,Ne]);const _e=q0(ce,ye,fe,Ne,P_);W==null||W.x(_e==null?void 0:_e.x),W==null||W.y(_e==null?void 0:_e.y),W==null||W.rotation(Math.atan2(Ne-ye,fe-ce)*(180/Math.PI))}else if(re.target.id===Y.id){if(!this.nodesGroup[re.source.id])return;ce=this.nodesGroup[re.source.id].x()||0,fe=Y.x||0,ye=this.nodesGroup[re.source.id].y()||0,Ne=Y.y||0,B.points([ce,ye,fe,Ne]);const _e=q0(ce,ye,fe,Ne,P_);W==null||W.x(_e==null?void 0:_e.x),W==null||W.y(_e==null?void 0:_e.y),W==null||W.rotation(Math.atan2(Ne-ye,fe-ce)*(180/Math.PI))}if(ee&&(re.source.id===Y.id||re.target.id===Y.id)){ee.x((ce+fe)/2),ee.y((ye+Ne)/2),ee.offsetX(ee.getWidth()/2||0),ee.offsetY(ee.getHeight()/2+8||0);const _e=Math.atan2(Ne-ye,fe-ce)*(180/Math.PI);fe<ce?ee.rotation(_e+180):ee.rotation(_e)}}),this.layer.batchDraw())}}),u.on("dragend",K=>{K.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(0),this.isDragging=!1)}),u.on("click",K=>{K.evt.detail===2?this.expandNodes(K,r):K.evt.detail===1&&K.evt.button===0&&this.handleNodeClick(K,r)}),u.on("contextmenu",K=>{K.cancelBubble=!0,K.evt.preventDefault(),K.evt.stopPropagation(),this.handleNodeContextMenu(K,r,u)}),u.on("mouseup",K=>this.handleNodeMouseUp(K,r)),u.on("mousedown",K=>this.handleNodeMouseDown(K,r)),u.on("mouseenter",K=>this.handleNodeMouseEnter(K,r)),u.on("mouseleave",K=>this.handleNodeMouseLeave(K,r)),this.grab.add(u),this.nodesGroup[r.id]=u})),this.stage.batchDraw()},paintLinks(){const e=this.stage.width()/2,t=this.stage.height()/2;this.links.forEach(n=>{this.linksGroup[`${n.source.id}-${n.target.id}`]&&this.linksGroup[`${n.source.id}-${n.target.id}`].destroy();const r=new tt.Group({opacity:1,id:`${n.source.id}-${n.target.id}`,visible:n.source.show&&n.target.show}),o=this.darkMode?"#445152":"#999",a=new tt.Arrow({name:"linkArrow",pointerLength:10,pointerWidth:10,x:e,y:t,fill:o});r.add(a);const l=n.source.x||0,c=n.source.y||0,d=n.target.x||0,u=n.target.y||0,f=new tt.Line({name:"konvaLine",id:`${n.source.id}-${n.target.id}`,points:[l,c,d,u],stroke:n.target.type==="org"?"#cf1322":o,strokeWidth:1,dash:n.diy===!0?[5,5]:null});if(n.edge_label){const p=new tt.Text({name:"edgeLabel",x:(l+d)/2,y:(c+u)/2,text:n.edge_label,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(p)}if(n.target.type==="nodeType"){const p=new tt.Text({name:"edgeLabel",x:(l+d)/2,y:(c+u)/2,text:n.target.name,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(p)}r.add(f),this.grab.add(r),r.moveToBottom(),this.linksGroup[`${n.source.id}-${n.target.id}`]=r}),this.stage.batchDraw()},updateSimulation(){var e,t;try{if(!this.simulation&&!this.hasSimulation){this.setSimulation();return}this.simulation.nodes(this.nodes),this.simulation.force("link").links(this.links),this.simulation.alpha(.4).restart(),this.history.layoutIndex===0?((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber?this.simulation.on("tick",this.ticked):(this.simulation.on("tick",null),this.sendManualTick()):this.simulation.on("tick",this.ticked)}catch(n){console.log(n,"simulation-e1"),(t=this.simulation)==null||t.stop()}},ticked(){switch(On("ticked"),this.history.layoutIndex){case 0:this.forceLayout();break;case 1:this.treeLayout();break;default:this.forceLayout();break}},forceLayout(){var t;if(!this.nodes.length||!this.links.length)return;let e=!0;for(let n=0;n<this.links.length;n++){const r=this.links[n],o=this.linksGroup[`${r.source.id}-${r.target.id}`],a=o==null?void 0:o.findOne(".konvaLine"),l=o==null?void 0:o.findOne(".linkArrow"),c=o==null?void 0:o.findOne(".edgeLabel");let d=r.source.x,u=r.source.y,f=r.target.x,p=r.target.y;const h=f-d||1,m=p-u||1,b=Math.sqrt(h*h+m*m),w=h/b||1,_=m/b||1,C=r.source.type==="nodeType"?(this.iconSizeComputed[r.source.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1,k=r.target.type==="nodeType"?(this.iconSizeComputed[r.target.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1;if(d=d+C*w,u=u+C*_,f=f-k*w,p=p-k*_,isNaN(d)||isNaN(u)||isNaN(f)||isNaN(p)){e=!1;break}if(a==null||a.points([d,u,f,p]),l){const S=q0(d,u,f,p,P_);l==null||l.x((S==null?void 0:S.x)||0),l==null||l.y((S==null?void 0:S.y)||0),l==null||l.rotation(Math.atan2(p-u,f-d)*(180/Math.PI))}if(c){c.x((d+f)/2),c.y((u+p)/2),c.offsetX(c.getWidth()/2||0),c.offsetY(c.getHeight()/2+8||0);const S=Math.atan2(p-u,f-d)*(180/Math.PI);f<d?c.rotation(S+180):c.rotation(S)}}if(!e){On("请点击自动布局按钮"),this.resetLayout();return}for(let n=0;n<this.nodes.length;n++){const r=this.nodes[n];(t=this.nodesGroup[r.id])==null||t.position({x:r.x||0,y:r.y||0})}},selectEdgesByNode(e){const t=e.map(n=>n.id);this.links.forEach(n=>{const r=this.linksGroup[`${n.source.id}-${n.target.id}`];t.includes(n==null?void 0:n.target.id)||t.includes(n==null?void 0:n.source.id)?r==null||r.addName("isSelected"):r==null||r.removeName("isSelected")})},showKeyWay(e){if(e.length!==1){this.links.forEach(r=>{const o=this.linksGroup[`${r.source.id}-${r.target.id}`];o==null||o.removeName("keyed")}),this.history.resetKeyLinksAndNodes();return}const{keyLinks:t,keyNodeIds:n}=this.history.findKeyLinksAndNodes(e[0].id,!0);this.links.forEach(r=>{const o=t.find(l=>l.source.id===r.source.id&&l.target.id===r.target.id),a=this.linksGroup[`${r.source.id}-${r.target.id}`];o?a==null||a.addName("keyed"):a==null||a.removeName("keyed")}),this.nodes.forEach(r=>{const o=this.nodesGroup[r.id];n.includes(r.id)?o==null||o.addName("keyed"):o==null||o.removeName("keyed")})},updateNodeStyle(){if(!this.iconAllLoaded)return;let e;this.nodesRange&&this.history.keyNodeIds?e=[...this.nodesRange.map(t=>t.id),...this.history.keyNodeIds]:this.nodesRange?e=this.nodesRange.map(t=>t.id):this.history.keyNodeIds&&(e=this.history.keyNodeIds),setTimeout(()=>{this.highlightByRule(this.highlightRule,e),this.updateNodesStyleByName(),this.updateLinksStyleByName()},0)},updateNodesStyleByName(){this.nodes.forEach(e=>{const t=this.nodesGroup[e.id];if(!t)return;const n=t==null?void 0:t.findOne(".border"),r=t==null?void 0:t.findOne(".konvaText"),o=this.darkMode?"#cdd9da":"#000";t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1),t!=null&&t.hasName("isSelected")?(t.scale({x:8/7,y:8/7}),n==null||n.visible(!0)):(t.scale({x:1,y:1}),n==null||n.visible(!1)),e.type!=="nodeType"&&(t!=null&&t.hasName("isSelected")?(r==null||r.visible(!0),r==null||r.fill("#007ee2")):(r==null||r.visible(!!e.textProp),r==null||r.fill(o)))}),this.layer.batchDraw()},updateLinksStyleByName(){this.links.forEach(e=>{const t=this.linksGroup[`${e.source.id}-${e.target.id}`];if(!t)return;const n=t.findOne(".konvaLine"),r=t.findOne(".edgeLabel"),o=t.findOne(".linkArrow");t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1);const a=this.darkMode?"#445152":"#999";if(t.hasName("isSelected")||t.hasName("keyed")){const l=e.target.type==="org"?"#cf1322":"#007ee2";n.stroke(l),o.fill(l),n.strokeWidth(1),t==null||t.opacity(1),r==null||r.fill("#007ee2"),t.hasName("keyed")?n.strokeWidth(3):n.strokeWidth(1)}else{const l=e.target.type==="org"?"#cf1322":a;this.linksGroup[`${e.source.id}-${e.target.id}`].removeName("isSelected"),n.strokeWidth(1),n.stroke(l),o.fill(l),r==null||r.fill(this.darkMode?"#cdd9da":"#000")}}),this.layer.batchDraw()},handleTableSelect(e=[]){this.selection=this.nodes.filter(t=>{let n;return e.length>1?n=e.indexOf(t.id)>=0&&t.type!=="nodeType"&&t.type!=="aggregation":n=e.indexOf(t.id)>=0,n}),this.updateSelection()},resetAll(){var e,t;document.removeEventListener("click",this.hideContextMenu),(e=this.simulation)==null||e.stop(),this.simulation=null,this.hasSimulation=!1,this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,this.$refs.canvasContainer&&((t=this.resizeObserver)==null||t.unobserve(this.$refs.canvasContainer)),this.nodes=[],this.links=[],this.resizeObserver=null,this.destroyed=!0,this.history.destroy&&this.history.destroy()},unbindKeyEvent(){this.initKeyEvent(1)},initKeyEvent(e=0){if(e){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp);return}document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),this.isKeyUp=!0},keyDown(e){const t=e.keyCode,n=e[this.actKey],r=e.shiftKey;if(this.isKeyUp)switch(t){case 17:break;case 16:this.toggleZoom(!1);break;case 38:break;case 40:this.goAction();break;case 67:if(window.getSelection().toString())return;n&&this.copyNodeText(this.selection);break;case 89:n&&!va()&&this.$parent.historyForward();break;case 90:n&&r?this.$parent.historyForward():n&&this.$parent.historyBack();break;case 46:this.$parent.deleteNodes(this.selection);break}},keyUp(e){const t=e.keyCode,n=e.keyCode;if(va())switch(n){case 17:break;case 16:this.toggleZoom(!0);break}else switch(t){case 17:break;case 16:this.toggleZoom(!0);break}this.isKeyUp=!0},initScript(){var r,o,a,l,c,d;if(this.scriptInited)return;((a=(o=(r=this.history)==null?void 0:r.dataNow)==null?void 0:o.nodes)==null?void 0:a.length)>0&&(this.scriptInited=!0);const e=["193.36.119.50","6cd7b91212983cc557c6e3e671734ff9"];let t=null;if((d=(c=(l=this.history)==null?void 0:l.dataNow)==null?void 0:c.nodes)==null||d.some(u=>{const f=e.indexOf(u.id);return f>=0&&u.startNode===!0&&(t=f),!0}),t===null)return;const n=[[{node:"193.36.119.50"},{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"}],[{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"},{node:"183.246.177.59"},{node:"e7db5b09a39e324d36e937d89f98fdb9122cd859"}]];this.scriptNow=n[t],this.canAct=!!this.scriptNow},goAction(){if(!this.scriptNow||this.actNum>(this.scriptNow.length-1)*2)return;if(this.actNum===(this.scriptNow.length-1)*2){this.centerAndZoom(),this.actNum++;return}const e=this.scriptNow[Math.floor(this.actNum/2)+1];if(this.actNum%2===0){if(!this.history.dataNow.nodes.some(t=>t.id===e.node))return;this.handleTableSelect(e.node),this.nodesMoveToCenterView([e.node]),this.actNum++}else this.$parent.expandNodes(this.selection[0]),setTimeout(()=>{this.nodesMoveToCenterView([this.selection[0].id])},100),this.actNum++},nodesMoveToCenterView(e,t=.9){if(e.length===0)return;const n=[],r=this.nodes.filter(k=>e.indexOf(k.id)>=0);r==null||r.forEach(function(k,S){const E=this.nodesGroup[k.id];n.push({bounds:(E==null?void 0:E.getClientRect())||{},fx:k.x||0,fy:k.y||0})});const o=this.getBounds(n);this.originTransform=this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()};const a=this.stage.width(),l=this.stage.height()/1.5,c=o.width,d=o.height;if(c===0||d===0)return;let u=t/Math.max(c/a,d/l);u=Math.min(u,ni)||ni,this.scale=u;const f=this.stage.width()/(2*u),p=this.stage.height()/(2*u),h=this.nodesGroup[e[0]],m=h==null?void 0:h.getClientRect(),b=m.x*u,w=m.y*u,_=f-b,C=p-w;this.stage.setAttrs({scaleX:u,scaleY:u,x:_||0,y:C||0}),this.layer.batchDraw()},getBounds(e){let t,n,r,o;return e.map(a=>{const l=a.bounds,c=l.x+a.fx,d=l.y+a.fy;t=Math.min(c,t)||c,n=Math.min(d,n)||d,r=Math.max(c+l.width,r)||c+l.width,o=Math.max(d+l.height,o)||d+l.height}),{x:t,y:n,width:r-t,height:o-n}},resetMouseVars(){var e;this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,(e=this.dragLine)==null||e.destroy(),Object.keys(this.nodesGroup).forEach(t=>{this.nodesGroup[t].draggable(!0)})},loadIcons(){return new Promise((e,t)=>{const n=[],r=[];for(const d in this.moduleDetail.plugs){const u=this.moduleDetail.plugs[d];u==null||u.map(f=>{f.children?r.push(...f.children):r.push(f)})}n.push(...r.map(d=>d.icon)),n.push(...this.moduleDetail.nodes.map(d=>d.name)),n.push("node_type"),n.push("node"),n.push("aggregation");const o=this;let a=0;const l=n.filter(d=>this.imgPath[`${o.prefix}d3svg1/${d}.svg`]);function c(d){return{}.VITE_SVG_TYPE==="base64"?E5(d):C5(d)}l.map(d=>{c(this.imgPath[`${o.prefix}d3svg1/${d}.svg`]).then(u=>{o.iconFiles[d]=u;const f=XQ(u).width;this.iconSize[d]=this.nodeWidth?this.nodeWidth:f,a++,a===l.length&&(o.iconAllLoaded=!0,e())}).catch(u=>{console.log(u,"e"),t()})})})},toggleZoom(e){},handleNodeContextMenu(e,t){var n,r;e.evt[this.actKey]||(clearTimeout(this.popoverTimer),this.showPopover=!1,this.contextMenuId++,this.contextMenuNode=t,this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.showContextMenu=!0,e.currentTarget.type==="aggregation"?this.menuOptions=oEe:this.menuOptions=(n=this.$parent.moduleDetail)!=null&&n.plugs[t.type]?Array.from((r=this.$parent.moduleDetail)==null?void 0:r.plugs[t.type]):[])},handleDeselectNode(e,t){be(this,"handle-select-node",{isSelected:!1,_node:s.toRaw(t)}),this.selection.length&&(this.selection=[],this.updateSelection()),this.setHighlightRule({}),this.hideContextMenu()},setHighlightRule({prop:e,type:t,value:n}){this.highlightRule={prop:e,type:t,value:n},this.updateNodeStyle(),t||bC(".legend-filter .out-box").classed("active",!1)},updateSelection(){const e=this.selection.map(t=>t.id);this.nodes.forEach(t=>{var n,r;e.includes(t.id)?(n=this.nodesGroup[t.id])==null||n.addName("isSelected"):(r=this.nodesGroup[t.id])==null||r.removeName("isSelected")}),be(this,"updateSelection")},toggleLayout(e){this.history.layoutIndex=e,this.nodes.map(t=>{t.fx=t.fy=null}),this.updateSimulation(),this.ticked(),setTimeout(()=>{this.centerAndZoom()},200)},handleNodeClick(e,t){en({cId:"handleNodeClick",c:"点击节点"}),this.canAct&&(t.type==="org"?window.open("http://bs.safe.360.net/starmap","__blank"):t.type==="nodeType"&&t.id.indexOf("org")>=0&&window.open("http://bs.safe.360.net/orglist?snapshot=true","__blank1")),this.hideContextMenu();const n=this.selection.some(o=>o.id===t.id);if(e.evt.shiftKey){if(t.type==="nodeType"||this.selection.some(o=>o.type==="nodeType"))return;n?this.selection=this.selection.filter(o=>o.id!==t.id):this.selection=[...this.selection,t]}else n?this.selection=[]:this.selection=[t];const r=this.selection.some(o=>o.id===t.id);be(this,"handle-select-node",{isSelected:r,_node:t}),this.updateSelection(),this.setHighlightRule(this.highlightRule)},handleNodeMouseEnter(e,t){if(!this.showContextMenu&&!e.evt[this.actKey]){const n=e.target.width(),r=e.target.height(),o=e.target,a=o.getAbsolutePosition(),c=o.getStage().container().getBoundingClientRect(),d=a.x-n/2+c.left,u=a.y-r/2+c.top,f=d,p=u,h=f,m=f+n,b=p,w=p+r;this.hoverNodePosition={top:b,right:m,bottom:w,left:h,width:n,height:r},this.popoverType="node",this.popoverContent={[t.type]:t.id},this.popoverNode=t,this.popoverTimer&&clearTimeout(this.popoverTimer),this.popoverTimer=setTimeout(()=>{this.showPopover=!0},200)}},handleNodeMouseLeave(e,t){this.showContextMenu||(clearTimeout(this.popoverTimer),this.showPopover=!1)},handleNodeMouseUp(e,t){var n;e.evt[this.actKey]&&this.mousedownNode&&(this.dragLine&&((n=this.dragLine)==null||n.destroy()),this.mouseupNode=t,this.mouseupNode.id===this.mousedownNode.id||this.mouseupNode.type==="aggregation"||this.mousedownNode.type==="aggregation"||this.$parent.addLink(this.mousedownNode,this.mouseupNode)),this.resetMouseVars()},handleNodeMouseDown(e,t){if(e.evt[this.actKey]){this.mousedownNode=t,this.nodesGroup[t.id].draggable(!1);const n=this.stage.scaleX(),r=this.stage.getPointerPosition(),o=(r.x-this.stage.x())/n,a=(r.y-this.stage.y())/n;this.mousedownPos={x:o,y:a},this.dragLine=new tt.Line({points:[o,a,o,a],stroke:"black",strokeWidth:1,dash:[5,5],opacity:.7,visible:!0}),this.layer.add(this.dragLine),this.stage.draw()}},treeLayout(){this.nodes.map(e=>{e.fx=e.pos,e.fy=e.levelNum*this.levelHeight}),this.forceLayout()},resetLayout(){this.simulation.stop(),this.nodes.map(e=>{delete e.vx,delete e.vy,delete e.x,delete e.y,delete e.fx,delete e.fy}),this.updateSimulation()},selectSingleEdgeNode(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)});for(let n=t.length-1;n>=0;n--){let r=0,o=0;const a=t[n];this.links.map(l=>{l.source.id===a&&r++,l.target.id===a&&o++}),r>=1&&t.splice(n,1),o>=2&&t.splice(n,1)}return t},selectChildren(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)}),this.handleTableSelect(t)},selectParents(e){const t=[];this.links.map(n=>{n.target.id===e.id&&t.push(n.source.id)}),this.handleTableSelect(t)},handleGlobalContextMenu(e){this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.menuOptions=[],this.showContextMenu=!0,this.showPopover=!1,this.contextMenuNode={},e.evt.preventDefault()},hideContextMenu(){this.showContextMenu=!1,this.contextMenuNode={}},centerAndZoom(e=.7,t=!1){var f,p,h;if(this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()},!this.grab)return;const n=this.stage.width(),r=this.stage.height(),o=this.grab.getClientRect(),a=o.width/this.scale,l=o.height/this.scale;if(a===0||l===0)return;let c=e/Math.max(a/n,l/r);if(c=t?c:Math.min(c,ni)||ni,!t&&c>ni)return;this.scale=c;const d=this.stage.width()/(2*c),u=this.stage.height()/(2*c);if((f=this.simulation)!=null&&f.force&&((p=this.simulation)==null||p.force("center",CS(d,u))),this.ticked(),this.stage.setAttrs({scaleX:c,scaleY:c,x:0,y:0}),this.layer.batchDraw(),this.history.layoutIndex===1){const m=this.grab.getClientRect(),b=(n-m.width)/2-m.x,w=(r-m.height)/2-m.y;this.stage.setAttrs({x:b,y:w}),this.layer.batchDraw(),(h=this.simulation)==null||h.stop()}},reset(){this.stage.setAttrs(this.originTransform)},handleContextMenuClick({nodes:e,api:t,dataApi:n}){if(this.requestGraphData){let r,o;const a={show_label:"label",all_show_label:"label",all_show_names:"name",show_names:"name"};switch(t&&t.name){case"edit_label":this.editLabel(e);break;case"single_edge_select":r=this.selectSingleEdgeNode(e[0]),this.selection=this.nodes.filter(l=>r.includes(l.id));break;case"hold_aggregation":o=this.selectSingleEdgeNode(e[0]),this.$parent.aggregationNodes(o,e[0]);break;case"release_aggregation":this.$parent.releaseAggregation(e[0]);break;case"show_label":case"show_names":e.map(l=>{this.showLabel(l,a[t.name])});break;case"all_show_label":case"all_show_names":this.nodes.map(l=>{this.showLabel(l,a[t.name])});break;case"un_show_names":case"un_show_label":e.map(l=>{this.hideLabel(l)});break;case"all_un_show_names":case"all_un_show_label":this.nodes.map(l=>{this.hideLabel(l)});break;case"copy":this.copyNodeText(e);break;case"node_star":e.map(l=>{this.starNode(l)});break;case"un_node_star":e.map(l=>{this.starNode(l,!1)});break;case"fix_nodes":e.map(l=>{this.toggleMove(l,!0)});break;case"un_fix_nodes":e.map(l=>{this.toggleMove(l,!1)}),this.updateSimulation();break;case"all_fix_nodes":this.fixAllNodes(!0);break;case"all_un_fix_nodes":this.fixAllNodes(!1);break;case"expand_node":e.map(l=>{this.$parent.expandNodes(l)});break;case"expand_part_node":e.map(l=>{this.$parent.expandNodes(l,n)});break;case"go_result":this.handleGoDetail(e);break;case"delete_node":this.$parent.deleteNodes(e);break;case"select_children":this.selectChildren(e[0]);break;case"select_parents":this.selectParents(e[0]);break;case"undo":this.$parent.historyBack();break;case"redo":this.$parent.historyForward();break;case"add_con_node":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"add_link":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"show_node":this.toggleShowNode(e[0],e[1],!0);break;case"hide_node":this.toggleShowNode(e[0],e[1],!1);break;default:be(this,"custom-contextmenu-click",{eventName:t.name,customConfig:t.customConfig,nodes:e,allNodes:s.toRaw(this.history.dataNow.nodes)})}this.hideContextMenu(),setTimeout(()=>{this.updateSelection()},400)}else Lt({message:"无可操作权限",type:"warning"})},expandNodes(e,t){en({cId:"dblclick",c:"双击节点"}),this.requestGraphData?this.$parent.expandNodes(t):Lt({message:"无可操作权限",type:"warning"})},toggleShowNode(e,t,n=!0){this.history.toggleShowNode(e,null,n),this.selection.filter(o=>o.show).length>0||this.handleTableSelect([]),setTimeout(this.updateNodeStyle,100)},copyNodeText(e){let t="";e.filter(n=>n.type!=="aggregation"&&n.type!=="nodeType").map(n=>{t=t+n.id+`
144
+ `).slice(1));try{for(o.s();!(n=o.n()).done;){var a=LSe(n.value);a&&r.push(a)}}catch(l){o.e(l)}finally{o.f()}return r.slice(0,10)}var Bl=function(e){return PSe(e).toString()},R_=function(e){return e instanceof ErrorEvent?e.message==="Script error."?Ag:Tg:Xd},BSe=function(){function e(t){Yf(this,e),Ai(this,"errorIdSet",new Set),this.webCoreIns=t,this.errorIdSet=new Set}return Jf(e,[{key:"init",value:function(){var t;if(this.initJsError(),this.initResourceError(),this.initPromiseError(),this.initCorsError(),(t=window.__QAPM__)!==null&&t!==void 0&&(t=t.q)!==null&&t!==void 0&&t.length){var n={error:this.onJSError.bind(this),reject:this.onPromiseError.bind(this)};window.__QAPM__.q.forEach(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=r.type,a=r.event,l=n[o];l&&l(a)}),window.__QAPM__.q=[]}}},{key:"initJsError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onJSError(n)},!0)}},{key:"initResourceError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onResourceError(n)},!0)}},{key:"initPromiseError",value:function(){var t=this;window.addEventListener("unhandledrejection",function(n){return t.onPromiseError(n)},!0)}},{key:"initCorsError",value:function(){var t=this;window.addEventListener("error",function(n){return function(r){if(R_(r)===Ag){var o={errorType:Ag,errorMessage:r.message,errorSummary:"CorsError",errorId:Bl("".concat(Ag,"-").concat(r.message))};t.commit(o)}}(n)},!0)}},{key:"onResourceError",value:function(t){if(R_(t)===Xd){var n=t.target||t.srcElement,r=n.src||n.href,o=JSON.stringify(Xd+": "+r||"UnKnown Resource"),a={errorType:Xd,errorMessage:o,errorSummary:"ResourceError",errorId:Bl("".concat(Xd,"-").concat(o))};this.commit(a)}}},{key:"onJSError",value:function(t){var n,r;if(R_(t)===Tg){var o=JSON.stringify(t.message),a=function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unknown";if(!c)return d;try{var u=new URL(c);return u.pathname&&u.pathname.endsWith(".js")?c:d}catch(f){return c}}(t.filename,(n=this.webCoreIns.config)===null||n===void 0?void 0:n.appKey),l={errorType:Tg,errorMessage:o,errorSummary:t.error&&((r=t.error)===null||r===void 0?void 0:r.name)||"UnKnown",errorStack:JSON.stringify(Og(t.error)),errorId:Bl("".concat(Tg,"-").concat(o,"-").concat(a))};this.commit(l)}}},{key:"onPromiseError",value:function(t){var n,r,o=JSON.stringify(((n=t.reason)===null||n===void 0?void 0:n.message)||t.reason||"UnKnown"),a=((r=t.reason)===null||r===void 0?void 0:r.name)||"UnKnown",l={errorType:yR,errorMessage:o,errorSummary:a,errorStack:JSON.stringify(Og(t.reason)),errorId:Bl("".concat(yR,"-").concat(o,"-").concat(a))};this.commit(l)}},{key:"onVueError",value:function(t,n,r){var o=JSON.stringify(t.message),a={errorType:bR,errorMessage:o,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Og(t)),errorId:Bl("".concat(bR,"-").concat(o,"-").concat(t.name))};this.commit(a)}},{key:"onReactError",value:function(t,n){var r=JSON.stringify(t.message),o={errorType:wR,errorMessage:r,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Og(t)),errorId:Bl("".concat(wR,"-").concat(r,"-").concat(t.name))};console.log(o),this.commit(o)}},{key:"commit",value:function(t){var n=t.errorId;this.errorIdSet.has(n)||(this.errorIdSet.add(n),this.webCoreIns.commit(qc({type:"error"},t)))}}]),e}(),DSe=function(e){function t(){var o,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Yf(this,t),(o=Sse(this,t,[a])).config=a,o.isReport()?(o.PerformancePluginInstance=new n4e(Gc(o)),o.WhiteScreenPluginInstance=new ECe(Gc(o)),o.ErrorPluginInstance=new BSe(Gc(o)),o.plugins=[o.PerformancePluginInstance,o.WhiteScreenPluginInstance,o.ErrorPluginInstance],o.init(),jS(t,t,Dl,Gc(o)),o):$S(o)}var n,r;return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(a&&a.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),a&&Jv(o,a)}(t,Cwe),Jf(t,[{key:"isReport",value:function(){var o=this.isIE(),a=this.calcRatio();return this.config.appKey&&a&&!o}},{key:"init",value:(r=Hc(Cr().mark(function o(){return Cr().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:this.initTime(this.mixed()),this.plugins.forEach(function(l){l.init()});case 2:case"end":return a.stop()}},o,this)})),function(){return r.apply(this,arguments)})},{key:"mixed",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=this.uid(),l=this.getTime(),c=l.time,d=l.date,u=this.getUA(),f=window.location,p=f.host,h=f.origin,m=f.pathname;return qc(qc({uid:a,sid:this.sid,url:window.location.href,host:p,fullPath:h+m,sdkVersion:this.sdkVersion,createDate:d,appKey:this.config.appKey,createTime:c,appVersion:this.appVersion,env:this.env},u),o)}},{key:"commit",value:(n=Hc(Cr().mark(function o(a){var l,c;return Cr().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:l=this.mixed(a),c=new URL("".concat(window.location.protocol,"//").concat(this.host,"/log.gif")),Object.entries(l).map(function(u){var f=Ese(u,2),p=f[0],h=f[1];c.searchParams.set(p,h)}),new Image().src=c.toString();case 5:case"end":return d.stop()}},o,this)})),function(o){return n.apply(this,arguments)})}],[{key:"install",value:function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Qf(t,t,Dl)||(o.config.errorHandler=function(l,c,d){Qf(t,t,Dl).ErrorPluginInstance.onVueError(l,c,d),console.error(l)},jS(t,t,Dl,new t(a)))}},{key:"sendError",value:function(o){Qf(t,t,Dl)?Qf(t,t,Dl).ErrorPluginInstance.onReactError(o):console.error("QAPM: 请先初始化 QAPM!")}}]),t}(),Dl={writable:!0,value:null};const NNe="",TNe="",MSe={components:{InfoFilled:Pm,ArrowRight:Im},mixins:[jr],inject:["hasLevel"],props:{axis:{required:!0,type:Object,default:()=>({x:0,y:0})},show:{required:!0,type:Boolean,default:!1},nodeInfo:{required:!0,type:Array,default:()=>[]},menuOptions:{required:!0,type:Array,default:()=>[]},border:{type:Boolean,required:!1,default:!0},itemWidth:{type:Number,required:!1,default:206},itemHeight:{type:Number,required:!1,default:36},itemSize:{type:Number,required:!1,default:14},offset:{type:Object,required:!1,default:()=>({x:6,y:2})},borderWidth:{type:Number,required:!1,default:6},history:{type:Object,required:!0,default:()=>{}},moduleDetail:{type:Object,required:!0,default:()=>{}}},emits:["contextmenu-click"],data(){return{checkedItems:{},globalMenus:JZ,maxMulti:6}},computed:{checkboxMenu(){return this.nodeInfo.length>1?[]:this.menuOptions},canGoDetail(){var e,t,n,r;return((t=(e=this.moduleDetail)==null?void 0:e.config)==null?void 0:t.jumpDetail)&&((r=this.moduleDetail)==null?void 0:r.config.jumpRule[(n=this.nodeInfo[0])==null?void 0:n.type])},systemMenu(){var r,o,a,l,c,d,u;const e=[];if(this.nodeInfo.length===1){const f=this.nodeInfo[0];f.type!=="aggregation"&&f.type!=="nodeType"&&(e.push(iv),(r=this.history.keyNodeIds)!=null&&r.some(_=>_===f.id)||(e.push(av),(a=(o=this.moduleDetail)==null?void 0:o.config)!=null&&a.hideCollectMenu||e.push(f.collect?sv:ov),e.push(f.textProp==="name"?tv:ev),f.label&&e.push(f.textProp==="label"?nv:rv)),this.canGoDetail&&e.push(Y5)),e.push(f.fx?V0:Z0);const p=this.history.dataNow.links.some(w=>w.source.id===f.id&&w.target.type==="aggregation"),b=this.history.dataNow.links.filter(w=>w.source.id===f.id).map(w=>w.target).some(w=>{let _=0;return this.history.dataNow.links.map(C=>{C.source.id===w.id&&_++}),_===0});p||f.type==="aggregation"?e.push(G5):b&&e.push(H5),b&&e.push(q5),e.push(lv)}else this.nodeInfo.length>1?(e.push(av,iv),e.push(this.nodeInfo.some(p=>!p.collect)?ov:sv),this.nodeInfo.some(p=>p.label)&&e.push(this.nodeInfo.some(p=>p.textProp!=="label")?rv:nv),e.push(this.nodeInfo.some(p=>p.textProp!=="name")?ev:tv),e.push(this.nodeInfo.some(p=>!p.fx)?Z0:V0),e.push(lv)):this.nodeInfo.length===0&&(this.history.dataNow.nodes.some(p=>p.label)&&e.push(this.history.dataNow.nodes.some(p=>p.textProp!=="label")?z5:$5),e.push(this.history.dataNow.nodes.some(p=>p.textProp!=="name")?M5:F5),e.push(this.history.dataNow.nodes.some(p=>!p.fx)?B5:D5),this.history.currentIndex>0&&e.push(U5),this.history.currentIndex<this.history.length-1&&e.push(j5));const t=(l=this.nodeInfo[0])==null?void 0:l.type,n=(u=(d=(c=this.nodeInfo[0])==null?void 0:c.detail)==null?void 0:d.info)==null?void 0:u.extraNodeContextMenus;return t!=="nodeType"&&(n!=null&&n.length)&&(n.forEach(f=>{f.icon||(f.icon="button_edit_label")}),e.push(...n)),e},totalHeight(){let e=this.menuOptions.length*(this.itemHeight+5)+10+44+48+5,t=this.systemMenu.length*(this.itemHeight+5)+10+44+5;return e=this.menuOptions.length===0?0:44,t=this.systemMenu.length===0?0:44,e+t},axisComputed(){const e=document.getElementsByClassName("d3-container")[0],t=this.axis.top-e.offsetTop;return{top:(t<e.offsetHeight/2?Math.min(t+this.offset.y,Math.max(e.offsetHeight-this.totalHeight,e.getBoundingClientRect().top)):Math.max(t+this.offset.y,this.totalHeight+e.getBoundingClientRect().top))+"px",left:this.axis.left+this.offset.x+"px",transform:`translate(${this.axis.left>e.offsetWidth/2?"-100%":"0%"}, ${t>e.offsetHeight/2?"-100%":"0%"})`}},liStyle(){return{width:this.itemWidth+"px",height:this.itemHeight+"px",lineHeight:this.itemHeight+"px",fontSize:this.itemSize+"px"}},firstLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*2>=e},secondLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*3>=e},checkedItemsFinal(){return Object.keys(this.checkedItems).filter(e=>this.checkedItems[e]).map(e=>this.checkedItems[e])},haveInterface(){let e=!1;return this.menuOptions.map(t=>{t.type===1&&(e=!0)}),e}},watch:{show(){this.checkedItems={}}},methods:{handleCollapse(){},isSystemItem(e){return e.type===2},isExternalItem(e){return e.type===3},hasChildren(e){var t;return((t=e==null?void 0:e.children)==null?void 0:t.length)>0},onCheck(e,t){this.checkedItems[t.name]=e.currentTarget.checked?t:!1},secondBorderCheck(e,t=0){const n=document.body.offsetWidth,r=document.body.offsetHeight,o=this.axis.top+(e+t)*this.itemHeight;return{width:this.itemWidth*2+60+"px",left:this.axis.left+this.itemWidth*2>=n?"-100%":"100%",top:r>=o?0:"auto",bottom:r<o?0:"auto"}},thirdBorderCheck(e,t,n,r){const o=document.body.offsetWidth,a=document.body.offsetHeight,l=this.secondBorderCheck(e,n).top;let c;const d=(t+r)*this.itemHeight,u=d>180?180:d;return l===0?c=this.axis.top+e*this.itemHeight+u:c=this.axis.top-e*this.itemHeight+u,{left:this.axis.left+this.itemWidth*3>=o?"-100%":"100%",bottom:a>=c?0:"auto",top:a<c?0:"auto"}},handleClick(e,t){if(!t){if(en({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),e.has_child>0)return!1;be(this,"contextmenu-click",{nodes:this.nodeInfo,api:e})}},handleDataClick(e,t){en({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),be(this,"contextmenu-click",{nodes:this.nodeInfo,api:t,dataApi:e}),this.checkedItems={}}}},Ml=e=>(s.pushScopeId("data-v-dd8dd8d0"),e=e(),s.popScopeId(),e),FSe={"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden",display:"none"}},$Se=[Ml(()=>s.createElementVNode("symbol",{id:"icon-arrow-right",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{d:"M288.791335 65.582671l446.41733 446.417329-446.41733 446.417329z"})],-1))],zSe={class:"cm-list"},USe={class:"cm-ul"},jSe={class:"hd"},qSe=["src"],HSe={class:"bd"},GSe={class:"cm-ul cm-ul-level1"},WSe=["title"],KSe=Ml(()=>s.createElementVNode("svg",{class:"icon","aria-hidden":"true"},[s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"})],-1)),YSe=["title","onClick"],JSe=["title","onClick"],XSe={key:0,class:"icon","aria-hidden":"true"},QSe=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],ZSe=["title","onClick"],VSe=["src"],e9e=Ml(()=>s.createElementVNode("div",{class:"bd"},null,-1)),t9e=["title","onClick"],n9e={key:0,class:"fas el-icon-fa-cog"},r9e={key:1,class:"fas el-icon-fa-external-link-alt"},i9e={class:"text-wrapper"},o9e=["src"],s9e=["src"],a9e={key:3,class:"shortcut"},l9e={key:2,class:"icon","aria-hidden":"true"},c9e=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],d9e=["title","onClick"],u9e={key:1,class:"icon","aria-hidden":"true"},f9e=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],h9e=["title","onClick"];function p9e(e,t,n,r,o,a){const l=s.resolveComponent("ArrowRight"),c=Qe,d=s.resolveComponent("InfoFilled"),u=Gn;return n.show?(s.openBlock(),s.createElementBlock("div",{key:0,class:"cm-container",style:s.normalizeStyle(a.axisComputed),onClick:t[1]||(t[1]=s.withModifiers((...f)=>a.handleCollapse&&a.handleCollapse(...f),["stop"]))},[(s.openBlock(),s.createElementBlock("svg",FSe,$Se)),s.createElementVNode("div",zSe,[s.createElementVNode("ul",USe,[a.checkboxMenu.length>0?(s.openBlock(),s.createElementBlock("li",{key:0,class:"cm-li data-opt-wrapper",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",jSe,[s.createElementVNode("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,qSe),s.createTextVNode("按关系分类拓线"),s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),s.createElementVNode("div",HSe,[s.createElementVNode("ul",GSe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.checkboxMenu,(f,p)=>(s.openBlock(),s.createElementBlock("li",{key:p,class:"cm-li context-one",style:s.normalizeStyle(a.liStyle)},[a.hasChildren(f)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["cm-item",a.firstLeft?"cm-left":""]),title:f.namec},[s.createElementVNode("span",null,s.toDisplayString(f.namec),1),KSe],10,WSe)):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["cm-item",a.firstLeft?"cm-left":""]),title:f.namec,onClick:s.withModifiers(h=>a.handleDataClick(f,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(f.namec),1)],10,YSe)),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("ul",{key:2,class:"cm-ul cm-ul-level2",style:s.normalizeStyle(a.secondBorderCheck(p,f.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.children,(h,m)=>(s.openBlock(),s.createElementBlock("li",{key:m,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",a.secondLeft?"cm-left":""]),title:h.namec,onClick:s.withModifiers(b=>a.handleDataClick(h,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(h.namec),1),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("svg",XSe,QSe)):s.createCommentVNode("",!0)],10,JSe),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level3",style:s.normalizeStyle(a.thirdBorderCheck(p,m,f.children.length,h.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.children,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:w,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:"cm-item",title:b.namec,onClick:s.withModifiers(_=>a.handleDataClick(b,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(b.namec),1)],8,ZSe)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))])])],4)):n.nodeInfo.length>1&&n.nodeInfo.length<o.maxMulti?(s.openBlock(),s.createElementBlock("li",{key:1,class:"cm-li data-opt-wrapper data-opt-all",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:"hd",onClick:t[0]||(t[0]=s.withModifiers(f=>a.handleDataClick(null,o.globalMenus.expandNode),["stop"]))},[s.createElementVNode("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,VSe),s.createTextVNode("展开全部关系 ")]),e9e],4)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.systemMenu,(f,p)=>(s.openBlock(),s.createElementBlock("li",{key:p,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{"cm-left":a.firstLeft,disabled:f.disabled}]),title:f.namec,onClick:s.withModifiers(h=>a.handleClick(f,f.disabled),["stop"])},[a.isSystemItem(f)?(s.openBlock(),s.createElementBlock("i",n9e)):a.isExternalItem(f)?(s.openBlock(),s.createElementBlock("i",r9e)):s.createCommentVNode("",!0),s.createElementVNode("div",i9e,[f.icon?(s.openBlock(),s.createElementBlock("img",{key:0,src:e.imgPath["./public/d3svg1/button18/"+f.icon+".svg"],class:"t-icon"},null,8,o9e)):(s.openBlock(),s.createElementBlock("img",{key:1,src:e.imgPath["./public/d3svg1/button18/button_"+f.name+".svg"],class:"t-icon"},null,8,s9e)),f.tooltip?(s.openBlock(),s.createBlock(u,{key:2,class:"el-icon-info",effect:"dark",content:f.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(f.namec),1),f.shortcut?(s.openBlock(),s.createElementBlock("span",a9e,s.toDisplayString(f.shortcut),1)):s.createCommentVNode("",!0)]),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("svg",l9e,c9e)):s.createCommentVNode("",!0)],10,t9e),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level2",style:s.normalizeStyle(a.secondBorderCheck(p,f.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.children,(h,m)=>(s.openBlock(),s.createElementBlock("li",{key:m,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{"cm-left":a.secondLeft,disabled:f.disabled||h.disabled}]),title:h.namec,onClick:s.withModifiers(b=>a.handleClick(h,f.disabled||h.disabled),["stop"])},[h.tooltip?(s.openBlock(),s.createBlock(u,{key:0,class:"el-icon-info",effect:"dark",content:h.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(h.namec),1),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("svg",u9e,f9e)):s.createCommentVNode("",!0)],10,d9e),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level3",style:s.normalizeStyle(a.thirdBorderCheck(p,m,f.children.length,h.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.children,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:w,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{disabled:f.disabled||h.disabled||b.disabled}]),title:b.namec,onClick:s.withModifiers(_=>a.handleClick(b,f.disabled||h.disabled||b.disabled),["stop"])},[b.tooltip?(s.openBlock(),s.createBlock(u,{key:0,class:"el-icon-info",effect:"dark",content:b.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(b.namec),1)],10,h9e)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))])])],4)):s.createCommentVNode("",!0)}const g9e=Bt(MSe,[["render",p9e],["__scopeId","data-v-dd8dd8d0"]]),PNe="",LNe="",BNe="",DNe="",m9e={name:"Popover",components:{ForceGraphSvgIcon:ls},mixins:[jr],inject:["levelList","hasLevel"],props:{showPopover:{type:Boolean,default:!1},mousePosition:{type:Object,default:()=>({left:0,top:0})},nodeInfo:{type:Object,default:()=>{}},type:{type:String,default:"node"},moduleDetail:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},darkMode:{type:Boolean,default:!0},history:{type:Object,default:()=>({})},customTooltip:{type:Function}},data(){return{isFunction:du,showSelf:!1,onPop:!1,position:null,aggregationList:[]}},computed:{show(){return this.showPopover||this.showSelf},name(){var e,t,n;return((n=(t=(e=this.nodeInfo)==null?void 0:e.detail)==null?void 0:t.info)==null?void 0:n.name)||this.nodeInfo.name},isNormalNode(){return this.nodeInfo.type!=="nodeType"&&this.nodeInfo.type!=="aggregation"},isNodeTypeNode(){return this.nodeInfo.type==="nodeType"},isAggregateNode(){return this.nodeInfo.type==="aggregation"},fieldMapThisType(){var e;return this.moduleDetail.detail_field_map&&this.moduleDetail.detail_field_map[`${(e=this.nodeInfo)==null?void 0:e.type}_detail_info`]},canGoDetail(){return["nodeType","aggregation","family","org","report","vul","thumbprint_md5","email","cert_https"].indexOf(this.nodeInfo.type)<0}},watch:{mousePosition(){setTimeout(()=>{var c,d,u;const e=this.mousePosition.left>document.body.offsetWidth/2,t=this.mousePosition.top>document.body.offsetHeight/2,n=(c=document.getElementsByClassName("popover-container")[0])==null?void 0:c.offsetHeight,r=(d=document.getElementsByClassName("d3-container")[0])==null?void 0:d.offsetHeight,o=(u=document.getElementsByClassName("d3-container")[0])==null?void 0:u.getBoundingClientRect().top;let a;t?a=Math.max(this.mousePosition.top,n+o)+5:a=Math.min(this.mousePosition.top,Math.max(r-n,o))-5;const l={left:(e?this.mousePosition.left+2:this.mousePosition.right-2)+"px",top:a+"px",transform:`translate(${e?"-100%":"0%"}, ${t?"-100%":"0%"})`};this.position=l},100)},nodeInfo:{handler:function(){var t;const e=(((t=this.nodeInfo)==null?void 0:t.list)||[]).map(n=>{var o,a,l;const r=n.detail;return ue(ae({},n),{name:((o=r==null?void 0:r.info)==null?void 0:o.name)||n.name,level:((l=(a=r==null?void 0:r.info)==null?void 0:a.basic)==null?void 0:l.level)||""})});e==null||e.sort((n,r)=>{var l,c;const o=(l=this.levelList.find(d=>d.level===n.level))==null?void 0:l.dangerNumber;return((c=this.levelList.find(d=>d.level===r.level))==null?void 0:c.dangerNumber)-o}),this.aggregationList=e},immediate:!0}},methods:{handleMouseEnter(){this.showSelf=!0},handleMouseLeave(){this.showSelf=!1},isSomething(e){return j0(e)},getTypeZh(e){var n,r,o;let t=e;if(e==="nodeType")t="关系节点";else for(const a in(n=this.moduleDetail)==null?void 0:n.nodes)if(e===((r=this.moduleDetail)==null?void 0:r.nodes[a].name)){t=(o=this.moduleDetail)==null?void 0:o.nodes[a].namec;break}return t},getLevelClass(e){return sf(e,this.levelList)},getColorStyle(e){return cs(e,this.levelList,this.darkMode)},getNodeTypeChildNum(e){var o;const t=(o=this.data)==null?void 0:o.links,n=[],r=[];return t==null||t.map(a=>{a.source.id===e&&(n.push(a.target.id),a.target.detail&&UQ(a.target.detail.info.basic.level,this.levelList)&&r.push(a.target.id))}),{allChildNum:n.length,dangerChildNum:r.length}},canShowField(e){const t=this.hasFieldValue(e);return!(t===void 0||e.hide_hover||e.hide_empty&&!t)},hasFieldValue(e){const t=this.nodeInfo.detail&&this.nodeInfo.detail.info&&this.nodeInfo.detail.info.basic[e.prop];if(t===null)return;const n=Array.isArray(t);return n&&t.length>0||!n&&t!==""&&t!=="无"},getFieldValue(e){const t=this.nodeInfo.detail.info.basic[e.prop],n=Array.isArray(t),r=this.isSomething(t);let o="-";return r&&(n?o=t.length?t.join("|"):"-":o=t||"-"),o},formatTags(e){return df(uf(e))},addToGraph(e){const t={type:"addFromAggregation",addOne:{nodes:[e],links:[{source:this.nodeInfo.relationId,target:e.id}]}};if(this.aggregationList=this.aggregationList.filter(n=>n.id!==e.id),this.history.updateAggregationNode(this.aggregationList,this.nodeInfo.id),this.history.pushState(t),this.aggregationList.length)be(qe,"emitDataLoaded");else{const n=this.nodeInfo,r={deleteOne:{nodes:[n],links:[{source:n.relationId,target:n.id}]},type:"aggregation"};setTimeout(()=>{this.history.pushState(r),be(qe,"emitDataLoaded")},0)}}}},Fl=e=>(s.pushScopeId("data-v-eb4f1bf9"),e=e(),s.popScopeId(),e),v9e={key:0},y9e=["innerHTML"],b9e={key:1,class:"node-info-container"},w9e={class:"popover-block popover-header"},_9e={key:0,class:"popover-collect"},C9e={key:1,class:"row-item"},S9e={class:"label"},E9e={key:2,class:"row-item"},x9e=Fl(()=>s.createElementVNode("div",{class:"label"},"关系节点:",-1)),k9e={class:"value"},N9e={class:"node-type-info"},T9e={class:"name"},A9e={key:3,class:"row-item"},O9e=Fl(()=>s.createElementVNode("div",{class:"label"},"备注:",-1)),I9e={class:"value"},R9e={class:"popover-block popover-fields"},P9e={key:0,class:"node-detail top-border"},L9e={key:0,class:"row-item"},B9e=Fl(()=>s.createElementVNode("div",{class:"label"},"危险级别:",-1)),D9e=["title"],M9e={key:1,class:"row-item row-item-tag"},F9e=Fl(()=>s.createElementVNode("div",{class:"label"},"标签:",-1)),$9e={class:"value"},z9e={class:"graph-tags-box"},U9e=Fl(()=>s.createElementVNode("br",null,null,-1)),j9e={key:0,class:"row-item"},q9e={class:"label"},H9e=["title"],G9e={key:1,class:"node-statistics top-border"},W9e={class:"row-item node-num"},K9e=Fl(()=>s.createElementVNode("div",{class:"label"},"拓展节点统计:",-1)),Y9e={class:"value"},J9e={key:0},X9e={class:"danger"},Q9e={key:2,class:"node-aggregation"},Z9e={class:"aggregation-title"},V9e={class:"aggregation-box"},eEe={key:2,class:"node-info-container"},tEe={class:"popover-fields"},nEe={class:"top"};function rEe(e,t,n,r,o,a){const l=s.resolveComponent("force-graph-svg-icon"),c=Gn,d=xc,u=CX,f=is,p=_X;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["popover-container",a.show?"show-popover":"hide-popover"]),style:s.normalizeStyle(o.position),onMouseenter:t[0]||(t[0]=(...h)=>a.handleMouseEnter&&a.handleMouseEnter(...h)),onMouseleave:t[1]||(t[1]=(...h)=>a.handleMouseLeave&&a.handleMouseLeave(...h))},[s.createElementVNode("div",null,[n.customTooltip&&o.isFunction(n.customTooltip)?(s.openBlock(),s.createElementBlock("div",v9e,[s.createElementVNode("div",{innerHTML:n.customTooltip({nodeInfo:n.nodeInfo,data:n.data,moduleDetail:n.moduleDetail})},null,8,y9e)])):n.type==="node"?(s.openBlock(),s.createElementBlock("div",b9e,[s.createElementVNode("div",w9e,[n.nodeInfo.collect?(s.openBlock(),s.createElementBlock("div",_9e,[s.createVNode(c,{content:"已收藏","popper-class":"el-tooltip-gray",placement:"left"},{default:s.withCtx(()=>[s.createVNode(l,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/star.svg"]},null,8,["icon-class"])]),_:1})])):s.createCommentVNode("",!0),a.isNormalNode?(s.openBlock(),s.createElementBlock("div",C9e,[s.createElementVNode("div",S9e,s.toDisplayString(a.getTypeZh(n.nodeInfo.type))+":",1),s.createElementVNode("div",{class:s.normalizeClass(["value",{"star-next":n.nodeInfo.collect}])},s.toDisplayString(a.name),3)])):s.createCommentVNode("",!0),a.isNodeTypeNode?(s.openBlock(),s.createElementBlock("div",E9e,[x9e,s.createElementVNode("div",k9e,[s.createElementVNode("div",N9e,[s.createElementVNode("div",T9e,s.toDisplayString(n.nodeInfo.name),1)])])])):s.createCommentVNode("",!0),n.nodeInfo.label?(s.openBlock(),s.createElementBlock("div",A9e,[O9e,s.createElementVNode("div",I9e,s.toDisplayString(n.nodeInfo.label),1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",R9e,[a.isNormalNode&&n.nodeInfo.detail?(s.openBlock(),s.createElementBlock("div",P9e,[a.canGoDetail&&a.hasLevel?(s.openBlock(),s.createElementBlock("div",L9e,[B9e,s.createElementVNode("div",{class:s.normalizeClass(["value level",a.getLevelClass(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level)]),title:n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"},s.toDisplayString(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"),11,D9e)])):s.createCommentVNode("",!0),n.nodeInfo.detail&&n.nodeInfo.detail.tags&&n.nodeInfo.detail.tags.length>0?(s.openBlock(),s.createElementBlock("div",M9e,[F9e,s.createElementVNode("div",$9e,[s.createElementVNode("div",z9e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.formatTags(n.nodeInfo.detail.tags),(h,m)=>(s.openBlock(),s.createBlock(c,{key:m,"popper-class":"el-tooltip-gray"},{content:s.withCtx(()=>[s.createElementVNode("div",null,[s.createTextVNode(s.toDisplayString(h.name===h.desc?h.name:h.name+":"+h.desc)+" ",1),h.disabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[U9e,s.createTextVNode(" 标签状态:失效 ")],64)):s.createCommentVNode("",!0)])]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createVNode(d,{class:s.normalizeClass(["graph-tag-one",`${h.type||"unknown"} ${h.disabled?"tag-disable":""}`]),type:h.type||"info"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(h.name),1)]),_:2},1032,["class","type"])])]),_:2},1024))),128))])])])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.fieldMapThisType,(h,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[a.canShowField(h)?(s.openBlock(),s.createElementBlock("div",j9e,[s.createElementVNode("div",q9e,s.toDisplayString(h.zh)+":",1),s.createElementVNode("div",{class:s.normalizeClass(["value",{red:h.prop==="virus_name"}]),title:n.nodeInfo.detail.info.basic[m]},s.toDisplayString(a.getFieldValue(h)),11,H9e)])):s.createCommentVNode("",!0)],64))),256))])):s.createCommentVNode("",!0),a.isNodeTypeNode?(s.openBlock(),s.createElementBlock("div",G9e,[s.createElementVNode("div",W9e,[K9e,s.createElementVNode("div",Y9e,[a.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum>0?(s.openBlock(),s.createElementBlock("span",J9e,[s.createElementVNode("span",X9e,s.toDisplayString(a.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum),1),s.createTextVNode("/")])):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.getNodeTypeChildNum(n.nodeInfo.id).allChildNum),1)])])])):s.createCommentVNode("",!0),a.isAggregateNode?(s.openBlock(),s.createElementBlock("div",Q9e,[s.createElementVNode("div",Z9e,"聚合节点 ("+s.toDisplayString(o.aggregationList.length)+"个)",1),s.createElementVNode("div",V9e,[s.createVNode(p,{data:o.aggregationList,style:{width:"100%"}},{default:s.withCtx(()=>[s.createVNode(u,{prop:"name","min-width":"200",label:"名称"}),s.createVNode(u,{sortable:"",prop:"type",label:"类型"}),s.createVNode(u,{sortable:"",prop:"level",width:"80",label:"级别"},{default:s.withCtx(h=>[s.createElementVNode("span",{style:s.normalizeStyle({color:a.getColorStyle(h.row.level)})},s.toDisplayString(h.row.level||"--"),5)]),_:1}),s.createVNode(u,{label:"操作"},{default:s.withCtx(h=>[s.createVNode(f,{class:"add-to-graph-btn",type:"primary",text:"",size:"small",onClick:m=>a.addToGraph(h.row)},{default:s.withCtx(()=>[s.createTextVNode(" 添加到图谱 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])):s.createCommentVNode("",!0)])])):(s.openBlock(),s.createElementBlock("div",eEe,[s.createElementVNode("div",tEe,[s.createElementVNode("div",nEe,s.toDisplayString(n.nodeInfo.apiName),1)])]))])],38)}const iEe=Bt(m9e,[["render",rEe],["__scopeId","data-v-eb4f1bf9"]]),oEe=[{id:52,product_id:0,name:"copy",namec:"复制",parent_id:0,has_child:0,status:0,type:2,path:"0-52",pos:65,ctime:"0000-00-00 00:00:00",utime:"2019-06-04 16:49:38",children:[]},{id:62,product_id:0,name:"release_aggregation",namec:"释放聚合顶点",parent_id:0,has_child:0,status:0,is_sys:0,is_detail:0,type:2,path:"0-62",pos:1,ctime:"0000-00-00 00:00:00",utime:"2019-05-06 15:08:10",children:[]}],sEe={name:"vue-safe-force-graph",version:"2.0.53",description:"force_graph in security area",author:"jason zhang",module:"./lib/vue-safe-force-graph.js",main:"./lib/vue-safe-force-graph.umd.cjs",type:"module",files:["/lib/"],exports:{".":{import:"./lib/vue-safe-force-graph.js",require:"./lib/vue-safe-force-graph.umd.cjs"},"./*":"./*"},scripts:{dev:"vite","dev:base64":"vite --mode development_base64",lib:"vite build","lib:base64":"vite build --mode production_base64",patch:'npm version patch -m "Upgrade to %s "',"patch:base64":'npm version patch -m "Upgrade to %s for base64"',p:"npm run patch && npm run lib && npm publish","p:base64":"npm run patch:base64 && npm run lib:base64 && npm publish",lint:"eslint --ext .js,.vue src",lintFix:"eslint --fix --ext .js,.vue src",imageToCdn:"node qcdn.cjs",imageToBase64:"node qcdn.cjs --buildtype=base64",changelog:"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},dependencies:{"@element-plus/icons-vue":"^2.1.0","@q/qapm":"^1.1.5","csv-parse":"^5.0.4",d3:"^7.8.5","d3-lasso":"0.0.5","element-plus":"^2.3.0",json2csv:"^5.0.7",konva:"^9.2.0","lodash-es":"^4.17.21","mime-types":"^2.1.35",minimist:"^1.2.6","radar-js-analytic-sdk":"^2.2.6",vue:"^3.2.47","vue-clipboard3":"^2.0.0","vue-router":"^4.1.6","vue-virtual-scroller":"^2.0.0-beta.8"},devDependencies:{"@babel/core":"^7.23.3","@babel/preset-env":"^7.23.3","@originjs/vite-plugin-commonjs":"^1.0.3","@q/qcdn":"^3.2.2","@vitejs/plugin-vue":"^4.1.0",axios:"^0.21.1","babel-eslint":"^10.1.0",eslint:"^7.32.0","eslint-plugin-vue":"^8.0.3",imageinfo:"^1.0.4",qs:"^6.10.1","rollup-plugin-visualizer":"^5.9.0",sass:"^1.62.0","unplugin-auto-import":"^0.15.2","unplugin-vue-components":"^0.24.1",vite:"^4.3.1"},browserslist:["> 1%","last 2 versions"],engines:{node:">=8.9",npm:">= 3.0.0"},license:"MIT"},ZNe="",VNe="",eTe="",{toClipboard:aEe}=ff(),lEe="Arial,Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif",ni=1,cEe=["ip","intranet","internet"],P_=20,cr={},dEe={name:"ForceGraphRenderByCanvas",components:{Popover:iEe,NodeContextmenu:g9e},mixins:[jr],provide:function(){return{levelList:this.levelList}},props:{data:{type:Object,default:()=>({nodes:[],links:[]})},history:{type:Object,default:()=>({})},linkDistance:{type:Number,default:120},strength:{type:Number,default:-600},isThreatPath:{type:Boolean,default:!1},requestGraphData:{type:Boolean,default:!1},moduleDetail:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}},alphaDecay:{type:Number,default:.0228},alphaMin:{type:Number,default:.001},darkMode:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},nodeWidth:{type:Number},startNodeWidth:{type:Number},nodeTypeScale:{type:Number,default:1},nodeTypeList:{type:Array,default:()=>[]},manualTickNumber:{type:Number,default:500},startNodeAnimation:{type:Boolean,default:!0},customTooltip:{type:Function}},emits:["handle-select-node","custom-contextmenu-click","flagFiles","updateSelection"],data(){return{prefix:"./public/",iconAllLoaded:!1,iconSize:{},iconFiles:{},flagFiles:{},highlightRule:{},nodesRange:null,mousePosition:{left:0,top:0},hoverNodePosition:{},uniqueClass:"",showPopover:!1,popoverTimer:null,popoverType:"",popoverContent:{},popoverNode:{},showContextMenu:!1,contextMenuNode:{},menuOptions:[],isDragging:!1,originTransform:null,dragNodeFix:!1,destroyed:!1,actKey:va()?"metaKey":"ctrlKey",levelHeight:100,actNum:0,scriptNow:null,scriptInited:!1,canAct:!1,isKeyUp:!0,initTimes:0,resizeObserver:null,canvasElement:null,stage:s.shallowRef(null),layer:s.shallowRef(null),nodesGroup:s.shallowRef({}),linksGroup:s.shallowRef({}),grab:s.shallowRef(null),simulation:s.shallowRef(null),nodes:s.shallowRef(null),links:s.shallowRef(null),hoveredNode:s.shallowRef(null),mouseDownNode:s.shallowRef(null),selectionRect:null,selection:[],scale:ni,mousedownPos:null,mousedownNode:null,mouseupNode:null,dragLine:null,darkBgRect:null,inited:!1,hasSimulation:!1,nodesLength:0,ticking:!1,anim1:null,anim2:null,anim3:null}},computed:{isAutoTick(){var e;return((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber},iconSizeComputed(){const e=a$(this.iconSize);return this.nodeTypeList.forEach(t=>{e[t]=this.iconSize[t]*this.nodeTypeScale}),e},contextMenuNodes(){return this.contextMenuNode.id?this.selection.some(e=>e.id===this.contextMenuNode.id)?[...this.selection]:[this.contextMenuNode]:[]},showContextMenuFlag(){return this.requestGraphData?this.showContextMenu:!1}},watch:{data:{handler:function(){const e=this.nodesLength!==this.data.nodes.length;this.nodes=this.data.nodes,this.links=this.data.links,this.nodesLength=this.data.nodes.length,this.update(e)},deep:!0},moduleDetail:{handler:function(e){return Oe(this,null,function*(){e!=null&&e.nodes&&!this.iconAllLoaded&&(yield this.loadIcons(),this.initForceGraph(),setTimeout(()=>{this.update()},50))})},deep:!0,immediate:!0},darkMode:{handler:function(e){return Oe(this,null,function*(){const t=e?"dark":"light";setTimeout(()=>{this.update(),this.isThreatPath?document.querySelectorAll(`.${this.uniqueClass}.render-container`)[0].setAttribute("data-theme",t):(document.querySelectorAll(`.${this.uniqueClass}.render-container`)[0].setAttribute("data-theme",t),document.getElementsByClassName(this.uniqueClass+" render-container")[0].parentElement.parentElement.setAttribute("data-theme",t))},200)})},immediate:!0}},created(){On("graph created time",Date.now()),wi.setProject("QH_10542_1724").getTrack(),localStorage.getItem("showSafeForceGraphLog")&&On("组件版本: "+sEe.version),this.isThreatPath||this.initKeyEvent(),this.uniqueClass="unique"+new Date().getTime()+Math.floor(Math.random()*1e5)},mounted(){return Oe(this,null,function*(){new DSe({appKey:"fe-force-graph",ratio:50}),this.initForceGraph(),zQ(this.levelList),!this.isThreatPath&&(uo(qe,"buttonClick",e=>{On(e,"buttonClick msg"),this.handleContextMenuClick(e)}),uo(qe,"relationClick",e=>{this.handleContextMenuClick(e)}),uo(qe,"sendNodesRange",(e,t)=>{e!==void 0&&(this.nodesRange=e,this.updateNodeStyle())}))})},beforeUnmount(){fo(qe,"buttonClick"),fo(qe,"relationClick"),fo(qe,"sendNodesRange"),this.unbindKeyEvent(),this.resetAll(),On("destroy")},methods:{initForceGraph(){return Oe(this,null,function*(){if(this.inited)return;const e=this.$refs.canvasContainer;let t=e.clientWidth,n=e.clientHeight;this.resizeObserver=new ResizeObserver(o=>{for(const a of o){if(t=a.contentRect.width,n=a.contentRect.height,On(`新宽度: ${t}px, 新高度: ${n}px`),t===0||n===0)return;this.stage.width(t),this.stage.height(n),this.layer&&this.layer.batchDraw(),this.hasSimulation&&this.updateSimulation()}}),this.resizeObserver.observe(e),document.addEventListener("click",this.hideContextMenu,!1),this.nodes=this.data.nodes,this.links=this.data.links,this.stage=new tt.Stage({container:e,width:t,height:n,scaleX:ni,scaleY:ni}),this.layer=new tt.Layer,this.grab=new tt.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab);const r=this.layer.getCanvas()._canvas;this.canvasElement=r,this.stage.on("mousemove",o=>{if(!this.mousedownNode||!o.evt[this.actKey]){if(this.resetMouseVars(),this.selectionRect&&o.evt.altKey){const a=this.stage.getPointerPosition(),l=(a.x-this.stage.x())/this.scale,c=(a.y-this.stage.y())/this.scale,d=l-this.selectionRect.x(),u=c-this.selectionRect.y();this.selectionRect.width(d),this.selectionRect.height(u),this.stage.batchDraw()}}else{const a=this.stage.getPointerPosition(),l=this.stage.scaleX(),c=(a.x-this.stage.x())/l,d=(a.y-this.stage.y())/l;this.dragLine.points([this.mousedownPos.x,this.mousedownPos.y,c,d]),this.layer.batchDraw()}}),this.stage.on("wheel",o=>{o.evt.preventDefault();const a=1.1,l=this.scale,c=o.evt.deltaY<0?l*a:l/a;this.scale=c;const d=this.stage.getPointerPosition(),u=this.stage.position(),f=d.x-(d.x-u.x)*(c/l),p=d.y-(d.y-u.y)*(c/l);this.stage.setAttrs({scaleX:c,scaleY:c,x:f,y:p}),this.layer.batchDraw()}),this.stage.on("mousedown",o=>{const a=o.target;if(a&&a.nodeType==="Stage"?this.stage.setDraggable(!0):this.stage.setDraggable(!1),o.evt.altKey){this.stage.setDraggable(!1);const l=this.stage.scaleX(),c=this.stage.getPointerPosition(),d=(c.x-this.stage.x())/l,u=(c.y-this.stage.y())/l;this.selectionRect=new tt.Rect({x:d,y:u,width:0,height:0,stroke:"rgb(80, 80, 80)",strokeWidth:2}),this.layer.add(this.selectionRect),this.stage.batchDraw()}}),this.stage.on("mouseup",o=>{if(this.stage.setDraggable(!1),this.selectionRect&&o.evt.altKey){const a=this.selectionRect.x(),l=this.selectionRect.y(),c=this.selectionRect.width(),d=this.selectionRect.height();this.selection=this.nodes.filter(u=>{const f={x:u.x,y:u.y},p=Math.min(a,a+c),h=Math.max(a,a+c),m=Math.min(l,l+d),b=Math.max(l,l+d);return f.x>=p&&f.x<=h&&f.y>=m&&f.y<=b}),this.updateSelection(),this.selectionRect.destroy(),this.selectionRect=null}}),this.stage.on("contextmenu",this.handleGlobalContextMenu),this.stage.on("click",o=>{o.target&&o.target.nodeType==="Stage"&&this.handleDeselectNode(o)}),this.setSimulation(),this.stage.add(this.layer),this.stage.draw(),this.update(),this.inited=!0})},setSimulation(){var n;if(this.hasSimulation||!((n=this.nodes)!=null&&n.length))return;const e=this.stage.width()/(2*ni),t=this.stage.height()/(2*ni);this.hasSimulation=!0,this.simulation=bse(this.nodes).force("link",ise(this.links).id(r=>r.id).distance(this.linkDistance).strength(1)).force("charge",wse().strength(this.strength)).force("x",_se()).force("y",Cse()).force("center",CS(e,t)).alphaDecay(this.alphaDecay).alphaMin(this.alphaMin).stop(),this.nodeWidth&&this.simulation.force("collision",nse().radius(this.nodeWidth/2)),this.isAutoTick?(this.simulation.alpha(1).restart(),this.simulation.on("tick",this.ticked)):(this.simulation.on("tick",null),this.sendManualTick()),this.simulation.on("end",()=>{On("simulation end time",Date.now()),this.isThreatPath&&this.centerAndZoom(1)})},sendManualTick(){var e;On("sendManualTick",(e=this.nodes)==null?void 0:e.length),!this.ticking&&(this.ticking=!0,this.doClearCanvas(),this.simulation.alphaDecay(this.alphaDecay*2),this.simulation.alphaMin(this.alphaMin*5),this.simulation.alpha(1).restart(),setTimeout(()=>{console.time("tick");for(let t=0,n=Math.ceil(Math.log(this.simulation.alphaMin())/Math.log(1-this.simulation.alphaDecay()));t<n;++t)On("tick"),this.simulation.tick();console.timeEnd("tick"),this.ticking=!1,this.update(),this.centerAndZoom()},1e3))},update(e=!1){return Oe(this,null,function*(){var t,n,r;!this.iconAllLoaded&&((n=(t=this.moduleDetail)==null?void 0:t.nodes)!=null&&n.length)&&(yield this.loadIcons()),!this.destroyed&&(r=this.nodes)!=null&&r.length&&(this.initScript(),On("update"),e&&this.updateSimulation(),this.doClearCanvas(),this.paintLinks(),this.paintNodes(),this.updateSelection(),this.ticked(),this.actNum===9&&setTimeout(()=>{this.centerAndZoom(.8)},200))})},doClearCanvas(){this.nodesGroup={},this.linksGroup={},this.layer.destroyChildren(),this.grab=new tt.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab)},paintNodes(){const e=this.stage.width()/2,t=this.stage.height()/2,n=this.selection.map(r=>r.id);this.nodes.forEach(r=>Oe(this,null,function*(){var _,C,k,S,E,T,A,I,O,F,R,j,M,q,X,V,z,U,H,G,D,se,ne;const o=(C=(_=r.detail)==null?void 0:_.info)==null?void 0:C.icon_img;let a;r.type==="nodeType"?a=this.iconSizeComputed[r.icon]||this.iconSizeComputed.node_type:a=this.iconSize[r.icon]||this.iconSize[r.type]||24,r.startNode&&this.startNodeWidth&&(a=this.startNodeWidth);const l=((E=(S=(k=r==null?void 0:r.detail)==null?void 0:k.info)==null?void 0:S.basic)==null?void 0:E.level)||"",c=(I=(A=(T=r==null?void 0:r.detail)==null?void 0:T.info)==null?void 0:A.basic)==null?void 0:I.flag;let d;try{d=yield this.getNodeImage(r)}catch(K){console.log(K)}this.nodesGroup[r.id]&&((O=this.nodesGroup[r.id])==null||O.destroy());const u=new tt.Group({name:"nodeGroup",opacity:1,id:`${r.id}`,x:r.x?r.x:e,y:r.y?r.y:t,draggable:!0,visible:r.show});if(n.includes(r.id)&&u.addName("isSelected"),r.startNode&&this.startNodeAnimation){const K=cs(l,this.levelList,this.darkMode),Y=new tt.Circle({x:0,y:0,radius:20,fill:K,opacity:0}),re=new tt.Circle({x:0,y:0,radius:20,fill:K,opacity:0}),oe=new tt.Circle({x:0,y:0,radius:20,fill:K,opacity:0});u.add(Y),u.add(re),u.add(oe);const B=(W,ee)=>new tt.Animation(function(ce){const fe=ce.time;if(fe%ee/ee===0)return!1;const Ne=.5-.5*(fe%ee)/ee,_e=40*(fe%ee)/ee;W.radius(_e||0),W.opacity(Ne)},this.layer);(F=this.anim1)==null||F.stop(),(R=this.anim2)==null||R.stop(),(j=this.anim3)==null||j.stop(),this.anim1=B(Y,1500),this.anim2=B(re,1500),this.anim3=B(oe,1500),(M=this.anim1)==null||M.start(),setTimeout(()=>{this.anim2.start()},500),setTimeout(()=>{this.anim3.start()},1e3)}else if(r.startNode&&!this.startNodeAnimation){const K=cs(l,this.levelList,this.darkMode),Y=new tt.Circle({x:0,y:0,radius:20,fill:K,opacity:this.startNodeAnimation?0:.3});u.add(Y)}if(!o&&(r.type==="ip"||r.type==="internet"||r.type==="country"||r.type==="target_country")){const K=cs(l,this.levelList,this.darkMode),Y=new tt.Circle({x:0,y:0,fill:this.darkMode?"#182628":"#fff",radius:a/2,stroke:K,strokeWidth:2});u.add(Y)}if(d){const K=c||(X=(q=r==null?void 0:r.detail)==null?void 0:q.info)!=null&&X.inner_country?20:a,Y=d&&new tt.Image({x:0,y:0,offsetX:K/2,offsetY:K/2,image:d,width:K,height:K,draggable:!1});u.add(Y)}if(!o&&r.detail&&r.type==="md5"){const K=((U=(z=(V=r.detail.info)==null?void 0:V.basic)==null?void 0:z.file_type)==null?void 0:U.toUpperCase())||"MD5",Y=new tt.Text({name:"md5Text",x:0,y:0,text:K,fontSize:4,fontWeight:700,fontFamily:lEe,fill:this.darkMode?"#182628":"#fff",align:"center",listening:!1});Y.x(Y.x()-Y.width()/2),u.add(Y)}const f=r.textProp||"name",p=f==="name"?((G=(H=r==null?void 0:r.detail)==null?void 0:H.info)==null?void 0:G.name)||r.name:r[f];let h=p.length>14&&!cEe.includes(r.type)?p.slice(0,7)+"..."+p.slice(-7):p;h=JQ(h);const m=new tt.Text({offsetY:a/2,name:"konvaText",x:0,y:a+8,text:h,fontSize:12,fontFamily:"Calibri",fill:this.darkMode?"#cdd9da":"#000",align:"center",listening:!1,visible:!!r.textProp});m.x(m.x()-m.width()/2),u.add(m);const b=new tt.Circle({name:"border",x:0,y:0,radius:a/2,fill:"#5c6271",opacity:.4,visible:!1});if(u.add(b),(se=(D=r.detail)==null?void 0:D.tags)!=null&&se.length){const K=new tt.Circle({x:((a/2||14)+5)*Math.sin(60*Math.PI/180),y:-((a/2||14)+5)*Math.cos(60*Math.PI/180),radius:3,fill:"#9300ff",listening:!1});u.add(K)}if(r.type!=="nodeType"&&r.type!=="aggregation"){var w=new tt.Circle({name:"collect",x:((a/2||14)+5)*Math.sin(0*Math.PI/180),y:-((a/2||14)+5)*Math.cos(0*Math.PI/180),radius:3,fill:"#ffad00",visible:!!r.collect});u.add(w)}if(r.label){const K=new tt.Circle({x:((a/2||14)+5)*Math.sin(30*Math.PI/180),y:-((a/2||14)+5)*Math.cos(30*Math.PI/180),radius:3,fill:"#0099ff",listening:!1});u.add(K)}if(r.type==="nodeType"&&r.showTotal){const K=(a/2||14)+5,Y=70*Math.PI/180,re=K*Math.sin(Y),oe=-K*Math.cos(Y),B=new tt.Circle({x:re,y:oe,radius:10,fill:"#1890ff",stroke:"white",strokeWidth:2,listening:!1});u.add(B);const W=new tt.Text({x:re,y:oe,text:`${((ne=r==null?void 0:r.children)==null?void 0:ne.length)||0}`,fontSize:10,fontFamily:"Calibri",fill:"#fff",align:"center",verticalAlign:"middle",listening:!1});W.offsetX(W.width()/2),W.offsetY(W.height()/2),u.add(W)}u.on("dragstart",(K,Y)=>{K.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(.3).restart(),this.isDragging=!0)}),u.on("dragmove",K=>{if(!K.evt[this.actKey]){var Y=this.simulation.nodes().find(re=>re.id===r.id);Y&&(Y.x=u.x(),Y.fx=u.x(),Y.y=u.y(),Y.fy=u.y(),this.links.forEach(re=>{const oe=this.linksGroup[`${re.source.id}-${re.target.id}`],B=oe==null?void 0:oe.findOne(".konvaLine"),W=oe==null?void 0:oe.findOne(".linkArrow"),ee=oe==null?void 0:oe.findOne(".edgeLabel");let ce,fe,ye,Ne;if(re.source.id===Y.id){if(!this.nodesGroup[re.target.id])return;ce=Y.x,fe=this.nodesGroup[re.target.id].x(),ye=Y.y,Ne=this.nodesGroup[re.target.id].y(),B.points([ce,ye,fe,Ne]);const _e=q0(ce,ye,fe,Ne,P_);W==null||W.x(_e==null?void 0:_e.x),W==null||W.y(_e==null?void 0:_e.y),W==null||W.rotation(Math.atan2(Ne-ye,fe-ce)*(180/Math.PI))}else if(re.target.id===Y.id){if(!this.nodesGroup[re.source.id])return;ce=this.nodesGroup[re.source.id].x()||0,fe=Y.x||0,ye=this.nodesGroup[re.source.id].y()||0,Ne=Y.y||0,B.points([ce,ye,fe,Ne]);const _e=q0(ce,ye,fe,Ne,P_);W==null||W.x(_e==null?void 0:_e.x),W==null||W.y(_e==null?void 0:_e.y),W==null||W.rotation(Math.atan2(Ne-ye,fe-ce)*(180/Math.PI))}if(ee&&(re.source.id===Y.id||re.target.id===Y.id)){ee.x((ce+fe)/2),ee.y((ye+Ne)/2),ee.offsetX(ee.getWidth()/2||0),ee.offsetY(ee.getHeight()/2+8||0);const _e=Math.atan2(Ne-ye,fe-ce)*(180/Math.PI);fe<ce?ee.rotation(_e+180):ee.rotation(_e)}}),this.layer.batchDraw())}}),u.on("dragend",K=>{K.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(0),this.isDragging=!1)}),u.on("click",K=>{K.evt.detail===2?this.expandNodes(K,r):K.evt.detail===1&&K.evt.button===0&&this.handleNodeClick(K,r)}),u.on("contextmenu",K=>{K.cancelBubble=!0,K.evt.preventDefault(),K.evt.stopPropagation(),this.handleNodeContextMenu(K,r,u)}),u.on("mouseup",K=>this.handleNodeMouseUp(K,r)),u.on("mousedown",K=>this.handleNodeMouseDown(K,r)),u.on("mouseenter",K=>this.handleNodeMouseEnter(K,r)),u.on("mouseleave",K=>this.handleNodeMouseLeave(K,r)),this.grab.add(u),this.nodesGroup[r.id]=u})),this.stage.batchDraw()},paintLinks(){const e=this.stage.width()/2,t=this.stage.height()/2;this.links.forEach(n=>{this.linksGroup[`${n.source.id}-${n.target.id}`]&&this.linksGroup[`${n.source.id}-${n.target.id}`].destroy();const r=new tt.Group({opacity:1,id:`${n.source.id}-${n.target.id}`,visible:n.source.show&&n.target.show}),o=this.darkMode?"#445152":"#999",a=new tt.Arrow({name:"linkArrow",pointerLength:10,pointerWidth:10,x:e,y:t,fill:o});r.add(a);const l=n.source.x||0,c=n.source.y||0,d=n.target.x||0,u=n.target.y||0,f=new tt.Line({name:"konvaLine",id:`${n.source.id}-${n.target.id}`,points:[l,c,d,u],stroke:n.target.type==="org"?"#cf1322":o,strokeWidth:1,dash:n.diy===!0?[5,5]:null});if(n.edge_label){const p=new tt.Text({name:"edgeLabel",x:(l+d)/2,y:(c+u)/2,text:n.edge_label,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(p)}if(n.target.type==="nodeType"){const p=new tt.Text({name:"edgeLabel",x:(l+d)/2,y:(c+u)/2,text:n.target.name,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(p)}r.add(f),this.grab.add(r),r.moveToBottom(),this.linksGroup[`${n.source.id}-${n.target.id}`]=r}),this.stage.batchDraw()},updateSimulation(){var e,t;try{if(!this.simulation&&!this.hasSimulation){this.setSimulation();return}this.simulation.nodes(this.nodes),this.simulation.force("link").links(this.links),this.simulation.alpha(.4).restart(),this.history.layoutIndex===0?((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber?this.simulation.on("tick",this.ticked):(this.simulation.on("tick",null),this.sendManualTick()):this.simulation.on("tick",this.ticked)}catch(n){console.log(n,"simulation-e1"),(t=this.simulation)==null||t.stop()}},ticked(){switch(On("ticked"),this.history.layoutIndex){case 0:this.forceLayout();break;case 1:this.treeLayout();break;default:this.forceLayout();break}},forceLayout(){var t;if(!this.nodes.length||!this.links.length)return;let e=!0;for(let n=0;n<this.links.length;n++){const r=this.links[n],o=this.linksGroup[`${r.source.id}-${r.target.id}`],a=o==null?void 0:o.findOne(".konvaLine"),l=o==null?void 0:o.findOne(".linkArrow"),c=o==null?void 0:o.findOne(".edgeLabel");let d=r.source.x,u=r.source.y,f=r.target.x,p=r.target.y;const h=f-d||1,m=p-u||1,b=Math.sqrt(h*h+m*m),w=h/b||1,_=m/b||1,C=r.source.type==="nodeType"?(this.iconSizeComputed[r.source.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1,k=r.target.type==="nodeType"?(this.iconSizeComputed[r.target.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1;if(d=d+C*w,u=u+C*_,f=f-k*w,p=p-k*_,isNaN(d)||isNaN(u)||isNaN(f)||isNaN(p)){e=!1;break}if(a==null||a.points([d,u,f,p]),l){const S=q0(d,u,f,p,P_);l==null||l.x((S==null?void 0:S.x)||0),l==null||l.y((S==null?void 0:S.y)||0),l==null||l.rotation(Math.atan2(p-u,f-d)*(180/Math.PI))}if(c){c.x((d+f)/2),c.y((u+p)/2),c.offsetX(c.getWidth()/2||0),c.offsetY(c.getHeight()/2+8||0);const S=Math.atan2(p-u,f-d)*(180/Math.PI);f<d?c.rotation(S+180):c.rotation(S)}}if(!e){On("请点击自动布局按钮"),this.resetLayout();return}for(let n=0;n<this.nodes.length;n++){const r=this.nodes[n];(t=this.nodesGroup[r.id])==null||t.position({x:r.x||0,y:r.y||0})}},selectEdgesByNode(e){const t=e.map(n=>n.id);this.links.forEach(n=>{const r=this.linksGroup[`${n.source.id}-${n.target.id}`];t.includes(n==null?void 0:n.target.id)||t.includes(n==null?void 0:n.source.id)?r==null||r.addName("isSelected"):r==null||r.removeName("isSelected")})},showKeyWay(e){if(e.length!==1){this.links.forEach(r=>{const o=this.linksGroup[`${r.source.id}-${r.target.id}`];o==null||o.removeName("keyed")}),this.history.resetKeyLinksAndNodes();return}const{keyLinks:t,keyNodeIds:n}=this.history.findKeyLinksAndNodes(e[0].id,!0);this.links.forEach(r=>{const o=t.find(l=>l.source.id===r.source.id&&l.target.id===r.target.id),a=this.linksGroup[`${r.source.id}-${r.target.id}`];o?a==null||a.addName("keyed"):a==null||a.removeName("keyed")}),this.nodes.forEach(r=>{const o=this.nodesGroup[r.id];n.includes(r.id)?o==null||o.addName("keyed"):o==null||o.removeName("keyed")})},updateNodeStyle(){if(!this.iconAllLoaded)return;let e;this.nodesRange&&this.history.keyNodeIds?e=[...this.nodesRange.map(t=>t.id),...this.history.keyNodeIds]:this.nodesRange?e=this.nodesRange.map(t=>t.id):this.history.keyNodeIds&&(e=this.history.keyNodeIds),setTimeout(()=>{this.highlightByRule(this.highlightRule,e),this.updateNodesStyleByName(),this.updateLinksStyleByName()},0)},updateNodesStyleByName(){this.nodes.forEach(e=>{const t=this.nodesGroup[e.id];if(!t)return;const n=t==null?void 0:t.findOne(".border"),r=t==null?void 0:t.findOne(".konvaText"),o=this.darkMode?"#cdd9da":"#000";t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1),t!=null&&t.hasName("isSelected")?(t.scale({x:8/7,y:8/7}),n==null||n.visible(!0)):(t.scale({x:1,y:1}),n==null||n.visible(!1)),e.type!=="nodeType"&&(t!=null&&t.hasName("isSelected")?(r==null||r.visible(!0),r==null||r.fill("#007ee2")):(r==null||r.visible(!!e.textProp),r==null||r.fill(o)))}),this.layer.batchDraw()},updateLinksStyleByName(){this.links.forEach(e=>{const t=this.linksGroup[`${e.source.id}-${e.target.id}`];if(!t)return;const n=t.findOne(".konvaLine"),r=t.findOne(".edgeLabel"),o=t.findOne(".linkArrow");t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1);const a=this.darkMode?"#445152":"#999";if(t.hasName("isSelected")||t.hasName("keyed")){const l=e.target.type==="org"?"#cf1322":"#007ee2";n.stroke(l),o.fill(l),n.strokeWidth(1),t==null||t.opacity(1),r==null||r.fill("#007ee2"),t.hasName("keyed")?n.strokeWidth(3):n.strokeWidth(1)}else{const l=e.target.type==="org"?"#cf1322":a;this.linksGroup[`${e.source.id}-${e.target.id}`].removeName("isSelected"),n.strokeWidth(1),n.stroke(l),o.fill(l),r==null||r.fill(this.darkMode?"#cdd9da":"#000")}}),this.layer.batchDraw()},handleTableSelect(e=[]){this.selection=this.nodes.filter(t=>{let n;return e.length>1?n=e.indexOf(t.id)>=0&&t.type!=="nodeType"&&t.type!=="aggregation":n=e.indexOf(t.id)>=0,n}),this.updateSelection()},resetAll(){var e,t;document.removeEventListener("click",this.hideContextMenu),(e=this.simulation)==null||e.stop(),this.simulation=null,this.hasSimulation=!1,this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,this.$refs.canvasContainer&&((t=this.resizeObserver)==null||t.unobserve(this.$refs.canvasContainer)),this.nodes=[],this.links=[],this.resizeObserver=null,this.destroyed=!0,this.history.destroy&&this.history.destroy()},unbindKeyEvent(){this.initKeyEvent(1)},initKeyEvent(e=0){if(e){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp);return}document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),this.isKeyUp=!0},keyDown(e){const t=e.keyCode,n=e[this.actKey],r=e.shiftKey;if(this.isKeyUp)switch(t){case 17:break;case 16:this.toggleZoom(!1);break;case 38:break;case 40:this.goAction();break;case 67:if(window.getSelection().toString())return;n&&this.copyNodeText(this.selection);break;case 89:n&&!va()&&this.$parent.historyForward();break;case 90:n&&r?this.$parent.historyForward():n&&this.$parent.historyBack();break;case 46:this.$parent.deleteNodes(this.selection);break}},keyUp(e){const t=e.keyCode,n=e.keyCode;if(va())switch(n){case 17:break;case 16:this.toggleZoom(!0);break}else switch(t){case 17:break;case 16:this.toggleZoom(!0);break}this.isKeyUp=!0},initScript(){var r,o,a,l,c,d;if(this.scriptInited)return;((a=(o=(r=this.history)==null?void 0:r.dataNow)==null?void 0:o.nodes)==null?void 0:a.length)>0&&(this.scriptInited=!0);const e=["193.36.119.50","6cd7b91212983cc557c6e3e671734ff9"];let t=null;if((d=(c=(l=this.history)==null?void 0:l.dataNow)==null?void 0:c.nodes)==null||d.some(u=>{const f=e.indexOf(u.id);return f>=0&&u.startNode===!0&&(t=f),!0}),t===null)return;const n=[[{node:"193.36.119.50"},{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"}],[{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"},{node:"183.246.177.59"},{node:"e7db5b09a39e324d36e937d89f98fdb9122cd859"}]];this.scriptNow=n[t],this.canAct=!!this.scriptNow},goAction(){if(!this.scriptNow||this.actNum>(this.scriptNow.length-1)*2)return;if(this.actNum===(this.scriptNow.length-1)*2){this.centerAndZoom(),this.actNum++;return}const e=this.scriptNow[Math.floor(this.actNum/2)+1];if(this.actNum%2===0){if(!this.history.dataNow.nodes.some(t=>t.id===e.node))return;this.handleTableSelect(e.node),this.nodesMoveToCenterView([e.node]),this.actNum++}else this.$parent.expandNodes(this.selection[0]),setTimeout(()=>{this.nodesMoveToCenterView([this.selection[0].id])},100),this.actNum++},nodesMoveToCenterView(e,t=.9){if(e.length===0)return;const n=[],r=this.nodes.filter(k=>e.indexOf(k.id)>=0);r==null||r.forEach(function(k,S){const E=this.nodesGroup[k.id];n.push({bounds:(E==null?void 0:E.getClientRect())||{},fx:k.x||0,fy:k.y||0})});const o=this.getBounds(n);this.originTransform=this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()};const a=this.stage.width(),l=this.stage.height()/1.5,c=o.width,d=o.height;if(c===0||d===0)return;let u=t/Math.max(c/a,d/l);u=Math.min(u,ni)||ni,this.scale=u;const f=this.stage.width()/(2*u),p=this.stage.height()/(2*u),h=this.nodesGroup[e[0]],m=h==null?void 0:h.getClientRect(),b=m.x*u,w=m.y*u,_=f-b,C=p-w;this.stage.setAttrs({scaleX:u,scaleY:u,x:_||0,y:C||0}),this.layer.batchDraw()},getBounds(e){let t,n,r,o;return e.map(a=>{const l=a.bounds,c=l.x+a.fx,d=l.y+a.fy;t=Math.min(c,t)||c,n=Math.min(d,n)||d,r=Math.max(c+l.width,r)||c+l.width,o=Math.max(d+l.height,o)||d+l.height}),{x:t,y:n,width:r-t,height:o-n}},resetMouseVars(){var e;this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,(e=this.dragLine)==null||e.destroy(),Object.keys(this.nodesGroup).forEach(t=>{this.nodesGroup[t].draggable(!0)})},loadIcons(){return new Promise((e,t)=>{const n=[],r=[];for(const d in this.moduleDetail.plugs){const u=this.moduleDetail.plugs[d];u==null||u.map(f=>{f.children?r.push(...f.children):r.push(f)})}n.push(...r.map(d=>d.icon)),n.push(...this.moduleDetail.nodes.map(d=>d.name)),n.push("node_type"),n.push("node"),n.push("aggregation");const o=this;let a=0;const l=n.filter(d=>this.imgPath[`${o.prefix}d3svg1/${d}.svg`]);function c(d){return{}.VITE_SVG_TYPE==="base64"?E5(d):C5(d)}l.map(d=>{c(this.imgPath[`${o.prefix}d3svg1/${d}.svg`]).then(u=>{o.iconFiles[d]=u;const f=XQ(u).width;this.iconSize[d]=this.nodeWidth?this.nodeWidth:f,a++,a===l.length&&(o.iconAllLoaded=!0,e())}).catch(u=>{console.log(u,"e"),t()})})})},toggleZoom(e){},handleNodeContextMenu(e,t){var n,r;e.evt[this.actKey]||(clearTimeout(this.popoverTimer),this.showPopover=!1,this.contextMenuId++,this.contextMenuNode=t,this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.showContextMenu=!0,e.currentTarget.type==="aggregation"?this.menuOptions=oEe:this.menuOptions=(n=this.$parent.moduleDetail)!=null&&n.plugs[t.type]?Array.from((r=this.$parent.moduleDetail)==null?void 0:r.plugs[t.type]):[])},handleDeselectNode(e,t){be(this,"handle-select-node",{isSelected:!1,_node:s.toRaw(t)}),this.selection.length&&(this.selection=[],this.updateSelection()),this.setHighlightRule({}),this.hideContextMenu()},setHighlightRule({prop:e,type:t,value:n}){this.highlightRule={prop:e,type:t,value:n},this.updateNodeStyle(),t||bC(".legend-filter .out-box").classed("active",!1)},updateSelection(){const e=this.selection.map(t=>t.id);this.nodes.forEach(t=>{var n,r;e.includes(t.id)?(n=this.nodesGroup[t.id])==null||n.addName("isSelected"):(r=this.nodesGroup[t.id])==null||r.removeName("isSelected")}),be(this,"updateSelection")},toggleLayout(e){this.history.layoutIndex=e,this.nodes.map(t=>{t.fx=t.fy=null}),this.updateSimulation(),this.ticked(),setTimeout(()=>{this.centerAndZoom()},200)},handleNodeClick(e,t){en({cId:"handleNodeClick",c:"点击节点"}),this.canAct&&(t.type==="org"?window.open("http://bs.safe.360.net/starmap","__blank"):t.type==="nodeType"&&t.id.indexOf("org")>=0&&window.open("http://bs.safe.360.net/orglist?snapshot=true","__blank1")),this.hideContextMenu();const n=this.selection.some(o=>o.id===t.id);if(e.evt.shiftKey){if(t.type==="nodeType"||this.selection.some(o=>o.type==="nodeType"))return;n?this.selection=this.selection.filter(o=>o.id!==t.id):this.selection=[...this.selection,t]}else n?this.selection=[]:this.selection=[t];const r=this.selection.some(o=>o.id===t.id);be(this,"handle-select-node",{isSelected:r,_node:t}),this.updateSelection(),this.setHighlightRule(this.highlightRule)},handleNodeMouseEnter(e,t){if(!this.showContextMenu&&!e.evt[this.actKey]){const n=e.target.width(),r=e.target.height(),o=e.target,a=o.getAbsolutePosition(),c=o.getStage().container().getBoundingClientRect(),d=a.x-n/2+c.left,u=a.y-r/2+c.top,f=d,p=u,h=f,m=f+n,b=p,w=p+r;this.hoverNodePosition={top:b,right:m,bottom:w,left:h,width:n,height:r},this.popoverType="node",this.popoverContent={[t.type]:t.id},this.popoverNode=t,this.popoverTimer&&clearTimeout(this.popoverTimer),this.popoverTimer=setTimeout(()=>{this.showPopover=!0},200)}},handleNodeMouseLeave(e,t){this.showContextMenu||(clearTimeout(this.popoverTimer),this.showPopover=!1)},handleNodeMouseUp(e,t){var n;e.evt[this.actKey]&&this.mousedownNode&&(this.dragLine&&((n=this.dragLine)==null||n.destroy()),this.mouseupNode=t,this.mouseupNode.id===this.mousedownNode.id||this.mouseupNode.type==="aggregation"||this.mousedownNode.type==="aggregation"||this.$parent.addLink(this.mousedownNode,this.mouseupNode)),this.resetMouseVars()},handleNodeMouseDown(e,t){if(e.evt[this.actKey]){this.mousedownNode=t,this.nodesGroup[t.id].draggable(!1);const n=this.stage.scaleX(),r=this.stage.getPointerPosition(),o=(r.x-this.stage.x())/n,a=(r.y-this.stage.y())/n;this.mousedownPos={x:o,y:a},this.dragLine=new tt.Line({points:[o,a,o,a],stroke:"black",strokeWidth:1,dash:[5,5],opacity:.7,visible:!0}),this.layer.add(this.dragLine),this.stage.draw()}},treeLayout(){this.nodes.map(e=>{e.fx=e.pos,e.fy=e.levelNum*this.levelHeight}),this.forceLayout()},resetLayout(){this.simulation.stop(),this.nodes.map(e=>{delete e.vx,delete e.vy,delete e.x,delete e.y,delete e.fx,delete e.fy}),this.updateSimulation()},selectSingleEdgeNode(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)});for(let n=t.length-1;n>=0;n--){let r=0,o=0;const a=t[n];this.links.map(l=>{l.source.id===a&&r++,l.target.id===a&&o++}),r>=1&&t.splice(n,1),o>=2&&t.splice(n,1)}return t},selectChildren(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)}),this.handleTableSelect(t)},selectParents(e){const t=[];this.links.map(n=>{n.target.id===e.id&&t.push(n.source.id)}),this.handleTableSelect(t)},handleGlobalContextMenu(e){this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.menuOptions=[],this.showContextMenu=!0,this.showPopover=!1,this.contextMenuNode={},e.evt.preventDefault()},hideContextMenu(){this.showContextMenu=!1,this.contextMenuNode={}},centerAndZoom(e=.7,t=!1){var f,p,h;if(this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()},!this.grab)return;const n=this.stage.width(),r=this.stage.height(),o=this.grab.getClientRect(),a=o.width/this.scale,l=o.height/this.scale;if(a===0||l===0)return;let c=e/Math.max(a/n,l/r);if(c=t?c:Math.min(c,ni)||ni,!t&&c>ni)return;this.scale=c;const d=this.stage.width()/(2*c),u=this.stage.height()/(2*c);if((f=this.simulation)!=null&&f.force&&((p=this.simulation)==null||p.force("center",CS(d,u))),this.ticked(),this.stage.setAttrs({scaleX:c,scaleY:c,x:0,y:0}),this.layer.batchDraw(),this.history.layoutIndex===1){const m=this.grab.getClientRect(),b=(n-m.width)/2-m.x,w=(r-m.height)/2-m.y;this.stage.setAttrs({x:b,y:w}),this.layer.batchDraw(),(h=this.simulation)==null||h.stop()}},reset(){this.stage.setAttrs(this.originTransform)},handleContextMenuClick({nodes:e,api:t,dataApi:n}){if(this.requestGraphData){let r,o;const a={show_label:"label",all_show_label:"label",all_show_names:"name",show_names:"name"};switch(t&&t.name){case"edit_label":this.editLabel(e);break;case"single_edge_select":r=this.selectSingleEdgeNode(e[0]),this.selection=this.nodes.filter(l=>r.includes(l.id));break;case"hold_aggregation":o=this.selectSingleEdgeNode(e[0]),this.$parent.aggregationNodes(o,e[0]);break;case"release_aggregation":this.$parent.releaseAggregation(e[0]);break;case"show_label":case"show_names":e.map(l=>{this.showLabel(l,a[t.name])});break;case"all_show_label":case"all_show_names":this.nodes.map(l=>{this.showLabel(l,a[t.name])});break;case"un_show_names":case"un_show_label":e.map(l=>{this.hideLabel(l)});break;case"all_un_show_names":case"all_un_show_label":this.nodes.map(l=>{this.hideLabel(l)});break;case"copy":this.copyNodeText(e);break;case"node_star":e.map(l=>{this.starNode(l)});break;case"un_node_star":e.map(l=>{this.starNode(l,!1)});break;case"fix_nodes":e.map(l=>{this.toggleMove(l,!0)});break;case"un_fix_nodes":e.map(l=>{this.toggleMove(l,!1)}),this.updateSimulation();break;case"all_fix_nodes":this.fixAllNodes(!0);break;case"all_un_fix_nodes":this.fixAllNodes(!1);break;case"expand_node":e.map(l=>{this.$parent.expandNodes(l)});break;case"expand_part_node":e.map(l=>{this.$parent.expandNodes(l,n)});break;case"go_result":this.handleGoDetail(e);break;case"delete_node":this.$parent.deleteNodes(e);break;case"select_children":this.selectChildren(e[0]);break;case"select_parents":this.selectParents(e[0]);break;case"undo":this.$parent.historyBack();break;case"redo":this.$parent.historyForward();break;case"add_con_node":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"add_link":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"show_node":this.toggleShowNode(e[0],e[1],!0);break;case"hide_node":this.toggleShowNode(e[0],e[1],!1);break;default:be(this,"custom-contextmenu-click",{eventName:t.name,customConfig:t.customConfig,nodes:e,allNodes:s.toRaw(this.history.dataNow.nodes)})}this.hideContextMenu(),setTimeout(()=>{this.updateSelection()},400)}else Lt({message:"无可操作权限",type:"warning"})},expandNodes(e,t){en({cId:"dblclick",c:"双击节点"}),this.requestGraphData?this.$parent.expandNodes(t):Lt({message:"无可操作权限",type:"warning"})},toggleShowNode(e,t,n=!0){this.history.toggleShowNode(e,null,n),this.selection.filter(o=>o.show).length>0||this.handleTableSelect([]),setTimeout(this.updateNodeStyle,100)},copyNodeText(e){let t="";e.filter(n=>n.type!=="aggregation"&&n.type!=="nodeType").map(n=>{t=t+n.id+`
145
145
  `}),t&&aEe(t).then(()=>{Lt({message:"复制成功",type:"success"})},n=>{console.log("copy---e",n)})},toggleMove(e,t){e.fx=t?e.x:null,e.fy=t?e.y:null},autoDisplay(){this.nodes.map(e=>{e.fx=null,e.fy=null})},editLabel(e){var t;m5.prompt("修改备注",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:(t=e[0])==null?void 0:t.label,inputPlaceholder:"请输入备注,最多20字",inputValidator:n=>n.length>20?"已超过20字":!0}).then(({value:n})=>{e.map(r=>{r.label=n,this.showLabel(r,"label")}),this.updateNodeStyle()}).catch(n=>{console.log(n)})},showLabel(e,t){e.textProp=t,this.update()},hideLabel(e,t){e.textProp=null,this.update()},safeGet(e,t){return!e||!t?void 0:t.split(".").reduce((o,a)=>o&&o[a]?o[a]:void 0,e)},fixAllNodes(e=!0){this.nodes.map(t=>{this.toggleMove(t,e)}),!e&&this.isAutoTick&&this.updateSimulation()},highlightByRule(e,t){if(!e.prop&&!t){this.nodes.forEach(c=>{const d=this.nodesGroup[c.id];d==null||d.removeName("lowlight")}),this.links.forEach(c=>{const d=this.linksGroup[`${c.source.id}-${c.target.id}`];d==null||d.removeName("lowlight")});return}const{type:n,prop:r,value:o}=e,a=this,l=[];this.nodes.forEach(c=>{const d=this.nodesGroup[c.id];r?n==="include"?o.includes(a.safeGet(c,r))&&a.inNodesRange(t,c)?(d==null||d.removeName("lowlight"),l.push(c)):d==null||d.addName("lowlight"):n==="equal"?a.safeGet(c,r)===o&&a.inNodesRange(t,c)?(d==null||d.removeName("lowlight"),l.push(c)):d==null||d.addName("lowlight"):n==="boolean"&&(j0(a.safeGet(c,r))&&a.inNodesRange(t,c)?(d==null||d.removeName("lowlight"),l.push(c)):d==null||d.addName("lowlight")):a.inNodesRange(t,c)?(d==null||d.removeName("lowlight"),l.push(c)):d==null||d.addName("lowlight")}),this.links.forEach(c=>{const d=this.linksGroup[`${c.source.id}-${c.target.id}`];l.some(f=>f.id===c.target.id)?d==null||d.removeName("lowlight"):d==null||d.addName("lowlight")})},handleCustomSelect(e){if(this.handleDeselectNode(),!e.prop)return;const{type:t,prop:n,value:r}=e,o=this;this.nodes.forEach(a=>{if(n&&t==="include"){let l;if(a.type==="nodeType"){const c=o.safeGet(a,"parents"),d=o.safeGet(a,"children"),u=c==null?void 0:c.some(p=>r.includes(p)),f=d==null?void 0:d.some(p=>r.includes(p));l=u&&f}(r.includes(o.safeGet(a,n))||l)&&this.selection.push(a)}}),this.updateSelection()},inNodesRange(e,t){return e?e.some(n=>n===t.id):!0},loadFlagFiles(e){return Oe(this,null,function*(){return new Promise(t=>{this.flagFiles[e]?t(this.flagFiles[e]):(this.flagFiles[e]=this.imgPath[`${this.prefix}d3svg1/flags/${e}.png`],t(this.flagFiles[e]))})})},getNodeImage(e){return Oe(this,null,function*(){var o,a,l,c,d,u,f,p,h,m,b,w;let t=null;const n=(l=(a=(o=e.detail)==null?void 0:o.info)==null?void 0:a.basic)==null?void 0:l.flag,r=(u=(d=(c=e==null?void 0:e.detail)==null?void 0:c.info)==null?void 0:d.basic)==null?void 0:u.level;if(e.detail&&((p=(f=e.detail)==null?void 0:f.info)!=null&&p.icon_img))try{t=yield po(e.detail.info.icon_img)}catch(_){console.log("loadCompleted error",_)}else if(e.detail&&((m=(h=e.detail)==null?void 0:h.info)!=null&&m.inner_img))try{t=yield po(e.detail.info.inner_img)}catch(_){console.log("loadCompleted error",_)}else if(e.type==="nodeType"||e.type==="aggregation"){if(e!=null&&e.icon_img)try{return t=yield po(e.icon_img),t}catch(C){console.log("loadCompleted error",C)}const _=e.icon||"node_type";if(cr[_])return t=cr[_],t;t=this.iconFiles[_]?this.iconFiles[_]:this.iconFiles.node_type,t=yield po("data:image/svg+xml,"+encodeURIComponent(t)),cr[_]=t}else if(n&&(e.type==="ip"||e.type==="internet")){if(cr[n])return t=cr[n],t;yield this.loadFlagFiles(n),t=yield po(this.flagFiles[n]),cr[n]=t}else if((w=(b=e.detail)==null?void 0:b.info)!=null&&w.inner_country&&(e.type==="country"||e.type==="target_country")){const _=e.detail.info.inner_country;if(cr[_])return t=cr[_],t;yield this.loadFlagFiles(_),t=yield po(this.flagFiles[_]),cr[_]=t}else{const _=`${e.type||"node"}${r}${this.darkMode}`;if(cr[_])return t=cr[_],t;t=this.iconFiles[e.type]?this.iconFiles[e.type]:this.iconFiles.node;const C=cs(r,this.levelList,this.darkMode),k=this.darkMode?"#182628":"#fff";t=S5(t,C,k);try{t=yield po("data:image/svg+xml,"+encodeURIComponent(t))}catch(S){console.log(S)}cr[_]=t}return t})},handleGoDetail(e){e.forEach(t=>{if(t.isCluster)return;const n=t.type,r=this.moduleDetail.config.jumpRule[n];if(r)if(n==="org"){const o=t.id.split("(")[0];o.indexOf("APT")>=0&&window.open(r.split("${id}").join(o),t.id)}else{let o=t.origin&&t.origin[0]||t.id;(n==="url"||n==="virus")&&(o=encodeURIComponent(o)),window.open(r.split("${id}").join(o),t.id)}})},starNode(e,t=!0){e.collect=t,this.update()},handleAddBlack(e){this.showBlackType=!0,this.node=e},changeVisible(e){this.showBlackType=e},zoomIn(){this.adjustZoom(1.1)},zoomOut(){this.adjustZoom(.909)},adjustZoom(e){const n=this.stage.scaleX()*e;this.scale=n;const r={x:this.stage.width()/2,y:this.stage.height()/2},o={x:this.stage.getPointerPosition().x-this.stage.x(),y:this.stage.getPointerPosition().y-this.stage.y()},a={x:-(o.x-r.x)*(e-1),y:-(o.y-r.y)*(e-1)};this.stage.setAttrs({x:this.stage.x()+a.x,y:this.stage.y()+a.y,scaleX:n,scaleY:n}),this.layer.batchDraw()},addNodesDetail(e){return Oe(this,null,function*(){const t=e.filter(o=>!o.detail&&o.noDetail!==!0&&o.type!=="aggregation"&&o.type!=="nodeType"),n={};t.map(o=>{n[o.type]?n[o.type].push(o):n[o.type]=[o]});const r=[];for(const o in n){const a=n[o],l={};a.map(c=>{c.origin&&(l[c.id]=c.origin)}),r.push(this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[n[o][0].type],node_id:n[o].map(c=>c.id),origin:l}).then(c=>(c.data.records.map(u=>{const f=e.find(p=>p.id===u.info.id);f.detail=u}),Promise.resolve({}))))}})},addCanvasBg(){this.darkMode&&(this.darkBgRect=new tt.Rect({x:0,y:0,width:this.stage.width()/this.scale,height:this.stage.height()/this.scale,fill:"#021212",stroke:"#021212",listening:!1,draggable:!1}),this.layer.add(this.darkBgRect),this.darkBgRect.moveToBottom(),this.stage.draw())},removeCanvasBg(){this.darkBgRect&&this.darkBgRect.destroy(),this.darkBgRect=null,this.stage.draw()}}},uEe={class:"main-svg-box","element-loading-text":"布局中...","element-loading-background":"rgba(122, 122, 122)"},fEe={ref:"canvasContainer",class:"canvas-container"};function hEe(e,t,n,r,o,a){const l=s.resolveComponent("popover"),c=s.resolveComponent("node-contextmenu"),d=h5;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["render-container",n.darkMode?"dark-theme "+o.uniqueClass:" "+o.uniqueClass])},[s.withDirectives((s.openBlock(),s.createElementBlock("div",uEe,[s.createElementVNode("div",fEe,null,512)])),[[d,o.ticking]]),s.createVNode(l,{"dark-mode":n.darkMode,"show-popover":o.showPopover&&!o.isDragging,"mouse-position":o.hoverNodePosition,"node-info":o.popoverNode,"module-detail":n.moduleDetail,type:o.popoverType,"custom-tooltip":n.customTooltip,history:n.history,data:n.history.dataNow},null,8,["dark-mode","show-popover","mouse-position","node-info","module-detail","type","custom-tooltip","history","data"]),n.isThreatPath?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(c,{key:0,show:a.showContextMenuFlag,axis:o.mousePosition,"node-info":a.contextMenuNodes,history:n.history,"menu-options":o.menuOptions,"module-detail":n.moduleDetail,onContextmenuClick:a.handleContextMenuClick},null,8,["show","axis","node-info","history","menu-options","module-detail","onContextmenuClick"]))],2)}const $l=Bt(dEe,[["render",hEe]]),tTe="",nTe="",rTe="",{toClipboard:xR}=ff(),pEe={name:"SnapShotDialog",components:{},mixins:[],props:{snapshot:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}}},data(){return{dialogVisible:!1,origin:window.location.origin,ruleForm:{radio:"0",event:"",group:"",graphDesc:""},rules:{event:[{required:!0,message:"请选择安全事件",trigger:"change"}],group:[{required:!1,message:"请选择团队",trigger:"change"}]},eventOptions:[{value:"",label:""}],groupOptions:[{value:"",label:""}],hostList:["https://sc.360.net","https://sc.b.qihoo.net","http://sec.test.safe.qihoo.net"],isInnerAccount:!1,visibleSuccess:!1,eventUrl:null}},computed:{},watch:{snapshot:{handler:function(e,t){e.name&&(this.ruleForm.graphDesc=e.name)},immediate:!0,deep:!0}},created(){this.graphApi.getReportList&&this.graphApi.getReportList().then(e=>{e.data!==null&&(this.eventOptions=[],e.data.map(t=>{this.eventOptions.push({label:t.title,value:t.report_id})}))}),this.graphApi.getGroupList&&this.graphApi.getGroupList().then(e=>{e.data!==null?(this.groupOptions=[],e.data.map(t=>{this.groupOptions.push({label:t.group_name,value:t.group_id})}),this.isInnerAccount=!0):this.isInnerAccount=!1})},mounted(){},updated(){},beforeUnmount(){},methods:{hanleClickCopy(e){xR(e).then(t=>Lt({message:"复制成功",type:"success"}),t=>Lt.error("复制失败"))},show(){this.dialogVisible=!0},hide(){this.dialogVisible=!1,this.resetForm("ruleForm")},submitForm(e){this.$refs[e].validate(t=>{if(t){const n=this.hostList.some(c=>c===this.origin);let r=null;n?this.origin===this.hostList[1]?r=`${this.hostList[0]}/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`:r=`${this.origin}/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`:r=`http://test.sec.360.net/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`,this.eventUrl=window.location.origin+"/event/"+this.ruleForm.event;const o=this.snapshot.thumb;let a=null;this.groupOptions.map(c=>{c.value===this.ruleForm.group&&(a=c.label)});const l={report_id:this.ruleForm.event,group_id:this.ruleForm.group,content:o,graph_url:r,group_name:a,acl:parseInt(this.ruleForm.radio),head:this.ruleForm.graphDesc};this.graphApi.addGraph(l).then(c=>{c.code==="0"?(xR(this.eventUrl),Lt({message:"分享成功! 分享事件地址已经复制",type:"success",showClose:!0,duration:5e3})):Lt({message:"分享失败",type:"error"})}).catch(()=>{Lt({message:"分享失败",type:"error"})}),this.resetForm(e),this.dialogVisible=!1}else return!1})},resetForm(e){this.$refs[e].resetFields(),this.snapshot.name=""}}},gEe={class:"sharetoEvents"},mEe={class:"lable-header"},vEe={class:"desc"},yEe={key:0,class:"desc-font"},bEe={key:1,class:"desc-font"},wEe={class:"dialog-footer"};function _Ee(e,t,n,r,o,a){const l=ZK,c=tf,d=ef,u=r0,f=ns,p=n0,h=is,m=kc;return s.openBlock(),s.createElementBlock("div",gEe,[s.createVNode(m,{title:"分享到安全事件","append-to-body":"","close-on-click-modal":!1,width:"25%",modelValue:o.dialogVisible,"onUpdate:modelValue":t[6]||(t[6]=b=>o.dialogVisible=b),class:"el-dialog-graph"},{footer:s.withCtx(()=>[s.createElementVNode("span",wEe,[s.createVNode(h,{type:"primary",onClick:t[5]||(t[5]=b=>a.submitForm("ruleForm"))},{default:s.withCtx(()=>[s.createTextVNode("确认分享")]),_:1}),s.createVNode(h,{onClick:a.hide},{default:s.withCtx(()=>[s.createTextVNode("关闭")]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(p,{ref:"ruleForm",model:o.ruleForm,rules:o.rules,"label-width":"100px",class:"demo-ruleForm"},{default:s.withCtx(()=>[s.createElementVNode("div",mEe,[s.createVNode(l,{modelValue:o.ruleForm.radio,"onUpdate:modelValue":t[0]||(t[0]=b=>o.ruleForm.radio=b),class:"el-radio",label:"1",border:"",size:"medium"},{default:s.withCtx(()=>[s.createTextVNode("付费可见")]),_:1},8,["modelValue"]),s.createVNode(l,{modelValue:o.ruleForm.radio,"onUpdate:modelValue":t[1]||(t[1]=b=>o.ruleForm.radio=b),label:"0",border:"",size:"medium"},{default:s.withCtx(()=>[s.createTextVNode("开放")]),_:1},8,["modelValue"]),s.createElementVNode("div",vEe,[o.ruleForm.radio==="0"?(s.openBlock(),s.createElementBlock("span",yEe,"该Graph内容对所有用户可见。")):(s.openBlock(),s.createElementBlock("span",bEe,"该Graph内容对付费用户可见。"))])]),s.createVNode(u,{label:"安全事件",prop:"event"},{default:s.withCtx(()=>[s.createVNode(d,{modelValue:o.ruleForm.event,"onUpdate:modelValue":t[2]||(t[2]=b=>o.ruleForm.event=b),"popper-append-to-body":!1,filterable:"",placeholder:"请选择",class:"select-item"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.eventOptions,b=>(s.openBlock(),s.createBlock(c,{key:b.value,label:b.label,value:b.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o.isInnerAccount?(s.openBlock(),s.createBlock(u,{key:0,label:"选择团队",prop:"group"},{default:s.withCtx(()=>[s.createVNode(d,{modelValue:o.ruleForm.group,"onUpdate:modelValue":t[3]||(t[3]=b=>o.ruleForm.group=b),class:"select-item",filterable:"",placeholder:"请选择"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.groupOptions,b=>(s.openBlock(),s.createBlock(c,{key:b.value,label:b.label,value:b.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(u,{label:"Graph介绍",prop:"graphDesc"},{default:s.withCtx(()=>[s.createVNode(f,{modelValue:o.ruleForm.graphDesc,"onUpdate:modelValue":t[4]||(t[4]=b=>o.ruleForm.graphDesc=b),type:"textarea",rows:2,placeholder:"请输入内容",maxlength:"50",clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}const CEe=Bt(pEe,[["render",_Ee]]),iTe="",{toClipboard:SEe}=ff(),EEe={name:"SnapShotDialog",components:{ShareToSecurityEvents:CEe},mixins:[],props:{graphUrlPath:{type:String,default:"/graph"},snapshot:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}}},data(){return{dialogVisible:!1,origin:window.location.origin,isInnerAccount:!1}},computed:{},watch:{},created(){},mounted(){uo(qe,"sharePermission",e=>{this.isInnerAccount=e})},updated(){},beforeUnmount(){fo(qe,"sharePermission")},methods:{hanleClickCopy(e){SEe(e).then(t=>Lt({message:"复制成功",type:"success"}),t=>Lt.error("复制失败"))},show(){this.dialogVisible=!0},hide(){this.dialogVisible=!1},shareToEvents(){this.dialogVisible=!1,this.$refs.sharetoevents.show()}}},xEe={class:"snapshotdialog-container"},kEe={class:"dialog-footer"};function NEe(e,t,n,r,o,a){const l=ns,c=EY,d=is,u=kc,f=s.resolveComponent("ShareToSecurityEvents");return s.openBlock(),s.createElementBlock("div",xEe,[s.createVNode(u,{title:"复制链接及提取码","append-to-body":"",modelValue:o.dialogVisible,"onUpdate:modelValue":t[2]||(t[2]=p=>o.dialogVisible=p),"close-on-click-modal":!1,class:"el-dialog-graph"},{footer:s.withCtx(()=>[s.createElementVNode("span",kEe,[o.isInnerAccount?(s.openBlock(),s.createBlock(d,{key:0,type:"primary",onClick:t[0]||(t[0]=p=>a.shareToEvents())},{default:s.withCtx(()=>[s.createTextVNode("分享到安全事件")]),_:1})):s.createCommentVNode("",!0),s.createVNode(d,{type:"primary",onClick:t[1]||(t[1]=p=>a.hanleClickCopy(`${o.origin}${n.graphUrlPath}?snapshot_id=${n.snapshot.snapshot_id}&vcode=${n.snapshot.vcode}`))},{default:s.withCtx(()=>[s.createTextVNode("复制链接及提取码")]),_:1}),s.createVNode(d,{onClick:a.hide},{default:s.withCtx(()=>[s.createTextVNode("关闭")]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(l,{value:`${o.origin}${n.graphUrlPath}?snapshot_id=${n.snapshot.snapshot_id}`},{prepend:s.withCtx(()=>[s.createTextVNode("链接地址:")]),_:1},8,["value"]),s.createVNode(c),s.createVNode(l,{value:n.snapshot.vcode},{prepend:s.withCtx(()=>[s.createTextVNode("提取码:")]),_:1},8,["value"])]),_:1},8,["modelValue"]),s.createVNode(f,{ref:"sharetoevents",snapshot:n.snapshot,"graph-api":n.graphApi},null,8,["snapshot","graph-api"])])}const TEe=Bt(EEe,[["render",NEe]]),oTe="",AEe={name:"ForceGraphByCanvas",components:{Loading:Eu,ForceGraphSvgIcon:ls,RenderByCanvas:$l,ButtonList:nie,SnapShotDialog:TEe,RightMenu:Aee,Legend:Ine},mixins:[jr],provide:function(){return{history:this.history,hasLevel:this.hasLevel,levelList:this.levelList,levelMap:this.levelMap,getDarkMode:()=>this.darkMode,requestGraphData:this.requestGraphData,moduleDetail:()=>this.moduleDetail}},props:{showPoint:{type:Boolean,default:!0},isRenderStartNode:{type:Boolean,default:!0},isDefaultSelectStartNode:{type:Boolean,default:!0},isShowRightMenu:{type:Boolean,default:!0},hideButtonList:{type:Array,default:()=>[]},customContextMenuEvent:{type:Function},handleSelectNodeEvent:{type:Function},handleDataLoaded:{type:Function},graphApi:{type:Object,default:()=>{}},graphUrlPath:{type:String,default:"/graph"},snapshot_id:{type:String,default:""},vcode:{type:String,default:""},module:{type:String,default:""},startNode:{type:Array,default:()=>[]},enterStartNode:{type:Boolean,default:!1},hasLevel:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",iconType:"",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",iconType:"",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",iconType:"",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",iconType:"",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},showLevelCount:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},title:{type:String,default:""},isShowNodeMessage:{type:Boolean,default:!0},nodeWidth:{type:Number},startNodeWidth:{type:Number},linkDistance:{type:Number},strength:{type:Number},nodeTypeScale:{type:Number},singlesNodeMaxNum:{type:Number,default:100},startNodeAnimation:{type:Boolean,default:!0},customTooltip:{type:Function}},emits:["sharePermission","custom-contextmenu-click","handle-select-node","handle-data-loaded","outdate"],data(){return{history:new MQ({isShowNodeMessage:this.isShowNodeMessage}),isLoading:!1,bigLoading:!1,loadingInfo:"数据加载中",moduleDetail:{},contextMenuNode:{},contextMenuId:0,isDragging:!1,isCtrlDown:!1,selection:[],snapshot:{},inited:!1,outdateTime:0,fullScreen:!1,generateUniqueIndexNow:this.generateUniqueIndex(),screenHeight:0,margin:"0",requestGraphData:!0,nodeTypeList:[]}},computed:{topFrame(){return window.top.location===window.location},levelMap(){const e={};return this.levelList.forEach(t=>{e[t.level]=t}),e}},watch:{startNode:{handler:function(e,t){this.moduleDetail.module&&this.searchStartNode()},immediate:!0,deep:!0},screenHeight:{deep:!0,handler:function(){this.margin=this.changeMargin()}}},created(){return Oe(this,null,function*(){if(this.snapshot_id)this.isLoading=!0,this.graphApi.getSnapshotDetail({snapshot_id:this.snapshot_id,vcode:this.vcode}).then(e=>{this.moduleDetail=e.data.config,this.history.initFromSnapshot(JSON.parse(e.data.data)),setTimeout(()=>{this.$refs.render.updateNodeStyle(),this.centerAndZoom(.8,!1)},1e3)}).catch(e=>{console.log(e,"e")}).finally(e=>{this.isLoading=!1});else if(this.module)this.initGraph();else{Lt.error("请传入模块名称");return}this.graphApi.userInfo&&this.graphApi.userInfo().then(e=>{e.data!==null&&(be(qe,"sharePermission",e.data.access.graph_share),this.requestGraphData=e.data.access.request_graph_data)}).catch(e=>{this.onOutdate(e.res)})})},unmounted(){window.onresize=null},mounted(){return Oe(this,null,function*(){window.onresize=()=>{this.fullScreen=!!document.fullscreenElement,this.screenHeight=document.body.clientHeight},this.margin=this.changeMargin(),uo(qe,"emitDataLoaded",()=>{this.emitDataLoaded()})})},methods:{handleCustomContextMenuClick(e){this.customContextMenuEvent&&typeof this.customContextMenuEvent=="function"?this.customContextMenuEvent(s.toRaw(e)):be(this,"custom-contextmenu-click",s.toRaw(e))},handleSelectNode(e){this.handleSelectNodeEvent&&typeof this.handleSelectNodeEvent=="function"?this.handleSelectNodeEvent(s.toRaw(e),s.toRaw(this.history.dataNow)):be(this,"handle-select-node",s.toRaw(e))},searchStartNode(){this.startNode.length>0&&!this.inited&&this.startNode.map(e=>{const t={type:e.type,id:e.id,startNode:!0};this.inited=!0,this.moduleDetail.nodes.findIndex(n=>e.type===n.name)>=0?this.addNewNodesAndExpand(t):(Lt({message:"无相关数据",type:"warning"}),this.emitDataLoaded())})},initGraph(){return Oe(this,null,function*(){var e;(e=this.graphApi)==null||e.getGraphConfig({name:this.module}).then(t=>{this.moduleDetail=t.data,this.searchStartNode(),!this.inited&&this.enterStartNode&&this.$refs.buttonList.addNode("search")}).catch(t=>{this.onOutdate(t.res),this.emitDataLoaded(),console.log("e",t)})})},addNewNodesAndExpand(e){this.isLoading=!0,this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[e.type],node_id:[e.id],nodeType:e.type,moduleDetail:this.moduleDetail}).then(t=>{var o,a,l;let n={id:(o=t.data.records[0])==null?void 0:o.info.id,type:(a=t.data.records[0])==null?void 0:a.info.type,startNode:!0,detail:t.data.records[0],group:e.id,name:((l=t.data.records[0])==null?void 0:l.info.name)||e.id};n=_i(n,this.moduleDetail.plugs);const r={addOne:{nodes:[n],links:[]}};this.isRenderStartNode&&(this.history.pushState(r),this.history.updateData(t.data.records,[e.id]),setTimeout(()=>{this.isDefaultSelectStartNode&&(this.handleTableSelect([e.id]),setTimeout(()=>{this.selection.length&&this.handleSelectNode({isSelected:!0,_node:this.selection[0]})},0))},500)),this.expandNodes(n)}).catch(t=>{console.log(t,"e"),this.emitDataLoaded(),this.onOutdate(t.res),Lt({message:"无该节点信息",type:"warning"})}).finally(()=>{this.isLoading=!1})},onAction(e){this.history.pushState(e)},onOutdate(e){(e==null?void 0:e.code)==="AC100001"&&this.outdateTime<1&&(this.outdateTime++,be(this,"outdate"))},expandNodes(e,t){return Oe(this,null,function*(){if(!(e!=null&&e.type))return;const n=this.moduleDetail.plugs[e==null?void 0:e.type];let r=[];t?(r=Array.isArray(t)?[...t]:[t],e.apis===void 0&&(e.apis=[]),e.apis.push(...r)):(e.expand=1,e.apis=[],e.apis.push({namec:"拓线全部",value:0,name:"",flagSelect:!0}),n==null||n.map(u=>{u.children?r.push(...u.children):r.push(u)}));const o=r.map(u=>this.graphApi.getGraphRequest({api:u.name,node_id:e.id,origin:e.origin,nodeType:e.type,moduleDetail:this.moduleDetail}).then(f=>Promise.resolve(ue(ae({},f),{api:u.name,apiC:u.relay_name,icon:u.icon,note_name:u.note_name,icon_img:u.icon_img,canLoop:u.canloop,showTotal:u.show_total}))).catch(f=>Promise.resolve(f)));this.isLoading=!0;let a;yield Promise.all(o).then(u=>{if(u.some(p=>{var h;return((h=p.res)==null?void 0:h.code)==="AC100001"})){this.onOutdate({code:"AC100001"});return}a=u.filter(p=>p.code==="0"||p.code===0)}).catch(u=>{console.log(u,"e")}).finally(u=>{this.isLoading=!1});const l=[];let c=[];if(a&&a.forEach(u=>{if(e.getData[u.api]=!0,this.history.dataNow.nodes.find(w=>w.id===e.id)&&(this.history.dataNow.nodes.find(w=>w.id===e.id).getData[u.api]=!0),!u.data)return;let f;const p=u.data.nodes.map(w=>(w.group=e.id+"-"+u.api,w.groupC=u.apiC,w=_i(w,this.moduleDetail.plugs),w)),h=e.id+"-"+u.api;let m={id:h,name:u.apiC,note_name:u.note_name,type:"nodeType",icon:u.icon,showTotal:u.showTotal,icon_img:u.icon_img};const b={source:e.id,target:h};if(m=_i(m,this.moduleDetail.plugs),this.nodeTypeList.push(u.icon||"node_type"),p.length>0&&this.isRenderStartNode){if(f=u.data.links.map(w=>{let _;if(w.source===e.id){const C=this.history.dataNow.nodes.filter(k=>k.id===w.target);if(C.length>0&&(_=this.findGrandSonNodeIds(C[0]).indexOf(w.source)>=0),!u.api.canLoop&&_)return;w.source=h}else w.target===e.id&&(w.target=h);return w}).filter(w=>w),f.length===0)return;f.push(b)}else f=u.data.links;if(this.isRenderStartNode&&p.length>=this.singlesNodeMaxNum){let w=null,_=null;const C=String(Math.floor(new Date().getTime()));w={id:C,list:p,type:"aggregation",name:"聚合",relationId:m.id},w=_i(w,this.moduleDetail.plugs),_={source:m.id,target:C,uniqueIndex:this.generateUniqueIndexNow()};const k={addOne:{nodes:[m,w],links:[b,_]},type:"aggregation"};this.history.pushState(k),this.getNodeDetail(w.list,w.id)}else f.length&&this.isRenderStartNode&&p.push(m),l.push(...p||[]),c.push(...f||[])}),!this.isRenderStartNode){const u={},f={},p=[];this.nodeTypeList.push("node_type"),c.forEach(h=>{const m=h.source+"-"+h.name;if(!u[m]){let b={id:m,name:h.name,type:"nodeType",icon:h.feature.icon};b=_i(b,this.moduleDetail.plugs),u[m]=b}f[m]?f[m].push(h):f[m]=[h]});for(const h in u)l.push(u[h]);for(const h in f)f[h].forEach(b=>{const w=ue(ae({},b),{source:b.source,target:h}),_=ue(ae({},b),{source:h,target:b.target});p.push(w),p.push(_)});c=p}c.map(u=>{u.uniqueIndex=this.generateUniqueIndexNow()});const d={addOne:{nodes:l,links:c}};(l.length>0||c.length>0)&&this.history.pushState(d),this.history.length===2&&setTimeout(()=>{this.centerAndZoom(.8,!1)},1e3),this.getNodeDetail(l)})},findGrandSonNodeIds(e){return this.history.dataNow.nodes.filter(r=>{var o;return((o=e.children)==null?void 0:o.indexOf(r.id))>=0}).reduce((r,o)=>(r.push(...o.children||[]),r),[])||[]},centerAndZoom(e,t){var n;(n=this.$refs.render)==null||n.centerAndZoom(e,t)},generateUniqueIndex(){let e=0;return function(){return e++}},reset(){this.$refs.render.reset()},getNodeDetail(e,t){const r=this.history.dataNow.nodes.filter(l=>e.findIndex(c=>c.id===l.id)>=0).filter(l=>!l.detail&&l.noDetail!==!0&&l.type!=="aggregation"&&l.type!=="nodeType"),o={};r.map(l=>{o[l.type]?o[l.type].push(l):o[l.type]=[l]});let a=Object.keys(o).length;for(const l in o){const c=o[l],d={};c.map(u=>{u.origin&&(d[u.id]=u.origin)}),this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[o[l][0].type],node_id:o[l].map(u=>u.id),origin:d,nodeType:o[l][0].type,moduleDetail:this.moduleDetail}).then(u=>{const f=u.data.records;t?this.history.updateAggregationDetail(f,o[l].map(p=>p.id),t):this.history.updateData(f,o[l].map(p=>p.id))}).catch(u=>{this.onOutdate(u.res)}).finally(()=>{a=a-1,a===0&&(On(" 数据加载完"),this.emitDataLoaded())})}Object.keys(o).length||this.emitDataLoaded()},emitDataLoaded(){this.handleDataLoaded&&typeof this.handleDataLoaded=="function"?this.handleDataLoaded({dataNow:s.toRaw(this.history.dataNow)}):be(this,"handle-data-loaded",{dataNow:s.toRaw(this.history.dataNow)})},addNode({node:e,type:t,connectNode:n}){if(this.history.dataNow.nodes.findIndex(a=>a.id===e.id)>-1){Lt({type:"warning",message:"该节点已存在,添加失败"});return}let o;if(t==="diy"&&e.type==="nodeType"){let a=ue(ae({},e),{detail:null,diy:!0,group:e.id});a=_i(a,this.moduleDetail.plugs);const l=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;o={addOne:{nodes:[a],links:l?[l]:[]}},this.history.pushState(o)}else t==="diy"?this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[e.type],node_id:[e.id],nodeType:e.type,moduleDetail:this.moduleDetail}).then(a=>{var d,u,f;let l={id:(d=a.data.records[0])==null?void 0:d.info.id,type:(u=a.data.records[0])==null?void 0:u.info.type,detail:a.data.records[0],group:e.id,name:((f=a.data.records[0])==null?void 0:f.info.name)||e.id};l=_i(l,this.moduleDetail.plugs);const c=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;o={addOne:{nodes:[l],links:c?[c]:[]}},this.history.pushState(o)}).catch(a=>{this.onOutdate(a.res);let l=ue(ae({},e),{detail:null,diy:!0,group:e.id});l=_i(l,this.moduleDetail.plugs);const c=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;o={addOne:{nodes:[l],links:c?[c]:[]}},this.history.pushState(o)}).finally(a=>{setTimeout(()=>{},500)}):this.addNewNodesAndExpand(e)},addLink(e,t){if(!([e,t].filter(a=>a.type==="nodeType").length===1))return;const r={source:e.id,target:t.id,uniqueIndex:this.generateUniqueIndexNow(),diy:!0};let o=!1;if(this.history.dataNow.links.map(a=>{a.source.id===e.id&&a.target.id===t.id&&(o=!0)}),!o){const a={addOne:{links:[r]}};this.onAction(a)}},expandSelectedNodes(e){e.map(t=>{this.expandNodes(t)})},handleTableSelect(e=[]){this.$refs.render.handleTableSelect(e)},updateSelection(){this.selection=this.$refs.render.selection,this.$refs.render.selectEdgesByNode(this.selection),this.$refs.render.showKeyWay(this.selection),this.$refs.render.updateNodeStyle()},aggregationNodes(e,t){if(e.length===0)return;const n=[];for(const l in this.history.dataNow.nodes)e.findIndex((d,u,f)=>d===this.history.dataNow.nodes[l].id)>=0&&n.push(JSON.parse(JSON.stringify(this.history.dataNow.nodes[l])));const r=String(Math.floor(new Date().getTime()));let o={id:r,list:n,type:"aggregation",name:"聚合",relationId:t.id};o=_i(o,this.moduleDetail.plugs);const a={addOne:{nodes:[o],links:[{source:t.id,target:r,uniqueIndex:this.generateUniqueIndexNow()}]},deleteOne:{nodes:n,links:n.map(l=>({source:t.id,target:l.id}))},type:"aggregation"};this.history.pushState(a),this.emitDataLoaded()},releaseAggregation(e){let t;if(e.type==="aggregation"&&(t=e),this.history.dataNow.links.map(n=>{n.source.id===e.id&&n.target.type==="aggregation"&&(t=t||n.target,n.source)}),t){const n={deleteOne:{nodes:[t],links:[{source:t.relationId,target:t.id}]},addOne:{nodes:t.list,links:t.list.map(r=>({source:t.relationId,target:r.id}))},type:"aggregation"};for(const r in this.history.dataNow.nodes)t.list.findIndex((a,l,c)=>a===this.history.dataNow.nodes[r].id)>=0&&(this.history.dataNow.nodes[r].aggregation=!1);this.history.pushState(n),this.emitDataLoaded()}},saveSnapshot(){return Oe(this,null,function*(){m5.prompt(null,"添加快照",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/^.{1,20}$/,inputPlaceholder:"请输入20字以内快照名称",inputErrorMessage:"请输入20字以内快照名称"}).then(t=>Oe(this,[t],function*({value:e}){this.bigLoading=!0,setTimeout(()=>Oe(this,null,function*(){try{const n=yield this.$refs.buttonList.svgToBlob(),r=new FormData;r.append("data",this.history.toString()),r.append("name",e),r.append("thumb",n),this.graphApi.addSnapshot1(r).then(o=>{this.snapshot=o.data,this.snapshot.name=e,this.$refs.snapshot.show()}).catch(o=>{this.onOutdate(o.res)}).finally(o=>{this.bigLoading=!1})}catch(n){this.bigLoading=!1,console.log(n)}}),100)})).catch(()=>{Lt({type:"info",message:"取消输入"})})})},autoDisplay(){this.$refs.render.autoDisplay()},deleteNodes(e=this.selection){const t={deleteOne:{nodes:e}};this.history.pushState(t),this.emitDataLoaded();const n=e.map(r=>r.id);this.$refs.render.selection=this.selection.filter(r=>!n.includes(r.id)),setTimeout(()=>{this.updateSelection()},300)},historyForward(){this.history.forward(),setTimeout(()=>{this.updateSelection()},100)},historyBack(){this.history.back(),setTimeout(()=>{this.updateSelection()},100)},toggleFullScreen(){en({cId:"toggleFullScreen",c:"切换全屏"}),document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():this.$refs["force-d3-container"].requestFullscreen()},zoomView(e="in"){e==="in"?(en({cId:"zoomIn",c:"zoomIn"}),this.$refs.render.zoomIn()):(en({cId:"zoomOut",c:"zoomOut"}),this.$refs.render.zoomOut())},fitScreen(){var e;en({cId:"centerAndZoom",c:"centerAndZoom"}),(e=this.$refs.render)==null||e.centerAndZoom()},changeMargin(){let e=0;const t=document.body.clientHeight;return e=Math.floor(((t-50)/20-22)/2),e>8?"8px 0":e+"px 0"},handleHighLight(e,t,n){this.$refs.render.setHighlightRule({type:e,prop:t,value:n})},handleCustomSelect(e,t,n){this.$refs.render.handleCustomSelect({type:e,prop:t,value:n})},fixAllNodes(e){this.$refs.render.fixAllNodes(e)},toggleLayout(e){this.$refs.render.toggleLayout(e)},importCsvData(e){for(const t in e.nodes)delete e.nodes[t].vx,delete e.nodes[t].vy,delete e.nodes[t].x,delete e.nodes[t].y;this.history.dataNow=Object.assign({},e)},getCanvasStage(){var e;return(e=this.$refs.render)==null?void 0:e.stage},addCanvasBg(){var e;(e=this.$refs.render)==null||e.addCanvasBg()},removeCanvasBg(){var e;(e=this.$refs.render)==null||e.removeCanvasBg()},controlOperation(e){var t;(t=this.$refs.render)==null||t.handleContextMenuClick(e)}}},OEe={ref:"force-d3-container",class:"d3-container"},IEe=["innerHTML"],REe=s.createElementVNode("div",{class:"top-line-bg"},null,-1),PEe={class:"top-item"},LEe={class:"top-line"},BEe={key:1,class:"select-num"},DEe={class:"highlight"},MEe={class:"loading-container"},FEe={class:"corner-button-box"};function $Ee(e,t,n,r,o,a){const l=s.resolveComponent("ButtonList"),c=s.resolveComponent("RenderByCanvas"),d=s.resolveComponent("Loading"),u=Qe,f=s.resolveComponent("Legend"),p=s.resolveComponent("force-graph-svg-icon"),h=Gn,m=s.resolveComponent("RightMenu"),b=s.resolveComponent("SnapShotDialog"),w=h5;return s.withDirectives((s.openBlock(),s.createElementBlock("div",OEe,[s.createElementVNode("div",{class:s.normalizeClass(["graph-box",{"hide-right-menu":!n.isShowRightMenu}])},[n.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:"safe-force-title",innerHTML:n.title},null,8,IEe)):s.createCommentVNode("",!0),REe,s.createElementVNode("div",PEe,[s.createElementVNode("div",LEe,[s.createVNode(l,{ref:"buttonList","hide-button-list":n.hideButtonList,selection:o.selection,history:o.history,"module-detail":o.moduleDetail,"request-graph-data":o.requestGraphData,onSaveSnapshot:a.saveSnapshot,onAddNodes:a.addNode,onAutoDisplay:a.autoDisplay,onDeleteNodes:a.deleteNodes,onFixNodes:a.fixAllNodes,onToggleLayout:a.toggleLayout,onImportCsvData:a.importCsvData},null,8,["hide-button-list","selection","history","module-detail","request-graph-data","onSaveSnapshot","onAddNodes","onAutoDisplay","onDeleteNodes","onFixNodes","onToggleLayout","onImportCsvData"])])]),s.createVNode(c,{ref:"render","module-detail":o.moduleDetail,history:o.history,"level-list":n.levelList,selection:o.selection,data:o.history.dataNow,"request-graph-data":o.requestGraphData,"dark-mode":n.darkMode,"node-type-scale":n.nodeTypeScale,"node-type-list":o.nodeTypeList,"link-distance":n.linkDistance,strength:n.strength,"node-width":n.nodeWidth,"start-node-width":n.startNodeWidth,"start-node-animation":n.startNodeAnimation,"custom-tooltip":n.customTooltip,onUpdateSelection:a.updateSelection,onOnaction:a.onAction,onHandleSelectNode:a.handleSelectNode,onCustomContextmenuClick:a.handleCustomContextMenuClick},null,8,["module-detail","history","level-list","selection","data","request-graph-data","dark-mode","node-type-scale","node-type-list","link-distance","strength","node-width","start-node-width","start-node-animation","custom-tooltip","onUpdateSelection","onOnaction","onHandleSelectNode","onCustomContextmenuClick"]),o.selection.length>0?(s.openBlock(),s.createElementBlock("p",BEe,[s.createTextVNode(" 已选择"),s.createElementVNode("span",DEe,s.toDisplayString(o.selection.length),1),s.createTextVNode("项 ")])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",MEe,[s.createElementVNode("span",null,s.toDisplayString(o.loadingInfo),1),s.createVNode(u,{class:"is-loading"},{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,o.isLoading]]),s.createVNode(f,{"show-point":n.showPoint,history:o.history,"module-detail":o.moduleDetail,"has-level":n.hasLevel,"show-level-count":n.showLevelCount,margin:o.margin,onHighLight:a.handleHighLight},null,8,["show-point","history","module-detail","has-level","show-level-count","margin","onHighLight"]),s.createElementVNode("div",FEe,[!o.fullScreen&&a.topFrame?(s.openBlock(),s.createBlock(h,{key:0,content:"进入全屏",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/full_button.svg"],alt:"",class:"corner-button",onClick:a.toggleFullScreen},null,8,["icon-class","onClick"])]),_:1})):s.createCommentVNode("",!0),o.fullScreen&&a.topFrame?(s.openBlock(),s.createBlock(h,{key:1,content:"退出全屏",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/un_full_button.svg"],alt:"",class:"corner-button",onClick:a.toggleFullScreen},null,8,["icon-class","onClick"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(h,{content:"适应屏幕",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/fit_button.svg"],alt:"",class:"corner-button",onClick:a.fitScreen},null,8,["icon-class","onClick"])]),_:1}),s.createVNode(h,{content:"放大",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/zoom_in_button.svg"],alt:"",class:"corner-button",onClick:t[0]||(t[0]=_=>a.zoomView("in"))},null,8,["icon-class"])]),_:1}),s.createVNode(h,{content:"缩小",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/zoom_out_button.svg"],alt:"",class:"corner-button",onClick:t[1]||(t[1]=_=>a.zoomView("out"))},null,8,["icon-class"])]),_:1})])],2),n.isShowRightMenu?(s.openBlock(),s.createBlock(m,{key:0,"graph-data":o.history.dataNow,"selected-nodes":o.selection,"request-graph-data":o.requestGraphData,onChangeBox:a.handleTableSelect},null,8,["graph-data","selected-nodes","request-graph-data","onChangeBox"])):s.createCommentVNode("",!0),s.createVNode(b,{ref:"snapshot",snapshot:o.snapshot,"graph-api":n.graphApi,"graph-url-path":n.graphUrlPath},null,8,["snapshot","graph-api","graph-url-path"])])),[[w,o.bigLoading]])}const Qd=Bt(AEe,[["render",$Ee]]);Qd.install=function(e){e.component(Qd.name,Qd)},$l.install=function(e){e.component($l.name,$l)};const sTe="",zEe=[Qd,$l],UEe={install:function(e,t={}){zEe.forEach(n=>{e.component(n.name,n)})}};Me.Graph=Qd,Me.Render=$l,Me.default=UEe,Object.defineProperties(Me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-safe-force-graph",
3
- "version": "2.0.52",
3
+ "version": "2.0.53",
4
4
  "description": "force_graph in security area",
5
5
  "author": "jason zhang",
6
6
  "module": "./lib/vue-safe-force-graph.js",