@dreamsengine/dreams-ad-engine 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -35,3 +35,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
35
35
  ### Fixed
36
36
 
37
37
  - Fixed interstitial display
38
+
39
+ ## [0.1.5] - 2024-11-25
40
+
41
+ ### Fixed
42
+
43
+ - Fixed initialization of apsgtag
44
+
45
+ ## [0.1.6] - 2024-11-27
46
+
47
+ ### Fixed
48
+
49
+ - Multiple initialization of apstag
50
+
51
+ ### Added
52
+
53
+ - Property targeting for ads
54
+ - Property setCentering for ads
55
+ - Property enableLazyLoad for ads
56
+ - Property configLazyLoad for ads
package/README.md CHANGED
@@ -42,29 +42,42 @@ Add the script of apstag in the template head of html if you use it.
42
42
  adUnit="xxx-xx-x-xx"
43
43
  mapping='[{"viewport":[320,0],"sizing":[[320,50],[320,100]]},{"viewport":[720,0],"sizing":[[728,90]]},{"viewport":[970,0],"sizing":[[920,250],[970,90],[728,90]]},{"viewport":[1280,0],"sizing":[[920,250],[970,250],[970,90],[728,90]]}]'
44
44
  sizing="[[320,50],[320,100],[728,90],[970,90],[920,250],[970,250]]"
45
+ targeting='[{"key":"kev1","value": "value1"},{"key":"key2","value":"value2"}...]'
46
+ setCentering
47
+ enableLazyLoad
48
+ configLazyLoad='{"fetchMarginPercent":500,"renderMarginPercent":200,"mobileScaling":2.0}'
45
49
  refresh
46
50
  enableTitle
47
51
  title="Anuncio"
48
52
  apstag
49
53
  pubId="xxx-xxxxx-xxxx-xxxx-xxx"
54
+ bidTimeout="2e3"
50
55
  ></dreams-ad-engine>
