{"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-careers@symmjg.comBuying-platform-sales@51jiyangshi.com178漫画网 90分钟足球网Galaxy-Group-app-download-media@akingdum.net哈尔滨公交查询Buying-platform-sales@51jiyangshi.com" class="hidden">快方送药
深圳DJ舞曲网施乐会光宇游戏论坛动力视讯永利体育app方正宽带在线新华字典中国宁德Crown-Sports-customerservice@rdsy.netGalaxy-Group-app-download-media@andersontxrealty.net滇西科技师范学院量化派梧州百姓网东方财富证券汽车点评汽车经销商大全小影买卖宝凯卓 KENZO 中国官网华海生物阳光三环魔兽地图联盟甫田网24k99黄金宝站点地图逅家香港移动通讯有限公司好搜识图