@descope/web-components-ui 3.27.4 → 3.27.6

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 (47) hide show
  1. package/dist/cjs/index.cjs.js +94 -10
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +95 -11
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/9439.js +1 -1
  6. package/dist/umd/9439.js.map +1 -1
  7. package/dist/umd/9582.js +1 -1
  8. package/dist/umd/9582.js.map +1 -1
  9. package/dist/umd/DescopeDev.js +1 -1
  10. package/dist/umd/DescopeDev.js.map +1 -1
  11. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  12. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
  13. package/dist/umd/descope-alert-index-js.js +1 -1
  14. package/dist/umd/descope-alert-index-js.js.map +1 -1
  15. package/dist/umd/descope-collapsible-container.js +1 -1
  16. package/dist/umd/descope-collapsible-container.js.map +1 -1
  17. package/dist/umd/descope-enriched-text.js +1 -1
  18. package/dist/umd/descope-enriched-text.js.map +1 -1
  19. package/dist/umd/descope-hybrid-field-index-js.js +3 -3
  20. package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
  21. package/dist/umd/descope-new-password-index-js.js +1 -1
  22. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  23. package/dist/umd/descope-passcode-index-js.js +1 -1
  24. package/dist/umd/descope-passcode-index-js.js.map +1 -1
  25. package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
  26. package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
  27. package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
  28. package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
  29. package/dist/umd/descope-text-field.js +1 -1
  30. package/dist/umd/descope-text-field.js.map +1 -1
  31. package/dist/umd/descope-tooltip.js +1 -1
  32. package/dist/umd/descope-tooltip.js.map +1 -1
  33. package/dist/umd/index.js +1 -1
  34. package/dist/umd/index.js.map +1 -1
  35. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  36. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  37. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  38. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  39. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  40. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
  41. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  42. package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
  43. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
  44. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
  45. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  46. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
  47. package/package.json +46 -46