51
56
  ```
52
57
 
53
58
  ### Options
54
59
 
55
- | Option | Type | Required | Default |
56
- | ----------- | ------- | -------- | ---------- |
57
- | networkId | String | Yes | - |
58
- | adUnit | String | Yes | - |
59
- | mapping | Array | Yes | - |
60
- | sizing | Array | Yes | - |
61
- | refresh | Boolean | No | false |
62
- | enableTitle | Boolean | No | false |
63
- | title | String | No | Publicidad |
64
- | apstag | Boolean | No | false |
65
- | pubId | String | No | - |
66
- | bidTimeout | Number | No | 2e3 |
67
-
60
+ | Option | Type | Required | Default |
61
+ | -------------- | ------- | -------- | ---------------------------------------------------------------------------------- |
62
+ | networkId | String | Yes | - |
63
+ | adUnit | String | Yes | - |
64
+ | mapping | String | Yes | - |
65
+ | sizing | String | Yes | - |
66
+ | targeting | String | No | \'[]\' |
67
+ | setCentering | Boolean | No | false |
68
+ | enableLazyLoad | Boolean | No | false |
69
+ | configLazyLoad | String | No | \'{\"fetchMarginPercent\":500,\"renderMarginPercent\":200,\"mobileScaling\":2.0}\' |
70
+ | refresh | Boolean | No | false |
71
+ | enableTitle | Boolean | No | false |
72
+ | title | String | No | Publicidad |
73
+ | apstag | Boolean | No | false |
74
+ | pubId | String | No | - |
75
+ | bidTimeout | Number | No | 2e3 |
76
+
77
+ - targeting: Array of objects with key and value for targeting
78
+ - setCentering: Enables and disables horizontal centering of ads, only ads that are requested after calling this method will be centered
79
+ - enableLazyLoad: Enables lazy loading in GPT as defined by the config object.
80
+ - configLazyLoad: Config object of LazyLoad
68
81
  - refresh: If you use this param the ad will be available to refresh it
69
82
  - enableTitle: If you use this param one title appears above of the ad
70
83
  - title: If you use this param overwrite "Publicidad"
@@ -1,22 +1,22 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function e(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=e(i);fetch(i.href,r)}})();/**
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function e(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=e(i);fetch(i.href,o)}})();/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const M=globalThis,V=M.ShadowRoot&&(M.ShadyCSS===void 0||M.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ot=Symbol(),F=new WeakMap;let vt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ot)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(V&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}};const at=n=>new vt(typeof n=="string"?n:n+"",void 0,ot),$t=(n,t)=>{if(V)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=M.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},G=V?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return at(e)})(n):n;/**
5
+ */const I=globalThis,V=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,at=Symbol(),G=new WeakMap;let vt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==at)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(V&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=G.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&G.set(e,t))}return t}toString(){return this.cssText}};const dt=n=>new vt(typeof n=="string"?n:n+"",void 0,at),$t=(n,t)=>{if(V)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=I.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},K=V?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return dt(e)})(n):n;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:_t,defineProperty:mt,getOwnPropertyDescriptor:yt,getOwnPropertyNames:At,getOwnPropertySymbols:bt,getPrototypeOf:wt}=Object,m=globalThis,K=m.trustedTypes,St=K?K.emptyScript:"",j=m.reactiveElementPolyfillSupport,C=(n,t)=>n,R={toAttribute(n,t){switch(t){case Boolean:n=n?St:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},J=(n,t)=>!_t(n,t),Z={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:J};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);class w extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Z){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&mt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=yt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const d=i==null?void 0:i.call(this);r.call(this,o),this.requestUpdate(t,d,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Z}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;const t=wt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){const e=this.properties,s=[...At(e),...bt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(G(i))}else t!==void 0&&e.push(G(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $t(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var r;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:R).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const o=s.getPropertyOptions(i),d=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:R;this._$Em=i,this[i]=d.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??J)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[C("elementProperties")]=new Map,w[C("finalized")]=new Map,j==null||j({ReactiveElement:w}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:yt,defineProperty:_t,getOwnPropertyDescriptor:mt,getOwnPropertyNames:bt,getOwnPropertySymbols:At,getPrototypeOf:wt}=Object,_=globalThis,Z=_.trustedTypes,St=Z?Z.emptyScript:"",B=_.reactiveElementPolyfillSupport,x=(n,t)=>n,H={toAttribute(n,t){switch(t){case Boolean:n=n?St:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},J=(n,t)=>!yt(n,t),Q={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:J};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class w extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Q){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&_t(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=mt(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i==null?void 0:i.call(this)},set(r){const d=i==null?void 0:i.call(this);o.call(this,r),this.requestUpdate(t,d,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Q}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=wt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const e=this.properties,s=[...bt(e),...At(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(K(i))}else t!==void 0&&e.push(K(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $t(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const r=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:H).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),d=typeof r.converter=="function"?{fromAttribute:r.converter}:((o=r.converter)==null?void 0:o.fromAttribute)!==void 0?r.converter:H;this._$Em=i,this[i]=d.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??J)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,r]of i)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[x("elementProperties")]=new Map,w[x("finalized")]=new Map,B==null||B({ReactiveElement:w}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const U=globalThis,D=U.trustedTypes,Q=D?D.createPolicy("lit-html",{createHTML:n=>n}):void 0,dt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,lt="?"+_,Et=`<${lt}>`,b=document,O=()=>b.createComment(""),N=n=>n===null||typeof n!="object"&&typeof n!="function",ht=Array.isArray,xt=n=>ht(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",B=`[
14
- \f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,X=/-->/g,Y=/>/g,y=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,ct=/^(?:script|style|textarea|title)$/i,Pt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),P=Pt(1),S=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),it=new WeakMap,A=b.createTreeWalker(b,129);function pt(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Q!==void 0?Q.createHTML(t):t}const Ct=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":"",o=x;for(let d=0;d<e;d++){const a=n[d];let c,u,l=-1,v=0;for(;v<a.length&&(o.lastIndex=v,u=o.exec(a),u!==null);)v=o.lastIndex,o===x?u[1]==="!--"?o=X:u[1]!==void 0?o=Y:u[2]!==void 0?(ct.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=y):u[3]!==void 0&&(o=y):o===y?u[0]===">"?(o=i??x,l=-1):u[1]===void 0?l=-2:(l=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?y:u[3]==='"'?et:tt):o===et||o===tt?o=y:o===X||o===Y?o=x:(o=y,i=void 0);const $=o===y&&n[d+1].startsWith("/>")?" ":"";r+=o===x?a+Et:l>=0?(s.push(c),a.slice(0,l)+dt+a.slice(l)+_+$):a+_+(l===-2?d:$)}return[pt(n,r+(n[e]||"<?>")+(t===2?"</svg>":"")),s]};class z{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const d=t.length-1,a=this.parts,[c,u]=Ct(t,e);if(this.el=z.createElement(c,s),A.currentNode=this.el.content,e===2){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=A.nextNode())!==null&&a.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(dt)){const v=u[o++],$=i.getAttribute(l).split(_),k=/([.?@])?(.*)/.exec(v);a.push({type:1,index:r,name:k[2],strings:$,ctor:k[1]==="."?Tt:k[1]==="?"?Ot:k[1]==="@"?Nt:L}),i.removeAttribute(l)}else l.startsWith(_)&&(a.push({type:6,index:r}),i.removeAttribute(l));if(ct.test(i.tagName)){const l=i.textContent.split(_),v=l.length-1;if(v>0){i.textContent=D?D.emptyScript:"";for(let $=0;$<v;$++)i.append(l[$],O()),A.nextNode(),a.push({type:2,index:++r});i.append(l[v],O())}}}else if(i.nodeType===8)if(i.data===lt)a.push({type:2,index:r});else{let l=-1;for(;(l=i.data.indexOf(_,l+1))!==-1;)a.push({type:7,index:r}),l+=_.length-1}r++}}static createElement(t,e){const s=b.createElement("template");return s.innerHTML=t,s}}function E(n,t,e=n,s){var o,d;if(t===S)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=N(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((d=i==null?void 0:i._$AO)==null||d.call(i,!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=E(n,i._$AS(n,t.values),i,s)),t}class Ut{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){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??b).importNode(e,!0);A.currentNode=i;let r=A.nextNode(),o=0,d=0,a=s[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new I(r,r.nextSibling,this,t):a.type===1?c=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(c=new zt(r,this,t)),this._$AV.push(c),a=s[++d]}o!==(a==null?void 0:a.index)&&(r=A.nextNode(),o++)}return A.currentNode=b,i}p(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 I{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}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=E(this,t,e),N(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xt(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==p&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(b.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=z.createElement(pt(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(e);else{const o=new Ut(i,this),d=o.u(this.options);o.p(e),this.T(d),this._$AH=o}}_$AC(t){let e=it.get(t.strings);return e===void 0&&it.set(t.strings,e=new z(t)),e}k(t){ht(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new I(this.S(O()),this.S(O()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class L{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=E(this,t,e,0),o=!N(t)||t!==this._$AH&&t!==S,o&&(this._$AH=t);else{const d=t;let a,c;for(t=r[0],a=0;a<r.length-1;a++)c=E(this,d[s+a],e,a),c===S&&(c=this._$AH[a]),o||(o=!N(c)||c!==this._$AH[a]),c===p?t=p:t!==p&&(t+=(c??"")+r[a+1]),this._$AH[a]=c}o&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Tt extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class Ot extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class Nt extends L{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??p)===S)return;const s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class zt{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){E(this,t)}}const W=U.litHtmlPolyfillSupport;W==null||W(z,I),(U.litHtmlVersions??(U.litHtmlVersions=[])).push("3.1.3");const It=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new I(t.insertBefore(O(),r),r,void 0,e??{})}return i._$AI(n),i};/**
13
+ */const U=globalThis,R=U.trustedTypes,X=R?R.createPolicy("lit-html",{createHTML:n=>n}):void 0,lt="$lit$",y=`lit$${Math.random().toFixed(9).slice(2)}$`,ht="?"+y,Et=`<${ht}>`,A=document,O=()=>A.createComment(""),T=n=>n===null||typeof n!="object"&&typeof n!="function",F=Array.isArray,Pt=n=>F(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",j=`[
14
+ \f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,tt=/>/g,m=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),et=/'/g,it=/"/g,ct=/^(?:script|style|textarea|title)$/i,Ct=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),C=Ct(1),S=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),st=new WeakMap,b=A.createTreeWalker(A,129);function pt(n,t){if(!F(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return X!==void 0?X.createHTML(t):t}const xt=(n,t)=>{const e=n.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",r=P;for(let d=0;d<e;d++){const a=n[d];let c,u,h=-1,v=0;for(;v<a.length&&(r.lastIndex=v,u=r.exec(a),u!==null);)v=r.lastIndex,r===P?u[1]==="!--"?r=Y:u[1]!==void 0?r=tt:u[2]!==void 0?(ct.test(u[2])&&(i=RegExp("</"+u[2],"g")),r=m):u[3]!==void 0&&(r=m):r===m?u[0]===">"?(r=i??P,h=-1):u[1]===void 0?h=-2:(h=r.lastIndex-u[2].length,c=u[1],r=u[3]===void 0?m:u[3]==='"'?it:et):r===it||r===et?r=m:r===Y||r===tt?r=P:(r=m,i=void 0);const $=r===m&&n[d+1].startsWith("/>")?" ":"";o+=r===P?a+Et:h>=0?(s.push(c),a.slice(0,h)+lt+a.slice(h)+y+$):a+y+(h===-2?d:$)}return[pt(n,o+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class L{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,r=0;const d=t.length-1,a=this.parts,[c,u]=xt(t,e);if(this.el=L.createElement(c,s),b.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=b.nextNode())!==null&&a.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(const h of i.getAttributeNames())if(h.endsWith(lt)){const v=u[r++],$=i.getAttribute(h).split(y),k=/([.?@])?(.*)/.exec(v);a.push({type:1,index:o,name:k[2],strings:$,ctor:k[1]==="."?zt:k[1]==="?"?Ot:k[1]==="@"?Tt:D}),i.removeAttribute(h)}else h.startsWith(y)&&(a.push({type:6,index:o}),i.removeAttribute(h));if(ct.test(i.tagName)){const h=i.textContent.split(y),v=h.length-1;if(v>0){i.textContent=R?R.emptyScript:"";for(let $=0;$<v;$++)i.append(h[$],O()),b.nextNode(),a.push({type:2,index:++o});i.append(h[v],O())}}}else if(i.nodeType===8)if(i.data===ht)a.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(y,h+1))!==-1;)a.push({type:7,index:o}),h+=y.length-1}o++}}static createElement(t,e){const s=A.createElement("template");return s.innerHTML=t,s}}function E(n,t,e=n,s){var r,d;if(t===S)return t;let i=s!==void 0?(r=e._$Co)==null?void 0:r[s]:e._$Cl;const o=T(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((d=i==null?void 0:i._$AO)==null||d.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=E(n,i._$AS(n,t.values),i,s)),t}class Ut{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){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??A).importNode(e,!0);b.currentNode=i;let o=b.nextNode(),r=0,d=0,a=s[0];for(;a!==void 0;){if(r===a.index){let c;a.type===2?c=new N(o,o.nextSibling,this,t):a.type===1?c=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(c=new Lt(o,this,t)),this._$AV.push(c),a=s[++d]}r!==(a==null?void 0:a.index)&&(o=b.nextNode(),r++)}return b.currentNode=A,i}p(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 N{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}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=E(this,t,e),T(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Pt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=L.createElement(pt(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const r=new Ut(i,this),d=r.u(this.options);r.p(e),this.T(d),this._$AH=r}}_$AC(t){let e=st.get(t.strings);return e===void 0&&st.set(t.strings,e=new L(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new N(this.O(O()),this.O(O()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class D{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){const o=this.strings;let r=!1;if(o===void 0)t=E(this,t,e,0),r=!T(t)||t!==this._$AH&&t!==S,r&&(this._$AH=t);else{const d=t;let a,c;for(t=o[0],a=0;a<o.length-1;a++)c=E(this,d[s+a],e,a),c===S&&(c=this._$AH[a]),r||(r=!T(c)||c!==this._$AH[a]),c===p?t=p:t!==p&&(t+=(c??"")+o[a+1]),this._$AH[a]=c}r&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class zt extends D{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class Ot extends D{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class Tt extends D{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??p)===S)return;const s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Lt{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){E(this,t)}}const W=U.litHtmlPolyfillSupport;W==null||W(L,N),(U.litHtmlVersions??(U.litHtmlVersions=[])).push("3.2.1");const Nt=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new N(t.insertBefore(O(),o),o,void 0,e??{})}return i._$AI(n),i};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */class T extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=It(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return S}}var rt;T._$litElement$=!0,T.finalized=!0,(rt=globalThis.litElementHydrateSupport)==null||rt.call(globalThis,{LitElement:T});const q=globalThis.litElementPolyfillSupport;q==null||q({LitElement:T});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/**
19
+ */let z=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Nt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return S}};var rt;z._$litElement$=!0,z.finalized=!0,(rt=globalThis.litElementHydrateSupport)==null||rt.call(globalThis,{LitElement:z});const q=globalThis.litElementPolyfillSupport;q==null||q({LitElement:z});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
@@ -24,11 +24,11 @@
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Mt={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:J},Ht=(n=Mt,t,e)=>{const{kind:s,metadata:i}=e;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),r.set(e.name,n),s==="accessor"){const{name:o}=e;return{set(d){const a=t.get.call(this);t.set.call(this,d),this.requestUpdate(o,a,n)},init(d){return d!==void 0&&this.P(o,void 0,n),d}}}if(s==="setter"){const{name:o}=e;return function(d){const a=this[o];t.call(this,d),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+s)};function f(n){return(t,e)=>typeof e=="object"?Ht(n,t,e):((s,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(i,r):void 0})(n,t,e)}/**
27
+ */const It={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:J},Mt=(n=It,t,e)=>{const{kind:s,metadata:i}=e;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,n),s==="accessor"){const{name:r}=e;return{set(d){const a=t.get.call(this);t.set.call(this,d),this.requestUpdate(r,a,n)},init(d){return d!==void 0&&this.P(r,void 0,n),d}}}if(s==="setter"){const{name:r}=e;return function(d){const a=this[r];t.call(this,d),this.requestUpdate(r,a,n)}}throw Error("Unsupported decorator location: "+s)};function f(n){return(t,e)=>typeof e=="object"?Mt(n,t,e):((s,i,o)=>{const r=i.hasOwnProperty(o);return i.constructor.createProperty(o,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,o):void 0})(n,t,e)}/**
28
28
  * @license
29
29
  * Copyright 2021 Google LLC
30
30
  * SPDX-License-Identifier: BSD-3-Clause
31
- */function st(n,t,e){return n?t(n):e==null?void 0:e(n)}const Rt=`:host {
31
+ */function nt(n,t,e){return n?t(n):e==null?void 0:e(n)}const Ht=`:host {
32
32
  display: var(--dae-display, block);
33
33
  contain: var(--dae-contain, content);
34
34
  min-height: var(--dae-min-heigh, 100px);
@@ -120,13 +120,13 @@
120
120
  background-position: right -40px top 0;
121
121
  }
