codecharta-visualization 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/MaibornWolff/codecharta.git"
11
11
  },
12
12
  "name": "codecharta-visualization",
13
- "version": "2.6.0",
13
+ "version": "2.7.0",
14
14
  "engines": {
15
15
  "node": "^22.22.3 || ^24.15.0 || >=26.0.0"
16
16
  },
@@ -1 +0,0 @@
1
- import{$ as Ewt,$n as tn$1,A as ne$1,An as jbe,At as Nv,Bn as nn$1,Bt as Rn$1,C as _n$1,Cn as gxe,D as gn$1,Dn as ii,E as fe$1,Et as N,F as ve,Ft as Qs,G as Bv,Gn as pxe,Gt as Tv,H as B,Hn as ot,Ht as Rv,I as z,In as mxe,J as Dd,Jn as ri,Jt as U1e,K as Cbe,Kt as Twt,L as ze$1,Lt as Rbe,M as ot$1,Mn as kr,Mt as POe,N as qe$1,Nn as kt,Nt as Pbe,O as ir,On as it,Ot as Ne,P as tn$2,Pn as lt,Q as Ev,Qn as st,Qt as Ur,R as $S,Rn as ne,Rt as Rg,S as Zi,Sn as gi,St as MCe,T as et$1,Tn as hxe,Tt as Mwt,Ut as Td,V as Ay,Vn as oH,W as Bd,Wt as Tt,X as Er,Xn as sn$1,Xt as Ube,Y as Dv,Yn as rt,Yt as UOe,Z as Et,Zn as sr,Zt as Uq,_ as Un,_n as dJ,a as H,ar as wt,at as Hn,b as Yi,bn as eN,bt as Ll,c as Kn,cn as Zt$1,cr as xa$1,ct as In$1,d as Qe,dn as ai,dr as xv,en as V1e,et as Fv,f as Qi,fn as ale,fr as yce,ft as JU,g as Ue,gn as dH,h as U$1,hr as zle,i as Ge,in as YU,ir as wJe,j as oe,jn as kR,jt as On$1,k as ke,kn as ja$1,kt as Nn$1,l as Lp,ln as _i,lr as xbe,lt as Iv,m as So,mr as ze,mt as Jn$1,n as Cn$1,nn as Wn$1,nr as vi,o as J,on as ZU,or as wv,p as Qn$1,pr as yi,pt as Jg,q as Cv,qn as qbe,qt as U,r as En$1,rn as XU,rr as vt$1,rt as Gr$1,s as Ke,sn as Ze,sr as wz,t as Be,tn as Vn,tr as ue,tt as G,u as Me$1,un as _v,ur as xt,ut as Iwt,v as Wo,vn as di,w as bn$1,wn as hJe,wt as Me,x as Ze$1,xn as f$,xt as Ls,y as Ye,yn as e2,z as $s,zn as ni,zt as Ri}from"./main-TLHAY4SS.js";import{$ as cx,C as Lu,Ct as xT,D as PO,E as PN,F as ST,G as X,H as WG,I as SY,J as Zt$2,K as XG,L as T1,M as RA,O as Pn$1,Q as cd,R as TT,V,W as Wz,Y as _T,Z as bO,_ as J$1,a as CO,at as jV,b as Kn$1,bt as wT,c as EC,ct as lt$1,d as Gr$2,dt as no,et as de$1,f as H$1,ft as pS,g as Ir,ht as sG,i as Bv$1,it as ie,k as QV,m as Ih,mt as re$1,n as $h,nt as dv,o as Ce$1,p as IT,q as Z,rt as ge$1,st as lo,v as K,vt as vd,w as NA,xt as wo,y as Ki,yt as w}from"./chunk-XL5ZC9Il.js";var re=(()=>{class t{constructor(){this.domainStateReadWindow=N(XU),this.store=N(wt),this.settings=Ri(this.domainStateReadWindow.wordCloudSettings$,{initialValue:ai}),this.hasTfidfData=Ri(this.store.select(Cn$1),{initialValue:!1})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var Qn=[[[``,`body`,``]],`*`];var Zn=[`[body]`,`*`];var Jn=[`ngProjectAs`,`[body]`,5,[``,`body`,``]];var Gr=(()=>{class t{constructor(){this.label=Me.required(),this.value=Me.required(),this.idPrefix=Me.required(),this.minWidthClass=Me(`min-w-[120px]`),this.popoverId=sn$1(()=>`${this.idPrefix()}-popover`),this.anchorName=sn$1(()=>`${this.idPrefix()}-cog`),this.segmentTestId=sn$1(()=>`${this.idPrefix()}-segment`),this.cogTestId=sn$1(()=>`${this.idPrefix()}-cog`)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-segment`]],hostAttrs:[1,`contents`],inputs:{label:[1,`label`],value:[1,`value`],idPrefix:[1,`idPrefix`],minWidthClass:[1,`minWidthClass`]},ngContentSelectors:Zn,decls:3,vars:8,consts:[[3,`label`,`metricName`,`hasCog`,`cogPopoverId`,`cogAnchorName`,`testId`,`cogTestId`,`minWidthClass`]],template:function(o,i){o&1&&(xa$1(Qn),Ne(0,`cc-axis-card`,0),Qs(1,0,Jn),ze(),Qs(2,1)),o&2&&xt(`label`,i.label())(`metricName`,i.value())(`hasCog`,!0)(`cogPopoverId`,i.popoverId())(`cogAnchorName`,i.anchorName())(`testId`,i.segmentTestId())(`cogTestId`,i.cogTestId())(`minWidthClass`,i.minWidthClass())},dependencies:[Rbe],encapsulation:2})}}return t})();var xe=(()=>{class t{constructor(){this.store=N(wt)}setShape(e){this.store.dispatch(Iv({value:e}))}setSizeRange(e){this.store.dispatch(Dv({value:e}))}setRotationRange(e){this.store.dispatch(Cv({value:e}))}setRotationStep(e){this.store.dispatch(xv({value:e}))}setGridSize(e){this.store.dispatch(wv({value:e}))}setSizingMode(e){this.store.dispatch(Bv({value:e}))}setTopN(e){this.store.dispatch(Nv({value:e}))}setShrinkToFit(e){this.store.dispatch(Tv({value:e}))}setDrawOutOfBound(e){this.store.dispatch(_v({value:e}))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var Xr=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.popoverId=Me.required(),this.anchorName=Me.required(),this.settings=this.readStore.settings,this.minRotationBounds={min:-90,max:0},this.maxRotationBounds={min:0,max:90},this.rotationStepBounds={min:15,max:90,step:15},this.resetKeys=[`domainState.rotationRange`,`domainState.rotationStep`]}onRotationStepChange(e){this.writeStore.setRotationStep(e)}onRotationRangeMinChange(e){this.writeStore.setRotationRange(Iwt(this.settings().rotationRange,e))}onRotationRangeMaxChange(e){this.writeStore.setRotationRange(Twt(this.settings().rotationRange,e))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-rotation-settings-popover`]],hostAttrs:[1,`contents`],inputs:{popoverId:[1,`popoverId`],anchorName:[1,`anchorName`]},decls:15,vars:14,consts:[[`ariaLabel`,`Rotation Settings`,`widthClass`,`w-80`,`contentClass`,`gap-3 py-3 px-4`,3,`popoverId`,`anchorName`],[1,`flex`,`flex-col`,`gap-2`,`rounded-lg`,`bg-base-200`,`p-3`],[`data-testid`,`domain-bar-rotation-min`],[1,`text-sm`],[`ariaLabel`,`Min Rotation in degrees`,3,`valueChange`,`min`,`max`,`value`],[`data-testid`,`domain-bar-rotation-max`],[`ariaLabel`,`Max Rotation in degrees`,3,`valueChange`,`min`,`max`,`value`],[`data-testid`,`domain-bar-rotation-step`,`title`,`Words are rotated in multiples of this angle`],[`ariaLabel`,`Rotation Step in degrees`,3,`valueChange`,`min`,`max`,`step`,`value`],[`tooltip`,`Reset the rotation settings to their defaults`,`label`,`Reset rotation`,3,`settingsKeys`,`small`]],template:function(o,i){o&1&&(Ne(0,`cc-settings-popover-shell`,0)(1,`div`,1)(2,`div`,2)(3,`span`,3),Et(4,`Min Rotation`),ze(),Ne(5,`cc-slider-number-input`,4),lt(`valueChange`,function(n){return i.onRotationRangeMinChange(n)}),ze()(),Ne(6,`div`,5)(7,`span`,3),Et(8,`Max Rotation`),ze(),Ne(9,`cc-slider-number-input`,6),lt(`valueChange`,function(n){return i.onRotationRangeMaxChange(n)}),ze()(),Ne(10,`div`,7)(11,`span`,3),Et(12,`Rotation Step`),ze(),Ne(13,`cc-slider-number-input`,8),lt(`valueChange`,function(n){return i.onRotationStepChange(n)}),ze()()(),In$1(14,`cc-reset-settings-button`,9),ze()),o&2&&(xt(`popoverId`,i.popoverId())(`anchorName`,i.anchorName()),ue(5),xt(`min`,i.minRotationBounds.min)(`max`,i.minRotationBounds.max)(`value`,i.settings().rotationRange[0]),ue(4),xt(`min`,i.maxRotationBounds.min)(`max`,i.maxRotationBounds.max)(`value`,i.settings().rotationRange[1]),ue(4),xt(`min`,i.rotationStepBounds.min)(`max`,i.rotationStepBounds.max)(`step`,i.rotationStepBounds.step)(`value`,i.settings().rotationStep),ue(),xt(`settingsKeys`,i.resetKeys)(`small`,!0))},dependencies:[U1e,Ay,V1e],encapsulation:2})}}return t})();var mt=(()=>{class t{constructor(){this.uploaded=Tt(null),this.mask=this.uploaded.asReadonly(),this.dataUri=sn$1(()=>this.uploaded()?.dataUri??null)}accept(e){this.uploaded.set(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var Yr=`image/svg+xml`;var ea=[`script`,`foreignObject`];var ta=[`href`,`xlink:href`];function Kr(t){let r=new DOMParser().parseFromString(t,Yr),e=r.documentElement;if(r.querySelector(`parsererror`)||e.localName!==`svg`)return{rejection:`That file is not an SVG.`};let o=ea.find(a=>e.getElementsByTagName(a).length>0);if(o)return{rejection:`An SVG carrying a <${o}> cannot be used as a shape.`};if(oa(e))return{rejection:`An SVG that references another file cannot be used as a shape.`};let i=ia(e);return i?{dataUri:`data:${Yr},${encodeURIComponent(new XMLSerializer().serializeToString(i))}`}:{rejection:`That SVG states neither a size nor a viewBox, so it has no shape to fill.`}}function oa(t){return[t,...t.querySelectorAll(`*`)].some(r=>ta.some(e=>{let o=r.getAttribute(e);return o!==null&&!o.startsWith(`#`)}))}function ia(t){if(t.getAttribute(`width`)&&t.getAttribute(`height`))return t;let r=t.getAttribute(`viewBox`)?.split(/[\s,]+/).filter(Boolean);if(r?.length!==4)return null;let[,,e,o]=r;return t.setAttribute(`width`,e),t.setAttribute(`height`,o),t}function ra(t,r){if(t&1&&(Ne(0,`option`,4),Et(1),ze()),t&2){let e=r.$implicit,o=st();xt(`value`,e)(`selected`,e===o.settings().shape),ue(),kr(o.shapeLabels[e])}}function na(t,r){t&1&&(Ne(0,`p`,8),Et(1),ze()),t&2&&(ue(),kr(r))}function aa(t,r){t&1&&(Ne(0,`p`,9),Et(1),ze()),t&2&&(ue(),ii(` `,r.fileName,` — words fill the opaque areas of the shape. `))}function sa(t,r){t&1&&(Ne(0,`p`,10),Et(1,` The cloud stays round until you upload a shape, and an uploaded one is forgotten on reload. `),ze())}function da(t,r){if(t&1){let e=Er();Ne(0,`label`,6)(1,`span`,2),Et(2,`SVG file`),ze(),Ne(3,`input`,7),lt(`change`,function(i){Rn$1(e);return Nn$1(st().onShapeFileChosen(i))}),ze()(),tn$1(4,na,2,1,`p`,8)(5,aa,2,1,`p`,9)(6,sa,2,0,`p`,10)}if(t&2){let e,o=st();ue(4),nn$1((e=o.rejection())?4:(e=o.uploadedMask())?5:6,e)}}var Qr=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.customShapeMaskStore=N(mt),this.popoverId=Me.required(),this.anchorName=Me.required(),this.settings=this.readStore.settings,this.shapes=Object.values(ja$1),this.shapeLabels=Mwt,this.resetKeys=[`domainState.shape`],this.isCustomShape=sn$1(()=>this.settings().shape===ja$1.custom),this.uploadedMask=this.customShapeMaskStore.mask,this.rejection=Tt(null)}onShapeChange(e){this.writeStore.setShape(e)}async onShapeFileChosen(e){let o=e.target.files?.[0];if(!o)return;let i=Kr(await o.text());if(`rejection`in i){this.rejection.set(i.rejection);return}this.rejection.set(null),this.customShapeMaskStore.accept({fileName:o.name,dataUri:i.dataUri})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-shape-settings-popover`]],hostAttrs:[1,`contents`],inputs:{popoverId:[1,`popoverId`],anchorName:[1,`anchorName`]},decls:9,vars:5,consts:[[`ariaLabel`,`Shape Settings`,3,`popoverId`,`anchorName`],[`title`,`The outline the words are laid out in`,1,`form-control`,`w-full`,`gap-1`],[1,`text-sm`],[`data-testid`,`domain-bar-shape`,1,`select`,`select-bordered`,`select-sm`,`w-full`,3,`change`],[3,`value`,`selected`],[`tooltip`,`Reset the shape to its default`,`label`,`Reset shape`,3,`settingsKeys`,`small`],[1,`form-control`,`w-full`,`gap-1`],[`type`,`file`,`accept`,`image/svg+xml,.svg`,`data-testid`,`domain-bar-shape-upload`,1,`file-input`,`file-input-bordered`,`file-input-sm`,`w-full`,3,`change`],[`data-testid`,`domain-bar-shape-rejection`,1,`text-xs`,`text-error`],[`data-testid`,`domain-bar-shape-file`,1,`text-xs`,`opacity-60`],[`data-testid`,`domain-bar-shape-hint`,1,`text-xs`,`opacity-60`]],template:function(o,i){o&1&&(Ne(0,`cc-settings-popover-shell`,0)(1,`label`,1)(2,`span`,2),Et(3,`Shape`),ze(),Ne(4,`select`,3),lt(`change`,function(n){return i.onShapeChange(n.target.value)}),Td(5,ra,2,3,`option`,4,ale),ze()(),tn$1(7,da,7,1),In$1(8,`cc-reset-settings-button`,5),ze()),o&2&&(xt(`popoverId`,i.popoverId())(`anchorName`,i.anchorName()),ue(5),Dd(i.shapes),ue(2),nn$1(i.isCustomShape()?7:-1),ue(),xt(`settingsKeys`,i.resetKeys)(`small`,!0))},dependencies:[U1e,Ay],encapsulation:2})}}return t})();var Zr=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.settings=this.readStore.settings,this.wordCountBounds={min:10,max:1e3,step:10}}onTopNChange(e){this.writeStore.setTopN(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-count-control`]],hostAttrs:[1,`contents`],decls:4,vars:4,consts:[[`data-testid`,`domain-bar-top-n`,`title`,`How many of the most important words are drawn`,1,`rounded-lg`,`bg-base-200`,`p-3`],[1,`text-sm`],[`ariaLabel`,`Words`,3,`valueChange`,`min`,`max`,`step`,`value`]],template:function(o,i){o&1&&(Ne(0,`div`,0)(1,`span`,1),Et(2,`Words`),ze(),Ne(3,`cc-slider-number-input`,2),lt(`valueChange`,function(n){return i.onTopNChange(n)}),ze()()),o&2&&(ue(3),xt(`min`,i.wordCountBounds.min)(`max`,i.wordCountBounds.max)(`step`,i.wordCountBounds.step)(`value`,i.settings().topN))},dependencies:[V1e],encapsulation:2})}}return t})();var Jr=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.settings=this.readStore.settings,this.smallestWordBounds={min:10,max:40},this.largestWordBounds={min:40,max:120},this.shrinkToFitTitle=sn$1(()=>this.settings().shrinkToFit?`On — words that do not fit are shrunk until they do, so the full word count is drawn. Tail words can render below Smallest Word.`:`Off — words that do not fit are left out, so Smallest Word is exact but fewer words than requested appear.`),this.drawOutOfBoundTitle=sn$1(()=>this.settings().drawOutOfBound?`On — words may render partially outside the layout area instead of being dropped or shrunk, so more words fit at their true size.`:`Off — every word is kept fully inside the layout area; words that only fit overlapping the edge are shrunk or left out.`)}onSizeRangeMinChange(e){this.writeStore.setSizeRange(Iwt(this.settings().sizeRange,e))}onSizeRangeMaxChange(e){this.writeStore.setSizeRange(Twt(this.settings().sizeRange,e))}onShrinkToFitChange(e){this.writeStore.setShrinkToFit(e)}onDrawOutOfBoundChange(e){this.writeStore.setDrawOutOfBound(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-size-range-control`]],hostAttrs:[1,`contents`],decls:17,vars:10,consts:[[1,`flex`,`flex-col`,`gap-2`,`rounded-lg`,`bg-base-200`,`p-3`],[`data-testid`,`domain-bar-size-min`,`title`,`The least important word in the cloud renders at this size`],[1,`text-sm`],[`ariaLabel`,`Smallest Word in pixels`,3,`valueChange`,`min`,`max`,`value`],[`data-testid`,`domain-bar-size-max`,`title`,`The most important word in the cloud renders at this size`],[`ariaLabel`,`Largest Word in pixels`,3,`valueChange`,`min`,`max`,`value`],[`data-testid`,`domain-bar-shrink-to-fit`,1,`flex`,`cursor-pointer`,`items-center`,`gap-2`,3,`title`],[`type`,`checkbox`,1,`checkbox`,`checkbox-sm`,3,`change`,`checked`],[`data-testid`,`domain-bar-draw-out-of-bound`,1,`flex`,`cursor-pointer`,`items-center`,`gap-2`,3,`title`]],template:function(o,i){o&1&&(Ne(0,`div`,0)(1,`div`,1)(2,`span`,2),Et(3,`Smallest Word`),ze(),Ne(4,`cc-slider-number-input`,3),lt(`valueChange`,function(n){return i.onSizeRangeMinChange(n)}),ze()(),Ne(5,`div`,4)(6,`span`,2),Et(7,`Largest Word`),ze(),Ne(8,`cc-slider-number-input`,5),lt(`valueChange`,function(n){return i.onSizeRangeMaxChange(n)}),ze()(),Ne(9,`label`,6)(10,`input`,7),lt(`change`,function(n){return i.onShrinkToFitChange(n.target.checked)}),ze(),Ne(11,`span`,2),Et(12,`Fit All Words`),ze()(),Ne(13,`label`,8)(14,`input`,7),lt(`change`,function(n){return i.onDrawOutOfBoundChange(n.target.checked)}),ze(),Ne(15,`span`,2),Et(16,`Draw Outside Bounds`),ze()()()),o&2&&(ue(4),xt(`min`,i.smallestWordBounds.min)(`max`,i.smallestWordBounds.max)(`value`,i.settings().sizeRange[0]),ue(4),xt(`min`,i.largestWordBounds.min)(`max`,i.largestWordBounds.max)(`value`,i.settings().sizeRange[1]),ue(),xt(`title`,i.shrinkToFitTitle()),ue(),xt(`checked`,i.settings().shrinkToFit),ue(3),xt(`title`,i.drawOutOfBoundTitle()),ue(),xt(`checked`,i.settings().drawOutOfBound))},dependencies:[V1e],encapsulation:2})}}return t})();function ca(t,r){t&1&&(rt(0,`span`,5),Et(1,`TF-IDF is unavailable: the loaded file has no TF-IDF scores.`),ot())}var en=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.settings=this.readStore.settings,this.hasTfidfData=this.readStore.hasTfidfData,this.WordCloudSizingMode=YU,this.tfidfOptionTitle=sn$1(()=>this.hasTfidfData()?`TF-IDF (relative importance) — sizes words by how distinctive they are, not by raw count`:`TF-IDF (relative importance) — not available: the loaded file has no TF-IDF scores`)}onSizingModeChange(e){this.writeStore.setSizingMode(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-sizing-mode-control`]],hostAttrs:[1,`contents`],decls:9,vars:7,consts:[[`title`,`Which word metric drives a word's rendered size`,1,`form-control`,`w-full`,`gap-1`],[1,`text-sm`],[`data-testid`,`domain-bar-sizing-mode`,1,`select`,`select-bordered`,`select-sm`,`w-full`,3,`change`],[`title`,`Frequency — sizes words by how often they occur`,3,`value`,`selected`],[3,`value`,`selected`,`disabled`,`title`],[1,`text-xs`,`opacity-70`]],template:function(o,i){o&1&&(rt(0,`label`,0)(1,`span`,1),Et(2,`Word Sizing`),ot(),rt(3,`select`,2),Wn$1(`change`,function(n){return i.onSizingModeChange(n.target.value)}),rt(4,`option`,3),Et(5,` Frequency `),ot(),rt(6,`option`,4),Et(7,` TF-IDF `),ot()(),tn$1(8,ca,2,0,`span`,5),ot()),o&2&&(ue(4),sr(`value`,i.WordCloudSizingMode.frequency)(`selected`,i.settings().sizingMode===i.WordCloudSizingMode.frequency),ue(2),sr(`value`,i.WordCloudSizingMode.tfidf)(`selected`,i.settings().sizingMode===i.WordCloudSizingMode.tfidf)(`disabled`,!i.hasTfidfData())(`title`,i.tfidfOptionTitle()),ue(2),nn$1(i.hasTfidfData()?-1:8))},encapsulation:2})}}return t})();var tn=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.settings=this.readStore.settings,this.wordSpacingBounds={min:4,max:16,step:4}}onGridSizeChange(e){this.writeStore.setGridSize(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-spacing-control`]],hostAttrs:[1,`contents`],decls:4,vars:4,consts:[[`data-testid`,`domain-bar-grid-size`,`title`,`Spacing between words in pixels — larger means fewer, more spread-out words`,1,`rounded-lg`,`bg-base-200`,`p-3`],[1,`text-sm`],[`ariaLabel`,`Word Spacing in pixels`,3,`valueChange`,`min`,`max`,`step`,`value`]],template:function(o,i){o&1&&(Ne(0,`div`,0)(1,`span`,1),Et(2,`Word Spacing`),ze(),Ne(3,`cc-slider-number-input`,2),lt(`valueChange`,function(n){return i.onGridSizeChange(n)}),ze()()),o&2&&(ue(3),xt(`min`,i.wordSpacingBounds.min)(`max`,i.wordSpacingBounds.max)(`step`,i.wordSpacingBounds.step)(`value`,i.settings().gridSize))},dependencies:[V1e],encapsulation:2})}}return t})();var on=(()=>{class t{constructor(){this.popoverId=Me.required(),this.anchorName=Me.required(),this.resetKeys=[`domainState.sizingMode`,`domainState.topN`,`domainState.sizeRange`,`domainState.gridSize`,`domainState.shrinkToFit`,`domainState.drawOutOfBound`]}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-sizing-settings-popover`]],hostAttrs:[1,`contents`],inputs:{popoverId:[1,`popoverId`],anchorName:[1,`anchorName`]},decls:6,vars:4,consts:[[`ariaLabel`,`Word Sizing Settings`,`widthClass`,`w-80`,`contentClass`,`gap-3 py-3 px-4`,3,`popoverId`,`anchorName`],[`tooltip`,`Reset the word sizing settings to their defaults`,`label`,`Reset word sizing`,3,`settingsKeys`,`small`]],template:function(o,i){o&1&&(Ne(0,`cc-settings-popover-shell`,0),In$1(1,`cc-word-sizing-mode-control`)(2,`cc-word-count-control`)(3,`cc-word-size-range-control`)(4,`cc-word-spacing-control`)(5,`cc-reset-settings-button`,1),ze()),o&2&&(xt(`popoverId`,i.popoverId())(`anchorName`,i.anchorName()),ue(5),xt(`settingsKeys`,i.resetKeys)(`small`,!0))},dependencies:[U1e,Ay,en,Zr,Jr,tn],encapsulation:2})}}return t})();var Ro=(()=>{class t{constructor(){this.barBottom=Pbe,this.readStore=N(re),this.settings=this.readStore.settings,this.shapeLabel=sn$1(()=>Mwt[this.settings().shape]),this.sizingModeLabel=sn$1(()=>this.settings().sizingMode===YU.tfidf?`TF-IDF`:`Frequency`),this.rotationRangeLabel=sn$1(()=>{let[e,o]=this.settings().rotationRange;return`${e}\xB0 \u2013 ${o}\xB0`})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-bar`]],hostVars:2,hostBindings:function(o,i){o&2&&Vn(`bottom`,i.barBottom)},features:[yce([Ube])],decls:11,vars:10,consts:[[`shape`,``],[`wordSizing`,``],[`rotation`,``],[`label`,`Shape`,`idPrefix`,`domain-bar-shape`,`minWidthClass`,`min-w-[100px]`,3,`value`],[3,`popoverId`,`anchorName`],[`label`,`Word Sizing`,`idPrefix`,`domain-bar-word-sizing`,3,`value`],[`body`,``,`data-testid`,`domain-bar-top-n-value`,1,`text-xs`,`opacity-70`,`text-center`],[`label`,`Rotation`,`idPrefix`,`domain-bar-rotation`,`minWidthClass`,`min-w-[110px]`,3,`value`]],template:function(o,i){if(o&1&&(Ne(0,`cc-domain-segment`,3,0),In$1(2,`cc-shape-settings-popover`,4),ze(),Ne(3,`cc-domain-segment`,5,1)(5,`div`,6),Et(6),ze(),In$1(7,`cc-word-sizing-settings-popover`,4),ze(),Ne(8,`cc-domain-segment`,7,2),In$1(10,`cc-rotation-settings-popover`,4),ze()),o&2){let a=Bd(1),n=Bd(4),s=Bd(9);xt(`value`,i.shapeLabel()),ue(2),xt(`popoverId`,a.popoverId())(`anchorName`,a.anchorName()),ue(),xt(`value`,i.sizingModeLabel()),ue(3),ii(``,i.settings().topN,` words`),ue(),xt(`popoverId`,n.popoverId())(`anchorName`,n.anchorName()),ue(),xt(`value`,i.rotationRangeLabel()),ue(2),xt(`popoverId`,s.popoverId())(`anchorName`,s.anchorName())}},dependencies:[Gr,Qr,on,Xr],encapsulation:2})}}return t})();var Do=(()=>{class t{static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-toolbox`]],features:[$s([{provide:oH,useExisting:UOe}])],decls:2,vars:0,consts:[[1,`join`,`shadow-md`,`bg-base-100`,`rounded`],[`view`,`domain`]],template:function(o,i){o&1&&(Ne(0,`div`,0),In$1(1,`cc-toolbox-screenshot-button`,1),ze())},dependencies:[POe],encapsulation:2})}}return t})();function la(t,r){if(t&1){let e=Er();Ne(0,`cc-floating-menu`,1),lt(`dismissed`,function(){Rn$1(e);return Nn$1(st().close())}),Ne(1,`button`,2),lt(`click`,function(){Rn$1(e);return Nn$1(st().copyWord())}),In$1(2,`i`),Ne(3,`span`,3),Et(4),ze()(),In$1(5,`div`,4),Ne(6,`cc-context-menu-item`,5),lt(`itemClick`,function(){Rn$1(e);return Nn$1(st().searchForThisWord())}),Et(7,` Search word `),ze(),Ne(8,`cc-context-menu-item`,6),lt(`itemClick`,function(){Rn$1(e);return Nn$1(st().hideThisWord())}),Et(9,` Hide word `),ze()()}if(t&2){let e=st();xt(`anchor`,r),ue(2),yi(Ll(`w-4 text-center `,e.wasWordCopied()?`fa-solid fa-check text-success`:`fa-regular fa-copy`)),ue(2),kr(e.rightClickedWord()?.word)}}var ko=(()=>{class t{constructor(){this.clipboard=N(qe$1),this.rightClickedWord=Me(null),this.searchWord=Gr$1(),this.hideWord=Gr$1(),this.closed=Gr$1(),this.anchor=sn$1(()=>{let e=this.rightClickedWord();return e?{x:e.clientX,y:e.clientY}:null}),this.wasWordCopied=this.clipboard.copied}searchForThisWord(){let e=this.rightClickedWord();e&&this.searchWord.emit(e.word),this.close()}hideThisWord(){let e=this.rightClickedWord();e&&this.hideWord.emit(e.word),this.close()}async copyWord(){let e=this.rightClickedWord();e&&await this.clipboard.copy(e.word)}close(){this.closed.emit()}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-menu`]],inputs:{rightClickedWord:[1,`rightClickedWord`]},outputs:{searchWord:`searchWord`,hideWord:`hideWord`,closed:`closed`},decls:1,vars:1,consts:[[`data-testid`,`domain-word-menu`,1,`w-56`,3,`anchor`],[`data-testid`,`domain-word-menu`,1,`w-56`,3,`dismissed`,`anchor`],[`type`,`button`,`title`,`Copy word to clipboard`,`data-testid`,`domain-word-menu-copy`,1,`flex`,`w-full`,`items-center`,`gap-3`,`px-4`,`py-2.5`,`text-left`,`hover:bg-base-200`,3,`click`],[1,`truncate`,`text-sm`,`font-semibold`,`tracking-wide`],[1,`my-1`,`border-t`,`border-base-300`],[`icon`,`fa-solid fa-magnifying-glass`,`hoverHint`,`Put this word into the explorer's word search`,3,`itemClick`],[`icon`,`fa-solid fa-eye-slash`,`hoverHint`,`Drop this word from the cloud and the word list`,3,`itemClick`]],template:function(o,i){if(o&1&&tn$1(0,la,10,5,`cc-floating-menu`,0),o&2){let a;nn$1((a=i.anchor())?0:-1,a)}},dependencies:[jbe,qbe],encapsulation:2})}}return t})();function Yt(t,r){if(r.length===0)return t;let e=new Set(r);return t.filter(o=>!e.has(o.text))}var ma=U(gn$1,hxe,Yt);var He=(()=>{class t{constructor(){this.store=N(wt),this.projectWords$=this.store.select(ma)}occurrencesOf(e,o){return this.store.select(En$1(o,e))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();function pt(t,r){let e=r.trim().toLowerCase();return t.filter(({text:o})=>o.toLowerCase().includes(e))}var ge=(function(t){return t.OCCURRENCES=`Occurrences`,t.NAME=`Name`,t.RELEVANCE=`Relevance`,t})(ge||{});var pa={[ge.OCCURRENCES]:(t,r)=>t.frequency-r.frequency,[ge.NAME]:(t,r)=>t.text.localeCompare(r.text),[ge.RELEVANCE]:(t,r)=>Ewt(t,YU.tfidf)-Ewt(r,YU.tfidf)};function rn(t,{option:r,ascending:e}){let o=pa[r],i=e?1:-1;return[...t].sort((a,n)=>i*o(a,n)||a.text.localeCompare(n.text))}function an(t){let{rowCount:r,rowHeight:e,scrolledPast:o,viewportHeight:i}=t;if(r===0)return ha(t);if(e<=0||i<=0)return ua(t);let a=nn(Math.floor(o/e)-6,0,r-1),n=nn(Math.floor((o+i)/e)+6,a,r-1);return{firstIndex:a,lastIndex:n,topSpacerHeight:a*e,bottomSpacerHeight:(r-n-1)*e}}function ha({rowCount:t}){return{firstIndex:0,lastIndex:t-1,topSpacerHeight:0,bottomSpacerHeight:0}}function ua({rowCount:t,rowHeight:r}){let e=Math.min(50,t)-1;return{firstIndex:0,lastIndex:e,topSpacerHeight:0,bottomSpacerHeight:(t-e-1)*Math.max(r,0)}}function nn(t,r,e){return Math.min(Math.max(t,r),e)}function Kt(t){let r=t*100;return r>0&&r<1?`<1%`:`${Math.round(r)}%`}var sn=(()=>{class t{constructor(){this.contextMenu=N(ve),this.node=Me.required(),this.word=Me.required(),this.isExpanded=Me(!1),this.isSelected=Me(!1),this.clicked=Gr$1(),this.isExpandable=sn$1(()=>this.node().children.length>0),this.isMarked=sn$1(()=>this.contextMenu.isMarked(this.node().path)),this.decoration=sn$1(()=>`${Kt(this.node().share)} of "${this.word()}" \xB7 ${Me$1(this.node().count)}`)}openContextMenu(e){this.contextMenu.openFor(this.node().path,e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-occurrence-row`]],hostAttrs:[1,`block`],hostVars:1,hostBindings:function(o,i){o&1&&lt(`click`,function(){return i.clicked.emit()})(`contextmenu`,function(n){return i.openContextMenu(n)}),o&2&&Hn(`aria-expanded`,i.isExpandable()?i.isExpanded():null)},inputs:{node:[1,`node`],word:[1,`word`],isExpanded:[1,`isExpanded`],isSelected:[1,`isSelected`]},outputs:{clicked:`clicked`},decls:4,vars:7,consts:[[`barTone`,`neutral`,3,`isSelected`,`isMarked`,`barShare`,`decoration`],[3,`isFolder`,`isOpen`],[1,`node-name`,`ml-1`,`flex-1`,`truncate`]],template:function(o,i){o&1&&(Ne(0,`cc-explorer-row`,0),In$1(1,`cc-explorer-tree-item-icon`,1),Ne(2,`span`,2),Et(3),ze()()),o&2&&(xt(`isSelected`,i.isSelected())(`isMarked`,i.isMarked())(`barShare`,i.node().share)(`decoration`,i.decoration()),ue(),xt(`isFolder`,i.node().isFolder)(`isOpen`,i.isExpanded()),ue(2),kr(i.node().name))},dependencies:[Ze$1,et$1],encapsulation:2})}}return t})();var dn=t=>({$implicit:t});var fa=(t,r)=>r.path;function ga(t,r){if(t&1&&(Ne(0,`p`,1),Et(1),ze()),t&2){let e=st();ue(),ii(``,e.word(),` does not occur in any file.`)}}function va(t,r){t&1&&Rg(0)}function Sa(t,r){if(t&1&&(Ne(0,`div`,2),$S(1,va,1,0,`ng-container`,3),ze()),t&2){let e=st(),o=Bd(3);ue(),xt(`ngTemplateOutlet`,o)(`ngTemplateOutletContext`,zle(2,dn,e.topLevelOccurrences()))}}function Ca(t,r){t&1&&Rg(0)}function wa(t,r){if(t&1&&$S(0,Ca,1,0,`ng-container`,3),t&2){let e=st().$implicit;st(2);xt(`ngTemplateOutlet`,Bd(3))(`ngTemplateOutletContext`,zle(2,dn,e.children))}}function xa(t,r){if(t&1){let e=Er();Ne(0,`cc-domain-word-occurrence-row`,4),lt(`clicked`,function(){let i=Rn$1(e).$implicit;return Nn$1(st(2).clickRow(i))}),ze(),Ne(1,`div`,5),tn$1(2,wa,1,4,`ng-container`),ze()}if(t&2){let e=r.$implicit,o=st(2);xt(`node`,e)(`word`,o.word())(`isExpanded`,o.isExpanded(e.path))(`isSelected`,e.path===o.selectedNodePath()),ue(2),nn$1(o.isExpanded(e.path)?2:-1)}}function _a(t,r){if(t&1&&Td(0,xa,3,5,null,null,fa),t&2){let e=r.$implicit;Dd(e)}}var ya=null;var cn=(()=>{class t{constructor(){this.readStore=N(He),this.word=Me.required(),this.selectedNodePath=Me(null),this.nodeClicked=Gr$1(),this.occurrences=Ri(hJe(this.word).pipe(di(e=>this.readStore.occurrencesOf(e,ya))),{initialValue:null}),this.topLevelOccurrences=sn$1(()=>this.occurrences()?.children??[]),this.expandedPaths=Tt(new Set)}isExpanded(e){return this.expandedPaths().has(e)}clickRow(e){e.children.length>0&&this.toggle(e.path),this.nodeClicked.emit(e.path)}toggle(e){let o=new Set(this.expandedPaths());o.delete(e)||o.add(e),this.expandedPaths.set(o)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-occurrence-tree`]],hostAttrs:[1,`block`],inputs:{word:[1,`word`],selectedNodePath:[1,`selectedNodePath`]},outputs:{nodeClicked:`nodeClicked`},decls:4,vars:1,consts:[[`subtree`,``],[`data-testid`,`domain-word-occurrences-empty`,1,`px-3`,`py-2`,`text-sm`,`opacity-60`],[`data-testid`,`domain-word-occurrences-tree`],[4,`ngTemplateOutlet`,`ngTemplateOutletContext`],[3,`clicked`,`node`,`word`,`isExpanded`,`isSelected`],[1,`pl-3`]],template:function(o,i){o&1&&(tn$1(0,ga,2,1,`p`,1)(1,Sa,2,4,`div`,2),$S(2,_a,2,0,`ng-template`,null,0,kR)),o&2&&nn$1(i.topLevelOccurrences().length===0?0:1)},dependencies:[eN,sn],encapsulation:2})}}return t})();var ba=t=>`domain-word-row-${t}`;var ln=(()=>{class t{constructor(){this.word=Me.required(),this.share=Me(0),this.isExpanded=Me(!1),this.toggled=Gr$1(),this.rowId=sn$1(()=>ba(this.word().text)),this.decoration=sn$1(()=>`${Kt(this.share())} of all words \xB7 ${Me$1(this.word().frequency)}`)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-row`]],hostAttrs:[1,`block`],hostVars:3,hostBindings:function(o,i){o&1&&lt(`click`,function(){return i.toggled.emit()}),o&2&&(sr(`id`,i.rowId()),Hn(`data-testid`,i.rowId())(`aria-expanded`,i.isExpanded()))},inputs:{word:[1,`word`],share:[1,`share`],isExpanded:[1,`isExpanded`]},outputs:{toggled:`toggled`},decls:4,vars:5,consts:[[1,`hover:bg-base-200`,3,`barShare`,`decoration`],[`aria-hidden`,`true`,1,`fa`,`fa-font`,`text-xs`,`opacity-70`],[1,`node-name`,`ml-1`,`flex-1`,`truncate`]],template:function(o,i){o&1&&(Ne(0,`cc-explorer-row`,0),In$1(1,`span`,1),Ne(2,`span`,2),Et(3),ze()()),o&2&&(xt(`barShare`,i.share())(`decoration`,i.decoration()),ue(2),ri(`font-semibold`,i.isExpanded()),ue(),kr(i.word().text))},dependencies:[Ze$1],encapsulation:2})}}return t})();var mn=28;var Wa=`cc-domain-word-row`;var Io={scrolledPast:0,viewportHeight:0,rowHeight:mn};var Qt=class{constructor(){this.scrollHost=null,this.measured=Tt(Io,{equal:(r,e)=>r.scrolledPast===e.scrolledPast&&r.viewportHeight===e.viewportHeight&&r.rowHeight===e.rowHeight}),this.geometry=this.measured.asReadonly(),this.remeasure=()=>this.measure()}attachTo(r,e){if(!(this.host===r&&this.scrollHost===e)){if(this.stopObserving(),this.host=r,this.scrollHost=e,!e){this.measured.set(Io);return}e.addEventListener(`scroll`,this.remeasure,{passive:!0}),typeof ResizeObserver<`u`&&(this.resizeObserver=new ResizeObserver(this.remeasure),this.resizeObserver.observe(r),this.resizeObserver.observe(e)),this.measure()}}measure(){let{host:r,scrollHost:e}=this;if(!(!r||!e)){if(!e.contains(r)){this.measured.set(Io);return}this.measured.set({scrolledPast:Math.max(0,e.getBoundingClientRect().top-r.getBoundingClientRect().top),viewportHeight:e.clientHeight,rowHeight:r.querySelector(Wa)?.offsetHeight||mn})}}dispose(){this.stopObserving(),this.host=void 0,this.scrollHost=null}stopObserving(){this.scrollHost?.removeEventListener(`scroll`,this.remeasure),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}};var Ta=(t,r)=>r.text;function Ma(t,r){if(t&1){let e=Er();Ne(0,`div`,0)(1,`div`,1)(2,`span`,2),Et(3,`Pinned`),ze(),Ne(4,`button`,3),lt(`click`,function(){let i=Rn$1(e);return Nn$1(st().wordToggled.emit(i.text))}),In$1(5,`i`,4),ze()(),Ne(6,`cc-domain-word-row`,5),lt(`toggled`,function(){let i=Rn$1(e);return Nn$1(st().wordToggled.emit(i.text))}),ze(),Ne(7,`div`,6)(8,`cc-domain-word-occurrence-tree`,7),lt(`nodeClicked`,function(i){Rn$1(e);return Nn$1(st().nodeClicked.emit(i))}),ze()()()}if(t&2){let e=r,o=st();ue(6),xt(`word`,e)(`share`,o.shareOf(e))(`isExpanded`,!0),ue(2),xt(`word`,e.text)(`selectedNodePath`,o.selectedNodePath())}}function Ea(t,r){t&1&&(Ne(0,`p`,8),Et(1),ze()),t&2&&(ue(),kr(r))}function Ra(t,r){if(t&1&&tn$1(0,Ea,2,1,`p`,8),t&2){let e;nn$1((e=st().emptyHint())?0:-1,e)}}function Da(t,r){if(t&1){let e=Er();Ne(0,`cc-domain-word-row`,10),lt(`toggled`,function(){let i=Rn$1(e).$implicit;return Nn$1(st(2).wordToggled.emit(i.text))}),ze()}if(t&2){let e=r.$implicit,o=st(2);xt(`word`,e)(`share`,o.shareOf(e))}}function ka(t,r){if(t&1&&(In$1(0,`div`),Td(1,Da,1,2,`cc-domain-word-row`,9,Ta),In$1(3,`div`)),t&2){let e=st();Vn(`height`,e.window().topSpacerHeight,`px`),ue(),Dd(e.renderedWords()),ue(2),Vn(`height`,e.window().bottomSpacerHeight,`px`)}}var Oo=(()=>{class t{constructor(){this.readStore=N(He),this.hostElement=N(Jn$1),this.scrollHostService=N(oe),this.viewport=new Qt,this.query=Me(``),this.sorting=Me({option:ge.OCCURRENCES,ascending:!1}),this.expandedWord=Me(null),this.selectedNodePath=Me(null),this.wordToggled=Gr$1(),this.nodeClicked=Gr$1(),this.projectWords=Ri(this.readStore.projectWords$,{requireSync:!0}),this.pinnedWord=sn$1(()=>this.projectWords().find(e=>e.text===this.expandedWord())??null),this.matchedWords=sn$1(()=>pt(this.projectWords(),this.query())),this.visibleWords=sn$1(()=>rn(this.matchedWords().filter(e=>e.text!==this.expandedWord()),this.sorting())),this.emptyHint=sn$1(()=>this.projectWords().length===0?`This project carries no words.`:this.matchedWords().length===0?`No word contains "${this.query().trim()}".`:null),this.geometry=sn$1(()=>ne(B({},this.viewport.geometry()),{rowCount:this.visibleWords().length})),this.window=sn$1(()=>an(this.geometry())),this.renderedWords=sn$1(()=>{let{firstIndex:e,lastIndex:o}=this.window();return this.visibleWords().slice(e,o+1)}),this.totalOccurrences=sn$1(()=>this.projectWords().reduce((e,o)=>e+o.frequency,0)),Ls(()=>this.viewport.attachTo(this.hostElement.nativeElement,this.scrollHostService.element()))}ngOnDestroy(){this.viewport.dispose()}shareOf(e){let o=this.totalOccurrences();return o>0?e.frequency/o:0}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-list`]],hostAttrs:[1,`block`],inputs:{query:[1,`query`],sorting:[1,`sorting`],expandedWord:[1,`expandedWord`],selectedNodePath:[1,`selectedNodePath`]},outputs:{wordToggled:`wordToggled`,nodeClicked:`nodeClicked`},decls:3,vars:2,consts:[[`data-testid`,`domain-word-pin`,1,`sticky`,`top-0`,`z-10`,`mb-1`,`rounded-md`,`border`,`border-base-300`,`bg-base-100`,`shadow-sm`],[1,`flex`,`items-center`,`gap-1`,`px-2`,`pt-1`],[1,`flex-1`,`text-[10px]`,`uppercase`,`tracking-wide`,`opacity-60`],[`type`,`button`,`title`,`Unpin this word`,`data-testid`,`domain-word-unpin`,1,`btn`,`btn-ghost`,`btn-xs`,`btn-square`,`shrink-0`,3,`click`],[1,`fa`,`fa-times`],[3,`toggled`,`word`,`share`,`isExpanded`],[1,`max-h-64`,`overflow-y-auto`,`pl-3`],[3,`nodeClicked`,`word`,`selectedNodePath`],[`data-testid`,`domain-word-list-empty`,1,`px-3`,`py-4`,`text-sm`,`opacity-60`],[3,`word`,`share`],[3,`toggled`,`word`,`share`]],template:function(o,i){if(o&1&&(tn$1(0,Ma,9,5,`div`,0),tn$1(1,Ra,1,1)(2,ka,4,4)),o&2){let a;nn$1((a=i.pinnedWord())?0:-1,a),ue(),nn$1(i.visibleWords().length===0?1:2)}},dependencies:[ln,cn],encapsulation:2})}}return t})();var ht=(()=>{class t{constructor(){this.store=N(wt),this.hiddenWords=Ri(this.store.select(hxe),{initialValue:[]})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var ut=(()=>{class t{constructor(){this.store=N(wt)}hide(e){this.store.dispatch(ZU({word:e}))}restore(e){this.store.dispatch(JU({word:e}))}restoreAll(){this.store.dispatch(e2())}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var Ia=[`popover`];function Oa(t,r){t&1&&(rt(0,`div`,6),Et(1,` Right-click a word in the cloud to drop it from the cloud and the word list. `),ot())}function Na(t,r){if(t&1){let e=Er();rt(0,`li`,8)(1,`span`,10),Et(2),ot(),rt(3,`button`,11),Wn$1(`click`,function(){let i=Rn$1(e).$implicit;return Nn$1(st(2).restore(i))}),Ur(4,`i`,12),ot()()}if(t&2){let e=r.$implicit;ue(2),kr(e),ue(),sr(`title`,`Show `+e+` again`),Hn(`aria-label`,`Show `+e+` again`)(`data-testid`,`domain-restore-`+e)}}function La(t,r){if(t&1){let e=Er();rt(0,`ul`,7),Td(1,Na,5,4,`li`,8,ale),ot(),rt(3,`button`,9),Wn$1(`click`,function(){Rn$1(e);return Nn$1(st().restoreAll())}),Et(4,` Show all words again `),ot()}if(t&2){let e=st();ue(),Dd(e.hiddenWords())}}var No=(()=>{class t{constructor(){this.readStore=N(ht),this.writeStore=N(ut),this.popoverId=Me.required(),this.anchorName=Me.required(),this.hiddenWords=sn$1(()=>[...this.readStore.hiddenWords()].sort((e,o)=>e.localeCompare(o))),this.popover=vi.required(`popover`)}closePopover(){this.popover().nativeElement.hidePopover()}restore(e){this.writeStore.restore(e)}restoreAll(){this.writeStore.restoreAll()}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-hidden-words-popover`]],viewQuery:function(o,i){o&1&&ni(i.popover,Ia,5),o&2&&gi()},hostAttrs:[1,`contents`],inputs:{popoverId:[1,`popoverId`],anchorName:[1,`anchorName`]},decls:9,vars:4,consts:[[`popover`,``],[`popover`,``,1,`dropdown`,`p-2`,`rounded-box`,`bg-base-100`,`shadow-lg`,`w-72`,3,`id`],[1,`flex`,`items-center`,`justify-between`,`border-b`,`border-base-300`,`pb-1`,`mb-1`],[1,`text-sm`,`font-semibold`,`uppercase`,`tracking-wide`],[`type`,`button`,`title`,`Close`,`data-testid`,`domain-hidden-words-close-button`,1,`btn`,`btn-ghost`,`btn-xs`,`btn-square`,3,`click`],[1,`fa`,`fa-times`],[`data-testid`,`domain-hidden-words-empty`,1,`px-2`,`py-3`,`text-xs`,`opacity-60`],[`data-testid`,`domain-hidden-words-list`,1,`m-0`,`flex`,`max-h-[60vh]`,`list-none`,`flex-col`,`overflow-y-auto`,`p-0`],[1,`flex`,`items-center`,`gap-2`,`rounded`,`py-1`,`pl-2`,`pr-1`,`hover:bg-base-200`],[`type`,`button`,`data-testid`,`domain-restore-all-words`,1,`btn`,`btn-sm`,`btn-block`,`mt-1`,3,`click`],[1,`min-w-0`,`flex-1`,`truncate`,`text-sm`],[`type`,`button`,1,`btn`,`btn-ghost`,`btn-xs`,`btn-square`,3,`click`,`title`],[1,`fa`,`fa-eye`]],template:function(o,i){o&1&&(rt(0,`div`,1,0)(2,`div`,2)(3,`span`,3),Et(4,`Hidden Words`),ot(),rt(5,`button`,4),Wn$1(`click`,function(){return i.closePopover()}),Ur(6,`i`,5),ot()(),tn$1(7,Oa,2,0,`div`,6)(8,La,5,0),ot()),o&2&&(Vn(`position-anchor`,`--`+i.anchorName()),sr(`id`,i.popoverId()),ue(7),nn$1(i.hiddenWords().length===0?7:8))},encapsulation:2})}}return t})();var pn=(()=>{class t{constructor(){this.store=N(wt)}wordsForSelectedNode(e){return this.store.select(U(bn$1(e),hxe,Yt))}selectedNodeName(e){return wJe(e,_i.rootName)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();function gt(t,r,e){if(e<=0)return[];let o=[];for(let i=0;i<t.length;i++){let a={word:t[i],value:Ewt(t[i],r),index:i};if(o.length<e){Pa(o,o.push(a)-1);continue}ft(a,o[0])&&(o[0]=a,Aa(o,0))}return o.sort((i,a)=>ft(i,a)?-1:1),o.map(({word:i})=>i)}function ft(t,r){return t.value>r.value||t.value===r.value&&t.index<r.index}function Pa(t,r){let e=r;for(;e>0;){let o=e-1>>1;if(!ft(t[o],t[e]))return;un(t,e,o),e=o}}function Aa(t,r){let e=r;for(;Fa(t,e);){let o=za(t,e);if(o===e)return;un(t,e,o),e=o}}var Fa=(t,r)=>hn(r)<t.length;function za(t,r){let e=hn(r),o=e+1,i=r;return ft(t[i],t[e])&&(i=e),o<t.length&&ft(t[i],t[o])&&(i=o),i}var hn=t=>2*t+1;function un(t,r,e){let o=t[r];t[r]=t[e],t[e]=o}var fn=`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="640" height="563" viewBox="58.7 0 64 56.3"><path fill="#000" d="M81.9,20.3h0c0-6.9,3.5-13,8.8-16.7C87.4,1.3,83.4,0,79.1,0,67.9,0,58.8,9.1,58.7,20.3h0v36h17.6V20.4h0c0-1.5,1.2-2.8,2.8-2.8s2.8,1.2,2.8,2.8h0Z"/><path fill="#000" d="M122.7,20.3c0-11.2-9.2-20.3-20.4-20.3s-20.3,9.1-20.4,20.3h0v36h17.6V20.4h0c0-1.1.6-2.1,1.6-2.5,2-.9,4,.6,4,2.5h0v35.9h17.6V20.3h0Z"/></svg>`)}`;function Lo(t){return new Promise((r,e)=>{if(typeof Image>`u`){e(new Error(`Image is not available in this environment`));return}let o=new Image;o.onload=()=>r(o),o.onerror=()=>e(new Error(`Failed to load the word-cloud mask image`)),o.src=t})}var Po=`#e6007e`;var Ao=`#0030ff`;var Ha=`--wordCloudColorStart`;var ja=`--wordCloudColorEnd`;var Va=/^#[0-9A-Fa-f]{6}$/;function vn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return[Po,Ao];let t=getComputedStyle(document.documentElement);return[gn(t,Ha,Po),gn(t,ja,Ao)]}function gn(t,r,e){return Fo(t.getPropertyValue(r).trim(),e)}function Fo(t,r){return Va.test(t)?t:r}function Sn(t,r,e){let o=Math.min(1,Math.max(0,e)),i=Zt$1.convertHexToColorObject(Fo(t,Po)),a=Zt$1.convertHexToColorObject(Fo(r,Ao));return Zt$1.convertColorToHex(new vt$1().lerpColors(i,a,o))}function Cn(t,r,e,o){let[i,a]=t;if(e||!o||r.length===0)return t;let n=Math.max(...r.map(u=>u.text.length)),s=o*.9/(n*.62),l=Math.max(Math.min(a,Math.floor(s)),1);return[Math.min(i,l),l]}var qa=3;function wn(){return({name:t,data:r})=>{let e=[`<b>${CO(t)}</b>`,`Frequency: ${r.frequency}`];return r.tfidf!==void 0&&e.push(`TF-IDF: ${r.tfidf.toFixed(qa)}`),e.join(`<br/>`)}}var Ua=31;var xn=1e3;function _n(t,r,e){return Sn(r,e,$a(t))}function $a(t){let r=0;for(let e of t)r=(r*Ua+(e.codePointAt(0)??0))%xn;return r/xn}var Ga=10;var Xa=`#333`;var Ya=`Roboto, "Helvetica Neue", sans-serif`;var Ka=.55;function bn(t,r,e={}){let o=Cn(r.sizeRange,t,r.drawOutOfBound,e.containerWidth),{shape:i,maskImage:a,keepAspect:n}=Za(r.shape,e.maskImage);return{aria:{enabled:!0},tooltip:{show:!0,formatter:wn()},series:[{type:`wordCloud`,shape:i,maskImage:a,keepAspect:n,left:`center`,top:`center`,width:`${.9*100}%`,height:`${.9*100}%`,sizeRange:o,rotationRange:r.rotationRange,rotationStep:r.rotationStep,gridSize:r.gridSize,drawOutOfBound:r.drawOutOfBound,shrinkToFit:r.shrinkToFit,layoutAnimation:e.layoutAnimation??!0,textStyle:{fontFamily:Ya,fontWeight:`bold`},emphasis:{textStyle:{textShadowBlur:Ga,textShadowColor:Xa}},blur:{textStyle:{opacity:Ka}},data:Qa(t,r)}]}}function Qa(t,r){let[e,o]=vn();return t.map(i=>({name:i.text,value:Ewt(i,r.sizingMode),frequency:i.frequency,tfidf:i.tfidf,textStyle:{color:_n(i.text,e,o)}}))}function Za(t,r){return t===ja$1.logoM||t===ja$1.custom?{shape:ja$1.circle,maskImage:r,keepAspect:!0}:{shape:t,maskImage:void 0,keepAspect:!1}}var vt=Math.PI*2;var je=Zt$2.CMD;var Ja=[`top`,`right`,`bottom`,`left`];function es(t,r,e,o,i){var a=e.width,n=e.height;switch(t){case`top`:o.set(e.x+a/2,e.y-r),i.set(0,-1);break;case`bottom`:o.set(e.x+a/2,e.y+n+r),i.set(0,1);break;case`left`:o.set(e.x-r,e.y+n/2),i.set(-1,0);break;case`right`:o.set(e.x+a+r,e.y+n/2),i.set(1,0);break}}function ts(t,r,e,o,i,a,n,s,l){n-=t,s-=r;var u=Math.sqrt(n*n+s*s);n/=u,s/=u;var d=n*e+t,W=s*e+r;if(Math.abs(o-i)%vt<1e-4)return l[0]=d,l[1]=W,u-e;if(a){var C=o;o=no(i),i=no(C)}else o=no(o),i=no(i);o>i&&(i+=vt);var m=Math.atan2(s,n);if(m<0&&(m+=vt),m>=o&&m<=i||m+vt>=o&&m+vt<=i)return l[0]=d,l[1]=W,u-e;var y=e*Math.cos(o)+t,D=e*Math.sin(o)+r,A=e*Math.cos(i)+t,ce=e*Math.sin(i)+r,H=(y-n)*(y-n)+(D-s)*(D-s),G=(A-n)*(A-n)+(ce-s)*(ce-s);return H<G?(l[0]=y,l[1]=D,Math.sqrt(H)):(l[0]=A,l[1]=ce,Math.sqrt(G))}function Bo(t,r,e,o,i,a,n,s){var l=i-t,u=a-r,d=e-t,W=o-r,C=Math.sqrt(d*d+W*W);d/=C,W/=C;var y=(l*d+u*W)/C;s&&(y=Math.min(Math.max(y,0),1)),y*=C;var D=n[0]=t+y*d,A=n[1]=r+y*W;return Math.sqrt((D-i)*(D-i)+(A-a)*(A-a))}function Tn(t,r,e,o,i,a,n){e<0&&(t=t+e,e=-e),o<0&&(r=r+o,o=-o);var s=t+e,l=r+o,u=n[0]=Math.min(Math.max(i,t),s),d=n[1]=Math.min(Math.max(a,r),l);return Math.sqrt((u-i)*(u-i)+(d-a)*(d-a))}var ye=[];function os(t,r,e){var o=Tn(r.x,r.y,r.width,r.height,t.x,t.y,ye);return e.set(ye[0],ye[1]),o}function is(t,r,e){for(var o=0,i=0,a=0,n=0,s,l,u=Infinity,d=r.data,W=t.x,C=t.y,m=0;m<d.length;){var y=d[m++];m===1&&(o=d[m],i=d[m+1],a=o,n=i);var D=u;switch(y){case je.M:a=d[m++],n=d[m++],o=a,i=n;break;case je.L:D=Bo(o,i,d[m],d[m+1],W,C,ye,!0),o=d[m++],i=d[m++];break;case je.C:D=cd(o,i,d[m++],d[m++],d[m++],d[m++],d[m],d[m+1],W,C,ye),o=d[m++],i=d[m++];break;case je.Q:D=vd(o,i,d[m++],d[m++],d[m],d[m+1],W,C,ye),o=d[m++],i=d[m++];break;case je.A:var A=d[m++],ce=d[m++],H=d[m++],G=d[m++],pe=d[m++],Le=d[m++];m+=1;var tt=!!(1-d[m++]);s=Math.cos(pe)*H+A,l=Math.sin(pe)*G+ce,m<=1&&(a=s,n=l);var Ue=(W-A)*G/H+A;D=ts(A,ce,G,pe,pe+Le,tt,Ue,C,ye),o=Math.cos(pe+Le)*H+A,i=Math.sin(pe+Le)*G+ce;break;case je.R:a=o=d[m++],n=i=d[m++];var ot=d[m++],Ct=d[m++];D=Tn(a,n,ot,Ct,W,C,ye);break;case je.Z:D=Bo(o,i,a,n,W,C,ye,!0),o=a,i=n;break}D<u&&(u=D,e.set(ye[0],ye[1]))}return u}var qe=new de$1;var de=new de$1;var Ce=new de$1;var Je=new de$1;var St=new de$1;function Ho(t,r){if(t){var e=t.getTextGuideLine(),o=t.getTextContent();if(o&&e){var i=t.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],n=i.candidates||Ja,s=o.getBoundingRect().clone();s.applyTransform(o.getComputedTransform());var l=Infinity,u=i.anchor,d=t.getComputedTransform(),W=d&&Gr$2([],d),C=r.get(`length2`)||0;u&&Ce.copy(u);for(var m=0;m<n.length;m++){var y=n[m];es(y,0,s,qe,Je),de$1.scaleAndAdd(de,qe,Je,C),de.transform(W);var D=t.getBoundingRect(),A=u?u.distance(de):t instanceof J$1?is(de,t.path,Ce):os(de,D,Ce);A<l&&(l=A,de.transform(d),Ce.transform(d),Ce.toArray(a[0]),de.toArray(a[1]),qe.toArray(a[2]))}rs(a,r.get(`minTurnAngle`)),e.setShape({points:a})}}}var Wn=[];var Ve=new de$1;function rs(t,r){if(r<=180&&r>0){r=r/180*Math.PI,qe.fromArray(t[0]),de.fromArray(t[1]),Ce.fromArray(t[2]),de$1.sub(Je,qe,de),de$1.sub(St,Ce,de);var e=Je.len(),o=St.len();if(!(e<.001||o<.001)){Je.scale(1/e),St.scale(1/o);var i=Je.dot(St);if(Math.cos(r)<i){var n=Bo(de.x,de.y,Ce.x,Ce.y,qe.x,qe.y,Wn,!1);Ve.fromArray(Wn),Ve.scaleAndAdd(St,n/Math.tan(Math.PI-r));var s=Ce.x!==de.x?(Ve.x-de.x)/(Ce.x-de.x):(Ve.y-de.y)/(Ce.y-de.y);if(isNaN(s))return;s<0?de$1.copy(Ve,de):s>1&&de$1.copy(Ve,Ce),Ve.toArray(t[1])}}}}function zo(t,r,e,o){var i=e===`normal`,a=i?t:t.ensureState(e);a.ignore=r;var n=o.get(`smooth`);n=n===!0?.3:Math.max(+n,0)||0,a.shape=a.shape||{},a.shape.smooth=n;var s=o.getModel(`lineStyle`).getLineStyle();i?t.useStyle(s):a.style=s}function ns(t,r){var e=r.smooth,o=r.points;if(o)if(t.moveTo(o[0][0],o[0][1]),e>0&&o.length>=3){var i=Bv$1(o[0],o[1]),a=Bv$1(o[1],o[2]);if(!i||!a){t.lineTo(o[1][0],o[1][1]),t.lineTo(o[2][0],o[2][1]);return}var n=Math.min(i,a)*e,s=PO([],o[1],o[0],n/i),l=PO([],o[1],o[2],n/a),u=PO([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],o[2][0],o[2][1])}else for(var d=1;d<o.length;d++)t.lineTo(o[d][0],o[d][1])}function Mn(t,r,e){var o=t.getTextGuideLine(),i=t.getTextContent();if(!i){o&&t.removeTextGuideLine();return}for(var a=r.normal,n=a.get(`show`),s=i.ignore,l=0;l<T1.length;l++){var u=T1[l],d=r[u],W=u===`normal`;if(d){var C=d.get(`show`);if((W?s:H$1(i.states[u]&&i.states[u].ignore,s))||!H$1(C,n)){var y=W?o:o&&o.states[u];y&&(y.ignore=!0),o&&zo(o,!0,u,d);continue}o||(o=new wo,t.setTextGuideLine(o),!W&&(s||!n)&&zo(o,!0,`normal`,r.normal),t.stateProxy&&(o.stateProxy=t.stateProxy)),zo(o,!1,u,d)}}if(o){re$1(o.style,e),o.style.fill=null;var D=a.get(`showAbove`),A=t.textGuideLineConfig=t.textGuideLineConfig||{};A.showAbove=D||!1,o.buildPath=ns}}function En(t,r){r=r||`labelLine`;for(var e={normal:t.getModel(r)},o=0;o<lo.length;o++){var i=lo[o];e[i]=t.getModel([i,r])}return e}function as(t){if(t){for(var r=[],e=0;e<t.length;e++)r.push(t[e].slice());return r}}function ss(t,r){var e=t.label,o=r&&r.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:e.style.align,verticalAlign:e.style.verticalAlign,labelLinePoints:as(o&&o.shape.points)}}var Rn=[`align`,`verticalAlign`,`width`,`height`,`fontSize`];var fe=new Pn$1;var jo=K();var ds=K();function Zt(t,r,e){for(var o=0;o<e.length;o++){var i=e[o];r[i]!=null&&(t[i]=r[i])}}var Jt=[`x`,`y`,`rotation`];var Dn=(function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(r,e,o,i,a){var n=i.style,l=i.__hostTarget.textConfig||{},u=i.getComputedTransform(),d=i.getBoundingRect().plain();X.applyTransform(d,d,u),u?fe.setLocalTransform(u):(fe.x=fe.y=fe.rotation=fe.originX=fe.originY=0,fe.scaleX=fe.scaleY=1),fe.rotation=no(fe.rotation);var W=i.__hostTarget,C;if(W){C=W.getBoundingRect().plain();var m=W.getComputedTransform();X.applyTransform(C,C,m)}var y=C&&W.getTextGuideLine();this._labelList.push({label:i,labelLine:y,seriesModel:o,dataIndex:r,dataType:e,layoutOptionOrCb:a,layoutOption:null,rect:d,hostRect:C,priority:C?C.width*C.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:y&&y.ignore,x:fe.x,y:fe.y,scaleX:fe.scaleX,scaleY:fe.scaleY,rotation:fe.rotation,style:{x:n.x,y:n.y,align:n.align,verticalAlign:n.verticalAlign,width:n.width,height:n.height,fontSize:n.fontSize},cursor:i.cursor,attachedPos:l.position,attachedRot:l.rotation}})},t.prototype.addLabelsOfSeries=function(r){var e=this;this._chartViewList.push(r);var o=r.__model,i=o.get(`labelLayout`);(V(i)||ie(i).length)&&r.group.traverse(function(a){if(a.ignore)return!0;var n=a.getTextContent(),s=ge$1(a);n&&!n.disableLabelLayout&&e._addLabel(s.dataIndex,s.dataType,o,n,i)})},t.prototype.updateLayoutConfig=function(r){var e=r.getWidth(),o=r.getHeight();function i(G,pe){return function(){Ho(G,pe)}}for(var a=0;a<this._labelList.length;a++){var n=this._labelList[a],s=n.label,l=s.__hostTarget,u=n.defaultAttr,d=void 0;V(n.layoutOptionOrCb)?d=n.layoutOptionOrCb(ss(n,l)):d=n.layoutOptionOrCb,d=d||{},n.layoutOption=d;var W=Math.PI/180;l&&l.setTextConfig({local:!1,position:d.x!=null||d.y!=null?null:u.attachedPos,rotation:d.rotate!=null?d.rotate*W:u.attachedRot,offset:[d.dx||0,d.dy||0]});var C=!1;if(d.x!=null?(s.x=lt$1(d.x,e),s.setStyle(`x`,0),C=!0):(s.x=u.x,s.setStyle(`x`,u.style.x)),d.y!=null?(s.y=lt$1(d.y,o),s.setStyle(`y`,0),C=!0):(s.y=u.y,s.setStyle(`y`,u.style.y)),d.labelLinePoints){var m=l.getTextGuideLine();m&&(m.setShape({points:d.labelLinePoints}),C=!1)}var y=jo(s);y.needsUpdateLabelLine=C,s.rotation=d.rotate!=null?d.rotate*W:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var D=0;D<Rn.length;D++){var A=Rn[D];s.setStyle(A,d[A]!=null?d[A]:u.style[A])}if(d.draggable){if(s.draggable=!0,s.cursor=`move`,l){var ce=n.seriesModel;if(n.dataIndex!=null)ce=n.seriesModel.getData(n.dataType).getItemModel(n.dataIndex);s.on(`drag`,i(l,ce.getModel(`labelLine`)))}}else s.off(`drag`),s.cursor=u.cursor}},t.prototype.layout=function(r){var e=r.getWidth(),o=r.getHeight(),i=[];w(this._labelList,function(l){l.defaultAttr.ignore||i.push($h({},l))});var a=Ce$1(i,function(l){return l.layoutOption.moveOverlap===`shiftX`}),n=Ce$1(i,function(l){return l.layoutOption.moveOverlap===`shiftY`});jV(a,0,0,e),jV(n,1,0,o);var s=Ce$1(i,function(l){return l.layoutOption.hideOverlap});QV(s),pS(s)},t.prototype.processLabelsOverall=function(){var r=this;w(this._chartViewList,function(e){var o=e.__model,i=e.ignoreLabelLineUpdate,a=o.isAnimationEnabled();e.group.traverse(function(n){if(n.ignore&&!n.forceLabelAnimation)return!0;var s=!i,l=n.getTextContent();!s&&l&&(s=jo(l).needsUpdateLabelLine),s&&r._updateLabelLine(n,o),a&&r._animateLabels(n,o)})})},t.prototype._updateLabelLine=function(r,e){var o=r.getTextContent(),i=ge$1(r),a=i.dataIndex;if(o&&a!=null){var n=e.getData(i.dataType),s=n.getItemModel(a),l={},u=n.getItemVisual(a,`style`);if(u)l.stroke=u[n.getVisual(`drawType`)];var W=s.getModel(`labelLine`);Mn(r,En(s),l),Ho(r,W)}},t.prototype._animateLabels=function(r,e){var o=r.getTextContent(),i=r.getTextGuideLine();if(o&&(r.forceLabelAnimation||!o.ignore&&!o.invisible&&!r.disableLabelAnimation&&!Ki(r))){var a=jo(o),n=a.oldLayout,s=ge$1(r),l=s.dataIndex,u={x:o.x,y:o.y,rotation:o.rotation},d=e.getData(s.dataType);if(n){o.attr(n);var C=r.prevStates;C&&(Z(C,`select`)>=0&&o.attr(a.oldLayoutSelect),Z(C,`emphasis`)>=0&&o.attr(a.oldLayoutEmphasis)),Ir(o,u,e,l)}else if(o.attr(u),!EC(o).valueAnimation){var W=H$1(o.style.opacity,1);o.style.opacity=0,Kn$1(o,{style:{opacity:W}},e,l)}if(a.oldLayout=u,o.states.select){var m=a.oldLayoutSelect={};Zt(m,u,Jt),Zt(m,o.states.select,Jt)}if(o.states.emphasis){var y=a.oldLayoutEmphasis={};Zt(y,u,Jt),Zt(y,o.states.emphasis,Jt)}PN(o,l,d,e,e)}if(i&&!i.ignore&&!i.invisible){var a=ds(i),n=a.oldLayout,D={points:i.shape.points};n?(i.attr({shape:n}),Ir(i,{shape:D},e)):(i.setShape(D),i.style.strokePercent=0,Kn$1(i,{style:{strokePercent:1}},e)),a.oldLayout=D}},t})();var Vo=K();function kn(t){t.registerUpdateLifecycle(`series:beforeupdate`,function(r,e,o){var i=Vo(e).labelManager;i||(i=Vo(e).labelManager=new Dn),i.clearLabels()}),t.registerUpdateLifecycle(`series:layoutlabels`,function(r,e,o){var i=Vo(e).labelManager;w(o.updatedSeries,function(a){i.addLabelsOfSeries(e.getViewOfSeriesModel(a))}),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()})}Lu([bO,sG]);Lu(kn);WG({type:`series.wordCloud`,visualStyleAccessPath:`textStyle`,visualStyleMapper:function(t){return{fill:t.get(`color`)}},visualDrawType:`fill`,optionUpdated:function(){var t=this.option;t.gridSize=Math.max(Math.floor(t.gridSize),4)},getInitialData:function(t,r){var o=new dv(_T.createDimensions(t.data,{coordDimensions:[`value`]}),this);return o.initData(t.data),o},defaultOption:{maskImage:null,shape:`circle`,keepAspect:!1,left:`center`,top:`center`,width:`70%`,height:`80%`,sizeRange:[12,60],rotationRange:[-90,90],rotationStep:45,gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,textStyle:{fontWeight:`normal`}}});XG({type:`wordCloud`,render:function(t,r,e){var o=this.group;o.removeAll();var i=t.getData(),a=t.get(`gridSize`);t.layoutInstance.ondraw=function(n,s,l,u){var d=i.getItemModel(l),W=d.getModel(`textStyle`),C=new ST.Text({style:_T.createTextStyle(W),scaleX:1/u.info.mu,scaleY:1/u.info.mu,x:(u.gx+u.info.gw/2)*a,y:(u.gy+u.info.gh/2)*a,rotation:u.rot});C.setStyle({x:u.info.fillTextOffsetX,y:u.info.fillTextOffsetY+s*.5,text:n,verticalAlign:`middle`,fill:i.getItemVisual(l,`style`).fill,fontSize:s}),o.add(C),i.setItemGraphicEl(l,C),C.ensureState(`emphasis`).style=_T.createTextStyle(d.getModel([`emphasis`,`textStyle`]),{state:`emphasis`}),C.ensureState(`blur`).style=_T.createTextStyle(d.getModel([`blur`,`textStyle`]),{state:`blur`}),_T.enableHoverEmphasis(C,d.get([`emphasis`,`focus`]),d.get([`emphasis`,`blurScope`])),C.stateTransition={duration:t.get(`animation`)?t.get([`stateAnimation`,`duration`]):0,easing:t.get([`stateAnimation`,`easing`])},C.__highDownDispatcher=!0},this._model=t},remove:function(){this.group.removeAll(),this._model.layoutInstance.dispose()},dispose:function(){this._model.layoutInstance.dispose()}});window.setImmediate||(window.setImmediate=(function(){return window.msSetImmediate||window.webkitSetImmediate||window.mozSetImmediate||window.oSetImmediate||(function(){if(!window.postMessage||!window.addEventListener)return null;var e=[void 0],o=`zero-timeout-message`,i=function(n){var s=e.length;return e.push(n),window.postMessage(o+s.toString(36),`*`),s};return window.addEventListener(`message`,function(n){if(!(typeof n.data!=`string`||n.data.substr(0,o.length)!==o)){n.stopImmediatePropagation();var s=parseInt(n.data.substr(o.length),36);e[s]&&(e[s](),e[s]=void 0)}},!0),window.clearImmediate=function(n){e[n]&&(e[n]=void 0)},i})()||function(e){window.setTimeout(e,0)}})());window.clearImmediate||(window.clearImmediate=(function(){return window.msClearImmediate||window.webkitClearImmediate||window.mozClearImmediate||window.oClearImmediate||function(e){window.clearTimeout(e)}})());var $o=(function(){var r=document.createElement(`canvas`);if(!r||!r.getContext)return!1;var e=r.getContext(`2d`);return!(!e||!e.getImageData||!e.fillText||!Array.prototype.some||!Array.prototype.push)})();var Uo=(function(){if($o){for(var r=document.createElement(`canvas`).getContext(`2d`),e=20,o,i;e;){if(r.font=e.toString(10)+`px sans-serif`,r.measureText(`W`).width===o&&r.measureText(`m`).width===i)return e+1;o=r.measureText(`W`).width,i=r.measureText(`m`).width,e--}return 0}})();var ls=function(t){if(Array.isArray(t)){var r=t.slice();return r.splice(0,2),r}else return[]};var ms=function(r){for(var e,o,i=r.length;i;)e=Math.floor(Math.random()*i),o=r[--i],r[i]=r[e],r[e]=o;return r};var et={};var Go=function(r,e){if(!$o)return;var o=Math.floor(Math.random()*Date.now());Array.isArray(r)||(r=[r]),r.forEach(function(L,c){if(typeof L==`string`){if(r[c]=document.getElementById(L),!r[c])throw new Error(`The element id specified is not found.`)}else if(!L.tagName&&!L.appendChild)throw new Error(`You must pass valid HTML elements, or ID of the element.`)});var i={list:[],fontFamily:`"Trebuchet MS", "Heiti TC", "微軟正黑體", "Arial Unicode MS", "Droid Fallback Sans", sans-serif`,fontWeight:`normal`,color:`random-dark`,minSize:0,weightFactor:1,clearCanvas:!0,backgroundColor:`#fff`,gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,origin:null,drawMask:!1,maskColor:`rgba(255,0,0,0.3)`,maskGapWidth:.3,layoutAnimation:!0,wait:0,abortThreshold:0,abort:function(){},minRotation:-Math.PI/2,maxRotation:Math.PI/2,rotationStep:.1,shuffle:!0,rotateRatio:.1,shape:`circle`,ellipticity:.65,classes:null,hover:null,click:null};if(e)for(var a in e)a in i&&(i[a]=e[a]);if(typeof i.weightFactor!=`function`){var n=i.weightFactor;i.weightFactor=function(c){return c*n}}if(typeof i.shape!=`function`)switch(i.shape){case`circle`:default:i.shape=`circle`;break;case`cardioid`:i.shape=function(c){return 1-Math.sin(c)};break;case`diamond`:i.shape=function(c){var v=c%(2*Math.PI/4);return 1/(Math.cos(v)+Math.sin(v))};break;case`square`:i.shape=function(c){return Math.min(1/Math.abs(Math.cos(c)),1/Math.abs(Math.sin(c)))};break;case`triangle-forward`:i.shape=function(c){var v=c%(2*Math.PI/3);return 1/(Math.cos(v)+Math.sqrt(3)*Math.sin(v))};break;case`triangle`:case`triangle-upright`:i.shape=function(c){var v=(c+Math.PI*3/2)%(2*Math.PI/3);return 1/(Math.cos(v)+Math.sqrt(3)*Math.sin(v))};break;case`pentagon`:i.shape=function(c){var v=(c+.955)%(2*Math.PI/5);return 1/(Math.cos(v)+.726543*Math.sin(v))};break;case`star`:i.shape=function(c){var v=(c+.955)%(2*Math.PI/10);return(c+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-v)+3.07768*Math.sin(2*Math.PI/10-v)):1/(Math.cos(v)+3.07768*Math.sin(v))};break}i.gridSize=Math.max(Math.floor(i.gridSize),4);var s=i.gridSize,l=s-i.maskGapWidth,u=Math.abs(i.maxRotation-i.minRotation),d=Math.min(i.maxRotation,i.minRotation),W=i.rotationStep,C,m,y,D,A,ce,H;function G(L,c){return`hsl(`+(Math.random()*360).toFixed()+`,`+(Math.random()*30+70).toFixed()+`%,`+(Math.random()*(c-L)+L).toFixed()+`%)`}switch(i.color){case`random-dark`:H=function(){return G(10,50)};break;case`random-light`:H=function(){return G(50,90)};break;default:typeof i.color==`function`&&(H=i.color);break}var pe;typeof i.fontWeight==`function`&&(pe=i.fontWeight);var Le=null;typeof i.classes==`function`&&(Le=i.classes);var tt=!1,Ue=[],ot,Ct=function(c){var v=c.currentTarget,S=v.getBoundingClientRect(),E,b;c.touches?(E=c.touches[0].clientX,b=c.touches[0].clientY):(E=c.clientX,b=c.clientY);var B=E-S.left,O=b-S.top,P=Math.floor(B*(v.width/S.width||1)/s),U=Math.floor(O*(v.height/S.height||1)/s);return Ue[P]?Ue[P][U]:null},Jo=function(c){var v=Ct(c);if(ot!==v){if(ot=v,!v){i.hover(void 0,void 0,c);return}i.hover(v.item,v.dimension,c)}},ro=function(c){var v=Ct(c);v&&(i.click(v.item,v.dimension,c),c.preventDefault())},no=[],Hn=function(c){if(no[c])return no[c];var v=c*8,S=v,E=[];for(c===0&&E.push([D[0],D[1],0]);S--;){var b=1;i.shape!==`circle`&&(b=i.shape(S/v*2*Math.PI)),E.push([D[0]+c*b*Math.cos(-S/v*2*Math.PI),D[1]+c*b*Math.sin(-S/v*2*Math.PI)*i.ellipticity,S/v*2*Math.PI])}return no[c]=E,E},ao=function(){return i.abortThreshold>0&&new Date().getTime()-ce>i.abortThreshold},jn=function(){return i.rotateRatio===0||Math.random()>i.rotateRatio?0:u===0?d:d+Math.round(Math.random()*u/W)*W},Vn=function(c,v,S,E){var B=i.weightFactor(v);if(B<=i.minSize)return!1;var O=1;B<Uo&&(O=(function(){for(var lo=2;lo*B<Uo;)lo+=2;return lo})());var P;pe?P=pe(c,v,B,E):P=i.fontWeight;var U=document.createElement(`canvas`),k=U.getContext(`2d`,{willReadFrequently:!0});k.font=P+` `+(B*O).toString(10)+`px `+i.fontFamily;var V=k.measureText(c).width/O,j=Math.max(B*O,k.measureText(`m`).width,k.measureText(`W`).width)/O,ee=V+j*2,ne=j*3,ve=Math.ceil(ee/s),te=Math.ceil(ne/s);ee=ve*s,ne=te*s;var N=-V/2,X=-j*.4,oe=Math.ceil((ee*Math.abs(Math.sin(S))+ne*Math.abs(Math.cos(S)))/s),Se=Math.ceil((ee*Math.abs(Math.cos(S))+ne*Math.abs(Math.sin(S)))/s),Pe=Se*s,$e=oe*s;U.setAttribute(`width`,Pe),U.setAttribute(`height`,$e),k.scale(1/O,1/O),k.translate(Pe*O/2,$e*O/2),k.rotate(-S),k.font=P+` `+(B*O).toString(10)+`px `+i.fontFamily,k.fillStyle=`#000`,k.textBaseline=`middle`,k.fillText(c,N*O,(X+B*.5)*O);var Kn=k.getImageData(0,0,Pe,$e).data;if(ao())return!1;for(var ei=[],Ee=Se,be,so,co,ue=[oe/2,Se/2,oe/2,Se/2];Ee--;)for(be=oe;be--;){co=s;e:for(;co--;)for(so=s;so--;)if(Kn[((be*s+co)*Pe+(Ee*s+so))*4+3]){ei.push([Ee,be]),Ee<ue[3]&&(ue[3]=Ee),Ee>ue[1]&&(ue[1]=Ee),be<ue[0]&&(ue[0]=be),be>ue[2]&&(ue[2]=be);break e}}return{mu:O,occupied:ei,bounds:ue,gw:Se,gh:oe,fillTextOffsetX:N,fillTextOffsetY:X,fillTextWidth:V,fillTextHeight:j,fontSize:B}},qn=function(c,v,S,E,b){for(var B=b.length;B--;){var O=c+b[B][0],P=v+b[B][1];if(O>=m||P>=y||O<0||P<0){if(!i.drawOutOfBound)return!1;continue}if(!C[O][P])return!1}return!0},Un=function(c,v,S,E,b,B,O,P,U,k){var V=S.fontSize,j;H?j=H(E,b,V,B,O,k):j=i.color;var ee;pe?ee=pe(E,b,V,k):ee=i.fontWeight;var ne;Le?ne=Le(E,b,V,k):ne=i.classes,r.forEach(function(ve){if(ve.getContext){var te=ve.getContext(`2d`),N=S.mu;te.save(),te.scale(1/N,1/N),te.font=ee+` `+(V*N).toString(10)+`px `+i.fontFamily,te.fillStyle=j,te.translate((c+S.gw/2)*s*N,(v+S.gh/2)*s*N),P!==0&&te.rotate(-P),te.textBaseline=`middle`,te.fillText(E,S.fillTextOffsetX*N,(S.fillTextOffsetY+V*.5)*N),te.restore()}else{var X=document.createElement(`span`),oe=``;oe=`rotate(`+-P/Math.PI*180+`deg) `,S.mu!==1&&(oe+=`translateX(-`+S.fillTextWidth/4+`px) scale(`+1/S.mu+`)`);var Se={position:`absolute`,display:`block`,font:ee+` `+V*S.mu+`px `+i.fontFamily,left:(c+S.gw/2)*s+S.fillTextOffsetX+`px`,top:(v+S.gh/2)*s+S.fillTextOffsetY+`px`,width:S.fillTextWidth+`px`,height:S.fillTextHeight+`px`,lineHeight:V+`px`,whiteSpace:`nowrap`,transform:oe,webkitTransform:oe,msTransform:oe,transformOrigin:`50% 40%`,webkitTransformOrigin:`50% 40%`,msTransformOrigin:`50% 40%`};j&&(Se.color=j),X.textContent=E;for(var Pe in Se)X.style[Pe]=Se[Pe];if(U)for(var $e in U)X.setAttribute($e,U[$e]);ne&&(X.className+=ne),ve.appendChild(X)}})},$n=function(c,v,S,E,b){if(!(c>=m||v>=y||c<0||v<0)){if(C[c][v]=!1,S)r[0].getContext(`2d`).fillRect(c*s,v*s,l,l);tt&&(Ue[c][v]={item:b,dimension:E})}},Gn=function(c,v,S,E,b,B){var O=b.occupied,P=i.drawMask,U;P&&(U=r[0].getContext(`2d`),U.save(),U.fillStyle=i.maskColor);var k;if(tt){var V=b.bounds;k={x:(c+V[3])*s,y:(v+V[0])*s,w:(V[1]-V[3]+1)*s,h:(V[2]-V[0]+1)*s}}for(var j=O.length;j--;){var ee=c+O[j][0],ne=v+O[j][1];ee>=m||ne>=y||ee<0||ne<0||$n(ee,ne,P,k,B)}P&&U.restore()},Xn=function L(c,v){if(v>20)return null;var S,E,b;Array.isArray(c)?(S=c[0],E=c[1]):(S=c.word,E=c.weight,b=c.attributes);var B=jn(),O=ls(c),P=Vn(S,E,B,O);if(!P||ao())return!1;if(!i.drawOutOfBound&&!i.shrinkToFit){var U=P.bounds;if(U[1]-U[3]+1>m||U[2]-U[0]+1>y)return!1}for(var k=A+1,V=function(ve){var te=Math.floor(ve[0]-P.gw/2),N=Math.floor(ve[1]-P.gh/2),X=P.gw,oe=P.gh;return qn(te,N,X,oe,P.occupied)?(Un(te,N,P,S,E,A-k,ve[2],B,b,O),Gn(te,N,X,oe,P,c),{gx:te,gy:N,rot:B,info:P}):!1};k--;){var j=Hn(A-k);i.shuffle&&(j=[].concat(j),ms(j));for(var ee=0;ee<j.length;ee++){var ne=V(j[ee]);if(ne)return ne}}return i.shrinkToFit?(Array.isArray(c)?c[1]=c[1]*3/4:c.weight=c.weight*3/4,L(c,v+1)):null},it=function(c,v,S){if(v)return!r.some(function(E){var b=new CustomEvent(c,{cancelable:!0,detail:S||{}});return!E.dispatchEvent(b)},this);r.forEach(function(E){var b=new CustomEvent(c,{detail:S||{}});E.dispatchEvent(b)},this)},Yn=function(){var c=r[0];if(c.getContext)m=Math.ceil(c.width/s),y=Math.ceil(c.height/s);else{var v=c.getBoundingClientRect();m=Math.ceil(v.width/s),y=Math.ceil(v.height/s)}if(it(`wordcloudstart`,!0)){D=i.origin?[i.origin[0]/s,i.origin[1]/s]:[m/2,y/2],A=Math.floor(Math.sqrt(m*m+y*y)),C=[];var S,E,b;if(!c.getContext||i.clearCanvas)for(r.forEach(function(N){if(N.getContext){var X=N.getContext(`2d`);X.fillStyle=i.backgroundColor,X.clearRect(0,0,m*(s+1),y*(s+1)),X.fillRect(0,0,m*(s+1),y*(s+1))}else N.textContent=``,N.style.backgroundColor=i.backgroundColor,N.style.position=`relative`}),S=m;S--;)for(C[S]=[],E=y;E--;)C[S][E]=!0;else{var B=document.createElement(`canvas`).getContext(`2d`);B.fillStyle=i.backgroundColor,B.fillRect(0,0,1,1);var O=B.getImageData(0,0,1,1).data,P=c.getContext(`2d`).getImageData(0,0,m*s,y*s).data;S=m;for(var U,k;S--;)for(C[S]=[],E=y;E--;){k=s;e:for(;k--;)for(U=s;U--;)for(b=4;b--;)if(P[((E*s+k)*m*s+(S*s+U))*4+b]!==O[b]){C[S][E]=!1;break e}C[S][E]!==!1&&(C[S][E]=!0)}P=B=O=void 0}if(i.hover||i.click){for(tt=!0,S=m+1;S--;)Ue[S]=[];i.hover&&c.addEventListener(`mousemove`,Jo),i.click&&(c.addEventListener(`click`,ro),c.addEventListener(`touchstart`,ro),c.addEventListener(`touchend`,function(N){N.preventDefault()}),c.style.webkitTapHighlightColor=`rgba(0, 0, 0, 0)`),c.addEventListener(`wordcloudstart`,function N(){c.removeEventListener(`wordcloudstart`,N),c.removeEventListener(`mousemove`,Jo),c.removeEventListener(`click`,ro),ot=void 0})}b=0;var V,j,ee=!0;i.layoutAnimation?i.wait!==0?(V=window.setTimeout,j=window.clearTimeout):(V=window.setImmediate,j=window.clearImmediate):(V=function(N){N()},j=function(){ee=!1});var ne=function(X,oe){r.forEach(function(Se){Se.addEventListener(X,oe)},this)},ve=function(X,oe){r.forEach(function(Se){Se.removeEventListener(X,oe)},this)},te=function N(){ve(`wordcloudstart`,N),j(et[o])};ne(`wordcloudstart`,te),et[o]=(i.layoutAnimation?V:setTimeout)(function N(){if(ee){if(b>=i.list.length){j(et[o]),it(`wordcloudstop`,!1),ve(`wordcloudstart`,te),delete et[o];return}ce=new Date().getTime();var X=Xn(i.list[b],0),oe=!it(`wordclouddrawn`,!0,{item:i.list[b],drawn:X});if(ao()||oe){j(et[o]),i.abort(),it(`wordcloudabort`,!1),it(`wordcloudstop`,!1),ve(`wordcloudstart`,te);return}b++,et[o]=V(N,i.wait)}},i.wait)}};Yn()};Go.isSupported=$o;Go.minFontSize=Uo;var Xo=Go;if(!Xo.isSupported)throw new Error(`Sorry your browser not support wordCloud`);function ps(t){for(var r=t.getContext(`2d`),e=r.getImageData(0,0,t.width,t.height),o=r.createImageData(e),i=0,a=0,n=0;n<e.data.length;n+=4){var s=e.data[n+3];if(s>128){var l=e.data[n]+e.data[n+1]+e.data[n+2];i+=l,++a}}for(var u=i/a,n=0;n<e.data.length;n+=4){var l=e.data[n]+e.data[n+1]+e.data[n+2],s=e.data[n+3];s<128||l>u?(o.data[n]=0,o.data[n+1]=0,o.data[n+2]=0,o.data[n+3]=0):(o.data[n]=255,o.data[n+1]=255,o.data[n+2]=255,o.data[n+3]=255)}r.putImageData(o,0,0)}cx(function(t,r){t.eachSeriesByType(`wordCloud`,function(e){var o=_T.getLayoutRect(e.getBoxLayoutParams(),{width:r.getWidth(),height:r.getHeight()}),i=e.get(`keepAspect`),a=e.get(`maskImage`),n=a?a.width/a.height:1;i&&hs(o,n);var s=e.getData(),l=document.createElement(`canvas`);l.width=o.width,l.height=o.height;var u=l.getContext(`2d`);if(a)try{u.drawImage(a,0,0,l.width,l.height),ps(l)}catch(H){console.error(`Invalid mask image`),console.error(H.toString())}var d=e.get(`sizeRange`),W=e.get(`rotationRange`),C=s.getDataExtent(`value`),m=Math.PI/180,y=e.get(`gridSize`);Xo(l,{list:s.mapArray(`value`,function(H,G){var pe=s.getItemModel(G);return[s.getName(G),pe.get(`textStyle.fontSize`,!0)||xT.linearMap(H,C,d),G]}).sort(function(H,G){return G[1]-H[1]}),fontFamily:e.get(`textStyle.fontFamily`)||e.get(`emphasis.textStyle.fontFamily`)||t.get(`textStyle.fontFamily`),fontWeight:e.get(`textStyle.fontWeight`)||e.get(`emphasis.textStyle.fontWeight`)||t.get(`textStyle.fontWeight`),gridSize:y,ellipticity:o.height/o.width,minRotation:W[0]*m,maxRotation:W[1]*m,clearCanvas:!a,rotateRatio:1,rotationStep:e.get(`rotationStep`)*m,drawOutOfBound:e.get(`drawOutOfBound`),shrinkToFit:e.get(`shrinkToFit`),layoutAnimation:e.get(`layoutAnimation`),shuffle:!1,shape:e.get(`shape`)});function D(H){var G=H.detail.item;H.detail.drawn&&e.layoutInstance.ondraw&&(H.detail.drawn.gx+=o.x/y,H.detail.drawn.gy+=o.y/y,e.layoutInstance.ondraw(G[0],G[1],G[2],H.detail.drawn))}l.addEventListener(`wordclouddrawn`,D),e.layoutInstance&&e.layoutInstance.dispose();var A=r.__wordCloudRunningLayouts=r.__wordCloudRunningLayouts||{},ce=e.seriesIndex;A[ce]&&A[ce].dispose(),e.layoutInstance={ondraw:null,dispose:function(){l.removeEventListener(`wordclouddrawn`,D),l.addEventListener(`wordclouddrawn`,function(H){H.preventDefault()})}},A[ce]=e.layoutInstance})});Ih(function(t){var r=(t||{}).series;!wT.isArray(r)&&(r=r?[r]:[]);var e=[`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`];wT.each(r,function(i){if(i&&i.type===`wordCloud`){var a=i.textStyle||{};o(a.normal),o(a.emphasis)}});function o(i){i&&wT.each(e,function(a){i.hasOwnProperty(a)&&(i[`text`+TT.capitalFirst(a)]=i[a])})}});function hs(t,r){var e=t.width,o=t.height;e>o*r?(t.x+=(e-o*r)/2,t.width=o*r):(t.y+=(o-e/r)/2,t.height=e/r)}Lu([bO,RA,NA]);var us=150;var fs=200;var eo=class{constructor(r,e){this.chartRegistry=r,this.handlers=e,this.highlightedWords=[],this.mustRestoreHighlightAfterLayout=!1,this.hasDrawnACloud=!1,this.containerSizeObserver=new IT,this.drawnWords=Tt(null),this.containerSize=this.containerSizeObserver.size,this.drawnWordCount=this.drawnWords.asReadonly()}attachTo(r){this.chart&&this.attachedContainer===r||(this.dispose(),this.attachedContainer=r,this.chart=Wz(r),this.chart.on(`finished`,()=>{this.handlers.onLayoutFinished(),this.scheduleLayoutSettled()}),this.chart.on(`click`,e=>this.reportClickedWord(e)),this.chart.getZr().on(`click`,e=>this.reportClickBesideEveryWord(e)),this.chart.on(`contextmenu`,e=>this.reportRightClickedWord(e)),r.addEventListener(`contextmenu`,SY),this.chartRegistry.register(this.chart),this.containerSizeObserver.observe(r))}reportRightClickedWord({name:r,event:e}){let o=e?.event;!r||!o||this.handlers.onWordRightClicked(r,o.clientX,o.clientY)}highlightWords(r){this.highlightedWords=r,this.applyHighlight()}restoreTheHighlightALayoutWiped(){this.mustRestoreHighlightAfterLayout&&(this.mustRestoreHighlightAfterLayout=!1,this.applyHighlight())}applyHighlight(){this.chart&&(this.chart.dispatchAction({type:`downplay`,seriesIndex:0}),this.highlightedWords.length>0&&this.chart.dispatchAction({type:`highlight`,seriesIndex:0,name:[...this.highlightedWords]}))}reportClickedWord({name:r}){r&&this.handlers.onWordClicked(r)}reportClickBesideEveryWord({target:r}){r||this.handlers.onBackgroundClicked()}render(r,e){if(this.cancelPendingRender(),!this.hasDrawnACloud){this.draw(r,e);return}this.renderTimeout=setTimeout(()=>{this.renderTimeout=void 0,this.draw(r,e)},us)}draw(r,e){this.hasMeasurableContainer()&&(this.hasDrawnACloud=!0,this.drawnWords.set(null),this.chart?.clear(),this.chart?.resize(),this.chart?.setOption(r,!0),this.mustRestoreHighlightAfterLayout=!0,e())}cancelPendingRender(){this.renderTimeout!==void 0&&(clearTimeout(this.renderTimeout),this.renderTimeout=void 0)}hasMeasurableContainer(){return this.attachedContainer!==void 0&&this.attachedContainer.clientWidth>0&&this.attachedContainer.clientHeight>0}dispose(){this.attachedContainer?.removeEventListener(`contextmenu`,SY),this.containerSizeObserver.disconnect(),this.cancelPendingRender(),this.layoutSettleTimeout!==void 0&&clearTimeout(this.layoutSettleTimeout),this.drawnWords.set(null),this.hasDrawnACloud=!1,this.chart&&this.chartRegistry.unregister(this.chart),this.chart?.dispose(),this.chart=void 0,this.attachedContainer=void 0}scheduleLayoutSettled(){this.layoutSettleTimeout!==void 0&&clearTimeout(this.layoutSettleTimeout),this.layoutSettleTimeout=setTimeout(()=>{this.layoutSettleTimeout=void 0,this.drawnWords.set(this.countWordsWithAGraphicElement()),this.restoreTheHighlightALayoutWiped()},fs)}countWordsWithAGraphicElement(){let r=this.chart?.getModel?.()?.getSeriesByIndex(0)?.getData();if(!r)return null;let e=0;for(let o=0;o<r.count();o++)r.getItemGraphicEl(o)&&e++;return e}};function In(t,r){let e=t.slice(0,3).map(i=>i.text).join(`, `),o=t.length===1?`domain term`:`domain terms`;return`Word cloud of ${t.length} ${o} for ${r}; largest: ${e}`}function On(t,r){return t===null||t>=r?null:`${t} of ${r} words fit \u2014 enlarge the window, reduce word spacing, or enable "Fit all words" or "Draw outside bounds"`}var vs=[`wordCloudCanvas`];var Ss=(t,r)=>r.text;function Cs(t,r){if(t&1){let e=Er();rt(0,`div`,2),Wn$1(`click`,function(){Rn$1(e);return Nn$1(st().backgroundClicked.emit())}),rt(1,`p`,3),Et(2),ot(),rt(3,`button`,4),Wn$1(`click`,function(i){Rn$1(e);return Nn$1(st().showWholeMap(i))}),Et(4,`Show whole map`),ot()()}if(t&2){let e=st();ue(2),ii(`No domain words for `,e.selectedNodeName(),`. Select a folder or another file in the explorer.`)}}function ws(t,r){if(t&1&&(rt(0,`output`,8),Et(1),ot()),t&2){let e=st(2);ue(),ii(` `,e.droppedWordNotice(),` `)}}function xs(t,r){if(t&1&&(rt(0,`li`),Et(1),ot()),t&2){let e=r.$implicit;ue(),f$(``,e.text,`: `,e.frequency)}}function _s(t,r){if(t&1&&(rt(0,`figure`,5)(1,`figcaption`,6),Et(2),ot(),Ur(3,`div`,7,0),ot(),tn$1(5,ws,2,1,`output`,8),rt(6,`ol`,6),Td(7,xs,2,2,`li`,null,Ss),ot()),t&2){let e=st();ue(2),kr(e.description()),ue(3),nn$1(e.droppedWordNotice()?5:-1),ue(2),Dd(e.topWordsForScreenReaders())}}var ys=`(prefers-reduced-motion: reduce)`;function bs(t,r){return t!==null&&t.container===r.container&&t.words===r.words&&t.settings===r.settings&&t.maskImage===r.maskImage&&t.containerWidth===r.containerWidth&&t.containerHeight===r.containerHeight}var Yo=(()=>{class t{constructor(){this.wordCloudReadStore=N(pn),this.viewReadinessStore=N(wz),this.settings=Me(ai),this.selectedNodePath=Me(null),this.customShapeMask=Me(null),this.markedWords=Me([]),this.clearSelection=Gr$1(),this.backgroundClicked=Gr$1(),this.wordRightClicked=Gr$1(),this.wordClicked=Gr$1(),this.canvasRef=vi(`wordCloudCanvas`),this.chartHost=new eo(N(dH),{onLayoutFinished:()=>this.viewReadinessStore.markReady(`domain`),onWordRightClicked:(e,o,i)=>this.wordRightClicked.emit({word:e,clientX:o,clientY:i}),onWordClicked:e=>this.wordClicked.emit(e),onBackgroundClicked:()=>this.backgroundClicked.emit()}),this.words=Ri(hJe(this.selectedNodePath).pipe(di(e=>this.wordCloudReadStore.wordsForSelectedNode(e))),{initialValue:[]}),this.selectedNodeName=sn$1(()=>this.wordCloudReadStore.selectedNodeName(this.selectedNodePath())),this.renderedWords=sn$1(()=>gt(this.words(),this.settings().sizingMode,this.settings().topN)),this.droppedWordNotice=sn$1(()=>On(this.chartHost.drawnWordCount(),this.renderedWords().length)),this.topWordsForScreenReaders=sn$1(()=>this.renderedWords().slice(0,10)),this.description=sn$1(()=>In(this.renderedWords(),this.selectedNodeName())),this.prefersReducedMotion=typeof matchMedia==`function`&&matchMedia(ys).matches,this.logoMaskImage=Tt(null),this.customMaskImage=Tt(null),this.lastRenderedInputs=null,this.loadTheLogoMaskAndKeepTheCircleFallbackOnFailure(),Ls(()=>this.loadTheUploadedShapeAndKeepTheCircleFallbackOnFailure()),Ls(()=>this.renderIntoTheChartOnceTheContainerIsMeasured()),Ls(()=>this.chartHost.highlightWords(this.markedWords()))}ngOnDestroy(){this.disposeChart()}disposeChart(){this.chartHost.dispose(),this.lastRenderedInputs=null}showWholeMap(e){e.stopPropagation(),this.clearSelection.emit()}renderIntoTheChartOnceTheContainerIsMeasured(){let e=this.words(),o=this.settings(),i=this.maskImageFor(o.shape),a=this.canvasRef()?.nativeElement;if(!a){this.disposeChart(),this.viewReadinessStore.markReady(`domain`);return}this.chartHost.attachTo(a);let{width:n,height:s}=this.chartHost.containerSize();if(n===0||s===0){this.chartHost.cancelPendingRender();return}let l={container:a,words:e,settings:o,maskImage:i,containerWidth:n,containerHeight:s};if(bs(this.lastRenderedInputs,l)){this.viewReadinessStore.markReady(`domain`);return}this.chartHost.render(bn(this.renderedWords(),o,{layoutAnimation:!this.prefersReducedMotion,containerWidth:n,maskImage:i}),()=>{this.lastRenderedInputs=l})}maskImageFor(e){if(e===ja$1.logoM)return this.logoMaskImage()??void 0;if(e===ja$1.custom)return this.customMaskImage()??void 0}loadTheLogoMaskAndKeepTheCircleFallbackOnFailure(){Lo(fn).then(e=>this.logoMaskImage.set(e)).catch(()=>{})}loadTheUploadedShapeAndKeepTheCircleFallbackOnFailure(){let e=this.customShapeMask();if(e===null){this.customMaskImage.set(null);return}Lo(e).then(o=>this.customMaskImage.set(o)).catch(()=>this.customMaskImage.set(null))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-cloud`]],viewQuery:function(o,i){o&1&&ni(i.canvasRef,vs,5),o&2&&gi()},hostAttrs:[1,`relative`,`block`,`h-full`,`w-full`],inputs:{settings:[1,`settings`],selectedNodePath:[1,`selectedNodePath`],customShapeMask:[1,`customShapeMask`],markedWords:[1,`markedWords`]},outputs:{clearSelection:`clearSelection`,backgroundClicked:`backgroundClicked`,wordRightClicked:`wordRightClicked`,wordClicked:`wordClicked`},decls:2,vars:1,consts:[[`wordCloudCanvas`,``],[`data-testid`,`word-cloud-empty-state`,1,`flex`,`h-full`,`w-full`,`flex-col`,`items-center`,`justify-center`,`gap-3`,`px-6`,`text-center`],[`data-testid`,`word-cloud-empty-state`,1,`flex`,`h-full`,`w-full`,`flex-col`,`items-center`,`justify-center`,`gap-3`,`px-6`,`text-center`,3,`click`],[1,`text-sm`,`opacity-60`],[`type`,`button`,1,`btn`,`btn-sm`,`btn-primary`,3,`click`],[1,`h-full`,`w-full`],[1,`sr-only`],[1,`word-cloud-canvas`,`relative`,`h-full`,`w-full`],[`data-testid`,`word-cloud-dropped-word-notice`,1,`pointer-events-none`,`absolute`,`bottom-2`,`left-1/2`,`-translate-x-1/2`,`whitespace-nowrap`,`rounded-lg`,`bg-base-200/90`,`px-3`,`py-1`,`text-xs`,`opacity-80`]],template:function(o,i){o&1&&tn$1(0,Cs,5,1,`div`,1)(1,_s,9,2),o&2&&nn$1(i.words().length===0?0:1)},encapsulation:2})}}return t})();var to={id:`words`,label:`Words`,icon:`fa-solid fa-font`,searchPlaceholder:`payment, invoice`,searchAriaLabel:`Search words`};var Nn=[fe$1,to];var Ko=(()=>{class t{constructor(){this.store=N(wt),this.pathsWithDomainWords=Ri(this.store.select(_n$1),{requireSync:!0})}project(e){return Qn$1(e,{pathsWithDomainWords:this.pathsWithDomainWords()})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();var Ln={patternSelector:pxe,setPattern:Ev,searchedNodePathsSelector:U(MCe,pxe,(t,r)=>new Set(Uq(t,r).map(e=>e.path)))};var Ts=5;var Ms=`No domain words`;var Qo=(()=>{class t{constructor(){this.store=N(wt),this.domainSelectionStore=N(ir),this.domainBarReadStore=N(re),this.hoverTooltipService=N(dJ),this.domainWordIndex=Ri(this.store.select(ke),{requireSync:!0}),this.clearsSelectionOnCollapse=!1}isSelected(e){return this.domainSelectionStore.selectedNodePath()===e.path}isHovered(){return!1}select(e){this.domainSelectionStore.select(e.path)}deselect(){this.domainSelectionStore.clear()}hover(e,o){let i=this.domainBarReadStore.settings().sizingMode,a=this.topWords(e.path,i);this.hoverTooltipService.show({title:e.name,rows:a.length>0?a.map(n=>({label:n.text,value:`${Ewt(n,i)}`})):[{label:Ms,value:``}]},o.right,o.top)}hoverEnd(){this.hoverTooltipService.hide()}topWords(e,o){return gt(this.domainWordIndex().wordsOf(e),o,Ts)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();var Pn={options:[Jg.NAME,Jg.NUMBER_OF_FILES],optionSelector:mxe,ascendingSelector:gxe,setOption:Fv,toggleAscending:t=>Rv({value:!t})};var Es=(t,r)=>U(MCe,e=>So(J(e),t,r));var Zo=(()=>{class t{constructor(){this.store=N(wt)}rootNodeFor(e,o){return this.store.select(Es(e,o))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();var An=(()=>{class t{constructor(){this.domainSelectionStore=N(ir),this.revealService=N(ne$1),this.modeService=N(H),Lp(`domain`,e=>this.showNode(e))}showNode(e){this.modeService.activate(fe$1.id),this.domainSelectionStore.select(e),this.revealService.revealNode(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵdir=On$1({type:t,selectors:[[``,`ccShowsHandedOverNode`,``]]})}}return t})();var Fn=(()=>{class t{constructor(){this.inspected=Tt(null),this.inspectedWord=this.inspected.asReadonly()}inspect(e){this.inspected.set(e)}toggle(e){this.inspected.update(o=>o===e?null:e)}clear(){this.inspected.set(null)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var oo=(()=>{class t{constructor(){this.querySubject=new kt(``),this.pattern$=this.querySubject.asObservable(),this.isPatternEmpty$=this.pattern$.pipe(it(e=>e.trim().length===0))}setPattern(e){this.querySubject.next(e)}resetPattern(){this.setPattern(``)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();var zn={[ge.OCCURRENCES]:!1,[ge.NAME]:!0,[ge.RELEVANCE]:!1};var Ds={option:ge.OCCURRENCES,ascending:zn[ge.OCCURRENCES]};var io=(()=>{class t{constructor(){this.sortingSubject=new kt(Ds),this.options=Object.values(ge),this.sorting$=this.sortingSubject.asObservable(),this.option$=this.sorting$.pipe(it(({option:e})=>e)),this.ascending$=this.sorting$.pipe(it(({ascending:e})=>e))}setOption(e){this.sortingSubject.next({option:e,ascending:zn[e]})}toggleAscending(){let{ascending:e}=this.sortingSubject.value;this.sortingSubject.next(ne(B({},this.sortingSubject.value),{ascending:!e}))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();function Bn(t,r,e,o){let i=o&&e.trim().length>0?pt(r,e).map(({text:a})=>a):[];return t===null||i.includes(t)?i:[t,...i]}function ks(t,r){if(t&1){let e=Er();Ne(0,`span`,12),Et(1),ze(),Ne(2,`button`,13),lt(`click`,function(){Rn$1(e);return Nn$1(st().copySelectedPath())}),In$1(3,`i`,14),ze()}if(t&2){let e=st();xt(`title`,e.selectedNodePath()),ue(),ii(` `,e.selectedNodePath(),` `),ue(),xt(`title`,e.copied()?`Copied!`:`Copy path`),ue(),ri(`fa-copy`,!e.copied())(`fa-check`,e.copied())}}function Is(t,r){if(t&1&&(Ne(0,`span`,5),Et(1),ze()),t&2){let e=st();ue(),kr(e.selectedNodeName()||`No selection`)}}var cu=(()=>{class t{constructor(){this.domainBarReadStore=N(re),this.customShapeMaskStore=N(mt),this.explorerCollapseService=N(z),this.explorerModeService=N(H),this.domainSelectionStore=N(ir),this.domainWordInspectionStore=N(Fn),this.domainWordQueryStore=N(oo),this.domainWordSortStore=N(io),this.wordOccurrencesReadStore=N(He),this.hiddenWordsReadStore=N(ht),this.hiddenWordsWriteStore=N(ut),this.clipboard=N(qe$1),this.settings=this.domainBarReadStore.settings,this.customShapeMask=this.customShapeMaskStore.dataUri,this.copied=this.clipboard.copied,this.selectedNodePath=this.domainSelectionStore.selectedNodePath,this.selectedNodeName=sn$1(()=>wJe(this.selectedNodePath(),``)),this.hiddenWordCount=sn$1(()=>this.hiddenWordsReadStore.hiddenWords().length),this.hiddenWordsTooltip=sn$1(()=>this.hiddenWordCount()===0?`No word is hidden`:`${this.hiddenWordCount()} hidden from the cloud and the word list`),this.rightClickedWord=Tt(null),this.inspectedWord=this.domainWordInspectionStore.inspectedWord,this.wordQuery=Ri(this.domainWordQueryStore.pattern$,{requireSync:!0}),this.wordSorting=Ri(this.domainWordSortStore.sorting$,{requireSync:!0}),this.projectWords=Ri(this.wordOccurrencesReadStore.projectWords$,{requireSync:!0}),this.markedWords=sn$1(()=>Bn(this.inspectedWord(),this.projectWords(),this.wordQuery(),!this.explorerModeService.isFilesMode()))}showWordOccurrences(e){this.explorerModeService.activate(to.id),this.explorerCollapseService.expand(),this.domainWordInspectionStore.inspect(e)}searchForWord(e){this.explorerModeService.activate(to.id),this.explorerCollapseService.expand(),this.domainWordQueryStore.setPattern(e)}toggleInspectedWord(e){this.domainWordInspectionStore.toggle(e)}hideWord(e){this.inspectedWord()===e&&this.domainWordInspectionStore.toggle(e),this.hiddenWordsWriteStore.hide(e)}closeWordMenu(){this.rightClickedWord.set(null)}selectNode(e){this.domainSelectionStore.select(e)}clearSelection(){this.domainSelectionStore.clear()}deselect(){this.domainWordInspectionStore.clear(),this.domainSelectionStore.clear()}async copySelectedPath(){let e=this.selectedNodePath();e&&await this.clipboard.copy(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-view`]],features:[$s([Ko,{provide:Ge,useExisting:Ko},Qo,{provide:Qe,useExisting:Qo},Kn,{provide:Ye,useExisting:Kn},Zo,{provide:ze$1,useExisting:Zo},tn$2(Pn),Zi(Ln),{provide:U$1,useValue:{showRules:!1,showSearch:!0,showCounts:!1,modes:Nn}},oo,{provide:Ue,useExisting:oo},io,{provide:Ke,useExisting:io},{provide:ot$1,useValue:{showMapActions:!1,jumpTargetView:`metrics`}},qe$1,Yi(`domain`),xbe()]),yce([An])],decls:16,vars:14,consts:[[`view`,`domain`],[`headerChips`,``,1,`flex`,`items-stretch`,`border`,`border-base-300`,`mx-2`,`mt-2`,`rounded-md`,`overflow-hidden`],[`label`,`Hidden`,`popoverId`,`domain-hidden-words`,`anchorName`,`domain-hidden-words-chip`,3,`count`,`tooltip`],[`explorerPopovers`,``,`popoverId`,`domain-hidden-words`,`anchorName`,`domain-hidden-words-chip`],[`collapsedContent`,``,1,`flex`,`flex-1`,`min-w-0`,`items-center`,`gap-1`],[1,`flex-1`,`min-w-0`,`truncate`,`text-xs`,`opacity-50`],[`modeBody`,``,3,`wordToggled`,`nodeClicked`,`query`,`sorting`,`expandedWord`,`selectedNodePath`],[1,`fixed`,`inset-x-0`,`top-[var(--cc-bars-height,49px)]`,`bottom-[var(--cc-bottom-bar-height,32px)]`],[3,`clearSelection`,`backgroundClicked`,`wordClicked`,`wordRightClicked`,`settings`,`customShapeMask`,`selectedNodePath`,`markedWords`],[1,`absolute`,`right-[10px]`,`top-[10px]`,`z-10`,`flex`],[3,`searchWord`,`hideWord`,`closed`,`rightClickedWord`],[3,`showSelectedWhenNotHovered`,`selectedNodePath`],[`data-testid`,`explorer-collapsed-path`,1,`flex-1`,`min-w-0`,`truncate`,`text-xs`,`opacity-70`,3,`title`],[`type`,`button`,`data-testid`,`explorer-copy-path-button`,1,`btn`,`btn-ghost`,`btn-sm`,`btn-square`,`shrink-0`,3,`click`,`title`],[1,`fa`]],template:function(o,i){o&1&&(In$1(0,`cc-loading-file-progress-spinner`,0),Ne(1,`cc-sidebar-explorer`)(2,`div`,1),In$1(3,`cc-explorer-count-chip`,2),ze(),In$1(4,`cc-hidden-words-popover`,3),Ne(5,`div`,4),tn$1(6,ks,4,7)(7,Is,2,1,`span`,5),ze(),Ne(8,`cc-domain-word-list`,6),lt(`wordToggled`,function(n){return i.toggleInspectedWord(n)})(`nodeClicked`,function(n){return i.selectNode(n)}),ze()(),Ne(9,`div`,7)(10,`cc-word-cloud`,8),lt(`clearSelection`,function(){return i.clearSelection()})(`backgroundClicked`,function(){return i.deselect()})(`wordClicked`,function(n){return i.showWordOccurrences(n)})(`wordRightClicked`,function(n){return i.rightClickedWord.set(n)}),ze(),In$1(11,`cc-domain-toolbox`,9),ze(),In$1(12,`cc-node-context-menu`),Ne(13,`cc-domain-word-menu`,10),lt(`searchWord`,function(n){return i.searchForWord(n)})(`hideWord`,function(n){return i.hideWord(n)})(`closed`,function(){return i.closeWordMenu()}),ze(),In$1(14,`cc-bottom-bar`,11)(15,`cc-domain-bar`)),o&2&&(ue(3),xt(`count`,i.hiddenWordCount())(`tooltip`,i.hiddenWordsTooltip()),ue(3),nn$1(i.selectedNodePath()?6:7),ue(2),xt(`query`,i.wordQuery())(`sorting`,i.wordSorting())(`expandedWord`,i.inspectedWord())(`selectedNodePath`,i.selectedNodePath()),ue(2),xt(`settings`,i.settings())(`customShapeMask`,i.customShapeMask())(`selectedNodePath`,i.selectedNodePath())(`markedWords`,i.markedWords()),ue(3),xt(`rightClickedWord`,i.rightClickedWord()),ue(),xt(`showSelectedWhenNotHovered`,!0)(`selectedNodePath`,i.selectedNodePath()))},dependencies:[Qi,Yo,Ro,Do,ko,Un,Oo,No,Be,Wo,Cbe],encapsulation:2})}}return t})();export{cu as DomainViewComponent};
@@ -1 +0,0 @@
1
- import{$n as tn,$t as Uy,B as AA,Bn as nn,Bt as Rn,Ct as MU,Dt as Nbe,En as iU,Et as N,Fn as mU,H as B,It as Qx,Jn as ri$1,Kn as py,Ln as n3,Mt as POe,On as it,Ot as Ne,Pn as lt,Pt as Qa,Qn as st,Qt as Ur$1,Rn as ne,Sn as gi$1,U as BL,Un as pA,Vn as oH,Vt as Rt,Wn as pJ,Wt as Tt,X as Er$1,Xn as sn,Z as Et,an as ZT,ar as wt,ct as In,dt as J0,er as uH,gt as L,hn as bn,ht as Js,it as Gy,kt as Nn,mn as bc,mr as ze,nr as vi$1,nt as GU,ot as IL,pn as bU,qt as U,rt as Gr$1,sn as Ze,st as IU,tn as Vn,tr as ue,tt as G$1,ur as xt$1,vt as LOe,wt as Me,xt as Ls,yt as Lc,z as $s,zn as ni$1,zt as Ri$1}from"./main-TLHAY4SS.js";import{A as Qu,B as U$1,C as Lu,Et as ye,I as SY,L as T1,M as RA,N as Rv,P as SR,S as Lr$1,St as wr$1,T as P,Tt as xo,U as WL,V,W as Wz,X as ae,Z as bO,_t as tN,a as CO,b as Kn,ct as lt$1,dt as no,g as Ir$1,gt as se,h as Ii$1,it as ie,j as R$1,l as Ee,lt as m2,nt as dv,ot as ji,p as IT,pt as pT,q as Z,r as Be,rt as ge,s as Ct,st as lo,t as $e,tt as dr,u as Fp,ut as mh,v as K,w as NA,wt as xd,x as L$1,yt as w,z as Te}from"./chunk-XL5ZC9Il.js";var jr=`#1f2937`;var Xr=`#ffffff`;var Wr=.5;var Yr=.299;var Zr=.587;var Kr=.114;var Qr=255;function gr({colorValue:r,isFlat:e},t){let{mapColors:i}=t;return r===void 0?i.base:e?i.flat:t.isUnaryMetric?i.positive:pJ(i,t.colorRange,t.colorMode,t.colorMetricRange,r)}function Ft(r){let[e,t,i]=ZT.hex.rgb(r);return(Yr*e+Zr*t+Kr*i)/Qr>Wr?jr:Xr}var G=3;var ot=20;var _r=95;var Jr=5;var xr=8;var ti=`#ffffff`;var ei=1;var ri=400;var ii={duration:500,easing:`cubicOut`};var Sr=.45;var Cr=new Intl.NumberFormat(`en`,{maximumFractionDigits:2});function yr(r){return{aria:{enabled:!0},tooltip:{show:!0,confine:!0,formatter:si(r.metrics,r.isMapRoot)},series:[{type:`sunburst`,data:[Ir(r.centre,r.coloring,G,!0)],radius:[`0%`,`${_r}%`],nodeClick:!1,sort:`desc`,emphasis:{focus:`ancestor`},blur:{itemStyle:{opacity:Sr},label:{opacity:Sr}},stateAnimation:ii,itemStyle:{borderColor:ti,borderWidth:ei},label:{formatter:ai},animationDurationUpdate:ri,levels:ni(r.centre,r.chartSizeInPixels/2)}]}}function ni(r,e){let t=Math.max(1,br(r,G)),i=(_r-ot)/t,n=e*ot*2/100;return[{},{r0:`0%`,r:`${ot}%`,label:{rotate:0,fontWeight:`bold`,overflow:`truncate`,width:n-xr}},...oi(t,i,e*i/100)]}function br(r,e){return e===0||r.children.length===0?0:1+r.children.reduce((t,i)=>Math.max(t,br(i,e-1)),0)}function oi(r,e,t){return Array.from({length:r},(i,n)=>({r0:`${ot+n*e}%`,r:`${ot+(n+1)*e}%`,label:{rotate:`radial`,minAngle:Jr,overflow:`truncate`,width:t-xr}}))}function Ir(r,e,t,i){let n=gr(r,e);return{name:r.path,value:r.area,displayName:r.name,colorValue:r.colorValue,isCentre:i,isFile:r.isFile,itemStyle:{color:n},label:r.isFile?{color:Ft(n),fontWeight:`bold`}:{color:Ft(n)},children:t>0?r.children.map(o=>Ir(o,e,t-1,!1)):[]}}function ai({data:r}){return r?.displayName??``}function si(r,e){return({data:t})=>{if(!t)return``;let i=[`<b>${CO(t.name)}</b>`,`${CO(r.areaMetric)}: ${Cr.format(t.value)}`,`${CO(r.colorMetric)}: ${t.colorValue===void 0?`–`:Cr.format(t.colorValue)}`];return t.isCentre&&!e&&i.push(`<i>Click to go up one folder</i>`),i.join(`<br/>`)}}function Ht(r,e,t){if(bn(r))return null;let i=Tr(r,e,t);return i.area>0?i:null}function Tr(r,e,t){let i=r.children.filter(o=>!o.isExcluded).map(o=>bn(o)?li(o,e,t):Tr(o,e,t)).filter(o=>o.area>0),n=i.reduce((o,a)=>o+a.area,0);return ne(B({},Ar(r,e,t)),{isFile:!1,area:n,children:i})}function li(r,e,t){return ne(B({},Ar(r,e,t)),{isFile:!0,area:r.attributes?.[e.areaMetric]??0,children:[]})}function Ar(r,e,t){return{path:r.path,name:r.name,colorValue:r.attributes?.[e.colorMetric],isFlat:t(r)}}function _t(r,e){let t=r.children.find(i=>!i.isFile&&at(e,i.path));return t?_t(t,e):r}function tt(r,e,t=Number.POSITIVE_INFINITY){let i=t>0?r.children.find(n=>at(e,n.path)):void 0;return i?tt(i,e,t-1):r}function at(r,e){return r===e||r.startsWith(`${e}/`)}function xt(r,e){let t=r.children.find(i=>at(e,i.path));if(t)return t.path===e?r:xt(t,e)}function Bt(r,e,t){var i=r.get(`borderRadius`);if(i==null)return t?{cornerRadius:0}:null;L$1(i)||(i=[i,i,i,i]);var n=Math.abs(e.r||0-e.r0||0);return{cornerRadius:U$1(i,function(o){return wr$1(o,n)})}}var T=K();function ci(r){var e=r.mainData,t=r.datas;t||(t={main:e},r.datasAttr={main:`data`}),r.datas=r.mainData=null,wr(e,t,r),w(t,function(i){w(e.TRANSFERABLE_METHODS,function(n){i.wrapMethod(n,Ee(ui,r))})}),e.wrapMethod(`cloneShallow`,Ee(di,r)),w(e.CHANGABLE_METHODS,function(i){e.wrapMethod(i,Ee(hi,r))}),Be(t[e.dataType]===e)}function ui(r,e){if(mi(this)){var t=R$1({},T(this).datas);t[this.dataType]=e,wr(e,t,r)}else zt(e,this.dataType,T(this).mainData,r);return e}function hi(r,e){return r.struct&&r.struct.update(),e}function di(r,e){return w(T(e).datas,function(t,i){t!==e&&zt(t.cloneShallow(),i,e,r)}),e}function fi(r){var e=T(this).mainData;return r==null||e==null?e:T(e).datas[r]}function pi(){var r=T(this).mainData;return r==null?[{data:r}]:U$1(ie(T(r).datas),function(e){return{type:e,data:T(r).datas[e]}})}function mi(r){return T(r).mainData===r}function wr(r,e,t){T(r).datas={},w(e,function(i,n){zt(i,n,r,t)})}function zt(r,e,t,i){T(t).datas[e]=r,T(r).mainData=t,r.dataType=e,i.struct&&(r[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=r),r.getLinkedData=fi,r.getLinkedDataAll=pi}var Rr=ci;var vi=(function(){function r(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||``,this.hostTree=t}return r.prototype.isRemoved=function(){return this.dataIndex<0},r.prototype.eachNode=function(e,t,i){V(e)&&(i=t,t=e,e=null),e=e||{},P(e)&&(e={order:e});var n=e.order||`preorder`,o=this[e.attr||`children`],a;n===`preorder`&&(a=t.call(i,this));for(var s=0;!a&&s<o.length;s++)o[s].eachNode(e,t,i);n===`postorder`&&t.call(i,this)},r.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(e+1),n.height>t&&(t=n.height)}this.height=t+1},r.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t<n;t++){var o=i[t].getNodeById(e);if(o)return o}},r.prototype.contains=function(e){if(e===this)return!0;for(var t=0,i=this.children,n=i.length;t<n;t++){var o=i[t].contains(e);if(o)return o}},r.prototype.getAncestors=function(e){for(var t=[],i=e?this:this.parentNode;i;)t.push(i),i=i.parentNode;return t.reverse(),t},r.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},r.prototype.getDescendantIndices=function(){var e=[];return this.eachNode(function(t){e.push(t.dataIndex)}),e},r.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||`value`),this.dataIndex)},r.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},r.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},r.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},r.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},r})();var gi=(function(){function r(e){this.type=`tree`,this._nodes=[],this.hostModel=e}return r.prototype.eachNode=function(e,t,i){this.root.eachNode(e,t,i)},r.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},r.prototype.getNodeById=function(e){return this.root.getNodeById(e)},r.prototype.update=function(){for(var e=this.data,t=this._nodes,i=0,n=t.length;i<n;i++)t[i].dataIndex=-1;for(var i=0,n=e.count();i<n;i++)t[e.getRawIndex(i)].dataIndex=i},r.prototype.clearLayouts=function(){this.data.clearItemLayouts()},r.createTree=function(e,t,i){var n=new r(t),o=[],a=1;s(e);function s(h,m){var f=h.value;a=Math.max(a,L$1(f)?f.length:1),o.push(h);var _=new vi(Ct(h.name,``),n);m?Si(_,m):n.root=_,n._nodes.push(_);var y=h.children;if(y)for(var v=0;v<y.length;v++)s(y[v],_)}n.root.updateDepthAndHeight(0);var c=Qu(o,{coordDimensions:[`value`],dimensionsCount:a}).dimensions,d=new dv(c,t);return d.initData(o),i&&i(d),Rr({mainData:d,struct:n,structAttr:`tree`}),n.update(),n},r})();function Si(r,e){var t=e.children;r.parentNode!==e&&(t.push(r),r.parentNode=e)}var Er=gi;function Gt(r,e,t){if(r&&Z(e,r.type)>=0){var i=t.getData().tree.root,n=r.targetNode;if(P(n)&&(n=i.getNodeById(n)),n&&i.contains(n))return{node:n};var o=r.targetNodeId;if(o!=null&&(n=i.getNodeById(o)))return{node:n}}}function Ci(r){for(var e=[];r;)r=r.parentNode,r&&e.push(r);return e.reverse()}function Pr(r,e){return Z(Ci(r),e)>=0}function Mr(r,e){for(var t=[];r;){var i=r.dataIndex;t.push({name:r.name,dataIndex:i,value:e.getRawValue(i)}),r=r.parentNode}return t.reverse(),t}function $t(r){var t=r.getData().tree,i={};t.eachNode(function(n){for(var o=n;o&&o.depth>1;)o=o.parentNode;var a=Fp(r.ecModel,o.name||o.dataIndex+``,i);n.setVisual(`decal`,a)})}var _i=2;var xi=4;var qt=(function(r){se(e,r);function e(t,i,n,o){var a=r.call(this)||this;a.z2=_i,a.textConfig={inside:!0},ge(a).seriesIndex=i.seriesIndex;var s=new $e({z2:xi,silent:t.getModel().get([`label`,`silent`])});return a.setTextContent(s),a.updateData(!0,t,i,n,o),a}return e.prototype.updateData=function(t,i,n,o,a){this.node=i,i.piece=this,n=n||this._seriesModel,o=o||this._ecModel;var s=this;ge(s).dataIndex=i.dataIndex;var c=i.getModel(),d=c.getModel(`emphasis`),h=i.getLayout(),m=R$1({},h);m.label=null;var f=i.getVisual(`style`);f.lineJoin=`bevel`;var _=i.getVisual(`decal`);_&&(f.decal=mh(_,a));R$1(m,Bt(c.getModel(`itemStyle`),m,!0)),w(lo,function(l){var u=s.ensureState(l),p=c.getModel([l,`itemStyle`]);u.style=p.getItemStyle();var S=Bt(p,m);S&&(u.shape=S)}),t?(s.setShape(m),s.shape.r=h.r0,Kn(s,{shape:{r:h.r}},n,i.dataIndex)):(Ir$1(s,{shape:m},n),tN(s)),s.useStyle(f),this._updateLabel(n);var v=c.getShallow(`cursor`);v&&s.attr(`cursor`,v),this._seriesModel=n||this._seriesModel,this._ecModel=o||this._ecModel;var x=d.get(`focus`),g=x===`relative`?Rv(i.getAncestorsIndices(),i.getDescendantIndices()):x===`ancestor`?i.getAncestorsIndices():x===`descendant`?i.getDescendantIndices():x;WL(this,g,d.get(`blurScope`),d.get(`disabled`))},e.prototype._updateLabel=function(t){var i=this,n=this.node.getModel(),o=n.getModel(`label`),a=this.node.getLayout(),s=a.endAngle-a.startAngle,c=(a.startAngle+a.endAngle)/2,d=Math.cos(c),h=Math.sin(c),m=this,f=m.getTextContent(),_=this.node.dataIndex,y=o.get(`minAngle`)/180*Math.PI;f.ignore=!(o.get(`show`)&&!(y!=null&&Math.abs(s)<y)),w(T1,function(g){var l=g===`normal`?n.getModel(`label`):n.getModel([g,`label`]),u=g===`normal`,p=u?f:f.ensureState(g),S=t.getFormattedLabel(_,g);u&&(S=S||i.node.name),p.style=ji(l,{},null,g!==`normal`,!0),S&&(p.style.text=S);var E=l.get(`show`);E!=null&&!u&&(p.ignore=!E);var P=x(l,`position`),V=u?m:m.states[g],et=V.style.fill;V.textConfig={outsideFill:l.get(`color`)===`inherit`?et:null,inside:P!==`outside`};var M,$=x(l,`distance`)||0,A=x(l,`align`),O=x(l,`rotate`),rt=Math.PI*.5,b=Math.PI*1.5,N=no(O===`tangential`?Math.PI/2-c:c),D=N>rt&&!Ii$1(N-rt)&&N<b;P===`outside`?(M=a.r+$,A=D?`right`:`left`):!A||A===`center`?(a.r0===0&&Ii$1(s-2*Math.PI)?M=0:M=(a.r+a.r0)/2,A=`center`):A===`left`?(M=a.r0+$,A=D?`right`:`left`):A===`right`&&(M=a.r-$,A=D?`left`:`right`),p.style.align=A,p.style.verticalAlign=x(l,`verticalAlign`)||`middle`,p.x=M*d+a.cx,p.y=M*h+a.cy;var q=0;O===`radial`?q=no(-c)+(D?Math.PI:0):O===`tangential`?q=no(Math.PI/2-c)+(D?Math.PI:0):ae(O)&&(q=O*Math.PI/180),p.rotation=no(q)});function x(g,l){return g.get(l)??o.get(l)}f.dirtyStyle()},e})(xo);var R=`sunburst`;var bi=(function(r){se(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,i){var n={name:t.name,children:t.data};Nr(n);var o=this._levelModels=U$1(t.levels||[],function(c){return new ye(c,this,i)},this),a=Er.createTree(n,this,s);function s(c){c.wrapMethod(`getItemModel`,function(d,h){var f=o[a.getNodeByDataIndex(h).depth];return f&&(d.parentModel=f),d})}return a.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments);return i.treePathInfo=Mr(this.getData().tree.getNodeByDataIndex(t),this),i},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var i=this.getRawData().tree.root;(!t||t!==i&&!i.contains(t))&&(this._viewRoot=i)},e.prototype.enableAriaDecal=function(){$t(this)},e.type=`series.`+R,e.defaultOption={z:2,center:[`50%`,`50%`],radius:[0,`75%`],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:`rootToNode`,renderLabelForZeroData:!1,label:{rotate:`radial`,show:!0,opacity:1,align:`center`,position:`inside`,distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:`white`,borderType:`solid`,shadowBlur:0,shadowColor:`rgba(0, 0, 0, 0.2)`,shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:`descendant`},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:`expansion`,animationDuration:1e3,animationDurationUpdate:500,data:[],sort:`desc`},e})(Lr$1);function Nr(r){var e=0;w(r.children,function(i){Nr(i);var n=i.value;L$1(n)&&(n=n[0]),e+=n});var t=r.value;L$1(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),L$1(r.value)?r.value[0]=t:r.value=t}var Dr=bi;var yt=`sunburstRootToNode`;var Lr=`sunburstHighlight`;var Ii=`sunburstUnhighlight`;function kr(r){r.registerAction({type:yt,update:`updateView`},function(e,t){t.eachComponent({mainType:`series`,subType:`sunburst`,query:e},i);function i(n,o){var a=Gt(e,[yt],n);if(a){var s=n.getViewRoot();s&&(e.direction=Pr(s,a.node)?`rollUp`:`drillDown`),n.resetViewRoot(a.node)}}}),r.registerAction({type:Lr,update:`none`},function(e,t,i){e=R$1({},e),t.eachComponent({mainType:`series`,subType:`sunburst`,query:e},n);function n(o){var a=Gt(e,[Lr],o);a&&(e.dataIndex=a.node.dataIndex)}i.dispatchAction(R$1(e,{type:`highlight`}))}),r.registerAction({type:Ii,update:`updateView`},function(e,t,i){e=R$1({},e),i.dispatchAction(R$1(e,{type:`downplay`}))})}var Ur=(function(r){se(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=R,t}return e.prototype.render=function(t,i,n,o){var a=this;this.seriesModel=t,this.api=n,this.ecModel=i;var s=t.getData(),c=s.tree.root,d=t.getViewRoot(),h=this.group,m=t.get(`renderLabelForZeroData`),f=[];d.eachNode(function(l){f.push(l)});y(f,this._oldChildren||[]),g(c,d),this._initEvents(),this._oldChildren=f;function y(l,u){if(l.length===0&&u.length===0)return;new pT(u,l,p,p).add(S).update(S).remove(Ee(S,null)).execute();function p(E){return E.getId()}function S(E,P){v(E==null?null:l[E],P==null?null:u[P])}}function v(l,u){if(!m&&l&&!l.getValue()&&(l=null),l!==c&&u!==c){if(u&&u.piece)l?(u.piece.updateData(!1,l,t,i,n),s.setItemGraphicEl(l.dataIndex,u.piece)):x(u);else if(l){var p=new qt(l,t,i,n);h.add(p),s.setItemGraphicEl(l.dataIndex,p)}}}function x(l){l&&l.piece&&(h.remove(l.piece),l.piece=null)}function g(l,u){u.depth>0?(a.virtualPiece?a.virtualPiece.updateData(!1,l,t,i,n):(a.virtualPiece=new qt(l,t,i,n),h.add(a.virtualPiece)),u.piece.off(`click`),a.virtualPiece.on(`click`,function(p){a._rootToNode(u.parentNode)})):a.virtualPiece&&(h.remove(a.virtualPiece),a.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off(`click`),this.group.on(`click`,function(i){var n=!1;t.seriesModel.getViewRoot().eachNode(function(a){if(!n&&a.piece&&a.piece===i.target){var s=a.getModel().get(`nodeClick`);if(s===`rootToNode`)t._rootToNode(a);else if(s===`link`){var c=a.getModel(),d=c.get(`link`);if(d)m2(d,c.get(`target`,!0)||`_blank`)}n=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:yt,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,i){var o=i.getData().getItemLayout(0);if(o){var a=t[0]-o.cx,s=t[1]-o.cy,c=Math.sqrt(a*a+s*s);return c<=o.r&&c>=o.r0}},e.type=R,e})(dr);var Vr=SR(R,Ai);function Ai(r){var e={};function t(i,n,o){if(i.depth===0)return Te.color.neutral50;for(var a=i;a&&a.depth>1;)a=a.parentNode;var s=n.getColorFromPalette(a.name||a.dataIndex+``,e);return i.depth>1&&P(s)&&(s=xd(s,(i.depth-1)/(o-1)*.5)),s}r.eachSeriesByType(R,function(i){var n=i.getData(),o=n.tree;o.eachNode(function(a){var c=a.getModel().getModel(`itemStyle`).getItemStyle();c.fill||(c.fill=t(a,i,o.root.height));R$1(n.ensureUniqueItemVisual(a.dataIndex,`style`),c)})})}var Or=Math.PI/180;var Fr=SR(R,wi);function wi(r,e){r.eachSeriesByType(R,function(t){var i=t.get(`center`),n=t.get(`radius`);L$1(n)||(n=[0,n]),L$1(i)||(i=[i,i]);var o=e.getWidth(),a=e.getHeight(),s=Math.min(o,a),c=lt$1(i[0],o),d=lt$1(i[1],a),h=lt$1(n[0],s/2),m=lt$1(n[1],s/2),f=-t.get(`startAngle`)*Or,_=t.get(`minAngle`)*Or,y=t.getData().tree.root,v=t.getViewRoot(),x=v.depth,g=t.get(`sort`);g!=null&&Hr(v,g);var l=0;w(v.children,function(b){!isNaN(b.getValue())&&l++});var u=v.getValue(),p=Math.PI/(u||l)*2,S=v.depth>0,E=v.height-(S?-1:1),P=(m-h)/(E||1),V=t.get(`clockwise`),et=t.get(`stillShowZeroSum`),M=V?1:-1,$=function(b,N){if(b){var D=N;if(b!==y){var q=b.getValue(),lt=u===0&&et?p:q*p;lt<_&&(lt=_),D=N+M*lt;var Zt=b.depth-x-(S?-1:1),Kt=h+P*Zt,Qt=h+P*(Zt+1),ct=t.getLevelModel(b);if(ct){var It=ct.get(`r0`,!0),Tt=ct.get(`r`,!0),At=ct.get(`radius`,!0);At!=null&&(It=At[0],Tt=At[1]),It!=null&&(Kt=lt$1(It,s/2)),Tt!=null&&(Qt=lt$1(Tt,s/2))}b.setLayout({angle:lt,startAngle:N,endAngle:D,clockwise:V,cx:c,cy:d,r0:Kt,r:Qt})}if(b.children&&b.children.length){var Jt=0;w(b.children,function(qr){Jt+=$(qr,N+Jt)})}return D-N}};if(S){var A=h,O=h+P,rt=Math.PI*2;y.setLayout({angle:rt,startAngle:f,endAngle:f+rt,clockwise:V,cx:c,cy:d,r0:A,r:O})}$(v,f)})}function Hr(r,e){var t=r.children||[];r.children=Ri(t,e),t.length&&w(r.children,function(i){Hr(i,e)})}function Ri(r,e){if(V(e)){var t=U$1(r,function(n,o){var a=n.getValue();return{params:{depth:n.depth,height:n.height,dataIndex:n.dataIndex,getValue:function(){return a}},index:o}});return t.sort(function(n,o){return e(n.params,o.params)}),U$1(t,function(n){return r[n.index]})}else{var i=e===`asc`;return r.sort(function(n,o){var a=(n.getValue()-o.getValue())*(i?1:-1);return a===0?(n.dataIndex-o.dataIndex)*(i?-1:1):a})}}function jt(r){r.registerChartView(Ur),r.registerSeriesModel(Dr),r.registerLayout(Fr),r.registerVisual(Vr),kr(r)}Lu([jt,bO,RA,NA]);var Ei=120;var bt=class{constructor(e,t){this.chartRegistry=e,this.handlers=t,this.highlightedPath=null,this.pathUnderPointer=null,this.containerSizeObserver=new IT,this.containerSize=this.containerSizeObserver.size}attachTo(e){this.chart&&this.attachedContainer===e||(this.dispose(),this.attachedContainer=e,this.chart=Wz(e),this.chart.on(`click`,t=>this.reportClick(t)),this.chart.on(`mouseover`,t=>this.reportPointerEntered(t.data?.name??null)),this.chart.on(`mouseout`,()=>this.reportPointerLeftAfterGrace()),this.chart.on(`contextmenu`,t=>this.reportRightClick(t)),this.chart.on(`finished`,()=>e.setAttribute(`aria-busy`,`false`)),e.addEventListener(`contextmenu`,SY),this.chartRegistry.register(this.chart),this.containerSizeObserver.observe(e))}render(e){this.chart&&(this.attachedContainer?.setAttribute(`aria-busy`,`true`),this.chart.resize(),this.chart.setOption(e),this.reportPointerLeft(),this.applyHighlight())}highlight(e){this.highlightedPath=e,!(e!==null&&e===this.pathUnderPointer)&&this.applyHighlight()}dispose(){this.cancelPointerLeave(),this.reportPointerLeft(),this.attachedContainer?.removeEventListener(`contextmenu`,SY),this.containerSizeObserver.disconnect(),this.chart&&(this.chartRegistry.unregister(this.chart),this.chart.dispose()),this.chart=void 0,this.attachedContainer=void 0}reportClick({data:e}){e&&(e.isCentre?this.handlers.onCentreClicked():e.isFile?this.handlers.onFileClicked(e.name):this.handlers.onFolderClicked(e.name))}reportPointerEntered(e){this.cancelPointerLeave(),this.pathUnderPointer=e,this.handlers.onNodeHovered(e)}reportPointerLeftAfterGrace(){this.cancelPointerLeave(),this.pointerLeaveTimeout=setTimeout(()=>{this.pointerLeaveTimeout=void 0,this.reportPointerLeft()},Ei)}reportPointerLeft(){this.pathUnderPointer!==null&&(this.pathUnderPointer=null,this.handlers.onNodeHovered(null))}cancelPointerLeave(){this.pointerLeaveTimeout!==void 0&&(clearTimeout(this.pointerLeaveTimeout),this.pointerLeaveTimeout=void 0)}reportRightClick({data:e,event:t}){let i=t?.event;e&&i&&this.handlers.onNodeRightClicked(e.name,i.clientX,i.clientY)}applyHighlight(){this.chart&&(this.chart.dispatchAction({type:`downplay`,seriesIndex:0}),this.highlightedPath!==null&&this.chart.dispatchAction({type:`highlight`,seriesIndex:0,name:this.highlightedPath}))}};var Pi=[`chartContainer`];var Wt=(()=>{class r{constructor(){this.tree=Me.required(),this.centre=Me.required(),this.hoveredPath=Me(null),this.metrics=Me.required(),this.coloring=Me.required(),this.folderClicked=Gr$1(),this.fileClicked=Gr$1(),this.centreClicked=Gr$1(),this.nodeHovered=Gr$1(),this.nodeRightClicked=Gr$1(),this.chartContainer=vi$1.required(`chartContainer`),this.chartHost=new bt(N(uH),{onFolderClicked:t=>this.folderClicked.emit(t),onFileClicked:t=>this.fileClicked.emit(t),onCentreClicked:()=>this.centreClicked.emit(),onNodeHovered:t=>this.nodeHovered.emit(t),onNodeRightClicked:(t,i,n)=>this.nodeRightClicked.emit({path:t,clientX:i,clientY:n})}),this.highlightedPath=sn(()=>{let t=this.hoveredPath(),i=this.centre();if(t===null||!at(t,i.path))return null;let n=tt(i,t,G);return n===i?null:n.path}),Ls(()=>this.chartHost.attachTo(this.chartContainer().nativeElement)),Ls(()=>this.renderOnceTheContainerIsMeasured()),Ls(()=>this.chartHost.highlight(this.highlightedPath()))}ngOnDestroy(){this.chartHost.dispose()}renderOnceTheContainerIsMeasured(){let{width:t,height:i}=this.chartHost.containerSize();t===0||i===0||this.chartHost.render(yr({centre:this.centre(),isMapRoot:this.centre()===this.tree(),metrics:this.metrics(),coloring:this.coloring(),chartSizeInPixels:Math.min(t,i)}))}static{this.ɵfac=function(i){return new(i||r)}}static{this.ɵcmp=Ze({type:r,selectors:[[`cc-sunburst`]],viewQuery:function(i,n){i&1&&ni$1(n.chartContainer,Pi,5),i&2&&gi$1()},hostAttrs:[1,`block`,`h-full`,`w-full`],inputs:{tree:[1,`tree`],centre:[1,`centre`],hoveredPath:[1,`hoveredPath`],metrics:[1,`metrics`],coloring:[1,`coloring`]},outputs:{folderClicked:`folderClicked`,fileClicked:`fileClicked`,centreClicked:`centreClicked`,nodeHovered:`nodeHovered`,nodeRightClicked:`nodeRightClicked`},decls:2,vars:0,consts:[[`chartContainer`,``],[`data-testid`,`sunburst-chart`,1,`h-full`,`w-full`]],template:function(i,n){i&1&&Ur$1(0,`div`,1,0)},encapsulation:2})}}return r})();var Yt=U(Uy,pA,(r,e)=>({areaMetric:r,colorMetric:e}));var Br=U(Js,Lc,iU,Yt,GU,({unifiedMapNode:r},e,t,i,n)=>{let o=t&&e.get(t)||r;return o?Ht(o,i,n):null});var zr=U(pA,IU,MU,Gy,Qa,(r,e,t,i,n)=>({isUnaryMetric:r===bc,colorRange:e,colorMode:t,mapColors:i,colorMetricRange:n}));var Gr=(()=>{class r{constructor(t){this.store=t,this.tree$=this.store.select(Br),this.metrics$=this.store.select(Yt),this.coloring$=this.store.select(zr),this.hoveredNodePath$=this.store.select(py),this.selectedNodePath$=this.store.select(AA),this.isDeltaState$=this.store.select(IL),this.isFocused$=this.store.select(iU).pipe(it(Boolean))}static{this.ɵfac=function(i){return new(i||r)(L(wt))}}static{this.ɵprov=G$1({token:r,factory:r.ɵfac,providedIn:`root`})}}return r})();var $r=(()=>{class r{constructor(t,i){this.store=t,this.nodeInteraction=i}selectNode(t){this.nodeInteraction.selectNode(t)}hoverNode(t){this.nodeInteraction.hoverNode(t)}openContextMenu(t,i,n){this.store.dispatch(bU({value:{nodeId:t,xPositionOfRightClickEvent:i,yPositionOfRightClickEvent:n,origin:`sunburst`}}))}unfocus(){this.store.dispatch(mU())}static{this.ɵfac=function(i){return new(i||r)(L(wt),L(n3))}}static{this.ɵprov=G$1({token:r,factory:r.ɵfac,providedIn:`root`})}}return r})();function ki(r,e){r&1&&(Ne(0,`div`,0)(1,`output`,1)(2,`span`),Et(3,`The sunburst shows a single map. Switch to another map layout to compare two maps.`),ze()()())}function Ui(r,e){if(r&1){let t=Er$1();Ne(0,`cc-sunburst`,2),lt(`folderClicked`,function(n){Rn(t);return Nn(st().selectFolder(n))})(`centreClicked`,function(){Rn(t);return Nn(st().goUp())})(`fileClicked`,function(n){Rn(t);return Nn(st().selectFile(n))})(`nodeHovered`,function(n){Rn(t);return Nn(st().hover(n))})(`nodeRightClicked`,function(n){Rn(t);return Nn(st().openContextMenu(n))}),ze(),Ne(1,`div`,3),In(2,`cc-toolbox-screenshot-button`,4),ze()}if(r&2){let t=e,i=st();xt$1(`tree`,t.tree)(`centre`,t.centre)(`hoveredPath`,i.hoveredPath())(`metrics`,i.metrics())(`coloring`,i.coloring())}}function Vi(r,e){if(r&1){let t=Er$1();Ne(0,`button`,6),lt(`click`,function(){Rn(t);return Nn(st(2).unfocus())}),Et(1,`Unfocus`),ze()}}function Oi(r,e){if(r&1&&(Ne(0,`div`,0)(1,`output`,1)(2,`span`),Et(3,`There are no files with an area to show.`),ze(),tn(4,Vi,2,0,`button`,5),ze()()),r&2){let t=st();ue(4),nn(t.isFocused()?4:-1)}}var Fi=`calc(${[`var(${Qx}, 32px)`,`var(${BL}, 17px)`,`var(${Nbe}, 0px)`,`12px`].join(` + `)})`;var Hi=(()=>{class r{constructor(){this.bottomInset=Fi,this.readStore=N(Gr),this.writeStore=N($r),this.tree=Ri$1(this.readStore.tree$,{requireSync:!0}),this.metrics=Ri$1(this.readStore.metrics$,{requireSync:!0}),this.coloring=Ri$1(this.readStore.coloring$,{requireSync:!0}),this.hoveredPath=Ri$1(this.readStore.hoveredNodePath$,{requireSync:!0}),this.isDeltaState=Ri$1(this.readStore.isDeltaState$,{requireSync:!0}),this.isFocused=Ri$1(this.readStore.isFocused$,{requireSync:!0}),this.isLoadingFile=Ri$1(N(J0).isLoadingFile$,{initialValue:!1}),this.selectedPath=Ri$1(this.readStore.selectedNodePath$,{requireSync:!0}),this.requestedCentrePath=Tt(null),this.view=sn(()=>{let t=this.tree();if(!t)return null;let i=this.requestedCentrePath();return{tree:t,centre:i===null?t:_t(t,i)}}),Ls(()=>this.centreOnTheSelection())}selectFolder(t){this.writeStore.selectNode(t)}goUp(){let t=this.view(),i=t&&xt(t.tree,t.centre.path);i&&this.selectFolder(i.path)}selectFile(t){this.writeStore.selectNode(t)}openContextMenu({path:t,clientX:i,clientY:n}){this.writeStore.openContextMenu(t,i,n)}unfocus(){this.writeStore.unfocus()}hover(t){this.writeStore.hoverNode(t)}centreOnTheSelection(){let t=this.selectedPath();Rt(()=>{t!==null&&!this.isFileShownAroundTheCentre(t)&&this.requestedCentrePath.set(t)})}isFileShownAroundTheCentre(t){let i=this.view();if(!i)return!1;let n=tt(i.centre,t,G);return n.isFile&&n.path===t}static{this.ɵfac=function(i){return new(i||r)}}static{this.ɵcmp=Ze({type:r,selectors:[[`cc-sunburst-map`]],hostAttrs:[1,`fixed`,`inset-x-0`,`z-0`,`top-[var(--cc-bars-height,49px)]`],hostVars:4,hostBindings:function(i,n){i&2&&(Vn(`bottom`,n.bottomInset),ri$1(`hidden`,n.isLoadingFile()))},features:[$s([{provide:oH,useExisting:LOe}])],decls:3,vars:1,consts:[[1,`flex`,`h-full`,`items-center`,`justify-center`,`p-4`],[1,`alert`,`max-w-md`],[3,`folderClicked`,`centreClicked`,`fileClicked`,`nodeHovered`,`nodeRightClicked`,`tree`,`centre`,`hoveredPath`,`metrics`,`coloring`],[1,`join`,`absolute`,`right-[10px]`,`top-[10px]`,`rounded`,`bg-base-100`,`shadow-md`],[`view`,`metrics`],[`type`,`button`,1,`btn`,`btn-sm`],[`type`,`button`,1,`btn`,`btn-sm`,3,`click`]],template:function(i,n){if(i&1&&tn(0,ki,4,0,`div`,0)(1,Ui,3,5)(2,Oi,5,1,`div`,0),i&2){let o;nn(n.isDeltaState()?0:(o=n.view())?1:2,o)}},dependencies:[Wt,POe],encapsulation:2})}}return r})();export{Hi as SunburstMapComponent};