@@ -1 +1 @@
1
- {"version":3,"file":"descope-collapsible-container.js","mappings":"oIAAAA,EAAAC,QAAA,6yBCeO,MAAAC,GAAsB,EAAAC,EAAAC,IAAgB,yBAE7C,MAAAC,WAAsC,EAAAC,EAAAC,IAAe,CACrDL,gBACAM,aAAA,UAEA,6BAAAC,GACA,wCACA,CAEA,WAAAC,GACAC,QAEAC,KAAAC,aAAA,CAAwBC,KAAA,SAAcC,UAAA,kOAMmBC,iNAYrD,EAAAb,EAAAc,IACJ,mwBAkCwBC,EAAAC,EAASC,WAAAC,oiBA0BjCT,MAGAA,KAAAU,OAAAV,KAAAW,WAAAC,cAAA,WACAZ,KAAAa,QAAAb,KAAAW,WAAAC,cAAA,eACAZ,KAAAc,KAAAd,KAAAU,OAAAE,cAAA,gBACAZ,KAAAe,WAAAf,KAAAU,OAAAE,cAAA,QACAZ,KAAAgB,c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,UACpBtD,eAAA,CAAwBsD,SAAA,eACxBuH,kBAAA,CAA2BvH,SAAA,kBAC3BwH,WAAA,GACAC,UAAA,GACAC,cAAA,GACAC,WAAA,GACAC,UAAA,GACAC,WAAA,GACA5G,YAAA,GACAD,YAAA,GACAD,YAAA,OAGE,EAAAoB,EAAA2F,IAAY,CAAGC,SAAA,EAAaC,KAAA,aAAAC,MAAA,WAC5B9F,EAAAP,GACAO,EAAAN,GAtBuB,CAuBzB+E,qGCjFA9E,eAAAC,OAAsBmG,EAAApF,EAAeoF,EAAA1L","sources":["webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/chevron.svg","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/CollapsibleContainerClass.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.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-image/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js"],"sourcesContent":["module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik02Ljc4MDcgMTQuNzI3MkM2LjM0MTYgMTUuMTIwOSA1LjY2NjYgMTUuMDg0MSA1LjI3MjggMTQuNjQ1MUM0Ljg3OTEgMTQuMjA2IDQuOTE1OSAxMy41MzA5IDUuMzU0OSAxMy4xMzcyQzUuMzU0OSAxMy4xMzcyIDEwLjk1NDMgNy45OTc4IDExLjM2IDcuNjM0QzExLjc2NTcgNy4yNzAyIDEyLjIzOTIgNy4yNzAyIDEyLjY0NDggNy42MzRMMTguNjQ1MSAxMy4xMzcyQzE5LjA4NDEgMTMuNTMwOSAxOS4xMjA5IDE0LjIwNiAxOC43MjcyIDE0LjY0NTFDMTguMzMzNCAxNS4wODQxIDE3LjY1ODQgMTUuMTIwOSAxNy4yMTkzIDE0LjcyNzJMMTIgOS44NjMyTDYuNzgwNyAxNC43MjcyWiIvPiA8L3N2Zz4g\"","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} from '@descope-ui/common/components-helpers';\nimport chevronIcon from './chevron.svg';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('collapsible-container');\n\nclass RawCollapsibleContainer extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return ['collapsed', 'collapsible', 'text'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <descope-text st-host-direction=\"ltr\">\n <div class=\"header\">\n <div class=\"title\">\n <div class=\"icon\">\n <descope-icon st-fill=\"currentcolor\" src=${chevronIcon}></descope-icon>\n </div>\n <span></span>\n </div>\n </div>\n </descope-text>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n\t`;\n\n injectStyle(\n `\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .title {\n display: contents;\n }\n :host([attach-icon=\"true\"]) .header {\n display: block;\n }\n :host([attach-icon=\"true\"]) .title {\n display: inline-flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${TextClass.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,\n this,\n );\n\n this.header = this.shadowRoot.querySelector('.header');\n this.content = this.shadowRoot.querySelector('div.content');\n this.icon = this.header.querySelector('descope-icon');\n this.headerText = this.header.querySelector('span');\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n }\n\n get isCollapsible() {\n return this.getAttribute('collapsible') === 'true';\n }\n\n calcContentHeight() {\n return this.content.offsetHeight || this.content.scrollHeight;\n }\n\n get isCollapsed() {\n return this.getAttribute('collapsed') === 'true';\n }\n\n toggle() {\n this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');\n }\n\n collapse(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '0px';\n };\n this.icon.classList.add('rotate');\n if (!animated) return final();\n\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n setTimeout(final);\n }\n\n expand(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '';\n };\n this.icon.classList.remove('rotate');\n if (!animated) return final();\n\n this.content.addEventListener('transitionend', final, { once: true });\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n }\n\n #isComponentMounted = false;\n\n init() {\n super.init?.();\n // we want to animate the collapse/expand only after the first time the component is connected\n // so when setting a default value for the collapsed attribute, it will not animate\n this.#isComponentMounted = true;\n\n this.header.addEventListener('click', () => {\n if (!this.isCollapsible) return;\n this.toggle();\n });\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['text-align', 'text-variant', 'text-mode'],\n mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },\n });\n }\n\n updateHeaderText() {\n const text = this.getAttribute('text') || '';\n this.headerText.innerText = text;\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'text') {\n this.updateHeaderText();\n return;\n }\n const collapsed = this.isCollapsed && this.isCollapsible;\n if (collapsed) {\n this.collapse(this.#isComponentMounted);\n } else {\n this.expand(this.#isComponentMounted);\n }\n }\n}\n\nconst selectors = {\n host: () => ':host',\n icon: () => 'descope-icon',\n collapsedIcon: () => 'descope-icon.rotate',\n iconWrapper: () => '.icon',\n header: () => '.header',\n iconAndText: () => '.header, .title',\n text: () => 'span',\n wrapper: () => '.wrapper',\n content: () => 'div.content',\n};\n\nexport const CollapsibleContainerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: selectors.host, property: 'width' },\n hostDirection: { selector: selectors.host, property: 'direction' },\n verticalPadding: [\n { selector: selectors.wrapper, property: 'padding-top' },\n { selector: selectors.wrapper, property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { selector: selectors.wrapper, property: 'padding-left' },\n { selector: selectors.wrapper, property: 'padding-right' },\n ],\n\n flexDirection: {},\n justifyContent: {},\n alignItems: {},\n gap: [{}, { property: 'margin-top' }],\n\n backgroundColor: { selector: selectors.wrapper },\n backgroundImage: { selector: selectors.wrapper },\n backgroundPositionX: { selector: selectors.wrapper },\n backgroundPositionY: { selector: selectors.wrapper },\n backgroundSize: { selector: selectors.wrapper },\n backgroundRepeat: { selector: selectors.wrapper },\n\n borderRadius: { selector: selectors.wrapper },\n borderColor: { selector: selectors.wrapper },\n borderStyle: { selector: selectors.wrapper },\n borderWidth: { selector: selectors.wrapper },\n\n boxShadow: { selector: selectors.wrapper },\n\n headerIconOrder: { selector: selectors.iconWrapper, property: 'order' },\n headerCursor: { selector: selectors.header, property: 'cursor' },\n headerGap: { selector: selectors.iconAndText, property: 'gap' },\n textGrow: { selector: selectors.text, property: 'flex-grow' },\n textDirection: { selector: selectors.text, property: 'direction' },\n iconAnimationDuration: {\n selector: selectors.icon,\n property: 'transition-duration',\n },\n contentAnimationDuration: {\n selector: selectors.content,\n property: 'transition-duration',\n },\n chevronRotation: {\n selector: selectors.collapsedIcon,\n property: 'transform',\n fallback: 'rotate(180deg)',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawCollapsibleContainer);\n","import '@descope-ui/descope-text'\nimport '@descope-ui/descope-icon'\nimport { componentName, CollapsibleContainerClass } from './CollapsibleContainerClass';\n\ncustomElements.define(componentName, CollapsibleContainerClass);\n\nexport { CollapsibleContainerClass, 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 height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style', 'st-height', 'st-width'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n"," \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 \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 { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["module","exports","componentName","componentsHelpers","xE","RawCollapsibleContainer","baseClasses","qu","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","chevron_default","fz","TextClass","s","cssVarList","textLineHeight","header","shadowRoot","querySelector","content","icon","headerText","textComponent","isCollapsible","getAttribute","calcContentHeight","offsetHeight","scrollHeight","isCollapsed","toggle","setAttribute","collapse","animated","final","style","maxHeight","classList","add","setTimeout","expand","remove","addEventListener","once","isComponentMounted","init","EA","includeAttrs","mapAttrs","updateHeaderText","text","innerText","attributeChangedCallback","name","oldValue","newValue","selectors","host","collapsedIcon","iconWrapper","iconAndText","wrapper","CollapsibleContainerClass","utils","Zz","componentsMixins","RF","mappings","hostWidth","selector","property","hostDirection","verticalPadding","horizontalPadding","flexDirection","justifyContent","alignItems","gap","backgroundColor","backgroundImage","backgroundPositionX","backgroundPositionY","backgroundSize","backgroundRepeat","borderRadius","borderColor","borderStyle","borderWidth","boxShadow","headerIconOrder","headerCursor","headerGap","textGrow","textDirection","iconAnimationDuration","contentAnimationDuration","chevronRotation","fallback","VO","tQ","customElements","define","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_1__","IconClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_3__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","fill","_descope_ui_descope_image_class__WEBPACK_IMPORTED_MODULE_2__","q","height","width","tz","slots","wrappedEleName","excludeAttrsSync","_IconClass__WEBPACK_IMPORTED_MODULE_1__","T","S","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_3__","srcAttrs","RawImage","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_1__","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","altText","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","ImageClass","_helpers__WEBPACK_IMPORTED_MODULE_4__","m","then","res","appendChild","shouldRender","src","srcVal","attrName","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","createSvgEle","clean","dompurify__WEBPACK_IMPORTED_MODULE_0__","A","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","_ImageClass__WEBPACK_IMPORTED_MODULE_0__","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","RawText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","hideWhenEmpty","Ge","hasChildren","childNodes","length","display","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","fontSize","textColor","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","DM","triggers","attr","value","_TextClass__WEBPACK_IMPORTED_MODULE_0__"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-collapsible-container.js","mappings":"oIAAAA,EAAAC,QAAA,6yBCeO,MAAAC,GAAsB,EAAAC,EAAAC,IAAgB,yBAE7C,MAAAC,WAAsC,EAAAC,EAAAC,IAAe,CACrDL,gBACAM,aAAA,UAEA,6BAAAC,GACA,qDACA,CAEA,WAAAC,GACAC,QAEAC,KAAAC,aAAA,CAAwBC,KAAA,SAAcC,UAAA,kOAMmBC,iNAYrD,EAAAb,EAAAc,IACJ,mwBAkCwBC,EAAAC,EAASC,WAAAC,oiBA0BjCT,MAGAA,KAAAU,OAAAV,KAAAW,WAAAC,cAAA,WACAZ,KAAAa,QAAAb,KAAAW,WAAAC,cAAA,eACAZ,KAAAc,KAAAd,KAAAU,OAAAE,cAAA,gBACAZ,KAAAe,WAAAf,KAAAU,OAAAE,cAAA,QACAZ,KAAAgB,cAAAhB,KAAAW,WAAAC,cAAA,eACA,CAEA,iBAAAK,GACA,eAAAjB,KAAAkB,aAAA,cACA,CAEA,iBAAAC,GACA,OAAAnB,KAAAa,QAAAO,cAAApB,KAAAa,QAAAQ,YACA,CAEA,eAAAC,GACA,eAAAtB,KAAAkB,aAAA,YACA,CAEA,MAAAK,GACAvB,KAAAwB,aAAA,YAAAxB,KAAAsB,YAAA,eACA,CAGA,gBAAAG,GACAzB,KAAAiB,eAMAjB,KAAAU,OAAAc,aAAA,iBACAxB,KAAAU,OAAAc,aAAA,gBACAxB,KAAAU,OAAAc,aAAA,gBAAAE,QAAA1B,KAAAsB,cAEAtB,KAAAkB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lE,GAAkB,EAAAsL,EAAAzH,KACvB,EAAAyC,EAAAvC,IAAgB,CAClBC,SAAA,CACAC,UAAA,IAAmBX,EAAAa,SAAA,SACnBC,cAAA,IAAuBd,EAAAa,SAAA,aACvBoH,SAAA,GACAC,UAAA,EAAoBrH,SAAA,UACpBhE,eAAA,CAAwBgE,SAAA,eACxBsH,kBAAA,CAA2BtH,SAAA,kBAC3BuH,WAAA,GACAC,UAAA,GACAC,cAAA,GACAC,WAAA,GACAC,UAAA,GACAC,WAAA,GACA3G,YAAA,GACAD,YAAA,GACAD,YAAA,OAGE,EAAAoB,EAAA0F,IAAY,CAAGC,SAAA,EAAa1K,KAAA,aAAA2K,MAAA,WAC5B5F,EAAAP,GACAO,EAAAN,GAtBuB,CAuBzB8E,qGCjFA7E,eAAAC,OAAsBiG,EAAAlF,EAAekF,EAAAlM","sources":["webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/chevron.svg","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/CollapsibleContainerClass.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.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-image/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js"],"sourcesContent":["module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik02Ljc4MDcgMTQuNzI3MkM2LjM0MTYgMTUuMTIwOSA1LjY2NjYgMTUuMDg0MSA1LjI3MjggMTQuNjQ1MUM0Ljg3OTEgMTQuMjA2IDQuOTE1OSAxMy41MzA5IDUuMzU0OSAxMy4xMzcyQzUuMzU0OSAxMy4xMzcyIDEwLjk1NDMgNy45OTc4IDExLjM2IDcuNjM0QzExLjc2NTcgNy4yNzAyIDEyLjIzOTIgNy4yNzAyIDEyLjY0NDggNy42MzRMMTguNjQ1MSAxMy4xMzcyQzE5LjA4NDEgMTMuNTMwOSAxOS4xMjA5IDE0LjIwNiAxOC43MjcyIDE0LjY0NTFDMTguMzMzNCAxNS4wODQxIDE3LjY1ODQgMTUuMTIwOSAxNy4yMTkzIDE0LjcyNzJMMTIgOS44NjMyTDYuNzgwNyAxNC43MjcyWiIvPiA8L3N2Zz4g\"","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} from '@descope-ui/common/components-helpers';\nimport chevronIcon from './chevron.svg';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('collapsible-container');\n\nclass RawCollapsibleContainer extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return ['collapsed', 'collapsible', 'text', 'aria-label'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <descope-text st-host-direction=\"ltr\">\n <div class=\"header\">\n <div class=\"title\">\n <div class=\"icon\">\n <descope-icon st-fill=\"currentcolor\" src=${chevronIcon}></descope-icon>\n </div>\n <span></span>\n </div>\n </div>\n </descope-text>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n\t`;\n\n injectStyle(\n `\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .title {\n display: contents;\n }\n :host([attach-icon=\"true\"]) .header {\n display: block;\n }\n :host([attach-icon=\"true\"]) .title {\n display: inline-flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${TextClass.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,\n this,\n );\n\n this.header = this.shadowRoot.querySelector('.header');\n this.content = this.shadowRoot.querySelector('div.content');\n this.icon = this.header.querySelector('descope-icon');\n this.headerText = this.header.querySelector('span');\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n }\n\n get isCollapsible() {\n return this.getAttribute('collapsible') === 'true';\n }\n\n calcContentHeight() {\n return this.content.offsetHeight || this.content.scrollHeight;\n }\n\n get isCollapsed() {\n return this.getAttribute('collapsed') === 'true';\n }\n\n toggle() {\n this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');\n }\n\n // header acts as a disclosure button only when the container is collapsible\n updateHeaderA11y() {\n if (!this.isCollapsible) {\n ['role', 'tabindex', 'aria-expanded', 'aria-label'].forEach((attr) =>\n this.header.removeAttribute(attr),\n );\n return;\n }\n this.header.setAttribute('role', 'button');\n this.header.setAttribute('tabindex', '0');\n this.header.setAttribute('aria-expanded', String(!this.isCollapsed));\n // without header text the button has no name, so fall back to a label\n if (this.getAttribute('text')) {\n this.header.removeAttribute('aria-label');\n } else {\n this.header.setAttribute(\n 'aria-label',\n this.getAttribute('aria-label') || 'Toggle section',\n );\n }\n }\n\n collapse(animated = false) {\n // keep collapsed content out of the tab order and the a11y tree\n this.content.inert = true;\n const final = () => {\n this.content.style.maxHeight = '0px';\n };\n this.icon.classList.add('rotate');\n if (!animated) return final();\n\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n setTimeout(final);\n }\n\n expand(animated = false) {\n this.content.inert = false;\n const final = () => {\n this.content.style.maxHeight = '';\n };\n this.icon.classList.remove('rotate');\n if (!animated) return final();\n\n this.content.addEventListener('transitionend', final, { once: true });\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n }\n\n #isComponentMounted = false;\n\n init() {\n super.init?.();\n // we want to animate the collapse/expand only after the first time the component is connected\n // so when setting a default value for the collapsed attribute, it will not animate\n this.#isComponentMounted = true;\n\n this.header.addEventListener('click', () => {\n if (!this.isCollapsible) return;\n this.toggle();\n });\n this.header.addEventListener('keydown', (e) => {\n if (!this.isCollapsible || (e.key !== 'Enter' && e.key !== ' ')) return;\n e.preventDefault();\n // the SDK submits the flow on any Enter that reaches the flow root\n e.stopPropagation();\n this.toggle();\n });\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['text-align', 'text-variant', 'text-mode'],\n mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },\n });\n }\n\n updateHeaderText() {\n const text = this.getAttribute('text') || '';\n this.headerText.innerText = text;\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'text') {\n this.updateHeaderText();\n this.updateHeaderA11y();\n return;\n }\n if (name === 'aria-label') {\n this.updateHeaderA11y();\n return;\n }\n this.updateHeaderA11y();\n const collapsed = this.isCollapsed && this.isCollapsible;\n if (collapsed) {\n this.collapse(this.#isComponentMounted);\n } else {\n this.expand(this.#isComponentMounted);\n }\n }\n}\n\nconst selectors = {\n host: () => ':host',\n icon: () => 'descope-icon',\n collapsedIcon: () => 'descope-icon.rotate',\n iconWrapper: () => '.icon',\n header: () => '.header',\n iconAndText: () => '.header, .title',\n text: () => 'span',\n wrapper: () => '.wrapper',\n content: () => 'div.content',\n};\n\nexport const CollapsibleContainerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: selectors.host, property: 'width' },\n hostDirection: { selector: selectors.host, property: 'direction' },\n verticalPadding: [\n { selector: selectors.wrapper, property: 'padding-top' },\n { selector: selectors.wrapper, property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { selector: selectors.wrapper, property: 'padding-left' },\n { selector: selectors.wrapper, property: 'padding-right' },\n ],\n\n flexDirection: {},\n justifyContent: {},\n alignItems: {},\n gap: [{}, { property: 'margin-top' }],\n\n backgroundColor: { selector: selectors.wrapper },\n backgroundImage: { selector: selectors.wrapper },\n backgroundPositionX: { selector: selectors.wrapper },\n backgroundPositionY: { selector: selectors.wrapper },\n backgroundSize: { selector: selectors.wrapper },\n backgroundRepeat: { selector: selectors.wrapper },\n\n borderRadius: { selector: selectors.wrapper },\n borderColor: { selector: selectors.wrapper },\n borderStyle: { selector: selectors.wrapper },\n borderWidth: { selector: selectors.wrapper },\n\n boxShadow: { selector: selectors.wrapper },\n\n headerIconOrder: { selector: selectors.iconWrapper, property: 'order' },\n headerCursor: { selector: selectors.header, property: 'cursor' },\n headerGap: { selector: selectors.iconAndText, property: 'gap' },\n textGrow: { selector: selectors.text, property: 'flex-grow' },\n textDirection: { selector: selectors.text, property: 'direction' },\n iconAnimationDuration: {\n selector: selectors.icon,\n property: 'transition-duration',\n },\n contentAnimationDuration: {\n selector: selectors.content,\n property: 'transition-duration',\n },\n chevronRotation: {\n selector: selectors.collapsedIcon,\n property: 'transform',\n fallback: 'rotate(180deg)',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawCollapsibleContainer);\n","import '@descope-ui/descope-text'\nimport '@descope-ui/descope-icon'\nimport { componentName, CollapsibleContainerClass } from './CollapsibleContainerClass';\n\ncustomElements.define(componentName, CollapsibleContainerClass);\n\nexport { CollapsibleContainerClass, 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 height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style', 'st-height', 'st-width'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n"," \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 \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 { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["module","exports","componentName","componentsHelpers","xE","RawCollapsibleContainer","baseClasses","qu","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","chevron_default","fz","TextClass","s","cssVarList","textLineHeight","header","shadowRoot","querySelector","content","icon","headerText","textComponent","isCollapsible","getAttribute","calcContentHeight","offsetHeight","scrollHeight","isCollapsed","toggle","setAttribute","updateHeaderA11y","String","removeAttribute","forEach","attr","collapse","animated","inert","final","style","maxHeight","classList","add","setTimeout","expand","remove","addEventListener","once","isComponentMounted","init","e","key","preventDefault","stopPropagation","EA","includeAttrs","mapAttrs","updateHeaderText","text","innerText","attributeChangedCallback","name","oldValue","newValue","selectors","host","collapsedIcon","iconWrapper","iconAndText","wrapper","CollapsibleContainerClass","utils","Zz","componentsMixins","RF","mappings","hostWidth","selector","property","hostDirection","verticalPadding","horizontalPadding","flexDirection","justifyContent","alignItems","gap","backgroundColor","backgroundImage","backgroundPositionX","backgroundPositionY","backgroundSize","backgroundRepeat","borderRadius","borderColor","borderStyle","borderWidth","boxShadow","headerIconOrder","headerCursor","headerGap","textGrow","textDirection","iconAnimationDuration","contentAnimationDuration","chevronRotation","fallback","VO","tQ","customElements","define","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_1__","IconClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_3__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","fill","_descope_ui_descope_image_class__WEBPACK_IMPORTED_MODULE_2__","q","height","width","tz","slots","wrappedEleName","excludeAttrsSync","_IconClass__WEBPACK_IMPORTED_MODULE_1__","T","S","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_3__","srcAttrs","RawImage","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_1__","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","altText","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","ele","ImageClass","_helpers__WEBPACK_IMPORTED_MODULE_4__","m","then","res","appendChild","shouldRender","src","srcVal","attrName","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","createSvgEle","clean","dompurify__WEBPACK_IMPORTED_MODULE_0__","A","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","_ImageClass__WEBPACK_IMPORTED_MODULE_0__","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","RawText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","hideWhenEmpty","Ge","hasChildren","childNodes","length","display","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","fontSize","textColor","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","DM","triggers","value","_TextClass__WEBPACK_IMPORTED_MODULE_0__"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159,9261],{76231(e,t,r){r.d(t,{T:()=>c,m:()=>p});var n=r(92540),o=r(88961),s=r(63200),i=r(36976),l=r(72270),a=r(54847),h=r(25964);const c=(0,h.xE)("enriched-text");class d extends((0,l.qu)({componentName:c,baseSelector:":host > div"})){#e;#t;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,h.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.#r(),(0,h.Ge)(this,this.#n.bind(this)),this.contentNode?.addEventListener("click",e=>{e.target instanceof HTMLAnchorElement&&e.stopPropagation()}),this.contentNode?.addEventListener("keydown",e=>{"Enter"===e.key&&e.target instanceof HTMLAnchorElement&&e.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),r!==t&&("readonly"===e&&this.onReadOnlyChange("true"===r),"link-target-blank"===e&&this.#r())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(e,t,r,n,o)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,n,o)),this.processor.renderer.rules.em_close=(e,t,r,n,o)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,n,o))}#o(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(e,t,r,n,o)=>(e[t].attrSet("target","_blank"),this.#e(e,t,r,n,o)):this.processor.renderer.rules.link_open=this.#e}#s(){this.processor&&this.processor.disable(i.M)}#i(){this.#s()}#l(){this.#e=this.processor.renderer.rules.link_open||((e,t,r,n,o)=>o.renderToken(e,t,r)),this.#t=this.processor.renderer.rules.em_open||((e,t,r,n,o)=>o.renderToken(e,t,r))}#r(){this.processor=new n.A("commonmark",{html:!0}),this.#l(),this.#i(),this.#o(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#n(){if(!this.processor)return;let e=(0,a.G)(this.innerHTML);!e?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const t=this.processor.parse(e,{references:void 0});e=this.processor.renderer.render(t,{html:!0,breaks:!0})}catch{console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=e,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(e){e?this.contentNode.setAttribute("inert",e):this.contentNode.removeAttribute("inert")}}const p=(0,s.Zz)((0,o.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,o.RF)({componentNameOverride:(0,h.xE)("link")}),(0,o.RF)({componentNameOverride:(0,h.xE)("text")}),(0,o.DM)({triggers:[{attr:"full-width",value:"true"}]}),o.VO,o.tQ)(d)},36976(e,t,r){r.d(t,{M:()=>n});const n=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(e,t,r){r.d(t,{G:()=>n});const n=e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.value}},55838(e,t,r){r.r(t),r.d(t,{EnrichedTextClass:()=>n.m,componentName:()=>n.T}),r(90512);var n=r(76231);customElements.define(n.T,n.m)},75464(e,t,r){r.d(t,{J:()=>b,T:()=>a});var n=r(88961),o=r(63200),s=r(25964),i=r(72270),l=r(66434);const a=(0,s.xE)("link"),h=["href","readonly"];class c extends((0,i.qu)({componentName:a,baseSelector:":host a"})){static get observedAttributes(){return h.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\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\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,s.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",e=>{this.readOnly&&e.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const d={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:p,text:u,host:m,wrapper:g,link:k}=d,b=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:g,textDecoration:{...k,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:l.s.cssVarList.textColor}],cursor:p}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(c)},90512(e,t,r){r.r(t),r.d(t,{LinkClass:()=>n.J,componentName:()=>n.T});var n=r(75464);r(63595),customElements.define(n.T,n.J)},66434(e,t,r){r.d(t,{T:()=>l,s:()=>c});var n=r(88961),o=r(63200),s=r(25964),i=r(72270);const l=(0,s.xE)("text");class a 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 e=!!this.childNodes.length;this.style.display=!e&&this.hideWhenEmpty?"none":""})}}const{host:h}={host:{selector:()=>":host"}},c=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...h,property:"width"},hostDirection:{...h,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(a)},63595(e,t,r){r.r(t),r.d(t,{TextClass:()=>n.s,componentName:()=>n.T});var n=r(66434);customElements.define(n.T,n.s)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159,9261],{76231(e,t,r){r.d(t,{T:()=>d,m:()=>m});var n=r(92540),o=r(25414),s=r(88961),i=r(63200),a=r(36976),l=r(72270),h=r(54847),c=r(25964);const d=(0,c.xE)("enriched-text"),p={ADD_ATTR:["target"],ALLOWED_URI_REGEXP:/^(?!(?:vbscript|javascript|file|data):)|^data:image\/(?:gif|png|jpeg|webp);/i,FORBID_TAGS:["form","input","button","textarea","select","style"]};class u extends((0,l.qu)({componentName:d,baseSelector:":host > div"})){#e;#t;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,c.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.#r(),(0,c.Ge)(this,this.#n.bind(this)),this.contentNode?.addEventListener("click",e=>{e.target instanceof HTMLAnchorElement&&e.stopPropagation()}),this.contentNode?.addEventListener("keydown",e=>{"Enter"===e.key&&e.target instanceof HTMLAnchorElement&&e.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),r!==t&&("readonly"===e&&this.onReadOnlyChange("true"===r),"link-target-blank"===e&&this.#r())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(e,t,r,n,o)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,n,o)),this.processor.renderer.rules.em_close=(e,t,r,n,o)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,n,o))}#o(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(e,t,r,n,o)=>(e[t].attrSet("target","_blank"),this.#e(e,t,r,n,o)):this.processor.renderer.rules.link_open=this.#e}#s(){this.processor&&this.processor.disable(a.M)}#i(){this.#s()}#a(){this.#e=this.processor.renderer.rules.link_open||((e,t,r,n,o)=>o.renderToken(e,t,r)),this.#t=this.processor.renderer.rules.em_open||((e,t,r,n,o)=>o.renderToken(e,t,r))}#r(){this.processor=new n.A("commonmark",{html:!0}),this.#a(),this.#i(),this.#o(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#n(){if(!this.processor)return;let e=(0,h.G)(this.innerHTML);!e?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const t=this.processor.parse(e,{references:void 0});e=this.processor.renderer.render(t,{html:!0,breaks:!0})}catch{console.warn("Not parsing invalid markdown token")}e=o.A.sanitize(e,p),this.contentNode.innerHTML=e,this.contentNode.firstElementChild?.setAttribute("part","content")}onReadOnlyChange(e){e?this.contentNode.setAttribute("inert",e):this.contentNode.removeAttribute("inert")}}const m=(0,i.Zz)((0,s.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,s.RF)({componentNameOverride:(0,c.xE)("link")}),(0,s.RF)({componentNameOverride:(0,c.xE)("text")}),(0,s.DM)({triggers:[{attr:"full-width",value:"true"}]}),s.VO,s.tQ)(u)},36976(e,t,r){r.d(t,{M:()=>n});const n=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(e,t,r){r.d(t,{G:()=>n});const n=e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.value}},55838(e,t,r){r.r(t),r.d(t,{EnrichedTextClass:()=>n.m,componentName:()=>n.T}),r(90512);var n=r(76231);customElements.define(n.T,n.m)},75464(e,t,r){r.d(t,{J:()=>b,T:()=>l});var n=r(88961),o=r(63200),s=r(25964),i=r(72270),a=r(66434);const l=(0,s.xE)("link"),h=["href","readonly"];class c extends((0,i.qu)({componentName:l,baseSelector:":host a"})){static get observedAttributes(){return h.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\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\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,s.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",e=>{this.readOnly&&e.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const d={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>a.s.componentName}},{anchor:p,text:u,host:m,wrapper:g,link:k}=d,b=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:g,textDecoration:{...k,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:a.s.cssVarList.textColor}],cursor:p}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(c)},90512(e,t,r){r.r(t),r.d(t,{LinkClass:()=>n.J,componentName:()=>n.T});var n=r(75464);r(63595),customElements.define(n.T,n.J)},66434(e,t,r){r.d(t,{T:()=>a,s:()=>c});var n=r(88961),o=r(63200),s=r(25964),i=r(72270);const a=(0,s.xE)("text");class l extends((0,i.qu)({componentName:a,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 e=!!this.childNodes.length;this.style.display=!e&&this.hideWhenEmpty?"none":""})}}const{host:h}={host:{selector:()=>":host"}},c=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...h,property:"width"},hostDirection:{...h,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(l)},63595(e,t,r){r.r(t),r.d(t,{TextClass:()=>n.s,componentName:()=>n.T});var n=r(66434);customElements.define(n.T,n.s)}}]);
2
2
  //# sourceMappingURL=descope-enriched-text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-enriched-text.js","mappings":"0PAiBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,iBAE7C,MAAAC,WAA2B,EAAAC,EAAAC,IAAe,CAC1CL,gBACAM,aAAA,iBAEAC,GAEAC,GAEA,WAAAC,GACAC,QAEAC,KAAAC,aAAA,CAAwBC,KAAA,SAAcC,UAAA,2CAIlC,EAAAb,EAAAc,IACJ,6iBAkCAJ,MAGAA,MAAAK,KAEI,EAAAf,EAAAgB,IAAeN,KAAAA,MAAAO,EAAAC,KAAAR,OAGnBA,KAAAS,aAAAC,iBAAA,QAAAC,IACAA,EAAAC,kBAAAC,mBACAF,EAAAG,oBAKAd,KAAAS,aAAAC,iBAAA,UAAAC,IACA,UAAAA,EAAAI,KAAAJ,EAAAC,kBAAAC,mBACAF,EAAAG,mBAGA,CAEA,6BAAAE,GACA,sCACA,CAEA,wBAAAC,CAAAC,EAAAC,EAAAC,GACArB,MAAAkB,2BAAAC,EAAAC,EAAAC,GAEAA,IAAAD,IACA,aAAAD,GACAlB,KAAAqB,iBAAA,SAAAD,GAGA,sBAAAF,GACAlB,MAAAK,IAGA,CAGA,u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E,kBAAA,CAA2BrE,SAAA,kBAC3BsE,WAAA,GACA5D,UAAA,GACA6D,cAAA,GACAlE,WAAA,GACAmE,UAAA,GACAlE,WAAA,GACAmE,YAAA,GACAC,YAAA,GACAC,YAAA,OAGE,EAAArB,EAAArC,IAAY,CAAGC,SAAA,EAAaC,KAAA,aAAAC,MAAA,WAC5BkC,EAAAjC,GACAiC,EAAAhC,GAtBuB,CAuBzBsC,wFCjFAhC,eAAAC,OAAsB+C,EAAA7C,EAAe6C,EAAAzB","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.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-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js"],"sourcesContent":["import MarkdownIt from 'markdown-it';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} 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 {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({\n componentName,\n baseSelector: ':host > div',\n}) {\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 // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n\n // The SDK submits the form (and prevents link activation) on any Enter that reaches the flow root\n this.contentNode?.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 =\n this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer =\n 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, {\n html: true,\n breaks: true,\n });\n } catch {\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\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: {\n selector: () => ':host',\n property: 'display',\n fallback: 'inline-block',\n },\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: {\n selector: 'a:hover',\n property: 'text-decoration',\n },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(EnrichedText);\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 {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\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 :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\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 this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\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: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\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","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_6__","xE","EnrichedText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_4__","qu","baseSelector","origLinkRenderer","origEmRenderer","constructor","super","this","attachShadow","mode","innerHTML","fz","initProcessor","Ge","parseChildren","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","key","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","customizeLinkRenderer","linkTargetBlank","link_open","attrSet","disableCustomRules","disable","_consts__WEBPACK_IMPORTED_MODULE_3__","M","updateProcessorRules","storeOrigRenderers","_","renderToken","markdown_it__WEBPACK_IMPORTED_MODULE_0__","A","html","getAttribute","shadowRoot","querySelector","_helpers__WEBPACK_IMPORTED_MODULE_5__","G","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","DM","triggers","attr","value","VO","tQ","disableRules","decodeHTML","textArea","document","createElement","customElements","define","_EnrichedTextClass__WEBPACK_IMPORTED_MODULE_1__","T","m","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","observedAttrs","RawLink","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","concat","anchor","EA","includeAttrs","mapAttrs","tooltip","readOnly","preventDefault","selectors","host","link","wrapper","text","_descope_ui_descope_text_class__WEBPACK_IMPORTED_MODULE_4__","s","LinkClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","textDecoration","cssVarList","cursor","_LinkClass__WEBPACK_IMPORTED_MODULE_0__","J","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","_TextClass__WEBPACK_IMPORTED_MODULE_0__"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-enri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AhC,GApBuB,CAqBzBa,iGCnHAP,eAAAC,OAAsB6B,EAAA3B,EAAe2B,EAAAC,0FCW9B,MAAAxJ,GAAsB,EAAA8H,EAAA5H,IAAgB,QAE7C,MAAAuJ,WAAsB,EAAAxB,EAAAxH,IAAe,CACrCT,gBACAU,aAAA,kBAEA,WAAAG,GACAC,QAEAC,KAAAC,aAAA,CAAwBC,KAAA,SAAcC,UAAA,iDAIlC,EAAA4G,EAAA3G,IACJ,iLAUAJ,KAEA,CAEA,iBAAA2I,GACA,eAAA3I,KAAAkD,aAAA,kBACA,CAEA,IAAA0F,GACA7I,MAAA6I,QAEI,EAAA7B,EAAAzG,IAAeN,KAAA,KACnB,MAAA6I,IAAA7I,KAAA8I,WAAAC,OACA/I,KAAAgJ,MAAAC,SAAAJ,GAAA7I,KAAA2I,cAAA,WAEA,EAGA,MAAAf,KAAQA,GAAO,CACfA,KAAA,CAAU/C,SAAA,cAGHqE,GAAkB,EAAAf,EAAA3D,KACvB,EAAA4D,EAAA1D,IAAgB,CAClBC,SAAA,CACAC,UAAA,IAAmBgD,EAAA9C,SAAA,SACnBG,cAAA,IAAuB2C,EAAA9C,SAAA,aACvBI,SAAA,GACAI,UAAA,EAAoBR,SAAA,UACpBS,eAAA,CAAwBT,SAAA,eACxBqE,kBAAA,CAA2BrE,SAAA,kBAC3BsE,WAAA,GACA5D,UAAA,GACA6D,cAAA,GACAlE,WAAA,GACAmE,UAAA,GACAlE,WAAA,GACAmE,YAAA,GACAC,YAAA,GACAC,YAAA,OAGE,EAAArB,EAAArC,IAAY,CAAGC,SAAA,EAAaC,KAAA,aAAAC,MAAA,WAC5BkC,EAAAjC,GACAiC,EAAAhC,GAtBuB,CAuBzBsC,wFCjFAhC,eAAAC,OAAsB+C,EAAA7C,EAAe6C,EAAAzB","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.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-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js"],"sourcesContent":["import MarkdownIt from 'markdown-it';\nimport DOMPurify from 'dompurify';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} 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 {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nconst sanitizeConfig = {\n ADD_ATTR: ['target'],\n // Same scheme rule as markdown-it's link check, so custom-scheme links\n // (myapp://, slack://) keep working; DOMPurify's default list strips them.\n // `i` because markdown-it lowercases the URL before testing and DOMPurify does not.\n ALLOWED_URI_REGEXP:\n /^(?!(?:vbscript|javascript|file|data):)|^data:image\\/(?:gif|png|jpeg|webp);/i,\n FORBID_TAGS: ['form', 'input', 'button', 'textarea', 'select', 'style'],\n};\n\nclass EnrichedText extends createBaseClass({\n componentName,\n baseSelector: ':host > div',\n}) {\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 // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n\n // The SDK submits the form (and prevents link activation) on any Enter that reaches the flow root\n this.contentNode?.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 =\n this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer =\n 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, {\n html: true,\n breaks: true,\n });\n } catch {\n console.warn('Not parsing invalid markdown token');\n }\n\n html = DOMPurify.sanitize(html, sanitizeConfig);\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstElementChild?.setAttribute('part', 'content');\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: {\n selector: () => ':host',\n property: 'display',\n fallback: 'inline-block',\n },\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: {\n selector: 'a:hover',\n property: 'text-decoration',\n },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(EnrichedText);\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 {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\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 :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\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 this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\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: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\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","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_7__","xE","sanitizeConfig","ADD_ATTR","ALLOWED_URI_REGEXP","FORBID_TAGS","EnrichedText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_5__","qu","baseSelector","origLinkRenderer","origEmRenderer","constructor","super","this","attachShadow","mode","innerHTML","fz","initProcessor","Ge","parseChildren","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","key","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","customizeLinkRenderer","linkTargetBlank","link_open","attrSet","disableCustomRules","disable","_consts__WEBPACK_IMPORTED_MODULE_4__","M","updateProcessorRules","storeOrigRenderers","_","renderToken","markdown_it__WEBPACK_IMPORTED_MODULE_0__","A","html","getAttribute","shadowRoot","querySelector","_helpers__WEBPACK_IMPORTED_MODULE_6__","G","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","dompurify__WEBPACK_IMPORTED_MODULE_1__","sanitize","firstElementChild","isReadOnly","EnrichedTextClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_3__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_2__","RF","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","DM","triggers","attr","value","VO","tQ","disableRules","decodeHTML","textArea","document","createElement","customElements","define","_EnrichedTextClass__WEBPACK_IMPORTED_MODULE_1__","T","m","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","observedAttrs","RawLink","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","concat","anchor","EA","includeAttrs","mapAttrs","tooltip","readOnly","preventDefault","selectors","host","link","wrapper","text","_descope_ui_descope_text_class__WEBPACK_IMPORTED_MODULE_4__","s","LinkClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","textDecoration","cssVarList","cursor","_LinkClass__WEBPACK_IMPORTED_MODULE_0__","J","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","_TextClass__WEBPACK_IMPORTED_MODULE_0__"],"sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see descope-hybrid-field-index-js.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7299],{67383(e,t,i){i.d(t,{T:()=>p,v:()=>E});var r=i(88961),n=i(63200),o=i(92985),a=i(49840),s=i(25964),l=i(79673);const p=(0,s.xE)("email-field"),u="email",{host:d,label:c,placeholder:h,requiredIndicator:m,inputField:g,input:y,inputMask:f,helperText:b,errorMessage:x,disabledPlaceholder:v,inputDisabled:I,inputIcon:F,externalInput:C,externalInputDisabled:w,externalPlaceholder:A,externalDisabledPlaceholder:V}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},E=(0,n.Zz)((0,r.RF)({mappings:{fontSize:[{},d],fontFamily:[c,g,b,x],labelFontSize:{...c,property:"font-size"},labelFontWeight:{...c,property:"font-weight"},inputValueFontWeight:[{...y,property:"font-weight"},{...C,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...A,property:"font-weight"}],helperTextFontWeight:{...b,property:"font-weight"},errorMessageFontWeight:{...x,property:"font-weight"},labelTextColor:[{...c,property:"color"},{...m,property:"color"},{...c,property:"-webkit-text-fill-color"},{...m,property:"-webkit-text-fill-color"}],hostWidth:{...d,property:"width"},hostMinWidth:{...d,property:"min-width"},hostDirection:{...d,property:"direction"},inputDirection:{...y,property:"direction"},inputBackgroundColor:[{...g,property:"background-color"},{...f,property:"background-color"}],errorMessageTextColor:{...x,property:"color"},errorMessageIcon:{...x,property:"background-image"},errorMessageIconSize:{...x,property:"background-size"},errorMessageIconPadding:{...x,property:"padding-inline-start"},errorMessageIconRepeat:{...x,property:"background-repeat"},errorMessageIconPosition:{...x,property:"background-position"},errorMessageFontSize:{...x,property:"font-size"},helperTextColor:{...b,property:"-webkit-text-fill-color"},inputValueTextColor:[{...g,property:"color"},{...I,property:"-webkit-text-fill-color"},{...w,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...y,property:"caret-color"},{...C,property:"caret-color"}],labelRequiredIndicator:{...m,property:"content"},inputBorderColor:{...g,property:"border-color"},inputBorderWidth:{...g,property:"border-width"},inputBorderStyle:{...g,property:"border-style"},inputBorderRadius:{...g,property:"border-radius"},inputHeight:{...g,property:"height"},inputHorizontalPadding:[{...y,property:"padding-left"},{...y,property:"padding-right"},{...C,property:"padding-left"},{...C,property:"padding-right"}],inputOutlineColor:{...g,property:"outline-color"},inputOutlineStyle:{...g,property:"outline-style"},inputOutlineWidth:{...g,property:"outline-width"},inputOutlineOffset:{...g,property:"outline-offset"},textAlign:{},inputTextAlign:[{...y,property:"text-align"},{...C,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...A,property:"color"},{...h,property:"color"},{...v,property:"-webkit-text-fill-color"},{...V,property:"-webkit-text-fill-color"}],labelPosition:{...c,property:"position"},labelTopPosition:{...c,property:"top"},labelHorizontalPosition:[{...c,property:"left"},{...c,property:"right"}],inputTransformY:{...c,property:"transform"},inputTransition:{...c,property:"transition"},marginInlineStart:{...c,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...A,property:"opacity"}],inputVerticalAlignment:[{...g,property:"align-items"},{...C,property:"align-items"}],valueInputHeight:[{...y,property:"height"},{...C,property:"height"}],valueInputMarginBottom:[{...y,property:"margin-bottom"},{...C,property:"margin-bottom"}],inputIconOffset:[{...F,property:"margin-right"},{...F,property:"margin-left"}],inputIconSize:{...F,property:"font-size"},inputIconColor:{...F,property:"color"},inputTextSecurity:[{...y,property:"-webkit-text-security"},{...y,property:"text-security"},{...C,property:"-webkit-text-security"},{...C,property:"text-security"}]}}),r.VO,(0,r.RV)({inputType:"email",inputName:"email",autocompleteType:"username",includeAttrs:["disabled","readonly","pattern"]}),(0,r.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),r.tQ,e=>class extends e{get acceptsUnicode(){return"false"!==this.getAttribute("accept-unicode")}get validatesFormat(){return"false"!==this.getAttribute("validate-format")}init(){super.init?.(),this.baseElement.setAttribute("pattern",o.a),this.getAttribute("autocomplete")||this.setAttribute("autocomplete","username"),this.createExternalInput(),[this.inputElement,this.externalInput].filter(Boolean).forEach(e=>{e.addEventListener("change",this.stripSurroundingWhitespace)}),this.acceptsUnicode&&this.enableUnicode(),this.validatesFormat||this.disableFormatValidation(),this.emailVerification&&this.enableEmailVerification()}get emailVerification(){return"true"===this.getAttribute("email-verification")}enableEmailVerification(){const{baseElement:e}=this,t=e._delegateAttribute.bind(e);e._delegateAttribute=(e,i)=>t(e,"autocomplete"===e?(0,a.y)(i):i),e._delegateAttribute("autocomplete",e.autocomplete),this.externalInput?.setAttribute("autocomplete",(0,a.y)(this.getAttribute("autocomplete")))}enableUnicode(){this.baseElement.setAttribute("pattern",o.g),this.useTextType()}disableFormatValidation(){this.baseElement.removeAttribute("pattern"),this.useTextType()}useTextType(){this.baseElement._setType("text"),this.externalInput&&(this.externalInput.type="text"),this.getAttribute("inputmode")||this.setAttribute("inputmode",u),this.externalInput?.setAttribute("inputmode",u)}stripSurroundingWhitespace=e=>{const t=e.target.value.trim();t!==e.target.value&&(this.value=t,this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))}})((0,r.tz)({slots:["","suffix"],wrappedEleName:"vaadin-email-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${E.cssVarList.inputOutlineWidth}) + var(${E.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,l.$J)("vaadin-email-field")}\n\t\t\t${(0,l.cy)(E.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-email-field",E.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-email-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-email-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n :host ::slotted(*) {\n -webkit-mask-image: none;\n }\n\n vaadin-email-field[external-input="true"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:p}))},92985(e,t,i){i.d(t,{a:()=>r,g:()=>n});const r="^[\\w\\.\\%\\+\\-']+@(?:[A-Za-z0-9](?:[A-Za-z0-9\\-]*[A-Za-z0-9])?\\.)+[A-Za-z]{2,}$",n="^[\\p{L}\\p{M}\\p{N}._%+'\\-]+@(?:[\\p{L}\\p{M}\\p{N}](?:[\\p{L}\\p{M}\\p{N}\\-]*[\\p{L}\\p{M}\\p{N}])?\\.)+[\\p{L}\\p{M}][\\p{L}\\p{M}\\p{N}\\-]+$"},49840(e,t,i){i.d(t,{y:()=>r});const r=e=>{const t=(e||"").split(/\s+/).filter(e=>e&&!["username","email","on","off"].includes(e)),i=t.indexOf("webauthn");return t.splice(-1===i?t.length:i,0,"email"),t.join(" ")}},30133(e,t,i){i.r(t),i.d(t,{EmailFieldClass:()=>u.v,componentName:()=>u.T}),i(52733);var r=i(47642),n=i(87550);const o=n.AH`
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7299,9894],{67383(t,e,r){r.d(e,{T:()=>s,v:()=>E});var n=r(88961),i=r(63200),o=r(92985),a=r(49840),p=r(25964),l=r(79673);const s=(0,p.xE)("email-field"),d="email",{host:u,label:c,placeholder:h,requiredIndicator:y,inputField:m,input:g,inputMask:f,helperText:b,errorMessage:x,disabledPlaceholder:v,inputDisabled:I,inputIcon:w,externalInput:C,externalInputDisabled:F,externalPlaceholder:A,externalDisabledPlaceholder:V}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},E=(0,i.Zz)((0,n.RF)({mappings:{fontSize:[{},u],fontFamily:[c,m,b,x],labelFontSize:{...c,property:"font-size"},labelFontWeight:{...c,property:"font-weight"},inputValueFontWeight:[{...g,property:"font-weight"},{...C,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...A,property:"font-weight"}],helperTextFontWeight:{...b,property:"font-weight"},errorMessageFontWeight:{...x,property:"font-weight"},labelTextColor:[{...c,property:"color"},{...y,property:"color"},{...c,property:"-webkit-text-fill-color"},{...y,property:"-webkit-text-fill-color"}],hostWidth:{...u,property:"width"},hostMinWidth:{...u,property:"min-width"},hostDirection:{...u,property:"direction"},inputDirection:{...g,property:"direction"},inputBackgroundColor:[{...m,property:"background-color"},{...f,property:"background-color"}],errorMessageTextColor:{...x,property:"color"},errorMessageIcon:{...x,property:"background-image"},errorMessageIconSize:{...x,property:"background-size"},errorMessageIconPadding:{...x,property:"padding-inline-start"},errorMessageIconRepeat:{...x,property:"background-repeat"},errorMessageIconPosition:{...x,property:"background-position"},errorMessageFontSize:{...x,property:"font-size"},helperTextColor:{...b,property:"-webkit-text-fill-color"},inputValueTextColor:[{...m,property:"color"},{...I,property:"-webkit-text-fill-color"},{...F,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...g,property:"caret-color"},{...C,property:"caret-color"}],labelRequiredIndicator:{...y,property:"content"},inputBorderColor:{...m,property:"border-color"},inputBorderWidth:{...m,property:"border-width"},inputBorderStyle:{...m,property:"border-style"},inputBorderRadius:{...m,property:"border-radius"},inputHeight:{...m,property:"height"},inputHorizontalPadding:[{...g,property:"padding-left"},{...g,property:"padding-right"},{...C,property:"padding-left"},{...C,property:"padding-right"}],inputOutlineColor:{...m,property:"outline-color"},inputOutlineStyle:{...m,property:"outline-style"},inputOutlineWidth:{...m,property:"outline-width"},inputOutlineOffset:{...m,property:"outline-offset"},textAlign:{},inputTextAlign:[{...g,property:"text-align"},{...C,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...A,property:"color"},{...h,property:"color"},{...v,property:"-webkit-text-fill-color"},{...V,property:"-webkit-text-fill-color"}],labelPosition:{...c,property:"position"},labelTopPosition:{...c,property:"top"},labelHorizontalPosition:[{...c,property:"left"},{...c,property:"right"}],inputTransformY:{...c,property:"transform"},inputTransition:{...c,property:"transition"},marginInlineStart:{...c,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...A,property:"opacity"}],inputVerticalAlignment:[{...m,property:"align-items"},{...C,property:"align-items"}],valueInputHeight:[{...g,property:"height"},{...C,property:"height"}],valueInputMarginBottom:[{...g,property:"margin-bottom"},{...C,property:"margin-bottom"}],inputIconOffset:[{...w,property:"margin-right"},{...w,property:"margin-left"}],inputIconSize:{...w,property:"font-size"},inputIconColor:{...w,property:"color"},inputTextSecurity:[{...g,property:"-webkit-text-security"},{...g,property:"text-security"},{...C,property:"-webkit-text-security"},{...C,property:"text-security"}]}}),n.VO,(0,n.RV)({inputType:"email",inputName:"email",autocompleteType:"username",includeAttrs:["disabled","readonly","pattern"]}),(0,n.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),n.tQ,t=>class extends t{get acceptsUnicode(){return"false"!==this.getAttribute("accept-unicode")}get validatesFormat(){return"false"!==this.getAttribute("validate-format")}init(){super.init?.(),this.baseElement.setAttribute("pattern",o.a),this.getAttribute("autocomplete")||this.setAttribute("autocomplete","username"),this.createExternalInput(),[this.inputElement,this.externalInput].filter(Boolean).forEach(t=>{t.addEventListener("change",this.stripSurroundingWhitespace)}),this.acceptsUnicode&&this.enableUnicode(),this.validatesFormat||this.disableFormatValidation(),this.emailVerification&&this.enableEmailVerification()}get emailVerification(){return"true"===this.getAttribute("email-verification")}enableEmailVerification(){const{baseElement:t}=this,e=t._delegateAttribute.bind(t);t._delegateAttribute=(t,r)=>e(t,"autocomplete"===t?(0,a.y)(r):r),t._delegateAttribute("autocomplete",t.autocomplete),this.externalInput?.setAttribute("autocomplete",(0,a.y)(this.getAttribute("autocomplete")))}enableUnicode(){this.baseElement.setAttribute("pattern",o.g),this.useTextType()}disableFormatValidation(){this.baseElement.removeAttribute("pattern"),this.useTextType()}useTextType(){this.baseElement._setType("text"),this.externalInput&&(this.externalInput.type="text"),this.getAttribute("inputmode")||this.setAttribute("inputmode",d),this.externalInput?.setAttribute("inputmode",d)}stripSurroundingWhitespace=t=>{const e=t.target.value.trim();e!==t.target.value&&(this.value=e,this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))}})((0,n.tz)({slots:["","suffix"],wrappedEleName:"vaadin-email-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${E.cssVarList.inputOutlineWidth}) + var(${E.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,l.$J)("vaadin-email-field")}\n\t\t\t${(0,l.cy)(E.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-email-field",E.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-email-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-email-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n :host ::slotted(*) {\n -webkit-mask-image: none;\n }\n\n vaadin-email-field[external-input="true"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:s}))},92985(t,e,r){r.d(e,{a:()=>n,g:()=>i});const n="^[\\w\\.\\%\\+\\-']+@(?:[A-Za-z0-9](?:[A-Za-z0-9\\-]*[A-Za-z0-9])?\\.)+[A-Za-z]{2,}$",i="^[\\p{L}\\p{M}\\p{N}._%+'\\-]+@(?:[\\p{L}\\p{M}\\p{N}](?:[\\p{L}\\p{M}\\p{N}\\-]*[\\p{L}\\p{M}\\p{N}])?\\.)+[\\p{L}\\p{M}][\\p{L}\\p{M}\\p{N}\\-]+$"},49840(t,e,r){r.d(e,{y:()=>n});const n=t=>{const e=(t||"").split(/\s+/).filter(t=>t&&!["username","email","on","off"].includes(t)),r=e.indexOf("webauthn");return e.splice(-1===r?e.length:r,0,"email"),e.join(" ")}},30133(t,e,r){r.r(e),r.d(e,{EmailFieldClass:()=>d.v,componentName:()=>d.T}),r(52733);var n=r(47642),i=r(87550);const o=i.AH`
3
3
  :host([dir='rtl']) [part='input-field'] ::slotted(input) {
4
4
  --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
5
5
  }
@@ -7,7 +7,7 @@
7
7
  :host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
8
8
  --_lumo-text-field-overflow-mask-image: none;
9
9
  }
10
- `;(0,n.SF)("vaadin-email-field",[r.k,o],{moduleId:"lumo-email-field"});var a=i(82901),s=i(27136);const l=i(51450).AH`
10
+ `;(0,i.SF)("vaadin-email-field",[n.k,o],{moduleId:"lumo-email-field"});var a=r(82901),p=r(27136);const l=r(51450).AH`
11
11
  :host([dir='rtl']) [part='input-field'] {
12
12
  direction: ltr;
13
13
  }
@@ -16,5 +16,5 @@
16
16
  direction: rtl;
17
17
  text-align: left;
18
18
  }
19
- `;(0,n.SF)("vaadin-email-field",l,{moduleId:"vaadin-email-field-styles"});class p extends s.A{static get is(){return"vaadin-email-field"}constructor(){super(),this._setType("email"),this.pattern="^([a-zA-Z0-9_\\.\\-+])+@[a-zA-Z0-9\\-.]+\\.[a-zA-Z0-9\\-]{2,}$"}ready(){super.ready(),this.inputElement&&(this.inputElement.autocapitalize="off")}}(0,a.X)(p);var u=i(67383);customElements.define(u.T,u.v)},44966(e,t,i){i.r(t),i.d(t,{HybridFieldClass:()=>y,componentName:()=>d}),i(30133),i(98136),i(30057);var r=i(25964),n=i(79365),o=i(81365),a=i(9696),s=i(97810);const l=/[^\d\s+\-()]/;var p=i(81808),u=i(16306);const d=(0,s.xE)("hybrid-field"),c={shared:["label","bordered","full-width","label-type","size","disabled","readonly","required","st-host-direction","st-error-message-icon","st-error-message-icon-size","st-error-message-icon-padding"],email:["placeholder","data-errormessage-value-missing-email","data-errormessage-pattern-mismatch-email","external-input"],phone:{countryCode:["phone-input-label","country-input-label","country-input-placeholder","restrict-countries","default-code","phone-minlength","phone-format-value","phone-strict-validation","phone-input-type","data-errormessage-value-missing-phone"],inputBox:["restrict-countries","default-code","phone-minlength","phone-format-value","phone-strict-validation","phone-input-type","data-errormessage-value-missing-phone"]}},h={email:{"data-errormessage-value-missing-email":"data-errormessage-value-missing","data-errormessage-pattern-mismatch-email":"data-errormessage-pattern-mismatch"},phone:{"phone-input-label":"label","phone-minlength":"minlength","phone-format-value":"format-value","phone-strict-validation":"strict-validation","data-errormessage-value-missing-phone":"data-errormessage-value-missing"}},m="descope-phone-field",g=(0,o.q)({componentName:d,baseSelector:"div"}),y=(0,a.Zz)((0,n.RF)({componentNameOverride:(0,s.xE)("input-wrapper")}),(0,n.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:[{selector:()=>"descope-email-field",property:"direction"},{selector:()=>"descope-phone-field",property:"direction"},{selector:()=>"descope-phone-input-box-field",property:"direction"}],errorMessageIcon:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.errorMessageIcon},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.errorMessageIcon}],errorMessageIconSize:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.errorMessageIconSize},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.errorMessageIconSize}],errorMessageIconPadding:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.errorMessageIconPadding},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.errorMessageIconPadding}],errorMessageIconRepeat:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.errorMessageIconRepeat},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.errorMessageIconRepeat}],errorMessageIconPosition:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.errorMessageIconPosition},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.errorMessageIconPosition}],errorMessageFontSize:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.errorMessageFontSize},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.errorMessageFontSize}],labelFontWeight:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.labelFontWeight},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.labelFontWeight}],inputValueFontWeight:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.inputValueFontWeight},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.inputValueFontWeight}],inputPlaceholderFontWeight:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.inputPlaceholderFontWeight},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.inputPlaceholderFontWeight}],helperTextFontWeight:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.helperTextFontWeight},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.helperTextFontWeight}],errorMessageFontWeight:[{selector:()=>p.NF.componentName,property:p.NF.cssVarList.errorMessageFontWeight},{selector:()=>u.Ul.componentName,property:u.Ul.cssVarList.errorMessageFontWeight}]}}),n.VO,n.tQ)(class extends g{#e=!1;#t;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div class="wrapper">\n <descope-email-field external-input="${this.isExternalInput}"></descope-email-field>\n <descope-phone-field allow-alphanumeric-input="true" phone-input-type="text"></descope-phone-field>\n <descope-phone-input-box-field allow-alphanumeric-input="true" phone-input-type="text"></descope-phone-input-box-field>\n </div>\n\t\t`,(0,r.fz)("\n :host {\n display: inline-flex;\n box-sizing: border-box;\n padding: 0;\n gap: 0;\n }\n .wrapper {\n display: grid;\n width: 100%;\n }\n descope-email-field,\n descope-phone-field,\n descope-phone-input-box-field {\n grid-area: 1/1;\n width: 100%;\n height: 100%;\n }\n .hidden {\n visibility: hidden;\n }\n ",this)}get isExternalInput(){return"true"===this.getAttribute("external-input")}get emailInputEle(){return this.isExternalInput?this.emailInput.externalInput:this.emailInput.inputElement}get phoneVariant(){return"inputBox"===this.getAttribute("phone-variant")?this.phoneInputBoxInput:this.phoneCountryCodeInput}get defaultCode(){const e=this.phoneCountryCodeInput.countryCodes?.[0]||"";return this.getAttribute("default-code")||e}get activeInputEle(){return this.activeInput===this.emailInput?this.emailInputEle:this.phoneVariant.phoneNumberInputEle}get value(){return this.activeInput?.value||""}set value(e){this.handleActiveInput(e),setTimeout(()=>{this.activeInput.value=e})}async init(){super.init?.(),this.initInputs(),this.updateAttrs(),this.toggleInputVisibility(),await this.waitForInputs(),this.initInputEles(),this.overrideEmailInputType(),this.overrideEmailSetAttribute()}waitForInputs(){return new Promise(e=>{const t=setInterval(()=>{this.emailInputEle&&(clearInterval(t),e())})})}initInputs(){this.emailInput=this.shadowRoot.querySelector("descope-email-field"),this.phoneCountryCodeInput=this.shadowRoot.querySelector(m),this.phoneInputBoxInput=this.shadowRoot.querySelector("descope-phone-input-box-field"),this.inputs=[this.emailInput,this.phoneCountryCodeInput,this.phoneInputBoxInput],this.activeInput=this.emailInput}initInputEles(){[this.emailInputEle,this.phoneCountryCodeInput.phoneNumberInputEle,this.phoneInputBoxInput.phoneNumberInputEle].forEach(e=>{e.addEventListener("input",this.onValueChange.bind(this))})}overrideEmailInputType(){this.emailInputEle.addEventListener("focus",()=>{this.emailInputEle.setAttribute("type","text")}),this.emailInputEle.addEventListener("blur",()=>{setTimeout(()=>{this.emailInputEle.setAttribute("type","email")})})}overrideEmailSetAttribute(){const e=this.emailInput.setAttribute.bind(this.emailInputEle);this.emailInputEle.setAttribute=(t,i)=>("type"!==t||"email"!==i||!this.emailInput.hasAttribute("focused"))&&e(t,i)}updateAttrs(){(0,s.EA)(this,this.emailInput,{includeAttrs:c.email,mapAttrs:h.email}),(0,s.EA)(this,this.phoneCountryCodeInput,{includeAttrs:c.phone.countryCode,mapAttrs:h.phone}),(0,s.EA)(this,this.phoneInputBoxInput,{includeAttrs:c.phone.inputBox,mapAttrs:h.phone}),this.inputs.forEach(e=>(0,s.EA)(this,e,{includeAttrs:c.shared})),setTimeout(()=>this.phoneCountryCodeInput.setAttribute("default-code",this.defaultCode))}onValueChange(){this.#t=this.activeInputEle.selectionStart,this.handleActiveInput(this.activeInputEle.value||this.activeInput.value)}handleActiveInput(e){const t=(e=>!!e&&!l.test(e))(e)?this.phoneVariant:this.emailInput;this.activeInput!==t&&this.setActiveInput(t)}setActiveInput(e){const t=this.activeInputEle.value||this.activeInput.value;this.activeInput=e,this.setActiveInputValue(t),this.#e&&this.activeInput.reportValidity(),this.setActiveInputSelectionStart(),this.toggleInputVisibility()}setActiveInputSelectionStart(){setTimeout(()=>{const e=this.activeInputEle;e.focus();try{e.setSelectionRange?.(this.#t,this.#t)}catch{}})}#i(){const e=this.getAttribute("default-code"),t=e&&p.NF.CountryCodes.find(t=>t.code===e);return t?.dialCode||p.NF.CountryCodes[0]?.dialCode||""}setActiveInputValue(e){const t=(e=>e.replace(/\+\d+-/,""))(e);if(this.activeInput.localName===m){const e=this.phoneCountryCodeInput.countryCodeItems||this.#i();this.activeInput.value=`${e}-${t}`}else this.activeInput.value=t}toggleInputVisibility(){this.inputs.forEach(e=>{e!==this.activeInput?e.classList.add("hidden"):e.classList.remove("hidden")})}reportValidity(){this.#e=!0;const e=this.activeInputEle,t=e.type;return e.setAttribute("type","text"),setTimeout(()=>{e.setSelectionRange?.(e.value.length,e.value.length),e.setAttribute("type",t)}),this.activeInput.reportValidity()}checkValidity(){return this.activeInput.checkValidity()}});customElements.define(d,y)},16306(e,t,i){i.d(t,{TQ:()=>c,Ul:()=>C});var r=i(25964),n=i(28027),o=i(9035),a=i(97810),s=i(9696),l=i(79365),p=i(51680),u=i(73551);const d=n.w.cssVarList,c=(0,a.xE)("phone-input-box-field"),{host:h,label:m,inputElement:g,requiredIndicator:y,inputField:f,internalComponent:b,internalComponentAfter:x,phoneInput:v,errorMessage:I,helperText:F}={host:{selector:()=>":host"},label:{selector:"::part(label)"},placeholder:{selector:"> input:placeholder-shown"},inputElement:{selector:"input"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:()=>"vaadin-text-field::part(input-field)"},internalComponent:{selector:"descope-phone-field-internal-input-box"},internalComponentAfter:{selector:"descope-phone-field-internal-input-box::after"},phoneInput:{selector:()=>"descope-text-field"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},C=(0,s.Zz)((0,l.RF)({mappings:{fontSize:[h,f,{selector:n.w.componentName,property:n.w.cssVarList.fontSize}],fontFamily:[m,I,F],hostWidth:{...h,property:"width"},hostMinWidth:{...h,property:"min-width"},hostDirection:{...h,property:"direction"},inputHorizontalPadding:[{...v,property:"padding-left"},{...v,property:"padding-right"}],labelFontSize:{...m,property:"font-size"},labelFontWeight:{...m,property:"font-weight"},inputValueFontWeight:{...v,property:d.inputValueFontWeight},inputPlaceholderFontWeight:{...v,property:d.inputPlaceholderFontWeight},helperTextFontWeight:{...F,property:"font-weight"},errorMessageFontWeight:{...I,property:"font-weight"},labelTextColor:[{...m,property:"color"},{...m,property:"-webkit-text-fill-color"},{...y,property:"color"}],labelRequiredIndicator:{...y,property:"content"},errorMessageTextColor:{...I,property:"color"},errorMessageIcon:{...I,property:"background-image"},errorMessageIconSize:{...I,property:"background-size"},errorMessageIconPadding:{...I,property:"padding-inline-start"},errorMessageIconRepeat:{...I,property:"background-repeat"},errorMessageIconPosition:{...I,property:"background-position"},errorMessageFontSize:{...I,property:"font-size"},inputValueTextColor:{...v,property:d.inputValueTextColor},inputPlaceholderTextColor:{...v,property:d.inputPlaceholderColor},inputBorderStyle:{...x,property:"border-style"},inputBorderWidth:{...x,property:"border-width"},inputBorderColor:{...x,property:"border-color"},inputBorderRadius:[{...b,property:"border-radius"},{...x,property:"border-radius"}],inputOutlineStyle:{...b,property:"outline-style"},inputOutlineColor:{...b,property:"outline-color"},inputOutlineWidth:{...b,property:"outline-width"},inputOutlineOffset:{...b,property:"outline-offset"},labelPosition:{...m,property:"position"},labelTopPosition:{...m,property:"top"},labelHorizontalPosition:[{...m,property:"left"},{...m,property:"right"}],inputTransformY:{...m,property:"transform"},inputTransition:{...m,property:"transition"},marginInlineStart:{...m,property:"margin-inline-start"},valueInputHeight:{...g,property:"height"},valueInputMarginBottom:{selector:n.w.componentName,property:d.valueInputMarginBottom}}}),l.VO,l.Yg,(0,l.OZ)({proxyProps:["value","selectionStart"]}),e=>class extends e{static get CountryCodes(){return p.A}init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n `,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),(0,r.Gh)(this,this.inputElement,{includeAttrs:["has-value"]}),(0,a.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","minlength","maxlength","default-code","disabled","phone-input-placeholder","label","label-type","allow-alphanumeric-input","restrict-countries","format-value","strict-validation","data-errormessage-type-mismatch","phone-input-type"]})}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}})((0,l.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n box-sizing: border-box;\n }\n ${(0,u.cy)(C.cssVarList)}\n ${(0,u.I4)("vaadin-text-field")}\n ${(0,u.kG)("vaadin-text-field")}\n ${(0,u.X6)()}\n\n vaadin-text-field {\n width: 100%;\n box-sizing: border-box;\n padding: 0;\n }\n vaadin-text-field[focus-ring]::part(input-field) {\n box-shadow: none;\n }\n vaadin-text-field::before {\n height: 0;\n }\n vaadin-text-field::part(input-field) {\n padding: 0;\n background: transparent;\n -webkit-mask-image: none;\n }\n descope-phone-field-internal-input-box {\n -webkit-mask-image: none;\n padding: 0;\n width: 100%;\n }\n descope-phone-field-internal-input-box > div {\n width: 100%;\n }\n descope-phone-field-internal-input-box descope-text-field {\n ${d.inputOutlineWidth}: 0;\n ${d.inputOutlineOffset}: 0;\n }\n descope-phone-field-internal-input-box::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n box-sizing: border-box;\n pointer-events: none;\n }\n descope-text-field {\n flex-grow: 1;\n width: 100%;\n direction: ltr;\n }\n vaadin-text-field[readonly] > input:placeholder-shown {\n opacity: 1;\n }\n vaadin-text-field::part(input-field)::after {\n border: none;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] input:placeholder-shown {\n opacity: 0;\n }\n\n ${(0,u.$J)("vaadin-text-field")}\n ${(0,u.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:c}))},9035(e,t,i){i.d(t,{A:()=>h,T:()=>p});var r=i(25964),n=i(10473),o=i(23530),a=i(3393),s=i(97810),l=i(92259);const p=(0,s.xE)("phone-field-internal-input-box"),u=["disabled","size","readonly","phone-input-placeholder","name","maxlength","autocomplete","label-type","phone-input-type"],d={"phone-input-placeholder":"placeholder","phone-input-type":"type"},c=(0,a.y)({componentName:p,baseSelector:"div"}),h=class extends c{static get observedAttributes(){return[].concat(c.observedAttributes||[],u)}#r;constructor(){super(),this.innerHTML='\n <div>\n <descope-text-field tabindex="1" type="tel" bordered="false"></descope-text-field>\n </div>\n ',this.textField=this.querySelector("descope-text-field")}get phoneNumberInputEle(){return this.textField.shadowRoot.querySelector("input")}get defaultDialCode(){return(0,l.Q)(this.getAttribute("default-code"))}get defaultCode(){return this.getAttribute("default-code")}get allowAlphanumericInput(){return"true"===this.getAttribute("allow-alphanumeric-input")}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}get maxLength(){return parseInt(this.getAttribute("maxlength"),10)||50}get restrictCountries(){return this.getAttribute("restrict-countries")?.split(",").filter(Boolean)||[]}get isFormatValue(){return"true"===this.getAttribute("format-value")}get isStrictValidation(){return"true"===this.getAttribute("strict-validation")}get value(){if(!this.textField.value)return"";if(!this.isStrictValidation)return this.#n();const e=this.#o();return e?.country&&e?.countryCallingCode&&e?.nationalNumber?`+${[e?.countryCallingCode,e?.nationalNumber].join("-")}`:this.textField.value}set value(e){this.textField.value=e}init(){this.addEventListener("focus",e=>{e.isTrusted&&this.textField.focus()}),super.init?.(),this.textField.addEventListener("input",this.#a.bind(this)),this.handleFocusEventsDispatching([this.textField]),(0,r.EA)(this.textField,this,{includeAttrs:["has-value"]}),(0,r.EA)(this,this.textField,{includeAttrs:["phone-input-type"],mapAttrs:{"phone-input-type":"type"}})}getValidity(){const e=/^\+?\d{1,4}-?(?:\d-?){1,15}$/,t=this.#s(this.textField.value||"");if(this.isRequired&&!this.textField.value)return{valueMissing:!0};if(this.textField.value){if(t.length<this.minLength)return{tooShort:!0};if(this.isStrictValidation&&this.textField.value&&!this.#l()||!this.isStrictValidation&&this.textField.value&&!e.test(this.value))return{patternMismatch:!0}}return{}}setSelectionRange(...e){this.textField.setSelectionRange(...e)}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),t!==i&&u.includes(e)){const t=d[e]||e;this.textField.setAttribute(t,i)}}#a(e){let t=this.#p(e.target.value);this.isFormatValue&&this.#u(t)&&(t=this.#d(t)),e.target.value=t}#n(){if(!this.defaultDialCode)return this.textField.value;const e=this.#c(this.textField.value),t=this.#s(e);return[this.defaultDialCode,t].join("-")}#o(){return this.defaultDialCode?(0,n.l)([this.defaultDialCode,this.#s(this.textField.value)].filter(Boolean).join("")):(0,n.l)(this.textField.value)}#s(e){return e.replace(/\D/g,"")}#c(e){if("+"===this.textField.value?.[0]){const t=new RegExp(`^\\${this.defaultDialCode}`);return e.replace(t,"")}return e}#l(){const e=(0,n.l)(this.value);return!(!e||!e.isValid?.()||!e.country||!this.#h(e.country)||this.defaultCode&&this.defaultCode!==e.country)}#h(e){return!this.restrictCountries.length||this.restrictCountries.includes(e)}#p(e){if(e=e.replace(/^-+/,"").replace(/(?!^)\+/g,"").replace("--","-").replace("+-","+"),!this.allowAlphanumericInput){const t=/^[+\d-\(\)]+$/;e=e.split("").filter(e=>t.test(e)).join("")}return e}#d(e=""){const t=this.defaultCode||this.#m(e);return t?(this.#r&&this.#r.country===t||(this.#r=new o.Q(t)),this.#r.reset(),this.#r.input(e)||e):e}#m(e){const t=(0,n.l)(e);return t?.country||""}#u(e){return!!(0,l.W)(e)}}},78343(e,t,i){i.r(t),i(64014);var r=i(9035);customElements.define(r.T,r.A)},30057(e,t,i){i.r(t),i.d(t,{PhoneFieldInputBoxClass:()=>r.Ul,componentName:()=>r.TQ}),i(78343),i(64014);var r=i(16306);customElements.define(r.TQ,r.Ul)},92259(e,t,i){i.d(t,{Q:()=>n,W:()=>o});var r=i(51680);const n=e=>r.A.find(t=>t.code===e)?.dialCode,o=e=>{const t=e.match(/\(/g),i=e.match(/\)/g);return t?.length===i?.length}}}]);
19
+ `;(0,i.SF)("vaadin-email-field",l,{moduleId:"vaadin-email-field-styles"});class s extends p.A{static get is(){return"vaadin-email-field"}constructor(){super(),this._setType("email"),this.pattern="^([a-zA-Z0-9_\\.\\-+])+@[a-zA-Z0-9\\-.]+\\.[a-zA-Z0-9\\-]{2,}$"}ready(){super.ready(),this.inputElement&&(this.inputElement.autocapitalize="off")}}(0,a.X)(s);var d=r(67383);customElements.define(d.T,d.v)},44966(t,e,r){r.r(e),r.d(e,{HybridFieldClass:()=>g,componentName:()=>u}),r(30133),r(98136),r(30057);var n=r(25964),i=r(79365),o=r(81365),a=r(9696),p=r(97810);const l=/[^\d\s+\-()]/;var s=r(81808),d=r(16306);const u=(0,p.xE)("hybrid-field"),c={shared:["label","bordered","full-width","label-type","size","disabled","readonly","required","st-host-direction","st-error-message-icon","st-error-message-icon-size","st-error-message-icon-padding"],email:["placeholder","data-errormessage-value-missing-email","data-errormessage-pattern-mismatch-email","external-input"],phone:{countryCode:["phone-input-label","country-input-label","country-input-placeholder","restrict-countries","default-code","phone-minlength","phone-format-value","phone-strict-validation","phone-input-type","data-errormessage-value-missing-phone"],inputBox:["restrict-countries","default-code","phone-minlength","phone-format-value","phone-strict-validation","phone-input-type","data-errormessage-value-missing-phone"]}},h={email:{"data-errormessage-value-missing-email":"data-errormessage-value-missing","data-errormessage-pattern-mismatch-email":"data-errormessage-pattern-mismatch"},phone:{"phone-input-label":"label","phone-minlength":"minlength","phone-format-value":"format-value","phone-strict-validation":"strict-validation","data-errormessage-value-missing-phone":"data-errormessage-value-missing"}},y="descope-phone-field",m=(0,o.q)({componentName:u,baseSelector:"div"}),g=(0,a.Zz)((0,i.RF)({componentNameOverride:(0,p.xE)("input-wrapper")}),(0,i.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:[{selector:()=>"descope-email-field",property:"direction"},{selector:()=>"descope-phone-field",property:"direction"},{selector:()=>"descope-phone-input-box-field",property:"direction"}],errorMessageIcon:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.errorMessageIcon},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.errorMessageIcon}],errorMessageIconSize:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.errorMessageIconSize},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.errorMessageIconSize}],errorMessageIconPadding:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.errorMessageIconPadding},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.errorMessageIconPadding}],errorMessageIconRepeat:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.errorMessageIconRepeat},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.errorMessageIconRepeat}],errorMessageIconPosition:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.errorMessageIconPosition},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.errorMessageIconPosition}],errorMessageFontSize:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.errorMessageFontSize},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.errorMessageFontSize}],labelFontWeight:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.labelFontWeight},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.labelFontWeight}],inputValueFontWeight:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.inputValueFontWeight},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.inputValueFontWeight}],inputPlaceholderFontWeight:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.inputPlaceholderFontWeight},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.inputPlaceholderFontWeight}],helperTextFontWeight:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.helperTextFontWeight},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.helperTextFontWeight}],errorMessageFontWeight:[{selector:()=>s.NF.componentName,property:s.NF.cssVarList.errorMessageFontWeight},{selector:()=>d.Ul.componentName,property:d.Ul.cssVarList.errorMessageFontWeight}]}}),i.VO,i.tQ)(class extends m{#t=!1;#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div class="wrapper">\n <descope-email-field external-input="${this.isExternalInput}"></descope-email-field>\n <descope-phone-field allow-alphanumeric-input="true" phone-input-type="text"></descope-phone-field>\n <descope-phone-input-box-field allow-alphanumeric-input="true" phone-input-type="text"></descope-phone-input-box-field>\n </div>\n\t\t`,(0,n.fz)("\n :host {\n display: inline-flex;\n box-sizing: border-box;\n padding: 0;\n gap: 0;\n }\n .wrapper {\n display: grid;\n width: 100%;\n }\n descope-email-field,\n descope-phone-field,\n descope-phone-input-box-field {\n grid-area: 1/1;\n width: 100%;\n height: 100%;\n }\n .hidden {\n visibility: hidden;\n }\n ",this)}get isExternalInput(){return"true"===this.getAttribute("external-input")}get emailInputEle(){return this.isExternalInput?this.emailInput.externalInput:this.emailInput.inputElement}get phoneVariant(){return"inputBox"===this.getAttribute("phone-variant")?this.phoneInputBoxInput:this.phoneCountryCodeInput}get defaultCode(){const t=this.phoneCountryCodeInput.countryCodes?.[0]||"";return this.getAttribute("default-code")||t}get activeInputEle(){return this.activeInput===this.emailInput?this.emailInputEle:this.phoneVariant.phoneNumberInputEle}get value(){return this.activeInput?.value||""}set value(t){this.handleActiveInput(t),setTimeout(()=>{this.activeInput.value=t})}async init(){super.init?.(),this.initInputs(),this.updateAttrs(),this.toggleInputVisibility(),await this.waitForInputs(),this.initInputEles(),this.overrideEmailInputType(),this.overrideEmailSetAttribute()}waitForInputs(){return new Promise(t=>{const e=setInterval(()=>{this.emailInputEle&&(clearInterval(e),t())})})}initInputs(){this.emailInput=this.shadowRoot.querySelector("descope-email-field"),this.phoneCountryCodeInput=this.shadowRoot.querySelector(y),this.phoneInputBoxInput=this.shadowRoot.querySelector("descope-phone-input-box-field"),this.inputs=[this.emailInput,this.phoneCountryCodeInput,this.phoneInputBoxInput],this.activeInput=this.emailInput}initInputEles(){[this.emailInputEle,this.phoneCountryCodeInput.phoneNumberInputEle,this.phoneInputBoxInput.phoneNumberInputEle].forEach(t=>{t.addEventListener("input",this.onValueChange.bind(this))})}overrideEmailInputType(){this.emailInputEle.addEventListener("focus",()=>{this.emailInputEle.setAttribute("type","text")}),this.emailInputEle.addEventListener("blur",()=>{setTimeout(()=>{this.emailInputEle.setAttribute("type","email")})})}overrideEmailSetAttribute(){const t=this.emailInput.setAttribute.bind(this.emailInputEle);this.emailInputEle.setAttribute=(e,r)=>("type"!==e||"email"!==r||!this.emailInput.hasAttribute("focused"))&&t(e,r)}updateAttrs(){(0,p.EA)(this,this.emailInput,{includeAttrs:c.email,mapAttrs:h.email}),(0,p.EA)(this,this.phoneCountryCodeInput,{includeAttrs:c.phone.countryCode,mapAttrs:h.phone}),(0,p.EA)(this,this.phoneInputBoxInput,{includeAttrs:c.phone.inputBox,mapAttrs:h.phone}),this.inputs.forEach(t=>(0,p.EA)(this,t,{includeAttrs:c.shared})),setTimeout(()=>this.phoneCountryCodeInput.setAttribute("default-code",this.defaultCode))}onValueChange(){this.#e=this.activeInputEle.selectionStart,this.handleActiveInput(this.activeInputEle.value||this.activeInput.value)}handleActiveInput(t){const e=(t=>!!t&&!l.test(t))(t)?this.phoneVariant:this.emailInput;this.activeInput!==e&&this.setActiveInput(e)}setActiveInput(t){const e=this.activeInputEle.value||this.activeInput.value;this.activeInput=t,this.setActiveInputValue(e),this.#t&&this.activeInput.reportValidity(),this.setActiveInputSelectionStart(),this.toggleInputVisibility()}setActiveInputSelectionStart(){setTimeout(()=>{const t=this.activeInputEle;t.focus();try{t.setSelectionRange?.(this.#e,this.#e)}catch{}})}#r(){const t=this.getAttribute("default-code"),e=t&&s.NF.CountryCodes.find(e=>e.code===t);return e?.dialCode||s.NF.CountryCodes[0]?.dialCode||""}setActiveInputValue(t){const e=(t=>t.replace(/\+\d+-/,""))(t);if(this.activeInput.localName===y){const t=this.phoneCountryCodeInput.countryCodeItems||this.#r();this.activeInput.value=`${t}-${e}`}else this.activeInput.value=e}toggleInputVisibility(){this.inputs.forEach(t=>{t!==this.activeInput?t.classList.add("hidden"):t.classList.remove("hidden")})}reportValidity(){this.#t=!0;const t=this.activeInputEle,e=t.type;return t.setAttribute("type","text"),setTimeout(()=>{t.setSelectionRange?.(t.value.length,t.value.length),t.setAttribute("type",e)}),this.activeInput.reportValidity()}checkValidity(){return this.activeInput.checkValidity()}});customElements.define(u,g)},81808(t,e,r){r.d(e,{NF:()=>F,TQ:()=>h});var n=r(86365),i=r(28027),o=r(84015),a=r(97810),p=r(9696),l=r(79365),s=r(51680),d=r(73551);const u=i.w.cssVarList,c=n.C.cssVarList,h=(0,a.xE)("phone-field"),{host:y,label:m,requiredIndicator:g,inputField:f,internalAfter:b,countryCodeInput:x,phoneInput:v,separator:I,errorMessage:w,helperText:C}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},internalAfter:{selector:"descope-phone-field-internal::after"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},separator:{selector:"descope-phone-field-internal .separator"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},F=(0,p.Zz)((0,l.RF)({mappings:{fontSize:[y,f,{selector:i.w.componentName,property:i.w.cssVarList.fontSize},{selector:n.C.componentName,property:n.C.cssVarList.fontSize}],fontFamily:[m,w,C,{...x,property:n.C.cssVarList.overlay.fontFamily}],hostWidth:[{...y,property:"width"},{...v,property:"width"},{...x,property:"--vaadin-combo-box-overlay-width"}],hostDirection:{...y,property:"direction"},inputBorderStyle:[{...b,property:"border-style"},{...I,property:"border-left-style"}],inputBorderWidth:[{...b,property:"border-width"},{...I,property:"border-left-width"}],inputBorderColor:[{...b,property:"border-color"},{...I,property:"border-left-color"}],inputBorderRadius:[{...f,property:"border-radius"},{...b,property:"border-radius"}],countryCodeInputWidth:{...x,property:c.hostWidth},countryCodeDropdownWidth:{...x,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...v,property:"width"},horizontalPadding:[{...v,property:"padding-left"},{...v,property:"padding-right"},{...x,property:"padding-left"},{...x,property:"padding-right"}],labelFontSize:{...m,property:"font-size"},labelFontWeight:{...m,property:"font-weight"},inputValueFontWeight:[{...v,property:u.inputValueFontWeight},{...x,property:c.inputValueFontWeight}],inputPlaceholderFontWeight:{...v,property:u.inputPlaceholderFontWeight},helperTextFontWeight:{...C,property:"font-weight"},errorMessageFontWeight:{...w,property:"font-weight"},labelTextColor:[{...m,property:"color"},{...m,property:"-webkit-text-fill-color"},{...g,property:"color"}],labelRequiredIndicator:{...g,property:"content"},errorMessageTextColor:{...w,property:"color"},errorMessageIcon:{...w,property:"background-image"},errorMessageIconSize:{...w,property:"background-size"},errorMessageIconPadding:{...w,property:"padding-inline-start"},errorMessageIconRepeat:{...w,property:"background-repeat"},errorMessageIconPosition:{...w,property:"background-position"},errorMessageFontSize:{...w,property:"font-size"},inputValueTextColor:[{...v,property:u.inputValueTextColor},{...x,property:c.inputValueTextColor}],inputPlaceholderTextColor:{...v,property:u.inputPlaceholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:c.overlayItemBackgroundColor},inputOutlineStyle:{...f,property:"outline-style"},inputOutlineColor:{...f,property:"outline-color"},inputOutlineWidth:{...f,property:"outline-width"},inputOutlineOffset:{...f,property:"outline-offset"},valueInputHeight:[{...x,property:c.valueInputHeight}],valueInputMarginBottom:[{...v,property:u.valueInputMarginBottom}],marginInlineStart:[{...v,property:u.marginInlineStart},{...x,property:c.marginInlineStart}]}}),l.VO,l.Yg,(0,l.OZ)({proxyProps:["value","selectionStart"]}),t=>class extends t{static get CountryCodes(){return s.A}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n \t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.baseElement._forwardInputValue=()=>{},this.inputElement=this.shadowRoot.querySelector(o.T),(0,a.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","minlength","maxlength","default-code","country-input-placeholder","phone-input-placeholder","disabled","restrict-countries","country-input-label","readonly","label","label-type","allow-alphanumeric-input","format-value","strict-validation","phone-input-type"]})}get countryCodeItems(){return this.inputElement?.countryCodeValue}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}get countryCodeInputData(){return this.inputElement?.countryCodeInputData}get countryCodes(){return Array.from(this.inputElement.countryCodeInputData).map(t=>t.getAttribute("data-country-code"))}})((0,l.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 15em;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,d.cy)(F.cssVarList)}\n\t\t\t${(0,d.I4)("vaadin-text-field")}\n\t\t\t${(0,d.kG)("vaadin-text-field")}\n\t\t\t${(0,d.X6)()}\n\n\t\t\tdiv {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\tvaadin-text-field {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-text-field::before {\n\t\t\t\theight: 0;\n\t\t\t}\n\t\t\tvaadin-text-field::part(label) {\n margin-left: 0;\n margin-right: 0;\n }\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\tdescope-phone-field-internal {\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n direction: ltr;\n position: relative;\n\t\t\t}\n descope-phone-field-internal::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n box-sizing: border-box;\n outline-offset: calc(var(${F.cssVarList.inputBorderWidth}) * -1);\n pointer-events: none;\n }\n\t\t\tdescope-phone-field-internal > div {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\tdescope-phone-field-internal .separator {\n\t\t\t\tflex: 0;\n\t\t\t\tborder: none;\n\t\t\t}\n\n\t\t\tdescope-combo-box {\n\t\t\t\tflex-shrink: 0;\n min-width: 5.75em;\n\t\t\t\t${c.inputOutlineWidth}: 0;\n\t\t\t\t${c.inputOutlineOffset}: 0;\n\t\t\t\t${c.inputBorderWidth}: 0;\n\t\t\t\t${c.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tdescope-text-field {\n\t\t\t\tflex-grow: 1;\n\t\t\t\t${u.inputOutlineWidth}: 0;\n\t\t\t\t${u.inputOutlineOffset}: 0;\n\t\t\t\t${u.inputBorderWidth}: 0;\n\t\t\t\t${u.inputBorderRadius}: 0;\n }\n\n :host([label-type="floating"]) vaadin-text-field::part(label) {\n display: none;\n }\n descope-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n descope-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t\tvaadin-text-field::part(input-field)::after {\n\t\t\t\tborder: none;\n\t\t\t}\n ${(0,d.$J)("vaadin-text-field")}\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:h}))},98136(t,e,r){r.r(e),r.d(e,{PhoneFieldClass:()=>n.NF,componentName:()=>n.TQ}),r(92132),r(27092),r(64014);var n=r(81808);customElements.define(n.TQ,n.NF)},16306(t,e,r){r.d(e,{TQ:()=>c,Ul:()=>C});var n=r(25964),i=r(28027),o=r(9035),a=r(97810),p=r(9696),l=r(79365),s=r(51680),d=r(73551);const u=i.w.cssVarList,c=(0,a.xE)("phone-input-box-field"),{host:h,label:y,inputElement:m,requiredIndicator:g,inputField:f,internalComponent:b,internalComponentAfter:x,phoneInput:v,errorMessage:I,helperText:w}={host:{selector:()=>":host"},label:{selector:"::part(label)"},placeholder:{selector:"> input:placeholder-shown"},inputElement:{selector:"input"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:()=>"vaadin-text-field::part(input-field)"},internalComponent:{selector:"descope-phone-field-internal-input-box"},internalComponentAfter:{selector:"descope-phone-field-internal-input-box::after"},phoneInput:{selector:()=>"descope-text-field"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},C=(0,p.Zz)((0,l.RF)({mappings:{fontSize:[h,f,{selector:i.w.componentName,property:i.w.cssVarList.fontSize}],fontFamily:[y,I,w],hostWidth:{...h,property:"width"},hostMinWidth:{...h,property:"min-width"},hostDirection:{...h,property:"direction"},inputHorizontalPadding:[{...v,property:"padding-left"},{...v,property:"padding-right"}],labelFontSize:{...y,property:"font-size"},labelFontWeight:{...y,property:"font-weight"},inputValueFontWeight:{...v,property:u.inputValueFontWeight},inputPlaceholderFontWeight:{...v,property:u.inputPlaceholderFontWeight},helperTextFontWeight:{...w,property:"font-weight"},errorMessageFontWeight:{...I,property:"font-weight"},labelTextColor:[{...y,property:"color"},{...y,property:"-webkit-text-fill-color"},{...g,property:"color"}],labelRequiredIndicator:{...g,property:"content"},errorMessageTextColor:{...I,property:"color"},errorMessageIcon:{...I,property:"background-image"},errorMessageIconSize:{...I,property:"background-size"},errorMessageIconPadding:{...I,property:"padding-inline-start"},errorMessageIconRepeat:{...I,property:"background-repeat"},errorMessageIconPosition:{...I,property:"background-position"},errorMessageFontSize:{...I,property:"font-size"},inputValueTextColor:{...v,property:u.inputValueTextColor},inputPlaceholderTextColor:{...v,property:u.inputPlaceholderColor},inputBorderStyle:{...x,property:"border-style"},inputBorderWidth:{...x,property:"border-width"},inputBorderColor:{...x,property:"border-color"},inputBorderRadius:[{...b,property:"border-radius"},{...x,property:"border-radius"}],inputOutlineStyle:{...b,property:"outline-style"},inputOutlineColor:{...b,property:"outline-color"},inputOutlineWidth:{...b,property:"outline-width"},inputOutlineOffset:{...b,property:"outline-offset"},labelPosition:{...y,property:"position"},labelTopPosition:{...y,property:"top"},labelHorizontalPosition:[{...y,property:"left"},{...y,property:"right"}],inputTransformY:{...y,property:"transform"},inputTransition:{...y,property:"transition"},marginInlineStart:{...y,property:"margin-inline-start"},valueInputHeight:{...m,property:"height"},valueInputMarginBottom:{selector:i.w.componentName,property:u.valueInputMarginBottom}}}),l.VO,l.Yg,(0,l.OZ)({proxyProps:["value","selectionStart"]}),t=>class extends t{static get CountryCodes(){return s.A}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),(0,n.Gh)(this,this.inputElement,{includeAttrs:["has-value"]}),(0,a.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","minlength","maxlength","default-code","disabled","phone-input-placeholder","label","label-type","allow-alphanumeric-input","restrict-countries","format-value","strict-validation","data-errormessage-type-mismatch","phone-input-type"]})}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}})((0,l.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n box-sizing: border-box;\n }\n ${(0,d.cy)(C.cssVarList)}\n ${(0,d.I4)("vaadin-text-field")}\n ${(0,d.kG)("vaadin-text-field")}\n ${(0,d.X6)()}\n\n vaadin-text-field {\n width: 100%;\n box-sizing: border-box;\n padding: 0;\n }\n vaadin-text-field[focus-ring]::part(input-field) {\n box-shadow: none;\n }\n vaadin-text-field::before {\n height: 0;\n }\n vaadin-text-field::part(input-field) {\n padding: 0;\n background: transparent;\n -webkit-mask-image: none;\n }\n descope-phone-field-internal-input-box {\n -webkit-mask-image: none;\n padding: 0;\n width: 100%;\n }\n descope-phone-field-internal-input-box > div {\n width: 100%;\n }\n descope-phone-field-internal-input-box descope-text-field {\n ${u.inputOutlineWidth}: 0;\n ${u.inputOutlineOffset}: 0;\n }\n descope-phone-field-internal-input-box::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n box-sizing: border-box;\n pointer-events: none;\n }\n descope-text-field {\n flex-grow: 1;\n width: 100%;\n direction: ltr;\n }\n vaadin-text-field[readonly] > input:placeholder-shown {\n opacity: 1;\n }\n vaadin-text-field::part(input-field)::after {\n border: none;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] input:placeholder-shown {\n opacity: 0;\n }\n\n ${(0,d.$J)("vaadin-text-field")}\n ${(0,d.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:c}))},9035(t,e,r){r.d(e,{A:()=>h,T:()=>s});var n=r(25964),i=r(10473),o=r(23530),a=r(3393),p=r(97810),l=r(92259);const s=(0,p.xE)("phone-field-internal-input-box"),d=["disabled","size","readonly","phone-input-placeholder","name","maxlength","autocomplete","label-type","phone-input-type"],u={"phone-input-placeholder":"placeholder","phone-input-type":"type"},c=(0,a.y)({componentName:s,baseSelector:"div"}),h=class extends c{static get observedAttributes(){return[].concat(c.observedAttributes||[],d)}#n;constructor(){super(),this.innerHTML='\n <div>\n <descope-text-field tabindex="1" type="tel" bordered="false"></descope-text-field>\n </div>\n ',this.textField=this.querySelector("descope-text-field")}get phoneNumberInputEle(){return this.textField.shadowRoot.querySelector("input")}get defaultDialCode(){return(0,l.Q)(this.getAttribute("default-code"))}get defaultCode(){return this.getAttribute("default-code")}get allowAlphanumericInput(){return"true"===this.getAttribute("allow-alphanumeric-input")}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}get maxLength(){return parseInt(this.getAttribute("maxlength"),10)||50}get restrictCountries(){return this.getAttribute("restrict-countries")?.split(",").filter(Boolean)||[]}get isFormatValue(){return"true"===this.getAttribute("format-value")}get isStrictValidation(){return"true"===this.getAttribute("strict-validation")}get value(){if(!this.textField.value)return"";if(!this.isStrictValidation)return this.#i();const t=this.#o();return t?.country&&t?.countryCallingCode&&t?.nationalNumber?`+${[t?.countryCallingCode,t?.nationalNumber].join("-")}`:this.textField.value}set value(t){this.textField.value=t}init(){this.addEventListener("focus",t=>{t.isTrusted&&this.textField.focus()}),super.init?.(),this.textField.addEventListener("input",this.#a.bind(this)),this.handleFocusEventsDispatching([this.textField]),(0,n.EA)(this.textField,this,{includeAttrs:["has-value"]}),(0,n.EA)(this,this.textField,{includeAttrs:["phone-input-type"],mapAttrs:{"phone-input-type":"type"}})}getValidity(){const t=/^\+?\d{1,4}-?(?:\d-?){1,15}$/,e=this.#p(this.textField.value||"");if(this.isRequired&&!this.textField.value)return{valueMissing:!0};if(this.textField.value){if(e.length<this.minLength)return{tooShort:!0};if(this.isStrictValidation&&this.textField.value&&!this.#l()||!this.isStrictValidation&&this.textField.value&&!t.test(this.value))return{patternMismatch:!0}}return{}}setSelectionRange(...t){this.textField.setSelectionRange(...t)}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),e!==r&&d.includes(t)){const e=u[t]||t;this.textField.setAttribute(e,r)}}#a(t){let e=this.#s(t.target.value);this.isFormatValue&&this.#d(e)&&(e=this.#u(e)),t.target.value=e}#i(){if(!this.defaultDialCode)return this.textField.value;const t=this.#c(this.textField.value),e=this.#p(t);return[this.defaultDialCode,e].join("-")}#o(){return this.defaultDialCode?(0,i.l)([this.defaultDialCode,this.#p(this.textField.value)].filter(Boolean).join("")):(0,i.l)(this.textField.value)}#p(t){return t.replace(/\D/g,"")}#c(t){if("+"===this.textField.value?.[0]){const e=new RegExp(`^\\${this.defaultDialCode}`);return t.replace(e,"")}return t}#l(){const t=(0,i.l)(this.value);return!(!t||!t.isValid?.()||!t.country||!this.#h(t.country)||this.defaultCode&&this.defaultCode!==t.country)}#h(t){return!this.restrictCountries.length||this.restrictCountries.includes(t)}#s(t){if(t=t.replace(/^-+/,"").replace(/(?!^)\+/g,"").replace("--","-").replace("+-","+"),!this.allowAlphanumericInput){const e=/^[+\d-\(\)]+$/;t=t.split("").filter(t=>e.test(t)).join("")}return t}#u(t=""){const e=this.defaultCode||this.#y(t);return e?(this.#n&&this.#n.country===e||(this.#n=new o.Q(e)),this.#n.reset(),this.#n.input(t)||t):t}#y(t){const e=(0,i.l)(t);return e?.country||""}#d(t){return!!(0,l.W)(t)}}},78343(t,e,r){r.r(e),r(64014);var n=r(9035);customElements.define(n.T,n.A)},30057(t,e,r){r.r(e),r.d(e,{PhoneFieldInputBoxClass:()=>n.Ul,componentName:()=>n.TQ}),r(78343),r(64014);var n=r(16306);customElements.define(n.TQ,n.Ul)},92259(t,e,r){r.d(e,{Q:()=>i,W:()=>o});var n=r(51680);const i=t=>n.A.find(e=>e.code===t)?.dialCode,o=t=>{const e=t.match(/\(/g),r=t.match(/\)/g);return e?.length===r?.length}}}]);
20
20
  //# sourceMappingURL=descope-hybrid-field-index-js.js.map