122
122
  }
123
- `;var Dt=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,ut=n=>{throw TypeError(n)},g=(n,t,e,s)=>{for(var i=s>1?void 0:s?Lt(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&Dt(t,e,i),i},jt=(n,t,e)=>t.has(n)||ut("Cannot "+e),Bt=(n,t,e)=>t.has(n)?ut("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),nt=(n,t,e)=>(jt(n,t,"access private method"),e),H,gt,ft;let h=class extends T{constructor(){super(...arguments),Bt(this,H),this.networkId="",this.adUnit="",this.divId="",this.mapping=[],this.sizing=[],this.refresh=!1,this.enableTitle=!1,this.apstag=!1,this.pubId="",this.bidTimeout=2e3,this.title="Publicidad",this.adLoaded=!1}connectedCallback(){if(super.connectedCallback(),!h.initialized)nt(this,H,gt).call(this),h.initialized=!0,h.old_url=location.href;else{const n=location.href;h.old_url!==n&&(window.googletag.destroySlots(window.dreamsAllSlots),h.old_url=n,window.dreamsAllSlots=[],window.dreamsSlotsToUpdate=[])}}firstUpdated(){this.divId=`div-gpt-ad-${this.adUnit}-${crypto.randomUUID()}`,typeof this.mapping=="string"&&(this.mapping=JSON.parse(this.mapping)),typeof this.sizing=="string"&&(this.sizing=JSON.parse(this.sizing)),nt(this,H,ft).call(this)}render(){return P`
123
+ `;var Rt=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,gt=n=>{throw TypeError(n)},g=(n,t,e,s)=>{for(var i=s>1?void 0:s?Dt(t,e):t,o=n.length-1,r;o>=0;o--)(r=n[o])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Rt(t,e,i),i},Bt=(n,t,e)=>t.has(n)||gt("Cannot "+e),jt=(n,t,e)=>t.has(n)?gt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),ot=(n,t,e)=>(Bt(n,t,"access private method"),e),M,ut,ft;let l=class extends z{constructor(){super(...arguments),jt(this,M),this.networkId="",this.adUnit="",this.divId="",this.mapping=[],this.sizing=[],this.targeting=[],this.setCentering=!1,this.enableLazyLoad=!1,this.configLazyLoad={fetchMarginPercent:500,renderMarginPercent:200,mobileScaling:2},this.refresh=!1,this.enableTitle=!1,this.apstag=!1,this.pubId="",this.bidTimeout=2e3,this.title="Publicidad",this.adLoaded=!1}connectedCallback(){if(super.connectedCallback(),!l.initialized)ot(this,M,ut).call(this),l.initialized=!0,l.old_url=location.href;else{const n=location.href;l.old_url!==n&&(window.googletag.destroySlots(window.dreamsAllSlots),l.old_url=n,window.dreamsAllSlots=[],window.dreamsSlotsToUpdate=[])}}firstUpdated(){this.divId=`div-gpt-ad-${this.adUnit}-${crypto.randomUUID()}`,typeof this.mapping=="string"&&(this.mapping=JSON.parse(this.mapping)),typeof this.sizing=="string"&&(this.sizing=JSON.parse(this.sizing)),this.targeting&&typeof this.targeting=="string"&&(this.targeting=JSON.parse(this.targeting)),this.configLazyLoad&&typeof this.configLazyLoad=="string"&&(this.configLazyLoad=JSON.parse(this.configLazyLoad)),this.apstag&&this.pubId&&!l.initialized_aps&&(window.apstag.init({pubID:this.pubId,adServer:"googletag",bidTimeout:this.bidTimeout}),l.initialized_aps=!0),ot(this,M,ft).call(this)}render(){return C`
124
124
  <div class="ad-container">
