@descope/web-components-ui 3.8.0 → 3.9.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.
@@ -0,0 +1,339 @@
1
+ /*! For license information please see descope-multi-line-mappings.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5087,5375],{19624(t,e,r){r.d(e,{J:()=>m,T:()=>l});var o=r(63200),i=r(25964),n=r(88961),s=r(98538),a=r(10767);const l=(0,i.xE)("button"),{host:d,label:c,slottedIcon:u}={host:{selector:()=>":host"},label:{selector:"::part(label)"},slottedIcon:{selector:()=>"::slotted(descope-icon)"}};let h;const m=(0,o.Zz)((0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),(0,n.RF)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...d,property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-right",fallback:"0.875em"},{property:"padding-left",fallback:"0.875em"}],labelTextColor:{property:"color"},iconColor:{selector:()=>"::slotted(*)",property:s.S.cssVarList.fill},labelTextDecoration:{...c,property:"text-decoration"},labelSpacing:{...c,property:"gap"},textAlign:{...c,property:"justify-content",fallback:"center"},iconSize:[{...u,property:"width"},{...u,property:"height"}]}}),a.G,n.VO,n.tQ)((0,n.tz)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${h}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${m.cssVarList.outlineWidth}) + var(${m.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${m.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${m.cssVarList.hostHeight}) - var(${m.cssVarList.outlineWidth}) - var(${m.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${m.cssVarList.hostWidth}) - var(${m.cssVarList.outlineWidth}) - var(${m.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex","class","style"],componentName:l})),{color:p,fontSize:b}=m.cssVarList;h=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${p});\n\t\ttop: calc(50% - (var(${b}) / 2));\n\t\tleft: calc(50% - (var(${b}) / 2));\n\t\tborder-width: calc(var(${b}) / 10);\n\t\twidth: var(${b});\n\t\theight: var(${b});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"]) ::part(prefix),\n\t:host([loading="true"]) ::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},10767(t,e,r){r.d(e,{G:()=>o});const o=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},30576(t,e,r){r.r(e),r.d(e,{ButtonClass:()=>o.J,componentName:()=>o.T});var o=r(19624);r(83799),customElements.define(o.T,o.J)},98538(t,e,r){r.d(e,{S:()=>l,T:()=>a});var o=r(88961),i=r(25964),n=r(8512),s=r(63200);const a=(0,i.xE)("icon"),l=(0,s.Zz)((0,o.RF)({mappings:{fill:[{},{property:n.q.cssVarList.fill}]}}),o.VO,o.tQ)((0,o.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style"],componentName:a}))},8512(t,e,r){r.d(e,{T:()=>l,q:()=>u});var o=r(88961),i=r(72270),n=r(63200),s=r(25964),a=r(18782);const l=(0,s.xE)("image"),d=["src","src-dark"];class c extends((0,i.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return d}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,s.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.getSrc)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get getSrc(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach(t=>{t.setAttribute("fill",`var(${u.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,a.m)(this.getSrc,this.altText).then(t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))})}shouldRender(t){const e=this.getAttribute(t);return this.getSrc===e}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),e!==r&&this.shouldRender(t)&&this.renderImage()}}const u=(0,n.Zz)((0,o.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),o.VO,o.tQ)(c)},18782(t,e,r){r.d(e,{m:()=>n});var o=r(25414);const i=t=>{const e=o.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},n=async(t,e)=>{try{let r;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));r=i(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),o=await e.text();r=i(o)}else r=((t,e)=>{const r=document.createElement("img");return r.setAttribute("src",t),r.setAttribute("alt",e),r})(t,e);return r.style.setProperty("max-width","100%"),r.style.setProperty("max-height","100%"),r}catch{return null}}},22931(t,e,r){r.r(e),r.d(e,{MultiLineMappingsClass:()=>y,componentName:()=>d}),r(30576),r(70067);var o=r(63200),i=r(25964),n=r(88961),s=r(72270),a=r(94681),l=r(19624);const d=(0,i.xE)("multi-line-mappings"),c=(0,s.qu)({componentName:d}),u=t=>null==t?"":String("object"==typeof t?t.value??t.id??t.label??"":t),h=t=>[...new Set(t.map(u).filter(Boolean))],m=t=>{const e=u(t);return"object"==typeof t&&null!==t?{...t,value:e,label:String(t.label??t.displayName??e)}:{value:e,label:e}},p=t=>{if(!Array.isArray(t))return[];const e=new Set;return t.map(m).filter(t=>!(!t.value||e.has(t.value)||(e.add(t.value),0)))},b=(t=[],e=[])=>t.length===e.length&&t.every((t,r)=>t===e[r]),g={selector:()=>":host"},f={selector:".row"},v={selector:".add-action"},y=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...g,property:"width"},hostDirection:[{...g,property:"direction"},{selector:a.t.componentName,property:a.t.cssVarList.hostDirection},{selector:l.J.componentName,property:l.J.cssVarList.hostDirection}],rowsGap:{selector:".rows",property:"gap"},rowGap:{...f,property:"gap"},rowAlignItems:{...f,property:"align-items"},rowWrap:{...f,property:"flex-wrap"},addActionJustifyContent:{...v,property:"justify-content"},addActionMarginTop:{...v,property:"margin-top"}}}),n.VO)(class extends c{static get observedAttributes(){return["data","max-rows","size","disabled","readonly","first-value-key","second-value-key","first-label","second-label","first-placeholder","second-placeholder","full-width","merge-rows"]}#t=[{firstValues:[],secondValues:[]}];#e=null;#r=[];#o={};constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <div class="rows"></div>\n <div class="add-action">\n <descope-button\n class="add-button"\n variant="link"\n mode="primary"\n >\n <slot name="add-button-content">Add line</slot>\n </descope-button>\n </div>\n </div>\n ',(0,i.fz)("\n :host {\n display: inline-flex;\n box-sizing: border-box;\n max-width: 100%;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows > .row {\n display: flex;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n align-items: flex-end;\n }\n\n .row descope-multi-select-combo-box {\n flex: 1 1 0;\n box-sizing: border-box;\n }\n\n .row .remove-button {\n flex: 0 0 auto;\n align-self: flex-end;\n }\n\n .row:only-child .remove-button {\n display: none;\n pointer-events: none;\n }\n\n .add-action {\n display: flex;\n }\n ",this),this.rowsElement=this.shadowRoot.querySelector(".rows"),this.addButtonElement=this.shadowRoot.querySelector(".add-button")}get size(){return this.getAttribute("size")||"md"}get firstValueKey(){return this.getAttribute("first-value-key")||"firstValues"}get secondValueKey(){return this.getAttribute("second-value-key")||"secondValues"}get firstLabel(){return this.getAttribute("first-label")||""}get secondLabel(){return this.getAttribute("second-label")||""}get firstPlaceholder(){return this.getAttribute("first-placeholder")||""}get secondPlaceholder(){return this.getAttribute("second-placeholder")||""}get disabled(){return"true"===this.getAttribute("disabled")}get readonly(){return"true"===this.getAttribute("readonly")}get mergeRows(){return"true"===this.getAttribute("merge-rows")}get maxRows(){const t=Number(this.getAttribute("max-rows"));return Number.isFinite(t)&&t>0?t:void 0}get data(){return this.#o}get value(){return this.#t.filter(t=>t.firstValues.length>0||t.secondValues.length>0).flatMap(t=>(t.firstValues.length?t.firstValues:[""]).map(e=>({[this.firstValueKey]:e,[this.secondValueKey]:[...t.secondValues]})))}set value(t){this.#e=t,this.#t=this.#i(t),this.#n(),this.#s()}#a(t){const e=((t,e,r="unknown")=>{if("string"!=typeof t||!t?.trim())return e;try{return JSON.parse(t)}catch(t){return console.error(`[descope-multi-line-mappings] Failed to parse JSON from "${r}"`,t),e}})(t,{},"data attribute"),r=e&&"object"==typeof e&&!Array.isArray(e)?e:{};this.#r=Object.entries(r).map(([t,e])=>{const r=String(t),o=null!=e&&"object"==typeof e&&!Array.isArray(e),i=o?e.options??[]:e;return{value:r,label:o&&null!=e.label?String(e.label):r,options:p(i)}}),this.#o=Object.fromEntries(this.#r.map(({value:t,options:e})=>[t,e]))}init(){super.init?.(),this.#l(),this.addButtonElement.addEventListener("click",()=>this.#d()),this.#s()}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback?.(t,e,r),e!==r){if("data"===t)return this.#a(r),this.#n(),void this.#s();if("size"===t)return[...this.#c(),...this.#u()].forEach(t=>t.setAttribute("size",this.size)),this.#l(),void this.#h();if(["disabled","readonly"].includes(t))return this.#c().forEach(t=>{t[this.disabled?"setAttribute":"removeAttribute"]("disabled","true"),t[this.readonly?"setAttribute":"removeAttribute"]("readonly","true")}),this.#u().forEach(t=>t[this.disabled||this.readonly?"setAttribute":"removeAttribute"]("disabled","true")),void this.#h();if(["first-label","second-label"].includes(t)){const e="first-label"===t?"first":"second";return void Array.from(this.rowsElement.children).forEach(t=>{const o=t.querySelector(`.${e}-combo`);r?o?.setAttribute("label",r):o?.removeAttribute("label")})}if(["first-placeholder","second-placeholder"].includes(t)){const e="first-placeholder"===t?"first":"second";return void Array.from(this.rowsElement.children).forEach(t=>{const o=t.querySelector(`.${e}-combo`);r?o?.setAttribute("placeholder",r):o?.removeAttribute("placeholder")})}"max-rows"===t&&this.#h(),"merge-rows"===t&&null!==this.#e&&(this.#t=this.#i(this.#e),this.#n(),this.#s())}}#c(){return Array.from(this.rowsElement.querySelectorAll("descope-multi-select-combo-box"))}#u(){return Array.from(this.rowsElement.querySelectorAll(".remove-button"))}#d(){if(this.disabled||this.readonly||this.#m())return;const t={firstValues:[],secondValues:[]};this.#t=[...this.#t,t],this.rowsElement.append(this.#p(t)),this.#h()}#i(t){if(!Array.isArray(t)||!t.length)return[{firstValues:[],secondValues:[]}];let e=t.map(t=>{const e=t?.[this.firstValueKey];return{firstValues:null!=e&&""!==String(e)?[String(e)]:[],secondValues:h(t?.[this.secondValueKey]??[])}});if(this.mergeRows){const t=new Map;for(const r of e){const e=[...r.secondValues].sort().join("\0");t.has(e)?t.get(e).firstValues.push(...r.firstValues):t.set(e,{firstValues:[...r.firstValues],secondValues:r.secondValues})}e=[...t.values()]}return e}#n(){const t=new Set(this.#r.map(t=>t.value));this.#t=this.#t.map(e=>{const r=e.firstValues.filter(e=>t.has(e)),o=this.#b(r),i=new Set(o.map(t=>t.value));return{firstValues:r,secondValues:e.secondValues.filter(t=>i.has(t))}})}#b(t){const e=t.length?t.map(t=>this.#o[t]||[]).filter(t=>t.length):Object.values(this.#o).filter(t=>t.length);if(!e.length||t.length&&e.length!==t.length)return[];if(1===e.length)return e[0];const[r,...o]=e,i=new Set(r.map(t=>t.value));for(const t of o){const e=new Set(t.map(t=>t.value));for(const t of i)e.has(t)||i.delete(t)}return r.filter(t=>i.has(t.value))}#g({getRowIndex:t,type:e,label:r,placeholder:o,options:i,selectedValues:n}){const s=document.createElement("descope-multi-select-combo-box");return s.className=`combo ${e}-combo`,s.setAttribute("size",this.size),s.setAttribute("bordered","true"),s.setAttribute("item-label-path","data-name"),s.setAttribute("item-value-path","data-id"),r&&s.setAttribute("label",r),o&&s.setAttribute("placeholder",o),this.disabled&&s.setAttribute("disabled","true"),this.readonly&&s.setAttribute("readonly","true"),s.data=i,this.#f(s,n),s.addEventListener("input",()=>{if(s.__descopeSyncingSelection)return;const r=t();-1!==r&&this.#v({rowIndex:r,type:e,selectedValues:h(s.value||[])})}),s}#f(t,e){t.__descopeSyncingSelection=!0,Promise.resolve().then(()=>{const r=new Set(e||[]);t.selectedItems=(t.items||[]).filter(t=>r.has(t["data-id"]||t.getAttribute?.("data-id"))),t.__descopeSyncingSelection=!1})}#y(t){const e=document.createElement("descope-button");return e.className="remove-button",e.setAttribute("variant","link"),e.setAttribute("mode","primary"),e.setAttribute("size",this.size),e.setAttribute("aria-label","Remove row"),e.innerHTML='<vaadin-icon icon="vaadin:minus"></vaadin-icon>',(this.disabled||this.readonly)&&e.setAttribute("disabled","true"),e.addEventListener("click",()=>{const e=t();-1!==e&&this.#w(e)}),e}#s(){this.rowsElement.innerHTML="",this.#t.forEach(t=>{this.rowsElement.append(this.#p(t))}),this.#h()}#p(t){const e=document.createElement("div");e.className="row";const r=()=>Array.from(this.rowsElement.children).indexOf(e),o=this.#g({getRowIndex:r,type:"first",label:this.firstLabel,placeholder:this.firstPlaceholder,options:this.#r.map(({value:t,label:e})=>({value:t,label:e})),selectedValues:t.firstValues}),i=this.#b(t.firstValues),n=this.#g({getRowIndex:r,type:"second",label:this.secondLabel,placeholder:this.secondPlaceholder,options:i,selectedValues:t.secondValues});return e.append(o,n,this.#y(r)),e}#x(t){const e=this.#t[t];if(!e)return;const r=this.rowsElement.children[t],o=r?.querySelector(".second-combo");if(!o)return void this.#s();const i=this.#b(e.firstValues);o.data=i,this.#f(o,e.secondValues)}#l(){this.addButtonElement.setAttribute("size",this.size)}#h(){this.disabled||this.readonly||this.#m()?this.addButtonElement.setAttribute("disabled","true"):this.addButtonElement.removeAttribute("disabled")}#m(){return Number.isFinite(this.maxRows)&&this.#t.length>=this.maxRows}#A(t){this.rowsElement.children[t]?.remove()}#v({rowIndex:t,type:e,selectedValues:r}){if(this.disabled||this.readonly)return;const o=this.#t[t];if(o){if("first"===e){const e=this.#b(r),i=new Set(e.map(t=>t.value)),n=o.secondValues.filter(t=>i.has(t));if(b(o.firstValues,r)&&b(o.secondValues,n))return;return this.#t[t]={firstValues:r,secondValues:n},this.#x(t),void this.#V()}b(o.secondValues,r)||(this.#t[t]={...o,secondValues:r},this.#V())}}#w(t){if(this.disabled||this.readonly||this.#t.length<=1)return;const e=this.#t[t];this.#t=this.#t.filter((e,r)=>r!==t),this.#A(t),this.#h(),(e.firstValues.length>0||e.secondValues.length>0)&&this.#V()}#V(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}});customElements.define(d,y)},89389(t,e,r){r.d(e,{$:()=>p});var o=r(13256),i=r(55774),n=r(82901),s=r(72562),a=r(81488),l=r(87550);const d=r(51450).AH`
3
+ :host {
4
+ display: inline-block;
5
+ position: relative;
6
+ outline: none;
7
+ white-space: nowrap;
8
+ -webkit-user-select: none;
9
+ -moz-user-select: none;
10
+ user-select: none;
11
+ }
12
+
13
+ :host([hidden]) {
14
+ display: none !important;
15
+ }
16
+
17
+ /* Aligns the button with form fields when placed on the same line.
18
+ Note, to make it work, the form fields should have the same "::before" pseudo-element. */
19
+ .vaadin-button-container::before {
20
+ content: '\\2003';
21
+ display: inline-block;
22
+ width: 0;
23
+ max-height: 100%;
24
+ }
25
+
26
+ .vaadin-button-container {
27
+ display: inline-flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ text-align: center;
31
+ width: 100%;
32
+ height: 100%;
33
+ min-height: inherit;
34
+ text-shadow: inherit;
35
+ }
36
+
37
+ [part='prefix'],
38
+ [part='suffix'] {
39
+ flex: none;
40
+ }
41
+
42
+ [part='label'] {
43
+ white-space: nowrap;
44
+ overflow: hidden;
45
+ text-overflow: ellipsis;
46
+ }
47
+
48
+ @media (forced-colors: active) {
49
+ :host {
50
+ outline: 1px solid;
51
+ outline-offset: -1px;
52
+ }
53
+
54
+ :host([focused]) {
55
+ outline-width: 2px;
56
+ }
57
+
58
+ :host([disabled]) {
59
+ outline-color: GrayText;
60
+ }
61
+ }
62
+ `;var c=r(84467),u=r(53149),h=r(36176);const m=t=>class extends((0,c.e)((0,h.l)((0,u.y)(t)))){static get properties(){return{tabindex:{type:Number,value:0,reflectToAttribute:!0}}}get _activeKeys(){return["Enter"," "]}ready(){super.ready(),this.hasAttribute("role")||this.setAttribute("role","button")}_onKeyDown(t){super._onKeyDown(t),t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||this._activeKeys.includes(t.key)&&(t.preventDefault(),this.click())}};(0,l.SF)("vaadin-button",d,{moduleId:"vaadin-button-styles"});class p extends(m((0,s.q)((0,l.cp)((0,i.w)(o.Pu))))){static get is(){return"vaadin-button"}static get template(){return o.qy`
63
+ <div class="vaadin-button-container">
64
+ <span part="prefix" aria-hidden="true">
65
+ <slot name="prefix"></slot>
66
+ </span>
67
+ <span part="label">
68
+ <slot></slot>
69
+ </span>
70
+ <span part="suffix" aria-hidden="true">
71
+ <slot name="suffix"></slot>
72
+ </span>
73
+ </div>
74
+ <slot name="tooltip"></slot>
75
+ `}ready(){super.ready(),this._tooltipController=new a.I(this),this.addController(this._tooltipController)}}(0,n.X)(p)},93555(t,e,r){r.d(e,{x:()=>i}),r(64511),r(42068),r(9433),r(3241),r(83315);var o=r(87550);const i=o.AH`
76
+ :host {
77
+ /* Sizing */
78
+ --lumo-button-size: var(--lumo-size-m);
79
+ min-width: var(--vaadin-button-min-width, calc(var(--_button-size) * 2));
80
+ height: var(--_button-size);
81
+ padding: var(--vaadin-button-padding, 0 calc(var(--_button-size) / 3 + var(--lumo-border-radius-m) / 2));
82
+ margin: var(--vaadin-button-margin, var(--lumo-space-xs) 0);
83
+ box-sizing: border-box;
84
+ /* Style */
85
+ font-family: var(--lumo-font-family);
86
+ font-size: var(--vaadin-button-font-size, var(--lumo-font-size-m));
87
+ font-weight: var(--vaadin-button-font-weight, 500);
88
+ color: var(--_lumo-button-text-color);
89
+ background: var(--_lumo-button-background);
90
+ border: var(--vaadin-button-border, none);
91
+ border-radius: var(--vaadin-button-border-radius, var(--lumo-border-radius-m));
92
+ cursor: var(--lumo-clickable-cursor);
93
+ -webkit-tap-highlight-color: transparent;
94
+ -webkit-font-smoothing: antialiased;
95
+ -moz-osx-font-smoothing: grayscale;
96
+ flex-shrink: 0;
97
+ --_button-size: var(--vaadin-button-height, var(--lumo-button-size));
98
+ --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
99
+ --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
100
+ /* Used by notification */
101
+ --_lumo-button-background: var(--vaadin-button-background, var(--lumo-contrast-5pct));
102
+ --_lumo-button-text-color: var(--vaadin-button-text-color, var(--lumo-primary-text-color));
103
+ --_lumo-button-primary-background: var(--vaadin-button-primary-background, var(--lumo-primary-color));
104
+ --_lumo-button-primary-text-color: var(--vaadin-button-primary-text-color, var(--lumo-primary-contrast-color));
105
+ }
106
+
107
+ /* Set only for the internal parts so we don't affect the host vertical alignment */
108
+ [part='label'],
109
+ [part='prefix'],
110
+ [part='suffix'] {
111
+ line-height: var(--lumo-line-height-xs);
112
+ }
113
+
114
+ [part='label'] {
115
+ padding: calc(var(--lumo-button-size) / 6) 0;
116
+ }
117
+
118
+ :host([theme~='small']) {
119
+ font-size: var(--lumo-font-size-s);
120
+ --lumo-button-size: var(--lumo-size-s);
121
+ }
122
+
123
+ :host([theme~='large']) {
124
+ font-size: var(--lumo-font-size-l);
125
+ --lumo-button-size: var(--lumo-size-l);
126
+ }
127
+
128
+ /* For interaction states */
129
+ :host::before,
130
+ :host::after {
131
+ content: '';
132
+ /* We rely on the host always being relative */
133
+ position: absolute;
134
+ z-index: 1;
135
+ inset: 0;
136
+ background-color: currentColor;
137
+ border-radius: inherit;
138
+ opacity: 0;
139
+ pointer-events: none;
140
+ }
141
+
142
+ /* Hover */
143
+
144
+ @media (any-hover: hover) {
145
+ :host(:hover)::before {
146
+ opacity: 0.02;
147
+ }
148
+ }
149
+
150
+ /* Active */
151
+
152
+ :host::after {
153
+ transition: opacity 1.4s, transform 0.1s;
154
+ filter: blur(8px);
155
+ }
156
+
157
+ :host([active])::before {
158
+ opacity: 0.05;
159
+ transition-duration: 0s;
160
+ }
161
+
162
+ :host([active])::after {
163
+ opacity: 0.1;
164
+ transition-duration: 0s, 0s;
165
+ transform: scale(0);
166
+ }
167
+
168
+ /* Keyboard focus */
169
+
170
+ :host([focus-ring]) {
171
+ box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
172
+ }
173
+
174
+ :host([theme~='primary'][focus-ring]) {
175
+ box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);
176
+ }
177
+
178
+ /* Types (primary, tertiary, tertiary-inline */
179
+
180
+ :host([theme~='tertiary']),
181
+ :host([theme~='tertiary-inline']) {
182
+ --_background: transparent !important;
183
+ background: var(--vaadin-button-tertiary-background, var(--_background));
184
+ min-width: 0;
185
+ }
186
+
187
+ :host([theme~='tertiary']) {
188
+ border: var(--vaadin-button-tertiary-border, none);
189
+ color: var(--vaadin-button-tertiary-text-color, var(--lumo-primary-text-color));
190
+ font-weight: var(--vaadin-button-tertiary-font-weight, 500);
191
+ padding: var(--vaadin-button-tertiary-padding, 0 calc(var(--_button-size) / 6));
192
+ }
193
+
194
+ :host([theme~='tertiary-inline'])::before {
195
+ display: none;
196
+ }
197
+
198
+ :host([theme~='tertiary-inline']) {
199
+ margin: 0;
200
+ height: auto;
201
+ padding: 0;
202
+ line-height: inherit;
203
+ font-size: inherit;
204
+ }
205
+
206
+ :host([theme~='tertiary-inline']) [part='label'] {
207
+ padding: 0;
208
+ overflow: visible;
209
+ line-height: inherit;
210
+ }
211
+
212
+ :host([theme~='primary']) {
213
+ background: var(--_lumo-button-primary-background);
214
+ border: var(--vaadin-button-primary-border, none);
215
+ color: var(--_lumo-button-primary-text-color);
216
+ font-weight: var(--vaadin-button-primary-font-weight, 600);
217
+ min-width: calc(var(--lumo-button-size) * 2.5);
218
+ }
219
+
220
+ :host([theme~='primary'])::before {
221
+ background-color: black;
222
+ }
223
+
224
+ @media (any-hover: hover) {
225
+ :host([theme~='primary']:hover)::before {
226
+ opacity: 0.05;
227
+ }
228
+ }
229
+
230
+ :host([theme~='primary'][active])::before {
231
+ opacity: 0.1;
232
+ }
233
+
234
+ :host([theme~='primary'][active])::after {
235
+ opacity: 0.2;
236
+ }
237
+
238
+ /* Colors (success, error, contrast) */
239
+
240
+ :host([theme~='success']) {
241
+ color: var(--lumo-success-text-color);
242
+ }
243
+
244
+ :host([theme~='success'][theme~='primary']) {
245
+ background-color: var(--lumo-success-color);
246
+ color: var(--lumo-success-contrast-color);
247
+ }
248
+
249
+ :host([theme~='error']) {
250
+ color: var(--lumo-error-text-color);
251
+ }
252
+
253
+ :host([theme~='error'][theme~='primary']) {
254
+ background-color: var(--lumo-error-color);
255
+ color: var(--lumo-error-contrast-color);
256
+ }
257
+
258
+ :host([theme~='contrast']) {
259
+ color: var(--lumo-contrast);
260
+ }
261
+
262
+ :host([theme~='contrast'][theme~='primary']) {
263
+ background-color: var(--lumo-contrast);
264
+ color: var(--lumo-base-color);
265
+ }
266
+
267
+ /* Disabled state. Keep selectors after other color variants. */
268
+
269
+ :host([disabled]) {
270
+ pointer-events: none;
271
+ color: var(--lumo-disabled-text-color);
272
+ }
273
+
274
+ :host([theme~='primary'][disabled]) {
275
+ background-color: var(--lumo-contrast-30pct);
276
+ color: var(--lumo-base-color);
277
+ }
278
+
279
+ :host([theme~='primary'][disabled]) [part] {
280
+ opacity: 0.7;
281
+ }
282
+
283
+ /* Icons */
284
+
285
+ [part] ::slotted(vaadin-icon) {
286
+ display: inline-block;
287
+ width: var(--lumo-icon-size-m);
288
+ height: var(--lumo-icon-size-m);
289
+ }
290
+
291
+ /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */
292
+ [part] ::slotted(vaadin-icon[icon^='vaadin:']) {
293
+ padding: 0.25em;
294
+ box-sizing: border-box !important;
295
+ }
296
+
297
+ [part='prefix'] {
298
+ margin-left: -0.25em;
299
+ margin-right: 0.25em;
300
+ }
301
+
302
+ [part='suffix'] {
303
+ margin-left: 0.25em;
304
+ margin-right: -0.25em;
305
+ }
306
+
307
+ /* Icon-only */
308
+
309
+ :host([theme~='icon']:not([theme~='tertiary-inline'])) {
310
+ min-width: var(--lumo-button-size);
311
+ padding-left: calc(var(--lumo-button-size) / 4);
312
+ padding-right: calc(var(--lumo-button-size) / 4);
313
+ }
314
+
315
+ :host([theme~='icon']) [part='prefix'],
316
+ :host([theme~='icon']) [part='suffix'] {
317
+ margin-left: 0;
318
+ margin-right: 0;
319
+ }
320
+
321
+ /* RTL specific styles */
322
+
323
+ :host([dir='rtl']) [part='prefix'] {
324
+ margin-left: 0.25em;
325
+ margin-right: -0.25em;
326
+ }
327
+
328
+ :host([dir='rtl']) [part='suffix'] {
329
+ margin-left: -0.25em;
330
+ margin-right: 0.25em;
331
+ }
332
+
333
+ :host([dir='rtl'][theme~='icon']) [part='prefix'],
334
+ :host([dir='rtl'][theme~='icon']) [part='suffix'] {
335
+ margin-left: 0;
336
+ margin-right: 0;
337
+ }
338
+ `;(0,o.SF)("vaadin-button",i,{moduleId:"lumo-button"})},83799(t,e,r){r(93555),r(89389)}}]);
339
+ //# sourceMappingURL=descope-multi-line-mappings.js.map
@@ -0,0 +1,5 @@
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
+ */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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Ac,CAAEgB,SAAU,yBAqC1D,MAAMC,UAAehB,GAAY,QAAa,SAAc,OAAgB,UAC1E,aAAWiB,GACT,MAAO,eACT,CAEA,mBAAWC,GACT,OAAsB,IFYkB;;;;;;;;;;;;;CEX1C,CAGA,KAAAZ,GACErN,MAAMqN,QAENxN,KAAKqO,mBAAqB,IAAI,IAAkBrO,MAChDA,KAAKsO,cAActO,KAAKqO,mBAC1B,GAGF,OAAoBH,E,0FC9DpB,MAAMK,EAAS,IAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyQlB,QAAe,gBAAiBA,EAAQ,CAAEN,SAAU,e","sources":["webpack://@descope/web-components-ui/../components/descope-button/src/component/ButtonClass.js","webpack://@descope/web-components-ui/../components/descope-button/src/component/clickableMixin.js","webpack://@descope/web-components-ui/../components/descope-button/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-multi-line-mappings/src/component/MultiLineMappingsClass.js","webpack://@descope/web-components-ui/../components/descope-multi-line-mappings/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button-base.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/theme/lumo/vaadin-button-styles.js"],"sourcesContent":["import { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { IconClass } from '@descope-ui/descope-icon/class';\nimport { clickableMixin } from './clickableMixin';\n\nexport const componentName = getComponentName('button');\n\nconst resetStyles = `\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n`;\n\nconst iconStyles = `\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n`;\n\nconst editorOverrides = `vaadin-button::part(label) { pointer-events: none; }`;\n\nconst { host, label, slottedIcon } = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n slottedIcon: { selector: () => '::slotted(descope-icon)' },\n};\n\nlet loadingIndicatorStyles;\n\nexport const ButtonClass = compose(\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n createStyleMixin({\n mappings: {\n hostWidth: { property: 'width' },\n hostHeight: { property: 'height' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n\n cursor: {},\n backgroundColor: {},\n\n outlineOffset: {},\n outlineColor: {},\n outlineStyle: {},\n outlineWidth: {},\n\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n verticalPadding: [\n { property: 'padding-top' },\n { property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { property: 'padding-right', fallback: '0.875em' },\n { property: 'padding-left', fallback: '0.875em' },\n ],\n\n labelTextColor: { property: 'color' },\n iconColor: {\n selector: () => `::slotted(*)`,\n property: IconClass.cssVarList.fill,\n },\n labelTextDecoration: { ...label, property: 'text-decoration' },\n labelSpacing: { ...label, property: 'gap' },\n textAlign: { ...label, property: 'justify-content', fallback: 'center' },\n\n iconSize: [\n { ...slottedIcon, property: 'width' },\n { ...slottedIcon, property: 'height' },\n ],\n },\n }),\n clickableMixin,\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: ['', 'prefix', 'label', 'suffix'],\n wrappedEleName: 'vaadin-button',\n style: () => `\n\t\t\t${resetStyles}\n\t\t\t${iconStyles}\n\t\t\t${loadingIndicatorStyles}\n\t\t\t${editorOverrides}\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${ButtonClass.cssVarList.outlineWidth}) + var(${ButtonClass.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width=\"true\"]) {\n width: var(${ButtonClass.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${ButtonClass.cssVarList.hostHeight}) - var(${ButtonClass.cssVarList.outlineWidth}) - var(${ButtonClass.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square=\"true\"]:not([full-width=\"true\"]) {\n\t\t\t\twidth: calc(var(${ButtonClass.cssVarList.hostWidth}) - var(${ButtonClass.cssVarList.outlineWidth}) - var(${ButtonClass.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n\nconst { color, fontSize } = ButtonClass.cssVarList;\nloadingIndicatorStyles = `\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading=\"true\"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${color});\n\t\ttop: calc(50% - (var(${fontSize}) / 2));\n\t\tleft: calc(50% - (var(${fontSize}) / 2));\n\t\tborder-width: calc(var(${fontSize}) / 10);\n\t\twidth: var(${fontSize});\n\t\theight: var(${fontSize});\n\t}\n\t:host([disabled=\"true\"]),\n\t:host([loading=\"true\"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading=\"true\"]) ::part(prefix),\n\t:host([loading=\"true\"]) ::part(label) {\n\t\tvisibility: hidden;\n\t}\n`;\n","export const clickableMixin = (superclass) =>\n class ClickableMixinClass extends superclass {\n get isLoading() {\n return this.getAttribute('loading') === 'true';\n }\n\n click() {\n this.isLoading || super.click();\n }\n };\n","import { componentName, ButtonClass } from './ButtonClass';\nimport '@vaadin/button';\n\ncustomElements.define(componentName, ButtonClass);\n\nexport { ButtonClass, componentName };\n","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n","/* eslint-disable no-use-before-define */\nimport {\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 { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { MultiSelectComboBoxClass } from '@descope-ui/descope-multi-select-combo-box/class';\nimport { ButtonClass } from '@descope-ui/descope-button/class';\n\nexport const componentName = getComponentName('multi-line-mappings');\nconst BaseClass = createBaseClass({ componentName });\n\nconst parseJSON = (value, fallback, source = 'unknown') => {\n if (typeof value !== 'string' || !value?.trim()) {\n return fallback;\n }\n\n try {\n return JSON.parse(value);\n } catch (error) {\n console.error(\n `[descope-multi-line-mappings] Failed to parse JSON from \"${source}\"`,\n error,\n );\n return fallback;\n }\n};\n\nconst toNormalizedValue = (item) => {\n if (item === undefined || item === null) {\n return '';\n }\n\n if (typeof item === 'object') {\n return String(item.value ?? item.id ?? item.label ?? '');\n }\n\n return String(item);\n};\n\nconst uniqueValues = (values) => [\n ...new Set(values.map(toNormalizedValue).filter(Boolean)),\n];\n\nconst normalizeOption = (item) => {\n const value = toNormalizedValue(item);\n\n if (typeof item === 'object' && item !== null) {\n return {\n ...item,\n value,\n label: String(item.label ?? item.displayName ?? value),\n };\n }\n\n return { value, label: value };\n};\n\nconst normalizeOptions = (options) => {\n if (!Array.isArray(options)) {\n return [];\n }\n\n const uniqueSet = new Set();\n\n return options.map(normalizeOption).filter((option) => {\n if (!option.value || uniqueSet.has(option.value)) {\n return false;\n }\n\n uniqueSet.add(option.value);\n return true;\n });\n};\n\nconst createEmptyRow = () => ({ firstValues: [], secondValues: [] });\n\nconst areSameValues = (first = [], second = []) =>\n first.length === second.length && first.every((v, i) => v === second[i]);\n\nclass RawMultiLineMappingsClass extends BaseClass {\n static get observedAttributes() {\n return [\n 'data',\n 'max-rows',\n 'size',\n 'disabled',\n 'readonly',\n 'first-value-key',\n 'second-value-key',\n 'first-label',\n 'second-label',\n 'first-placeholder',\n 'second-placeholder',\n 'full-width',\n 'merge-rows',\n ];\n }\n\n #rows = [createEmptyRow()];\n\n #rawValue = null;\n\n #firstOptions = [];\n\n #secondOptionsByFirstValue = {};\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <div class=\"rows\"></div>\n <div class=\"add-action\">\n <descope-button\n class=\"add-button\"\n variant=\"link\"\n mode=\"primary\"\n >\n <slot name=\"add-button-content\">Add line</slot>\n </descope-button>\n </div>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n box-sizing: border-box;\n max-width: 100%;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows > .row {\n display: flex;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n align-items: flex-end;\n }\n\n .row descope-multi-select-combo-box {\n flex: 1 1 0;\n box-sizing: border-box;\n }\n\n .row .remove-button {\n flex: 0 0 auto;\n align-self: flex-end;\n }\n\n .row:only-child .remove-button {\n display: none;\n pointer-events: none;\n }\n\n .add-action {\n display: flex;\n }\n `,\n this,\n );\n\n this.rowsElement = this.shadowRoot.querySelector('.rows');\n this.addButtonElement = this.shadowRoot.querySelector('.add-button');\n }\n\n get size() {\n return this.getAttribute('size') || 'md';\n }\n\n get firstValueKey() {\n return this.getAttribute('first-value-key') || 'firstValues';\n }\n\n get secondValueKey() {\n return this.getAttribute('second-value-key') || 'secondValues';\n }\n\n get firstLabel() {\n return this.getAttribute('first-label') || '';\n }\n\n get secondLabel() {\n return this.getAttribute('second-label') || '';\n }\n\n get firstPlaceholder() {\n return this.getAttribute('first-placeholder') || '';\n }\n\n get secondPlaceholder() {\n return this.getAttribute('second-placeholder') || '';\n }\n\n get disabled() {\n return this.getAttribute('disabled') === 'true';\n }\n\n get readonly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n get mergeRows() {\n return this.getAttribute('merge-rows') === 'true';\n }\n\n get maxRows() {\n const maxRows = Number(this.getAttribute('max-rows'));\n\n return Number.isFinite(maxRows) && maxRows > 0 ? maxRows : undefined;\n }\n\n get data() {\n return this.#secondOptionsByFirstValue;\n }\n\n get value() {\n return this.#rows\n .filter(\n (row) => row.firstValues.length > 0 || row.secondValues.length > 0,\n )\n .flatMap((rowValue) => {\n const firsts = rowValue.firstValues.length\n ? rowValue.firstValues\n : [''];\n return firsts.map((firstValue) => ({\n [this.firstValueKey]: firstValue,\n [this.secondValueKey]: [...rowValue.secondValues],\n }));\n });\n }\n\n set value(value) {\n this.#rawValue = value;\n this.#rows = this.#normalizeRows(value);\n this.#dropStaleSelections();\n this.#renderRows();\n }\n\n #setData(rawValue) {\n const parsed = parseJSON(rawValue, {}, 'data attribute');\n const optionsMap =\n parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? parsed\n : {};\n\n this.#firstOptions = Object.entries(optionsMap).map(([key, value]) => {\n const strKey = String(key);\n const isEnriched =\n value != null && typeof value === 'object' && !Array.isArray(value);\n const options = isEnriched ? (value.options ?? []) : value;\n const label =\n isEnriched && value.label != null ? String(value.label) : strKey;\n return { value: strKey, label, options: normalizeOptions(options) };\n });\n this.#secondOptionsByFirstValue = Object.fromEntries(\n this.#firstOptions.map(({ value, options }) => [value, options]),\n );\n }\n\n init() {\n super.init?.();\n this.#updateAddButtonSize();\n this.addButtonElement.addEventListener('click', () => this.#addRow());\n this.#renderRows();\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n if (oldValue === newValue) return;\n\n if (name === 'data') {\n this.#setData(newValue);\n this.#dropStaleSelections();\n this.#renderRows();\n return;\n }\n\n if (name === 'size') {\n [...this.#getAllCombos(), ...this.#getAllRemoveButtons()].forEach((el) =>\n el.setAttribute('size', this.size),\n );\n this.#updateAddButtonSize();\n this.#updateAddButtonState();\n return;\n }\n\n if (['disabled', 'readonly'].includes(name)) {\n this.#getAllCombos().forEach((combo) => {\n combo[this.disabled ? 'setAttribute' : 'removeAttribute'](\n 'disabled',\n 'true',\n );\n combo[this.readonly ? 'setAttribute' : 'removeAttribute'](\n 'readonly',\n 'true',\n );\n });\n this.#getAllRemoveButtons().forEach((el) =>\n el[this.disabled || this.readonly ? 'setAttribute' : 'removeAttribute'](\n 'disabled',\n 'true',\n ),\n );\n this.#updateAddButtonState();\n return;\n }\n\n if (['first-label', 'second-label'].includes(name)) {\n const type = name === 'first-label' ? 'first' : 'second';\n Array.from(this.rowsElement.children).forEach((rowElement) => {\n const combo = rowElement.querySelector(`.${type}-combo`);\n if (newValue) combo?.setAttribute('label', newValue);\n else combo?.removeAttribute('label');\n });\n return;\n }\n\n if (['first-placeholder', 'second-placeholder'].includes(name)) {\n const type = name === 'first-placeholder' ? 'first' : 'second';\n Array.from(this.rowsElement.children).forEach((rowElement) => {\n const combo = rowElement.querySelector(`.${type}-combo`);\n if (newValue) combo?.setAttribute('placeholder', newValue);\n else combo?.removeAttribute('placeholder');\n });\n return;\n }\n\n if (name === 'max-rows') {\n this.#updateAddButtonState();\n }\n\n if (name === 'merge-rows' && this.#rawValue !== null) {\n this.#rows = this.#normalizeRows(this.#rawValue);\n this.#dropStaleSelections();\n this.#renderRows();\n }\n }\n\n #getAllCombos() {\n return Array.from(\n this.rowsElement.querySelectorAll('descope-multi-select-combo-box'),\n );\n }\n\n #getAllRemoveButtons() {\n return Array.from(this.rowsElement.querySelectorAll('.remove-button'));\n }\n\n #addRow() {\n if (this.disabled || this.readonly || this.#isMaxRowsReached()) {\n return;\n }\n\n const newRow = createEmptyRow();\n this.#rows = [...this.#rows, newRow];\n this.rowsElement.append(this.#createRowElement(newRow));\n this.#updateAddButtonState();\n }\n\n #normalizeRows(value) {\n if (!Array.isArray(value) || !value.length) {\n return [createEmptyRow()];\n }\n\n const rows = value.map((rowValue) => {\n const firstRaw = rowValue?.[this.firstValueKey];\n const firstValues =\n firstRaw != null && String(firstRaw) !== '' ? [String(firstRaw)] : [];\n\n return {\n firstValues,\n secondValues: uniqueValues(rowValue?.[this.secondValueKey] ?? []),\n };\n });\n\n let result = rows;\n\n if (this.mergeRows) {\n const map = new Map();\n for (const row of result) {\n const key = [...row.secondValues].sort().join('\\0');\n if (map.has(key)) {\n map.get(key).firstValues.push(...row.firstValues);\n } else {\n map.set(key, {\n firstValues: [...row.firstValues],\n secondValues: row.secondValues,\n });\n }\n }\n result = [...map.values()];\n }\n\n return result;\n }\n\n #dropStaleSelections() {\n const firstValuesSet = new Set(this.#firstOptions.map((o) => o.value));\n\n this.#rows = this.#rows.map((rowValue) => {\n const firstValues = rowValue.firstValues.filter((value) =>\n firstValuesSet.has(value),\n );\n const availableSecondOptions =\n this.#getSecondOptionsForFirstValues(firstValues);\n const availableSecondValuesSet = new Set(\n availableSecondOptions.map((item) => item.value),\n );\n\n const secondValues = rowValue.secondValues.filter((value) =>\n availableSecondValuesSet.has(value),\n );\n\n return {\n firstValues,\n secondValues,\n };\n });\n }\n\n #getSecondOptionsForFirstValues(firstValues) {\n // Get lists to intersect\n const lists = !firstValues.length\n ? Object.values(this.#secondOptionsByFirstValue).filter(\n (options) => options.length,\n )\n : firstValues\n .map((value) => this.#secondOptionsByFirstValue[value] || [])\n .filter((options) => options.length);\n\n if (\n !lists.length ||\n (firstValues.length && lists.length !== firstValues.length)\n ) {\n return [];\n }\n\n if (lists.length === 1) {\n return lists[0];\n }\n\n // Compute intersection of all lists\n const [baseList, ...otherLists] = lists;\n const intersectionSet = new Set(baseList.map((item) => item.value));\n\n for (const options of otherLists) {\n const currentSet = new Set(options.map((item) => item.value));\n for (const value of intersectionSet) {\n if (!currentSet.has(value)) {\n intersectionSet.delete(value);\n }\n }\n }\n\n return baseList.filter((item) => intersectionSet.has(item.value));\n }\n\n #createCombo({\n getRowIndex,\n type,\n label,\n placeholder,\n options,\n selectedValues,\n }) {\n const comboElement = document.createElement(\n 'descope-multi-select-combo-box',\n );\n\n comboElement.className = `combo ${type}-combo`;\n comboElement.setAttribute('size', this.size);\n comboElement.setAttribute('bordered', 'true');\n comboElement.setAttribute('item-label-path', 'data-name');\n comboElement.setAttribute('item-value-path', 'data-id');\n\n if (label) {\n comboElement.setAttribute('label', label);\n }\n\n if (placeholder) {\n comboElement.setAttribute('placeholder', placeholder);\n }\n\n if (this.disabled) {\n comboElement.setAttribute('disabled', 'true');\n }\n\n if (this.readonly) {\n comboElement.setAttribute('readonly', 'true');\n }\n\n comboElement.data = options;\n this.#syncComboSelection(comboElement, selectedValues);\n\n comboElement.addEventListener('input', () => {\n if (comboElement.__descopeSyncingSelection) {\n return;\n }\n\n const rowIndex = getRowIndex();\n if (rowIndex === -1) return;\n\n this.#handleComboChange({\n rowIndex,\n type,\n selectedValues: uniqueValues(comboElement.value || []),\n });\n });\n\n return comboElement;\n }\n\n #syncComboSelection(comboElement, selectedValues) {\n comboElement.__descopeSyncingSelection = true;\n Promise.resolve().then(() => {\n const selectedValuesSet = new Set(selectedValues || []);\n comboElement.selectedItems = (comboElement.items || []).filter((item) =>\n selectedValuesSet.has(\n item['data-id'] || item.getAttribute?.('data-id'),\n ),\n );\n comboElement.__descopeSyncingSelection = false;\n });\n }\n\n #createRemoveButton(getRowIndex) {\n const buttonElement = document.createElement('descope-button');\n\n buttonElement.className = 'remove-button';\n buttonElement.setAttribute('variant', 'link');\n buttonElement.setAttribute('mode', 'primary');\n buttonElement.setAttribute('size', this.size);\n buttonElement.setAttribute('aria-label', 'Remove row');\n buttonElement.innerHTML = '<vaadin-icon icon=\"vaadin:minus\"></vaadin-icon>';\n\n if (this.disabled || this.readonly) {\n buttonElement.setAttribute('disabled', 'true');\n }\n\n buttonElement.addEventListener('click', () => {\n const rowIndex = getRowIndex();\n if (rowIndex !== -1) this.#removeRow(rowIndex);\n });\n\n return buttonElement;\n }\n\n #renderRows() {\n this.rowsElement.innerHTML = '';\n this.#rows.forEach((rowValue) => {\n this.rowsElement.append(this.#createRowElement(rowValue));\n });\n this.#updateAddButtonState();\n }\n\n #createRowElement(rowValue) {\n const rowElement = document.createElement('div');\n rowElement.className = 'row';\n\n const getRowIndex = () =>\n Array.from(this.rowsElement.children).indexOf(rowElement);\n\n const firstCombo = this.#createCombo({\n getRowIndex,\n type: 'first',\n label: this.firstLabel,\n placeholder: this.firstPlaceholder,\n options: this.#firstOptions.map(({ value, label }) => ({ value, label })),\n selectedValues: rowValue.firstValues,\n });\n\n const secondOptions = this.#getSecondOptionsForFirstValues(\n rowValue.firstValues,\n );\n const secondCombo = this.#createCombo({\n getRowIndex,\n type: 'second',\n label: this.secondLabel,\n placeholder: this.secondPlaceholder,\n options: secondOptions,\n selectedValues: rowValue.secondValues,\n });\n\n rowElement.append(\n firstCombo,\n secondCombo,\n this.#createRemoveButton(getRowIndex),\n );\n return rowElement;\n }\n\n #updateSecondComboForRow(rowIndex) {\n const currentRowValue = this.#rows[rowIndex];\n if (!currentRowValue) return;\n\n const rowElement = this.rowsElement.children[rowIndex];\n const secondCombo = rowElement?.querySelector('.second-combo');\n if (!secondCombo) {\n this.#renderRows();\n return;\n }\n\n const secondOptions = this.#getSecondOptionsForFirstValues(\n currentRowValue.firstValues,\n );\n secondCombo.data = secondOptions;\n this.#syncComboSelection(secondCombo, currentRowValue.secondValues);\n }\n\n #updateAddButtonSize() {\n this.addButtonElement.setAttribute('size', this.size);\n }\n\n #updateAddButtonState() {\n if (this.disabled || this.readonly || this.#isMaxRowsReached()) {\n this.addButtonElement.setAttribute('disabled', 'true');\n } else {\n this.addButtonElement.removeAttribute('disabled');\n }\n }\n\n #isMaxRowsReached() {\n return Number.isFinite(this.maxRows) && this.#rows.length >= this.maxRows;\n }\n\n #removeRowFromDOM(rowIndex) {\n this.rowsElement.children[rowIndex]?.remove();\n }\n\n #handleComboChange({ rowIndex, type, selectedValues }) {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const currentRow = this.#rows[rowIndex];\n\n if (!currentRow) {\n return;\n }\n\n if (type === 'first') {\n const availableSecondOptions =\n this.#getSecondOptionsForFirstValues(selectedValues);\n const availableSecondValuesSet = new Set(\n availableSecondOptions.map((item) => item.value),\n );\n\n const nextSecondValues = currentRow.secondValues.filter((value) =>\n availableSecondValuesSet.has(value),\n );\n\n if (\n areSameValues(currentRow.firstValues, selectedValues) &&\n areSameValues(currentRow.secondValues, nextSecondValues)\n ) {\n return;\n }\n\n this.#rows[rowIndex] = {\n firstValues: selectedValues,\n secondValues: nextSecondValues,\n };\n\n this.#updateSecondComboForRow(rowIndex);\n this.#emitValueChange();\n return;\n }\n\n if (areSameValues(currentRow.secondValues, selectedValues)) {\n return;\n }\n\n this.#rows[rowIndex] = {\n ...currentRow,\n secondValues: selectedValues,\n };\n\n this.#emitValueChange();\n }\n\n #removeRow(rowIndex) {\n if (this.disabled || this.readonly || this.#rows.length <= 1) {\n return;\n }\n\n const removedRow = this.#rows[rowIndex];\n this.#rows = this.#rows.filter((_, index) => index !== rowIndex);\n\n this.#removeRowFromDOM(rowIndex);\n this.#updateAddButtonState();\n\n const rowHadValues =\n removedRow.firstValues.length > 0 || removedRow.secondValues.length > 0;\n if (rowHadValues) {\n this.#emitValueChange();\n }\n }\n\n #emitValueChange() {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n }\n}\n\nconst host = { selector: () => ':host' };\nconst rows = { selector: '.rows' };\nconst row = { selector: '.row' };\nconst addAction = { selector: '.add-action' };\n\nexport const MultiLineMappingsClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: [\n { ...host, property: 'direction' },\n {\n selector: MultiSelectComboBoxClass.componentName,\n property: MultiSelectComboBoxClass.cssVarList.hostDirection,\n },\n {\n selector: ButtonClass.componentName,\n property: ButtonClass.cssVarList.hostDirection,\n },\n ],\n rowsGap: { ...rows, property: 'gap' },\n rowGap: { ...row, property: 'gap' },\n rowAlignItems: { ...row, property: 'align-items' },\n rowWrap: { ...row, property: 'flex-wrap' },\n addActionJustifyContent: { ...addAction, property: 'justify-content' },\n addActionMarginTop: { ...addAction, property: 'margin-top' },\n },\n }),\n draggableMixin,\n)(RawMultiLineMappingsClass);\n","import '@descope-ui/descope-button';\nimport '@descope-ui/descope-multi-select-combo-box';\n\nimport {\n componentName,\n MultiLineMappingsClass,\n} from './MultiLineMappingsClass';\n\ncustomElements.define(componentName, MultiLineMappingsClass);\n\nexport { MultiLineMappingsClass, 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 { css } from 'lit';\n\nexport const buttonStyles = css`\n :host {\n display: inline-block;\n position: relative;\n outline: none;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Aligns the button with form fields when placed on the same line.\n Note, to make it work, the form fields should have the same \"::before\" pseudo-element. */\n .vaadin-button-container::before {\n content: '\\\\2003';\n display: inline-block;\n width: 0;\n max-height: 100%;\n }\n\n .vaadin-button-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n width: 100%;\n height: 100%;\n min-height: inherit;\n text-shadow: inherit;\n }\n\n [part='prefix'],\n [part='suffix'] {\n flex: none;\n }\n\n [part='label'] {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n @media (forced-colors: active) {\n :host {\n outline: 1px solid;\n outline-offset: -1px;\n }\n\n :host([focused]) {\n outline-width: 2px;\n }\n\n :host([disabled]) {\n outline-color: GrayText;\n }\n }\n`;\n\nexport const buttonTemplate = (html) => html`\n <div class=\"vaadin-button-container\">\n <span part=\"prefix\" aria-hidden=\"true\">\n <slot name=\"prefix\"></slot>\n </span>\n <span part=\"label\">\n <slot></slot>\n </span>\n <span part=\"suffix\" aria-hidden=\"true\">\n <slot name=\"suffix\"></slot>\n </span>\n </div>\n <slot name=\"tooltip\"></slot>\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 { ActiveMixin } from '@vaadin/a11y-base/src/active-mixin.js';\nimport { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';\nimport { TabindexMixin } from '@vaadin/a11y-base/src/tabindex-mixin.js';\n\n/**\n * A mixin providing common button functionality.\n *\n * @polymerMixin\n * @mixes ActiveMixin\n * @mixes FocusMixin\n * @mixes TabindexMixin\n */\nexport const ButtonMixin = (superClass) =>\n class ButtonMixinClass extends ActiveMixin(TabindexMixin(FocusMixin(superClass))) {\n static get properties() {\n return {\n /**\n * Indicates whether the element can be focused and where it participates in sequential keyboard navigation.\n *\n * @override\n * @protected\n */\n tabindex: {\n type: Number,\n value: 0,\n reflectToAttribute: true,\n },\n };\n }\n\n /**\n * By default, `Space` is the only possible activation key for a focusable HTML element.\n * Nonetheless, the button is an exception as it can be also activated by pressing `Enter`.\n * See the \"Keyboard Support\" section in https://www.w3.org/TR/wai-aria-practices/examples/button/button.html.\n *\n * @protected\n * @override\n */\n get _activeKeys() {\n return ['Enter', ' '];\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n // By default, if the user hasn't provided a custom role,\n // the role attribute is set to \"button\".\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n }\n\n /**\n * Since the button component is designed on the base of the `[role=button]` attribute,\n * and doesn't have a native <button> inside, in order to be fully accessible from the keyboard,\n * it should manually fire the `click` event once an activation key is pressed,\n * as it follows from the WAI-ARIA specifications:\n * https://www.w3.org/TR/wai-aria-practices-1.1/#button\n *\n * According to the UI Events specifications,\n * the `click` event should be fired exactly on `keydown`:\n * https://www.w3.org/TR/uievents/#event-type-keydown\n *\n * @param {KeyboardEvent} event\n * @protected\n * @override\n */\n _onKeyDown(event) {\n super._onKeyDown(event);\n\n if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) {\n return;\n }\n\n if (this._activeKeys.includes(event.key)) {\n event.preventDefault();\n\n // `DisabledMixin` overrides the standard `click()` method\n // so that it doesn't fire the `click` event when the element is disabled.\n this.click();\n }\n }\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 { html, PolymerElement } from '@polymer/polymer/polymer-element.js';\nimport { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { buttonStyles, buttonTemplate } from './vaadin-button-base.js';\nimport { ButtonMixin } from './vaadin-button-mixin.js';\n\nregisterStyles('vaadin-button', buttonStyles, { moduleId: 'vaadin-button-styles' });\n\n/**\n * `<vaadin-button>` is an accessible and customizable button that allows users to perform actions.\n *\n * ```html\n * <vaadin-button>Press me</vaadin-button>\n * ```\n *\n * ### Styling\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ----------|-------------\n * `label` | The label (text) inside the button.\n * `prefix` | A slot for content before the label (e.g. an icon).\n * `suffix` | A slot for content after the label (e.g. an icon).\n *\n * The following attributes are available for styling:\n *\n * Attribute | Description\n * -------------|-------------\n * `active` | Set when the button is pressed down, either with mouse, touch or the keyboard.\n * `disabled` | Set when the button is disabled.\n * `focus-ring` | Set when the button is focused using the keyboard.\n * `focused` | Set when the button is focused.\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ButtonMixin\n * @mixes ControllerMixin\n * @mixes ElementMixin\n * @mixes ThemableMixin\n */\nclass Button extends ButtonMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement)))) {\n static get is() {\n return 'vaadin-button';\n }\n\n static get template() {\n return buttonTemplate(html);\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(Button);\n\nexport { Button };\n","import '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/spacing.js';\nimport '@vaadin/vaadin-lumo-styles/style.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nconst button = css`\n :host {\n /* Sizing */\n --lumo-button-size: var(--lumo-size-m);\n min-width: var(--vaadin-button-min-width, calc(var(--_button-size) * 2));\n height: var(--_button-size);\n padding: var(--vaadin-button-padding, 0 calc(var(--_button-size) / 3 + var(--lumo-border-radius-m) / 2));\n margin: var(--vaadin-button-margin, var(--lumo-space-xs) 0);\n box-sizing: border-box;\n /* Style */\n font-family: var(--lumo-font-family);\n font-size: var(--vaadin-button-font-size, var(--lumo-font-size-m));\n font-weight: var(--vaadin-button-font-weight, 500);\n color: var(--_lumo-button-text-color);\n background: var(--_lumo-button-background);\n border: var(--vaadin-button-border, none);\n border-radius: var(--vaadin-button-border-radius, var(--lumo-border-radius-m));\n cursor: var(--lumo-clickable-cursor);\n -webkit-tap-highlight-color: transparent;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n flex-shrink: 0;\n --_button-size: var(--vaadin-button-height, var(--lumo-button-size));\n --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));\n --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);\n /* Used by notification */\n --_lumo-button-background: var(--vaadin-button-background, var(--lumo-contrast-5pct));\n --_lumo-button-text-color: var(--vaadin-button-text-color, var(--lumo-primary-text-color));\n --_lumo-button-primary-background: var(--vaadin-button-primary-background, var(--lumo-primary-color));\n --_lumo-button-primary-text-color: var(--vaadin-button-primary-text-color, var(--lumo-primary-contrast-color));\n }\n\n /* Set only for the internal parts so we don't affect the host vertical alignment */\n [part='label'],\n [part='prefix'],\n [part='suffix'] {\n line-height: var(--lumo-line-height-xs);\n }\n\n [part='label'] {\n padding: calc(var(--lumo-button-size) / 6) 0;\n }\n\n :host([theme~='small']) {\n font-size: var(--lumo-font-size-s);\n --lumo-button-size: var(--lumo-size-s);\n }\n\n :host([theme~='large']) {\n font-size: var(--lumo-font-size-l);\n --lumo-button-size: var(--lumo-size-l);\n }\n\n /* For interaction states */\n :host::before,\n :host::after {\n content: '';\n /* We rely on the host always being relative */\n position: absolute;\n z-index: 1;\n inset: 0;\n background-color: currentColor;\n border-radius: inherit;\n opacity: 0;\n pointer-events: none;\n }\n\n /* Hover */\n\n @media (any-hover: hover) {\n :host(:hover)::before {\n opacity: 0.02;\n }\n }\n\n /* Active */\n\n :host::after {\n transition: opacity 1.4s, transform 0.1s;\n filter: blur(8px);\n }\n\n :host([active])::before {\n opacity: 0.05;\n transition-duration: 0s;\n }\n\n :host([active])::after {\n opacity: 0.1;\n transition-duration: 0s, 0s;\n transform: scale(0);\n }\n\n /* Keyboard focus */\n\n :host([focus-ring]) {\n box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);\n }\n\n :host([theme~='primary'][focus-ring]) {\n box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);\n }\n\n /* Types (primary, tertiary, tertiary-inline */\n\n :host([theme~='tertiary']),\n :host([theme~='tertiary-inline']) {\n --_background: transparent !important;\n background: var(--vaadin-button-tertiary-background, var(--_background));\n min-width: 0;\n }\n\n :host([theme~='tertiary']) {\n border: var(--vaadin-button-tertiary-border, none);\n color: var(--vaadin-button-tertiary-text-color, var(--lumo-primary-text-color));\n font-weight: var(--vaadin-button-tertiary-font-weight, 500);\n padding: var(--vaadin-button-tertiary-padding, 0 calc(var(--_button-size) / 6));\n }\n\n :host([theme~='tertiary-inline'])::before {\n display: none;\n }\n\n :host([theme~='tertiary-inline']) {\n margin: 0;\n height: auto;\n padding: 0;\n line-height: inherit;\n font-size: inherit;\n }\n\n :host([theme~='tertiary-inline']) [part='label'] {\n padding: 0;\n overflow: visible;\n line-height: inherit;\n }\n\n :host([theme~='primary']) {\n background: var(--_lumo-button-primary-background);\n border: var(--vaadin-button-primary-border, none);\n color: var(--_lumo-button-primary-text-color);\n font-weight: var(--vaadin-button-primary-font-weight, 600);\n min-width: calc(var(--lumo-button-size) * 2.5);\n }\n\n :host([theme~='primary'])::before {\n background-color: black;\n }\n\n @media (any-hover: hover) {\n :host([theme~='primary']:hover)::before {\n opacity: 0.05;\n }\n }\n\n :host([theme~='primary'][active])::before {\n opacity: 0.1;\n }\n\n :host([theme~='primary'][active])::after {\n opacity: 0.2;\n }\n\n /* Colors (success, error, contrast) */\n\n :host([theme~='success']) {\n color: var(--lumo-success-text-color);\n }\n\n :host([theme~='success'][theme~='primary']) {\n background-color: var(--lumo-success-color);\n color: var(--lumo-success-contrast-color);\n }\n\n :host([theme~='error']) {\n color: var(--lumo-error-text-color);\n }\n\n :host([theme~='error'][theme~='primary']) {\n background-color: var(--lumo-error-color);\n color: var(--lumo-error-contrast-color);\n }\n\n :host([theme~='contrast']) {\n color: var(--lumo-contrast);\n }\n\n :host([theme~='contrast'][theme~='primary']) {\n background-color: var(--lumo-contrast);\n color: var(--lumo-base-color);\n }\n\n /* Disabled state. Keep selectors after other color variants. */\n\n :host([disabled]) {\n pointer-events: none;\n color: var(--lumo-disabled-text-color);\n }\n\n :host([theme~='primary'][disabled]) {\n background-color: var(--lumo-contrast-30pct);\n color: var(--lumo-base-color);\n }\n\n :host([theme~='primary'][disabled]) [part] {\n opacity: 0.7;\n }\n\n /* Icons */\n\n [part] ::slotted(vaadin-icon) {\n display: inline-block;\n width: var(--lumo-icon-size-m);\n height: var(--lumo-icon-size-m);\n }\n\n /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */\n [part] ::slotted(vaadin-icon[icon^='vaadin:']) {\n padding: 0.25em;\n box-sizing: border-box !important;\n }\n\n [part='prefix'] {\n margin-left: -0.25em;\n margin-right: 0.25em;\n }\n\n [part='suffix'] {\n margin-left: 0.25em;\n margin-right: -0.25em;\n }\n\n /* Icon-only */\n\n :host([theme~='icon']:not([theme~='tertiary-inline'])) {\n min-width: var(--lumo-button-size);\n padding-left: calc(var(--lumo-button-size) / 4);\n padding-right: calc(var(--lumo-button-size) / 4);\n }\n\n :host([theme~='icon']) [part='prefix'],\n :host([theme~='icon']) [part='suffix'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* RTL specific styles */\n\n :host([dir='rtl']) [part='prefix'] {\n margin-left: 0.25em;\n margin-right: -0.25em;\n }\n\n :host([dir='rtl']) [part='suffix'] {\n margin-left: -0.25em;\n margin-right: 0.25em;\n }\n\n :host([dir='rtl'][theme~='icon']) [part='prefix'],\n :host([dir='rtl'][theme~='icon']) [part='suffix'] {\n margin-left: 0;\n margin-right: 0;\n }\n`;\n\nregisterStyles('vaadin-button', button, { moduleId: 'lumo-button' });\n\nexport { button };\n"],"names":["componentName","host","label","slottedIcon","selector","loadingIndicatorStyles","ButtonClass","triggers","attr","value","mappings","hostWidth","property","hostHeight","hostDirection","fontSize","fontFamily","fontWeight","cursor","backgroundColor","outlineOffset","outlineColor","outlineStyle","outlineWidth","borderRadius","borderColor","borderStyle","borderWidth","verticalPadding","horizontalPadding","fallback","labelTextColor","iconColor","cssVarList","fill","labelTextDecoration","labelSpacing","textAlign","iconSize","slots","wrappedEleName","style","excludeAttrsSync","color","clickableMixin","superclass","isLoading","this","getAttribute","click","super","customElements","define","IconClass","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","height","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","BaseClass","toNormalizedValue","item","String","id","uniqueValues","values","Set","map","filter","Boolean","normalizeOption","displayName","normalizeOptions","options","Array","isArray","uniqueSet","option","has","areSameValues","first","second","length","every","v","i","row","addAction","MultiLineMappingsClass","MultiSelectComboBoxClass","rowsGap","rowGap","rowAlignItems","rowWrap","addActionJustifyContent","addActionMarginTop","firstValues","secondValues","rowsElement","shadowRoot","addButtonElement","size","firstValueKey","secondValueKey","firstLabel","secondLabel","firstPlaceholder","secondPlaceholder","disabled","readonly","mergeRows","maxRows","Number","isFinite","undefined","data","flatMap","rowValue","firstValue","rawValue","parsed","source","trim","JSON","parse","error","console","parseJSON","optionsMap","Object","entries","key","strKey","isEnriched","fromEntries","addEventListener","name","el","includes","combo","type","from","children","rowElement","removeAttribute","newRow","append","result","firstRaw","Map","sort","join","get","push","set","firstValuesSet","o","availableSecondOptions","availableSecondValuesSet","lists","baseList","otherLists","intersectionSet","currentSet","delete","getRowIndex","placeholder","selectedValues","comboElement","className","__descopeSyncingSelection","rowIndex","Promise","resolve","selectedValuesSet","selectedItems","items","buttonElement","indexOf","firstCombo","secondOptions","secondCombo","currentRowValue","currentRow","nextSecondValues","removedRow","_","index","dispatchEvent","Event","bubbles","composed","buttonStyles","ButtonMixin","superClass","properties","tabindex","reflectToAttribute","_activeKeys","ready","hasAttribute","_onKeyDown","event","altKey","shiftKey","ctrlKey","metaKey","preventDefault","moduleId","Button","is","template","_tooltipController","addController","button"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9054],{94681(e,t,o){o.d(t,{T:()=>l,t:()=>I});var r=o(63200),i=o(25964),n=o(79673),a=o(88961);const l=(0,i.xE)("multi-select-combo-box"),{host:s,inputField:p,inputElement:d,placeholder:c,toggle:u,clearButton:m,label:h,requiredIndicator:b,helperText:y,errorMessage:g,chip:v,chipLabel:f,overflowChipFirstBorder:x,overflowChipSecondBorder:w}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},chip:{selector:"vaadin-multi-select-combo-box-chip"},chipLabel:{selector:"vaadin-multi-select-combo-box-chip::part(label)"},overflowChipFirstBorder:{selector:"vaadin-multi-select-combo-box-chip[slot='overflow']::before"},overflowChipSecondBorder:{selector:"vaadin-multi-select-combo-box-chip[slot='overflow']::after"}},I=(0,r.Zz)((0,a.RF)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],chipFontSize:{...f,property:"font-size"},fontFamily:[h,c,p,y,g,f],labelFontSize:{...h,property:"font-size"},labelFontWeight:{...h,property:"font-weight"},inputValueFontWeight:{...p,property:"font-weight"},inputPlaceholderFontWeight:{...c,property:"font-weight"},helperTextFontWeight:{...y,property:"font-weight"},errorMessageFontWeight:{...g,property:"font-weight"},labelTextColor:[{...h,property:"color"},{...b,property:"color"}],errorMessageTextColor:{...g,property:"color"},errorMessageIcon:{...g,property:"background-image"},errorMessageIconSize:{...g,property:"background-size"},errorMessageIconPadding:{...g,property:"padding-inline-start"},errorMessageIconRepeat:{...g,property:"background-repeat"},errorMessageIconPosition:{...g,property:"background-position"},errorMessageFontSize:{...g,property:"font-size"},inputHeight:{...p,property:"min-height"},inputBackgroundColor:{...p,property:"background-color"},inputBorderColor:{...p,property:"border-color"},inputBorderWidth:{...p,property:"border-width"},inputBorderStyle:{...p,property:"border-style"},inputBorderRadius:{...p,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...p,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...m,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...m,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...m,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...p,property:"outline-color"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputHorizontalPadding:[{...d,property:"padding-left"},{...d,property:"padding-right"},{...p,property:"padding-inline-start"}],inputVerticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}],chipTextColor:{...f,property:"color"},chipBackgroundColor:[{...v,property:"background-color"},{...x,property:"border-color"},{...w,property:"border-color"}],labelPosition:{...h,property:"position"},labelTopPosition:{...h,property:"top"},labelLeftPosition:{...h,property:"left"},labelHorizontalPosition:[{...h,property:"left"},{...h,property:"right"}],inputTransformY:{...h,property:"transform"},inputTransition:{...h,property:"transition"},marginInlineStart:{...h,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...p,property:"align-items"},overlayBackground:{property:()=>I.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>I.cssVarList.overlay.textColor},overlayBorder:{property:()=>I.cssVarList.overlay.border},overlayFontSize:{property:()=>I.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>I.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>I.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>I.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>I.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>I.cssVarList.overlay.itemPaddingInlineEnd}}}),a.VO,(0,a.mA)({name:"overlay",selector:"vaadin-multi-select-combo-box-internal",mappings:{backgroundColor:{selector:"vaadin-multi-select-combo-box-scroller"},minHeight:{selector:"vaadin-multi-select-combo-box-overlay"},margin:{selector:"vaadin-multi-select-combo-box-overlay"},cursor:{selector:"vaadin-multi-select-combo-box-item"},fontFamily:{selector:"vaadin-multi-select-combo-box-item"},textColor:{selector:"vaadin-multi-select-combo-box-item",property:"color"},fontSize:{selector:"vaadin-multi-select-combo-box-item"},itemBoxShadow:{selector:"vaadin-multi-select-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-multi-select-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-multi-select-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.OZ)({proxyProps:["selectionStart"],inputEvent:"selected-items-changed"}),a._$,a.tQ,e=>class extends e{static get observedAttributes(){return["readonly"]}#e=({displayName:e,value:t,label:o})=>{const r=document.createElement("span");return r.setAttribute("data-name",o),r.setAttribute("data-id",t),r.textContent=e||o,r.outerHTML};#t;#o=[];get defaultValues(){const e=this.getAttribute("default-values");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "default-values" -',e.message)}return[]}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" -',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}get allowCustomValues(){return"true"===this.getAttribute("allow-custom-value")}get minItemsSelection(){return parseInt(this.getAttribute("min-items-selection"),10)||0}get maxItemsSelection(){return parseInt(this.getAttribute("max-items-selection"),10)||0}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data and default-values must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.renderItem?.(t||{})||""),"")}renderItems(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}updateSelectedItems(){const e=this.baseElement.selectedItems?.map(e=>e.getAttribute("data-id"))||[];e.length>0&&(this.value=e),0===this.value.length&&this.setDefaultValues()}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(o){const r=t.customValueTransformFn(o)||"";r!==this.value&&e.set.call(this,r)}}})}#r(e){return Array.from(new Map(e.map(e=>[e.getAttribute("data-id"),e])).values())}#i(){const e=Array.from(this.children),t=this.#r(e);e.length?(this.removeAttribute("has-no-options"),t.forEach(e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})}),this.baseElement.items=t,setTimeout(()=>{this.updateSelectedItems()},0)):(this.baseElement.items=[],this.setAttribute("has-no-options","")),this.baseElement.renderer=(e,t,o)=>{e.innerHTML=o.item.outerHTML}}#n(){const e=this.baseElement.shadowRoot.querySelector("vaadin-multi-select-combo-box-internal").shadowRoot.querySelector("vaadin-multi-select-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}#a(){this.allowCustomValues&&this.baseElement.addEventListener("custom-value-set",e=>{const t=this.#e({label:e.detail,displayName:e.detail,value:e.detail});this.innerHTML+=t,this.baseElement._lastFilter="",setTimeout(()=>{this.value=[...this.value,e.detail]},0)})}setGetValidity(){this.getValidity=function(){if(this.pattern){const e=new RegExp(this.pattern);if(this.value.some(t=>!e.test(t)))return{patternMismatch:!0}}return this.isRequired&&!this.value.length?{valueMissing:!0}:this.isRequired&&this.minItemsSelection&&this.value.length<this.minItemsSelection?{rangeUnderflow:!0}:this.maxItemsSelection&&this.value.length>this.maxItemsSelection?{rangeOverflow:!0}:{}};const e=this;this.baseElement.checkValidity=()=>e.validity.valid}init(){super.init?.(),this.setGetValidity(),this.#a(),this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.Ge)(this,this.#i.bind(this)),(0,i.EA)(this,this.baseElement,{includeAttrs:["placeholder"]}),setTimeout(()=>{this.setComboBoxDescriptor(),this.#n()}),this.setDefaultValues(),this.baseElement.addEventListener("selected-items-changed",()=>{this.#l(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0}))})}setDefaultValues(){this.defaultValues.length>0&&(this.value=this.defaultValues)}#l(){this.#o=this.baseElement.selectedItems?.map(e=>e.getAttribute("data-id"))||[]}set value(e){if(e&&e.length>0){const t=this.baseElement.items?.filter(t=>e.includes(t["data-id"]));if(this.allowCustomValues){const o=t?.map(e=>e.getAttribute("data-id"))||[],r=e.filter(e=>!o.includes(e));if(r.length){const t=r.reduce((e,t)=>e+this.#e({label:t,displayName:t,value:t}),"");return this.innerHTML+=t,void setTimeout(()=>{this.value=e},0)}}const o=t?.map(e=>e.getAttribute("data-id"))||[];(0,r.AG)(this.#o,o)||(this.baseElement.selectedItems=t)}else this.baseElement.selectedItems=[]}get value(){return this.#o}attributeChangedCallback(e,t,o){super.attributeChangedCallback?.(e,t,o),"readonly"===e&&this.onReadOnlyChange(null!==o&&"true"===o)}onReadOnlyChange(e){e?this.baseElement?.shadowRoot?.querySelector("vaadin-multi-select-combo-box-internal")?.setAttribute("inert",e):this.baseElement?.shadowRoot?.querySelector("vaadin-multi-select-combo-box-internal")?.removeAttribute("inert")}})((0,a.tz)({slots:["","prefix"],wrappedEleName:"vaadin-multi-select-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,n.cy)(I.cssVarList)}\n\t\t${(0,n.fu)("vaadin-multi-select-combo-box")}\n\t\t${(0,n.lS)("vaadin-multi-select-combo-box")}\n\t\t${(0,n.I4)("vaadin-multi-select-combo-box")}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot="input"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,n.$J)("vaadin-multi-select-combo-box")}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${(0,n.Kl)()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,excludeAttrsSync:["tabindex","size","data","placeholder","style"],componentName:l,includeForwardProps:["items","renderer","selectedItems"]}))},70067(e,t,o){o.r(t),o.d(t,{MultiSelectComboBoxClass:()=>r.t,componentName:()=>r.T}),o(51408);var r=o(94681);customElements.define(r.T,r.t)}}]);
2
+ //# sourceMappingURL=descope-multi-select-combo-box.js.map