@carbon/charts 1.23.13 → 1.23.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { h as e, k as r, X as o, A as t, a8 as i, F as l, B as n, o as d, p as h, C as p, f as u, e as S, r as C, s as c, q as g, a9 as B, D as m, z as T, a7 as L, G as b, v as k, E as A, H as x, I as P, Y as R, b as w, L as G, j as H, K as v, O as M, N as f, M as D, P as Z, Q as j, R as q, l as y, w as z, m as E, J as W, S as F, x as I, t as J, u as K, y as N, g as O, T as Q, a as U, d as V, U as X, V as Y, i as _, W as $, n as aa, Z as sa, _ as ea, $ as ra, a0 as oa, a1 as ta, a2 as ia, a3 as la, a4 as na, a5 as da, a6 as ha } from "../choropleth-CnQNALge.mjs";
1
+ import { h as e, k as r, X as o, A as t, a8 as i, F as l, B as n, o as d, p as h, C as p, f as u, e as S, r as C, s as c, q as g, a9 as B, D as m, z as T, a7 as L, G as b, v as k, E as A, H as x, I as P, Y as R, b as w, L as G, j as H, K as v, O as M, N as f, M as D, P as Z, Q as j, R as q, l as y, w as z, m as E, J as W, S as F, x as I, t as J, u as K, y as N, g as O, T as Q, a as U, d as V, U as X, V as Y, i as _, W as $, n as aa, Z as sa, _ as ea, $ as ra, a0 as oa, a1 as ta, a2 as ia, a3 as la, a4 as na, a5 as da, a6 as ha } from "../choropleth-PBjldW-E.mjs";
2
2
  export {
3
3
  e as Alluvial,
4
4
  r as Area,
package/dist/index.mjs CHANGED
@@ -4,8 +4,8 @@ import { i as ho } from "./index-DwV8lNnO.mjs";
4
4
  import { ChartModel as Re, ChartModelCartesian as Te, AlluvialChartModel as be, BoxplotChartModel as Oe, BulletChartModel as Se, ChoroplethModel as fe, CirclePackChartModel as Ae, PieChartModel as xe, GaugeChartModel as ye, HeatmapModel as De, ChartModelBinned as Le, MeterChartModel as Fe, RadarChartModel as Pe, TreeChartModel as Me, TreemapChartModel as ke, WordCloudModel as Be } from "./model/index.mjs";
5
5
  import { $ as j, r as i, L as Z, q as h, y as A, t as N, e as $, S as Ie, u as K, F as p, l as R } from "./axis-scales-CPuwbFQf.mjs";
6
6
  import { A as mo, a as lo, b as po, c as Co, d as uo, f as vo, B as go, g as wo, C as Eo, h as Ro, i as To, j as bo, k as Oo, m as So, n as fo, D as Ao, o as xo, G as yo, p as Do, s as Lo, v as Fo, M as Po, w as Mo, P as ko, x as Bo, R as Io, z as Ho, H as Go, T as Vo, I as No, J as Uo, K as Zo, N as _o, O as zo, Q as Wo, U as jo, V as $o, W as Ko, X as Jo, Z as qo, Y as Xo, _ as Qo } from "./axis-scales-CPuwbFQf.mjs";
7
- import { c as He, L as ee, C as Ge, T as _, a as z, b as g, S as L, d as se, M as W, e as Ve, f as Ne, g as Ue, H as Ze, Z as _e, A as te, h as ze, i as d, G as w, R as B, j as k, k as oe, l as M, m as C, B as We, n as I, o as je, p as $e, q as ne, r as Ke, s as Je, t as ie, u as U, v as re, w as ae, x as he, y as ce, P as qe, D as Xe, z as Qe, E as Ye, F as es, I as ss, J as ts, K as os, N as ns, O as is, Q as rs, U as as, V as hs, W as cs } from "./choropleth-CnQNALge.mjs";
8
- import { X as en, a8 as sn, a9 as tn, a7 as on, Y as nn, _ as rn, $ as an, a0 as hn, a1 as cn, a2 as mn, a3 as ln, a4 as pn, a5 as dn, a6 as Cn } from "./choropleth-CnQNALge.mjs";
7
+ import { c as He, L as ee, C as Ge, T as _, a as z, b as g, S as L, d as se, M as W, e as Ve, f as Ne, g as Ue, H as Ze, Z as _e, A as te, h as ze, i as d, G as w, R as B, j as k, k as oe, l as M, m as C, B as We, n as I, o as je, p as $e, q as ne, r as Ke, s as Je, t as ie, u as U, v as re, w as ae, x as he, y as ce, P as qe, D as Xe, z as Qe, E as Ye, F as es, I as ss, J as ts, K as os, N as ns, O as is, Q as rs, U as as, V as hs, W as cs } from "./choropleth-PBjldW-E.mjs";
8
+ import { X as en, a8 as sn, a9 as tn, a7 as on, Y as nn, _ as rn, $ as an, a0 as hn, a1 as cn, a2 as mn, a3 as ln, a4 as pn, a5 as dn, a6 as Cn } from "./choropleth-PBjldW-E.mjs";
9
9
  import { b as ms, T as ls, F as ps, E as ds, C as Cs, Z as us, a as vs, c as gs, f as ws } from "./index-Ciju2yyn.mjs";
10
10
  import { G as Es, D as Rs } from "./angle-utils-Re7uVv7K.mjs";
11
11
  import { S as vn, d as gn, a as wn, p as En, b as Rn, r as Tn } from "./angle-utils-Re7uVv7K.mjs";
@@ -3,12 +3,13 @@
3
3
  `)}async function AI(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await CI(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function DI(e,t={}){const{width:n,height:r}=cm(e,t),i=await no(e,t,!0);return await AI(i,t),await vm(i,t),TI(i,t),await XR(i,n,r)}async function Sm(e,t={}){const{width:n,height:r}=cm(e,t),i=await DI(e,t),s=await eo(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||WR(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||YR(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function LI(e,t={}){return(await Sm(e,t)).toDataURL()}async function RI(e,t={}){return(await Sm(e,t)).toDataURL("image/jpeg",t.quality||1)}class An{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const II="DONT_STYLE_ME_css_styles_verifier";class k extends An{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=I(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(f=>{if(h[f]){const p=h[f],g=parseFloat(p);p&&g>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=I(this.getHolder()).append("div").classed(`${fe}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",II),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),I(this.getHolder()).classed(`${fe}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),RI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),LI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=k.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(k.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Wa(()=>{var a;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(a=this.services.events)==null||a.dispatchEvent(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}class mt{constructor(t,n,r){if(this.type="",this.renderType=at.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=y(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(I(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var r;const n=this.parent;if(this.parent=t,!(n&&n.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");(r=this.parent)==null||r.classed(`${fe}--${i}--${this.type}`,!0),n&&n.classed(`${fe}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=k.appendOrSelect(this.parent,`${this.renderType===at.SVG?"svg":"div"}${r}.${fe}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=I(`#${s}`).select("rect");if(o.size()!==0){const l=parseFloat(o.attr("height")),c=parseFloat(o.attr("width"));!isNaN(l)&&!isNaN(c)&&l>0&&c>0&&i.attr("clip-path",`url(#${s})`)}}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ct({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:_m,setPrototypeOf:Tm,isFrozen:kI,getPrototypeOf:PI,getOwnPropertyDescriptor:NI}=Object;let{freeze:ae,seal:Pe,create:Om}=Object,{apply:ou,construct:lu}=typeof Reflect<"u"&&Reflect;ae||(ae=function(t){return t}),Pe||(Pe=function(t){return t}),ou||(ou=function(t,n,r){return t.apply(n,r)}),lu||(lu=function(t,n){return new t(...n)});const io=le(Array.prototype.forEach),$I=le(Array.prototype.lastIndexOf),wm=le(Array.prototype.pop),fs=le(Array.prototype.push),FI=le(Array.prototype.splice),so=le(String.prototype.toLowerCase),cu=le(String.prototype.toString),Mm=le(String.prototype.match),ps=le(String.prototype.replace),UI=le(String.prototype.indexOf),BI=le(String.prototype.trim),Xe=le(Object.prototype.hasOwnProperty),oe=le(RegExp.prototype.test),gs=HI(TypeError);function le(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return ou(e,t,r)}}function HI(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return lu(e,n)}}function vt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:so;Tm&&Tm(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(kI(t)||(t[r]=s),i=s)}e[i]=!0}return e}function GI(e){for(let t=0;t<e.length;t++)Xe(e,t)||(e[t]=null);return e}function Dn(e){const t=Om(null);for(const[n,r]of _m(e))Xe(e,n)&&(Array.isArray(r)?t[n]=GI(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Dn(r):t[n]=r);return t}function ms(e,t){for(;e!==null;){const r=NI(e,t);if(r){if(r.get)return le(r.get);if(typeof r.value=="function")return le(r.value)}e=PI(e)}function n(){return null}return n}const Cm=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uu=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hu=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),VI=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),du=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),zI=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Am=ae(["#text"]),Dm=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),fu=ae(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Lm=ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ao=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),WI=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),YI=Pe(/<%[\w\W]*|[\w\W]*%>/gm),qI=Pe(/\$\{[\w\W]*/gm),XI=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),ZI=Pe(/^aria-[\-\w]+$/),Rm=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jI=Pe(/^(?:\w+script|data):/i),KI=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Im=Pe(/^html$/i),QI=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var km=Object.freeze({__proto__:null,ARIA_ATTR:ZI,ATTR_WHITESPACE:KI,CUSTOM_ELEMENT:QI,DATA_ATTR:XI,DOCTYPE_NAME:Im,ERB_EXPR:YI,IS_ALLOWED_URI:Rm,IS_SCRIPT_OR_DATA:jI,MUSTACHE_EXPR:WI,TMPLIT_EXPR:qI});const vs={element:1,text:3,progressingInstruction:7,comment:8,document:9},JI=function(){return typeof window>"u"?null:window},tk=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Pm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Nm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:JI();const t=ot=>Nm(ot);if(t.version="3.2.6",t.removed=[],!e||!e.document||e.document.nodeType!==vs.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,g=ms(p,"cloneNode"),m=ms(p,"remove"),v=ms(p,"nextSibling"),x=ms(p,"childNodes"),E=ms(p,"parentNode");if(typeof a=="function"){const ot=n.createElement("template");ot.content&&ot.content.ownerDocument&&(n=ot.content.ownerDocument)}let b,S="";const{implementation:_,createNodeIterator:C,createDocumentFragment:D,getElementsByTagName:B}=n,{importNode:P}=r;let w=Pm();t.isSupported=typeof _m=="function"&&typeof E=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:N,TMPLIT_EXPR:M,DATA_ATTR:O,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:F,ATTR_WHITESPACE:L,CUSTOM_ELEMENT:U}=km;let{IS_ALLOWED_URI:tt}=km,X=null;const Y=vt({},[...Cm,...uu,...hu,...du,...Am]);let Q=null;const ut=vt({},[...Dm,...fu,...Lm,...ao]);let et=Object.seal(Om(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),K=null,nt=null,ht=!0,W=!0,j=!1,J=!0,A=!1,G=!0,V=!1,xt=!1,Ut=!1,st=!1,_t=!1,Ne=!1,Oe=!0,Ss=!1;const _s="user-content-";let mr=!0,je=!1,ii={},si=null;const Dv=vt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Lv=null;const Rv=vt({},["audio","video","img","source","image","track"]);let Du=null;const Iv=vt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vo="http://www.w3.org/1998/Math/MathML",yo="http://www.w3.org/2000/svg",Rn="http://www.w3.org/1999/xhtml";let ai=Rn,Lu=!1,Ru=null;const Y$=vt({},[vo,yo,Rn],cu);let Eo=vt({},["mi","mo","mn","ms","mtext"]),xo=vt({},["annotation-xml"]);const q$=vt({},["title","style","font","a","script"]);let Ts=null;const X$=["application/xhtml+xml","text/html"],Z$="text/html";let Xt=null,oi=null;const j$=n.createElement("form"),kv=function(R){return R instanceof RegExp||R instanceof Function},Iu=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(oi&&oi===R)){if((!R||typeof R!="object")&&(R={}),R=Dn(R),Ts=X$.indexOf(R.PARSER_MEDIA_TYPE)===-1?Z$:R.PARSER_MEDIA_TYPE,Xt=Ts==="application/xhtml+xml"?cu:so,X=Xe(R,"ALLOWED_TAGS")?vt({},R.ALLOWED_TAGS,Xt):Y,Q=Xe(R,"ALLOWED_ATTR")?vt({},R.ALLOWED_ATTR,Xt):ut,Ru=Xe(R,"ALLOWED_NAMESPACES")?vt({},R.ALLOWED_NAMESPACES,cu):Y$,Du=Xe(R,"ADD_URI_SAFE_ATTR")?vt(Dn(Iv),R.ADD_URI_SAFE_ATTR,Xt):Iv,Lv=Xe(R,"ADD_DATA_URI_TAGS")?vt(Dn(Rv),R.ADD_DATA_URI_TAGS,Xt):Rv,si=Xe(R,"FORBID_CONTENTS")?vt({},R.FORBID_CONTENTS,Xt):Dv,K=Xe(R,"FORBID_TAGS")?vt({},R.FORBID_TAGS,Xt):Dn({}),nt=Xe(R,"FORBID_ATTR")?vt({},R.FORBID_ATTR,Xt):Dn({}),ii=Xe(R,"USE_PROFILES")?R.USE_PROFILES:!1,ht=R.ALLOW_ARIA_ATTR!==!1,W=R.ALLOW_DATA_ATTR!==!1,j=R.ALLOW_UNKNOWN_PROTOCOLS||!1,J=R.ALLOW_SELF_CLOSE_IN_ATTR!==!1,A=R.SAFE_FOR_TEMPLATES||!1,G=R.SAFE_FOR_XML!==!1,V=R.WHOLE_DOCUMENT||!1,st=R.RETURN_DOM||!1,_t=R.RETURN_DOM_FRAGMENT||!1,Ne=R.RETURN_TRUSTED_TYPE||!1,Ut=R.FORCE_BODY||!1,Oe=R.SANITIZE_DOM!==!1,Ss=R.SANITIZE_NAMED_PROPS||!1,mr=R.KEEP_CONTENT!==!1,je=R.IN_PLACE||!1,tt=R.ALLOWED_URI_REGEXP||Rm,ai=R.NAMESPACE||Rn,Eo=R.MATHML_TEXT_INTEGRATION_POINTS||Eo,xo=R.HTML_INTEGRATION_POINTS||xo,et=R.CUSTOM_ELEMENT_HANDLING||{},R.CUSTOM_ELEMENT_HANDLING&&kv(R.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(et.tagNameCheck=R.CUSTOM_ELEMENT_HANDLING.tagNameCheck),R.CUSTOM_ELEMENT_HANDLING&&kv(R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(et.attributeNameCheck=R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),R.CUSTOM_ELEMENT_HANDLING&&typeof R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),A&&(W=!1),_t&&(st=!0),ii&&(X=vt({},Am),Q=[],ii.html===!0&&(vt(X,Cm),vt(Q,Dm)),ii.svg===!0&&(vt(X,uu),vt(Q,fu),vt(Q,ao)),ii.svgFilters===!0&&(vt(X,hu),vt(Q,fu),vt(Q,ao)),ii.mathMl===!0&&(vt(X,du),vt(Q,Lm),vt(Q,ao))),R.ADD_TAGS&&(X===Y&&(X=Dn(X)),vt(X,R.ADD_TAGS,Xt)),R.ADD_ATTR&&(Q===ut&&(Q=Dn(Q)),vt(Q,R.ADD_ATTR,Xt)),R.ADD_URI_SAFE_ATTR&&vt(Du,R.ADD_URI_SAFE_ATTR,Xt),R.FORBID_CONTENTS&&(si===Dv&&(si=Dn(si)),vt(si,R.FORBID_CONTENTS,Xt)),mr&&(X["#text"]=!0),V&&vt(X,["html","head","body"]),X.table&&(vt(X,["tbody"]),delete K.tbody),R.TRUSTED_TYPES_POLICY){if(typeof R.TRUSTED_TYPES_POLICY.createHTML!="function")throw gs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof R.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=R.TRUSTED_TYPES_POLICY,S=b.createHTML("")}else b===void 0&&(b=tk(f,i)),b!==null&&typeof S=="string"&&(S=b.createHTML(""));ae&&ae(R),oi=R}},Pv=vt({},[...uu,...hu,...VI]),Nv=vt({},[...du,...zI]),K$=function(R){let Z=E(R);(!Z||!Z.tagName)&&(Z={namespaceURI:ai,tagName:"template"});const it=so(R.tagName),kt=so(Z.tagName);return Ru[R.namespaceURI]?R.namespaceURI===yo?Z.namespaceURI===Rn?it==="svg":Z.namespaceURI===vo?it==="svg"&&(kt==="annotation-xml"||Eo[kt]):!!Pv[it]:R.namespaceURI===vo?Z.namespaceURI===Rn?it==="math":Z.namespaceURI===yo?it==="math"&&xo[kt]:!!Nv[it]:R.namespaceURI===Rn?Z.namespaceURI===yo&&!xo[kt]||Z.namespaceURI===vo&&!Eo[kt]?!1:!Nv[it]&&(q$[it]||!Pv[it]):!!(Ts==="application/xhtml+xml"&&Ru[R.namespaceURI]):!1},un=function(R){fs(t.removed,{element:R});try{E(R).removeChild(R)}catch{m(R)}},li=function(R,Z){try{fs(t.removed,{attribute:Z.getAttributeNode(R),from:Z})}catch{fs(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(R),R==="is")if(st||_t)try{un(Z)}catch{}else try{Z.setAttribute(R,"")}catch{}},$v=function(R){let Z=null,it=null;if(Ut)R="<remove></remove>"+R;else{const Yt=Mm(R,/^[\r\n\t ]+/);it=Yt&&Yt[0]}Ts==="application/xhtml+xml"&&ai===Rn&&(R='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+R+"</body></html>");const kt=b?b.createHTML(R):R;if(ai===Rn)try{Z=new h().parseFromString(kt,Ts)}catch{}if(!Z||!Z.documentElement){Z=_.createDocument(ai,"template",null);try{Z.documentElement.innerHTML=Lu?S:kt}catch{}}const ne=Z.body||Z.documentElement;return R&&it&&ne.insertBefore(n.createTextNode(it),ne.childNodes[0]||null),ai===Rn?B.call(Z,V?"html":"body")[0]:V?Z.documentElement:ne},Fv=function(R){return C.call(R.ownerDocument||R,R,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ku=function(R){return R instanceof d&&(typeof R.nodeName!="string"||typeof R.textContent!="string"||typeof R.removeChild!="function"||!(R.attributes instanceof u)||typeof R.removeAttribute!="function"||typeof R.setAttribute!="function"||typeof R.namespaceURI!="string"||typeof R.insertBefore!="function"||typeof R.hasChildNodes!="function")},Uv=function(R){return typeof o=="function"&&R instanceof o};function In(ot,R,Z){io(ot,it=>{it.call(t,R,Z,oi)})}const Bv=function(R){let Z=null;if(In(w.beforeSanitizeElements,R,null),ku(R))return un(R),!0;const it=Xt(R.nodeName);if(In(w.uponSanitizeElement,R,{tagName:it,allowedTags:X}),G&&R.hasChildNodes()&&!Uv(R.firstElementChild)&&oe(/<[/\w!]/g,R.innerHTML)&&oe(/<[/\w!]/g,R.textContent)||R.nodeType===vs.progressingInstruction||G&&R.nodeType===vs.comment&&oe(/<[/\w]/g,R.data))return un(R),!0;if(!X[it]||K[it]){if(!K[it]&&Gv(it)&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,it)||et.tagNameCheck instanceof Function&&et.tagNameCheck(it)))return!1;if(mr&&!si[it]){const kt=E(R)||R.parentNode,ne=x(R)||R.childNodes;if(ne&&kt){const Yt=ne.length;for(let ve=Yt-1;ve>=0;--ve){const kn=g(ne[ve],!0);kn.__removalCount=(R.__removalCount||0)+1,kt.insertBefore(kn,v(R))}}}return un(R),!0}return R instanceof l&&!K$(R)||(it==="noscript"||it==="noembed"||it==="noframes")&&oe(/<\/no(script|embed|frames)/i,R.innerHTML)?(un(R),!0):(A&&R.nodeType===vs.text&&(Z=R.textContent,io([H,N,M],kt=>{Z=ps(Z,kt," ")}),R.textContent!==Z&&(fs(t.removed,{element:R.cloneNode()}),R.textContent=Z)),In(w.afterSanitizeElements,R,null),!1)},Hv=function(R,Z,it){if(Oe&&(Z==="id"||Z==="name")&&(it in n||it in j$))return!1;if(!(W&&!nt[Z]&&oe(O,Z))){if(!(ht&&oe($,Z))){if(!Q[Z]||nt[Z]){if(!(Gv(R)&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,R)||et.tagNameCheck instanceof Function&&et.tagNameCheck(R))&&(et.attributeNameCheck instanceof RegExp&&oe(et.attributeNameCheck,Z)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(Z))||Z==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,it)||et.tagNameCheck instanceof Function&&et.tagNameCheck(it))))return!1}else if(!Du[Z]){if(!oe(tt,ps(it,L,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&R!=="script"&&UI(it,"data:")===0&&Lv[R])){if(!(j&&!oe(F,ps(it,L,"")))){if(it)return!1}}}}}}return!0},Gv=function(R){return R!=="annotation-xml"&&Mm(R,U)},Vv=function(R){In(w.beforeSanitizeAttributes,R,null);const{attributes:Z}=R;if(!Z||ku(R))return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let kt=Z.length;for(;kt--;){const ne=Z[kt],{name:Yt,namespaceURI:ve,value:kn}=ne,Os=Xt(Yt),Pu=kn;let re=Yt==="value"?Pu:BI(Pu);if(it.attrName=Os,it.attrValue=re,it.keepAttr=!0,it.forceKeepAttr=void 0,In(w.uponSanitizeAttribute,R,it),re=it.attrValue,Ss&&(Os==="id"||Os==="name")&&(li(Yt,R),re=_s+re),G&&oe(/((--!?|])>)|<\/(style|title)/i,re)){li(Yt,R);continue}if(it.forceKeepAttr)continue;if(!it.keepAttr){li(Yt,R);continue}if(!J&&oe(/\/>/i,re)){li(Yt,R);continue}A&&io([H,N,M],Wv=>{re=ps(re,Wv," ")});const zv=Xt(R.nodeName);if(!Hv(zv,Os,re)){li(Yt,R);continue}if(b&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ve)switch(f.getAttributeType(zv,Os)){case"TrustedHTML":{re=b.createHTML(re);break}case"TrustedScriptURL":{re=b.createScriptURL(re);break}}if(re!==Pu)try{ve?R.setAttributeNS(ve,Yt,re):R.setAttribute(Yt,re),ku(R)?un(R):wm(t.removed)}catch{li(Yt,R)}}In(w.afterSanitizeAttributes,R,null)},Q$=function ot(R){let Z=null;const it=Fv(R);for(In(w.beforeSanitizeShadowDOM,R,null);Z=it.nextNode();)In(w.uponSanitizeShadowNode,Z,null),Bv(Z),Vv(Z),Z.content instanceof s&&ot(Z.content);In(w.afterSanitizeShadowDOM,R,null)};return t.sanitize=function(ot){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,it=null,kt=null,ne=null;if(Lu=!ot,Lu&&(ot="<!-->"),typeof ot!="string"&&!Uv(ot))if(typeof ot.toString=="function"){if(ot=ot.toString(),typeof ot!="string")throw gs("dirty is not a string, aborting")}else throw gs("toString is not a function");if(!t.isSupported)return ot;if(xt||Iu(R),t.removed=[],typeof ot=="string"&&(je=!1),je){if(ot.nodeName){const kn=Xt(ot.nodeName);if(!X[kn]||K[kn])throw gs("root node is forbidden and cannot be sanitized in-place")}}else if(ot instanceof o)Z=$v("<!---->"),it=Z.ownerDocument.importNode(ot,!0),it.nodeType===vs.element&&it.nodeName==="BODY"||it.nodeName==="HTML"?Z=it:Z.appendChild(it);else{if(!st&&!A&&!V&&ot.indexOf("<")===-1)return b&&Ne?b.createHTML(ot):ot;if(Z=$v(ot),!Z)return st?null:Ne?S:""}Z&&Ut&&un(Z.firstChild);const Yt=Fv(je?ot:Z);for(;kt=Yt.nextNode();)Bv(kt),Vv(kt),kt.content instanceof s&&Q$(kt.content);if(je)return ot;if(st){if(_t)for(ne=D.call(Z.ownerDocument);Z.firstChild;)ne.appendChild(Z.firstChild);else ne=Z;return(Q.shadowroot||Q.shadowrootmode)&&(ne=P.call(r,ne,!0)),ne}let ve=V?Z.outerHTML:Z.innerHTML;return V&&X["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&oe(Im,Z.ownerDocument.doctype.name)&&(ve="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
4
4
  `+ve),A&&io([H,N,M],kn=>{ve=ps(ve,kn," ")}),b&&Ne?b.createHTML(ve):ve},t.setConfig=function(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Iu(ot),xt=!0},t.clearConfig=function(){oi=null,xt=!1},t.isValidAttribute=function(ot,R,Z){oi||Iu({});const it=Xt(ot),kt=Xt(R);return Hv(it,kt,Z)},t.addHook=function(ot,R){typeof R=="function"&&fs(w[ot],R)},t.removeHook=function(ot,R){if(R!==void 0){const Z=$I(w[ot],R);return Z===-1?void 0:FI(w[ot],Z,1)[0]}return wm(w[ot])},t.removeHooks=function(ot){w[ot]=[]},t.removeAllHooks=function(){w=Pm()},t}var pu=Nm();const oo=e=>pu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ek=e=>pu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ln=e=>pu.sanitize(e,{ALLOWED_TAGS:[]}),go=class go extends mt{constructor(){super(...arguments),this.type="toolbar",this.renderType=at.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(T.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(T.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(y(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:i,overflowMenuItemList:s}=this.getControlConfigs();s&&i.push(this.getOverflowButtonConfig());const a=n.selectAll("div.toolbar-control").data(i,c=>c.id);a.exit().remove();const o=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),l=this;o.merge(a).classed("disabled",c=>c.shouldBeDisabled()).attr("role","button").attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
5
5
  <button
6
+ type="button"
6
7
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
7
8
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${ln(c.id)}`)}" aria-label="${ln(c.title)}">
8
9
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
9
10
  ${ek(c.iconSVG.content)}
10
11
  </svg>
11
- </button>`).each(function(c,u){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(d){const h=I(this);h.classed("hovered",!0),l.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:d,hoveredElement:h,content:c.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){l.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).on("click",d=>{c.shouldBeDisabled()||l.triggerFunctionAndEvent(c,d,this)}).on("keydown",d=>{d.key&&d.key==="Enter"||d.key===" "?(d.preventDefault(),l.triggerFunctionAndEvent(c,d,this)):d.key&&d.key==="ArrowLeft"?l.focusOnPreviousEnabledToolbarItem(u):d.key&&d.key==="ArrowRight"&&l.focusOnNextEnabledToolbarItem(u)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((i,s)=>{const a=I(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(i,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",o=>{o&&o.key==="Enter"?n.triggerFunctionAndEvent(i,t,a.node()):o&&o.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(s):o&&o.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(s):o&&o.key==="Escape"&&n.updateOverflowMenu(!1),o.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(T.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===St.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${go.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===St.MAKE_FULLSCREEN&&l?a.type=St.EXIT_FULLSCREEN:a.type===St.EXIT_FULLSCREEN&&!l&&(a.type=St.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
12
+ </button>`).each(function(c,u){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(d){const h=I(this);h.classed("hovered",!0),l.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:d,hoveredElement:h,content:c.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){l.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).on("click",d=>{c.shouldBeDisabled()||l.triggerFunctionAndEvent(c,d,this)}).on("keydown",d=>{d.key&&d.key==="Enter"||d.key===" "?(d.preventDefault(),l.triggerFunctionAndEvent(c,d,this)):d.key&&d.key==="ArrowLeft"?l.focusOnPreviousEnabledToolbarItem(u):d.key&&d.key==="ArrowRight"&&l.focusOnNextEnabledToolbarItem(u)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("type","button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((i,s)=>{const a=I(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(i,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",o=>{o&&o.key==="Enter"?n.triggerFunctionAndEvent(i,t,a.node()):o&&o.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(s):o&&o.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(s):o&&o.key==="Escape"&&n.updateOverflowMenu(!1),o.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(T.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===St.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${go.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===St.MAKE_FULLSCREEN&&l?a.type=St.EXIT_FULLSCREEN:a.type===St.EXIT_FULLSCREEN&&!l&&(a.type=St.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
12
13
  <circle cx="16" cy="16" r="2"></circle>
13
14
  <circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:f}=y(i,"locale","translations","toolbar");let p;switch(t){case St.ZOOM_IN:n&&(p={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case St.ZOOM_OUT:n&&(p={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case St.RESET_ZOOM:n&&(p={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case St.MAKE_FULLSCREEN:p={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case St.EXIT_FULLSCREEN:p={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case St.SHOW_AS_DATATABLE:p={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:f,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(T.Modal.SHOW)};break;case St.EXPORT_CSV:p={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case St.EXPORT_PNG:p={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case St.EXPORT_JPG:p={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return p}getControlIconByType(t){switch(t){case St.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
14
15
  <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case St.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>