125
- ${st(this.enableTitle,()=>P`<span class="ad-label">${this.title}</span>`,()=>P``)}
126
- ${st(!this.adLoaded,()=>P`<div
125
+ ${nt(this.enableTitle,()=>C`<span class="ad-label">${this.title}</span>`,()=>C``)}
126
+ ${nt(!this.adLoaded,()=>C`<div
127
127
  class="ad-loader"
128
128
  data-ad-loader="${this.divId}"
129
- ></div>`,()=>P``)}
129
+ ></div>`,()=>C``)}
130
130
  <div
131
131
  class="ad-serving"
132
132
  data-post-id="${this.divId}"
@@ -136,4 +136,4 @@
136
136
  <slot name="ad-slot"></slot>
137
137
  </div>
138
138
  </div>
139
- `}};H=new WeakSet;gt=function(){window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(()=>{window.dreamsAllSlots=window.dreamsAllSlots||[],window.dreamsSlotsToUpdate=window.dreamsSlotsToUpdate||[],window.googletag.pubads().enableSingleRequest(),window.googletag.enableServices()}),this.apstag&&this.pubId&&window.apstag.init({pubID:this.pubId,adServer:"googletag",bidTimeout:this.bidTimeout})};ft=function(){const n=`/${this.networkId}/${this.adUnit}`,t=this.divId,e=document.createElement("div");e.id=t,e.setAttribute("data-ad",this.divId),e.setAttribute("slot","ad-slot"),e.classList.add("ad-serving-rendered"),e.parentElement||this.appendChild(e),window.googletag.cmd.push(()=>{const s=window.googletag.defineSlot(n,this.sizing,t).addService(window.googletag.pubads());window.googletag.pubads().addEventListener("slotRenderEnded",d=>{d.slot.getSlotElementId()===t&&(this.adLoaded=!0)});const i=window.googletag.sizeMapping();this.mapping.forEach(d=>{i.addSize(d.viewport,d.sizing)});const r=i.build(),o=s.defineSizeMapping(r).addService(window.googletag.pubads());this.refresh&&window.dreamsSlotsToUpdate.push(s),window.dreamsAllSlots.push(o),!this.apstag&&!this.pubId&&window.googletag.display(t),this.apstag&&this.pubId&&window.apstag.fetchBids({slots:[{slotID:t,slotName:n,sizes:this.sizing}]},()=>{window.googletag.cmd.push(()=>{window.apstag.setDisplayBids(),window.googletag.pubads().refresh([o])})})})};h.styles=at(Rt);h.initialized=!1;h.old_url="";g([f({type:String})],h.prototype,"networkId",2);g([f({type:String})],h.prototype,"adUnit",2);g([f({type:String})],h.prototype,"divId",2);g([f({type:Array})],h.prototype,"mapping",2);g([f({type:Array})],h.prototype,"sizing",2);g([f({type:Boolean,reflect:!0})],h.prototype,"refresh",2);g([f({type:Boolean,reflect:!0})],h.prototype,"enableTitle",2);g([f({type:Boolean,reflect:!0})],h.prototype,"apstag",2);g([f({type:String})],h.prototype,"pubId",2);g([f({type:Number})],h.prototype,"bidTimeout",2);g([f({type:String})],h.prototype,"title",2);g([f({type:Boolean})],h.prototype,"adLoaded",2);h=g([kt("dreams-ad-engine")],h);
139
+ `}};M=new WeakSet;ut=function(){window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(()=>{window.dreamsAllSlots=window.dreamsAllSlots||[],window.dreamsSlotsToUpdate=window.dreamsSlotsToUpdate||[],window.googletag.pubads().enableSingleRequest(),window.googletag.enableServices()})};ft=function(){const n=`/${this.networkId}/${this.adUnit}`,t=this.divId,e=document.createElement("div");e.id=t,e.setAttribute("data-ad",this.divId),e.setAttribute("slot","ad-slot"),e.classList.add("ad-serving-rendered"),e.parentElement||this.appendChild(e),window.googletag.cmd.push(()=>{window.googletag.pubads().setCentering(this.setCentering),this.enableLazyLoad&&window.googletag.pubads().enableLazyLoad(this.configLazyLoad);const s=window.googletag.defineSlot(n,this.sizing,t).addService(window.googletag.pubads());this.targeting.map(d=>{s.setTargeting(d.key,d.value)}),window.googletag.pubads().addEventListener("slotRenderEnded",d=>{d.slot.getSlotElementId()===t&&(this.adLoaded=!0)});const i=window.googletag.sizeMapping();this.mapping.forEach(d=>{i.addSize(d.viewport,d.sizing)});const o=i.build(),r=s.defineSizeMapping(o).addService(window.googletag.pubads());this.refresh&&window.dreamsSlotsToUpdate.push(s),window.dreamsAllSlots.push(r),!this.apstag&&!this.pubId&&window.googletag.display(t),this.apstag&&this.pubId&&window.apstag.fetchBids({slots:[{slotID:t,slotName:n,sizes:this.sizing}]},()=>{window.googletag.cmd.push(()=>{window.apstag.setDisplayBids(),window.googletag.pubads().refresh([r])})})})};l.styles=dt(Ht);l.initialized=!1;l.old_url="";l.initialized_aps=!1;g([f({type:String})],l.prototype,"networkId",2);g([f({type:String})],l.prototype,"adUnit",2);g([f({type:String})],l.prototype,"divId",2);g([f({type:Array})],l.prototype,"mapping",2);g([f({type:Array})],l.prototype,"sizing",2);g([f({type:Array})],l.prototype,"targeting",2);g([f({type:Boolean,reflect:!0})],l.prototype,"setCentering",2);g([f({type:Boolean,reflect:!0})],l.prototype,"enableLazyLoad",2);g([f({type:Object})],l.prototype,"configLazyLoad",2);g([f({type:Boolean,reflect:!0})],l.prototype,"refresh",2);g([f({type:Boolean,reflect:!0})],l.prototype,"enableTitle",2);g([f({type:Boolean,reflect:!0})],l.prototype,"apstag",2);g([f({type:String})],l.prototype,"pubId",2);g([f({type:Number})],l.prototype,"bidTimeout",2);g([f({type:String})],l.prototype,"title",2);g([f({type:Boolean})],l.prototype,"adLoaded",2);l=g([kt("dreams-ad-engine")],l);
package/dist/index.html CHANGED
@@ -9,6 +9,7 @@
9
9
  async
