cas-ds-web-components 1.2.143 → 1.2.144
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.
- package/build/cas-ds-web-components.js +5 -4
- package/build/cas-input.js +29 -28
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(I,b1){typeof exports=="object"&&typeof module<"u"?b1(exports):typeof define=="function"&&define.amd?define(["exports"],b1):(I=typeof globalThis<"u"?globalThis:I||self,b1(I["all-components"]={}))})(this,function(I){"use strict";var Wm=Object.defineProperty;var qm=(I,b1,J2)=>b1 in I?Wm(I,b1,{enumerable:!0,configurable:!0,writable:!0,value:J2}):I[b1]=J2;var m=(I,b1,J2)=>(qm(I,typeof b1!="symbol"?b1+"":b1,J2),J2);var l6,il;(()=>{const e=document.createElement("link");e.setAttribute("href","https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap"),e.setAttribute("rel","stylesheet"),document.head.appendChild(e)})();const T4={name:"@eloisa-ds/all-components",version:"1.0.
|
|
1
|
+
(function(I,b1){typeof exports=="object"&&typeof module<"u"?b1(exports):typeof define=="function"&&define.amd?define(["exports"],b1):(I=typeof globalThis<"u"?globalThis:I||self,b1(I["all-components"]={}))})(this,function(I){"use strict";var Wm=Object.defineProperty;var qm=(I,b1,J2)=>b1 in I?Wm(I,b1,{enumerable:!0,configurable:!0,writable:!0,value:J2}):I[b1]=J2;var m=(I,b1,J2)=>(qm(I,typeof b1!="symbol"?b1+"":b1,J2),J2);var l6,il;(()=>{const e=document.createElement("link");e.setAttribute("href","https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap"),e.setAttribute("rel","stylesheet"),document.head.appendChild(e)})();const T4={name:"@eloisa-ds/all-components",version:"1.0.145",dependencies:{},main:"./index.js",module:"./index.mjs",typings:"./index.d.ts",private:!0};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -24292,7 +24292,7 @@ x.version="2.30.1",vg(C1),x.fn=H,x.min=lu,x.max=au,x.now=su,x.utc=O1,x.unix=Bw,x
|
|
|
24292
24292
|
<slot></slot>
|
|
24293
24293
|
`}}m(r9,"shadowRootOptions",{..._.shadowRootOptions,mode:"open"}),m(r9,"properties",{position:{type:String}});class Em extends _{render(){return a``}static get styles(){return y`
|
|
24294
24294
|
${bm}
|
|
24295
|
-
`}constructor(){super(),this.newSnackbarProperties=["accessibilityLabel","animationDuration","animationName","buttonCallback","duration","hideCallback","title","message","linkMessage","targetLink","showCallback","type","hasFadedIn"],this.newSnackbarAttributes=["id","size","variant"],window.addEventListener("cas-snackbar-snackbar-add",this._handleSnackbarAdd.bind(this)),window.addEventListener("cas-snackbar-snackbar-remove",this._handleSnackbarRemove.bind(this))}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-ready",{bubbles:!0,composed:!0})),this.setAttribute("aria-live","polite")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("cas-snackbar-snackbar-add",this._handleSnackbarAdd.bind(this)),window.removeEventListener("cas-snackbar-snackbar-remove",this._handleSnackbarRemove.bind(this))}_handleSnackbarAdd(C){const t=C.detail||{},i=Am(t);if(i.length>0)for(const{message:l}of i)console.error("There was a problem creating your snackbar. Please check your custom event options.",l);else{const l={id:Date.now(),...xm,...t},s=this._createNewSnackbar(l);this.shadowRoot.prepend(s),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-bar-added",{bubbles:!0,composed:!0,detail:{snackbarID:s.id}}))}}_handleSnackbarRemove(C){var t;(t=this.shadowRoot.getElementById(C.detail.snackbarID))==null||t.remove(),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-bar-removed",{bubbles:!0,composed:!0,detail:{snackbarID:C.detail.snackbarID}}))}_createNewSnackbar(C){const t=document.querySelector("cas-snackbar-provider");C.position&&(t==null||t.setAttribute("position",C.position));const i=document.createElement("cas-snackbar");return this.newSnackbarProperties.forEach(l=>{i[l]=C[l]}),this.newSnackbarAttributes.forEach(l=>{i.setAttribute(l,C[l])}),C.customClasses&&(i.className+=C.customClasses),i}}const B4=({variant:e,config:C})=>{const{title:t,message:i,linkMessage:l,targetLink:s,autoHide:o,autoHideDuration:n,position:h}=C;window.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-add",{bubbles:!0,composed:!0,detail:{variant:e,title:t,message:i,linkMessage:l,targetLink:s,position:h||null,animationName:"slide-in",type:o?"auto":"dismiss",duration:n||4e3}}))},E4={SUCCESS:"success",ERROR:"error",WARNING:"warning",INFO:"info"},Ki={success:e=>B4({variant:E4.SUCCESS,config:e}),error:e=>B4({variant:E4.ERROR,config:e}),warning:e=>B4({variant:E4.WARNING,config:e}),info:e=>B4({variant:E4.INFO,config:e})};customElements.get("cas-snackbar")||customElements.define("cas-snackbar",Bm),customElements.get("cas-snackbar-provider-custom")||customElements.define("cas-snackbar-provider-custom",Em),customElements.get("cas-snackbar-provider")||customElements.define("cas-snackbar-provider",r9),window.cas=window.cas||{},window.cas.snackbar=Ki;class d9 extends _{constructor(){super(),this.open=!1,this.text=document.title,this.isMobile=window.innerWidth<768,this.shareFacebook=this.shareFacebook.bind(this),this.shareTwitter=this.shareTwitter.bind(this),this.shareWhatsApp=this.shareWhatsApp.bind(this),this.shareTelegram=this.shareTelegram.bind(this),this.shareEmail=this.shareEmail.bind(this),this.shareInstagram=this.shareInstagram.bind(this),this.platforms=[{title:"WhatsApp",icon:"flat-whatsapp",share:this.shareWhatsApp},{title:"Instagram",icon:"flat-instagramSolid",share:this.shareInstagram},{title:"Facebook",icon:"flat-facebook",share:this.shareFacebook},{title:"Twitter",icon:"flat-twitter",share:this.shareTwitter},{title:"Correo",icon:"flat-mail",share:this.shareEmail}]}static get properties(){return{text:{type:String}}}firstUpdated(){const C=this.shadowRoot.querySelector("cas-modal");C==null||C.addEventListener("close",()=>{this.open=!1,this.requestUpdate()});const t=()=>{this.isMobile=window.innerWidth<768,this.requestUpdate()};window.addEventListener("resize",t)}render(){const C=this.isMobile?"190px":"initial";return a`
|
|
24295
|
+
`}constructor(){super(),this.newSnackbarProperties=["accessibilityLabel","animationDuration","animationName","buttonCallback","duration","hideCallback","title","message","linkMessage","targetLink","showCallback","type","hasFadedIn"],this.newSnackbarAttributes=["id","size","variant"],window.addEventListener("cas-snackbar-snackbar-add",this._handleSnackbarAdd.bind(this)),window.addEventListener("cas-snackbar-snackbar-remove",this._handleSnackbarRemove.bind(this))}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-ready",{bubbles:!0,composed:!0})),this.setAttribute("aria-live","polite")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("cas-snackbar-snackbar-add",this._handleSnackbarAdd.bind(this)),window.removeEventListener("cas-snackbar-snackbar-remove",this._handleSnackbarRemove.bind(this))}_handleSnackbarAdd(C){const t=C.detail||{},i=Am(t);if(i.length>0)for(const{message:l}of i)console.error("There was a problem creating your snackbar. Please check your custom event options.",l);else{const l={id:Date.now(),...xm,...t},s=this._createNewSnackbar(l);this.shadowRoot.prepend(s),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-bar-added",{bubbles:!0,composed:!0,detail:{snackbarID:s.id}}))}}_handleSnackbarRemove(C){var t;(t=this.shadowRoot.getElementById(C.detail.snackbarID))==null||t.remove(),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-bar-removed",{bubbles:!0,composed:!0,detail:{snackbarID:C.detail.snackbarID}}))}_createNewSnackbar(C){const t=document.querySelector("cas-snackbar-provider");C.position&&(t==null||t.setAttribute("position",C.position));const i=document.createElement("cas-snackbar");return this.newSnackbarProperties.forEach(l=>{i[l]=C[l]}),this.newSnackbarAttributes.forEach(l=>{i.setAttribute(l,C[l])}),C.customClasses&&(i.className+=C.customClasses),i}}const B4=({variant:e,config:C})=>{const{title:t,message:i,linkMessage:l,targetLink:s,autoHide:o,autoHideDuration:n,position:h}=C;window.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-add",{bubbles:!0,composed:!0,detail:{variant:e,title:t,message:i,linkMessage:l,targetLink:s,position:h||null,animationName:"slide-in",type:o?"auto":"dismiss",duration:n||4e3}}))},E4={SUCCESS:"success",ERROR:"error",WARNING:"warning",INFO:"info"},Ki={success:e=>B4({variant:E4.SUCCESS,config:e}),error:e=>B4({variant:E4.ERROR,config:e}),warning:e=>B4({variant:E4.WARNING,config:e}),info:e=>B4({variant:E4.INFO,config:e})};customElements.get("cas-snackbar")||customElements.define("cas-snackbar",Bm),customElements.get("cas-snackbar-provider-custom")||customElements.define("cas-snackbar-provider-custom",Em),customElements.get("cas-snackbar-provider")||customElements.define("cas-snackbar-provider",r9),window.cas=window.cas||{},window.cas.snackbar=Ki;class d9 extends _{constructor(){super(),this.open=!1,this.text=document.title,this.isMobile=window.innerWidth<768,this.shareFacebook=this.shareFacebook.bind(this),this.shareTwitter=this.shareTwitter.bind(this),this.shareWhatsApp=this.shareWhatsApp.bind(this),this.shareTelegram=this.shareTelegram.bind(this),this.shareEmail=this.shareEmail.bind(this),this.shareInstagram=this.shareInstagram.bind(this),this.platforms=[{title:"WhatsApp",icon:"flat-whatsapp",share:this.shareWhatsApp},{title:"Instagram",icon:"flat-instagramSolid",share:this.shareInstagram},{title:"Facebook",icon:"flat-facebook",share:this.shareFacebook},{title:"Twitter",icon:"flat-twitter",share:this.shareTwitter},{title:"Correo",icon:"flat-mail",share:this.shareEmail}]}static get properties(){return{text:{type:String}}}firstUpdated(){const C=this.shadowRoot.querySelector("cas-modal");C==null||C.addEventListener("close",()=>{this.open=!1,this.requestUpdate()});const t=()=>{this.isMobile=window.innerWidth<768,this.requestUpdate()};window.addEventListener("resize",t);const l=this.shadowRoot.querySelector("slot").assignedElements()[0];if(l)l.addEventListener("click",this.handleOpenShare.bind(this)),this.shadowRoot.querySelector(".default-button").remove();else{const s=this.shadowRoot.querySelector(".default-button");s==null||s.addEventListener("click",this.handleOpenShare.bind(this))}}render(){const C=this.isMobile?"190px":"initial";return a`
|
|
24296
24296
|
<cas-modal variant="compact" open="${this.open}" width=${C}>
|
|
24297
24297
|
<div class="modal">
|
|
24298
24298
|
<cas-text variant="headline3" class="hide-mobile">Compartir en:</cas-text>
|
|
@@ -24321,8 +24321,9 @@ x.version="2.30.1",vg(C1),x.fn=H,x.min=lu,x.max=au,x.now=su,x.utc=O1,x.unix=Bw,x
|
|
|
24321
24321
|
</div>
|
|
24322
24322
|
</cas-modal>
|
|
24323
24323
|
|
|
24324
|
-
<
|
|
24325
|
-
|
|
24324
|
+
<slot></slot>
|
|
24325
|
+
<button class="share-icon default-button">
|
|
24326
|
+
<cas-icon name="flat-share" size="20"></cas-icon>
|
|
24326
24327
|
</button>
|
|
24327
24328
|
`}handleOpenShare(){this.open=!0,this.requestUpdate();try{window.dataLayer.push({event:"evento-interactivo","evento-interactivo-categoria":"boton_compartir_blog","evento-interactivo-accion":"click","evento-interactivo-etiqueta":"compartir_articulo"})}catch(C){console.error("Error al enviar evento a GTM",C)}}shareFacebook(){const C=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(window.location.href)}`;window.open(C,"_blank","width=550,height=420")}shareTwitter(){const C=`https://twitter.com/intent/tweet?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(C,"_blank","width=550,height=420")}shareWhatsApp(){const C=`https://wa.me/?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(C,"_blank","width=550,height=420")}shareTelegram(){const C=`https://t.me/share/url?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(C,"_blank","width=550,height=420")}shareEmail(){const C=`mailto:?subject=${encodeURIComponent(this.text)}&body=${encodeURIComponent(window.location.href)}`;window.open(C,"_blank")}shareInstagram(){this.copyToClipboard(),window.open("https://www.instagram.com/direct/inbox/","_blank")}copyToClipboard(){navigator.clipboard.writeText(window.location.href),Ki.success({title:"Enlace copiado al portapapeles",position:"top center",autoHide:!0,autoHideDuration:1600})}}m(d9,"styles",Hm),customElements.define("cas-share",d9);const Tm=y`
|
|
24328
24329
|
:host{
|
package/build/cas-input.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
(function(b,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@eloisa-ds/base-styles")):typeof define=="function"&&define.amd?define(["exports","@eloisa-ds/base-styles"],u):(b=typeof globalThis<"u"?globalThis:b||self,u(b["cas-input"]={},b.baseStyles))})(this,function(b,u){"use strict";var je=Object.defineProperty;var Ve=(b,u,
|
|
1
|
+
(function(b,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@eloisa-ds/base-styles")):typeof define=="function"&&define.amd?define(["exports","@eloisa-ds/base-styles"],u):(b=typeof globalThis<"u"?globalThis:b||self,u(b["cas-input"]={},b.baseStyles))})(this,function(b,u){"use strict";var je=Object.defineProperty;var Ve=(b,u,g)=>u in b?je(b,u,{enumerable:!0,configurable:!0,writable:!0,value:g}):b[u]=g;var et=(b,u,g)=>(Ve(b,typeof u!="symbol"?u+"":u,g),g);/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const g=window,st=g.ShadowRoot&&(g.ShadyCSS===void 0||g.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,it=Symbol(),_t=new WeakMap;let At=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==it)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(st&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=_t.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_t.set(e,t))}return t}toString(){return this.cssText}};const f=i=>new At(typeof i=="string"?i:i+"",void 0,it),T=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,n,a)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[a+1],i[0]);return new At(e,i,it)},ie=(i,t)=>{st?i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const s=document.createElement("style"),n=g.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)})},yt=st?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return f(e)})(i):i;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/var nt;const F=window,wt=F.trustedTypes,ne=wt?wt.emptyScript:"",kt=F.reactiveElementPolyfillSupport,ot={toAttribute(
|
|
9
|
+
*/var nt;const F=window,wt=F.trustedTypes,ne=wt?wt.emptyScript:"",kt=F.reactiveElementPolyfillSupport,ot={toAttribute(i,t){switch(t){case Boolean:i=i?ne:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},xt=(i,t)=>t!==i&&(t==t||i==i),at={attribute:!0,type:String,converter:ot,reflect:!1,hasChanged:xt},rt="finalized";let H=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,s)=>{const n=this._$Ep(s,e);n!==void 0&&(this._$Ev.set(n,s),t.push(n))}),t}static createProperty(t,e=at){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s=typeof t=="symbol"?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const a=this[t];this[e]=n,this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||at}static finalize(){if(this.hasOwnProperty(rt))return!1;this[rt]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const n of s)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const n of s)e.unshift(yt(n))}else t!==void 0&&e.push(yt(t));return e}static _$Ep(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return ie(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostConnected)===null||s===void 0?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=at){var n;const a=this.constructor._$Ep(t,s);if(a!==void 0&&s.reflect===!0){const o=(((n=s.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?s.converter:ot).toAttribute(e,s.type);this._$El=t,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,a=n._$Ev.get(t);if(a!==void 0&&this._$El!==a){const o=n.getPropertyOptions(a),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?o.converter:ot;this._$El=a,this[a]=l.fromAttribute(e,o.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||xt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,a)=>this[a]=n),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(n=>{var a;return(a=n.hostUpdate)===null||a===void 0?void 0:a.call(n)}),this.update(s)):this._$Ek()}catch(n){throw e=!1,this._$Ek(),n}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var n;return(n=s.hostUpdated)===null||n===void 0?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};H[rt]=!0,H.elementProperties=new Map,H.elementStyles=[],H.shadowRootOptions={mode:"open"},kt==null||kt({ReactiveElement:H}),((nt=F.reactiveElementVersions)!==null&&nt!==void 0?nt:F.reactiveElementVersions=[]).push("1.6.3");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/var ct;const q=window,M=q.trustedTypes,Ct=M?M.createPolicy("lit-html",{createHTML:
|
|
13
|
+
*/var ct;const q=window,M=q.trustedTypes,Ct=M?M.createPolicy("lit-html",{createHTML:i=>i}):void 0,lt="$lit$",y=`lit$${(Math.random()+"").slice(9)}$`,St="?"+y,oe=`<${St}>`,k=document,Z=()=>k.createComment(""),O=i=>i===null||typeof i!="object"&&typeof i!="function",Et=Array.isArray,ae=i=>Et(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",ht=`[
|
|
14
14
|
\f\r]`,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Nt=/-->/g,Tt=/>/g,x=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ht=/'/g,Mt=/"/g,Rt=/^(?:script|style|textarea|title)$/i,re=
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ht=/'/g,Mt=/"/g,Rt=/^(?:script|style|textarea|title)$/i,re=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),ce=re(1),D=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),Ut=new WeakMap,C=k.createTreeWalker(k,129,null,!1);function Pt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ct!==void 0?Ct.createHTML(t):t}const le=(i,t)=>{const e=i.length-1,s=[];let n,a=t===2?"<svg>":"",o=L;for(let l=0;l<e;l++){const r=i[l];let c,h,d=-1,p=0;for(;p<r.length&&(o.lastIndex=p,h=o.exec(r),h!==null);)p=o.lastIndex,o===L?h[1]==="!--"?o=Nt:h[1]!==void 0?o=Tt:h[2]!==void 0?(Rt.test(h[2])&&(n=RegExp("</"+h[2],"g")),o=x):h[3]!==void 0&&(o=x):o===x?h[0]===">"?(o=n??L,d=-1):h[1]===void 0?d=-2:(d=o.lastIndex-h[2].length,c=h[1],o=h[3]===void 0?x:h[3]==='"'?Mt:Ht):o===Mt||o===Ht?o=x:o===Nt||o===Tt?o=L:(o=x,n=void 0);const $=o===x&&i[l+1].startsWith("/>")?" ":"";a+=o===L?r+oe:d>=0?(s.push(c),r.slice(0,d)+lt+r.slice(d)+y+$):r+y+(d===-2?(s.push(void 0),l):$)}return[Pt(i,a+(i[e]||"<?>")+(t===2?"</svg>":"")),s]};let dt=class ee{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let a=0,o=0;const l=t.length-1,r=this.parts,[c,h]=le(t,e);if(this.el=ee.createElement(c,s),C.currentNode=this.el.content,e===2){const d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(n=C.nextNode())!==null&&r.length<l;){if(n.nodeType===1){if(n.hasAttributes()){const d=[];for(const p of n.getAttributeNames())if(p.endsWith(lt)||p.startsWith(y)){const $=h[o++];if(d.push(p),$!==void 0){const gt=n.getAttribute($.toLowerCase()+lt).split(y),A=/([.?@])?(.*)/.exec($);r.push({type:1,index:a,name:A[2],strings:gt,ctor:A[1]==="."?de:A[1]==="?"?ue:A[1]==="@"?$e:X})}else r.push({type:6,index:a})}for(const p of d)n.removeAttribute(p)}if(Rt.test(n.tagName)){const d=n.textContent.split(y),p=d.length-1;if(p>0){n.textContent=M?M.emptyScript:"";for(let $=0;$<p;$++)n.append(d[$],Z()),C.nextNode(),r.push({type:2,index:++a});n.append(d[p],Z())}}}else if(n.nodeType===8)if(n.data===St)r.push({type:2,index:a});else{let d=-1;for(;(d=n.data.indexOf(y,d+1))!==-1;)r.push({type:7,index:a}),d+=y.length-1}a++}}static createElement(t,e){const s=k.createElement("template");return s.innerHTML=t,s}};function R(i,t,e=i,s){var n,a,o,l;if(t===D)return t;let r=s!==void 0?(n=e._$Co)===null||n===void 0?void 0:n[s]:e._$Cl;const c=O(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==c&&((a=r==null?void 0:r._$AO)===null||a===void 0||a.call(r,!1),c===void 0?r=void 0:(r=new c(i),r._$AT(i,e,s)),s!==void 0?((o=(l=e)._$Co)!==null&&o!==void 0?o:l._$Co=[])[s]=r:e._$Cl=r),r!==void 0&&(t=R(i,r._$AS(i,t.values),r,s)),t}let he=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:s},parts:n}=this._$AD,a=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:k).importNode(s,!0);C.currentNode=a;let o=C.nextNode(),l=0,r=0,c=n[0];for(;c!==void 0;){if(l===c.index){let h;c.type===2?h=new It(o,o.nextSibling,this,t):c.type===1?h=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(h=new me(o,this,t)),this._$AV.push(h),c=n[++r]}l!==(c==null?void 0:c.index)&&(o=C.nextNode(),l++)}return C.currentNode=k,a}v(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},It=class se{constructor(t,e,s,n){var a;this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cp=(a=n==null?void 0:n.isConnected)===null||a===void 0||a}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),O(t)?t===m||t==null||t===""?(this._$AH!==m&&this._$AR(),this._$AH=m):t!==this._$AH&&t!==D&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):ae(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==m&&O(this._$AH)?this._$AA.nextSibling.data=t:this.$(k.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,a=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=dt.createElement(Pt(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===a)this._$AH.v(s);else{const o=new he(a,this),l=o.u(this.options);o.v(s),this.$(l),this._$AH=o}}_$AC(t){let e=Ut.get(t.strings);return e===void 0&&Ut.set(t.strings,e=new dt(t)),e}T(t){Et(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const a of t)n===e.length?e.push(s=new se(this.k(Z()),this.k(Z()),this,this.options)):s=e[n],s._$AI(a),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}},X=class{constructor(t,e,s,n,a){this.type=1,this._$AH=m,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const a=this.strings;let o=!1;if(a===void 0)t=R(this,t,e,0),o=!O(t)||t!==this._$AH&&t!==D,o&&(this._$AH=t);else{const l=t;let r,c;for(t=a[0],r=0;r<a.length-1;r++)c=R(this,l[s+r],e,r),c===D&&(c=this._$AH[r]),o||(o=!O(c)||c!==this._$AH[r]),c===m?t=m:t!==m&&(t+=(c??"")+a[r+1]),this._$AH[r]=c}o&&!n&&this.j(t)}j(t){t===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},de=class extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===m?void 0:t}};const pe=M?M.emptyScript:"";let ue=class extends X{constructor(){super(...arguments),this.type=4}j(t){t&&t!==m?this.element.setAttribute(this.name,pe):this.element.removeAttribute(this.name)}},$e=class extends X{constructor(t,e,s,n,a){super(t,e,s,n,a),this.type=5}_$AI(t,e=this){var s;if((t=(s=R(this,t,e,0))!==null&&s!==void 0?s:m)===D)return;const n=this._$AH,a=t===m&&n!==m||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==m&&(n===m||a);a&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}},me=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}};const Ot=q.litHtmlPolyfillSupport;Ot==null||Ot(dt,It),((ct=q.litHtmlVersions)!==null&&ct!==void 0?ct:q.litHtmlVersions=[]).push("2.8.0");/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/var pt;const K=window,U=K.trustedTypes,Lt=U?U.createPolicy("lit-html",{createHTML:
|
|
19
|
+
*/var pt;const K=window,U=K.trustedTypes,Lt=U?U.createPolicy("lit-html",{createHTML:i=>i}):void 0,ut="$lit$",w=`lit$${(Math.random()+"").slice(9)}$`,Dt="?"+w,ve=`<${Dt}>`,S=document,z=()=>S.createComment(""),B=i=>i===null||typeof i!="object"&&typeof i!="function",zt=Array.isArray,be=i=>zt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",$t=`[
|
|
20
20
|
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Bt=/-->/g,jt=/>/g,E=RegExp(`>|${$t}(?:([^\\s"'>=/]+)(${$t}*=${$t}*(?:[^
|
|
21
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vt=/'/g,Wt=/"/g,Ft=/^(?:script|style|textarea|title)$/i,
|
|
21
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vt=/'/g,Wt=/"/g,Ft=/^(?:script|style|textarea|title)$/i,fe=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),G=fe(1),P=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),qt=new WeakMap,N=S.createTreeWalker(S,129,null,!1);function Zt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Lt!==void 0?Lt.createHTML(t):t}const ge=(i,t)=>{const e=i.length-1,s=[];let n,a=t===2?"<svg>":"",o=j;for(let l=0;l<e;l++){const r=i[l];let c,h,d=-1,p=0;for(;p<r.length&&(o.lastIndex=p,h=o.exec(r),h!==null);)p=o.lastIndex,o===j?h[1]==="!--"?o=Bt:h[1]!==void 0?o=jt:h[2]!==void 0?(Ft.test(h[2])&&(n=RegExp("</"+h[2],"g")),o=E):h[3]!==void 0&&(o=E):o===E?h[0]===">"?(o=n??j,d=-1):h[1]===void 0?d=-2:(d=o.lastIndex-h[2].length,c=h[1],o=h[3]===void 0?E:h[3]==='"'?Wt:Vt):o===Wt||o===Vt?o=E:o===Bt||o===jt?o=j:(o=E,n=void 0);const $=o===E&&i[l+1].startsWith("/>")?" ":"";a+=o===j?r+ve:d>=0?(s.push(c),r.slice(0,d)+ut+r.slice(d)+w+$):r+w+(d===-2?(s.push(void 0),l):$)}return[Zt(i,a+(i[e]||"<?>")+(t===2?"</svg>":"")),s]};class V{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let a=0,o=0;const l=t.length-1,r=this.parts,[c,h]=ge(t,e);if(this.el=V.createElement(c,s),N.currentNode=this.el.content,e===2){const d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(n=N.nextNode())!==null&&r.length<l;){if(n.nodeType===1){if(n.hasAttributes()){const d=[];for(const p of n.getAttributeNames())if(p.endsWith(ut)||p.startsWith(w)){const $=h[o++];if(d.push(p),$!==void 0){const gt=n.getAttribute($.toLowerCase()+ut).split(w),A=/([.?@])?(.*)/.exec($);r.push({type:1,index:a,name:A[2],strings:gt,ctor:A[1]==="."?Ae:A[1]==="?"?we:A[1]==="@"?ke:J})}else r.push({type:6,index:a})}for(const p of d)n.removeAttribute(p)}if(Ft.test(n.tagName)){const d=n.textContent.split(w),p=d.length-1;if(p>0){n.textContent=U?U.emptyScript:"";for(let $=0;$<p;$++)n.append(d[$],z()),N.nextNode(),r.push({type:2,index:++a});n.append(d[p],z())}}}else if(n.nodeType===8)if(n.data===Dt)r.push({type:2,index:a});else{let d=-1;for(;(d=n.data.indexOf(w,d+1))!==-1;)r.push({type:7,index:a}),d+=w.length-1}a++}}static createElement(t,e){const s=S.createElement("template");return s.innerHTML=t,s}}function I(i,t,e=i,s){var n,a,o,l;if(t===P)return t;let r=s!==void 0?(n=e._$Co)===null||n===void 0?void 0:n[s]:e._$Cl;const c=B(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==c&&((a=r==null?void 0:r._$AO)===null||a===void 0||a.call(r,!1),c===void 0?r=void 0:(r=new c(i),r._$AT(i,e,s)),s!==void 0?((o=(l=e)._$Co)!==null&&o!==void 0?o:l._$Co=[])[s]=r:e._$Cl=r),r!==void 0&&(t=I(i,r._$AS(i,t.values),r,s)),t}class _e{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:s},parts:n}=this._$AD,a=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:S).importNode(s,!0);N.currentNode=a;let o=N.nextNode(),l=0,r=0,c=n[0];for(;c!==void 0;){if(l===c.index){let h;c.type===2?h=new W(o,o.nextSibling,this,t):c.type===1?h=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(h=new xe(o,this,t)),this._$AV.push(h),c=n[++r]}l!==(c==null?void 0:c.index)&&(o=N.nextNode(),l++)}return N.currentNode=S,a}v(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class W{constructor(t,e,s,n){var a;this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cp=(a=n==null?void 0:n.isConnected)===null||a===void 0||a}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=I(this,t,e),B(t)?t===v||t==null||t===""?(this._$AH!==v&&this._$AR(),this._$AH=v):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):be(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==v&&B(this._$AH)?this._$AA.nextSibling.data=t:this.$(S.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,a=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=V.createElement(Zt(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===a)this._$AH.v(s);else{const o=new _e(a,this),l=o.u(this.options);o.v(s),this.$(l),this._$AH=o}}_$AC(t){let e=qt.get(t.strings);return e===void 0&&qt.set(t.strings,e=new V(t)),e}T(t){zt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const a of t)n===e.length?e.push(s=new W(this.k(z()),this.k(z()),this,this.options)):s=e[n],s._$AI(a),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class J{constructor(t,e,s,n,a){this.type=1,this._$AH=v,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=v}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const a=this.strings;let o=!1;if(a===void 0)t=I(this,t,e,0),o=!B(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{const l=t;let r,c;for(t=a[0],r=0;r<a.length-1;r++)c=I(this,l[s+r],e,r),c===P&&(c=this._$AH[r]),o||(o=!B(c)||c!==this._$AH[r]),c===v?t=v:t!==v&&(t+=(c??"")+a[r+1]),this._$AH[r]=c}o&&!n&&this.j(t)}j(t){t===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ae extends J{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===v?void 0:t}}const ye=U?U.emptyScript:"";class we extends J{constructor(){super(...arguments),this.type=4}j(t){t&&t!==v?this.element.setAttribute(this.name,ye):this.element.removeAttribute(this.name)}}class ke extends J{constructor(t,e,s,n,a){super(t,e,s,n,a),this.type=5}_$AI(t,e=this){var s;if((t=(s=I(this,t,e,0))!==null&&s!==void 0?s:v)===P)return;const n=this._$AH,a=t===v&&n!==v||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==v&&(n===v||a);a&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}}class xe{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){I(this,t)}}const Xt=K.litHtmlPolyfillSupport;Xt==null||Xt(V,W),((pt=K.litHtmlVersions)!==null&&pt!==void 0?pt:K.litHtmlVersions=[]).push("2.8.0");const Ce=(i,t,e)=>{var s,n;const a=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:t;let o=a._$litPart$;if(o===void 0){const l=(n=e==null?void 0:e.renderBefore)!==null&&n!==void 0?n:null;a._$litPart$=o=new W(t.insertBefore(z(),l),l,void 0,e??{})}return o._$AI(i),o};/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/var mt,vt;let _=class extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const
|
|
25
|
+
*/var mt,vt;let _=class extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ce(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return P}};_.finalized=!0,_._$litElement$=!0,(mt=globalThis.litElementHydrateSupport)===null||mt===void 0||mt.call(globalThis,{LitElement:_});const Kt=globalThis.litElementPolyfillSupport;Kt==null||Kt({LitElement:_}),((vt=globalThis.litElementVersions)!==null&&vt!==void 0?vt:globalThis.litElementVersions=[]).push("3.3.3");const Se=T`
|
|
26
26
|
* {
|
|
27
27
|
box-sizing: border-box;
|
|
28
28
|
}
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
`,Te=T`
|
|
231
231
|
:host {
|
|
232
232
|
display: flex;
|
|
233
|
-
background: ${
|
|
233
|
+
background: ${f(u.casColorBackground1ModeLight)};
|
|
234
234
|
box-shadow: 0 2px 10px #C9CFE3;
|
|
235
235
|
border-radius: 8px;
|
|
236
236
|
width: var(--cas-snackbar-width);
|
|
@@ -243,8 +243,8 @@
|
|
|
243
243
|
align-items: center;
|
|
244
244
|
justify-content: center;
|
|
245
245
|
padding: 14px 12px;
|
|
246
|
-
background-color: ${
|
|
247
|
-
color: ${
|
|
246
|
+
background-color: ${f(u.casColorTertiary3ModeLight)};
|
|
247
|
+
color: ${f(u.casColorBackground1ModeLight)};
|
|
248
248
|
border-radius: 8px 0 0 8px;
|
|
249
249
|
}
|
|
250
250
|
:host .content {
|
|
@@ -253,58 +253,58 @@
|
|
|
253
253
|
align-items: center;
|
|
254
254
|
justify-content: space-between;
|
|
255
255
|
gap:12px;
|
|
256
|
-
color: ${
|
|
256
|
+
color: ${f(u.casColorTertiary2ModeLight)};
|
|
257
257
|
padding: 14px 16px 14px 24px;
|
|
258
258
|
}
|
|
259
259
|
:host .content .text-container cas-text:nth-child(2) {
|
|
260
|
-
color: ${
|
|
260
|
+
color: ${f(u.casColorTertiary3ModeLight)};
|
|
261
261
|
}
|
|
262
262
|
:host .content .text-container a {
|
|
263
|
-
color: ${
|
|
263
|
+
color: ${f(u.casColorPrimary2ModeLight)};
|
|
264
264
|
}
|
|
265
265
|
/* VARIANTS*/
|
|
266
266
|
:host([variant='success']) .icon {
|
|
267
|
-
background-color: ${
|
|
267
|
+
background-color: ${f(u.casColorSuccess1ModeLight)};
|
|
268
268
|
}
|
|
269
269
|
:host([variant='error']) .icon {
|
|
270
|
-
background-color: ${
|
|
270
|
+
background-color: ${f(u.casColorError1ModeLight)};
|
|
271
271
|
}
|
|
272
272
|
:host([variant='warning']) .icon {
|
|
273
|
-
background-color: ${
|
|
273
|
+
background-color: ${f(u.casColorWarning1ModeLight)};
|
|
274
274
|
}
|
|
275
275
|
:host([variant='info']) .icon {
|
|
276
|
-
background-color: ${
|
|
276
|
+
background-color: ${f(u.casColorSecondary1ModeLight)};
|
|
277
277
|
}
|
|
278
|
-
`,He={accessibilityLabel:null,animationDone:!1,animationDuration:300,animationName:"default",buttonCallback:null,buttonText:null,customClasses:null,duration:4e3,hideCallback:null,title:"Title is required",message:"Snackbar: It's a snackbar!",linkMessage:null,targetLink:"_parent",showCallback:null,size:"normal",type:"auto",variant:"default"},Me=["default","slide-in","zoom"],Re=["small","normal","large"],Ue=["auto","dismiss"],Pe=["default","success","error","warning","info"],Gt={accessibilityLabel:
|
|
278
|
+
`,He={accessibilityLabel:null,animationDone:!1,animationDuration:300,animationName:"default",buttonCallback:null,buttonText:null,customClasses:null,duration:4e3,hideCallback:null,title:"Title is required",message:"Snackbar: It's a snackbar!",linkMessage:null,targetLink:"_parent",showCallback:null,size:"normal",type:"auto",variant:"default"},Me=["default","slide-in","zoom"],Re=["small","normal","large"],Ue=["auto","dismiss"],Pe=["default","success","error","warning","info"],Gt={accessibilityLabel:i=>!i||typeof i=="string",animationDuration:i=>!i||typeof i=="number",animationName:i=>!i||typeof i=="string"&&Me.includes(i),buttonCallback:i=>!i||typeof i=="function",buttonText:i=>!i||typeof i=="string",customClasses:i=>!i||typeof i=="string",duration:i=>!i||typeof i=="number"&&!Number.isNaN(i),hideCallback:i=>!i||typeof i=="function",title:i=>!i||typeof i=="string"&&i.length>0,message:i=>!i||typeof i=="string"&&i.length>0,linkMessage:i=>!i||typeof i=="string"&&i.length>0,targetLink:i=>!i||typeof i=="string"&&i.length>0,showCallback:i=>!i||typeof i=="function",size:i=>!i||typeof i=="string"&&Re.includes(i),type:i=>!i||typeof i=="string"&&Ue.includes(i),variant:i=>!i||typeof i=="string"&&Pe.includes(i)};function Ie(i){return Object.keys(Gt).filter(t=>!Gt[t](i[t])).map(t=>new Error(`${t} is invalid.`))}/**
|
|
279
279
|
* @license
|
|
280
280
|
* Copyright 2020 Google LLC
|
|
281
281
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
282
|
-
*/const Oe=Symbol.for(""),Le=
|
|
282
|
+
*/const Oe=Symbol.for(""),Le=i=>{if((i==null?void 0:i.r)===Oe)return i==null?void 0:i._$litStatic$},Jt=new Map,De=i=>(t,...e)=>{const s=e.length;let n,a;const o=[],l=[];let r,c=0,h=!1;for(;c<s;){for(r=t[c];c<s&&(a=e[c],(n=Le(a))!==void 0);)r+=n+t[++c],h=!0;c!==s&&l.push(a),o.push(r),c++}if(c===s&&o.push(t[s]),h){const d=o.join("$$lit$$");(t=Jt.get(d))===void 0&&(o.raw=o,Jt.set(d,t=o)),e=l}return i(t,...e)},Y=De(ce),Yt={default:{showAnimation:[{opacity:"0"},{opacity:"1"}],hideAnimation:[{opacity:"1"},{opacity:"0"}]},"slide-in":{showAnimation:[{transform:"translateX(-100%)",opacity:"0"},{transform:"translateX(0)",opacity:"1"}],hideAnimation:[{transform:"translateX(0)",opacity:"1"},{transform:"translateX(-100%)",opacity:"0"}]},zoom:{showAnimation:[{transform:"scale(0)",opacity:"0"},{transform:"scale(1)",opacity:"1"}],hideAnimation:[{transform:"scale(1)",opacity:"1"},{transform:"scale(0)",opacity:"0"}]}};function ze({type:i,variant:t}){const s={default:{title:"body2",text:"footnote2"},autoClose:{title:"body1",text:"body1"}}[i==="auto"?"autoClose":"default"],a={success:"flat-success",error:"flat-error",warning:"flat-alert",info:"flat-info"}[t];return{textVariants:s,icon:a}}class Be extends _{static get styles(){return T`${Te}`}render(){const{message:t,title:e,linkMessage:s,type:n,targetLink:a,variant:o}=this,{textVariants:l,icon:r}=ze({type:n,variant:o}),c=Y`<cas-text variant=${l.text}>${t}</cas-text>`,h=Y`<cas-text variant=${l.text}><a href="${s}" target="${a}">${t}</a></cas-text>`;return Y`
|
|
283
283
|
<div class="icon">
|
|
284
284
|
<cas-icon name=${r} size="24"></cas-icon>
|
|
285
285
|
</div>
|
|
286
286
|
<div class="content">
|
|
287
287
|
<div class="text-container">
|
|
288
288
|
<cas-text id="snackbarMessage" variant=${l.title}>${e}</cas-text>
|
|
289
|
-
${
|
|
289
|
+
${s?h:c}
|
|
290
290
|
</div>
|
|
291
291
|
${n==="dismiss"?Y`<div id="snackbarButton" class="close-icon" @click=${this._handleButtonClick}>
|
|
292
292
|
<cas-icon name="flat-close" size="16"></cas-icon>
|
|
293
293
|
</div>`:""}
|
|
294
294
|
</div>
|
|
295
|
-
`}static get properties(){return{animationDone:{type:Boolean},animationDuration:{type:Number},animationName:{type:String},buttonCallback:{type:Function},buttonText:{type:String},duration:{type:Number},id:{type:String},title:{type:String},message:{type:String},linkMessage:{type:String},targetLink:{type:String},type:{type:String},variant:{type:String}}}constructor(){super(),this._timer=this._timer.bind(this),this._showStart=Date.now()}connectedCallback(){super.connectedCallback(),(this.type==="auto"||this.type!=="dismiss")&&this._timer(),this.setAttribute("aria-label",this.accessibilityLabel||`Snackbar: ${this.message}`),this.setAttribute("role","alert")}_timer(){Date.now()-this._showStart>=this.duration?(this._fadeOut(),cancelAnimationFrame(this._timer)):requestAnimationFrame(this._timer)}update(t){super.update(t),this.animationDone||this._fadeIn()}_fadeIn(){const t=Yt[this.animationName].showAnimation,e={duration:this.animationDuration,iterations:1},
|
|
295
|
+
`}static get properties(){return{animationDone:{type:Boolean},animationDuration:{type:Number},animationName:{type:String},buttonCallback:{type:Function},buttonText:{type:String},duration:{type:Number},id:{type:String},title:{type:String},message:{type:String},linkMessage:{type:String},targetLink:{type:String},type:{type:String},variant:{type:String}}}constructor(){super(),this._timer=this._timer.bind(this),this._showStart=Date.now()}connectedCallback(){super.connectedCallback(),(this.type==="auto"||this.type!=="dismiss")&&this._timer(),this.setAttribute("aria-label",this.accessibilityLabel||`Snackbar: ${this.message}`),this.setAttribute("role","alert")}_timer(){Date.now()-this._showStart>=this.duration?(this._fadeOut(),cancelAnimationFrame(this._timer)):requestAnimationFrame(this._timer)}update(t){super.update(t),this.animationDone||this._fadeIn()}_fadeIn(){const t=Yt[this.animationName].showAnimation,e={duration:this.animationDuration,iterations:1},s=this.animate(t,e);s.onfinish=()=>{typeof this.showCallback=="function"&&this.showCallback()},this.dispatchEvent(new CustomEvent("cas-snackbar-bar-has-faded-in",{bubbles:!0,composed:!0,detail:{snackbarID:this.id}}))}_fadeOut(){const t=Yt[this.animationName].hideAnimation,e={duration:this.animationDuration,iterations:1},s=this.animate(t,e);s.onfinish=()=>{typeof this.hideCallback=="function"&&this.hideCallback(),this._removeSnackbar()}}_removeSnackbar(){this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-remove",{bubbles:!0,composed:!0,detail:{snackbarID:this.id}}))}_handleButtonClick(){this._fadeOut(),typeof this.buttonCallback=="function"&&this.buttonCallback()}}class bt extends _{constructor(){super(),this.position="bottom left"}render(){const{position:t}=this;return G`
|
|
296
296
|
<cas-snackbar-provider-custom position=${t}></cas-snackbar-provider-custom>
|
|
297
297
|
<slot></slot>
|
|
298
298
|
`}}et(bt,"shadowRootOptions",{..._.shadowRootOptions,mode:"open"}),et(bt,"properties",{position:{type:String}});class Qt extends _{render(){return G``}static get styles(){return T`
|
|
299
299
|
${Ne}
|
|
300
|
-
`}constructor(){super(),this.newSnackbarProperties=["accessibilityLabel","animationDuration","animationName","buttonCallback","duration","hideCallback","title","message","linkMessage","targetLink","showCallback","type","hasFadedIn"],this.newSnackbarAttributes=["id","size","variant"],window.addEventListener("cas-snackbar-snackbar-add",this._handleSnackbarAdd.bind(this)),window.addEventListener("cas-snackbar-snackbar-remove",this._handleSnackbarRemove.bind(this))}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-ready",{bubbles:!0,composed:!0})),this.setAttribute("aria-live","polite")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("cas-snackbar-snackbar-add",this._handleSnackbarAdd.bind(this)),window.removeEventListener("cas-snackbar-snackbar-remove",this._handleSnackbarRemove.bind(this))}_handleSnackbarAdd(t){const e=t.detail||{},
|
|
300
|
+
`}constructor(){super(),this.newSnackbarProperties=["accessibilityLabel","animationDuration","animationName","buttonCallback","duration","hideCallback","title","message","linkMessage","targetLink","showCallback","type","hasFadedIn"],this.newSnackbarAttributes=["id","size","variant"],window.addEventListener("cas-snackbar-snackbar-add",this._handleSnackbarAdd.bind(this)),window.addEventListener("cas-snackbar-snackbar-remove",this._handleSnackbarRemove.bind(this))}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-ready",{bubbles:!0,composed:!0})),this.setAttribute("aria-live","polite")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("cas-snackbar-snackbar-add",this._handleSnackbarAdd.bind(this)),window.removeEventListener("cas-snackbar-snackbar-remove",this._handleSnackbarRemove.bind(this))}_handleSnackbarAdd(t){const e=t.detail||{},s=Ie(e);if(s.length>0)for(const{message:n}of s)console.error("There was a problem creating your snackbar. Please check your custom event options.",n);else{const n={id:Date.now(),...He,...e},a=this._createNewSnackbar(n);this.shadowRoot.prepend(a),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-bar-added",{bubbles:!0,composed:!0,detail:{snackbarID:a.id}}))}}_handleSnackbarRemove(t){var e;(e=this.shadowRoot.getElementById(t.detail.snackbarID))==null||e.remove(),this.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-bar-removed",{bubbles:!0,composed:!0,detail:{snackbarID:t.detail.snackbarID}}))}_createNewSnackbar(t){const e=document.querySelector("cas-snackbar-provider");t.position&&(e==null||e.setAttribute("position",t.position));const s=document.createElement("cas-snackbar");return this.newSnackbarProperties.forEach(n=>{s[n]=t[n]}),this.newSnackbarAttributes.forEach(n=>{s.setAttribute(n,t[n])}),t.customClasses&&(s.className+=t.customClasses),s}}const Q=({variant:i,config:t})=>{const{title:e,message:s,linkMessage:n,targetLink:a,autoHide:o,autoHideDuration:l,position:r}=t;window.dispatchEvent(new CustomEvent("cas-snackbar-snackbar-add",{bubbles:!0,composed:!0,detail:{variant:i,title:e,message:s,linkMessage:n,targetLink:a,position:r||null,animationName:"slide-in",type:o?"auto":"dismiss",duration:l||4e3}}))},tt={SUCCESS:"success",ERROR:"error",WARNING:"warning",INFO:"info"},te={success:i=>Q({variant:tt.SUCCESS,config:i}),error:i=>Q({variant:tt.ERROR,config:i}),warning:i=>Q({variant:tt.WARNING,config:i}),info:i=>Q({variant:tt.INFO,config:i})};customElements.get("cas-snackbar")||customElements.define("cas-snackbar",Be),customElements.get("cas-snackbar-provider-custom")||customElements.define("cas-snackbar-provider-custom",Qt),customElements.get("cas-snackbar-provider")||customElements.define("cas-snackbar-provider",bt),window.cas=window.cas||{},window.cas.snackbar=te;class ft extends _{constructor(){super(),this.open=!1,this.text=document.title,this.isMobile=window.innerWidth<768,this.shareFacebook=this.shareFacebook.bind(this),this.shareTwitter=this.shareTwitter.bind(this),this.shareWhatsApp=this.shareWhatsApp.bind(this),this.shareTelegram=this.shareTelegram.bind(this),this.shareEmail=this.shareEmail.bind(this),this.shareInstagram=this.shareInstagram.bind(this),this.platforms=[{title:"WhatsApp",icon:"flat-whatsapp",share:this.shareWhatsApp},{title:"Instagram",icon:"flat-instagramSolid",share:this.shareInstagram},{title:"Facebook",icon:"flat-facebook",share:this.shareFacebook},{title:"Twitter",icon:"flat-twitter",share:this.shareTwitter},{title:"Correo",icon:"flat-mail",share:this.shareEmail}]}static get properties(){return{text:{type:String}}}firstUpdated(){const t=this.shadowRoot.querySelector("cas-modal");t==null||t.addEventListener("close",()=>{this.open=!1,this.requestUpdate()});const e=()=>{this.isMobile=window.innerWidth<768,this.requestUpdate()};window.addEventListener("resize",e);const n=this.shadowRoot.querySelector("slot").assignedElements()[0];if(n)n.addEventListener("click",this.handleOpenShare.bind(this)),this.shadowRoot.querySelector(".default-button").remove();else{const a=this.shadowRoot.querySelector(".default-button");a==null||a.addEventListener("click",this.handleOpenShare.bind(this))}}render(){const t=this.isMobile?"190px":"initial";return G`
|
|
301
301
|
<cas-modal variant="compact" open="${this.open}" width=${t}>
|
|
302
302
|
<div class="modal">
|
|
303
303
|
<cas-text variant="headline3" class="hide-mobile">Compartir en:</cas-text>
|
|
304
304
|
<div class="list">
|
|
305
|
-
${this.platforms.map(({title:e,icon:
|
|
305
|
+
${this.platforms.map(({title:e,icon:s,share:n})=>G` <button class="item" @click="${()=>n()}">
|
|
306
306
|
<div class="icon">
|
|
307
|
-
<cas-icon name="${
|
|
307
|
+
<cas-icon name="${s}" size="24"></cas-icon>
|
|
308
308
|
</div>
|
|
309
309
|
<cas-text variant="caption2">${e}</cas-text>
|
|
310
310
|
</button>`)}
|
|
@@ -326,7 +326,8 @@
|
|
|
326
326
|
</div>
|
|
327
327
|
</cas-modal>
|
|
328
328
|
|
|
329
|
-
<
|
|
330
|
-
|
|
329
|
+
<slot></slot>
|
|
330
|
+
<button class="share-icon default-button">
|
|
331
|
+
<cas-icon name="flat-share" size="20"></cas-icon>
|
|
331
332
|
</button>
|
|
332
|
-
`}handleOpenShare(){this.open=!0,this.requestUpdate();try{window.dataLayer.push({event:"evento-interactivo","evento-interactivo-categoria":"boton_compartir_blog","evento-interactivo-accion":"click","evento-interactivo-etiqueta":"compartir_articulo"})}catch(t){console.error("Error al enviar evento a GTM",t)}}shareFacebook(){const t=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(window.location.href)}`;window.open(t,"_blank","width=550,height=420")}shareTwitter(){const t=`https://twitter.com/intent/tweet?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(t,"_blank","width=550,height=420")}shareWhatsApp(){const t=`https://wa.me/?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(t,"_blank","width=550,height=420")}shareTelegram(){const t=`https://t.me/share/url?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(t,"_blank","width=550,height=420")}shareEmail(){const t=`mailto:?subject=${encodeURIComponent(this.text)}&body=${encodeURIComponent(window.location.href)}`;window.open(t,"_blank")}shareInstagram(){this.copyToClipboard(),window.open("https://www.instagram.com/direct/inbox/","_blank")}copyToClipboard(){navigator.clipboard.writeText(window.location.href),te.success({title:"Enlace copiado al portapapeles",position:"top center",autoHide:!0,autoHideDuration:1600})}}et(
|
|
333
|
+
`}handleOpenShare(){this.open=!0,this.requestUpdate();try{window.dataLayer.push({event:"evento-interactivo","evento-interactivo-categoria":"boton_compartir_blog","evento-interactivo-accion":"click","evento-interactivo-etiqueta":"compartir_articulo"})}catch(t){console.error("Error al enviar evento a GTM",t)}}shareFacebook(){const t=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(window.location.href)}`;window.open(t,"_blank","width=550,height=420")}shareTwitter(){const t=`https://twitter.com/intent/tweet?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(t,"_blank","width=550,height=420")}shareWhatsApp(){const t=`https://wa.me/?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(t,"_blank","width=550,height=420")}shareTelegram(){const t=`https://t.me/share/url?text=${encodeURIComponent(`${this.text} ${window.location.href}`)}`;window.open(t,"_blank","width=550,height=420")}shareEmail(){const t=`mailto:?subject=${encodeURIComponent(this.text)}&body=${encodeURIComponent(window.location.href)}`;window.open(t,"_blank")}shareInstagram(){this.copyToClipboard(),window.open("https://www.instagram.com/direct/inbox/","_blank")}copyToClipboard(){navigator.clipboard.writeText(window.location.href),te.success({title:"Enlace copiado al portapapeles",position:"top center",autoHide:!0,autoHideDuration:1600})}}et(ft,"styles",Se),customElements.define("cas-share",ft),b.CasShare=ft,b.CasSnackbarProvider=Qt,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|