@descope/web-components-ui 1.110.0 → 1.111.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.
Files changed (69) hide show
  1. package/dist/cjs/index.cjs.js +2029 -1782
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +2341 -2093
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/1995.js +7 -22
  6. package/dist/umd/1995.js.LICENSE.txt +0 -6
  7. package/dist/umd/1995.js.map +1 -1
  8. package/dist/umd/8961.js +1 -1
  9. package/dist/umd/8961.js.map +1 -1
  10. package/dist/umd/DescopeDev.js +1 -1
  11. package/dist/umd/DescopeDev.js.map +1 -1
  12. package/dist/umd/descope-alert-index-js.js +1 -1
  13. package/dist/umd/descope-alert-index-js.js.map +1 -1
  14. package/dist/umd/descope-apps-list.js +18 -0
  15. package/dist/umd/descope-apps-list.js.LICENSE.txt +23 -0
  16. package/dist/umd/descope-apps-list.js.map +1 -0
  17. package/dist/umd/descope-avatar.js +17 -1
  18. package/dist/umd/descope-avatar.js.LICENSE.txt +23 -0
  19. package/dist/umd/descope-avatar.js.map +1 -1
  20. package/dist/umd/descope-collapsible-container.js +1 -1
  21. package/dist/umd/descope-collapsible-container.js.map +1 -1
  22. package/dist/umd/descope-divider-index-js.js +1 -1
  23. package/dist/umd/descope-divider-index-js.js.map +1 -1
  24. package/dist/umd/descope-enriched-text.js +1 -1
  25. package/dist/umd/descope-enriched-text.js.map +1 -1
  26. package/dist/umd/descope-link.js +1 -1
  27. package/dist/umd/descope-link.js.map +1 -1
  28. package/dist/umd/descope-list-item.js +2 -0
  29. package/dist/umd/descope-list-item.js.map +1 -0
  30. package/dist/umd/descope-list.js +2 -0
  31. package/dist/umd/descope-list.js.map +1 -0
  32. package/dist/umd/descope-outbound-apps.js +339 -0
  33. package/dist/umd/descope-outbound-apps.js.LICENSE.txt +5 -0
  34. package/dist/umd/descope-outbound-apps.js.map +1 -0
  35. package/dist/umd/descope-recovery-codes.js +1 -1
  36. package/dist/umd/descope-recovery-codes.js.map +1 -1
  37. package/dist/umd/descope-scopes-list-index-js.js +1 -1
  38. package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
  39. package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
  40. package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
  41. package/dist/umd/descope-text.js +1 -1
  42. package/dist/umd/descope-text.js.map +1 -1
  43. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  44. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  45. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  46. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  47. package/dist/umd/index.js +1 -1
  48. package/dist/umd/index.js.map +1 -1
  49. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  50. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  51. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  52. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  53. package/package.json +21 -17
  54. package/src/components/descope-scopes-list/index.js +2 -1
  55. package/src/index.cjs.js +0 -3
  56. package/src/index.js +0 -2
  57. package/src/theme/components/index.js +5 -3
  58. package/dist/umd/descope-apps-list-index-js.js +0 -2
  59. package/dist/umd/descope-apps-list-index-js.js.map +0 -1
  60. package/dist/umd/descope-list-index-js.js +0 -2
  61. package/dist/umd/descope-list-index-js.js.map +0 -1
  62. package/src/components/descope-apps-list/AppsListClass.js +0 -97
  63. package/src/components/descope-apps-list/index.js +0 -8
  64. package/src/components/descope-list/ListClass.js +0 -156
  65. package/src/components/descope-list/ListItemClass.js +0 -58
  66. package/src/components/descope-list/index.js +0 -7
  67. package/src/theme/components/appsList.js +0 -36
  68. package/src/theme/components/list/list.js +0 -56
  69. package/src/theme/components/list/listItem.js +0 -41
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1456,2294,4159,9261],{11339:(t,e,n)=>{n.r(e),n.d(e,{AlertClass:()=>p,componentName:()=>a}),n(55838);var o=n(79365),r=n(9696),s=n(97810),i=n(81365),l=n(76231),h=n(25964);const a=(0,s.xE)("alert");class c extends((0,i.q)({componentName:a,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="icon"></div>\n <div class="content">\n <descope-enriched-text>\n <slot></slot>\n </descope-enriched-text>\n </div>\n </div>\n ',(0,h.fz)('\n :host {\n display: inline-flex;\n }\n :host > div {\n display: flex;\n width: 100%;\n }\n :host([empty="true"]) {\n display: none;\n }\n .icon {\n flex-shrink: 0;\n }\n .content {\n display: flex;\n flex-wrap: wrap;\n white-space: normal;\n overflow-wrap: break-word;\n }\n ',this)}init(){super.init?.(),this.slotEle=this.shadowRoot.querySelector("slot"),this.textComp=this.shadowRoot.querySelector("descope-enriched-text"),this.slotEle.addEventListener("slotchange",this.handleSlotChange.bind(this)),(0,h.Gh)(this.textComp,this,{includeAttrs:["empty"]}),(0,h.Ge)(this,this.handleChildrenChange.bind(this)),(0,s.EA)(this,this.textComp,{includeAttrs:["variant","full-width","link-target-blank"]})}handleChildrenChange(){this.textComp.textContent=this.textContent}handleSlotChange(){const t=this.slotEle.assignedNodes({flatten:!0});t.length&&(this.textComp.textContent=t[0]?.textContent||"")}}const{icon:d}={icon:{selector:()=>".icon"}},p=(0,r.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},textColor:{selector:l.m.componentName,property:l.m.cssVarList.textColor},backgroundColor:{},borderColor:{},borderWidth:{},borderStyle:{},borderRadius:{},fontSize:[{},{selector:l.m.componentName,property:l.m.cssVarList.fontSize}],gap:{},horizontalPadding:[{property:"padding-top"},{property:"padding-bottom"}],verticalPadding:[{property:"padding-right"},{property:"padding-left"}],alignItems:{},justifyContent:{},icon:[{...d,property:"content"},{...d,property:"display",fallback:"none"}],iconSize:[{...d,property:"width"},{...d,property:"height"}]}}),(0,o.RF)({componentNameOverride:(0,s.xE)("enriched-text")}),(0,o.RF)({componentNameOverride:(0,s.xE)("text")}),o.VO,o.tQ)(c);customElements.define(a,p)},36976:(t,e,n)=>{n.d(e,{M:()=>o});const o=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847:(t,e,n)=>{n.d(e,{G:()=>o});const o=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838:(t,e,n)=>{n.r(e),n.d(e,{EnrichedTextClass:()=>o.m,componentName:()=>o.T}),n(74778);var o=n(76231);customElements.define(o.T,o.m)},63595:(t,e,n)=>{n.r(e),n.d(e,{TextClass:()=>o.s,componentName:()=>o.T});var o=n(66434);customElements.define(o.T,o.s)},66434:(t,e,n)=>{n.d(e,{T:()=>l,s:()=>c});var o=n(88961),r=n(63200),s=n(25964),i=n(72270);const l=(0,s.xE)("text");class h extends((0,i.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:a}={host:{selector:()=>":host"}},c=(0,r.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),o.VO,o.tQ)(h)},74778:(t,e,n)=>{n.r(e),n.d(e,{LinkClass:()=>y,componentName:()=>h});var o=n(88961),r=n(63200),s=n(25964),i=n(72270),l=n(66434);const h=(0,s.xE)("link");class a extends((0,i.qu)({componentName:h,baseSelector:":host a"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t",(0,s.fz)("\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n ",this),(0,s.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:d,text:p,host:m,wrapper:u,link:g}=c,y=(0,r.Zz)((0,o.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...p,property:"direction"},textAlign:u,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...d,property:"color"},{...p,property:l.s.cssVarList.textColor}],cursor:d}}),o.VO,o.tQ)(a);n(63595),customElements.define(h,y)},76231:(t,e,n)=>{n.d(e,{T:()=>c,m:()=>p});var o=n(92540),r=n(88961),s=n(63200),i=n(36976),l=n(72270),h=n(54847),a=n(25964);const c=(0,a.xE)("enriched-text");class d extends((0,l.qu)({componentName:c,baseSelector:":host > div"})){#t;#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,a.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#n(),(0,a.Ge)(this,this.#o.bind(this))}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("readonly"===t&&this.onReadOnlyChange("true"===n),"link-target-blank"===t&&this.#n())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,n,o,r)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,o,r)),this.processor.renderer.rules.em_close=(t,e,n,o,r)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,o,r))}#r(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,n,o,r)=>(t[e].attrSet("target","_blank"),this.#t(t,e,n,o,r)):this.processor.renderer.rules.link_open=this.#t}#s(){this.processor&&this.processor.disable(i.M)}#i(){this.#s()}#l(){this.#t=this.processor.renderer.rules.link_open||((t,e,n,o,r)=>r.renderToken(t,e,n)),this.#e=this.processor.renderer.rules.em_open||((t,e,n,o,r)=>r.renderToken(t,e,n))}#n(){this.processor=new o.A("commonmark",{html:!0}),this.#l(),this.#i(),this.#r(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#o(){if(!this.processor)return;let t=(0,h.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch(t){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,s.Zz)((0,r.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,r.RF)({componentNameOverride:(0,a.xE)("link")}),(0,r.RF)({componentNameOverride:(0,a.xE)("text")}),r.VO,r.tQ)(d)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1456,2294,4159,9261],{11339:(t,e,n)=>{n.r(e),n.d(e,{AlertClass:()=>p,componentName:()=>a}),n(55838);var o=n(79365),r=n(9696),s=n(97810),i=n(81365),l=n(76231),h=n(25964);const a=(0,s.xE)("alert");class c extends((0,i.q)({componentName:a,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="icon"></div>\n <div class="content">\n <descope-enriched-text>\n <slot></slot>\n </descope-enriched-text>\n </div>\n </div>\n ',(0,h.fz)('\n :host {\n display: inline-flex;\n }\n :host > div {\n display: flex;\n width: 100%;\n }\n :host([empty="true"]) {\n display: none;\n }\n .icon {\n flex-shrink: 0;\n }\n .content {\n display: flex;\n flex-wrap: wrap;\n white-space: normal;\n overflow-wrap: break-word;\n }\n ',this)}init(){super.init?.(),this.slotEle=this.shadowRoot.querySelector("slot"),this.textComp=this.shadowRoot.querySelector("descope-enriched-text"),this.slotEle.addEventListener("slotchange",this.handleSlotChange.bind(this)),(0,h.Gh)(this.textComp,this,{includeAttrs:["empty"]}),(0,h.Ge)(this,this.handleChildrenChange.bind(this)),(0,s.EA)(this,this.textComp,{includeAttrs:["variant","full-width","link-target-blank"]})}handleChildrenChange(){this.textComp.textContent=this.textContent}handleSlotChange(){const t=this.slotEle.assignedNodes({flatten:!0});t.length&&(this.textComp.textContent=t[0]?.textContent||"")}}const{icon:d}={icon:{selector:()=>".icon"}},p=(0,r.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},textColor:{selector:l.m.componentName,property:l.m.cssVarList.textColor},backgroundColor:{},borderColor:{},borderWidth:{},borderStyle:{},borderRadius:{},fontSize:[{},{selector:l.m.componentName,property:l.m.cssVarList.fontSize}],gap:{},horizontalPadding:[{property:"padding-top"},{property:"padding-bottom"}],verticalPadding:[{property:"padding-right"},{property:"padding-left"}],alignItems:{},justifyContent:{},icon:[{...d,property:"content"},{...d,property:"display",fallback:"none"}],iconSize:[{...d,property:"width"},{...d,property:"height"}]}}),(0,o.RF)({componentNameOverride:(0,s.xE)("enriched-text")}),(0,o.RF)({componentNameOverride:(0,s.xE)("text")}),o.VO,o.tQ)(c);customElements.define(a,p)},36976:(t,e,n)=>{n.d(e,{M:()=>o});const o=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847:(t,e,n)=>{n.d(e,{G:()=>o});const o=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838:(t,e,n)=>{n.r(e),n.d(e,{EnrichedTextClass:()=>o.m,componentName:()=>o.T}),n(74778);var o=n(76231);customElements.define(o.T,o.m)},63595:(t,e,n)=>{n.r(e),n.d(e,{TextClass:()=>o.s,componentName:()=>o.T});var o=n(66434);customElements.define(o.T,o.s)},66434:(t,e,n)=>{n.d(e,{T:()=>l,s:()=>c});var o=n(88961),r=n(63200),s=n(25964),i=n(72270);const l=(0,s.xE)("text");class h extends((0,i.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:a}={host:{selector:()=>":host"}},c=(0,r.Zz)((0,o.RF)({mappings:{hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),o.VO,o.tQ)(h)},74778:(t,e,n)=>{n.r(e),n.d(e,{LinkClass:()=>y,componentName:()=>h});var o=n(88961),r=n(63200),s=n(25964),i=n(72270),l=n(66434);const h=(0,s.xE)("link");class a extends((0,i.qu)({componentName:h,baseSelector:":host a"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t",(0,s.fz)("\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n ",this),(0,s.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:d,text:p,host:m,wrapper:u,link:g}=c,y=(0,r.Zz)((0,o.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...p,property:"direction"},textAlign:u,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...d,property:"color"},{...p,property:l.s.cssVarList.textColor}],cursor:d}}),o.VO,o.tQ)(a);n(63595),customElements.define(h,y)},76231:(t,e,n)=>{n.d(e,{T:()=>c,m:()=>p});var o=n(92540),r=n(88961),s=n(63200),i=n(36976),l=n(72270),h=n(54847),a=n(25964);const c=(0,a.xE)("enriched-text");class d extends((0,l.qu)({componentName:c,baseSelector:":host > div"})){#t;#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,a.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#n(),(0,a.Ge)(this,this.#o.bind(this))}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("readonly"===t&&this.onReadOnlyChange("true"===n),"link-target-blank"===t&&this.#n())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,n,o,r)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,o,r)),this.processor.renderer.rules.em_close=(t,e,n,o,r)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,o,r))}#r(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,n,o,r)=>(t[e].attrSet("target","_blank"),this.#t(t,e,n,o,r)):this.processor.renderer.rules.link_open=this.#t}#s(){this.processor&&this.processor.disable(i.M)}#i(){this.#s()}#l(){this.#t=this.processor.renderer.rules.link_open||((t,e,n,o,r)=>r.renderToken(t,e,n)),this.#e=this.processor.renderer.rules.em_open||((t,e,n,o,r)=>r.renderToken(t,e,n))}#n(){this.processor=new o.A("commonmark",{html:!0}),this.#l(),this.#i(),this.#r(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#o(){if(!this.processor)return;let t=(0,h.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch(t){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,s.Zz)((0,r.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,r.RF)({componentNameOverride:(0,a.xE)("link")}),(0,r.RF)({componentNameOverride:(0,a.xE)("text")}),r.VO,r.tQ)(d)}}]);
2
2
  //# sourceMappingURL=descope-alert-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-alert-index-js.js","mappings":"2RAOO,MAAMA,GAAgB,QAAiB,SAE9C,MAAMC,WAAiB,EAAAC,EAAA,GAAgB,CAAEF,gBAAeG,aAAc,iBACpE,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,wMAWhD,QACE,8YAqBAH,KAEJ,CAEA,IAAAI,GACEL,MAAMK,SAENJ,KAAKK,QAAUL,KAAKM,WAAWC,cAAc,QAC7CP,KAAKQ,SAAWR,KAAKM,WAAWC,cAAc,yBAE9CP,KAAKK,QAAQI,iBAAiB,aAAcT,KAAKU,iBAAiBC,KAAKX,QAEvE,QAAUA,KAAKQ,SAAUR,KAAM,CAAEY,aAAc,CAAC,YAEhD,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AuB,QAAiB,WAC3D,QAAiB,CAAEA,uBAAuB,QAAiB,UAC3D,KACA,KA1B+B,CA2B/BsC,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-alert/AlertClass.js","webpack://@descope/web-components-ui/./src/components/descope-alert/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js"],"sourcesContent":["import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { injectStyle, observeChildren, syncAttrs } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('alert');\n\nclass RawAlert extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <div class=\"icon\"></div>\n <div class=\"content\">\n <descope-enriched-text>\n <slot></slot>\n </descope-enriched-text>\n </div>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n }\n :host > div {\n display: flex;\n width: 100%;\n }\n :host([empty=\"true\"]) {\n display: none;\n }\n .icon {\n flex-shrink: 0;\n }\n .content {\n display: flex;\n flex-wrap: wrap;\n white-space: normal;\n overflow-wrap: break-word;\n }\n `,\n this\n );\n }\n\n init() {\n super.init?.();\n\n this.slotEle = this.shadowRoot.querySelector('slot');\n this.textComp = this.shadowRoot.querySelector('descope-enriched-text');\n\n this.slotEle.addEventListener('slotchange', this.handleSlotChange.bind(this));\n\n syncAttrs(this.textComp, this, { includeAttrs: ['empty'] });\n\n observeChildren(this, this.handleChildrenChange.bind(this));\n\n forwardAttrs(this, this.textComp, {\n includeAttrs: ['variant', 'full-width', 'link-target-blank'],\n });\n }\n\n handleChildrenChange() {\n this.textComp.textContent = this.textContent;\n }\n\n handleSlotChange() {\n const assignedNodes = this.slotEle.assignedNodes({ flatten: true });\n if (!assignedNodes.length) return;\n this.textComp.textContent = assignedNodes[0]?.textContent || '';\n }\n}\n\nconst { icon } = {\n icon: { selector: () => '.icon' },\n};\n\nexport const AlertClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n textColor: {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.textColor,\n },\n backgroundColor: {},\n borderColor: {},\n borderWidth: {},\n borderStyle: {},\n borderRadius: {},\n fontSize: [\n {},\n {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.fontSize,\n },\n ],\n gap: {},\n horizontalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],\n verticalPadding: [{ property: 'padding-right' }, { property: 'padding-left' }],\n alignItems: {},\n justifyContent: {},\n icon: [\n { ...icon, property: 'content' },\n { ...icon, property: 'display', fallback: 'none' },\n ],\n iconSize: [\n { ...icon, property: 'width' },\n { ...icon, property: 'height' },\n ],\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('enriched-text') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(RawAlert);\n","import '@descope-ui/descope-enriched-text';\nimport { componentName, AlertClass } from './AlertClass';\n\ncustomElements.define(componentName, AlertClass);\n\nexport { AlertClass, componentName };\n","export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n `,\n this\n );\n\n forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n"],"names":["componentName","RawAlert","createBaseClass","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","init","slotEle","shadowRoot","querySelector","textComp","addEventListener","handleSlotChange","bind","includeAttrs","handleChildrenChange","textContent","assignedNodes","flatten","length","icon","selector","AlertClass","mappings","hostWidth","property","hostDirection","textColor","EnrichedTextClass","cssVarList","backgroundColor","borderColor","borderWidth","borderStyle","borderRadius","fontSize","gap","horizontalPadding","verticalPadding","alignItems","justifyContent","fallback","iconSize","componentNameOverride","customElements","define","disableRules","decodeHTML","html","textArea","document","createElement","value","RawText","hideWhenEmpty","getAttribute","hasChildren","childNodes","style","display","host","TextClass","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","RawLink","mapAttrs","tooltip","selectors","link","anchor","wrapper","text","LinkClass","textDecoration","cursor","EnrichedText","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","contentNode","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","e","console","warn","isReadOnly","hostDisplay","fontWeightBold","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-alert-index-js.js","mappings":"2RAOO,MAAMA,GAAgB,QAAiB,SAE9C,MAAMC,WAAiB,EAAAC,EAAA,GAAgB,CAAEF,gBAAeG,aAAc,iBACpE,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,wMAWhD,QACE,8YAqBAH,KAEJ,CAEA,IAAAI,GACEL,MAAMK,SAENJ,KAAKK,QAAUL,KAAKM,WAAWC,cAAc,QAC7CP,KAAKQ,SAAWR,KAAKM,WAAWC,cAAc,yBAE9CP,KAAKK,QAAQI,iBAAiB,aAAcT,KAAKU,iBAAiBC,KAAKX,QAEvE,QAAUA,KAAKQ,SAAUR,KAAM,CAAEY,aAAc,CAAC,YAEhD,QAAgBZ,KAAMA,KAAKa,qBAAqBF,KAAKX,QAErD,QAAaA,KAAMA,KAAKQ,SAAU,CAChCI,aAAc,CAAC,UAAW,aAAc,sBAE5C,CAEA,oBAAAC,GACEb,KAAKQ,SAASM,YAAcd,KAAKc,WACnC,CAEA,gBAAAJ,GACE,MAAMK,EAAgBf,KAAKK,QAAQU,cAAc,CAAEC,SAAS,IACvDD,EAAcE,SACnBjB,KAAKQ,SAASM,YAAcC,EAAc,IAAID,aAAe,GAC/D,EAGF,MAAM,KAAEI,GAAS,CACfA,KAAM,CAAEC,SAAU,IAAM,UAGbC,GAAa,SACxB,QAAiB,CACfC,SAAU,CACRC,UAAW,CAAEH,SAAU,IAAM,QAASI,SAAU,SAChDC,cAAe,CAAEL,SAAU,IAAM,QAASI,SAAU,aACpDE,UAAW,CACTN,SAAUO,EAAA,EAAkBhC,cAC5B6B,SAAUG,EAAA,EAAkBC,WAAWF,WAEzCG,gBAAiB,C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K,MAAMnF,GAAoB,SAC/B,QAAiB,CACfL,SAAU,CACRC,UAAW,CAAEH,SAAU,IAAM,QAASI,SAAU,SAChDgG,YAAa,CAAEpG,SAAU,IAAM,QAASI,SAAU,UAAWgB,SAAU,gBACvEf,cAAe,CAAEL,SAAU,IAAM,QAASI,SAAU,aACpDU,SAAU,CAAC,EACXgC,WAAY,CAAC,EACbE,WAAY,CAAC,EACbqD,eAAgB,CACd,CAAErG,SAAU,IAAM,eAAgBI,SAAU,eAC5C,CAAEJ,SAAU,IAAM,UAAWI,SAAU,gBAEzCE,UAAW,CAAEF,SAAU,SACvBqC,eAAgB,CAAErC,SAAU,eAC5BwC,UAAW,CAAC,EACZ0D,UAAW,CAAEtG,SAAU,IAAKI,SAAU,SACtCmG,mBAAoB,CAAEvG,SAAU,IAAKI,SAAU,mBAC/CoG,wBAAyB,CAAExG,SAAU,UAAWI,SAAU,mBAC1DqG,UAAW,CAAC,EACZC,SAAU,CAAC,MAGf,QAAiB,CAAEpF,uBAAuB,QAAiB,WAC3D,QAAiB,CAAEA,uBAAuB,QAAiB,UAC3D,KACA,KA1B+B,CA2B/BsC,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-alert/AlertClass.js","webpack://@descope/web-components-ui/./src/components/descope-alert/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js"],"sourcesContent":["import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { injectStyle, observeChildren, syncAttrs } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('alert');\n\nclass RawAlert extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <div class=\"icon\"></div>\n <div class=\"content\">\n <descope-enriched-text>\n <slot></slot>\n </descope-enriched-text>\n </div>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n }\n :host > div {\n display: flex;\n width: 100%;\n }\n :host([empty=\"true\"]) {\n display: none;\n }\n .icon {\n flex-shrink: 0;\n }\n .content {\n display: flex;\n flex-wrap: wrap;\n white-space: normal;\n overflow-wrap: break-word;\n }\n `,\n this\n );\n }\n\n init() {\n super.init?.();\n\n this.slotEle = this.shadowRoot.querySelector('slot');\n this.textComp = this.shadowRoot.querySelector('descope-enriched-text');\n\n this.slotEle.addEventListener('slotchange', this.handleSlotChange.bind(this));\n\n syncAttrs(this.textComp, this, { includeAttrs: ['empty'] });\n\n observeChildren(this, this.handleChildrenChange.bind(this));\n\n forwardAttrs(this, this.textComp, {\n includeAttrs: ['variant', 'full-width', 'link-target-blank'],\n });\n }\n\n handleChildrenChange() {\n this.textComp.textContent = this.textContent;\n }\n\n handleSlotChange() {\n const assignedNodes = this.slotEle.assignedNodes({ flatten: true });\n if (!assignedNodes.length) return;\n this.textComp.textContent = assignedNodes[0]?.textContent || '';\n }\n}\n\nconst { icon } = {\n icon: { selector: () => '.icon' },\n};\n\nexport const AlertClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n textColor: {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.textColor,\n },\n backgroundColor: {},\n borderColor: {},\n borderWidth: {},\n borderStyle: {},\n borderRadius: {},\n fontSize: [\n {},\n {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.fontSize,\n },\n ],\n gap: {},\n horizontalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],\n verticalPadding: [{ property: 'padding-right' }, { property: 'padding-left' }],\n alignItems: {},\n justifyContent: {},\n icon: [\n { ...icon, property: 'content' },\n { ...icon, property: 'display', fallback: 'none' },\n ],\n iconSize: [\n { ...icon, property: 'width' },\n { ...icon, property: 'height' },\n ],\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('enriched-text') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(RawAlert);\n","import '@descope-ui/descope-enriched-text';\nimport { componentName, AlertClass } from './AlertClass';\n\ncustomElements.define(componentName, AlertClass);\n\nexport { AlertClass, componentName };\n","export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n `,\n this\n );\n\n forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n"],"names":["componentName","RawAlert","createBaseClass","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","init","slotEle","shadowRoot","querySelector","textComp","addEventListener","handleSlotChange","bind","includeAttrs","handleChildrenChange","textContent","assignedNodes","flatten","length","icon","selector","AlertClass","mappings","hostWidth","property","hostDirection","textColor","EnrichedTextClass","cssVarList","backgroundColor","borderColor","borderWidth","borderStyle","borderRadius","fontSize","gap","horizontalPadding","verticalPadding","alignItems","justifyContent","fallback","iconSize","componentNameOverride","customElements","define","disableRules","decodeHTML","html","textArea","document","createElement","value","RawText","hideWhenEmpty","getAttribute","hasChildren","childNodes","style","display","host","TextClass","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","RawLink","mapAttrs","tooltip","selectors","link","anchor","wrapper","text","LinkClass","textDecoration","cursor","EnrichedText","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","contentNode","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","e","console","warn","isReadOnly","hostDisplay","fontWeightBold","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth"],"sourceRoot":""}
@@ -0,0 +1,18 @@
1
+ /*! For license information please see descope-apps-list.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[461,2272,2294,3580,4551],{1508:(t,e,s)=>{function o(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function n(t){const e=[];let s;return"slot"===t.localName?s=t.assignedElements():(e.push(t),s=[...t.children]),s.forEach((t=>e.push(...n(t)))),e}function i(t,e){return e?e.closest(t)||i(t,e.getRootNode().host):null}function r(t){return t?new Set(t.split(" ")):new Set}function a(t){return t?[...t].join(" "):""}function d(t,e,s){const o=r(t.getAttribute(e));o.add(s),t.setAttribute(e,a(o))}function l(t,e,s){const o=r(t.getAttribute(e));o.delete(s),0!==o.size?t.setAttribute(e,a(o)):t.removeAttribute(e)}function h(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}s.d(e,{Dy:()=>o,J$:()=>n,Wr:()=>l,Z4:()=>r,ZA:()=>h,el:()=>i,iA:()=>d,sz:()=>a})},7720:(t,e,s)=>{s.d(e,{T:()=>d,x:()=>h});var o=s(88961),n=s(63200),i=s(25964),r=s(93895),a=s(72270);const d=(0,i.xE)("list");class l extends((0,a.qu)({componentName:d,baseSelector:".wrapper"})){static get observedAttributes(){return["variant","readonly"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <slot></slot>\n <slot name="empty-state">\n No item...\n </slot>\n </div>\n\t',(0,i.fz)('\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name="empty-state"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name="empty-state"] {\n display: none;\n }\n :host([empty]) slot[name="empty-state"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n ',this)}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}#t(){0===this.items.length?this.setAttribute("empty","true"):this.removeAttribute("empty")}get variant(){return this.getAttribute("variant")||"list"}#e(){this.items.forEach((t=>{let e=t;e.localName!==r.O.componentName&&(e=t.querySelector(r.O.componentName));const s="tiles"===this.variant?"tile":"row";e.setAttribute("variant",s)}))}init(){super.init?.(),(0,i.Ge)(this,(()=>{this.#t(),this.#e(),this.#s()}))}get isReadOnly(){return"true"===this.getAttribute("readonly")}#s(){this.items.forEach((t=>{this.isReadOnly?t.setAttribute("inert",""):t.removeAttribute("inert")}))}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),s!==e&&("variant"===t?this.#e():"readonly"===t&&this.#s())}}const h=(0,n.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},maxHeight:{selector:()=>":host"},minHeight:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],hostDirection:{selector:()=>":host",property:"direction"},fontFamily:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{},gridTemplateColumns:{},maxItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"max-width"},minItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"min-width"},itemsHorizontalAlign:{selector:()=>"::slotted(*)",property:"justify-self"},emptyStateTextColor:{selector:()=>'slot[name="empty-state"]',property:"color"},emptyStateTextFontFamily:{selector:()=>'slot[name="empty-state"]',property:"font-family"}}}),o.VO,o.tQ)(l)},11707:(t,e,s)=>{s.d(e,{I:()=>n});let o=0;function n(){return o++}},24542:(t,e,s)=>{s.r(e),s.d(e,{ListItemClass:()=>o.O,componentName:()=>o.T});var o=s(93895);customElements.define(o.T,o.O)},42068:(t,e,s)=>{s(88660);var o=s(87550),n=s(36411);const i=o.AH`
3
+ :host {
4
+ --lumo-size-xs: 1.625rem;
5
+ --lumo-size-s: 1.875rem;
6
+ --lumo-size-m: 2.25rem;
7
+ --lumo-size-l: 2.75rem;
8
+ --lumo-size-xl: 3.5rem;
9
+
10
+ /* Icons */
11
+ --lumo-icon-size-s: 1.25em;
12
+ --lumo-icon-size-m: 1.5em;
13
+ --lumo-icon-size-l: 2.25em;
14
+ /* For backwards compatibility */
15
+ --lumo-icon-size: var(--lumo-icon-size-m);
16
+ }
17
+ `;(0,n.q)("sizing-props",i)},44099:(t,e,s)=>{s.d(e,{r:()=>r});var o=s(1508),n=s(65641),i=s(11707);class r extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,i.I)()}`}constructor(t,e,s,o={}){super();const{initializer:n,multiple:i,observe:r,useUniqueId:a}=o;this.host=t,this.slotName=e,this.tagName=s,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof i&&i,this.slotInitializer=n,i&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach((t=>{this.initAddedNode(t)}))}attachDefaultNode(){const{host:t,slotName:e,tagName:s}=this;let o=this.defaultNode;return!o&&s&&(o=document.createElement(s),o instanceof Element&&(""!==e&&o.setAttribute("slot",e),this.defaultNode=o)),o&&(this.node=o,t.appendChild(o)),o}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter((e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,s=this.host.shadowRoot.querySelector(e);this.__slotObserver=new n.P(s,(({addedNodes:t,removedNodes:e})=>{const s=this.multiple?this.nodes:[this.node],n=t.filter((t=>!(0,o.ZA)(t)&&!s.includes(t)));e.length&&(this.nodes=s.filter((t=>!e.includes(t))),e.forEach((t=>{this.teardownNode(t)}))),n&&n.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...s,...n].filter((t=>t!==this.defaultNode)),n.forEach((t=>{this.initAddedNode(t)}))):(this.node&&this.node.remove(),this.node=n[0],this.initAddedNode(this.node)))}))}}},44666:(t,e,s)=>{s.d(e,{E:()=>p,T:()=>a});var o=s(88961),n=s(72270),i=s(63200),r=s(25964);const a=(0,r.xE)("avatar");class d extends((0,n.qu)({componentName:a,baseSelector:":host > .wrapper"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <vaadin-avatar></vaadin-avatar>\n <div class="editableBadge">\n <vaadin-icon icon="vaadin:pencil"></vaadin-icon>\n </div>\n </div>\n\t\t',(0,r.fz)("\n :host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\n .editableBadge {\n border: 1px solid;\n border-radius: 100%;\n height: fit-content;\n width: 25%;\n height: 25%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5%;\n box-sizing: border-box;\n position: absolute;\n bottom: 0;\n inset-inline-end: 0;\n }\n\n vaadin-icon {\n color: currentcolor;\n }\n\n vaadin-avatar {\n width: 100%;\n height: 100%;\n margin: 0;\n border: none\n }\n\n .wrapper {\n display: inline-flex;\n position: relative;\n width: 100%;\n height: 100%;\n }\n ",this),this.avatarComponent=this.shadowRoot.querySelector("vaadin-avatar"),(0,r.EA)(this,this.avatarComponent,{includeAttrs:["display-name","img","abbr"],mapAttrs:{"display-name":"name"}});const t=this.shadowRoot.querySelector(".editableBadge");(0,r.mx)(this,(()=>{t.style.display=this.isEditable?"":"none"}),{includeAttrs:["editable"]})}get isEditable(){return"true"===this.getAttribute("editable")}}const{host:l,editableBadge:h,avatar:c}={host:{selector:()=>":host"},editableBadge:{selector:"> .editableBadge"},avatar:{selector:"vaadin-avatar"}},p=(0,i.Zz)((0,o.RF)({mappings:{hostWidth:[{...l,property:"width"},{...l,property:"min-width"}],hostHeight:{...l,property:"height"},cursor:[c,l],hostDirection:{...l,property:"direction"},avatarTextColor:{...c,property:"color"},avatarBackgroundColor:{...c,property:"background-color"},editableIconColor:{...h,property:"color"},editableBorderColor:{...h,property:"border-color"},editableBackgroundColor:{...h,property:"background-color"}}}),o.VO,o.tQ)(d)},45400:(t,e,s)=>{s.r(e),s.d(e,{ListClass:()=>o.x,componentName:()=>o.T}),s(24542);var o=s(7720);customElements.define(o.T,o.x)},47477:(t,e,s)=>{s.r(e),s.d(e,{AppsListClass:()=>d,componentName:()=>a}),s(45400),s(64309),s(63595);var o=s(63200),n=s(25964),i=s(88961),r=s(66434);const a=(0,n.xE)("apps-list"),d=(0,o.Zz)((0,i.RF)({mappings:{maxHeight:{selector:()=>":host"},minHeight:{selector:()=>":host"},hostDirection:{selector:()=>":host",property:"direction"},itemsFontWeight:{selector:r.s.componentName,property:r.s.cssVarList.fontWeight},itemsFontSize:{selector:r.s.componentName,property:r.s.cssVarList.fontSize},itemsTextAlign:{selector:r.s.componentName,property:r.s.cssVarList.textAlign}}}),(0,i.t$)({itemRenderer:({name:t,icon:e,url:s},o,i)=>`\n <a ${s?`href="${s}" title="${s}"`:""} target="_blank">\n <descope-list-item>\n <descope-avatar\n ${e?`img="${e}"`:""}\n ${t?`display-name="${t}" abbr=${(0,n.ie)(t)}`:""}\n size=${i.size}\n ></descope-avatar>\n <descope-text\n variant="body1"\n mode="primary"\n >${t}</descope-text>\n </descope-list-item>\n </a>\n`,rerenderAttrsList:["size"]}),i.VO,i.tQ,(t=>class extends t{get size(){return this.getAttribute("size")||"sm"}}))((0,i.tz)({slots:["empty-state"],wrappedEleName:"descope-list",excludeAttrsSync:["tabindex","class","empty"],componentName:a,style:()=>`\n :host {\n width: 100%;\n display: inline-flex;\n }\n\n descope-text::part(text-wrapper) {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n a {\n text-decoration: none;\n }\n\n descope-text {\n ${r.s.cssVarList.hostDirection}: var(${d.cssVarList.hostDirection});\n }\n `}));customElements.define(a,d)},53149:(t,e,s)=>{s.d(e,{y:()=>i});var o=s(98741),n=s(30025);const i=(0,o.y)((t=>class extends t{get _keyboardActive(){return(0,n.aJ)()}ready(){this.addEventListener("focusin",(t=>{this._shouldSetFocus(t)&&this._setFocused(!0)})),this.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}}))},63595:(t,e,s)=>{s.r(e),s.d(e,{TextClass:()=>o.s,componentName:()=>o.T});var o=s(66434);customElements.define(o.T,o.s)},64309:(t,e,s)=>{s.r(e),s.d(e,{AvatarClass:()=>o.E,componentName:()=>o.T});var o=s(44666);s(4408),s(95260),s(37182),customElements.define(o.T,o.E)},65641:(t,e,s)=>{s.d(e,{P:()=>o});class o{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask((()=>{this.flush()})))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const s=[],o=[];t.length&&(e=t.filter((t=>!this._storedNodes.includes(t)))),this._storedNodes.length&&this._storedNodes.forEach(((e,n)=>{const i=t.indexOf(e);-1===i?s.push(e):i!==n&&o.push(e)})),(e.length||s.length||o.length)&&this.callback({addedNodes:e,movedNodes:o,removedNodes:s}),this._storedNodes=t}}},66434:(t,e,s)=>{s.d(e,{T:()=>a,s:()=>h});var o=s(88961),n=s(63200),i=s(25964),r=s(72270);const a=(0,i.xE)("text");class d extends((0,r.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,i.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:l}={host:{selector:()=>":host"}},h=(0,n.Zz)((0,o.RF)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),o.VO,o.tQ)(d)},81488:(t,e,s)=>{s.d(e,{I:()=>n});var o=s(44099);class n extends o.r{constructor(t){super(t,"tooltip"),this.setTarget(t)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.__notifyChange()}teardownNode(){this.__notifyChange()}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__notifyChange(){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:this.node}}))}}},93895:(t,e,s)=>{s.d(e,{O:()=>d,T:()=>a});var o=s(88961),n=s(63200),i=s(25964),r=s(72270);const a=(0,i.xE)("list-item"),d=(0,n.Zz)((0,o.RF)({mappings:{padding:{},backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),o.VO,o.tQ,(t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <slot></slot>\n ",(0,i.fz)("\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n ",this)}}),o.y)((0,r.qu)({componentName:a,baseSelector:"slot"}))}}]);
18
+ //# sourceMappingURL=descope-apps-list.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+
7
+ /**
8
+ * @license
9
+ * Copyright (c) 2021 - 2023 Vaadin Ltd.
10
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
11
+ */
12
+
13
+ /**
14
+ * @license
15
+ * Copyright (c) 2022 - 2023 Vaadin Ltd.
16
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
17
+ */
18
+
19
+ /**
20
+ * @license
21
+ * Copyright (c) 2023 Vaadin Ltd.
22
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
23
+ */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descope-apps-list.js","mappings":";2JAgBO,SAASA,EAAqBC,GACnC,MAAMC,EAAS,GAEf,KAAOD,GAAM,CACX,GAAIA,EAAKE,WAAaC,KAAKC,cAAe,CACxCH,EAAOI,KAAKL,GACZ,KACF,CAEIA,EAAKE,WAAaC,KAAKG,uBAOzBN,EADEA,EAAKO,aACAP,EAAKO,aAIPP,EAAKQ,YAVVP,EAAOI,KAAKL,GACZA,EAAOA,EAAKS,KAUhB,CAEA,OAAOR,CACT,CAUO,SAASS,EAAqBV,GACnC,MAAMC,EAAS,GACf,I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ArB2B,EAsB3B,QAAgB,CAAEN,gBAAeE,aAAc","sources":["webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/dom-utils.js","webpack://@descope/web-components-ui/../components/descope-list/src/component/ListClass.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/unique-id-utils.js","webpack://@descope/web-components-ui/../components/descope-list-item/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/vaadin-lumo-styles/sizing.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-controller.js","webpack://@descope/web-components-ui/../components/descope-avatar/src/component/AvatarClass.js","webpack://@descope/web-components-ui/../components/descope-list/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-apps-list/src/component/AppsListClass.js","webpack://@descope/web-components-ui/../components/descope-apps-list/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/a11y-base/src/focus-mixin.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-avatar/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-observer.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/tooltip-controller.js","webpack://@descope/web-components-ui/../components/descope-list-item/src/component/ListItemClass.js"],"sourcesContent":["/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns an array of ancestor root nodes for the given node.\n *\n * A root node is either a document node or a document fragment node (Shadow Root).\n * The array is collected by a bottom-up DOM traversing that starts with the given node\n * and involves both the light DOM and ancestor shadow DOM trees.\n *\n * @param {Node} node\n * @return {Node[]}\n */\nexport function getAncestorRootNodes(node) {\n const result = [];\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n result.push(node);\n break;\n }\n\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result.push(node);\n node = node.host;\n continue;\n }\n\n if (node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n\n node = node.parentNode;\n }\n\n return result;\n}\n\n/**\n * Returns the list of flattened elements for the given `node`.\n * This list consists of a node's children and, for any children that are\n * `<slot>` elements, the expanded flattened list of `assignedElements`.\n *\n * @param {Node} node\n * @return {Element[]}\n */\nexport function getFlattenedElements(node) {\n const result = [];\n let elements;\n if (node.localName === 'slot') {\n elements = node.assignedElements();\n } else {\n result.push(node);\n elements = [...node.children];\n }\n elements.forEach((elem) => result.push(...getFlattenedElements(elem)));\n return result;\n}\n\n/**\n * Traverses the given node and its parents, including those that are across\n * the shadow root boundaries, until it finds a node that matches the selector.\n *\n * @param {string} selector The CSS selector to match against\n * @param {Node} node The starting node for the traversal\n * @return {Node | null} The closest matching element, or null if no match is found\n */\nexport function getClosestElement(selector, node) {\n if (!node) {\n return null;\n }\n\n return node.closest(selector) || getClosestElement(selector, node.getRootNode().host);\n}\n\n/**\n * Takes a string with values separated by space and returns a set the values\n *\n * @param {string} value\n * @return {Set<string>}\n */\nexport function deserializeAttributeValue(value) {\n if (!value) {\n return new Set();\n }\n\n return new Set(value.split(' '));\n}\n\n/**\n * Takes a set of string values and returns a string with values separated by space\n *\n * @param {Set<string>} values\n * @return {string}\n */\nexport function serializeAttributeValue(values) {\n return values ? [...values].join(' ') : '';\n}\n\n/**\n * Adds a value to an attribute containing space-delimited values.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function addValueToAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.add(value);\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Removes a value from an attribute containing space-delimited values.\n * If the value is the last one, the whole attribute is removed.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function removeValueFromAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.delete(value);\n if (values.size === 0) {\n element.removeAttribute(attr);\n return;\n }\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Returns true if the given node is an empty text node, false otherwise.\n *\n * @param {Node} node\n * @return {boolean}\n */\nexport function isEmptyTextNode(node) {\n return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '';\n}\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { ListItemClass } from '@descope-ui/descope-list-item/class';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list');\n\nclass RawList extends createBaseClass({ componentName, baseSelector: '.wrapper' }) {\n static get observedAttributes() {\n return ['variant', 'readonly'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <slot></slot>\n <slot name=\"empty-state\">\n No item...\n </slot>\n </div>\n\t`;\n\n injectStyle(\n `\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name=\"empty-state\"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name=\"empty-state\"] {\n display: none;\n }\n :host([empty]) slot[name=\"empty-state\"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n `,\n this\n );\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n #handleEmptyState() {\n if (this.items.length === 0) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n }\n\n get variant() {\n return this.getAttribute('variant') || 'list';\n }\n\n #handleItemsVariant() {\n this.items.forEach((item) => {\n let listItem = item;\n if (listItem.localName !== ListItemClass.componentName) {\n listItem = item.querySelector(ListItemClass.componentName);\n }\n\n const listItemVariant = this.variant === 'tiles' ? 'tile' : 'row';\n listItem.setAttribute('variant', listItemVariant);\n });\n }\n\n init() {\n super.init?.();\n\n // we want new items to get the size\n observeChildren(this, () => {\n this.#handleEmptyState();\n this.#handleItemsVariant();\n this.#handleReadOnly();\n });\n }\n\n get isReadOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n #handleReadOnly() {\n this.items.forEach((item) => {\n if (this.isReadOnly) item.setAttribute('inert', '');\n else item.removeAttribute('inert');\n });\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (newValue === oldValue) return;\n\n if (name === 'variant') {\n this.#handleItemsVariant();\n } else if (name === 'readonly') {\n this.#handleReadOnly();\n }\n }\n}\n\nexport const ListClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n maxHeight: { selector: () => ':host' },\n minHeight: {},\n verticalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],\n horizontalPadding: [{ property: 'padding-left' }, { property: 'padding-right' }],\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontFamily: {},\n gap: {},\n\n backgroundColor: {},\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n boxShadow: {},\n gridTemplateColumns: {},\n maxItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'max-width' },\n minItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'min-width' },\n itemsHorizontalAlign: { selector: () => '::slotted(*)', property: 'justify-self' },\n emptyStateTextColor: { selector: () => 'slot[name=\"empty-state\"]', property: 'color' },\n emptyStateTextFontFamily: {\n selector: () => 'slot[name=\"empty-state\"]',\n property: 'font-family',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawList);\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nlet uniqueId = 0;\n\n/**\n * Resets the unique id counter.\n *\n * @return {void}\n */\nexport function resetUniqueId() {\n uniqueId = 0;\n}\n\n/**\n * Returns a unique integer id.\n *\n * @return {number}\n */\nexport function generateUniqueId() {\n // eslint-disable-next-line no-plusplus\n return uniqueId++;\n}\n","import { componentName, ListItemClass } from './ListItemClass';\n\ncustomElements.define(componentName, ListItemClass);\n\nexport { ListItemClass, componentName };\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport './version.js';\nimport { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { addLumoGlobalStyles } from './global.js';\n\nconst sizing = css`\n :host {\n --lumo-size-xs: 1.625rem;\n --lumo-size-s: 1.875rem;\n --lumo-size-m: 2.25rem;\n --lumo-size-l: 2.75rem;\n --lumo-size-xl: 3.5rem;\n\n /* Icons */\n --lumo-icon-size-s: 1.25em;\n --lumo-icon-size-m: 1.5em;\n --lumo-icon-size-l: 2.25em;\n /* For backwards compatibility */\n --lumo-icon-size: var(--lumo-icon-size-m);\n }\n`;\n\naddLumoGlobalStyles('sizing-props', sizing);\n\nexport { sizing };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { isEmptyTextNode } from './dom-utils.js';\nimport { SlotObserver } from './slot-observer.js';\nimport { generateUniqueId } from './unique-id-utils.js';\n\n/**\n * A controller for providing content to slot element and observing changes.\n */\nexport class SlotController extends EventTarget {\n /**\n * Ensure that every instance has unique ID.\n *\n * @param {HTMLElement} host\n * @param {string} slotName\n * @return {string}\n * @protected\n */\n static generateId(host, slotName) {\n const prefix = slotName || 'default';\n return `${prefix}-${host.localName}-${generateUniqueId()}`;\n }\n\n constructor(host, slotName, tagName, config = {}) {\n super();\n\n const { initializer, multiple, observe, useUniqueId } = config;\n\n this.host = host;\n this.slotName = slotName;\n this.tagName = tagName;\n this.observe = typeof observe === 'boolean' ? observe : true;\n this.multiple = typeof multiple === 'boolean' ? multiple : false;\n this.slotInitializer = initializer;\n\n if (multiple) {\n this.nodes = [];\n }\n\n // Only generate the default ID if requested by the controller.\n if (useUniqueId) {\n this.defaultId = this.constructor.generateId(host, slotName);\n }\n }\n\n hostConnected() {\n if (!this.initialized) {\n if (this.multiple) {\n this.initMultiple();\n } else {\n this.initSingle();\n }\n\n if (this.observe) {\n this.observeSlot();\n }\n\n this.initialized = true;\n }\n }\n\n /** @protected */\n initSingle() {\n let node = this.getSlotChild();\n\n if (!node) {\n node = this.attachDefaultNode();\n this.initNode(node);\n } else {\n this.node = node;\n this.initAddedNode(node);\n }\n }\n\n /** @protected */\n initMultiple() {\n const children = this.getSlotChildren();\n\n if (children.length === 0) {\n const defaultNode = this.attachDefaultNode();\n if (defaultNode) {\n this.nodes = [defaultNode];\n this.initNode(defaultNode);\n }\n } else {\n this.nodes = children;\n children.forEach((node) => {\n this.initAddedNode(node);\n });\n }\n }\n\n /**\n * Create and attach default node using the provided tag name, if any.\n * @return {Node | undefined}\n * @protected\n */\n attachDefaultNode() {\n const { host, slotName, tagName } = this;\n\n // Check if the node was created previously and if so, reuse it.\n let node = this.defaultNode;\n\n // Tag name is optional, sometimes we don't init default content.\n if (!node && tagName) {\n node = document.createElement(tagName);\n if (node instanceof Element) {\n if (slotName !== '') {\n node.setAttribute('slot', slotName);\n }\n this.defaultNode = node;\n }\n }\n\n if (node) {\n this.node = node;\n host.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * Return the list of nodes matching the slot managed by the controller.\n * @return {Node}\n */\n getSlotChildren() {\n const { slotName } = this;\n return Array.from(this.host.childNodes).filter((node) => {\n // Either an element (any slot) or a text node (only un-named slot).\n return (\n (node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) ||\n (node.nodeType === Node.TEXT_NODE && node.textContent.trim() && slotName === '')\n );\n });\n }\n\n /**\n * Return a reference to the node managed by the controller.\n * @return {Node}\n */\n getSlotChild() {\n return this.getSlotChildren()[0];\n }\n\n /**\n * Run `slotInitializer` for the node managed by the controller.\n *\n * @param {Node} node\n * @protected\n */\n initNode(node) {\n const { slotInitializer } = this;\n // Don't try to bind `this` to initializer (normally it's arrow function).\n // Instead, pass the host as a first argument to access component's state.\n if (slotInitializer) {\n slotInitializer(node, this.host);\n }\n }\n\n /**\n * Override to initialize the newly added custom node.\n *\n * @param {Node} _node\n * @protected\n */\n initCustomNode(_node) {}\n\n /**\n * Override to teardown slotted node when it's removed.\n *\n * @param {Node} _node\n * @protected\n */\n teardownNode(_node) {}\n\n /**\n * Run both `initCustomNode` and `initNode` for a custom slotted node.\n *\n * @param {Node} node\n * @protected\n */\n initAddedNode(node) {\n if (node !== this.defaultNode) {\n this.initCustomNode(node);\n this.initNode(node);\n }\n }\n\n /**\n * Setup the observer to manage slot content changes.\n * @protected\n */\n observeSlot() {\n const { slotName } = this;\n const selector = slotName === '' ? 'slot:not([name])' : `slot[name=${slotName}]`;\n const slot = this.host.shadowRoot.querySelector(selector);\n\n this.__slotObserver = new SlotObserver(slot, ({ addedNodes, removedNodes }) => {\n const current = this.multiple ? this.nodes : [this.node];\n\n // Calling `slot.assignedNodes()` includes whitespace text nodes in case of default slot:\n // unlike comment nodes, they are not filtered out. So we need to manually ignore them.\n const newNodes = addedNodes.filter((node) => !isEmptyTextNode(node) && !current.includes(node));\n\n if (removedNodes.length) {\n this.nodes = current.filter((node) => !removedNodes.includes(node));\n\n removedNodes.forEach((node) => {\n this.teardownNode(node);\n });\n }\n\n if (newNodes && newNodes.length > 0) {\n if (this.multiple) {\n // Remove default node if exists\n if (this.defaultNode) {\n this.defaultNode.remove();\n }\n this.nodes = [...current, ...newNodes].filter((node) => node !== this.defaultNode);\n newNodes.forEach((node) => {\n this.initAddedNode(node);\n });\n } else {\n // Remove previous node if exists\n if (this.node) {\n this.node.remove();\n }\n this.node = newNodes[0];\n this.initAddedNode(this.node);\n }\n }\n });\n }\n}\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n observeAttributes,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('avatar');\nclass RawAvatar extends createBaseClass({\n componentName,\n baseSelector: ':host > .wrapper',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <vaadin-avatar></vaadin-avatar>\n <div class=\"editableBadge\">\n <vaadin-icon icon=\"vaadin:pencil\"></vaadin-icon>\n </div>\n </div>\n\t\t`;\n\n injectStyle(`\n :host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\n .editableBadge {\n border: 1px solid;\n border-radius: 100%;\n height: fit-content;\n width: 25%;\n height: 25%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5%;\n box-sizing: border-box;\n position: absolute;\n bottom: 0;\n inset-inline-end: 0;\n }\n\n vaadin-icon {\n color: currentcolor;\n }\n\n vaadin-avatar {\n width: 100%;\n height: 100%;\n margin: 0;\n border: none\n }\n\n .wrapper {\n display: inline-flex;\n position: relative;\n width: 100%;\n height: 100%;\n }\n `, this);\n\n this.avatarComponent = this.shadowRoot.querySelector('vaadin-avatar');\n\n forwardAttrs(this, this.avatarComponent, {\n includeAttrs: ['display-name', 'img', 'abbr'],\n mapAttrs: { 'display-name': 'name' },\n });\n\n const editableIcon = this.shadowRoot.querySelector('.editableBadge');\n\n observeAttributes(\n this,\n () => {\n editableIcon.style.display = this.isEditable ? '' : 'none';\n },\n { includeAttrs: ['editable'] },\n );\n }\n\n get isEditable() {\n return this.getAttribute('editable') === 'true';\n }\n}\n\nconst { host, editableBadge, avatar } = {\n host: { selector: () => ':host' },\n editableBadge: { selector: '> .editableBadge' },\n avatar: { selector: 'vaadin-avatar' },\n};\n\nexport const AvatarClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: [\n { ...host, property: 'width' },\n { ...host, property: 'min-width' },\n ],\n hostHeight: { ...host, property: 'height' },\n cursor: [avatar, host],\n hostDirection: { ...host, property: 'direction' },\n avatarTextColor: { ...avatar, property: 'color' },\n avatarBackgroundColor: { ...avatar, property: 'background-color' },\n editableIconColor: { ...editableBadge, property: 'color' },\n editableBorderColor: { ...editableBadge, property: 'border-color' },\n editableBackgroundColor: {\n ...editableBadge,\n property: 'background-color',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawAvatar);\n","import '@descope-ui/descope-list-item';\n\nimport { componentName, ListClass } from './ListClass';\n\ncustomElements.define(componentName, ListClass);\n\nexport { ListClass, componentName };\n","import { compose } from '@descope-ui/common/utils';\nimport { getComponentName, limitAbbreviation } from '@descope-ui/common/components-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n createDynamicDataMixin,\n} from '@descope-ui/common/components-mixins';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('apps-list');\n\nconst itemRenderer = ({ name, icon, url }, _, ref) => `\n <a ${url ? `href=\"${url}\" title=\"${url}\"` : ''} target=\"_blank\">\n <descope-list-item>\n <descope-avatar\n ${icon ? `img=\"${icon}\"` : ''}\n ${name ? `display-name=\"${name}\" abbr=${limitAbbreviation(name)}` : ''}\n size=${ref.size}\n ></descope-avatar>\n <descope-text\n variant=\"body1\"\n mode=\"primary\"\n >${name}</descope-text>\n </descope-list-item>\n </a>\n`;\n\nconst customMixin = (superclass) =>\n class AppsListMixinClass extends superclass {\n get size() {\n return this.getAttribute('size') || 'sm';\n }\n };\n\nexport const AppsListClass = compose(\n createStyleMixin({\n mappings: {\n maxHeight: { selector: () => ':host' },\n minHeight: { selector: () => ':host' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n itemsFontWeight: {\n selector: TextClass.componentName,\n property: TextClass.cssVarList.fontWeight,\n },\n itemsFontSize: {\n selector: TextClass.componentName,\n property: TextClass.cssVarList.fontSize,\n },\n itemsTextAlign: {\n selector: TextClass.componentName,\n property: TextClass.cssVarList.textAlign,\n },\n },\n }),\n createDynamicDataMixin({ itemRenderer, rerenderAttrsList: ['size'] }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['empty-state'],\n wrappedEleName: 'descope-list',\n excludeAttrsSync: ['tabindex', 'class', 'empty'],\n componentName,\n style: () => `\n :host {\n width: 100%;\n display: inline-flex;\n }\n\n descope-text::part(text-wrapper) {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n a {\n text-decoration: none;\n }\n\n descope-text {\n ${TextClass.cssVarList.hostDirection}: var(${AppsListClass.cssVarList.hostDirection});\n }\n `,\n })\n);\n","import '@descope-ui/descope-list';\nimport '@descope-ui/descope-avatar';\nimport '@descope-ui/descope-text';\nimport { componentName, AppsListClass } from './AppsListClass';\n\ncustomElements.define(componentName, AppsListClass);\n\nexport { AppsListClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';\nimport { isKeyboardActive } from './focus-utils.js';\n\n/**\n * A mixin to handle `focused` and `focus-ring` attributes based on focus.\n *\n * @polymerMixin\n */\nexport const FocusMixin = dedupingMixin(\n (superclass) =>\n class FocusMixinClass extends superclass {\n /**\n * @protected\n * @return {boolean}\n */\n get _keyboardActive() {\n return isKeyboardActive();\n }\n\n /** @protected */\n ready() {\n this.addEventListener('focusin', (e) => {\n if (this._shouldSetFocus(e)) {\n this._setFocused(true);\n }\n });\n\n this.addEventListener('focusout', (e) => {\n if (this._shouldRemoveFocus(e)) {\n this._setFocused(false);\n }\n });\n\n // In super.ready() other 'focusin' and 'focusout' listeners might be\n // added, so we call it after our own ones to ensure they execute first.\n // Issue to watch out: when incorrect, <vaadin-combo-box> refocuses the\n // input field on iOS after \"Done\" is pressed.\n super.ready();\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n // In non-Chrome browsers, blur does not fire on the element when it is disconnected.\n // reproducible in `<vaadin-date-picker>` when closing on `Cancel` or `Today` click.\n if (this.hasAttribute('focused')) {\n this._setFocused(false);\n }\n }\n\n /**\n * Override to change how focused and focus-ring attributes are set.\n *\n * @param {boolean} focused\n * @protected\n */\n _setFocused(focused) {\n this.toggleAttribute('focused', focused);\n\n // Focus-ring is true when the element was focused from the keyboard.\n // Focus Ring [A11ycasts]: https://youtu.be/ilj2P5-5CjI\n this.toggleAttribute('focus-ring', focused && this._keyboardActive);\n }\n\n /**\n * Override to define if the field receives focus based on the event.\n *\n * @param {FocusEvent} _event\n * @return {boolean}\n * @protected\n */\n _shouldSetFocus(_event) {\n return true;\n }\n\n /**\n * Override to define if the field loses focus based on the event.\n *\n * @param {FocusEvent} _event\n * @return {boolean}\n * @protected\n */\n _shouldRemoveFocus(_event) {\n return true;\n }\n },\n);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import { componentName, AvatarClass } from './AvatarClass';\nimport '@vaadin/avatar';\nimport '@vaadin/icon';\nimport '@vaadin/icons';\n\ncustomElements.define(componentName, AvatarClass);\n\nexport { AvatarClass, componentName };\n","/**\n * @license\n * Copyright (c) 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A helper for observing slot changes.\n */\nexport class SlotObserver {\n constructor(slot, callback) {\n /** @type HTMLSlotElement */\n this.slot = slot;\n\n /** @type Function */\n this.callback = callback;\n\n /** @type {Node[]} */\n this._storedNodes = [];\n\n this._connected = false;\n this._scheduled = false;\n\n this._boundSchedule = () => {\n this._schedule();\n };\n\n this.connect();\n this._schedule();\n }\n\n /**\n * Activates an observer. This method is automatically called when\n * a `SlotObserver` is created. It should only be called to re-activate\n * an observer that has been deactivated via the `disconnect` method.\n */\n connect() {\n this.slot.addEventListener('slotchange', this._boundSchedule);\n this._connected = true;\n }\n\n /**\n * Deactivates the observer. After calling this method the observer callback\n * will not be called when changes to slotted nodes occur. The `connect` method\n * may be subsequently called to reactivate the observer.\n */\n disconnect() {\n this.slot.removeEventListener('slotchange', this._boundSchedule);\n this._connected = false;\n }\n\n /** @private */\n _schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n\n queueMicrotask(() => {\n this.flush();\n });\n }\n }\n\n /**\n * Run the observer callback synchronously.\n */\n flush() {\n if (!this._connected) {\n return;\n }\n\n this._scheduled = false;\n\n this._processNodes();\n }\n\n /** @private */\n _processNodes() {\n const currentNodes = this.slot.assignedNodes({ flatten: true });\n\n let addedNodes = [];\n const removedNodes = [];\n const movedNodes = [];\n\n if (currentNodes.length) {\n addedNodes = currentNodes.filter((node) => !this._storedNodes.includes(node));\n }\n\n if (this._storedNodes.length) {\n this._storedNodes.forEach((node, index) => {\n const idx = currentNodes.indexOf(node);\n if (idx === -1) {\n removedNodes.push(node);\n } else if (idx !== index) {\n movedNodes.push(node);\n }\n });\n }\n\n if (addedNodes.length || removedNodes.length || movedNodes.length) {\n this.callback({ addedNodes, movedNodes, removedNodes });\n }\n\n this._storedNodes = currentNodes;\n }\n}\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","/**\n * @license\n * Copyright (c) 2022 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from './slot-controller.js';\n\n/**\n * A controller that manages the slotted tooltip element.\n */\nexport class TooltipController extends SlotController {\n constructor(host) {\n // Do not provide slot factory to create tooltip lazily.\n super(host, 'tooltip');\n\n this.setTarget(host);\n }\n\n /**\n * Override to initialize the newly added custom tooltip.\n *\n * @param {Node} tooltipNode\n * @protected\n * @override\n */\n initCustomNode(tooltipNode) {\n tooltipNode.target = this.target;\n\n if (this.ariaTarget !== undefined) {\n tooltipNode.ariaTarget = this.ariaTarget;\n }\n\n if (this.context !== undefined) {\n tooltipNode.context = this.context;\n }\n\n if (this.manual !== undefined) {\n tooltipNode.manual = this.manual;\n }\n\n if (this.opened !== undefined) {\n tooltipNode.opened = this.opened;\n }\n\n if (this.position !== undefined) {\n tooltipNode._position = this.position;\n }\n\n if (this.shouldShow !== undefined) {\n tooltipNode.shouldShow = this.shouldShow;\n }\n\n this.__notifyChange();\n }\n\n /**\n * Override to notify the host when the tooltip is removed.\n *\n * @param {Node} tooltipNode\n * @protected\n * @override\n */\n teardownNode() {\n this.__notifyChange();\n }\n\n /**\n * Set an HTML element for linking with the tooltip overlay\n * via `aria-describedby` attribute used by screen readers.\n * @param {HTMLElement} ariaTarget\n */\n setAriaTarget(ariaTarget) {\n this.ariaTarget = ariaTarget;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.ariaTarget = ariaTarget;\n }\n }\n\n /**\n * Set a context object to be used by generator.\n * @param {object} context\n */\n setContext(context) {\n this.context = context;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.context = context;\n }\n }\n\n /**\n * Toggle manual state on the slotted tooltip.\n * @param {boolean} manual\n */\n setManual(manual) {\n this.manual = manual;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.manual = manual;\n }\n }\n\n /**\n * Toggle opened state on the slotted tooltip.\n * @param {boolean} opened\n */\n setOpened(opened) {\n this.opened = opened;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.opened = opened;\n }\n }\n\n /**\n * Set default position for the slotted tooltip.\n * This can be overridden by setting the position\n * using corresponding property or attribute.\n * @param {string} position\n */\n setPosition(position) {\n this.position = position;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode._position = position;\n }\n }\n\n /**\n * Set function used to detect whether to show\n * the tooltip based on a condition.\n * @param {Function} shouldShow\n */\n setShouldShow(shouldShow) {\n this.shouldShow = shouldShow;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.shouldShow = shouldShow;\n }\n }\n\n /**\n * Set an HTML element to attach the tooltip to.\n * @param {HTMLElement} target\n */\n setTarget(target) {\n this.target = target;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.target = target;\n }\n }\n\n /** @private */\n __notifyChange() {\n this.dispatchEvent(new CustomEvent('tooltip-changed', { detail: { node: this.node } }));\n }\n}\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n activeableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list-item');\n\nconst customMixin = (superclass) =>\n class ListItemMixinClass extends superclass {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot></slot>\n `;\n\n injectStyle(\n `\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n `,\n this\n );\n }\n };\n\nexport const ListItemClass = compose(\n createStyleMixin({\n mappings: {\n padding: {},\n backgroundColor: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n borderRadius: {},\n outline: {},\n cursor: {},\n gap: {},\n maxWidth: { selector: () => ':host' },\n alignItems: {},\n flexDirection: {},\n transition: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin,\n activeableMixin\n)(createBaseClass({ componentName, baseSelector: 'slot' }));\n"],"names":["getAncestorRootNodes","node","result","nodeType","Node","DOCUMENT_NODE","push","DOCUMENT_FRAGMENT_NODE","assignedSlot","parentNode","host","getFlattenedElements","elements","localName","assignedElements","children","forEach","elem","getClosestElement","selector","closest","getRootNode","deserializeAttributeValue","value","Set","split","serializeAttributeValue","values","join","addValueToAttribute","element","attr","getAttribute","add","setAttribute","removeValueFromAttribute","delete","size","removeAttribute","isEmptyTextNode","TEXT_NODE","textContent","trim","componentName","RawList","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","items","shadowRoot","querySelector","length","variant","item","listItem","listItemVariant","init","isReadOnly","attributeChangedCallback","name","oldValue","newValue","ListClass","mappings","hostWidth","property","maxHeight","minHeight","verticalPadding","horizontalPadding","hostDirection","fontFamily","gap","backgroundColor","borderRadius","borderColor","borderStyle","borderWidth","boxShadow","gridTemplateColumns","maxItemsWidth","minItemsWidth","itemsHorizontalAlign","emptyStateTextColor","emptyStateTextFontFamily","uniqueId","generateUniqueId","customElements","define","sizing","SlotController","EventTarget","generateId","slotName","tagName","config","initializer","multiple","observe","useUniqueId","slotInitializer","nodes","defaultId","hostConnected","initialized","initMultiple","initSingle","observeSlot","getSlotChild","initAddedNode","attachDefaultNode","initNode","getSlotChildren","defaultNode","document","createElement","Element","appendChild","Array","from","childNodes","filter","ELEMENT_NODE","slot","initCustomNode","_node","teardownNode","__slotObserver","addedNodes","removedNodes","current","newNodes","includes","remove","RawAvatar","avatarComponent","includeAttrs","mapAttrs","editableIcon","style","display","isEditable","editableBadge","avatar","AvatarClass","hostHeight","cursor","avatarTextColor","avatarBackgroundColor","editableIconColor","editableBorderColor","editableBackgroundColor","AppsListClass","itemsFontWeight","TextClass","cssVarList","fontWeight","itemsFontSize","fontSize","itemsTextAlign","textAlign","itemRenderer","icon","url","_","ref","rerenderAttrsList","superclass","slots","wrappedEleName","excludeAttrsSync","FocusMixin","_keyboardActive","ready","addEventListener","e","_shouldSetFocus","_setFocused","_shouldRemoveFocus","disconnectedCallback","hasAttribute","focused","toggleAttribute","_event","SlotObserver","callback","_storedNodes","_connected","_scheduled","_boundSchedule","_schedule","connect","disconnect","removeEventListener","queueMicrotask","flush","_processNodes","currentNodes","assignedNodes","flatten","movedNodes","index","idx","indexOf","RawText","hideWhenEmpty","hasChildren","textColor","textLineHeight","textLetterSpacing","textShadow","textTransform","fontStyle","TooltipController","setTarget","tooltipNode","target","undefined","ariaTarget","context","manual","opened","position","_position","shouldShow","__notifyChange","setAriaTarget","setContext","setManual","setOpened","setPosition","setShouldShow","dispatchEvent","CustomEvent","detail","ListItemClass","padding","outline","maxWidth","alignItems","flexDirection","transition"],"sourceRoot":""}
@@ -1,2 +1,18 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2272],{53557:(t,e,n)=>{n.r(e),n.d(e,{AvatarClass:()=>h,componentName:()=>s});var a=n(88961),o=n(72270),r=n(63200),i=n(25964);const s=(0,i.xE)("avatar");class d extends((0,o.qu)({componentName:s,baseSelector:":host > .wrapper"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <vaadin-avatar></vaadin-avatar>\n <div class="editableBadge">\n <vaadin-icon icon="vaadin:pencil"></vaadin-icon>\n </div>\n </div>\n\t\t',(0,i.fz)("\n :host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\n .editableBadge {\n border: 1px solid;\n border-radius: 100%;\n height: fit-content;\n width: 25%;\n height: 25%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5%;\n box-sizing: border-box;\n position: absolute;\n bottom: 0;\n inset-inline-end: 0;\n }\n\n vaadin-icon {\n color: currentcolor;\n }\n\n vaadin-avatar {\n width: 100%;\n height: 100%;\n margin: 0;\n border: none\n }\n\n .wrapper {\n display: inline-flex;\n position: relative;\n width: 100%;\n height: 100%;\n }\n ",this),this.avatarComponent=this.shadowRoot.querySelector("vaadin-avatar"),(0,i.EA)(this,this.avatarComponent,{includeAttrs:["display-name","img","abbr"],mapAttrs:{"display-name":"name"}});const t=this.shadowRoot.querySelector(".editableBadge");(0,i.mx)(this,(()=>{t.style.display=this.isEditable?"":"none"}),{includeAttrs:["editable"]})}get isEditable(){return"true"===this.getAttribute("editable")}}const{host:l,editableBadge:c,avatar:p}={host:{selector:()=>":host"},editableBadge:{selector:"> .editableBadge"},avatar:{selector:"vaadin-avatar"}},h=(0,r.Zz)((0,a.RF)({mappings:{hostWidth:[{...l,property:"width"},{...l,property:"min-width"}],hostHeight:{...l,property:"height"},cursor:[p,l],hostDirection:{...l,property:"direction"},avatarTextColor:{...p,property:"color"},avatarBackgroundColor:{...p,property:"background-color"},editableIconColor:{...c,property:"color"},editableBorderColor:{...c,property:"border-color"},editableBackgroundColor:{...c,property:"background-color"}}}),a.VO,a.tQ)(d);n(4408),n(95260),n(37182),customElements.define(s,h)}}]);
1
+ /*! For license information please see descope-avatar.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2272],{1508:(t,e,o)=>{function s(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function i(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach((t=>e.push(...i(t)))),e}function n(t,e){return e?e.closest(t)||n(t,e.getRootNode().host):null}function d(t){return t?new Set(t.split(" ")):new Set}function a(t){return t?[...t].join(" "):""}function r(t,e,o){const s=d(t.getAttribute(e));s.add(o),t.setAttribute(e,a(s))}function h(t,e,o){const s=d(t.getAttribute(e));s.delete(o),0!==s.size?t.setAttribute(e,a(s)):t.removeAttribute(e)}function l(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{Dy:()=>s,J$:()=>i,Wr:()=>h,Z4:()=>d,ZA:()=>l,el:()=>n,iA:()=>r,sz:()=>a})},11707:(t,e,o)=>{o.d(e,{I:()=>i});let s=0;function i(){return s++}},42068:(t,e,o)=>{o(88660);var s=o(87550),i=o(36411);const n=s.AH`
3
+ :host {
4
+ --lumo-size-xs: 1.625rem;
5
+ --lumo-size-s: 1.875rem;
6
+ --lumo-size-m: 2.25rem;
7
+ --lumo-size-l: 2.75rem;
8
+ --lumo-size-xl: 3.5rem;
9
+
10
+ /* Icons */
11
+ --lumo-icon-size-s: 1.25em;
12
+ --lumo-icon-size-m: 1.5em;
13
+ --lumo-icon-size-l: 2.25em;
14
+ /* For backwards compatibility */
15
+ --lumo-icon-size: var(--lumo-icon-size-m);
16
+ }
17
+ `;(0,i.q)("sizing-props",n)},44099:(t,e,o)=>{o.d(e,{r:()=>d});var s=o(1508),i=o(65641),n=o(11707);class d extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,n.I)()}`}constructor(t,e,o,s={}){super();const{initializer:i,multiple:n,observe:d,useUniqueId:a}=s;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof d||d,this.multiple="boolean"==typeof n&&n,this.slotInitializer=i,n&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach((t=>{this.initAddedNode(t)}))}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let s=this.defaultNode;return!s&&o&&(s=document.createElement(o),s instanceof Element&&(""!==e&&s.setAttribute("slot",e),this.defaultNode=s)),s&&(this.node=s,t.appendChild(s)),s}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter((e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new i.P(o,(({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],i=t.filter((t=>!(0,s.ZA)(t)&&!o.includes(t)));e.length&&(this.nodes=o.filter((t=>!e.includes(t))),e.forEach((t=>{this.teardownNode(t)}))),i&&i.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...i].filter((t=>t!==this.defaultNode)),i.forEach((t=>{this.initAddedNode(t)}))):(this.node&&this.node.remove(),this.node=i[0],this.initAddedNode(this.node)))}))}}},44666:(t,e,o)=>{o.d(e,{E:()=>u,T:()=>a});var s=o(88961),i=o(72270),n=o(63200),d=o(25964);const a=(0,d.xE)("avatar");class r extends((0,i.qu)({componentName:a,baseSelector:":host > .wrapper"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <vaadin-avatar></vaadin-avatar>\n <div class="editableBadge">\n <vaadin-icon icon="vaadin:pencil"></vaadin-icon>\n </div>\n </div>\n\t\t',(0,d.fz)("\n :host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\n .editableBadge {\n border: 1px solid;\n border-radius: 100%;\n height: fit-content;\n width: 25%;\n height: 25%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5%;\n box-sizing: border-box;\n position: absolute;\n bottom: 0;\n inset-inline-end: 0;\n }\n\n vaadin-icon {\n color: currentcolor;\n }\n\n vaadin-avatar {\n width: 100%;\n height: 100%;\n margin: 0;\n border: none\n }\n\n .wrapper {\n display: inline-flex;\n position: relative;\n width: 100%;\n height: 100%;\n }\n ",this),this.avatarComponent=this.shadowRoot.querySelector("vaadin-avatar"),(0,d.EA)(this,this.avatarComponent,{includeAttrs:["display-name","img","abbr"],mapAttrs:{"display-name":"name"}});const t=this.shadowRoot.querySelector(".editableBadge");(0,d.mx)(this,(()=>{t.style.display=this.isEditable?"":"none"}),{includeAttrs:["editable"]})}get isEditable(){return"true"===this.getAttribute("editable")}}const{host:h,editableBadge:l,avatar:c}={host:{selector:()=>":host"},editableBadge:{selector:"> .editableBadge"},avatar:{selector:"vaadin-avatar"}},u=(0,n.Zz)((0,s.RF)({mappings:{hostWidth:[{...h,property:"width"},{...h,property:"min-width"}],hostHeight:{...h,property:"height"},cursor:[c,h],hostDirection:{...h,property:"direction"},avatarTextColor:{...c,property:"color"},avatarBackgroundColor:{...c,property:"background-color"},editableIconColor:{...l,property:"color"},editableBorderColor:{...l,property:"border-color"},editableBackgroundColor:{...l,property:"background-color"}}}),s.VO,s.tQ)(r)},53149:(t,e,o)=>{o.d(e,{y:()=>n});var s=o(98741),i=o(30025);const n=(0,s.y)((t=>class extends t{get _keyboardActive(){return(0,i.aJ)()}ready(){this.addEventListener("focusin",(t=>{this._shouldSetFocus(t)&&this._setFocused(!0)})),this.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}}))},64309:(t,e,o)=>{o.r(e),o.d(e,{AvatarClass:()=>s.E,componentName:()=>s.T});var s=o(44666);o(4408),o(95260),o(37182),customElements.define(s.T,s.E)},65641:(t,e,o)=>{o.d(e,{P:()=>s});class s{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask((()=>{this.flush()})))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],s=[];t.length&&(e=t.filter((t=>!this._storedNodes.includes(t)))),this._storedNodes.length&&this._storedNodes.forEach(((e,i)=>{const n=t.indexOf(e);-1===n?o.push(e):n!==i&&s.push(e)})),(e.length||o.length||s.length)&&this.callback({addedNodes:e,movedNodes:s,removedNodes:o}),this._storedNodes=t}}},81488:(t,e,o)=>{o.d(e,{I:()=>i});var s=o(44099);class i extends s.r{constructor(t){super(t,"tooltip"),this.setTarget(t)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.__notifyChange()}teardownNode(){this.__notifyChange()}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__notifyChange(){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:this.node}}))}}}}]);
2
18
  //# sourceMappingURL=descope-avatar.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+
7
+ /**
8
+ * @license
9
+ * Copyright (c) 2021 - 2023 Vaadin Ltd.
10
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
11
+ */
12
+
13
+ /**
14
+ * @license
15
+ * Copyright (c) 2022 - 2023 Vaadin Ltd.
16
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
17
+ */
18
+
19
+ /**
20
+ * @license
21
+ * Copyright (c) 2023 Vaadin Ltd.
22
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
23
+ */
@@ -1 +1 @@
1
- {"version":3,"file":"descope-avatar.js","mappings":"+OAcO,MAAMA,GAAgB,QAAiB,UAC9C,MAAMC,WAAkB,QAAgB,CACtCD,gBACAE,aAAc,sBAEd,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,+MAShD,QAAY,m0BAsCTH,MAEHA,KAAKI,gBAAkBJ,KAAKK,WAAWC,cAAc,kBAErD,QAAaN,KAAMA,KAAKI,gBAAiB,CACvCG,aAAc,CAAC,eAAgB,MAAO,QACtCC,SAAU,CAAE,eAAgB,UAG9B,MAAMC,EAAeT,KAAKK,WAAWC,cAAc,mBAEnD,QACEN,MACA,KACES,EAAaC,MAAMC,QAAUX,KAAKY,WAAa,GAAK,MAAM,GAE5D,CAAEL,aAAc,CAAC,aAErB,CAEA,cAAIK,GACF,MAAyC,SAAlCZ,KAAKa,aAAa,WAC3B,EAGF,MAAM,KAAEC,EAAI,cAAEC,EAAa,OAAEC,GAAW,CACtCF,KAAM,CAAEG,SAAU,IAAM,SACxBF,cAAe,CAAEE,SAAU,oBAC3BD,OAAQ,CAAEC,SAAU,kBAGTC,GAAc,SACzB,QAAiB,CACfC,SAAU,CACRC,UAAW,CACT,IAAKN,EAAMO,SAAU,SACrB,IAAKP,EAAMO,SAAU,cAEvBC,WAAY,IAAKR,EAAMO,SAAU,UACjCE,OAAQ,CAACP,EAAQF,GACjBU,cAAe,IAAKV,EAAMO,SAAU,aACpCI,gBAAiB,IAAKT,EAAQK,SAAU,SACxCK,sBAAuB,IAAKV,EAAQK,SAAU,oBAC9CM,kBAAmB,IAAKZ,EAAeM,SAAU,SACjDO,oBAAqB,IAAKb,EAAeM,SAAU,gBACnDQ,wBAAyB,IACpBd,EACHM,SAAU,uBAIhB,KACA,KArByB,CAsBzBzB,G,0BCrHFkC,eAAeC,OAAOpC,EAAeuB,E","sources":["webpack://@descope/web-components-ui/../components/descope-avatar/src/component/AvatarClass.js","webpack://@descope/web-components-ui/../components/descope-avatar/src/component/index.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n observeAttributes,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('avatar');\nclass RawAvatar extends createBaseClass({\n componentName,\n baseSelector: ':host > .wrapper',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <vaadin-avatar></vaadin-avatar>\n <div class=\"editableBadge\">\n <vaadin-icon icon=\"vaadin:pencil\"></vaadin-icon>\n </div>\n </div>\n\t\t`;\n\n injectStyle(`\n :host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\n .editableBadge {\n border: 1px solid;\n border-radius: 100%;\n height: fit-content;\n width: 25%;\n height: 25%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5%;\n box-sizing: border-box;\n position: absolute;\n bottom: 0;\n inset-inline-end: 0;\n }\n\n vaadin-icon {\n color: currentcolor;\n }\n\n vaadin-avatar {\n width: 100%;\n height: 100%;\n margin: 0;\n border: none\n }\n\n .wrapper {\n display: inline-flex;\n position: relative;\n width: 100%;\n height: 100%;\n }\n `, this);\n\n this.avatarComponent = this.shadowRoot.querySelector('vaadin-avatar');\n\n forwardAttrs(this, this.avatarComponent, {\n includeAttrs: ['display-name', 'img', 'abbr'],\n mapAttrs: { 'display-name': 'name' },\n });\n\n const editableIcon = this.shadowRoot.querySelector('.editableBadge');\n\n observeAttributes(\n this,\n () => {\n editableIcon.style.display = this.isEditable ? '' : 'none';\n },\n { includeAttrs: ['editable'] },\n );\n }\n\n get isEditable() {\n return this.getAttribute('editable') === 'true';\n }\n}\n\nconst { host, editableBadge, avatar } = {\n host: { selector: () => ':host' },\n editableBadge: { selector: '> .editableBadge' },\n avatar: { selector: 'vaadin-avatar' },\n};\n\nexport const AvatarClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: [\n { ...host, property: 'width' },\n { ...host, property: 'min-width' },\n ],\n hostHeight: { ...host, property: 'height' },\n cursor: [avatar, host],\n hostDirection: { ...host, property: 'direction' },\n avatarTextColor: { ...avatar, property: 'color' },\n avatarBackgroundColor: { ...avatar, property: 'background-color' },\n editableIconColor: { ...editableBadge, property: 'color' },\n editableBorderColor: { ...editableBadge, property: 'border-color' },\n editableBackgroundColor: {\n ...editableBadge,\n property: 'background-color',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawAvatar);\n","import { componentName, AvatarClass } from './AvatarClass';\nimport '@vaadin/avatar';\nimport '@vaadin/icon';\nimport '@vaadin/icons';\n\ncustomElements.define(componentName, AvatarClass);\n\nexport { AvatarClass, componentName };\n"],"names":["componentName","RawAvatar","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","avatarComponent","shadowRoot","querySelector","includeAttrs","mapAttrs","editableIcon","style","display","isEditable","getAttribute","host","editableBadge","avatar","selector","AvatarClass","mappings","hostWidth","property","hostHeight","cursor","hostDirection","avatarTextColor","avatarBackgroundColor","editableIconColor","editableBorderColor","editableBackgroundColor","customElements","define"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-avatar.js","mappings":";wIAgBO,SAASA,EAAqBC,GACnC,MAAMC,EAAS,GAEf,KAAOD,GAAM,CACX,GAAIA,EAAKE,WAAaC,KAAKC,cAAe,CACxCH,EAAOI,KAAKL,GACZ,KACF,CAEIA,EAAKE,WAAaC,KAAKG,uBAOzBN,EADEA,EAAKO,aACAP,EAAKO,aAIPP,EAAKQ,YAVVP,EAAOI,KAAKL,GACZA,EAAOA,EAAKS,KAUhB,CAEA,OAAOR,CACT,CAUO,SAASS,EAAqBV,GACnC,MAAMC,EAAS,GACf,IAAIU,EAQJ,MAPuB,SAAnBX,EAAKY,UACPD,EAAWX,EAAKa,oBAEhBZ,EAAOI,KAAKL,GACZW,EAAW,IAAIX,EAAKc,WAEtBH,EAASI,SAASC,GAASf,EAAOI,QAAQK,EAAqBM,MACxDf,CACT,CAUO,SAASgB,EAAkBC,EAAUlB,GAC1C,OAAKA,EAIEA,EAAKmB,QAAQD,IAAaD,EAAkBC,EAAUlB,EAAKoB,cAAcX,MAHvE,IAIX,CAQO,SAASY,EAA0BC,GACxC,OAAK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Ed,MAAMD,EAAcvG,KAAKzD,KACrBgK,IACFA,EAAYC,OAASA,EAEzB,CAGA,cAAAS,GACEjH,KAAKwH,cAAc,IAAIC,YAAY,kBAAmB,CAAEC,OAAQ,CAAEnL,KAAMyD,KAAKzD,QAC/E","sources":["webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/dom-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/unique-id-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/vaadin-lumo-styles/sizing.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-controller.js","webpack://@descope/web-components-ui/../components/descope-avatar/src/component/AvatarClass.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/a11y-base/src/focus-mixin.js","webpack://@descope/web-components-ui/../components/descope-avatar/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-observer.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/tooltip-controller.js"],"sourcesContent":["/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns an array of ancestor root nodes for the given node.\n *\n * A root node is either a document node or a document fragment node (Shadow Root).\n * The array is collected by a bottom-up DOM traversing that starts with the given node\n * and involves both the light DOM and ancestor shadow DOM trees.\n *\n * @param {Node} node\n * @return {Node[]}\n */\nexport function getAncestorRootNodes(node) {\n const result = [];\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n result.push(node);\n break;\n }\n\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result.push(node);\n node = node.host;\n continue;\n }\n\n if (node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n\n node = node.parentNode;\n }\n\n return result;\n}\n\n/**\n * Returns the list of flattened elements for the given `node`.\n * This list consists of a node's children and, for any children that are\n * `<slot>` elements, the expanded flattened list of `assignedElements`.\n *\n * @param {Node} node\n * @return {Element[]}\n */\nexport function getFlattenedElements(node) {\n const result = [];\n let elements;\n if (node.localName === 'slot') {\n elements = node.assignedElements();\n } else {\n result.push(node);\n elements = [...node.children];\n }\n elements.forEach((elem) => result.push(...getFlattenedElements(elem)));\n return result;\n}\n\n/**\n * Traverses the given node and its parents, including those that are across\n * the shadow root boundaries, until it finds a node that matches the selector.\n *\n * @param {string} selector The CSS selector to match against\n * @param {Node} node The starting node for the traversal\n * @return {Node | null} The closest matching element, or null if no match is found\n */\nexport function getClosestElement(selector, node) {\n if (!node) {\n return null;\n }\n\n return node.closest(selector) || getClosestElement(selector, node.getRootNode().host);\n}\n\n/**\n * Takes a string with values separated by space and returns a set the values\n *\n * @param {string} value\n * @return {Set<string>}\n */\nexport function deserializeAttributeValue(value) {\n if (!value) {\n return new Set();\n }\n\n return new Set(value.split(' '));\n}\n\n/**\n * Takes a set of string values and returns a string with values separated by space\n *\n * @param {Set<string>} values\n * @return {string}\n */\nexport function serializeAttributeValue(values) {\n return values ? [...values].join(' ') : '';\n}\n\n/**\n * Adds a value to an attribute containing space-delimited values.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function addValueToAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.add(value);\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Removes a value from an attribute containing space-delimited values.\n * If the value is the last one, the whole attribute is removed.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function removeValueFromAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.delete(value);\n if (values.size === 0) {\n element.removeAttribute(attr);\n return;\n }\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Returns true if the given node is an empty text node, false otherwise.\n *\n * @param {Node} node\n * @return {boolean}\n */\nexport function isEmptyTextNode(node) {\n return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '';\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nlet uniqueId = 0;\n\n/**\n * Resets the unique id counter.\n *\n * @return {void}\n */\nexport function resetUniqueId() {\n uniqueId = 0;\n}\n\n/**\n * Returns a unique integer id.\n *\n * @return {number}\n */\nexport function generateUniqueId() {\n // eslint-disable-next-line no-plusplus\n return uniqueId++;\n}\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport './version.js';\nimport { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { addLumoGlobalStyles } from './global.js';\n\nconst sizing = css`\n :host {\n --lumo-size-xs: 1.625rem;\n --lumo-size-s: 1.875rem;\n --lumo-size-m: 2.25rem;\n --lumo-size-l: 2.75rem;\n --lumo-size-xl: 3.5rem;\n\n /* Icons */\n --lumo-icon-size-s: 1.25em;\n --lumo-icon-size-m: 1.5em;\n --lumo-icon-size-l: 2.25em;\n /* For backwards compatibility */\n --lumo-icon-size: var(--lumo-icon-size-m);\n }\n`;\n\naddLumoGlobalStyles('sizing-props', sizing);\n\nexport { sizing };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { isEmptyTextNode } from './dom-utils.js';\nimport { SlotObserver } from './slot-observer.js';\nimport { generateUniqueId } from './unique-id-utils.js';\n\n/**\n * A controller for providing content to slot element and observing changes.\n */\nexport class SlotController extends EventTarget {\n /**\n * Ensure that every instance has unique ID.\n *\n * @param {HTMLElement} host\n * @param {string} slotName\n * @return {string}\n * @protected\n */\n static generateId(host, slotName) {\n const prefix = slotName || 'default';\n return `${prefix}-${host.localName}-${generateUniqueId()}`;\n }\n\n constructor(host, slotName, tagName, config = {}) {\n super();\n\n const { initializer, multiple, observe, useUniqueId } = config;\n\n this.host = host;\n this.slotName = slotName;\n this.tagName = tagName;\n this.observe = typeof observe === 'boolean' ? observe : true;\n this.multiple = typeof multiple === 'boolean' ? multiple : false;\n this.slotInitializer = initializer;\n\n if (multiple) {\n this.nodes = [];\n }\n\n // Only generate the default ID if requested by the controller.\n if (useUniqueId) {\n this.defaultId = this.constructor.generateId(host, slotName);\n }\n }\n\n hostConnected() {\n if (!this.initialized) {\n if (this.multiple) {\n this.initMultiple();\n } else {\n this.initSingle();\n }\n\n if (this.observe) {\n this.observeSlot();\n }\n\n this.initialized = true;\n }\n }\n\n /** @protected */\n initSingle() {\n let node = this.getSlotChild();\n\n if (!node) {\n node = this.attachDefaultNode();\n this.initNode(node);\n } else {\n this.node = node;\n this.initAddedNode(node);\n }\n }\n\n /** @protected */\n initMultiple() {\n const children = this.getSlotChildren();\n\n if (children.length === 0) {\n const defaultNode = this.attachDefaultNode();\n if (defaultNode) {\n this.nodes = [defaultNode];\n this.initNode(defaultNode);\n }\n } else {\n this.nodes = children;\n children.forEach((node) => {\n this.initAddedNode(node);\n });\n }\n }\n\n /**\n * Create and attach default node using the provided tag name, if any.\n * @return {Node | undefined}\n * @protected\n */\n attachDefaultNode() {\n const { host, slotName, tagName } = this;\n\n // Check if the node was created previously and if so, reuse it.\n let node = this.defaultNode;\n\n // Tag name is optional, sometimes we don't init default content.\n if (!node && tagName) {\n node = document.createElement(tagName);\n if (node instanceof Element) {\n if (slotName !== '') {\n node.setAttribute('slot', slotName);\n }\n this.defaultNode = node;\n }\n }\n\n if (node) {\n this.node = node;\n host.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * Return the list of nodes matching the slot managed by the controller.\n * @return {Node}\n */\n getSlotChildren() {\n const { slotName } = this;\n return Array.from(this.host.childNodes).filter((node) => {\n // Either an element (any slot) or a text node (only un-named slot).\n return (\n (node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) ||\n (node.nodeType === Node.TEXT_NODE && node.textContent.trim() && slotName === '')\n );\n });\n }\n\n /**\n * Return a reference to the node managed by the controller.\n * @return {Node}\n */\n getSlotChild() {\n return this.getSlotChildren()[0];\n }\n\n /**\n * Run `slotInitializer` for the node managed by the controller.\n *\n * @param {Node} node\n * @protected\n */\n initNode(node) {\n const { slotInitializer } = this;\n // Don't try to bind `this` to initializer (normally it's arrow function).\n // Instead, pass the host as a first argument to access component's state.\n if (slotInitializer) {\n slotInitializer(node, this.host);\n }\n }\n\n /**\n * Override to initialize the newly added custom node.\n *\n * @param {Node} _node\n * @protected\n */\n initCustomNode(_node) {}\n\n /**\n * Override to teardown slotted node when it's removed.\n *\n * @param {Node} _node\n * @protected\n */\n teardownNode(_node) {}\n\n /**\n * Run both `initCustomNode` and `initNode` for a custom slotted node.\n *\n * @param {Node} node\n * @protected\n */\n initAddedNode(node) {\n if (node !== this.defaultNode) {\n this.initCustomNode(node);\n this.initNode(node);\n }\n }\n\n /**\n * Setup the observer to manage slot content changes.\n * @protected\n */\n observeSlot() {\n const { slotName } = this;\n const selector = slotName === '' ? 'slot:not([name])' : `slot[name=${slotName}]`;\n const slot = this.host.shadowRoot.querySelector(selector);\n\n this.__slotObserver = new SlotObserver(slot, ({ addedNodes, removedNodes }) => {\n const current = this.multiple ? this.nodes : [this.node];\n\n // Calling `slot.assignedNodes()` includes whitespace text nodes in case of default slot:\n // unlike comment nodes, they are not filtered out. So we need to manually ignore them.\n const newNodes = addedNodes.filter((node) => !isEmptyTextNode(node) && !current.includes(node));\n\n if (removedNodes.length) {\n this.nodes = current.filter((node) => !removedNodes.includes(node));\n\n removedNodes.forEach((node) => {\n this.teardownNode(node);\n });\n }\n\n if (newNodes && newNodes.length > 0) {\n if (this.multiple) {\n // Remove default node if exists\n if (this.defaultNode) {\n this.defaultNode.remove();\n }\n this.nodes = [...current, ...newNodes].filter((node) => node !== this.defaultNode);\n newNodes.forEach((node) => {\n this.initAddedNode(node);\n });\n } else {\n // Remove previous node if exists\n if (this.node) {\n this.node.remove();\n }\n this.node = newNodes[0];\n this.initAddedNode(this.node);\n }\n }\n });\n }\n}\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n observeAttributes,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('avatar');\nclass RawAvatar extends createBaseClass({\n componentName,\n baseSelector: ':host > .wrapper',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <vaadin-avatar></vaadin-avatar>\n <div class=\"editableBadge\">\n <vaadin-icon icon=\"vaadin:pencil\"></vaadin-icon>\n </div>\n </div>\n\t\t`;\n\n injectStyle(`\n :host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\n .editableBadge {\n border: 1px solid;\n border-radius: 100%;\n height: fit-content;\n width: 25%;\n height: 25%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5%;\n box-sizing: border-box;\n position: absolute;\n bottom: 0;\n inset-inline-end: 0;\n }\n\n vaadin-icon {\n color: currentcolor;\n }\n\n vaadin-avatar {\n width: 100%;\n height: 100%;\n margin: 0;\n border: none\n }\n\n .wrapper {\n display: inline-flex;\n position: relative;\n width: 100%;\n height: 100%;\n }\n `, this);\n\n this.avatarComponent = this.shadowRoot.querySelector('vaadin-avatar');\n\n forwardAttrs(this, this.avatarComponent, {\n includeAttrs: ['display-name', 'img', 'abbr'],\n mapAttrs: { 'display-name': 'name' },\n });\n\n const editableIcon = this.shadowRoot.querySelector('.editableBadge');\n\n observeAttributes(\n this,\n () => {\n editableIcon.style.display = this.isEditable ? '' : 'none';\n },\n { includeAttrs: ['editable'] },\n );\n }\n\n get isEditable() {\n return this.getAttribute('editable') === 'true';\n }\n}\n\nconst { host, editableBadge, avatar } = {\n host: { selector: () => ':host' },\n editableBadge: { selector: '> .editableBadge' },\n avatar: { selector: 'vaadin-avatar' },\n};\n\nexport const AvatarClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: [\n { ...host, property: 'width' },\n { ...host, property: 'min-width' },\n ],\n hostHeight: { ...host, property: 'height' },\n cursor: [avatar, host],\n hostDirection: { ...host, property: 'direction' },\n avatarTextColor: { ...avatar, property: 'color' },\n avatarBackgroundColor: { ...avatar, property: 'background-color' },\n editableIconColor: { ...editableBadge, property: 'color' },\n editableBorderColor: { ...editableBadge, property: 'border-color' },\n editableBackgroundColor: {\n ...editableBadge,\n property: 'background-color',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawAvatar);\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';\nimport { isKeyboardActive } from './focus-utils.js';\n\n/**\n * A mixin to handle `focused` and `focus-ring` attributes based on focus.\n *\n * @polymerMixin\n */\nexport const FocusMixin = dedupingMixin(\n (superclass) =>\n class FocusMixinClass extends superclass {\n /**\n * @protected\n * @return {boolean}\n */\n get _keyboardActive() {\n return isKeyboardActive();\n }\n\n /** @protected */\n ready() {\n this.addEventListener('focusin', (e) => {\n if (this._shouldSetFocus(e)) {\n this._setFocused(true);\n }\n });\n\n this.addEventListener('focusout', (e) => {\n if (this._shouldRemoveFocus(e)) {\n this._setFocused(false);\n }\n });\n\n // In super.ready() other 'focusin' and 'focusout' listeners might be\n // added, so we call it after our own ones to ensure they execute first.\n // Issue to watch out: when incorrect, <vaadin-combo-box> refocuses the\n // input field on iOS after \"Done\" is pressed.\n super.ready();\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n // In non-Chrome browsers, blur does not fire on the element when it is disconnected.\n // reproducible in `<vaadin-date-picker>` when closing on `Cancel` or `Today` click.\n if (this.hasAttribute('focused')) {\n this._setFocused(false);\n }\n }\n\n /**\n * Override to change how focused and focus-ring attributes are set.\n *\n * @param {boolean} focused\n * @protected\n */\n _setFocused(focused) {\n this.toggleAttribute('focused', focused);\n\n // Focus-ring is true when the element was focused from the keyboard.\n // Focus Ring [A11ycasts]: https://youtu.be/ilj2P5-5CjI\n this.toggleAttribute('focus-ring', focused && this._keyboardActive);\n }\n\n /**\n * Override to define if the field receives focus based on the event.\n *\n * @param {FocusEvent} _event\n * @return {boolean}\n * @protected\n */\n _shouldSetFocus(_event) {\n return true;\n }\n\n /**\n * Override to define if the field loses focus based on the event.\n *\n * @param {FocusEvent} _event\n * @return {boolean}\n * @protected\n */\n _shouldRemoveFocus(_event) {\n return true;\n }\n },\n);\n","import { componentName, AvatarClass } from './AvatarClass';\nimport '@vaadin/avatar';\nimport '@vaadin/icon';\nimport '@vaadin/icons';\n\ncustomElements.define(componentName, AvatarClass);\n\nexport { AvatarClass, componentName };\n","/**\n * @license\n * Copyright (c) 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A helper for observing slot changes.\n */\nexport class SlotObserver {\n constructor(slot, callback) {\n /** @type HTMLSlotElement */\n this.slot = slot;\n\n /** @type Function */\n this.callback = callback;\n\n /** @type {Node[]} */\n this._storedNodes = [];\n\n this._connected = false;\n this._scheduled = false;\n\n this._boundSchedule = () => {\n this._schedule();\n };\n\n this.connect();\n this._schedule();\n }\n\n /**\n * Activates an observer. This method is automatically called when\n * a `SlotObserver` is created. It should only be called to re-activate\n * an observer that has been deactivated via the `disconnect` method.\n */\n connect() {\n this.slot.addEventListener('slotchange', this._boundSchedule);\n this._connected = true;\n }\n\n /**\n * Deactivates the observer. After calling this method the observer callback\n * will not be called when changes to slotted nodes occur. The `connect` method\n * may be subsequently called to reactivate the observer.\n */\n disconnect() {\n this.slot.removeEventListener('slotchange', this._boundSchedule);\n this._connected = false;\n }\n\n /** @private */\n _schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n\n queueMicrotask(() => {\n this.flush();\n });\n }\n }\n\n /**\n * Run the observer callback synchronously.\n */\n flush() {\n if (!this._connected) {\n return;\n }\n\n this._scheduled = false;\n\n this._processNodes();\n }\n\n /** @private */\n _processNodes() {\n const currentNodes = this.slot.assignedNodes({ flatten: true });\n\n let addedNodes = [];\n const removedNodes = [];\n const movedNodes = [];\n\n if (currentNodes.length) {\n addedNodes = currentNodes.filter((node) => !this._storedNodes.includes(node));\n }\n\n if (this._storedNodes.length) {\n this._storedNodes.forEach((node, index) => {\n const idx = currentNodes.indexOf(node);\n if (idx === -1) {\n removedNodes.push(node);\n } else if (idx !== index) {\n movedNodes.push(node);\n }\n });\n }\n\n if (addedNodes.length || removedNodes.length || movedNodes.length) {\n this.callback({ addedNodes, movedNodes, removedNodes });\n }\n\n this._storedNodes = currentNodes;\n }\n}\n","/**\n * @license\n * Copyright (c) 2022 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from './slot-controller.js';\n\n/**\n * A controller that manages the slotted tooltip element.\n */\nexport class TooltipController extends SlotController {\n constructor(host) {\n // Do not provide slot factory to create tooltip lazily.\n super(host, 'tooltip');\n\n this.setTarget(host);\n }\n\n /**\n * Override to initialize the newly added custom tooltip.\n *\n * @param {Node} tooltipNode\n * @protected\n * @override\n */\n initCustomNode(tooltipNode) {\n tooltipNode.target = this.target;\n\n if (this.ariaTarget !== undefined) {\n tooltipNode.ariaTarget = this.ariaTarget;\n }\n\n if (this.context !== undefined) {\n tooltipNode.context = this.context;\n }\n\n if (this.manual !== undefined) {\n tooltipNode.manual = this.manual;\n }\n\n if (this.opened !== undefined) {\n tooltipNode.opened = this.opened;\n }\n\n if (this.position !== undefined) {\n tooltipNode._position = this.position;\n }\n\n if (this.shouldShow !== undefined) {\n tooltipNode.shouldShow = this.shouldShow;\n }\n\n this.__notifyChange();\n }\n\n /**\n * Override to notify the host when the tooltip is removed.\n *\n * @param {Node} tooltipNode\n * @protected\n * @override\n */\n teardownNode() {\n this.__notifyChange();\n }\n\n /**\n * Set an HTML element for linking with the tooltip overlay\n * via `aria-describedby` attribute used by screen readers.\n * @param {HTMLElement} ariaTarget\n */\n setAriaTarget(ariaTarget) {\n this.ariaTarget = ariaTarget;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.ariaTarget = ariaTarget;\n }\n }\n\n /**\n * Set a context object to be used by generator.\n * @param {object} context\n */\n setContext(context) {\n this.context = context;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.context = context;\n }\n }\n\n /**\n * Toggle manual state on the slotted tooltip.\n * @param {boolean} manual\n */\n setManual(manual) {\n this.manual = manual;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.manual = manual;\n }\n }\n\n /**\n * Toggle opened state on the slotted tooltip.\n * @param {boolean} opened\n */\n setOpened(opened) {\n this.opened = opened;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.opened = opened;\n }\n }\n\n /**\n * Set default position for the slotted tooltip.\n * This can be overridden by setting the position\n * using corresponding property or attribute.\n * @param {string} position\n */\n setPosition(position) {\n this.position = position;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode._position = position;\n }\n }\n\n /**\n * Set function used to detect whether to show\n * the tooltip based on a condition.\n * @param {Function} shouldShow\n */\n setShouldShow(shouldShow) {\n this.shouldShow = shouldShow;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.shouldShow = shouldShow;\n }\n }\n\n /**\n * Set an HTML element to attach the tooltip to.\n * @param {HTMLElement} target\n */\n setTarget(target) {\n this.target = target;\n\n const tooltipNode = this.node;\n if (tooltipNode) {\n tooltipNode.target = target;\n }\n }\n\n /** @private */\n __notifyChange() {\n this.dispatchEvent(new CustomEvent('tooltip-changed', { detail: { node: this.node } }));\n }\n}\n"],"names":["getAncestorRootNodes","node","result","nodeType","Node","DOCUMENT_NODE","push","DOCUMENT_FRAGMENT_NODE","assignedSlot","parentNode","host","getFlattenedElements","elements","localName","assignedElements","children","forEach","elem","getClosestElement","selector","closest","getRootNode","deserializeAttributeValue","value","Set","split","serializeAttributeValue","values","join","addValueToAttribute","element","attr","getAttribute","add","setAttribute","removeValueFromAttribute","delete","size","removeAttribute","isEmptyTextNode","TEXT_NODE","textContent","trim","uniqueId","generateUniqueId","sizing","SlotController","EventTarget","generateId","slotName","constructor","tagName","config","super","initializer","multiple","observe","useUniqueId","this","slotInitializer","nodes","defaultId","hostConnected","initialized","initMultiple","initSingle","observeSlot","getSlotChild","initAddedNode","attachDefaultNode","initNode","getSlotChildren","length","defaultNode","document","createElement","Element","appendChild","Array","from","childNodes","filter","ELEMENT_NODE","slot","initCustomNode","_node","teardownNode","shadowRoot","querySelector","__slotObserver","addedNodes","removedNodes","current","newNodes","includes","remove","componentName","RawAvatar","baseSelector","attachShadow","mode","innerHTML","avatarComponent","includeAttrs","mapAttrs","editableIcon","style","display","isEditable","editableBadge","avatar","AvatarClass","mappings","hostWidth","property","hostHeight","cursor","hostDirection","avatarTextColor","avatarBackgroundColor","editableIconColor","editableBorderColor","editableBackgroundColor","FocusMixin","superclass","_keyboardActive","ready","addEventListener","e","_shouldSetFocus","_setFocused","_shouldRemoveFocus","disconnectedCallback","hasAttribute","focused","toggleAttribute","_event","customElements","define","SlotObserver","callback","_storedNodes","_connected","_scheduled","_boundSchedule","_schedule","connect","disconnect","removeEventListener","queueMicrotask","flush","_processNodes","currentNodes","assignedNodes","flatten","movedNodes","index","idx","indexOf","TooltipController","setTarget","tooltipNode","target","undefined","ariaTarget","context","manual","opened","position","_position","shouldShow","__notifyChange","setAriaTarget","setContext","setManual","setOpened","setPosition","setShouldShow","dispatchEvent","CustomEvent","detail"],"sourceRoot":""}