10
10
  id="gads-js"
11
11
  src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"
12
+ defer
12
13
  ></script>
13
14
  <script
14
15
  async
@@ -19,52 +20,42 @@
19
20
  <script type="module" crossorigin src="./dreams-ad-engine.js"></script>
20
21
  </head>
21
22
  <body>
22
- <dummy-demo></dummy-demo>
23
+ <!-- apstag
24
+ pubId="1d96f569-faca-48fb-8e78-c679f28ea4a2" -->
23
25
  <dreams-ad-engine
24
- networkId="39772251"
25
- adUnit="la8-default-t-01"
26
- mapping='[{"viewport":[320,0],"sizing":[[320,50],[320,100]]},{"viewport":[720,0],"sizing":[[728,90]]},{"viewport":[970,0],"sizing":[[920,250],[728,90]]},{"viewport":[1280,0],"sizing":[[970,250],[970,90],[728,90]]}]'
27
- sizing="[[320,50],[320,100],[728,90],[970,90],[970,250]]"
28
- title="Anuncio"
29
- apstag
30
- pubId="2904158c-a185-455d-9cf5-9152554dc476"
31
- >
32
- </dreams-ad-engine>
33
- <dreams-ad-engine
34
- networkId="39772251"
35
- adUnit="la8-default-t-02"
36
- mapping='[{"viewport":[320,0],"sizing":[[300,250],[320,50],[320,100]]},{"viewport":[760,0],"sizing":[[728,90]]},{"viewport":[970,90],"sizing":[[920,250],[728,90]]}]'
26
+ networkId="270959339"
27
+ adUnit="fco-is-t-02"
28
+ mapping='[{"viewport":[320,0],"sizing":[[300,250],[320,50]]},{"viewport":[760,0],"sizing":[[728,90]]},{"viewport":[970,0],"sizing":[[970,90],[728,90],[728,90]]}]'
37
29
  sizing="[[300,250],[320,50],[728,90],[970,90]]"
