{"version":3,"file":"score-button.js","sources":["../../../../src/components/score/score-button/score-button.ts"],"sourcesContent":["import { CSSResultGroup, TemplateResult, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { OutlineButton } from '../../base/outline-button/outline-button';\nimport { SlotController } from '../../controllers/slot-controller';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport componentStyles from './score-button.css.lit';\nimport { isExternalLink, isMessageRequired, isOmittedDomain } from '../../../utilities/external-links'; \n\nexport type ScoreButtonVariant =\n | 'primary'\n | 'secondary'\n | 'login'\n | 'signup'\n | 'filter';\n\n/**\n * The Score Button component\n * @element score-button\n *\n */\n\n@customElement('score-button')\nexport class ScoreButton extends OutlineButton {\n slots = new SlotController(\n this, // This, the host element.\n true // To shift or not to shift LightDom nodes to ShadowDOM.\n );\n static styles: CSSResultGroup = [componentStyles];\n @property({ type: String, attribute: 'sr-only' }) srOnly: string;\n @property({ type: Boolean, attribute: 'is-modal-action' }) isModalAction: boolean;\n @property({ type: String, attribute: 'rel-text' }) relText: string;\n\n render(): TemplateResult {\n const isModalAction = this.isModalAction ? true : false;\n let buttonUrl = this.buttonUrl ? String(this.buttonUrl) : '';\n let buttonTarget = this.buttonTarget ? String(this.buttonTarget) : undefined;\n let isLinkExternal: boolean = isExternalLink(buttonUrl);\n let isLinkOmitted: boolean = isOmittedDomain(buttonUrl);\n // External links should open in the new tab.\n if (isLinkExternal && !isLinkOmitted) {\n buttonTarget = '_blank';\n }\n \n if (isMessageRequired(buttonUrl) && !isModalAction && !isLinkOmitted) {\n // Call the modal in the score_content module.\n // To preserve the external link URL value within the\n // external modal, encode the URL prior to passing to the external modal.\n // When using javascript as an href, web browsers will automatically decode the value\n // which leads to the scoreContentCallModal receiving a decoded URL value.\n // Encoding the URL again before passing to the javascript call ensures any existing encoded\n // characters in the URL are preserved in the scoreContentCallModal once the web browser decodes\n // the value.\n buttonUrl = 'javascript:scoreContentCallModal(\"' + encodeURIComponent(buttonUrl) + '\")';\n buttonTarget = '_self';\n }\n return this.buttonUrl\n ? html` \n ${this.iconTemplate(this.hasLeftIcon, 'left')}\n \n ${this.iconTemplate(this.hasRightIcon, 'right')} ${this.hasSrOnly()}\n `\n : html`皇冠体育博彩社科网太阳城娱乐澳门银河Crown-Sports-Betting-marketing@jayconscious.com东方红运动网皇冠体育《天下3》客服专区Sun-City-entertainment-City-info@xyschool.netSun-City-contactus@braelyngenerator.net深度素材网厦门大学附属成功医院Asian-sports-betting-platform-info@rf518.com沙巴体育博彩esball易世博皇冠博彩足球买球果实网中小学教师继续教育培训平台Buying-platform-marketing@izuanhui.netCrown-Sports-media@seezl.com《征途2动作版》官方网站珠海欣欣旅游网百分百考试网优思网校寻觅网车车网大余在线斗仙官方网站天津生活网_4399动画片网圣牧官网博购官网努努书坊 上海法语培训中心江苏历史教研网