@descope/web-components-ui 3.3.1 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"descope-enriched-text.js","mappings":"0PAUO,MAAMA,GAAgB,QAAiB,iBAE9C,MAAMC,WAAqB,QAAgB,CAAED,gBAAeE,aAAc,iBACxE,GAEA,GAEA,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,2CAIhD,QACE,6iBAkCAH,MAGFA,MAAK,KAEL,QAAgBA,KAAMA,MAAK,EAAeI,KAAKJ,OAG/CA,KAAKK,aAAaC,iBAAiB,QAAUC,IACvCA,EAAEC,kBAAkBC,mBACtBF,EAAEG,mBAGR,CAEA,6BAAWC,GACT,MAAO,CAAC,WAAY,oBACtB,CAEA,wBAAAC,CAAyBC,EAAUC,EAAUC,GAC3ChB,MAAMa,2BAA2BC,EAAUC,EAAUC,GAEjDA,IAAaD,IACE,aAAbD,GACFb,KAAKgB,iBAA8B,SAAbD,GAGP,sBAAbF,GACFb,MAAK,IAGX,CAGA,uBAAAiB,GACEjB,KAAKkB,UAAUC,SAASC,MAAMC,QAAU,CAACC,EAAQC,EAAKC,EAASC,EAAKC,KACvC,MAAvBJ,EAAOC,GAAKI,SAAgBL,EAAOC,GAAKK,IAAM,KAC3C5B,MAAK,EAAgBsB,EAAQC,EAAKC,EAASC,EAAKC,IAEzD1B,KAAKkB,UAAUC,SAASC,MAAMS,SAAW,CAACP,EAAQC,EAAKC,EAASC,EAAKC,KACxC,MAAvBJ,EAAOC,GAAKI,SAAgBL,EAAOC,GAAKK,IAAM,KAC3C5B,MAAK,EAAgBsB,EAAQC,EAAKC,EAASC,EAAKC,GAE3D,CAEA,KACM1B,KAAK8B,gBACP9B,KAAKkB,UAAUC,SAASC,MAAMW,UAAY,CAACT,EAAQC,EAAKC,EAASC,EAAKC,KAEpEJ,EAAOC,GAAKS,QAAQ,S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AAER,SAAU,UAEdS,eAAgB,CAAET,SAAU,eAC5BgD,kBAAmB,CAAEhD,SAAU,kBAC/BiD,WAAY,CAAC,EACbvC,UAAW,CAAC,EACZwC,cAAe,CAAC,EAChB7C,WAAY,CAAC,EACb8C,UAAW,CAAC,EACZ7C,WAAY,CAAC,EACb8C,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,YAAa,CAAC,KAGlB,KACA,KAvBuB,CAwBvBd,E,sFC9EFjB,eAAeC,OAAO,IAAe,I","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":["/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n\n // 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\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n 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: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n","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} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text 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 forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["componentName","EnrichedText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","html","getAttribute","shadowRoot","querySelector","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","disableRules","decodeHTML","textArea","document","createElement","value","customElements","define","RawLink","includeAttrs","mapAttrs","tooltip","selectors","host","link","anchor","wrapper","text","TextClass","LinkClass","textDecoration","cssVarList","cursor","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-enriched-text.js","mappings":"0PAUO,MAAMA,GAAgB,QAAiB,iBAE9C,MAAMC,WAAqB,QAAgB,CAAED,gBAAeE,aAAc,iBACxE,GAEA,GAEA,WAAAC,GAC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EdS,eAAgB,CAAET,SAAU,eAC5BoD,kBAAmB,CAAEpD,SAAU,kBAC/BqD,WAAY,CAAC,EACb3C,UAAW,CAAC,EACZ4C,cAAe,CAAC,EAChBjD,WAAY,CAAC,EACbkD,UAAW,CAAC,EACZjD,WAAY,CAAC,EACbkD,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,YAAa,CAAC,KAGlB,KACA,KAvBuB,CAwBvBd,E,sFC9EFrB,eAAeC,OAAO,IAAe,I","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":["/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n\n // 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\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n 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: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n","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} 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 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} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["componentName","EnrichedText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","html","getAttribute","shadowRoot","querySelector","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","disableRules","decodeHTML","textArea","document","createElement","value","customElements","define","observedAttrs","RawLink","concat","anchor","includeAttrs","mapAttrs","tooltip","readOnly","preventDefault","selectors","host","link","wrapper","text","TextClass","LinkClass","textDecoration","cssVarList","cursor","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159],{74778(t,e,o){o.r(e),o.d(e,{LinkClass:()=>y,componentName:()=>l});var n=o(88961),s=o(63200),r=o(25964),i=o(72270),p=o(66434);const l=(0,r.xE)("link");class h extends((0,i.qu)({componentName:l,baseSelector:":host a"})){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,r.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),(0,r.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,r.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const a={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>p.s.componentName}},{anchor:c,text:d,host:m,wrapper:x,link:u}=a,y=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...d,property:"direction"},textAlign:x,textDecoration:{...u,property:"text-decoration",fallback:"none"},textColor:[{...c,property:"color"},{...d,property:p.s.cssVarList.textColor}],cursor:c}}),n.VO,n.tQ)(h);o(63595),customElements.define(l,y)},66434(t,e,o){o.d(e,{T:()=>p,s:()=>a});var n=o(88961),s=o(63200),r=o(25964),i=o(72270);const p=(0,r.xE)("text");class l extends((0,i.qu)({componentName:p,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.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,r.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:h}={host:{selector:()=>":host"}},a=(0,s.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:{}}}),n.VO,n.tQ)(l)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(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],{74778(t,e,o){o.r(e),o.d(e,{LinkClass:()=>w,componentName:()=>p});var n=o(88961),s=o(63200),r=o(25964),i=o(72270),l=o(66434);const p=(0,r.xE)("link"),h=["href","readonly"];class a extends((0,i.qu)({componentName:p,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,r.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,r.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,r.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:d,text:u,host:m,wrapper:y,link:x}=c,w=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:y,textDecoration:{...x,property:"text-decoration",fallback:"none"},textColor:[{...d,property:"color"},{...u,property:l.s.cssVarList.textColor}],cursor:d}}),n.VO,n.tQ)(a);o(63595),customElements.define(p,w)},66434(t,e,o){o.d(e,{T:()=>l,s:()=>a});var n=o(88961),s=o(63200),r=o(25964),i=o(72270);const l=(0,r.xE)("text");class p extends((0,i.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.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,r.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:h}={host:{selector:()=>":host"}},a=(0,s.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:{}}}),n.VO,n.tQ)(p)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)}}]);
2
2
  //# sourceMappingURL=descope-link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-link.js","mappings":"0PAcO,MAAMA,GAAgB,QAAiB,QAE9C,MAAMC,WAAgB,QAAgB,CAAED,gBAAeE,aAAc,aACnE,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,iJAUhD,QACE,oXAkBAH,OAGF,QAAaA,KAAMA,KAAKI,WAAWC,cAAc,KAAM,CACrDC,aAAc,CAAC,OAAQ,SAAU,WACjCC,SAAU,CACRC,QAAS,YAIb,QAAaR,KAAMA,KAAKI,WAAWC,cAAc,gBAAiB,CAChEC,aAAc,CAAC,OAAQ,YAE3B,EAGF,MAAMG,EAAY,CAChBC,KAAM,CAAEC,SAAU,IAAM,SACxBC,KAAM,CAAED,SAAU,IAAM,WACxBE,OAAQ,CAAC,EACTC,QAAS,CAAEH,SAAU,IAAM,eAC3BI,KAAM,CAAEJ,SAAU,IAAMK,EAAA,EAAUrB,iBAG5BkB,OAAM,OAAM,wBAAqB,GAAKJ,EAEjCQ,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKT,EAAMU,SAAU,SAChCC,cAAe,IAAK,EAAMD,SAAU,aACpCE,UAAWR,EACXS,eAAgB,IAAK,EAAMH,SAAU,kBAAmBI,SAAU,QAClEC,UAAW,CACT,IAAK,EAAQL,SAAU,SACvB,IAAK,EAAMA,SAAUJ,EAAA,EAAUU,WAAWD,YAE5CE,OAAQ,KAGZ,KACA,KAfuB,CAgBvB/B,G,SCxFFgC,eAAeC,OAAOlC,EAAesB,E,wFCU9B,MAAMtB,GAAgB,QAAiB,QAE9C,MAAMmC,WAAgB,QAAgB,CACpCnC,gBACAE,aAAc,kBAEd,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,iDAIhD,QAAY,iLASTH,KACL,CAEA,iBAAI+B,GACF,MAAgD,SAAzC/B,KAAKgC,aAAa,kBAC3B,CAEA,IAAAC,GACElC,MAAMkC,QAEN,QAAgBjC,KAAM,KACpB,MAAMkC,IAAgBlC,KAAKmC,WAAWC,OACtCpC,KAAKqC,MAAMC,SAAWJ,GAAelC,KAAK+B,cAAgB,OAAS,IAEvE,EAGF,MAAM,KAAErB,GAAS,CACfA,KAAM,CAAEC,SAAU,IAAM,UAGbK,GAAY,SACvB,QAAiB,CACfE,SAAU,CACRC,UAAW,IAAKT,EAAMU,SAAU,SAChCC,cAAe,IAAKX,EAAMU,SAAU,aACpCmB,SAAU,CAAC,EACXd,UAAW,CACT,CAAEL,SAAU,UAEdoB,eAAgB,CAAEpB,SAAU,eAC5BqB,kBAAmB,CAAErB,SAAU,kBAC/BsB,WAAY,CAAC,EACbpB,UAAW,CAAC,EACZqB,cAAe,CAAC,EAChBC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,WAAY,CAAC,EACbC,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,YAAa,CAAC,KAGlB,KACA,KAvBuB,CAwBvBnB,E,sFC9EFF,eAAeC,OAAO,IAAe,I","sources":["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 {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text 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 forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["componentName","RawLink","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","shadowRoot","querySelector","includeAttrs","mapAttrs","tooltip","selectors","host","selector","link","anchor","wrapper","text","TextClass","LinkClass","mappings","hostWidth","property","hostDirection","textAlign","textDecoration","fallback","textColor","cssVarList","cursor","customElements","define","RawText","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","fontSize","textLineHeight","textLetterSpacing","textShadow","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-link.js","mappings":"0PAcO,MAAMA,GAAgB,QAAiB,QAExCC,EAAgB,CAAC,OAAQ,YAE/B,MAAMC,WAAgB,QAAgB,CACpCF,gBACAG,aAAc,aAEd,6BAAWC,GACT,OAAOH,EAAcI,OAAOC,MAAMF,oBAAsB,GAC1D,CAEA,WAAAG,GACED,QAEAE,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,iJAUhD,QACE,oXAkBAH,MAGFA,KAAKI,OAASJ,KAAKK,WAAWC,cAAc,MAE5C,QAAaN,KAAMA,KAAKI,OAAQ,CAC9BG,aAAc,CAAC,OAAQ,SAAU,WACjCC,SAAU,CACRC,QAAS,YAIb,QAAaT,KAAMA,KAAKK,WAAWC,cAAc,gBAAiB,CAChEC,aAAc,CAAC,OAAQ,aAGzBP,KAAKI,OAAOM,iBAAiB,QAAUC,IACjCX,KAAKY,UACPD,EAAEE,kBAGR,CAEA,YAAID,GACF,MAAyC,SAAlCZ,KAAKc,aAAa,WAC3B,EAGF,MAAMC,EAAY,CAChBC,KAAM,CAAEC,SAAU,IAAM,SACxBC,KAAM,CAAED,SAAU,IAAM,WACxBb,OAAQ,CAAC,EACTe,QAAS,CAAEF,SAAU,IAAM,eAC3BG,KAAM,CAAEH,SAAU,IAAMI,EAAA,EAAU7B,iBAG5BY,OAAM,OAAM,wBAAqB,GAAKW,EAEjCO,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKR,EAAMS,SAAU,SAChCC,cAAe,IAAK,EAAMD,SAAU,aACpCE,UAAWR,EACXS,eAAgB,IACX,EACHH,SAAU,kBACVI,SAAU,QAEZC,UAAW,CACT,IAAK,EAAQL,SAAU,SACvB,IAAK,EAAMA,SAAUJ,EAAA,EAAUU,WAAWD,YAE5CE,OAAQ,KAGZ,KACA,KAnBuB,CAoBvBtC,G,SCjHFuC,eAAeC,OAAO1C,EAAe8B,E,wFCU9B,MAAM9B,GAAgB,QAAiB,QAE9C,MAAM2C,WAAgB,QAAgB,CACpC3C,gBACAG,aAAc,kBAEd,WAAAI,GACED,QAEAE,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,iDAIhD,QAAY,iLASTH,KACL,CAEA,iBAAIoC,GACF,MAAgD,SAAzCpC,KAAKc,aAAa,kBAC3B,CAEA,IAAAuB,GACEvC,MAAMuC,QAEN,QAAgBrC,KAAM,KACpB,MAAMsC,IAAgBtC,KAAKuC,WAAWC,OACtCxC,KAAKyC,MAAMC,SAAWJ,GAAetC,KAAKoC,cAAgB,OAAS,IAEvE,EAGF,MAAM,KAAEpB,GAAS,CACfA,KAAM,CAAEC,SAAU,IAAM,UAGbI,GAAY,SACvB,QAAiB,CACfE,SAAU,CACRC,UAAW,IAAKR,EAAMS,SAAU,SAChCC,cAAe,IAAKV,EAAMS,SAAU,aACpCkB,SAAU,CAAC,EACXb,UAAW,CACT,CAAEL,SAAU,UAEdmB,eAAgB,CAAEnB,SAAU,eAC5BoB,kBAAmB,CAAEpB,SAAU,kBAC/BqB,WAAY,CAAC,EACbnB,UAAW,CAAC,EACZoB,cAAe,CAAC,EAChBC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,WAAY,CAAC,EACbC,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,YAAa,CAAC,KAGlB,KACA,KAvBuB,CAwBvBlB,E,sFC9EFF,eAAeC,OAAO,IAAe,I","sources":["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 {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\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 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} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["componentName","observedAttrs","RawLink","baseSelector","observedAttributes","concat","super","constructor","this","attachShadow","mode","innerHTML","anchor","shadowRoot","querySelector","includeAttrs","mapAttrs","tooltip","addEventListener","e","readOnly","preventDefault","getAttribute","selectors","host","selector","link","wrapper","text","TextClass","LinkClass","mappings","hostWidth","property","hostDirection","textAlign","textDecoration","fallback","textColor","cssVarList","cursor","customElements","define","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","fontSize","textLineHeight","textLetterSpacing","textShadow","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see descope-tooltip.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[628,2294,4159,9261],{76231(t,e,o){o.d(e,{T:()=>a,m:()=>p});var i=o(92540),s=o(88961),n=o(63200),r=o(36976),l=o(72270),h=o(54847),d=o(25964);const a=(0,d.xE)("enriched-text");class c extends((0,l.qu)({componentName:a,baseSelector:":host > div"})){#t;#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,d.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.#o(),(0,d.Ge)(this,this.#i.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),o!==e&&("readonly"===t&&this.onReadOnlyChange("true"===o),"link-target-blank"===t&&this.#o())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,o,i,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,o,i,s)),this.processor.renderer.rules.em_close=(t,e,o,i,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,o,i,s))}#s(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,o,i,s)=>(t[e].attrSet("target","_blank"),this.#t(t,e,o,i,s)):this.processor.renderer.rules.link_open=this.#t}#n(){this.processor&&this.processor.disable(r.M)}#r(){this.#n()}#l(){this.#t=this.processor.renderer.rules.link_open||((t,e,o,i,s)=>s.renderToken(t,e,o)),this.#e=this.processor.renderer.rules.em_open||((t,e,o,i,s)=>s.renderToken(t,e,o))}#o(){this.processor=new i.A("commonmark",{html:!0}),this.#l(),this.#r(),this.#s(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#i(){if(!this.processor)return;let t=(0,h.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch(t){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,n.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,d.xE)("link")}),(0,s.RF)({componentNameOverride:(0,d.xE)("text")}),s.VO,s.tQ)(c)},36976(t,e,o){o.d(e,{M:()=>i});const i=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,o){o.d(e,{G:()=>i});const i=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,o){o.r(e),o.d(e,{EnrichedTextClass:()=>i.m,componentName:()=>i.T}),o(74778);var i=o(76231);customElements.define(i.T,i.m)},74778(t,e,o){o.r(e),o.d(e,{LinkClass:()=>g,componentName:()=>h});var i=o(88961),s=o(63200),n=o(25964),r=o(72270),l=o(66434);const h=(0,n.xE)("link");class d extends((0,r.qu)({componentName:h,baseSelector:":host a"})){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,n.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),(0,n.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,n.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const a={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:c,text:p,host:u,wrapper:m,link:y}=a,g=(0,s.Zz)((0,i.RF)({mappings:{hostWidth:{...u,property:"width"},hostDirection:{...p,property:"direction"},textAlign:m,textDecoration:{...y,property:"text-decoration",fallback:"none"},textColor:[{...c,property:"color"},{...p,property:l.s.cssVarList.textColor}],cursor:c}}),i.VO,i.tQ)(d);o(63595),customElements.define(h,g)},66434(t,e,o){o.d(e,{T:()=>l,s:()=>a});var i=o(88961),s=o(63200),n=o(25964),r=o(72270);const l=(0,n.xE)("text");class h extends((0,r.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,n.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,n.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:d}={host:{selector:()=>":host"}},a=(0,s.Zz)((0,i.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),i.VO,i.tQ)(h)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>i.s,componentName:()=>i.T});var i=o(66434);customElements.define(i.T,i.s)},38516(t,e,o){o.r(e),o.d(e,{TooltipClass:()=>u,componentName:()=>h}),o(55838),o(17017),o(76720);var i=o(88961),s=o(63200),n=o(25964),r=o(72270),l=o(76231);const h=(0,n.xE)("tooltip"),d=["text","position","hide-delay","hover-delay","opened"],a=(0,r.qu)({componentName:h,baseSelector:"vaadin-tooltip"}),{overlay:c,content:p}={overlay:{selector:()=>"vaadin-tooltip-overlay::part(overlay)"},content:{selector:()=>"vaadin-tooltip-overlay::part(content)"}},u=(0,s.Zz)(i.tQ,(0,i.mA)({selector:"",mappings:{fontFamily:{...p,property:l.m.cssVarList.fontFamilyOverride},fontSize:{...p,property:l.m.cssVarList.fontSizeOverride},fontWeight:{...p,property:l.m.cssVarList.fontWeightOverride},textColor:{...p,property:l.m.cssVarList.textColorOverride},hostDirection:{...p,property:l.m.cssVarList.hostDirectionOverride},backgroundColor:[{...c},{...p}],borderColor:{...c},borderStyle:{...c},borderWidth:{...c},borderRadius:{...c},boxShadow:{...c},horizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],verticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}]},forward:{attributes:["style"],include:!1}}))(class extends a{static get observedAttributes(){return d.concat(a.observedAttributes||[])}get isOpened(){return"true"===this.getAttribute("opened")}get overlay(){return this.tooltip?._overlayElement}get overlayContentNode(){return this.overlay?.shadowRoot.querySelector('[part="content"]')}get tooltipText(){return this.getAttribute("text")?.trim()||""}get isStaticDisplay(){return"true"===this.getAttribute("static-display")}#h(){this.isStaticDisplay?(this.#d(),this.setAttribute("inert","true")):(this.#a(),this.removeAttribute("inert"))}init(){super.init(),this.style.display="contents",this.insertAdjacentHTML("beforeend","<vaadin-tooltip></vaadin-tooltip>"),this.tooltip=this.querySelector("vaadin-tooltip"),this.#a(),this.#c(),setTimeout(()=>this.#p())}#a(){this.tooltip.style.width="0",this.tooltip.style.height="0",this.tooltip.style.display="block",this.tooltip.style.overflow="hidden",this.tooltip.style.position="absolute"}#d(){this.tooltip.style.width="100%",this.tooltip.style.height="100%",this.tooltip.style.position="static",this.tooltip.style.overflow="visible",this.tooltip.textContent="",this.overlay.style.display="block",this.overlay.style.position="static"}#p(){this.#u(),this.#m(),(0,n.EA)(this,this.tooltip,{includeAttrs:["position","opened"]}),this.#y()}#c(){if(!this.children?.length)return;let t=Array.from(this.children).find(t=>t!==this.tooltip);t&&(this.tooltip.target=t)}#g(){this.overlayContentNode.innerHTML=""}#b(){const t=document.createElement("descope-enriched-text");return t.setAttribute("link-target-blank","true"),t.textContent=this.tooltipText,t}get srLabel(){return this.tooltip?.querySelector('[slot="sr-label"]')}#u(){this.overlayContentNode&&setTimeout(()=>{this.#g(),this.textComponent=this.#b(),this.overlayContentNode.appendChild(this.textComponent),this.srLabel&&!this.tooltipText&&this.srLabel.setAttribute("aria-hidden","true"),(0,n.EA)(this,this.textComponent,{includeAttrs:["readonly"]})})}#m(){this.overlay&&(this.isOpened?setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.#h()}):(this.overlay._detachOverlay=()=>{},this.overlay._attachOverlay=()=>this.tooltip.shadowRoot.appendChild(this.overlay)))}#y(){this.tooltip?.toggleAttribute("manual",this.isOpened)}#v(t){if(!this.textComponent)return;const e=(t??"").trim();this.textComponent.textContent=e,this.srLabel&&(e?this.srLabel.removeAttribute("aria-hidden"):this.srLabel.setAttribute("aria-hidden","true"))}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),e!==o&&("text"===t&&this.#v(o),"opened"===t&&this.#y())}});customElements.define(h,u)},1508(t,e,o){function i(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function s(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach(t=>e.push(...s(t))),e}function n(t,e){return e?e.closest(t)||n(t,e.getRootNode().host):null}function r(t){return t?new Set(t.split(" ")):new Set}function l(t){return t?[...t].join(" "):""}function h(t,e,o){const i=r(t.getAttribute(e));i.add(o),t.setAttribute(e,l(i))}function d(t,e,o){const i=r(t.getAttribute(e));i.delete(o),0!==i.size?t.setAttribute(e,l(i)):t.removeAttribute(e)}function a(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{Dy:()=>i,J$:()=>s,Wr:()=>d,Z4:()=>r,ZA:()=>a,el:()=>n,iA:()=>h,sz:()=>l})},44099(t,e,o){o.d(e,{r:()=>r});var i=o(1508),s=o(65641),n=o(11707);class r extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,n.I)()}`}constructor(t,e,o,i={}){super();const{initializer:s,multiple:n,observe:r,useUniqueId:l}=i;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof n&&n,this.slotInitializer=s,n&&(this.nodes=[]),l&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let i=this.defaultNode;return!i&&o&&(i=document.createElement(o),i instanceof Element&&(""!==e&&i.setAttribute("slot",e),this.defaultNode=i)),i&&(this.node=i,t.appendChild(i)),i}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t)}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new s.P(o,({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],s=t.filter(t=>!(0,i.ZA)(t)&&!o.includes(t));e.length&&(this.nodes=o.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),s&&s.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...s].filter(t=>t!==this.defaultNode),s.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))})}}},65641(t,e,o){o.d(e,{P:()=>i});class i{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],i=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,s)=>{const n=t.indexOf(e);-1===n?o.push(e):n!==s&&i.push(e)}),(e.length||o.length||i.length)&&this.callback({addedNodes:e,movedNodes:i,removedNodes:o}),this._storedNodes=t}}},11707(t,e,o){o.d(e,{I:()=>s});let i=0;function s(){return i++}}}]);
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[628,2294,4159,9261],{76231(t,e,o){o.d(e,{T:()=>a,m:()=>p});var i=o(92540),s=o(88961),n=o(63200),r=o(36976),l=o(72270),h=o(54847),d=o(25964);const a=(0,d.xE)("enriched-text");class c extends((0,l.qu)({componentName:a,baseSelector:":host > div"})){#t;#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,d.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.#o(),(0,d.Ge)(this,this.#i.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),o!==e&&("readonly"===t&&this.onReadOnlyChange("true"===o),"link-target-blank"===t&&this.#o())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,o,i,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,o,i,s)),this.processor.renderer.rules.em_close=(t,e,o,i,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,o,i,s))}#s(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,o,i,s)=>(t[e].attrSet("target","_blank"),this.#t(t,e,o,i,s)):this.processor.renderer.rules.link_open=this.#t}#n(){this.processor&&this.processor.disable(r.M)}#r(){this.#n()}#l(){this.#t=this.processor.renderer.rules.link_open||((t,e,o,i,s)=>s.renderToken(t,e,o)),this.#e=this.processor.renderer.rules.em_open||((t,e,o,i,s)=>s.renderToken(t,e,o))}#o(){this.processor=new i.A("commonmark",{html:!0}),this.#l(),this.#r(),this.#s(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#i(){if(!this.processor)return;let t=(0,h.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch(t){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,n.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,d.xE)("link")}),(0,s.RF)({componentNameOverride:(0,d.xE)("text")}),s.VO,s.tQ)(c)},36976(t,e,o){o.d(e,{M:()=>i});const i=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,o){o.d(e,{G:()=>i});const i=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,o){o.r(e),o.d(e,{EnrichedTextClass:()=>i.m,componentName:()=>i.T}),o(74778);var i=o(76231);customElements.define(i.T,i.m)},74778(t,e,o){o.r(e),o.d(e,{LinkClass:()=>b,componentName:()=>h});var i=o(88961),s=o(63200),n=o(25964),r=o(72270),l=o(66434);const h=(0,n.xE)("link"),d=["href","readonly"];class a extends((0,r.qu)({componentName:h,baseSelector:":host a"})){static get observedAttributes(){return d.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,n.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,n.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,n.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:p,text:u,host:m,wrapper:y,link:g}=c,b=(0,s.Zz)((0,i.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:y,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:l.s.cssVarList.textColor}],cursor:p}}),i.VO,i.tQ)(a);o(63595),customElements.define(h,b)},66434(t,e,o){o.d(e,{T:()=>l,s:()=>a});var i=o(88961),s=o(63200),n=o(25964),r=o(72270);const l=(0,n.xE)("text");class h extends((0,r.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,n.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,n.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:d}={host:{selector:()=>":host"}},a=(0,s.Zz)((0,i.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),i.VO,i.tQ)(h)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>i.s,componentName:()=>i.T});var i=o(66434);customElements.define(i.T,i.s)},38516(t,e,o){o.r(e),o.d(e,{TooltipClass:()=>u,componentName:()=>h}),o(55838),o(17017),o(76720);var i=o(88961),s=o(63200),n=o(25964),r=o(72270),l=o(76231);const h=(0,n.xE)("tooltip"),d=["text","position","hide-delay","hover-delay","opened"],a=(0,r.qu)({componentName:h,baseSelector:"vaadin-tooltip"}),{overlay:c,content:p}={overlay:{selector:()=>"vaadin-tooltip-overlay::part(overlay)"},content:{selector:()=>"vaadin-tooltip-overlay::part(content)"}},u=(0,s.Zz)(i.tQ,(0,i.mA)({selector:"",mappings:{fontFamily:{...p,property:l.m.cssVarList.fontFamilyOverride},fontSize:{...p,property:l.m.cssVarList.fontSizeOverride},fontWeight:{...p,property:l.m.cssVarList.fontWeightOverride},textColor:{...p,property:l.m.cssVarList.textColorOverride},hostDirection:{...p,property:l.m.cssVarList.hostDirectionOverride},backgroundColor:[{...c},{...p}],borderColor:{...c},borderStyle:{...c},borderWidth:{...c},borderRadius:{...c},boxShadow:{...c},horizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],verticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}]},forward:{attributes:["style"],include:!1}}))(class extends a{static get observedAttributes(){return d.concat(a.observedAttributes||[])}get isOpened(){return"true"===this.getAttribute("opened")}get overlay(){return this.tooltip?._overlayElement}get overlayContentNode(){return this.overlay?.shadowRoot.querySelector('[part="content"]')}get tooltipText(){return this.getAttribute("text")?.trim()||""}get isStaticDisplay(){return"true"===this.getAttribute("static-display")}#h(){this.isStaticDisplay?(this.#d(),this.setAttribute("inert","true")):(this.#a(),this.removeAttribute("inert"))}init(){super.init(),this.style.display="contents",this.insertAdjacentHTML("beforeend","<vaadin-tooltip></vaadin-tooltip>"),this.tooltip=this.querySelector("vaadin-tooltip"),this.#a(),this.#c(),setTimeout(()=>this.#p())}#a(){this.tooltip.style.width="0",this.tooltip.style.height="0",this.tooltip.style.display="block",this.tooltip.style.overflow="hidden",this.tooltip.style.position="absolute"}#d(){this.tooltip.style.width="100%",this.tooltip.style.height="100%",this.tooltip.style.position="static",this.tooltip.style.overflow="visible",this.tooltip.textContent="",this.overlay.style.display="block",this.overlay.style.position="static"}#p(){this.#u(),this.#m(),(0,n.EA)(this,this.tooltip,{includeAttrs:["position","opened"]}),this.#y()}#c(){if(!this.children?.length)return;let t=Array.from(this.children).find(t=>t!==this.tooltip);t&&(this.tooltip.target=t)}#g(){this.overlayContentNode.innerHTML=""}#b(){const t=document.createElement("descope-enriched-text");return t.setAttribute("link-target-blank","true"),t.textContent=this.tooltipText,t}get srLabel(){return this.tooltip?.querySelector('[slot="sr-label"]')}#u(){this.overlayContentNode&&setTimeout(()=>{this.#g(),this.textComponent=this.#b(),this.overlayContentNode.appendChild(this.textComponent),this.srLabel&&!this.tooltipText&&this.srLabel.setAttribute("aria-hidden","true"),(0,n.EA)(this,this.textComponent,{includeAttrs:["readonly"]})})}#m(){this.overlay&&(this.isOpened?setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.#h()}):(this.overlay._detachOverlay=()=>{},this.overlay._attachOverlay=()=>this.tooltip.shadowRoot.appendChild(this.overlay)))}#y(){this.tooltip?.toggleAttribute("manual",this.isOpened)}#v(t){if(!this.textComponent)return;const e=(t??"").trim();this.textComponent.textContent=e,this.srLabel&&(e?this.srLabel.removeAttribute("aria-hidden"):this.srLabel.setAttribute("aria-hidden","true"))}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),e!==o&&("text"===t&&this.#v(o),"opened"===t&&this.#y())}});customElements.define(h,u)},1508(t,e,o){function i(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function s(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach(t=>e.push(...s(t))),e}function n(t,e){return e?e.closest(t)||n(t,e.getRootNode().host):null}function r(t){return t?new Set(t.split(" ")):new Set}function l(t){return t?[...t].join(" "):""}function h(t,e,o){const i=r(t.getAttribute(e));i.add(o),t.setAttribute(e,l(i))}function d(t,e,o){const i=r(t.getAttribute(e));i.delete(o),0!==i.size?t.setAttribute(e,l(i)):t.removeAttribute(e)}function a(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{Dy:()=>i,J$:()=>s,Wr:()=>d,Z4:()=>r,ZA:()=>a,el:()=>n,iA:()=>h,sz:()=>l})},44099(t,e,o){o.d(e,{r:()=>r});var i=o(1508),s=o(65641),n=o(11707);class r extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,n.I)()}`}constructor(t,e,o,i={}){super();const{initializer:s,multiple:n,observe:r,useUniqueId:l}=i;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof n&&n,this.slotInitializer=s,n&&(this.nodes=[]),l&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let i=this.defaultNode;return!i&&o&&(i=document.createElement(o),i instanceof Element&&(""!==e&&i.setAttribute("slot",e),this.defaultNode=i)),i&&(this.node=i,t.appendChild(i)),i}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t)}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new s.P(o,({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],s=t.filter(t=>!(0,i.ZA)(t)&&!o.includes(t));e.length&&(this.nodes=o.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),s&&s.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...s].filter(t=>t!==this.defaultNode),s.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))})}}},65641(t,e,o){o.d(e,{P:()=>i});class i{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],i=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,s)=>{const n=t.indexOf(e);-1===n?o.push(e):n!==s&&i.push(e)}),(e.length||o.length||i.length)&&this.callback({addedNodes:e,movedNodes:i,removedNodes:o}),this._storedNodes=t}}},11707(t,e,o){o.d(e,{I:()=>s});let i=0;function s(){return i++}}}]);
3
3
  //# sourceMappingURL=descope-tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-tooltip.js","mappings":";8PAUO,MAA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Q,CAACb,EAAMwF,KAC/B,MAAM/N,EAAM2N,EAAaK,QAAQzF,IACpB,IAATvI,EACFyM,EAAa7D,KAAKL,GACTvI,IAAQ+N,GACjBD,EAAWlF,KAAKL,MAKlBiE,EAAWzH,QAAU0H,EAAa1H,QAAU+I,EAAW/I,SACzDtG,KAAKsO,SAAS,CAAEP,aAAYsB,aAAYrB,iBAG1ChO,KAAKuO,aAAeW,CACtB,E,gCCjGF,IAAIM,EAAW,EAgBR,SAASC,IAEd,OAAOD,GACT,C","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","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/TooltipClass.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/dom-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-observer.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/unique-id-utils.js"],"sourcesContent":["/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n\n // 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\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n 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: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n","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} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text 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 forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n componentNameValidationMixin,\n portalMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\n\nexport const componentName = getComponentName('tooltip');\n\nconst tooltipAttrs = [\n 'text',\n 'position',\n 'hide-delay',\n 'hover-delay',\n 'opened',\n];\n\nconst BaseClass = createBaseClass({\n componentName,\n baseSelector: 'vaadin-tooltip',\n});\n\nclass RawTooltip extends BaseClass {\n static get observedAttributes() {\n return tooltipAttrs.concat(BaseClass.observedAttributes || []);\n }\n\n get isOpened() {\n return this.getAttribute('opened') === 'true';\n }\n\n get overlay() {\n return this.tooltip?._overlayElement;\n }\n\n get overlayContentNode() {\n return this.overlay?.shadowRoot.querySelector('[part=\"content\"]');\n }\n\n get tooltipText() {\n return this.getAttribute('text')?.trim() || '';\n }\n\n get isStaticDisplay() {\n return this.getAttribute('static-display') === 'true';\n }\n\n // We use `static-display` for presentation purposes, to show the tooltip content.\n // This should be used only when `opened` is `true`. Once `static-display` is set,\n // the overlay would become a `static` element, and will have layout in the presenting page.\n // This is mainly aimed to solve the presentation problem on our Styles Page in the Console.\n #handleStaticDisplay() {\n if (this.isStaticDisplay) {\n this.#revealWrappedParts();\n this.setAttribute('inert', 'true');\n } else {\n this.#hideWrappedParts();\n this.removeAttribute('inert');\n }\n }\n\n init() {\n super.init();\n\n // Create the vaadin-tooltip here instead of constructor (for React compatibility)\n this.style.display = 'contents';\n this.insertAdjacentHTML('beforeend', '<vaadin-tooltip></vaadin-tooltip>');\n this.tooltip = this.querySelector('vaadin-tooltip');\n\n this.#hideWrappedParts();\n\n this.#setTooltipTarget();\n\n setTimeout(() => this.#onOverlayReady());\n }\n\n #hideWrappedParts() {\n this.tooltip.style.width = '0';\n this.tooltip.style.height = '0';\n this.tooltip.style.display = 'block';\n this.tooltip.style.overflow = 'hidden';\n this.tooltip.style.position = 'absolute';\n }\n\n #revealWrappedParts() {\n this.tooltip.style.width = '100%';\n this.tooltip.style.height = '100%';\n this.tooltip.style.position = 'static';\n this.tooltip.style.overflow = 'visible';\n this.tooltip.textContent = '';\n this.overlay.style.display = 'block';\n this.overlay.style.position = 'static';\n }\n\n #onOverlayReady() {\n this.#initTooltipTextComponent();\n this.#overrideAttachOverlay();\n\n forwardAttrs(this, this.tooltip, {\n includeAttrs: ['position', 'opened'],\n });\n\n this.#handleTooltipVisibility();\n }\n\n #setTooltipTarget() {\n if (!this.children?.length) return;\n\n let ele = Array.from(this.children).find((child) => child !== this.tooltip);\n\n if (!ele) return;\n\n this.tooltip.target = ele;\n }\n\n #clearOverlayContentNode() {\n this.overlayContentNode.innerHTML = '';\n }\n\n #createEnrichedTextComponent() {\n const enrichedText = document.createElement('descope-enriched-text');\n\n enrichedText.setAttribute('link-target-blank', 'true');\n enrichedText.textContent = this.tooltipText;\n\n return enrichedText;\n }\n\n get srLabel() {\n return this.tooltip?.querySelector('[slot=\"sr-label\"]');\n }\n\n #initTooltipTextComponent() {\n if (!this.overlayContentNode) return;\n\n setTimeout(() => {\n this.#clearOverlayContentNode();\n\n this.textComponent = this.#createEnrichedTextComponent();\n\n this.overlayContentNode.appendChild(this.textComponent);\n\n // An empty sr-label with role=\"tooltip\" fails accessibility checks.\n // Hide it when there's no tooltip text; vaadin handles populating it when text is present.\n if (this.srLabel && !this.tooltipText) {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['readonly'],\n });\n });\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideAttachOverlay() {\n if (!this.overlay) return;\n\n if (this.isOpened) {\n // When `opened` attr is used, vaadin doesn't execute `_attachOverlay`,\n // and the overlay element is rendered outside the component, on the top\n // level. We need to move it back to the local component's DOM.\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.#handleStaticDisplay();\n });\n } else {\n this.overlay._detachOverlay = () => {};\n\n this.overlay._attachOverlay = () =>\n this.tooltip.shadowRoot.appendChild(this.overlay);\n }\n }\n\n #handleTooltipVisibility() {\n // This is Vaadin's API for manual control of tooltip visibility\n this.tooltip?.toggleAttribute('manual', this.isOpened);\n }\n\n #updateText(value) {\n if (!this.textComponent) return;\n const trimmedValue = (value ?? '').trim();\n this.textComponent.textContent = trimmedValue;\n if (this.srLabel) {\n if (trimmedValue) {\n this.srLabel.removeAttribute('aria-hidden');\n } else {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'text') {\n this.#updateText(newValue);\n }\n\n if (attrName === 'opened') {\n this.#handleTooltipVisibility();\n }\n }\n }\n}\n\nconst { overlay, content } = {\n overlay: { selector: () => 'vaadin-tooltip-overlay::part(overlay)' },\n content: { selector: () => 'vaadin-tooltip-overlay::part(content)' },\n};\n\n/**\n * This component has no Shadow DOM of its own, so we can't add styles to it\n * (otherwise it would affect the rest of the DOM).\n * Note that all styles are within PortalMixin.\n */\nexport const TooltipClass = compose(\n componentNameValidationMixin,\n portalMixin({\n selector: '',\n mappings: {\n fontFamily: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontFamilyOverride,\n },\n fontSize: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontSizeOverride,\n },\n fontWeight: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontWeightOverride,\n },\n textColor: {\n ...content,\n property: EnrichedTextClass.cssVarList.textColorOverride,\n },\n hostDirection: {\n ...content,\n property: EnrichedTextClass.cssVarList.hostDirectionOverride,\n },\n backgroundColor: [{ ...overlay }, { ...content }],\n borderColor: { ...overlay },\n borderStyle: { ...overlay },\n borderWidth: { ...overlay },\n borderRadius: { ...overlay },\n boxShadow: { ...overlay },\n horizontalPadding: [\n { ...content, property: 'padding-left' },\n { ...content, property: 'padding-right' },\n ],\n verticalPadding: [\n { ...content, property: 'padding-top' },\n { ...content, property: 'padding-bottom' },\n ],\n },\n forward: {\n attributes: ['style'],\n include: false,\n },\n }),\n)(RawTooltip);\n","import '@descope-ui/descope-enriched-text';\nimport '@vaadin/tooltip';\nimport { componentName, TooltipClass } from './TooltipClass';\n\ncustomElements.define(componentName, TooltipClass);\n\nexport { TooltipClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns an array of ancestor root nodes for the given node.\n *\n * A root node is either a document node or a document fragment node (Shadow Root).\n * The array is collected by a bottom-up DOM traversing that starts with the given node\n * and involves both the light DOM and ancestor shadow DOM trees.\n *\n * @param {Node} node\n * @return {Node[]}\n */\nexport function getAncestorRootNodes(node) {\n const result = [];\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n result.push(node);\n break;\n }\n\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result.push(node);\n node = node.host;\n continue;\n }\n\n if (node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n\n node = node.parentNode;\n }\n\n return result;\n}\n\n/**\n * Returns the list of flattened elements for the given `node`.\n * This list consists of a node's children and, for any children that are\n * `<slot>` elements, the expanded flattened list of `assignedElements`.\n *\n * @param {Node} node\n * @return {Element[]}\n */\nexport function getFlattenedElements(node) {\n const result = [];\n let elements;\n if (node.localName === 'slot') {\n elements = node.assignedElements();\n } else {\n result.push(node);\n elements = [...node.children];\n }\n elements.forEach((elem) => result.push(...getFlattenedElements(elem)));\n return result;\n}\n\n/**\n * Traverses the given node and its parents, including those that are across\n * the shadow root boundaries, until it finds a node that matches the selector.\n *\n * @param {string} selector The CSS selector to match against\n * @param {Node} node The starting node for the traversal\n * @return {Node | null} The closest matching element, or null if no match is found\n */\nexport function getClosestElement(selector, node) {\n if (!node) {\n return null;\n }\n\n return node.closest(selector) || getClosestElement(selector, node.getRootNode().host);\n}\n\n/**\n * Takes a string with values separated by space and returns a set the values\n *\n * @param {string} value\n * @return {Set<string>}\n */\nexport function deserializeAttributeValue(value) {\n if (!value) {\n return new Set();\n }\n\n return new Set(value.split(' '));\n}\n\n/**\n * Takes a set of string values and returns a string with values separated by space\n *\n * @param {Set<string>} values\n * @return {string}\n */\nexport function serializeAttributeValue(values) {\n return values ? [...values].join(' ') : '';\n}\n\n/**\n * Adds a value to an attribute containing space-delimited values.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function addValueToAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.add(value);\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Removes a value from an attribute containing space-delimited values.\n * If the value is the last one, the whole attribute is removed.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function removeValueFromAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.delete(value);\n if (values.size === 0) {\n element.removeAttribute(attr);\n return;\n }\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Returns true if the given node is an empty text node, false otherwise.\n *\n * @param {Node} node\n * @return {boolean}\n */\nexport function isEmptyTextNode(node) {\n return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '';\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { isEmptyTextNode } from './dom-utils.js';\nimport { SlotObserver } from './slot-observer.js';\nimport { generateUniqueId } from './unique-id-utils.js';\n\n/**\n * A controller for providing content to slot element and observing changes.\n */\nexport class SlotController extends EventTarget {\n /**\n * Ensure that every instance has unique ID.\n *\n * @param {HTMLElement} host\n * @param {string} slotName\n * @return {string}\n * @protected\n */\n static generateId(host, slotName) {\n const prefix = slotName || 'default';\n return `${prefix}-${host.localName}-${generateUniqueId()}`;\n }\n\n constructor(host, slotName, tagName, config = {}) {\n super();\n\n const { initializer, multiple, observe, useUniqueId } = config;\n\n this.host = host;\n this.slotName = slotName;\n this.tagName = tagName;\n this.observe = typeof observe === 'boolean' ? observe : true;\n this.multiple = typeof multiple === 'boolean' ? multiple : false;\n this.slotInitializer = initializer;\n\n if (multiple) {\n this.nodes = [];\n }\n\n // Only generate the default ID if requested by the controller.\n if (useUniqueId) {\n this.defaultId = this.constructor.generateId(host, slotName);\n }\n }\n\n hostConnected() {\n if (!this.initialized) {\n if (this.multiple) {\n this.initMultiple();\n } else {\n this.initSingle();\n }\n\n if (this.observe) {\n this.observeSlot();\n }\n\n this.initialized = true;\n }\n }\n\n /** @protected */\n initSingle() {\n let node = this.getSlotChild();\n\n if (!node) {\n node = this.attachDefaultNode();\n this.initNode(node);\n } else {\n this.node = node;\n this.initAddedNode(node);\n }\n }\n\n /** @protected */\n initMultiple() {\n const children = this.getSlotChildren();\n\n if (children.length === 0) {\n const defaultNode = this.attachDefaultNode();\n if (defaultNode) {\n this.nodes = [defaultNode];\n this.initNode(defaultNode);\n }\n } else {\n this.nodes = children;\n children.forEach((node) => {\n this.initAddedNode(node);\n });\n }\n }\n\n /**\n * Create and attach default node using the provided tag name, if any.\n * @return {Node | undefined}\n * @protected\n */\n attachDefaultNode() {\n const { host, slotName, tagName } = this;\n\n // Check if the node was created previously and if so, reuse it.\n let node = this.defaultNode;\n\n // Tag name is optional, sometimes we don't init default content.\n if (!node && tagName) {\n node = document.createElement(tagName);\n if (node instanceof Element) {\n if (slotName !== '') {\n node.setAttribute('slot', slotName);\n }\n this.defaultNode = node;\n }\n }\n\n if (node) {\n this.node = node;\n host.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * Return the list of nodes matching the slot managed by the controller.\n * @return {Node}\n */\n getSlotChildren() {\n const { slotName } = this;\n return Array.from(this.host.childNodes).filter((node) => {\n // Either an element (any slot) or a text node (only un-named slot).\n return (\n (node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) ||\n (node.nodeType === Node.TEXT_NODE && node.textContent.trim() && slotName === '')\n );\n });\n }\n\n /**\n * Return a reference to the node managed by the controller.\n * @return {Node}\n */\n getSlotChild() {\n return this.getSlotChildren()[0];\n }\n\n /**\n * Run `slotInitializer` for the node managed by the controller.\n *\n * @param {Node} node\n * @protected\n */\n initNode(node) {\n const { slotInitializer } = this;\n // Don't try to bind `this` to initializer (normally it's arrow function).\n // Instead, pass the host as a first argument to access component's state.\n if (slotInitializer) {\n slotInitializer(node, this.host);\n }\n }\n\n /**\n * Override to initialize the newly added custom node.\n *\n * @param {Node} _node\n * @protected\n */\n initCustomNode(_node) {}\n\n /**\n * Override to teardown slotted node when it's removed.\n *\n * @param {Node} _node\n * @protected\n */\n teardownNode(_node) {}\n\n /**\n * Run both `initCustomNode` and `initNode` for a custom slotted node.\n *\n * @param {Node} node\n * @protected\n */\n initAddedNode(node) {\n if (node !== this.defaultNode) {\n this.initCustomNode(node);\n this.initNode(node);\n }\n }\n\n /**\n * Setup the observer to manage slot content changes.\n * @protected\n */\n observeSlot() {\n const { slotName } = this;\n const selector = slotName === '' ? 'slot:not([name])' : `slot[name=${slotName}]`;\n const slot = this.host.shadowRoot.querySelector(selector);\n\n this.__slotObserver = new SlotObserver(slot, ({ addedNodes, removedNodes }) => {\n const current = this.multiple ? this.nodes : [this.node];\n\n // Calling `slot.assignedNodes()` includes whitespace text nodes in case of default slot:\n // unlike comment nodes, they are not filtered out. So we need to manually ignore them.\n const newNodes = addedNodes.filter((node) => !isEmptyTextNode(node) && !current.includes(node));\n\n if (removedNodes.length) {\n this.nodes = current.filter((node) => !removedNodes.includes(node));\n\n removedNodes.forEach((node) => {\n this.teardownNode(node);\n });\n }\n\n if (newNodes && newNodes.length > 0) {\n if (this.multiple) {\n // Remove default node if exists\n if (this.defaultNode) {\n this.defaultNode.remove();\n }\n this.nodes = [...current, ...newNodes].filter((node) => node !== this.defaultNode);\n newNodes.forEach((node) => {\n this.initAddedNode(node);\n });\n } else {\n // Remove previous node if exists\n if (this.node) {\n this.node.remove();\n }\n this.node = newNodes[0];\n this.initAddedNode(this.node);\n }\n }\n });\n }\n}\n","/**\n * @license\n * Copyright (c) 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A helper for observing slot changes.\n */\nexport class SlotObserver {\n constructor(slot, callback) {\n /** @type HTMLSlotElement */\n this.slot = slot;\n\n /** @type Function */\n this.callback = callback;\n\n /** @type {Node[]} */\n this._storedNodes = [];\n\n this._connected = false;\n this._scheduled = false;\n\n this._boundSchedule = () => {\n this._schedule();\n };\n\n this.connect();\n this._schedule();\n }\n\n /**\n * Activates an observer. This method is automatically called when\n * a `SlotObserver` is created. It should only be called to re-activate\n * an observer that has been deactivated via the `disconnect` method.\n */\n connect() {\n this.slot.addEventListener('slotchange', this._boundSchedule);\n this._connected = true;\n }\n\n /**\n * Deactivates the observer. After calling this method the observer callback\n * will not be called when changes to slotted nodes occur. The `connect` method\n * may be subsequently called to reactivate the observer.\n */\n disconnect() {\n this.slot.removeEventListener('slotchange', this._boundSchedule);\n this._connected = false;\n }\n\n /** @private */\n _schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n\n queueMicrotask(() => {\n this.flush();\n });\n }\n }\n\n /**\n * Run the observer callback synchronously.\n */\n flush() {\n if (!this._connected) {\n return;\n }\n\n this._scheduled = false;\n\n this._processNodes();\n }\n\n /** @private */\n _processNodes() {\n const currentNodes = this.slot.assignedNodes({ flatten: true });\n\n let addedNodes = [];\n const removedNodes = [];\n const movedNodes = [];\n\n if (currentNodes.length) {\n addedNodes = currentNodes.filter((node) => !this._storedNodes.includes(node));\n }\n\n if (this._storedNodes.length) {\n this._storedNodes.forEach((node, index) => {\n const idx = currentNodes.indexOf(node);\n if (idx === -1) {\n removedNodes.push(node);\n } else if (idx !== index) {\n movedNodes.push(node);\n }\n });\n }\n\n if (addedNodes.length || removedNodes.length || movedNodes.length) {\n this.callback({ addedNodes, movedNodes, removedNodes });\n }\n\n this._storedNodes = currentNodes;\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nlet uniqueId = 0;\n\n/**\n * Resets the unique id counter.\n *\n * @return {void}\n */\nexport function resetUniqueId() {\n uniqueId = 0;\n}\n\n/**\n * Returns a unique integer id.\n *\n * @return {number}\n */\nexport function generateUniqueId() {\n // eslint-disable-next-line no-plusplus\n return uniqueId++;\n}\n"],"names":["componentName","EnrichedText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","html","getAttribute","shadowRoot","querySelector","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","disableRules","decodeHTML","textArea","document","createElement","value","customElements","define","RawLink","includeAttrs","mapAttrs","tooltip","selectors","host","link","anchor","wrapper","text","TextClass","LinkClass","textDecoration","cssVarList","cursor","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","tooltipAttrs","BaseClass","overlay","content","TooltipClass","fontFamilyOverride","fontSizeOverride","fontWeightOverride","textColorOverride","hostDirectionOverride","backgroundColor","borderRadius","boxShadow","horizontalPadding","verticalPadding","forward","attributes","include","concat","isOpened","_overlayElement","overlayContentNode","tooltipText","isStaticDisplay","insertAdjacentHTML","setTimeout","width","height","overflow","position","textContent","children","ele","Array","from","find","child","enrichedText","srLabel","textComponent","appendChild","_detachOverlay","_attachOverlay","toggleAttribute","trimmedValue","getAncestorRootNodes","node","result","nodeType","Node","DOCUMENT_NODE","push","DOCUMENT_FRAGMENT_NODE","assignedSlot","parentNode","getFlattenedElements","elements","localName","assignedElements","forEach","elem","getClosestElement","closest","getRootNode","deserializeAttributeValue","Set","split","serializeAttributeValue","values","join","addValueToAttribute","element","attr","add","removeValueFromAttribute","delete","size","isEmptyTextNode","TEXT_NODE","SlotController","EventTarget","generateId","slotName","tagName","config","initializer","multiple","observe","useUniqueId","slotInitializer","nodes","defaultId","hostConnected","initialized","initMultiple","initSingle","observeSlot","getSlotChild","initAddedNode","attachDefaultNode","initNode","getSlotChildren","defaultNode","Element","filter","ELEMENT_NODE","slot","initCustomNode","_node","teardownNode","__slotObserver","addedNodes","removedNodes","current","newNodes","includes","remove","SlotObserver","callback","_storedNodes","_connected","_scheduled","_boundSchedule","_schedule","connect","disconnect","removeEventListener","queueMicrotask","flush","_processNodes","currentNodes","assignedNodes","flatten","movedNodes","index","indexOf","uniqueId","generateUniqueId"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-tooltip.js","mappings":";8PAUO,MAAMA,GAAgB,QAAiB,iBAE9C,MAAMC,WAAqB,QAAgB,CAAED,gBAAeE,aAAc,iBACxE,GAEA,GAEA,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,2CAIhD,QACE,6iBAkCAH,MAGFA,MAAK,KAEL,QAAgBA,KAAMA,MAAK,EAAeI,KAAKJ,OAG/CA,KAAKK,aAAaC,iBAAiB,QAAUC,IACvCA,EAAEC,kBAAkBC,mBACtBF,EAAEG,mBAGR,CAEA,6BAAWC,GACT,MAAO,CAAC,WAAY,oBACtB,CAEA,wBAAAC,CAAyBC,EAAUC,EAAUC,GAC3ChB,MAAMa,2BAA2BC,EAAUC,EAAUC,GAEjDA,IAAaD,IACE,aAAbD,GACFb,KAAKgB,iBAA8B,SAAbD,GAGP,sBAAbF,GACFb,MAAK,IAGX,CAGA,uBAAAiB,GACEjB,KAAKkB,UAAUC,SAASC,MAAMC,QAAU,CAACC,EAAQC,EAAKC,EAASC,EAAKC,KACvC,MAAvBJ,EAAOC,GAAKI,SAAgBL,EAAOC,GAAKK,IAAM,KAC3C5B,MAAK,EAAgBsB,EAAQC,EAAKC,EAASC,EAAKC,IAEzD1B,KAAKkB,UAAUC,SAASC,MAAMS,SAAW,CAACP,EAAQC,EAAKC,EAASC,EAAKC,KACxC,MAAvBJ,EAAOC,GAAKI,SAAgBL,EAAOC,GAAKK,IAAM,KAC3C5B,MAAK,EAAgBsB,EAAQC,EAAKC,EAASC,EAAKC,GAE3D,CAEA,KACM1B,KAAK8B,gBACP9B,KAAKkB,UAAUC,SA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,UAAAK,GACEhP,KAAK6N,KAAKoB,oBAAoB,aAAcjP,KAAK6O,gBACjD7O,KAAK2O,YAAa,CACpB,CAGA,SAAAG,GACO9O,KAAK4O,aACR5O,KAAK4O,YAAa,EAElBM,eAAe,KACblP,KAAKmP,UAGX,CAKA,KAAAA,GACOnP,KAAK2O,aAIV3O,KAAK4O,YAAa,EAElB5O,KAAKoP,gBACP,CAGA,aAAAA,GACE,MAAMC,EAAerP,KAAK6N,KAAKyB,cAAc,CAAEC,SAAS,IAExD,IAAIrB,EAAa,GACjB,MAAMC,EAAe,GACfqB,EAAa,GAEfH,EAAa3I,SACfwH,EAAamB,EAAa1B,OAAQ1D,IAAUjK,KAAK0O,aAAaJ,SAASrE,KAGrEjK,KAAK0O,aAAahI,QACpB1G,KAAK0O,aAAa5D,QAAQ,CAACb,EAAMwF,KAC/B,MAAMlO,EAAM8N,EAAaK,QAAQzF,IACpB,IAAT1I,EACF4M,EAAa7D,KAAKL,GACT1I,IAAQkO,GACjBD,EAAWlF,KAAKL,MAKlBiE,EAAWxH,QAAUyH,EAAazH,QAAU8I,EAAW9I,SACzD1G,KAAKyO,SAAS,CAAEP,aAAYsB,aAAYrB,iBAG1CnO,KAAK0O,aAAeW,CACtB,E,gCCjGF,IAAIM,EAAW,EAgBR,SAASC,IAEd,OAAOD,GACT,C","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","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/TooltipClass.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/dom-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-observer.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/unique-id-utils.js"],"sourcesContent":["/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n\n // 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\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n 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: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n","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} 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 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} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n componentNameValidationMixin,\n portalMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\n\nexport const componentName = getComponentName('tooltip');\n\nconst tooltipAttrs = [\n 'text',\n 'position',\n 'hide-delay',\n 'hover-delay',\n 'opened',\n];\n\nconst BaseClass = createBaseClass({\n componentName,\n baseSelector: 'vaadin-tooltip',\n});\n\nclass RawTooltip extends BaseClass {\n static get observedAttributes() {\n return tooltipAttrs.concat(BaseClass.observedAttributes || []);\n }\n\n get isOpened() {\n return this.getAttribute('opened') === 'true';\n }\n\n get overlay() {\n return this.tooltip?._overlayElement;\n }\n\n get overlayContentNode() {\n return this.overlay?.shadowRoot.querySelector('[part=\"content\"]');\n }\n\n get tooltipText() {\n return this.getAttribute('text')?.trim() || '';\n }\n\n get isStaticDisplay() {\n return this.getAttribute('static-display') === 'true';\n }\n\n // We use `static-display` for presentation purposes, to show the tooltip content.\n // This should be used only when `opened` is `true`. Once `static-display` is set,\n // the overlay would become a `static` element, and will have layout in the presenting page.\n // This is mainly aimed to solve the presentation problem on our Styles Page in the Console.\n #handleStaticDisplay() {\n if (this.isStaticDisplay) {\n this.#revealWrappedParts();\n this.setAttribute('inert', 'true');\n } else {\n this.#hideWrappedParts();\n this.removeAttribute('inert');\n }\n }\n\n init() {\n super.init();\n\n // Create the vaadin-tooltip here instead of constructor (for React compatibility)\n this.style.display = 'contents';\n this.insertAdjacentHTML('beforeend', '<vaadin-tooltip></vaadin-tooltip>');\n this.tooltip = this.querySelector('vaadin-tooltip');\n\n this.#hideWrappedParts();\n\n this.#setTooltipTarget();\n\n setTimeout(() => this.#onOverlayReady());\n }\n\n #hideWrappedParts() {\n this.tooltip.style.width = '0';\n this.tooltip.style.height = '0';\n this.tooltip.style.display = 'block';\n this.tooltip.style.overflow = 'hidden';\n this.tooltip.style.position = 'absolute';\n }\n\n #revealWrappedParts() {\n this.tooltip.style.width = '100%';\n this.tooltip.style.height = '100%';\n this.tooltip.style.position = 'static';\n this.tooltip.style.overflow = 'visible';\n this.tooltip.textContent = '';\n this.overlay.style.display = 'block';\n this.overlay.style.position = 'static';\n }\n\n #onOverlayReady() {\n this.#initTooltipTextComponent();\n this.#overrideAttachOverlay();\n\n forwardAttrs(this, this.tooltip, {\n includeAttrs: ['position', 'opened'],\n });\n\n this.#handleTooltipVisibility();\n }\n\n #setTooltipTarget() {\n if (!this.children?.length) return;\n\n let ele = Array.from(this.children).find((child) => child !== this.tooltip);\n\n if (!ele) return;\n\n this.tooltip.target = ele;\n }\n\n #clearOverlayContentNode() {\n this.overlayContentNode.innerHTML = '';\n }\n\n #createEnrichedTextComponent() {\n const enrichedText = document.createElement('descope-enriched-text');\n\n enrichedText.setAttribute('link-target-blank', 'true');\n enrichedText.textContent = this.tooltipText;\n\n return enrichedText;\n }\n\n get srLabel() {\n return this.tooltip?.querySelector('[slot=\"sr-label\"]');\n }\n\n #initTooltipTextComponent() {\n if (!this.overlayContentNode) return;\n\n setTimeout(() => {\n this.#clearOverlayContentNode();\n\n this.textComponent = this.#createEnrichedTextComponent();\n\n this.overlayContentNode.appendChild(this.textComponent);\n\n // An empty sr-label with role=\"tooltip\" fails accessibility checks.\n // Hide it when there's no tooltip text; vaadin handles populating it when text is present.\n if (this.srLabel && !this.tooltipText) {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['readonly'],\n });\n });\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideAttachOverlay() {\n if (!this.overlay) return;\n\n if (this.isOpened) {\n // When `opened` attr is used, vaadin doesn't execute `_attachOverlay`,\n // and the overlay element is rendered outside the component, on the top\n // level. We need to move it back to the local component's DOM.\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.#handleStaticDisplay();\n });\n } else {\n this.overlay._detachOverlay = () => {};\n\n this.overlay._attachOverlay = () =>\n this.tooltip.shadowRoot.appendChild(this.overlay);\n }\n }\n\n #handleTooltipVisibility() {\n // This is Vaadin's API for manual control of tooltip visibility\n this.tooltip?.toggleAttribute('manual', this.isOpened);\n }\n\n #updateText(value) {\n if (!this.textComponent) return;\n const trimmedValue = (value ?? '').trim();\n this.textComponent.textContent = trimmedValue;\n if (this.srLabel) {\n if (trimmedValue) {\n this.srLabel.removeAttribute('aria-hidden');\n } else {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'text') {\n this.#updateText(newValue);\n }\n\n if (attrName === 'opened') {\n this.#handleTooltipVisibility();\n }\n }\n }\n}\n\nconst { overlay, content } = {\n overlay: { selector: () => 'vaadin-tooltip-overlay::part(overlay)' },\n content: { selector: () => 'vaadin-tooltip-overlay::part(content)' },\n};\n\n/**\n * This component has no Shadow DOM of its own, so we can't add styles to it\n * (otherwise it would affect the rest of the DOM).\n * Note that all styles are within PortalMixin.\n */\nexport const TooltipClass = compose(\n componentNameValidationMixin,\n portalMixin({\n selector: '',\n mappings: {\n fontFamily: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontFamilyOverride,\n },\n fontSize: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontSizeOverride,\n },\n fontWeight: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontWeightOverride,\n },\n textColor: {\n ...content,\n property: EnrichedTextClass.cssVarList.textColorOverride,\n },\n hostDirection: {\n ...content,\n property: EnrichedTextClass.cssVarList.hostDirectionOverride,\n },\n backgroundColor: [{ ...overlay }, { ...content }],\n borderColor: { ...overlay },\n borderStyle: { ...overlay },\n borderWidth: { ...overlay },\n borderRadius: { ...overlay },\n boxShadow: { ...overlay },\n horizontalPadding: [\n { ...content, property: 'padding-left' },\n { ...content, property: 'padding-right' },\n ],\n verticalPadding: [\n { ...content, property: 'padding-top' },\n { ...content, property: 'padding-bottom' },\n ],\n },\n forward: {\n attributes: ['style'],\n include: false,\n },\n }),\n)(RawTooltip);\n","import '@descope-ui/descope-enriched-text';\nimport '@vaadin/tooltip';\nimport { componentName, TooltipClass } from './TooltipClass';\n\ncustomElements.define(componentName, TooltipClass);\n\nexport { TooltipClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns an array of ancestor root nodes for the given node.\n *\n * A root node is either a document node or a document fragment node (Shadow Root).\n * The array is collected by a bottom-up DOM traversing that starts with the given node\n * and involves both the light DOM and ancestor shadow DOM trees.\n *\n * @param {Node} node\n * @return {Node[]}\n */\nexport function getAncestorRootNodes(node) {\n const result = [];\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n result.push(node);\n break;\n }\n\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result.push(node);\n node = node.host;\n continue;\n }\n\n if (node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n\n node = node.parentNode;\n }\n\n return result;\n}\n\n/**\n * Returns the list of flattened elements for the given `node`.\n * This list consists of a node's children and, for any children that are\n * `<slot>` elements, the expanded flattened list of `assignedElements`.\n *\n * @param {Node} node\n * @return {Element[]}\n */\nexport function getFlattenedElements(node) {\n const result = [];\n let elements;\n if (node.localName === 'slot') {\n elements = node.assignedElements();\n } else {\n result.push(node);\n elements = [...node.children];\n }\n elements.forEach((elem) => result.push(...getFlattenedElements(elem)));\n return result;\n}\n\n/**\n * Traverses the given node and its parents, including those that are across\n * the shadow root boundaries, until it finds a node that matches the selector.\n *\n * @param {string} selector The CSS selector to match against\n * @param {Node} node The starting node for the traversal\n * @return {Node | null} The closest matching element, or null if no match is found\n */\nexport function getClosestElement(selector, node) {\n if (!node) {\n return null;\n }\n\n return node.closest(selector) || getClosestElement(selector, node.getRootNode().host);\n}\n\n/**\n * Takes a string with values separated by space and returns a set the values\n *\n * @param {string} value\n * @return {Set<string>}\n */\nexport function deserializeAttributeValue(value) {\n if (!value) {\n return new Set();\n }\n\n return new Set(value.split(' '));\n}\n\n/**\n * Takes a set of string values and returns a string with values separated by space\n *\n * @param {Set<string>} values\n * @return {string}\n */\nexport function serializeAttributeValue(values) {\n return values ? [...values].join(' ') : '';\n}\n\n/**\n * Adds a value to an attribute containing space-delimited values.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function addValueToAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.add(value);\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Removes a value from an attribute containing space-delimited values.\n * If the value is the last one, the whole attribute is removed.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function removeValueFromAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.delete(value);\n if (values.size === 0) {\n element.removeAttribute(attr);\n return;\n }\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Returns true if the given node is an empty text node, false otherwise.\n *\n * @param {Node} node\n * @return {boolean}\n */\nexport function isEmptyTextNode(node) {\n return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '';\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { isEmptyTextNode } from './dom-utils.js';\nimport { SlotObserver } from './slot-observer.js';\nimport { generateUniqueId } from './unique-id-utils.js';\n\n/**\n * A controller for providing content to slot element and observing changes.\n */\nexport class SlotController extends EventTarget {\n /**\n * Ensure that every instance has unique ID.\n *\n * @param {HTMLElement} host\n * @param {string} slotName\n * @return {string}\n * @protected\n */\n static generateId(host, slotName) {\n const prefix = slotName || 'default';\n return `${prefix}-${host.localName}-${generateUniqueId()}`;\n }\n\n constructor(host, slotName, tagName, config = {}) {\n super();\n\n const { initializer, multiple, observe, useUniqueId } = config;\n\n this.host = host;\n this.slotName = slotName;\n this.tagName = tagName;\n this.observe = typeof observe === 'boolean' ? observe : true;\n this.multiple = typeof multiple === 'boolean' ? multiple : false;\n this.slotInitializer = initializer;\n\n if (multiple) {\n this.nodes = [];\n }\n\n // Only generate the default ID if requested by the controller.\n if (useUniqueId) {\n this.defaultId = this.constructor.generateId(host, slotName);\n }\n }\n\n hostConnected() {\n if (!this.initialized) {\n if (this.multiple) {\n this.initMultiple();\n } else {\n this.initSingle();\n }\n\n if (this.observe) {\n this.observeSlot();\n }\n\n this.initialized = true;\n }\n }\n\n /** @protected */\n initSingle() {\n let node = this.getSlotChild();\n\n if (!node) {\n node = this.attachDefaultNode();\n this.initNode(node);\n } else {\n this.node = node;\n this.initAddedNode(node);\n }\n }\n\n /** @protected */\n initMultiple() {\n const children = this.getSlotChildren();\n\n if (children.length === 0) {\n const defaultNode = this.attachDefaultNode();\n if (defaultNode) {\n this.nodes = [defaultNode];\n this.initNode(defaultNode);\n }\n } else {\n this.nodes = children;\n children.forEach((node) => {\n this.initAddedNode(node);\n });\n }\n }\n\n /**\n * Create and attach default node using the provided tag name, if any.\n * @return {Node | undefined}\n * @protected\n */\n attachDefaultNode() {\n const { host, slotName, tagName } = this;\n\n // Check if the node was created previously and if so, reuse it.\n let node = this.defaultNode;\n\n // Tag name is optional, sometimes we don't init default content.\n if (!node && tagName) {\n node = document.createElement(tagName);\n if (node instanceof Element) {\n if (slotName !== '') {\n node.setAttribute('slot', slotName);\n }\n this.defaultNode = node;\n }\n }\n\n if (node) {\n this.node = node;\n host.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * Return the list of nodes matching the slot managed by the controller.\n * @return {Node}\n */\n getSlotChildren() {\n const { slotName } = this;\n return Array.from(this.host.childNodes).filter((node) => {\n // Either an element (any slot) or a text node (only un-named slot).\n return (\n (node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) ||\n (node.nodeType === Node.TEXT_NODE && node.textContent.trim() && slotName === '')\n );\n });\n }\n\n /**\n * Return a reference to the node managed by the controller.\n * @return {Node}\n */\n getSlotChild() {\n return this.getSlotChildren()[0];\n }\n\n /**\n * Run `slotInitializer` for the node managed by the controller.\n *\n * @param {Node} node\n * @protected\n */\n initNode(node) {\n const { slotInitializer } = this;\n // Don't try to bind `this` to initializer (normally it's arrow function).\n // Instead, pass the host as a first argument to access component's state.\n if (slotInitializer) {\n slotInitializer(node, this.host);\n }\n }\n\n /**\n * Override to initialize the newly added custom node.\n *\n * @param {Node} _node\n * @protected\n */\n initCustomNode(_node) {}\n\n /**\n * Override to teardown slotted node when it's removed.\n *\n * @param {Node} _node\n * @protected\n */\n teardownNode(_node) {}\n\n /**\n * Run both `initCustomNode` and `initNode` for a custom slotted node.\n *\n * @param {Node} node\n * @protected\n */\n initAddedNode(node) {\n if (node !== this.defaultNode) {\n this.initCustomNode(node);\n this.initNode(node);\n }\n }\n\n /**\n * Setup the observer to manage slot content changes.\n * @protected\n */\n observeSlot() {\n const { slotName } = this;\n const selector = slotName === '' ? 'slot:not([name])' : `slot[name=${slotName}]`;\n const slot = this.host.shadowRoot.querySelector(selector);\n\n this.__slotObserver = new SlotObserver(slot, ({ addedNodes, removedNodes }) => {\n const current = this.multiple ? this.nodes : [this.node];\n\n // Calling `slot.assignedNodes()` includes whitespace text nodes in case of default slot:\n // unlike comment nodes, they are not filtered out. So we need to manually ignore them.\n const newNodes = addedNodes.filter((node) => !isEmptyTextNode(node) && !current.includes(node));\n\n if (removedNodes.length) {\n this.nodes = current.filter((node) => !removedNodes.includes(node));\n\n removedNodes.forEach((node) => {\n this.teardownNode(node);\n });\n }\n\n if (newNodes && newNodes.length > 0) {\n if (this.multiple) {\n // Remove default node if exists\n if (this.defaultNode) {\n this.defaultNode.remove();\n }\n this.nodes = [...current, ...newNodes].filter((node) => node !== this.defaultNode);\n newNodes.forEach((node) => {\n this.initAddedNode(node);\n });\n } else {\n // Remove previous node if exists\n if (this.node) {\n this.node.remove();\n }\n this.node = newNodes[0];\n this.initAddedNode(this.node);\n }\n }\n });\n }\n}\n","/**\n * @license\n * Copyright (c) 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A helper for observing slot changes.\n */\nexport class SlotObserver {\n constructor(slot, callback) {\n /** @type HTMLSlotElement */\n this.slot = slot;\n\n /** @type Function */\n this.callback = callback;\n\n /** @type {Node[]} */\n this._storedNodes = [];\n\n this._connected = false;\n this._scheduled = false;\n\n this._boundSchedule = () => {\n this._schedule();\n };\n\n this.connect();\n this._schedule();\n }\n\n /**\n * Activates an observer. This method is automatically called when\n * a `SlotObserver` is created. It should only be called to re-activate\n * an observer that has been deactivated via the `disconnect` method.\n */\n connect() {\n this.slot.addEventListener('slotchange', this._boundSchedule);\n this._connected = true;\n }\n\n /**\n * Deactivates the observer. After calling this method the observer callback\n * will not be called when changes to slotted nodes occur. The `connect` method\n * may be subsequently called to reactivate the observer.\n */\n disconnect() {\n this.slot.removeEventListener('slotchange', this._boundSchedule);\n this._connected = false;\n }\n\n /** @private */\n _schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n\n queueMicrotask(() => {\n this.flush();\n });\n }\n }\n\n /**\n * Run the observer callback synchronously.\n */\n flush() {\n if (!this._connected) {\n return;\n }\n\n this._scheduled = false;\n\n this._processNodes();\n }\n\n /** @private */\n _processNodes() {\n const currentNodes = this.slot.assignedNodes({ flatten: true });\n\n let addedNodes = [];\n const removedNodes = [];\n const movedNodes = [];\n\n if (currentNodes.length) {\n addedNodes = currentNodes.filter((node) => !this._storedNodes.includes(node));\n }\n\n if (this._storedNodes.length) {\n this._storedNodes.forEach((node, index) => {\n const idx = currentNodes.indexOf(node);\n if (idx === -1) {\n removedNodes.push(node);\n } else if (idx !== index) {\n movedNodes.push(node);\n }\n });\n }\n\n if (addedNodes.length || removedNodes.length || movedNodes.length) {\n this.callback({ addedNodes, movedNodes, removedNodes });\n }\n\n this._storedNodes = currentNodes;\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nlet uniqueId = 0;\n\n/**\n * Resets the unique id counter.\n *\n * @return {void}\n */\nexport function resetUniqueId() {\n uniqueId = 0;\n}\n\n/**\n * Returns a unique integer id.\n *\n * @return {number}\n */\nexport function generateUniqueId() {\n // eslint-disable-next-line no-plusplus\n return uniqueId++;\n}\n"],"names":["componentName","EnrichedText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","html","getAttribute","shadowRoot","querySelector","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","disableRules","decodeHTML","textArea","document","createElement","value","customElements","define","observedAttrs","RawLink","concat","anchor","includeAttrs","mapAttrs","tooltip","readOnly","preventDefault","selectors","host","link","wrapper","text","TextClass","LinkClass","textDecoration","cssVarList","cursor","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","tooltipAttrs","BaseClass","overlay","content","TooltipClass","fontFamilyOverride","fontSizeOverride","fontWeightOverride","textColorOverride","hostDirectionOverride","backgroundColor","borderRadius","boxShadow","horizontalPadding","verticalPadding","forward","attributes","include","isOpened","_overlayElement","overlayContentNode","tooltipText","isStaticDisplay","insertAdjacentHTML","setTimeout","width","height","overflow","position","textContent","children","ele","Array","from","find","child","enrichedText","srLabel","textComponent","appendChild","_detachOverlay","_attachOverlay","toggleAttribute","trimmedValue","getAncestorRootNodes","node","result","nodeType","Node","DOCUMENT_NODE","push","DOCUMENT_FRAGMENT_NODE","assignedSlot","parentNode","getFlattenedElements","elements","localName","assignedElements","forEach","elem","getClosestElement","closest","getRootNode","deserializeAttributeValue","Set","split","serializeAttributeValue","values","join","addValueToAttribute","element","attr","add","removeValueFromAttribute","delete","size","isEmptyTextNode","TEXT_NODE","SlotController","EventTarget","generateId","slotName","tagName","config","initializer","multiple","observe","useUniqueId","slotInitializer","nodes","defaultId","hostConnected","initialized","initMultiple","initSingle","observeSlot","getSlotChild","initAddedNode","attachDefaultNode","initNode","getSlotChildren","defaultNode","Element","filter","ELEMENT_NODE","slot","initCustomNode","_node","teardownNode","__slotObserver","addedNodes","removedNodes","current","newNodes","includes","remove","SlotObserver","callback","_storedNodes","_connected","_scheduled","_boundSchedule","_schedule","connect","disconnect","removeEventListener","queueMicrotask","flush","_processNodes","currentNodes","assignedNodes","flatten","movedNodes","index","indexOf","uniqueId","generateUniqueId"],"sourceRoot":""}