30
+ minHeight="600"
38
31
  apstag
39
- pubId="2904158c-a185-455d-9cf5-9152554dc476"
32
+ pubId="1d96f569-faca-48fb-8e78-c679f28ea4a2"
33
+ targeting='[{"key":"url","value": "/"},{"key":"catName","value":"Home"}]'
40
34
  >
41
35
  </dreams-ad-engine>
42
36
  <dreams-ad-engine
43
- networkId="39772251"
44
- adUnit="la8-default-t-03"
45
- mapping='[{"viewport":[320,0],"sizing":[[300,250],[320,50],[320,100]]},{"viewport":[760,0],"sizing":[[728,90]]},{"viewport":[970,90],"sizing":[[920,250],[728,90]]}]'
37
+ networkId="270959339"
38
+ adUnit="fco-is-t-03"
39
+ mapping='[{"viewport":[320,0],"sizing":[[300,250],[320,50]]},{"viewport":[760,0],"sizing":[[728,90]]},{"viewport":[970,0],"sizing":[[970,90],[728,90],[728,90]]}]'
46
40
  sizing="[[300,250],[320,50],[728,90],[970,90]]"
47
41
  apstag
48
- pubId="2904158c-a185-455d-9cf5-9152554dc476"
42
+ pubId="1d96f569-faca-48fb-8e78-c679f28ea4a2"
49
43
  >
50
44
  </dreams-ad-engine>
51
45
  <dreams-ad-engine
52
- networkId="39772251"
53
- adUnit="la8-default-t-04"
54
- mapping='[{"viewport":[320,0],"sizing":[[300,250],[320,50],[320,100]]},{"viewport":[760,0],"sizing":[[728,90]]},{"viewport":[970,90],"sizing":[[920,250],[728,90]]}]'
46
+ networkId="270959339"
47
+ adUnit="fco-is-t-04"
48
+ mapping='[{"viewport":[320,0],"sizing":[[300,250],[320,50]]},{"viewport":[760,0],"sizing":[[728,90]]},{"viewport":[970,0],"sizing":[[970,90],[728,90],[728,90]]}]'
55
49
  sizing="[[300,250],[320,50],[728,90],[970,90]]"
56
- apstag
57
- pubId="2904158c-a185-455d-9cf5-9152554dc476"
58
50
  >
59
51
  </dreams-ad-engine>
60
52
  <dreams-ad-engine
61
- networkId="39772251"
62
- adUnit="la8-default-b-01"
63
- mapping='[{"viewport":[320,0],"sizing":[[1,1],[300,250]]}]'
64
- sizing="[[300,250]]"
53
+ networkId="270959339"
54
+ adUnit="fco-is-b-01"
55
+ mapping='[{"viewport":[320,0],"sizing":[[300,250],[300,600]]}]'
56
+ sizing="[[300,250],[300,600]]"
65
57
  enableTitle="false"
66
- apstag
67
- pubId="2904158c-a185-455d-9cf5-9152554dc476"
58
+ minHeight="600"
68
59
  >
69
60
  </dreams-ad-engine>
70
61
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamsengine/dreams-ad-engine",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "license": "GPL-3.0",
6
6
  "main": "./dist/dreams-ad-engine.js",