278 files
This commit is contained in:
1 parent
d7a0a08372
commit
1b4f5f68c6
278 files changed
+36892
-7150
No files matched your search
@@ -1,6 +1,6 @@
|
||||
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let a=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=r.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}};const i=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:o,defineProperty:s,getOwnPropertyDescriptor:l,getOwnPropertyNames:d,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,_=globalThis,m=_.trustedTypes,h=m?m.emptyScript:"",p=_.reactiveElementPolyfillSupport,f=(e,t)=>e,g={toAttribute(e,t){switch(t){case Boolean:e=e?h:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},y=(e,t)=>!o(e,t),v={attribute:!0,type:String,converter:g,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),_.litPropertyMetadata??=new WeakMap;let w=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&s(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:a}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);a?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??v}static _$Ei(){if(this.hasOwnProperty(f("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(f("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f("properties"))){const e=this.properties,t=[...d(e),...c(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(i(e))}else void 0!==e&&t.push(i(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,r)=>{if(t)n.adoptedStyleSheets=r.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of r){const r=document.createElement("style"),a=e.litNonce;void 0!==a&&r.setAttribute("nonce",a),r.textContent=t.cssText,n.appendChild(r)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const a=(void 0!==n.converter?.toAttribute?n.converter:g).toAttribute(t,n.type);this._$Em=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:g;this._$Em=r;const i=a.fromAttribute(t,e.type);this[r]=i??this.Line truncated
|
||||
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let a=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=r.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}};const i=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:o,defineProperty:s,getOwnPropertyDescriptor:l,getOwnPropertyNames:d,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,_=globalThis,m=_.trustedTypes,h=m?m.emptyScript:"",p=_.reactiveElementPolyfillSupport,f=(e,t)=>e,g={toAttribute(e,t){switch(t){case Boolean:e=e?h:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},y=(e,t)=>!o(e,t),v={attribute:!0,type:String,converter:g,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),_.litPropertyMetadata??=new WeakMap;let w=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&s(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:a}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);a?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??v}static _$Ei(){if(this.hasOwnProperty(f("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(f("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f("properties"))){const e=this.properties,t=[...d(e),...c(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(i(e))}else void 0!==e&&t.push(i(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,r)=>{if(t)n.adoptedStyleSheets=r.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of r){const r=document.createElement("style"),a=e.litNonce;void 0!==a&&r.setAttribute("nonce",a),r.textContent=t.cssText,n.appendChild(r)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const a=(void 0!==n.converter?.toAttribute?n.converter:g).toAttribute(t,n.type);this._$Em=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:g;this._$Em=r;const i=a.fromAttribute(t,e.type);this[r]=i??this.Line truncated
|
||||
<div class="weather">${d?N`<ha-icon .icon=${s.icon}></ha-icon>`:F}${c?N`<span class="weather-temp-high">${s.temperature}°</span>`:F}${_?N`<span class="weather-temp-low">/${s.templow}°</span>`:F}${u?N`<span class="weather-uv-index">UV${s.uv_index}</span>`:F}</div>
|
||||
`}function ii(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(e).toDateString(),a=new Date(n);return a.setDate(a.getDate()+1),{isToday:r===n.toDateString(),isTomorrow:r===a.toDateString()}}function oi(e,t,n,r,a=F){const i=Ta(e);let o=t.weekday_color,s=t.day_color,l=t.month_color;i&&(o=t.weekend_weekday_color||o,s=t.weekend_day_color||s,l=t.weekend_month_color||l),r&&(o=t.today_weekday_color||o,s=t.today_day_color||s,l=t.today_month_color||l);const d=Gn(n),c=d.daysOfWeek[e.getDay()],u=e.getDate(),_=d.months[e.getMonth()];return N`
|
||||
`}function di(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(e).toDateString(),a=new Date(n);return a.setDate(a.getDate()+1),{isToday:r===n.toDateString(),isTomorrow:r===a.toDateString()}}function ci(e,t,n,r,a=F){const i=za(e);let o=t.weekday_color,s=t.day_color,l=t.month_color;i&&(o=t.weekend_weekday_color||o,s=t.weekend_day_color||s,l=t.weekend_month_color||l),r&&(o=t.today_weekday_color||o,s=t.today_day_color||s,l=t.today_month_color||l);const d=Gn(n),c=d.daysOfWeek[e.getDay()],u=e.getDate(),_=d.months[e.getMonth()];return N`
|
||||
<div
|
||||
class="weekday"
|
||||
style=${xn({"font-size":t.weekday_font_size,color:o})}
|
||||
@@ -22,46 +22,46 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
</div>
|
||||
`:F}
|
||||
${a}
|
||||
`}const si=/[\u2000-\u3300]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|\uD83E[\uDC00-\uDFFF]/,li=/[\s\p{L}]/u;function di(e,t,n){if(!e)return F;const r=He(e,n);if("none"===r)return F;if("icon"===r)return N`<ha-icon icon="${e}" class="label-icon" style=${t?`color: ${t};`:F}></ha-icon>`;if("image"===r)return N`<img src="${e}" class="label-image" />`;const a=function(e){return si.test(e)&&!li.test(e)}(e)?" label-emoji":"";return N`<span class="calendar-label${a}">${e}</span>`}function ci(e){var t;const n=Qa(e.weather);return!(!(null==(t=e.weather)?void 0:t.entity)||"event"!==n&&"both"!==n)}function ui(e,t,n,r="title",a){var i,o,s,l;if(!ci(t)||!(null==n?void 0:n.hourly))return N``;if(null==(i=e.end)?void 0:i.dateTime){const t=new Date;if(new Date(e.end.dateTime)<t)return N``}const d=(null==(o=t.weather)?void 0:o.event)||{},c=function(e,t,n,r=!1){if(e.start.date&&!e.start.dateTime&&n)return n[La(Sa(e.start.date))];if(!e.start.dateTime)return;const a=new Date(e.start.dateTime),i=La(a),o=a.getHours();if(t){const e=t[`${i}_${o}`];if(e)return e;let n=-1,r=24;if(Object.keys(t).forEach((e=>{if(e.startsWith(i)){const t=e.split("_")[1],a=parseInt(t);if(!isNaN(a)){const e=Math.abs(a-o);e<r&&(r=e,n=a)}}})),n>=0)return t[`${i}_${n}`]}return r&&n?n[i]:void 0}(e,n.hourly,n.daily,!1!==d.daily_forecast_fallback);if(!c)return N``;const u=!1!==d.show_conditions,_=!1!==d.show_temp,m=!0===d.show_uv_index&&void 0!==c.uv_index&&c.uv_index>=(null!=(s=d.uv_index_threshold)?s:0),h="row"===r,p=h||u,f=h&&u?function(e,t,n,r){var a;if(!e||!t||!n)return;const i=Ra(e,r);if(i){const e=Ka(i,n);if(e)return e}const o=null==(a=e.states)?void 0:a[t];if(!o||"function"!=typeof e.formatEntityState)return;const s=e.formatEntityState(o,n);return s?(s!==n||ni.has(n)||(ni.add(n),st(`Weather condition "${n}" came back untranslated from ${t}; Home Assistant returned the raw token, so the row will show it as-is`)),s):void 0}(a,null==(l=t.weather)?void 0:l.entity,c.condition,t.language):void 0;return N`
|
||||
`}const ui=/[\u2000-\u3300]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|\uD83E[\uDC00-\uDFFF]/,_i=/[\s\p{L}]/u;function mi(e,t,n){if(!e)return F;const r=He(e,n);if("none"===r)return F;if("icon"===r)return N`<ha-icon icon="${e}" class="label-icon" style=${t?`color: ${t};`:F}></ha-icon>`;if("image"===r)return N`<img src="${e}" class="label-image" />`;const a=function(e){return ui.test(e)&&!_i.test(e)}(e)?" label-emoji":"";return N`<span class="calendar-label${a}">${e}</span>`}function hi(e){var t;const n=ni(e.weather);return!(!(null==(t=e.weather)?void 0:t.entity)||"event"!==n&&"both"!==n)}function pi(e,t,n,r="title",a){var i,o,s,l;if(!hi(t)||!(null==n?void 0:n.hourly))return N``;if(null==(i=e.end)?void 0:i.dateTime){const t=new Date;if(new Date(e.end.dateTime)<t)return N``}const d=(null==(o=t.weather)?void 0:o.event)||{},c=function(e,t,n,r=!1){if(e.start.date&&!e.start.dateTime&&n)return n[Ha(ja(e.start.date))];if(!e.start.dateTime)return;const a=new Date(e.start.dateTime),i=Ha(a),o=a.getHours();if(t){const e=t[`${i}_${o}`];if(e)return e;let n=-1,r=24;if(Object.keys(t).forEach((e=>{if(e.startsWith(i)){const t=e.split("_")[1],a=parseInt(t);if(!isNaN(a)){const e=Math.abs(a-o);e<r&&(r=e,n=a)}}})),n>=0)return t[`${i}_${n}`]}return r&&n?n[i]:void 0}(e,n.hourly,n.daily,!1!==d.daily_forecast_fallback);if(!c)return N``;const u=!1!==d.show_conditions,_=!1!==d.show_temp,m=!0===d.show_uv_index&&void 0!==c.uv_index&&c.uv_index>=(null!=(s=d.uv_index_threshold)?s:0),h="row"===r,p=h||u,f=h&&u?function(e,t,n,r){var a;if(!e||!t||!n)return;const i=Ka(e,r);if(i){const e=Qa(i,n);if(e)return e}const o=null==(a=e.states)?void 0:a[t];if(!o||"function"!=typeof e.formatEntityState)return;const s=e.formatEntityState(o,n);return s?(s!==n||oi.has(n)||(oi.add(n),st(`Weather condition "${n}" came back untranslated from ${t}; Home Assistant returned the raw token, so the row will show it as-is`)),s):void 0}(a,null==(l=t.weather)?void 0:l.entity,c.condition,t.language):void 0;return N`
|
||||
<div class="event-weather">${p?N`<ha-icon .icon=${c.icon}></ha-icon>`:F}<span class="event-weather-text">${_?N`<span>${c.temperature}°</span>`:F}${m?N`<span class="weather-uv-index">UV${c.uv_index}</span>`:F}${f?N`<span class="weather-condition">${f}</span>`:F}</span></div>
|
||||
`}function _i(e,t,n,r={}){const{weatherForecasts:a,weatherPlacement:i="title",progressPlacement:o="inline",countdownPlacement:s="trailing",hass:l}=r,{eventTime:d,allDayBadge:c,titlePill:u,eventLocation:_,locationIcon:m,eventDescription:h,shouldShowTime:p,countdownStr:f,progressPercentage:g,entityLabel:y}=n,v=null!==g&&t.show_progress_bar,w=v&&"inline"===o,b=v&&"row"===o?N`
|
||||
`}function fi(e,t,n,r={}){const{weatherForecasts:a,weatherPlacement:i="title",progressPlacement:o="inline",countdownPlacement:s="trailing",hass:l}=r,{eventTime:d,allDayBadge:c,titlePill:u,eventLocation:_,locationIcon:m,eventDescription:h,shouldShowTime:p,countdownStr:f,progressPercentage:g,entityLabel:y,mergedLabels:v}=n,w=null!==g&&t.show_progress_bar,b=w&&"inline"===o,M=w&&"row"===o?N`
|
||||
<div class="progress-bar progress-bar-row">
|
||||
<div class="progress-bar-filled" style="width: ${g}%"></div>
|
||||
</div>
|
||||
`:F,M="title"===i?a:void 0,k="row"===i&&ci(t)?ui(e,t,a,"row",l):F,D="text"===s&&null!==f,Y=D?null:f,$=d?N`<span>${d}</span>`:F,x=c?N`<span
|
||||
`:F,k="title"===i?a:void 0,D="row"===i&&hi(t)?pi(e,t,a,"row",l):F,Y="text"===s&&null!==f,$=Y?null:f,x=d?N`<span>${d}</span>`:F,S=c?N`<span
|
||||
class=${"allday-badge allday-pill-"+c.mode+(c.inheritsText?" allday-source-text":"")}
|
||||
lang=${c.lang}
|
||||
style=${`--calendar-card-event-accent: ${c.accent};`+(c.inheritsText?" --badge-source: var(--calendar-card-color-time);":"")}
|
||||
>${c.label}</span
|
||||
>`:F,S=D?N`<span class="time-text">${$}<span class="time-countdown">${f}</span></span>`:$;return N`
|
||||
>`:F,L=Y?N`<span class="time-text">${x}<span class="time-countdown">${f}</span></span>`:x;return N`
|
||||
<div class="event-content">
|
||||
${function(e,t,n,r,a){var i,o,s;const l=!!e._isEmptyDay,d=l&&!e._isCustomEmptyText,c=l?"var(--calendar-card-empty-day-color)":(null==(i=e._matchedConfig)?void 0:i.color)||t.event_color,u=null==(o=e._matchedConfig)?void 0:o.label_icon_color,_=null==(s=e._matchedConfig)?void 0:s.label_type,m=d?`✓ ${e.summary}`:e.summary,h=a?`allday-title-pill allday-pill-${a.mode}`+(a.inheritsText?" allday-source-text":""):"",p=a?`--calendar-card-event-accent: ${a.accent};`+(a.inheritsText?` --badge-source: ${c};`:""):"",f=a?N`<span
|
||||
class=${h}
|
||||
style=${p}
|
||||
>${m}</span
|
||||
>`:m;return N`
|
||||
${function(e,t,n,r,a,i){var o,s,l;const d=!!e._isEmptyDay,c=d&&!e._isCustomEmptyText,u=d?"var(--calendar-card-empty-day-color)":(null==(o=e._matchedConfig)?void 0:o.color)||t.event_color,_=null==(s=e._matchedConfig)?void 0:s.label_icon_color,m=null==(l=e._matchedConfig)?void 0:l.label_type,h=c?`✓ ${e.summary}`:e.summary,p=a?`allday-title-pill allday-pill-${a.mode}`+(a.inheritsText?" allday-source-text":""):"",f=a?`--calendar-card-event-accent: ${a.accent};`+(a.inheritsText?` --badge-source: ${u};`:""):"",g=a?N`<span
|
||||
class=${p}
|
||||
style=${f}
|
||||
>${h}</span
|
||||
>`:h,y=i?i.map((e=>mi(e.value,e.iconColor,e.type))):n?mi(n,_,m):F;return N`
|
||||
<div class="summary-row">
|
||||
<div class="summary">
|
||||
${n?di(n,u,_):F}
|
||||
${y}
|
||||
<span
|
||||
class="event-title ${l?"empty-day-title":""}"
|
||||
style="color: ${c}"
|
||||
class="event-title ${d?"empty-day-title":""}"
|
||||
style="color: ${u}"
|
||||
>
|
||||
${f}
|
||||
${g}
|
||||
</span>
|
||||
</div>
|
||||
${ui(e,t,r)}
|
||||
${pi(e,t,r)}
|
||||
</div>
|
||||
`}(e,t,y,M,u)}
|
||||
`}(e,t,y,k,u,v)}
|
||||
<div class="time-location">
|
||||
${b}
|
||||
${M}
|
||||
${p?N`
|
||||
<div class="time">
|
||||
<div class="time-actual">
|
||||
<ha-icon icon="mdi:clock-outline"></ha-icon>
|
||||
${x}${S}
|
||||
${S}${L}
|
||||
</div>
|
||||
${Y?N`<div class="time-countdown">${Y}</div>`:w?N`
|
||||
${$?N`<div class="time-countdown">${$}</div>`:b?N`
|
||||
<div class="progress-bar">
|
||||
<div
|
||||
class="progress-bar-filled"
|
||||
@@ -75,7 +75,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
<div class="time-actual"></div>
|
||||
<div class="time-countdown">${f}</div>
|
||||
</div>
|
||||
`:w?N`
|
||||
`:b?N`
|
||||
<div class="time">
|
||||
<div class="time-actual"></div>
|
||||
<div class="progress-bar">
|
||||
@@ -83,7 +83,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
</div>
|
||||
</div>
|
||||
`:F}
|
||||
${k}
|
||||
${D}
|
||||
${_?N`
|
||||
<div class="location">
|
||||
<ha-icon icon="${m}"></ha-icon>
|
||||
@@ -98,7 +98,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
`:""}
|
||||
</div>
|
||||
</div>
|
||||
`}function mi(e,t,n="absolute"){if(!e.today_indicator||!t)return F;const r=e.today_indicator,a=void 0===(i=r)||!1===i?"none":!0===i?"dot":"string"==typeof i?"dot"===i||"pulse"===i||"glow"===i?i:""===i.trim()?"dot":Te(i)?"mdi":i.startsWith("/")||/^https?:\/\//i.test(i)||/\.(apng|avif|bmp|gif|ico|jpe?g|png|svg|webp)(?:[?#]|$)/i.test(i)?"image":"emoji":"none";var i;if("none"===a)return F;const o="inline"===n?{}:function(e){const t={position:"absolute",transform:"translate(-50%, -50%)"},n=e.trim().split(/\s+/);return n.length>=1&&(t.left=n[0]),n.length>=2?t.top=n[1]:t.top="50%",t}(e.today_indicator_position);return N`
|
||||
`}function gi(e,t,n="absolute"){if(!e.today_indicator||!t)return F;const r=e.today_indicator,a=void 0===(i=r)||!1===i?"none":!0===i?"dot":"string"==typeof i?"dot"===i||"pulse"===i||"glow"===i?i:""===i.trim()?"dot":Te(i)?"mdi":i.startsWith("/")||/^https?:\/\//i.test(i)||/\.(apng|avif|bmp|gif|ico|jpe?g|png|svg|webp)(?:[?#]|$)/i.test(i)?"image":"emoji":"none";var i;if("none"===a)return F;const o="inline"===n?{}:function(e){const t={position:"absolute",transform:"translate(-50%, -50%)"},n=e.trim().split(/\s+/);return n.length>=1&&(t.left=n[0]),n.length>=2?t.top=n[1]:t.top="50%",t}(e.today_indicator_position);return N`
|
||||
<div class="today-indicator-container${"inline"===n?" inline":""}">
|
||||
${function(e,t,n){let r="";switch(e){case"dot":case"pulse":case"glow":r="mdi:circle";break;case"mdi":r="string"==typeof t?t:"mdi:circle";break;case"image":return"string"==typeof t?N` <img
|
||||
src="${t}"
|
||||
@@ -114,10 +114,10 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
>
|
||||
</ha-icon>`;return F}(a,r,o)}
|
||||
</div>
|
||||
`}function hi(e){return"home-assistant"===e}const pi=new Set(["primary","accent","red","pink","purple","deep-purple","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","deep-orange","brown","light-grey","grey","dark-grey","blue-grey","black","white","primary-text","secondary-text","disabled"]);let fi,gi,yi=new Map,vi=!1,wi=0,bi=!1;const Mi=new Set;function ki(){for(const e of Mi)e()}function Di(e){const t=function(e,t){if("function"==typeof e.callWS)return e.callWS(t);const n=e.connection;return n&&"function"==typeof n.sendMessagePromise?n.sendMessagePromise(t):void 0}(e,{type:"config/entity_registry/list"});if(t)return t.then((e=>{yi=function(e){var t,n;const r=new Map;for(const i of null!=e?e:[]){const e=null==i?void 0:i.entity_id;if("string"!=typeof e||!e.startsWith("calendar."))continue;const o=null==(n=null==(t=i.options)?void 0:t.calendar)?void 0:n.color;"string"==typeof o&&""!==o&&r.set(e,(a=o,pi.has(a)?`var(--${a}-color)`:a))}var a;return r}(e),vi=!0,st(`Loaded ${yi.size} calendar colors from the entity registry`)})).catch((e=>{st("Could not read calendar colors from the entity registry",e)}));bi||(bi=!0,st("This instance exposes no WebSocket command API, so Home Assistant calendar colors are unavailable; configured colors are used instead"))}function Yi(e,t){if(!e)return;if(Mi.add(t),function(e){const t=e.connection;if(gi||!t||"function"!=typeof t.subscribeEvents)return;gi=()=>{};const n=++wi;t.subscribeEvents((()=>{const t=Di(e);t&&t.then(ki)}),"entity_registry_updated").then((e=>{n===wi?gi=e:e()})).catch((()=>{n===wi&&(gi=void 0)}))}(e),vi||fi)return;const n=Di(e);n&&(fi=n.then((()=>{fi=void 0,ki()})))}function $i(e){Mi.delete(e),0===Mi.size&&(wi++,gi&&(gi(),gi=void 0),vi=!1)}const xi=/(?:^|\s)year[:=](\d{4})(?!\w)/i,Si=new RegExp(xi.source,"gi");function Li(e){return e.replace(Si,"").replace(/[^\S\n]{2,}/g," ").replace(/[^\S\n]+\n/g,"\n").replace(/\n{3,}/g,"\n\n").trim()}function Ti(e,t){return e.trim().length>0?`${e} (${t})`:`(${t})`}const ji={sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},Hi="start_of_week";function zi(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Ei(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Oi(e,t){const n=(t-e.getDay()+7)%7;return Ei(e,n)}function Ai(e,t){const n=(e.getDay()-t+7)%7;return Ei(e,-n)}function Ci(e){const t=[];let n="";for(const r of e)"+"===r||"-"===r?(t.push(n),n=r):n+=r;return t.push(n),t}function Pi(e,t,n){const r=String(e).replace(/\s+/g,"").toLowerCase();if(""===r)return{kind:"nomatch"};const a=Ci(r),i=a[0],o=a.slice(1);let s;if("today"===i)s=zi(n);else if(i===Hi)s=function(e,t){return Ai(e,(t%7+7)%7)}(n,t);else if(i in ji)s=Oi(zi(n),ji[i]);else{if(""!==i)return{kind:"nomatch"};s=zi(n)}if(o.length>8)return{kind:"error",message:"too many operators (maximum 8)"};for(const e of o){const t="-"===e[0]?-1:1,n=e.slice(1);if(""===n)return{kind:"error",message:`dangling "${e[0]}" with no value`};if(n in ji){const e=ji[n];s=t>0?Oi(s,e):Ai(s,e);continue}const r=n.match(/^(\d+)w$/);if(r){s=Ei(s,t*parseInt(r[1],10)*7);continue}const a=n.match(/^(\d+)$/);if(!a)return{kind:"error",message:`unrecognized operand "${n}"`};s=Ei(s,t*parseInt(a[1],10))}return{kind:"ok",date:s}}const Ii=new Map;function Ni(e){return void 0===e||""===e?void 0:e}function Wi(e,t,n){var r,a;if(null===t||t.field!==n||""===e)return{text:e,replacedWholeField:!1};if(void 0===t.pattern)return{text:null!=(r=t.replacement)?r:"",replacedWholeField:!0};const i=function(e){var t;if(Ii.has(e))return null!=(t=Ii.get(e))?t:null;let n=null;try{n=new RegExp(e,"gi")}catch(t){at(`Ignoring "replace_pattern": ${JSON.stringify(e)} is not a valid regular expression. Event text is shown unchanged.`)}return Ii.set(e,n),n}(t.pattern);return null===i?{text:e,replacedWholeField:!1}:{text:e.replace(i,null!=(a=t.replacement)?a:""),replacedWholeField:!1}}var Fi=Object.defineProperty,Ui=Object.defineProperties,Ri=Object.getOwnPropertyDescriptors,Ji=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Bi=Object.prototype.propertyIsEnumerable,Ki=(e,t,n)=>t in e?Fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qi=(e,t)=>{for(var n in t||(t={}))Vi.call(t,n)&&Ki(e,n,t[n]);if(Ji)for(var n of Ji(t))Bi.call(t,n)&&Ki(e,n,t[n]);return e},Gi=(e,t)=>Ui(e,Ri(t));const Zi=new Map;async function Qi(e,t,n,r=!1){const a=Aa(t.first_day_of_week,e.locale),i=function(e,t,n,r,a){const i=t.map((e=>"string"==typeof e?e:e.entity)).sort().join("_");let o="";if(r)try{o=r.includes("T")?r.split("T")[0]:r}catch(e){o=r}const s=o?`_${o}`:"",l=function(e){const t=String(e).replace(/\s+/g,"").toLowerCase();return""!==t&&Ci(t)[0]===Hi}(o)&&void 0!==a?`_fdw${a}`:"";return`${me}${e}_${i}_${n}${s}${l}${de}`}(n,t.entities,t.days_to_show,t.start_date,a),o=function(){if(window.performance&&window.performance.navigation)return 1===window.performance.navigation.type;if(wi
Line truncated
|
||||
`}function yi(e){return"home-assistant"===e}const vi=new Set(["primary","accent","red","pink","purple","deep-purple","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","deep-orange","brown","light-grey","grey","dark-grey","blue-grey","black","white","primary-text","secondary-text","disabled"]);let wi,bi,Mi=new Map,ki=!1,Di=0,Yi=!1;const $i=new Set;function xi(){for(const e of $i)e()}function Si(e){const t=function(e,t){if("function"==typeof e.callWS)return e.callWS(t);const n=e.connection;return n&&"function"==typeof n.sendMessagePromise?n.sendMessagePromise(t):void 0}(e,{type:"config/entity_registry/list"});if(t)return t.then((e=>{Mi=function(e){var t,n;const r=new Map;for(const i of null!=e?e:[]){const e=null==i?void 0:i.entity_id;if("string"!=typeof e||!e.startsWith("calendar."))continue;const o=null==(n=null==(t=i.options)?void 0:t.calendar)?void 0:n.color;"string"==typeof o&&""!==o&&r.set(e,(a=o,vi.has(a)?`var(--${a}-color)`:a))}var a;return r}(e),ki=!0,st(`Loaded ${Mi.size} calendar colors from the entity registry`)})).catch((e=>{st("Could not read calendar colors from the entity registry",e)}));Yi||(Yi=!0,st("This instance exposes no WebSocket command API, so Home Assistant calendar colors are unavailable; configured colors are used instead"))}function Li(e,t){if(!e)return;if($i.add(t),function(e){const t=e.connection;if(bi||!t||"function"!=typeof t.subscribeEvents)return;bi=()=>{};const n=++Di;t.subscribeEvents((()=>{const t=Si(e);t&&t.then(xi)}),"entity_registry_updated").then((e=>{n===Di?bi=e:e()})).catch((()=>{n===Di&&(bi=void 0)}))}(e),ki||wi)return;const n=Si(e);n&&(wi=n.then((()=>{wi=void 0,xi()})))}function Ti(e){$i.delete(e),0===$i.size&&(Di++,bi&&(bi(),bi=void 0),ki=!1)}const ji=/(?:^|\s)year[:=](\d{4})(?!\w)/i,Hi=new RegExp(ji.source,"gi");function zi(e){return e.replace(Hi,"").replace(/[^\S\n]{2,}/g," ").replace(/[^\S\n]+\n/g,"\n").replace(/\n{3,}/g,"\n\n").trim()}function Ei(e,t){return e.trim().length>0?`${e} (${t})`:`(${t})`}const Oi={sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},Ai="start_of_week";function Ci(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Pi(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Ii(e,t){const n=(t-e.getDay()+7)%7;return Pi(e,n)}function Ni(e,t){const n=(e.getDay()-t+7)%7;return Pi(e,-n)}function Wi(e){const t=[];let n="";for(const r of e)"+"===r||"-"===r?(t.push(n),n=r):n+=r;return t.push(n),t}function Fi(e,t,n){const r=String(e).replace(/\s+/g,"").toLowerCase();if(""===r)return{kind:"nomatch"};const a=Wi(r),i=a[0],o=a.slice(1);let s;if("today"===i)s=Ci(n);else if(i===Ai)s=function(e,t){return Ni(e,(t%7+7)%7)}(n,t);else if(i in Oi)s=Ii(Ci(n),Oi[i]);else{if(""!==i)return{kind:"nomatch"};s=Ci(n)}if(o.length>8)return{kind:"error",message:"too many operators (maximum 8)"};for(const e of o){const t="-"===e[0]?-1:1,n=e.slice(1);if(""===n)return{kind:"error",message:`dangling "${e[0]}" with no value`};if(n in Oi){const e=Oi[n];s=t>0?Ii(s,e):Ni(s,e);continue}const r=n.match(/^(\d+)w$/);if(r){s=Pi(s,t*parseInt(r[1],10)*7);continue}const a=n.match(/^(\d+)$/);if(!a)return{kind:"error",message:`unrecognized operand "${n}"`};s=Pi(s,t*parseInt(a[1],10))}return{kind:"ok",date:s}}const Ui=new Map;function Ri(e){return void 0===e||""===e?void 0:e}function Ji(e,t,n){var r,a;if(null===t||t.field!==n||""===e)return{text:e,replacedWholeField:!1};if(void 0===t.pattern)return{text:null!=(r=t.replacement)?r:"",replacedWholeField:!0};const i=function(e){var t;if(Ui.has(e))return null!=(t=Ui.get(e))?t:null;let n=null;try{n=new RegExp(e,"gi")}catch(t){at(`Ignoring "replace_pattern": ${JSON.stringify(e)} is not a valid regular expression. Event text is shown unchanged.`)}return Ui.set(e,n),n}(t.pattern);return null===i?{text:e,replacedWholeField:!1}:{text:e.replace(i,null!=(a=t.replacement)?a:""),replacedWholeField:!1}}var Vi=Object.defineProperty,Bi=Object.defineProperties,Ki=Object.getOwnPropertyDescriptors,qi=Object.getOwnPropertySymbols,Gi=Object.prototype.hasOwnProperty,Zi=Object.prototype.propertyIsEnumerable,Qi=(e,t,n)=>t in e?Vi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xi=(e,t)=>{for(var n in t||(t={}))Gi.call(t,n)&&Qi(e,n,t[n]);if(qi)for(var n of qi(t))Zi.call(t,n)&&Qi(e,n,t[n]);return e},eo=(e,t)=>Bi(e,Ki(t));const to=new Map;async function no(e,t,n,r=!1){const a=Na(t.first_day_of_week,e.locale),i=function(e,t,n,r,a){const i=t.map((e=>"string"==typeof e?e:e.entity)).sort().join("_");let o="";if(r)try{o=r.includes("T")?r.split("T")[0]:r}catch(e){o=r}const s=o?`_${o}`:"",l=function(e){const t=String(e).replace(/\s+/g,"").toLowerCase();return""!==t&&Wi(t)[0]===Ai}(o)&&void 0!==a?`_fdw${a}`:"";return`${me}${e}_${i}_${n}${s}${l}${de}`}(n,t.entities,t.days_to_show,t.start_date,a),o=function(){if(window.performance&&window.performance.navigation)return 1===window.performance.navigation.type;if(wi
Line truncated
|
||||
class="column-header-separator"
|
||||
style=${xn({borderTopWidth:u,borderTopColor:_,borderTopStyle:"solid"})}
|
||||
></div>`,h=mi(t,s,"inline"),p=h!==F;return N`
|
||||
></div>`,h=gi(t,s,"inline"),p=h!==F;return N`
|
||||
<div
|
||||
class=${pn({"day-column":!0,today:s,tomorrow:l,"future-day":!s,weekend:d})}
|
||||
style=${xn({gridColumn:String(r+1),gridRow:"2"})}
|
||||
@@ -127,29 +127,29 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
class=${pn({"column-date-content":!0,"with-today-indicator":p})}
|
||||
>
|
||||
${h}
|
||||
${oi(o,t,n,s,c)}
|
||||
${ci(o,t,n,s,c)}
|
||||
</div>
|
||||
</div>
|
||||
${m}
|
||||
<div class="column-events">
|
||||
${Dn(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((r,o)=>function(e,t,n,r,a,i,o){const s=$o(e,r,a,o),l=0===n,d=n===t.events.length-1,c={event:!0,"event-first":l,"event-middle":!l&&!d,"event-last":d,"past-event":s.isPastEvent};return N`
|
||||
${Dn(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((r,o)=>function(e,t,n,r,a,i,o){const s=jo(e,r,a,o),l=0===n,d=n===t.events.length-1,c={event:!0,"event-first":l,"event-middle":!l&&!d,"event-last":d,"past-event":s.isPastEvent};return N`
|
||||
<div
|
||||
class=${pn(c)}
|
||||
style="border-inline-start: var(--calendar-card-line-width-vertical) solid ${s.entityAccentColor}; background-color: ${s.entityAccentBackgroundColor};"
|
||||
>
|
||||
${_i(e,r,s.contentParts,{weatherForecasts:i,weatherPlacement:"row",progressPlacement:"row",countdownPlacement:"text",hass:o})}
|
||||
${fi(e,r,s.contentParts,{weatherForecasts:i,weatherPlacement:"row",progressPlacement:"row",countdownPlacement:"text",hass:o})}
|
||||
</div>
|
||||
`}(r,e,o,t,n,a,i)))}
|
||||
</div>
|
||||
</div>
|
||||
`}function Eo(e,t,n){return N`
|
||||
`}function Io(e,t,n){return N`
|
||||
<div
|
||||
class="column-week-number"
|
||||
style=${xn(((e,t)=>{for(var n in t||(t={}))Lo.call(t,n)&&jo(e,n,t[n]);if(So)for(var n of So(t))To.call(t,n)&&jo(e,n,t[n]);return e})({gridColumn:String(n+1),gridRow:"1"},t?{}:{visibility:"hidden"}))}
|
||||
style=${xn(((e,t)=>{for(var n in t||(t={}))Eo.call(t,n)&&Ao(e,n,t[n]);if(zo)for(var n of zo(t))Oo.call(t,n)&&Ao(e,n,t[n]);return e})({gridColumn:String(n+1),gridRow:"1"},t?{}:{visibility:"hidden"}))}
|
||||
>
|
||||
<div class="week-number">${null!=e?e:""}</div>
|
||||
</div>
|
||||
`}function Oo(e,t,n,r,a){const i=Vt(t,"day_header_gap"),o=tn(t.day_spacing),s=function(e){return e.map(((t,n)=>{const r=n>0?e[n-1]:void 0;return{isNewWeek:!r||t.weekNumber!==r.weekNumber,isNewMonth:Boolean(r&&t.monthNumber!==r.monthNumber)}}))}(e),l=function(e,t,n){const r=t.map(((e,t)=>e.isNewWeek&&!(0===t&&!n.show_current_week_number)));return null!==n.show_week_numbers&&r.some(Boolean)?e.map(((e,t)=>Eo(e.weekNumber,r[t],t))):e.map((()=>F))}(e,s,t),d=s.map(((e,n)=>({separator:Ho(e,t),index:n}))).filter((({separator:e,index:t})=>null!==e&&t>0)).map((({separator:e,index:t})=>function(e,t,n){return N`
|
||||
`}function No(e,t,n,r,a){const i=Vt(t,"day_header_gap"),o=tn(t.day_spacing),s=function(e){return e.map(((t,n)=>{const r=n>0?e[n-1]:void 0;return{isNewWeek:!r||t.weekNumber!==r.weekNumber,isNewMonth:Boolean(r&&t.monthNumber!==r.monthNumber)}}))}(e),l=function(e,t,n){const r=t.map(((e,t)=>e.isNewWeek&&!(0===t&&!n.show_current_week_number)));return null!==n.show_week_numbers&&r.some(Boolean)?e.map(((e,t)=>Io(e.weekNumber,r[t],t))):e.map((()=>F))}(e,s,t),d=s.map(((e,n)=>({separator:Co(e,t),index:n}))).filter((({separator:e,index:t})=>null!==e&&t>0)).map((({separator:e,index:t})=>function(e,t,n){return N`
|
||||
<div
|
||||
class="column-separator column-separator-${e.kind}"
|
||||
style=${xn({gridColumn:String(t+1),gridRow:"day"===e.kind?"2":"1 / -1",width:e.width,backgroundColor:e.color,marginInlineStart:`calc(-0.5 * (${n} + ${e.width}))`})}
|
||||
@@ -160,10 +160,10 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
style=${xn({gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,columnGap:o,"--calendar-card-column-header-gap":i})}
|
||||
>
|
||||
${l}
|
||||
${e.map(((e,i)=>zo(e,t,n,i,r,a)))}
|
||||
${e.map(((e,i)=>Po(e,t,n,i,r,a)))}
|
||||
${d}
|
||||
</div>
|
||||
`}function Ao(e,t){const n=Gn(t);return"loading"===e?N`
|
||||
`}function Wo(e,t){const n=Gn(t);return"loading"===e?N`
|
||||
<div class="calendar-card">
|
||||
<div class="loading">${n.loading}</div>
|
||||
</div>
|
||||
@@ -171,12 +171,12 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
<div class="calendar-card">
|
||||
<div class="error">${n.error}</div>
|
||||
</div>
|
||||
`}function Co(e,t,n,r="day"){if("day"===r)return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:"0px",marginBottom:n.day_spacing};let a=be.WEEK;"month"===r&&(a=be.MONTH);const i=Kt(n.day_spacing,a);return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:i,marginBottom:i}}function Po(e,t,n,r,a=!1,i="day"){if(Bt(e)||a)return F;const o=Co(e,t,r,i);return N`<div class="${n}" style=${xn(o)}></div>`}function Io(e){return Po(e.month_separator_width,e.month_separator_color,"month-separator",e,!1,"month")}function No(e,t=!1){return Po(e.week_separator_width,e.week_separator_color,"week-separator",e,t,"week")}function Wo(e,t,n,r,a,i,o){const{isToday:s,isTomorrow:l}=ii(e.timestamp),d=Ta(new Date(e.timestamp));let c=F;const u=(null==a?void 0:a.isNewMonth)||!1,_=(null==a?void 0:a.isNewWeek)||!1,m=u&&!Bt(t.month_separator_width),h=_&&(null!==t.show_week_numbers||!Bt(t.week_separator_width)),p=t.day_separator_width,f=t.day_separator_color;if(r&&!Bt(p)&&!m&&!h){const e=Co(p,f,t,"day");c=N`<div class="separator" style=${xn(e)}></div>`}return N`
|
||||
`}function Fo(e,t,n,r="day"){if("day"===r)return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:"0px",marginBottom:n.day_spacing};let a=be.WEEK;"month"===r&&(a=be.MONTH);const i=Kt(n.day_spacing,a);return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:i,marginBottom:i}}function Uo(e,t,n,r,a=!1,i="day"){if(Bt(e)||a)return F;const o=Fo(e,t,r,i);return N`<div class="${n}" style=${xn(o)}></div>`}function Ro(e){return Uo(e.month_separator_width,e.month_separator_color,"month-separator",e,!1,"month")}function Jo(e,t=!1){return Uo(e.week_separator_width,e.week_separator_color,"week-separator",e,t,"week")}function Vo(e,t,n,r,a,i,o){const{isToday:s,isTomorrow:l}=di(e.timestamp),d=za(new Date(e.timestamp));let c=F;const u=(null==a?void 0:a.isNewMonth)||!1,_=(null==a?void 0:a.isNewWeek)||!1,m=u&&!Bt(t.month_separator_width),h=_&&(null!==t.show_week_numbers||!Bt(t.week_separator_width)),p=t.day_separator_width,f=t.day_separator_color;if(r&&!Bt(p)&&!m&&!h){const e=Fo(p,f,t,"day");c=N`<div class="separator" style=${xn(e)}></div>`}return N`
|
||||
${c}
|
||||
<table
|
||||
class=${pn({"day-table":!0,today:s,tomorrow:l,"future-day":!s,weekend:d})}
|
||||
>
|
||||
${Dn(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((r,a)=>function(e,t,n,r,a,i,o,s){const l=$o(e,r,a,s),d=new Date(t.timestamp),c=Ta(d),u=0===n,_=n===t.events.length-1,m={event:!0,"event-first":u,"event-middle":!u&&!_,"event-last":_,"past-event":l.isPastEvent};return N`
|
||||
${Dn(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((r,a)=>function(e,t,n,r,a,i,o,s){const l=jo(e,r,a,s),d=new Date(t.timestamp),c=za(d),u=0===n,_=n===t.events.length-1,m={event:!0,"event-first":u,"event-middle":!u&&!_,"event-last":_,"past-event":l.isPastEvent};return N`
|
||||
<tr>
|
||||
${0===n?N`
|
||||
<td
|
||||
@@ -184,21 +184,21 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
rowspan="${t.events.length}"
|
||||
style="position: relative;"
|
||||
>
|
||||
${function(e,t,n,r,a){return oi(e,t,n,r,ai(e,t,a))}(d,r,a,i,o)}
|
||||
${mi(r,i)}
|
||||
${function(e,t,n,r,a){return ci(e,t,n,r,li(e,t,a))}(d,r,a,i,o)}
|
||||
${gi(r,i)}
|
||||
</td>
|
||||
`:""}
|
||||
<td
|
||||
class=${pn(m)}
|
||||
style="border-inline-start: var(--calendar-card-line-width-vertical) solid ${l.entityAccentColor}; background-color: ${l.entityAccentBackgroundColor};"
|
||||
>
|
||||
${_i(e,r,l.contentParts,{weatherForecasts:o})}
|
||||
${fi(e,r,l.contentParts,{weatherForecasts:o})}
|
||||
</td>
|
||||
</tr>
|
||||
`}(r,e,a,t,n,s,i,o)))}
|
||||
</table>
|
||||
`}function Fo(e,t,n,r,a){return N`
|
||||
${e.map(((i,o)=>{var s;const l=o>0?e[o-1]:void 0,d=null!=(s=i.weekNumber)?s:null;let c=!1;if(l){c=i.weekNumber!==l.weekNumber}else c=!0;const u=l&&i.monthNumber!==l.monthNumber,_=0===o,m={isNewWeek:c,isNewMonth:Boolean(u)};let h=F;return!u||Bt(t.month_separator_width)||c&&null!==t.show_week_numbers?c&&(h=_&&null!==t.show_week_numbers&&!t.show_current_week_number?u?Io(t):No(t,_):null!==t.show_week_numbers?function(e,t,n,r=!1){if(null===e)return F;const a=t?be.MONTH:be.WEEK,i={marginTop:r?"0px":Kt(n.day_spacing,a/2-1),marginBottom:Kt(n.day_spacing,a/2)},o={};return r?o["--separator-display"]="none":t&&!Bt(n.month_separator_width)?(o["--separator-border-width"]=n.month_separator_width,o["--separator-border-color"]=n.month_separator_color,o["--separator-display"]="block"):Bt(n.week_separator_width)?o["--separator-display"]="none":(o["--separator-border-width"]=n.week_separator_width,o["--separator-border-color"]=n.week_separator_color,o["--separator-display"]="block"),N`
|
||||
`}function Bo(e,t,n,r,a){return N`
|
||||
${e.map(((i,o)=>{var s;const l=o>0?e[o-1]:void 0,d=null!=(s=i.weekNumber)?s:null;let c=!1;if(l){c=i.weekNumber!==l.weekNumber}else c=!0;const u=l&&i.monthNumber!==l.monthNumber,_=0===o,m={isNewWeek:c,isNewMonth:Boolean(u)};let h=F;return!u||Bt(t.month_separator_width)||c&&null!==t.show_week_numbers?c&&(h=_&&null!==t.show_week_numbers&&!t.show_current_week_number?u?Ro(t):Jo(t,_):null!==t.show_week_numbers?function(e,t,n,r=!1){if(null===e)return F;const a=t?be.MONTH:be.WEEK,i={marginTop:r?"0px":Kt(n.day_spacing,a/2-1),marginBottom:Kt(n.day_spacing,a/2)},o={};return r?o["--separator-display"]="none":t&&!Bt(n.month_separator_width)?(o["--separator-border-width"]=n.month_separator_width,o["--separator-border-color"]=n.month_separator_color,o["--separator-display"]="block"):Bt(n.week_separator_width)?o["--separator-display"]="none":(o["--separator-border-width"]=n.week_separator_width,o["--separator-border-color"]=n.week_separator_color,o["--separator-display"]="block"),N`
|
||||
<table class="week-row-table" style=${xn(i)}>
|
||||
<tr>
|
||||
<td class="week-number-cell">
|
||||
@@ -209,11 +209,11 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
`}(d,Boolean(u),t,_):No(t,_)):h=Io(t),N`
|
||||
`}(d,Boolean(u),t,_):Jo(t,_)):h=Ro(t),N`
|
||||
${h}
|
||||
${Wo(i,t,n,l,m,r,a)}
|
||||
${Vo(i,t,n,l,m,r,a)}
|
||||
`}))}
|
||||
`}const Uo=((e,...t)=>{const r=1===e.length?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new a(r,e,n)})`
|
||||
`}const Ko=((e,...t)=>{const r=1===e.length?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new a(r,e,n)})`
|
||||
:host {
|
||||
display: block;
|
||||
height: 100%;
|
||||
@@ -985,7 +985,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
justify-self: start;
|
||||
pointer-events: none;
|
||||
}
|
||||
`;var Ro=Object.defineProperty,Jo=Object.getOwnPropertySymbols,Vo=Object.prototype.hasOwnProperty,Bo=Object.prototype.propertyIsEnumerable,Ko=(e,t,n)=>t in e?Ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let qo=!0;function Go(e){return"string"==typeof e&&(e.includes("{{")||e.includes("{%"))}async function Zo(e,t,n){const r=null==e?void 0:e.connection;if(!r||!t)return;const a=e=>{if(e&&"error"in e)return"WARNING"===e.level?void st("Template warning",{template:t,error:e.error}):(rt("Template render error",{template:t,error:e.error}),void n.onError(e.error));var r;e&&"result"in e&&n.onResult(null==(r=e.result)?"":"string"==typeof r?r:String(r))},i=e=>r.subscribeMessage(a,((e,t)=>{for(var n in t||(t={}))Vo.call(t,n)&&Ko(e,n,t[n]);if(Jo)for(var n of Jo(t))Bo.call(t,n)&&Ko(e,n,t[n]);return e})({type:"render_template",template:t},e?{report_errors:!0}:{}));try{return await i(qo)}catch(e){if(qo&&function(e){return"invalid_format"===(null==e?void 0:e.code)}(e)){qo=!1,at("Home Assistant rejected the render_template `report_errors` option; falling back to basic template rendering (requires 2023.9+ for error reporting)");try{return await i(!1)}catch(e){return void rt("Failed to subscribe to template",{template:t,error:e})}}const r=null==e?void 0:e.message;return rt("Failed to subscribe to template",{template:t,error:e}),void n.onError(null!=r?r:String(e))}}class Qo{constructor(e){this.callbacks=e,this._hasConnected=!1,this._version=0}update(e,t){const n=Go(t)?t:void 0,r=null==e?void 0:e.connection,a=!this._hasConnected&&Boolean(r);r&&(this._hasConnected=!0),n===this._template&&r===this._connection||(this._template=n,this._connection=r,this._version++,this._clearPending(),this._teardown(),n&&e&&(a?this._subscribe(e,n,this._version):this._debounceId=setTimeout((()=>{this._debounceId=void 0,this._subscribe(e,n,this._version)}),300)))}destroy(){this._version++,this._template=void 0,this._connection=void 0,this._hasConnected=!1,this._clearPending(),this._teardown()}async _subscribe(e,t,n){const r=await Zo(e,t,{onResult:e=>{n===this._version&&this.callbacks.onResult(e)},onError:e=>{n===this._version&&this.callbacks.onError(e)}});r&&(n===this._version?this._unsubscribe=r:r())}_clearPending(){this._debounceId&&(clearTimeout(this._debounceId),this._debounceId=void 0)}_teardown(){if(this._unsubscribe){try{this._unsubscribe()}catch(e){at("Failed to unsubscribe from template",e)}this._unsubscribe=void 0}}}var Xo=Object.defineProperty,es=Object.defineProperties,ts=Object.getOwnPropertyDescriptor,ns=Object.getOwnPropertyDescriptors,rs=Object.getOwnPropertySymbols,as=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,os=(e,t,n)=>t in e?Xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ss=(e,t)=>{for(var n in t||(t={}))as.call(t,n)&&os(e,n,t[n]);if(rs)for(var n of rs(t))is.call(t,n)&&os(e,n,t[n]);return e},ls=(e,t)=>es(e,ns(t)),ds=(e,t,n,r)=>{for(var a,i=r>1?void 0:r?ts(t,n):t,o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Xo(t,n,i),i};function cs(e,t){const n=e,r=null==n?void 0:n.CalendarCardProEditor;if("function"!=typeof r)throw new Error("Calendar Card Pro: the editor file was found but is not the card’s editor. This usually means another file of the same name is installed alongside it — put the card’s files in a folder of their own, or reinstall through HACS, which does that for you. The card itself is unaffected.");const a=null==n?void 0:n.EDITOR_VERSION;a!==de&&at(`Editor file is v${null!=a?a:"unknown"} but the card is v${de}. Both files come from the same release, so one of them is stale — hard-refresh the browser, and if that does not help, reinstall so the card and editor files are replaced together.`),customElements.get(t)||customElements.define(t,r)}let us=class extends ae{constructor(){super(),this.config=ss({},vt),this.events=[],this.isInitialLoad=!0,this.isLoading=!1,this.isExpanded=!1,this.weatherForecasts={daily:{},hourly:{}},this.preview=!1,this.editMode=!1,this.connectedWhileHidden=!0,this._instanceId=ze(),this._eventsInstanceId="",this._eventRequestGeneration=0,this._language="",this._lastUpdateTime=0,this._weatherUnsubscribers=[],this._weatherSetupVersion=0,this._weatherSetupPending=!1,this._hasFetchError=!1,this._activePointerId=null,this._holdTriggered=!1,this._holdTimer=null,this._holdIndicator=null,this._measuredWidthPx=null,this._effectiveView="list",this._columnCount=0,this._resizeObserver=null,this._widthSettleTimerId=null,this._handleVisibilityChange=()=>{if("visible"===document.visibilityState){Date.now()-this._lastUpdateTime>ve&&(st("Visibility changed to visible, updating events"),this.updateEvents())}},this._onEntityColorsChanged=()=>{this.requestUpdate()},this._instanceId=ze(),nt(de)}static async getConfigElement(){if(!customElements.get("calendar-card-pro-editor"))try{cs(await import(function(e){const t=new URL("./editor.js",e);return t.search=new URL(e).search,t.href}(import.meta.url)),"calendar-card-pro-edito
Line truncated
|
||||
`;var qo=Object.defineProperty,Go=Object.getOwnPropertySymbols,Zo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable,Xo=(e,t,n)=>t in e?qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let es=!0;function ts(e){return"string"==typeof e&&(e.includes("{{")||e.includes("{%"))}async function ns(e,t,n){const r=null==e?void 0:e.connection;if(!r||!t)return;const a=e=>{if(e&&"error"in e)return"WARNING"===e.level?void st("Template warning",{template:t,error:e.error}):(rt("Template render error",{template:t,error:e.error}),void n.onError(e.error));var r;e&&"result"in e&&n.onResult(null==(r=e.result)?"":"string"==typeof r?r:String(r))},i=e=>r.subscribeMessage(a,((e,t)=>{for(var n in t||(t={}))Zo.call(t,n)&&Xo(e,n,t[n]);if(Go)for(var n of Go(t))Qo.call(t,n)&&Xo(e,n,t[n]);return e})({type:"render_template",template:t},e?{report_errors:!0}:{}));try{return await i(es)}catch(e){if(es&&function(e){return"invalid_format"===(null==e?void 0:e.code)}(e)){es=!1,at("Home Assistant rejected the render_template `report_errors` option; falling back to basic template rendering (requires 2023.9+ for error reporting)");try{return await i(!1)}catch(e){return void rt("Failed to subscribe to template",{template:t,error:e})}}const r=null==e?void 0:e.message;return rt("Failed to subscribe to template",{template:t,error:e}),void n.onError(null!=r?r:String(e))}}class rs{constructor(e){this.callbacks=e,this._hasConnected=!1,this._version=0}update(e,t){const n=ts(t)?t:void 0,r=null==e?void 0:e.connection,a=!this._hasConnected&&Boolean(r);r&&(this._hasConnected=!0),n===this._template&&r===this._connection||(this._template=n,this._connection=r,this._version++,this._clearPending(),this._teardown(),n&&e&&(a?this._subscribe(e,n,this._version):this._debounceId=setTimeout((()=>{this._debounceId=void 0,this._subscribe(e,n,this._version)}),300)))}destroy(){this._version++,this._template=void 0,this._connection=void 0,this._hasConnected=!1,this._clearPending(),this._teardown()}async _subscribe(e,t,n){const r=await ns(e,t,{onResult:e=>{n===this._version&&this.callbacks.onResult(e)},onError:e=>{n===this._version&&this.callbacks.onError(e)}});r&&(n===this._version?this._unsubscribe=r:r())}_clearPending(){this._debounceId&&(clearTimeout(this._debounceId),this._debounceId=void 0)}_teardown(){if(this._unsubscribe){try{this._unsubscribe()}catch(e){at("Failed to unsubscribe from template",e)}this._unsubscribe=void 0}}}var as=Object.defineProperty,is=Object.defineProperties,os=Object.getOwnPropertyDescriptor,ss=Object.getOwnPropertyDescriptors,ls=Object.getOwnPropertySymbols,ds=Object.prototype.hasOwnProperty,cs=Object.prototype.propertyIsEnumerable,us=(e,t,n)=>t in e?as(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_s=(e,t)=>{for(var n in t||(t={}))ds.call(t,n)&&us(e,n,t[n]);if(ls)for(var n of ls(t))cs.call(t,n)&&us(e,n,t[n]);return e},ms=(e,t)=>is(e,ss(t)),hs=(e,t,n,r)=>{for(var a,i=r>1?void 0:r?os(t,n):t,o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&as(t,n,i),i};function ps(e,t){const n=e,r=null==n?void 0:n.CalendarCardProEditor;if("function"!=typeof r)throw new Error("Calendar Card Pro: the editor file was found but is not the card’s editor. This usually means another file of the same name is installed alongside it — put the card’s files in a folder of their own, or reinstall through HACS, which does that for you. The card itself is unaffected.");const a=null==n?void 0:n.EDITOR_VERSION;a!==de&&at(`Editor file is v${null!=a?a:"unknown"} but the card is v${de}. Both files come from the same release, so one of them is stale — hard-refresh the browser, and if that does not help, reinstall so the card and editor files are replaced together.`),customElements.get(t)||customElements.define(t,r)}let fs=class extends ae{constructor(){super(),this.config=_s({},vt),this.events=[],this.isInitialLoad=!0,this.isLoading=!1,this.isExpanded=!1,this.weatherForecasts={daily:{},hourly:{}},this.preview=!1,this.editMode=!1,this.connectedWhileHidden=!0,this._instanceId=ze(),this._eventsInstanceId="",this._eventRequestGeneration=0,this._language="",this._lastUpdateTime=0,this._weatherUnsubscribers=[],this._weatherSetupVersion=0,this._weatherSetupPending=!1,this._hasFetchError=!1,this._activePointerId=null,this._holdTriggered=!1,this._holdTimer=null,this._holdIndicator=null,this._measuredWidthPx=null,this._effectiveView="list",this._columnCount=0,this._resizeObserver=null,this._widthSettleTimerId=null,this._handleVisibilityChange=()=>{if("visible"===document.visibilityState){Date.now()-this._lastUpdateTime>ve&&(st("Visibility changed to visible, updating events"),this.updateEvents())}},this._onEntityColorsChanged=()=>{this.requestUpdate()},this._instanceId=ze(),nt(de)}static async getConfigElement(){if(!customElements.get("calendar-card-pro-editor"))try{ps(await import(function(e){const t=new URL("./editor.js",e);return t.search=new URL(e).search,t.href}(import.meta.url)),"calendar-card-pro-edito
Line truncated
|
||||
<ha-card
|
||||
class=${s}
|
||||
style=${xn(e)}
|
||||
@@ -1020,4 +1020,4 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
<!-- Content container is always present -->
|
||||
<div class="content-container">${n}</div>
|
||||
</ha-card>
|
||||
`}(e,this.effectiveTitle,n,t,this.isLoading,this.isTitlePending,this.effectiveView)}};us.getStubConfig=Et,ds([le({attribute:!1})],us.prototype,"hass",2),ds([le({attribute:!1})],us.prototype,"config",2),ds([le({attribute:!1})],us.prototype,"events",2),ds([le({attribute:!1})],us.prototype,"isInitialLoad",2),ds([le({attribute:!1})],us.prototype,"isLoading",2),ds([le({attribute:!1})],us.prototype,"isExpanded",2),ds([le({attribute:!1})],us.prototype,"weatherForecasts",2),ds([le({attribute:!1})],us.prototype,"renderedTitle",2),ds([le({type:Boolean})],us.prototype,"preview",2),ds([le({type:Boolean})],us.prototype,"editMode",2),us=ds([(e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("calendar-card-pro")],us);const _s=customElements.get("calendar-card-pro");_s&&(_s.getStubConfig=Et),window.customCards=window.customCards||[],window.customCards.push({type:"calendar-card-pro",name:"Calendar Card Pro",preview:!0,description:"A calendar card that supports multiple calendars with individual styling.",documentationURL:"https://github.com/alexpfau/calendar-card-pro",getEntitySuggestion:function(e,t){if("string"!=typeof t||"calendar"!==t.split(".")[0])return null;if(!e||"object"!=typeof e)return null;const n=e.states;return n&&"object"==typeof n&&n[t]?[{config:yt(gt({},zt([t])),{grid_options:gt({},Ht)})},{label:"Columns",config:yt(gt({},zt([t])),{view:"column",grid_options:gt({},Ht)})}]:null}});export{cs as adoptEditorComponent};
|
||||
`}(e,this.effectiveTitle,n,t,this.isLoading,this.isTitlePending,this.effectiveView)}};fs.getStubConfig=Et,hs([le({attribute:!1})],fs.prototype,"hass",2),hs([le({attribute:!1})],fs.prototype,"config",2),hs([le({attribute:!1})],fs.prototype,"events",2),hs([le({attribute:!1})],fs.prototype,"isInitialLoad",2),hs([le({attribute:!1})],fs.prototype,"isLoading",2),hs([le({attribute:!1})],fs.prototype,"isExpanded",2),hs([le({attribute:!1})],fs.prototype,"weatherForecasts",2),hs([le({attribute:!1})],fs.prototype,"renderedTitle",2),hs([le({type:Boolean})],fs.prototype,"preview",2),hs([le({type:Boolean})],fs.prototype,"editMode",2),fs=hs([(e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("calendar-card-pro")],fs);const gs=customElements.get("calendar-card-pro");gs&&(gs.getStubConfig=Et),window.customCards=window.customCards||[],window.customCards.push({type:"calendar-card-pro",name:"Calendar Card Pro",preview:!0,description:"A calendar card that supports multiple calendars with individual styling.",documentationURL:"https://github.com/alexpfau/calendar-card-pro",getEntitySuggestion:function(e,t){if("string"!=typeof t||"calendar"!==t.split(".")[0])return null;if(!e||"object"!=typeof e)return null;const n=e.states;return n&&"object"==typeof n&&n[t]?[{config:yt(gt({},zt([t])),{grid_options:gt({},Ht)})},{label:"Columns",config:yt(gt({},zt([t])),{view:"column",grid_options:gt({},Ht)})}]:null}});export{ps as adoptEditorComponent};
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),i=new WeakMap;let o=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const a=this.t;if(t&&void 0===e){const t=void 0!==a&&1===a.length;t&&(e=i.get(a)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&i.set(a,e))}return e}toString(){return this.cssText}};const n=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const a of e.cssRules)t+=a.cssText;return(e=>new o("string"==typeof e?e:e+"",void 0,a))(t)})(e):e,{is:l,defineProperty:r,getOwnPropertyDescriptor:s,getOwnPropertyNames:d,getOwnPropertySymbols:c,getPrototypeOf:_}=Object,u=globalThis,p=u.trustedTypes,m=p?p.emptyScript:"",h=u.reactiveElementPolyfillSupport,y=(e,t)=>e,k={toAttribute(e,t){switch(t){case Boolean:e=e?m:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let a=e;switch(t){case Boolean:a=null!==e;break;case Number:a=null===e?null:Number(e);break;case Object:case Array:try{a=JSON.parse(e)}catch(e){a=null}}return a}},g=(e,t)=>!l(e,t),v={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;let b=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const a=Symbol(),i=this.getPropertyDescriptor(e,a,t);void 0!==i&&r(this.prototype,e,i)}}static getPropertyDescriptor(e,t,a){const{get:i,set:o}=s(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const n=i?.call(this);o?.call(this,t),this.requestUpdate(e,n,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??v}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=_(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...d(e),...c(e)];for(const a of t)this.createProperty(a,e[a])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,a]of t)this.elementProperties.set(e,a)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const a=this._$Eu(e,t);void 0!==a&&this._$Eh.set(a,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const a=new Set(e.flat(1/0).reverse());for(const e of a)t.unshift(n(e))}else void 0!==e&&t.push(n(e));return t}static _$Eu(e,t){const a=t.attribute;return!1===a?void 0:"string"==typeof a?a:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const a of t.keys())this.hasOwnProperty(a)&&(e.set(a,this[a]),delete this[a]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const a=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((a,i)=>{if(t)a.adoptedStyleSheets=i.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of i){const i=document.createElement("style"),o=e.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=t.cssText,a.appendChild(i)}})(a,this.constructor.elementStyles),a}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,a){this._$AK(e,a)}_$ET(e,t){const a=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,a);if(void 0!==i&&!0===a.reflect){const o=(void 0!==a.converter?.toAttribute?a.converter:k).toAttribute(t,a.type);this._$Em=e,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){const a=this.constructor,i=a._$Eh.get(e);if(void 0!==i&&this._$Em!==i){const e=a.getPropertyOptions(i),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:k;this._$Em=i;const n=o.fromAttribute(t,e.type);this[i]=n??this.Line truncated
|
||||
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),i=new WeakMap;let o=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const a=this.t;if(t&&void 0===e){const t=void 0!==a&&1===a.length;t&&(e=i.get(a)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&i.set(a,e))}return e}toString(){return this.cssText}};const n=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const a of e.cssRules)t+=a.cssText;return(e=>new o("string"==typeof e?e:e+"",void 0,a))(t)})(e):e,{is:l,defineProperty:r,getOwnPropertyDescriptor:s,getOwnPropertyNames:d,getOwnPropertySymbols:c,getPrototypeOf:_}=Object,u=globalThis,p=u.trustedTypes,m=p?p.emptyScript:"",h=u.reactiveElementPolyfillSupport,y=(e,t)=>e,k={toAttribute(e,t){switch(t){case Boolean:e=e?m:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let a=e;switch(t){case Boolean:a=null!==e;break;case Number:a=null===e?null:Number(e);break;case Object:case Array:try{a=JSON.parse(e)}catch(e){a=null}}return a}},g=(e,t)=>!l(e,t),v={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;let b=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const a=Symbol(),i=this.getPropertyDescriptor(e,a,t);void 0!==i&&r(this.prototype,e,i)}}static getPropertyDescriptor(e,t,a){const{get:i,set:o}=s(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const n=i?.call(this);o?.call(this,t),this.requestUpdate(e,n,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??v}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=_(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...d(e),...c(e)];for(const a of t)this.createProperty(a,e[a])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,a]of t)this.elementProperties.set(e,a)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const a=this._$Eu(e,t);void 0!==a&&this._$Eh.set(a,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const a=new Set(e.flat(1/0).reverse());for(const e of a)t.unshift(n(e))}else void 0!==e&&t.push(n(e));return t}static _$Eu(e,t){const a=t.attribute;return!1===a?void 0:"string"==typeof a?a:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const a of t.keys())this.hasOwnProperty(a)&&(e.set(a,this[a]),delete this[a]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const a=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((a,i)=>{if(t)a.adoptedStyleSheets=i.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of i){const i=document.createElement("style"),o=e.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=t.cssText,a.appendChild(i)}})(a,this.constructor.elementStyles),a}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,a){this._$AK(e,a)}_$ET(e,t){const a=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,a);if(void 0!==i&&!0===a.reflect){const o=(void 0!==a.converter?.toAttribute?a.converter:k).toAttribute(t,a.type);this._$Em=e,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){const a=this.constructor,i=a._$Eh.get(e);if(void 0!==i&&this._$Em!==i){const e=a.getPropertyOptions(i),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:k;this._$Em=i;const n=o.fromAttribute(t,e.type);this[i]=n??this.Line truncated
|
||||
.card-config {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -102,7 +102,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
color: var(--disabled-text-color);
|
||||
cursor: default;
|
||||
}
|
||||
`;const bn="exceptions";var fn={daysOfWeek:["нед.","пон.","вт.","ср.","четв.","пет.","съб."],fullDaysOfWeek:["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],months:["ян.","фев.","мар","апр.","май","юни","юли","авг.","септ.","окт.","ноем.","дек."],allDay:"цял ден",multiDay:"до",at:"в",endsToday:"приключва днес",endsTomorrow:"приключва утре",noEvents:"Няма планирани събития",loading:"Зареждане на календара със събития...",error:"Грешка: календарът не е намерен или не е конфигуриран правилно"},wn={daysOfWeek:["Dg","Dl","Dm","Dc","Dj","Dv","Ds"],fullDaysOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],months:["Gen","Febr","Març","Abr","Maig","Juny","Jul","Ag","Set","Oct","Nov","Des"],allDay:"tot el dia",multiDay:"fins a",at:"a les",endsToday:"acaba avui",endsTomorrow:"acaba damà",noEvents:"Cap event proper",loading:"Carregant events...",error:"Error: No s'ha trobat l'entitat del calendari o aquesta està mal configurada"},zn={daysOfWeek:["Ne","Po","Út","St","Čt","Pá","So"],fullDaysOfWeek:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"],months:["Led","Úno","Bře","Dub","Kvě","Čvn","Čvc","Srp","Zář","Říj","Lis","Pro"],allDay:"celý den",multiDay:"do",at:"v",endsToday:"končí dnes",endsTomorrow:"končí zítra",noEvents:"Žádné nadcházející události",loading:"Načítání událostí z kalendáře...",error:"Chyba: Entita kalendáře nebyla nalezena nebo je nesprávně nakonfigurována"},jn={daysOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],fullDaysOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],months:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],allDay:"hele dagen",multiDay:"indtil",at:"kl.",endsToday:"slutter i dag",endsTomorrow:"slutter i morgen",noEvents:"Ingen kommende begivenheder",loading:"Indlæser kalenderbegivenheder...",error:"Fejl: Kalenderenheden blev ikke fundet eller er ikke konfigureret korrekt"},xn={daysOfWeek:["So","Mo","Di","Mi","Do","Fr","Sa"],fullDaysOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],allDay:"ganztägig",multiDay:"bis",at:"um",endsToday:"endet heute",endsTomorrow:"endet morgen",noEvents:"Keine anstehenden Termine",loading:"Kalendereinträge werden geladen...",error:"Fehler: Kalender-Entität nicht gefunden oder falsch konfiguriert"},Sn={daysOfWeek:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],fullDaysOfWeek:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],months:["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],allDay:"Ολοήμερο",multiDay:"έως",at:"στις",endsToday:"λήγει σήμερα",endsTomorrow:"λήγει αύριο",noEvents:"Δεν υπάρχουν προγραμματισμένα γεγονότα",loading:"Φόρτωση ημερολογίου...",error:"Σφάλμα: Η οντότητα ημερολογίου δεν βρέθηκε ή δεν έχει ρυθμιστεί σωστά"},An={daysOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDaysOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],allDay:"all day",multiDay:"until",at:"at",endsToday:"ends today",endsTomorrow:"ends tomorrow",noEvents:"No upcoming events",loading:"Loading calendar events...",error:"Error: Calendar entity not found or improperly configured"},Tn={daysOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDaysOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],allDay:"all day",multiDay:"until",at:"at",endsToday:"ends today",endsTomorrow:"ends tomorrow",noEvents:"No upcoming events",loading:"Loading calendar events...",error:"Error: Calendar entity not found or improperly configured"},Dn={daysOfWeek:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],fullDaysOfWeek:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],months:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],allDay:"todo el día",multiDay:"hasta",at:"a las",endsToday:"termina hoy",endsTomorrow:"termina mañana",noEvents:"No hay eventos próximos",loading:"Cargando eventos del calendario...",error:"Error: La entidad del calendario no se encontró o está mal configurada"},Vn={daysOfWeek:["P","E","T","K","N","R","L"],fullDaysOfWeek:["pühapäev","esmaspäev","teisipäev","kolmapäev","neljapäev","reede
Line truncated
|
||||
`;const bn="exceptions";var fn={daysOfWeek:["нед.","пон.","вт.","ср.","четв.","пет.","съб."],fullDaysOfWeek:["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],months:["ян.","фев.","мар","апр.","май","юни","юли","авг.","септ.","окт.","ноем.","дек."],allDay:"цял ден",multiDay:"до",at:"в",endsToday:"приключва днес",endsTomorrow:"приключва утре",noEvents:"Няма планирани събития",loading:"Зареждане на календара със събития...",error:"Грешка: календарът не е намерен или не е конфигуриран правилно"},wn={daysOfWeek:["Dg","Dl","Dm","Dc","Dj","Dv","Ds"],fullDaysOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],months:["Gen","Febr","Març","Abr","Maig","Juny","Jul","Ag","Set","Oct","Nov","Des"],allDay:"tot el dia",multiDay:"fins a",at:"a les",endsToday:"acaba avui",endsTomorrow:"acaba damà",noEvents:"Cap event proper",loading:"Carregant events...",error:"Error: No s'ha trobat l'entitat del calendari o aquesta està mal configurada"},zn={daysOfWeek:["Ne","Po","Út","St","Čt","Pá","So"],fullDaysOfWeek:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"],months:["Led","Úno","Bře","Dub","Kvě","Čvn","Čvc","Srp","Zář","Říj","Lis","Pro"],allDay:"celý den",multiDay:"do",at:"v",endsToday:"končí dnes",endsTomorrow:"končí zítra",noEvents:"Žádné nadcházející události",loading:"Načítání událostí z kalendáře...",error:"Chyba: Entita kalendáře nebyla nalezena nebo je nesprávně nakonfigurována"},jn={daysOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],fullDaysOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],months:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],allDay:"hele dagen",multiDay:"indtil",at:"kl.",endsToday:"slutter i dag",endsTomorrow:"slutter i morgen",noEvents:"Ingen kommende begivenheder",loading:"Indlæser kalenderbegivenheder...",error:"Fejl: Kalenderenheden blev ikke fundet eller er ikke konfigureret korrekt"},xn={daysOfWeek:["So","Mo","Di","Mi","Do","Fr","Sa"],fullDaysOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],allDay:"ganztägig",multiDay:"bis",at:"um",endsToday:"endet heute",endsTomorrow:"endet morgen",noEvents:"Keine anstehenden Termine",loading:"Kalendereinträge werden geladen...",error:"Fehler: Kalender-Entität nicht gefunden oder falsch konfiguriert"},Sn={daysOfWeek:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],fullDaysOfWeek:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],months:["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],allDay:"Ολοήμερο",multiDay:"έως",at:"στις",endsToday:"λήγει σήμερα",endsTomorrow:"λήγει αύριο",noEvents:"Δεν υπάρχουν προγραμματισμένα γεγονότα",loading:"Φόρτωση ημερολογίου...",error:"Σφάλμα: Η οντότητα ημερολογίου δεν βρέθηκε ή δεν έχει ρυθμιστεί σωστά"},An={daysOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDaysOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],allDay:"all day",multiDay:"until",at:"at",endsToday:"ends today",endsTomorrow:"ends tomorrow",noEvents:"No upcoming events",loading:"Loading calendar events...",error:"Error: Calendar entity not found or improperly configured"},Tn={daysOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDaysOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],allDay:"all day",multiDay:"until",at:"at",endsToday:"ends today",endsTomorrow:"ends tomorrow",noEvents:"No upcoming events",loading:"Loading calendar events...",error:"Error: Calendar entity not found or improperly configured"},Dn={daysOfWeek:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],fullDaysOfWeek:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],months:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],allDay:"todo el día",multiDay:"hasta",at:"a las",endsToday:"termina hoy",endsTomorrow:"termina mañana",noEvents:"No hay eventos próximos",loading:"Cargando eventos del calendario...",error:"Error: La entidad del calendario no se encontró o está mal configurada"},Vn={daysOfWeek:["P","E","T","K","N","R","L"],fullDaysOfWeek:["pühapäev","esmaspäev","teisipäev","kolmapäev","neljapäev","reede
Line truncated
|
||||
<ha-expansion-panel
|
||||
outlined
|
||||
.header=${this._panelTitle(e,t)}
|
||||
@@ -125,11 +125,11 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
${u.map((e=>this._renderExtra(e)))} ${_} ${c}
|
||||
</div>
|
||||
</ha-expansion-panel>
|
||||
`}_panelTitle(e,t){var a;return null!=(a=zt(t.language,e.titleKey))?a:wt(e.titleKey)}_panelHelper(e,t){return zt(t.language,`${e.titleKey}.helper`)}_renderExtra(e){return L`
|
||||
`}_panelTitle(e,t){var a;return null!=(a=zt(t.language,e.titleKey))?a:wt(e.titleKey)}_panelHelper(e,t){return zt(t.language,`${e.titleKey}.helper`)}_renderExtra(e){return $`
|
||||
<div class="width-table">
|
||||
<div class="width-table-title">${e.title}</div>
|
||||
<table>
|
||||
${e.rows.map((e=>L`
|
||||
${e.rows.map((e=>$`
|
||||
<tr>
|
||||
<td class="width-table-width">${e.width}</td>
|
||||
<td class="width-table-layout">${e.layout}</td>
|
||||
@@ -138,8 +138,8 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
</table>
|
||||
<div class="width-table-note">${e.note}</div>
|
||||
</div>
|
||||
`}_renderEntities(e,t){var a,i,o,n;const l=null==(i=null==(a=e.subforms)?void 0:a.call(e,t))?void 0:i.find((e=>e.path.join(".")===so.join(".")));if(void 0===l)return F;const r=null!=(n=null==(o=this._config)?void 0:o.entities)?n:[];if(0===r.length)return F;const s=this._filterCtx,d=an(this._filter),c=r.map(((e,a)=>({entry:e,index:a,schema:gn(ya(l.schema,oi(e),da(ai(e).accent_color),na(ai(e).label),ii(e,t.config,t.view),ra(ai(e).label)),e,l.path,s)}))).filter((e=>yn(e.schema)));if(0===c.length)return F;const _=e=>xt(t.language,e,l.path),u=e=>Dt(t.language,t.view,e,l.path,function(e){var t;return null!=(t=lt[e])?t:nt[e]}(e.name));return L`
|
||||
${c.map((({entry:e,index:a,schema:i})=>{const o=Na(e);return L`
|
||||
`}_renderEntities(e,t){var a,i,o,n;const l=null==(i=null==(a=e.subforms)?void 0:a.call(e,t))?void 0:i.find((e=>e.path.join(".")===so.join(".")));if(void 0===l)return I;const r=null!=(n=null==(o=this._config)?void 0:o.entities)?n:[];if(0===r.length)return I;const s=this._filterCtx,d=an(this._filter),c=r.map(((e,a)=>({entry:e,index:a,schema:gn(ya(l.schema,oi(e),da(ai(e).accent_color),na(ai(e).label),ii(e,t.config,t.view),ra(ai(e).label)),e,l.path,s)}))).filter((e=>yn(e.schema)));if(0===c.length)return I;const _=e=>xt(t.language,e,l.path),u=e=>Dt(t.language,t.view,e,l.path,function(e){var t;return null!=(t=lt[e])?t:nt[e]}(e.name));return $`
|
||||
${c.map((({entry:e,index:a,schema:i})=>{const o=Na(e);return $`
|
||||
<ha-expansion-panel
|
||||
outlined
|
||||
class="entity-panel"
|
||||
@@ -197,7 +197,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
</div>
|
||||
</ha-expansion-panel>
|
||||
`}))}
|
||||
`}_entitySummary(e,t,a){const i=e[t],o=ai(i),n="string"==typeof o.label&&""!==o.label?o.label:ci(i)?this._string(a,"entity.customised"):this._string(a,"entity.unconfigured"),{position:l,total:r}=function(e,t){if(t<0||t>=e.length)return{position:0,total:0};const a=Na(e[t]);let i=0,o=0;return e.forEach(((e,n)=>{Na(e)===a&&(o+=1,n===t&&(i=o))})),{position:i,total:o}}(e,t);if(r<2)return n;return`${ke(this._string(a,"entity.occurrence"),{position:l,total:r})} · ${n}`}_entityChanged(e,t){var a,i,o;t.stopPropagation();const n=null==(a=t.detail)?void 0:a.value;n&&this._config&&(this._config=Gn(Jn({},this._config),{entities:ri(null!=(i=this._config.entities)?i:[],e,n,this._config.accent_color,null!=(o=this.hass)?o:void 0)}),this._report(this._config))}_copyEntitySettings(e){si(e),this.requestUpdate()}_pasteEntitySettings(e){var t;this._config&&(this._config=Gn(Jn({},this._config),{entities:di(null!=(t=this._config.entities)?t:[],e)}),this._report(this._config))}_duplicateEntity(e){var t;this._config&&(this._config=Gn(Jn({},this._config),{entities:ei(null!=(t=this._config.entities)?t:[],e)}),this._report(this._config))}_removeEntity(e){var t;this._config&&(this._config=Gn(Jn({},this._config),{entities:ti(null!=(t=this._config.entities)?t:[],e)}),this._report(this._config))}_renderExceptions(e,t,a){const i=ot[a.view];if(void 0===i)return F;const o=function(e,t,a="en"){var i,o;const n=new Set,l=[];for(const{node:t}of Ao(e)){if(!("selector"in t))continue;const e=null!=(i=Co.get(t.name))?i:t.name;if(!Mo.has(e)||n.has(e))continue;const o=e===t.name?{name:e,selector:t.selector}:No(e,a);void 0!==o&&(n.add(e),l.push(o))}for(const e of null!=(o=Ho[t])?o:[]){if(n.has(e)||!Mo.has(e))continue;const t=No(e,a);void 0!==t&&(n.add(e),l.push(t))}return l}(t,e.id,a.language);if(0===o.length)return F;const n=function(e,t){return e.filter((e=>t.has(e.name)))}(o,this._declaredExceptions),l=[i],r=an(this._filter),s=this._string(a,"exceptions.title"),d=function(e,t,a,i){if(!an(i.criteria))return[...e];const o=tn(i);return""!==o&&on(t,o)?[...e]:e.filter((e=>ln(e,a,i)))}(n,s,l,this._filterCtx);if(r&&0===d.length)return F;const c=e=>xt(a.language,e,l),_={name:bn,selector:{select:{mode:"dropdown",multiple:!0,options:o.map((e=>({value:e.name,label:c(e)})))}}},u=d.map((e=>e.name)),p=lo(Qi(this._config,u),u,ro(this._pending,i)),m=function(e,t,a){return e.flatMap((e=>{const i=oo[e.name];return void 0===i?[e]:i.build(t,a)}))}(d,a.language,p);return L`
|
||||
`}_entitySummary(e,t,a){const i=e[t],o=ai(i),n="string"==typeof o.label&&""!==o.label?o.label:ci(i)?this._string(a,"entity.customised"):this._string(a,"entity.unconfigured"),{position:l,total:r}=function(e,t){if(t<0||t>=e.length)return{position:0,total:0};const a=Na(e[t]);let i=0,o=0;return e.forEach(((e,n)=>{Na(e)===a&&(o+=1,n===t&&(i=o))})),{position:i,total:o}}(e,t);if(r<2)return n;return`${ke(this._string(a,"entity.occurrence"),{position:l,total:r})} · ${n}`}_entityChanged(e,t){var a,i,o;t.stopPropagation();const n=null==(a=t.detail)?void 0:a.value;n&&this._config&&(this._config=Gn(Jn({},this._config),{entities:ri(null!=(i=this._config.entities)?i:[],e,n,this._config.accent_color,null!=(o=this.hass)?o:void 0)}),this._report(this._config))}_copyEntitySettings(e){si(e),this.requestUpdate()}_pasteEntitySettings(e){var t;this._config&&(this._config=Gn(Jn({},this._config),{entities:di(null!=(t=this._config.entities)?t:[],e)}),this._report(this._config))}_duplicateEntity(e){var t;this._config&&(this._config=Gn(Jn({},this._config),{entities:ei(null!=(t=this._config.entities)?t:[],e)}),this._report(this._config))}_removeEntity(e){var t;this._config&&(this._config=Gn(Jn({},this._config),{entities:ti(null!=(t=this._config.entities)?t:[],e)}),this._report(this._config))}_renderExceptions(e,t,a){const i=ot[a.view];if(void 0===i)return I;const o=function(e,t,a="en"){var i,o;const n=new Set,l=[];for(const{node:t}of Ao(e)){if(!("selector"in t))continue;const e=null!=(i=Co.get(t.name))?i:t.name;if(!Mo.has(e)||n.has(e))continue;const o=e===t.name?{name:e,selector:t.selector}:No(e,a);void 0!==o&&(n.add(e),l.push(o))}for(const e of null!=(o=Ho[t])?o:[]){if(n.has(e)||!Mo.has(e))continue;const t=No(e,a);void 0!==t&&(n.add(e),l.push(t))}return l}(t,e.id,a.language);if(0===o.length)return I;const n=function(e,t){return e.filter((e=>t.has(e.name)))}(o,this._declaredExceptions),l=[i],r=an(this._filter),s=this._string(a,"exceptions.title"),d=function(e,t,a,i){if(!an(i.criteria))return[...e];const o=tn(i);return""!==o&&on(t,o)?[...e]:e.filter((e=>ln(e,a,i)))}(n,s,l,this._filterCtx);if(r&&0===d.length)return I;const c=e=>xt(a.language,e,l),_={name:bn,selector:{select:{mode:"dropdown",multiple:!0,options:o.map((e=>({value:e.name,label:c(e)})))}}},u=d.map((e=>e.name)),p=lo(Qi(this._config,u),u,ro(this._pending,i)),m=function(e,t,a){return e.flatMap((e=>{const i=oo[e.name];return void 0===i?[e]:i.build(t,a)}))}(d,a.language,p);return $`
|
||||
<ha-expansion-panel
|
||||
outlined
|
||||
class="exceptions"
|
||||
@@ -218,7 +218,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
.localizeValue=${this._localizeValue}
|
||||
@value-changed=${e=>this._exceptionsSelected(i,o,e)}
|
||||
></ha-form>
|
||||
${0===d.length?F:L`
|
||||
${0===d.length?I:$`
|
||||
<ha-form
|
||||
class="exception-form"
|
||||
.hass=${this.hass}
|
||||
@@ -232,11 +232,11 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
`}
|
||||
</div>
|
||||
</ha-expansion-panel>
|
||||
`}_exceptionSummary(e,t){return 0===e?this._string(t,"exceptions.summary.none"):1===e?this._string(t,"exceptions.summary.one"):ke(this._string(t,"exceptions.summary.many"),{count:e})}_exceptionsSelected(e,t,a){var i,o;if(a.stopPropagation(),!this._config)return;const n=null==(o=null==(i=a.detail)?void 0:i.value)?void 0:o[bn];if(!Array.isArray(n))return;const l=function(e,t,a,i,o){const n=new Set(o.filter((e=>a.includes(e)))),l=new Set(i);let r=e;for(const e of a)n.has(e)?l.add(e):(l.delete(e),r=$o(r,t,e));return{config:r,declared:l}}(this._config,e,t.map((e=>e.name)),this._declaredExceptions,n.map((e=>String(e))));this._config=l.config,this._declaredExceptions=l.declared,this._report(this._config)}_exceptionChanged(e,t,a){var i;a.stopPropagation();const o=null==(i=a.detail)?void 0:i.value;if(!o||!this._config)return;const n=e,l=ro(this._pending,n),r=lo(Qi(this._config,t),t,l),s=this._config[e],d=function(e,t,a,i={}){const o=Wi(t,a),n=qi(e,t,a,i),l=io({},n.config);for(const e of Object.keys(l))$a(e)&&delete l[e];for(const[e,t]of Object.entries(oo))o.some((e=>t.fields.includes(e)))&&void 0===l[e]&&(l[e]=t.off);return{block:l,pending:n.pending}}(s&&"object"==typeof s&&!Array.isArray(s)?s:{},r,o,l);this._pending=function(e,t,a){const i=`${t}.`,o=Object.fromEntries(Object.entries(e).filter((([e])=>!e.startsWith(i))));return io(io({},o),Object.fromEntries(Object.entries(a).map((([e,t])=>[i+e,t]))))}(this._pending,n,d.pending),this._config=Gn(Jn({},this._config),{[e]:d.block}),this._report(this._config)}_string(e,t){var a;return null!=(a=zt(e.language,t))?a:wt(t)}render(){if(!this.hass||!this._config)return F;const e=this._ctx,t=So.map((t=>this._renderPanel(t,e))).filter((e=>e!==F)),a=0===t.length&&an(this._filter);return L`
|
||||
`}_exceptionSummary(e,t){return 0===e?this._string(t,"exceptions.summary.none"):1===e?this._string(t,"exceptions.summary.one"):ke(this._string(t,"exceptions.summary.many"),{count:e})}_exceptionsSelected(e,t,a){var i,o;if(a.stopPropagation(),!this._config)return;const n=null==(o=null==(i=a.detail)?void 0:i.value)?void 0:o[bn];if(!Array.isArray(n))return;const l=function(e,t,a,i,o){const n=new Set(o.filter((e=>a.includes(e)))),l=new Set(i);let r=e;for(const e of a)n.has(e)?l.add(e):(l.delete(e),r=Lo(r,t,e));return{config:r,declared:l}}(this._config,e,t.map((e=>e.name)),this._declaredExceptions,n.map((e=>String(e))));this._config=l.config,this._declaredExceptions=l.declared,this._report(this._config)}_exceptionChanged(e,t,a){var i;a.stopPropagation();const o=null==(i=a.detail)?void 0:i.value;if(!o||!this._config)return;const n=e,l=ro(this._pending,n),r=lo(Qi(this._config,t),t,l),s=this._config[e],d=function(e,t,a,i={}){const o=Wi(t,a),n=qi(e,t,a,i),l=io({},n.config);for(const e of Object.keys(l))La(e)&&delete l[e];for(const[e,t]of Object.entries(oo))o.some((e=>t.fields.includes(e)))&&void 0===l[e]&&(l[e]=t.off);return{block:l,pending:n.pending}}(s&&"object"==typeof s&&!Array.isArray(s)?s:{},r,o,l);this._pending=function(e,t,a){const i=`${t}.`,o=Object.fromEntries(Object.entries(e).filter((([e])=>!e.startsWith(i))));return io(io({},o),Object.fromEntries(Object.entries(a).map((([e,t])=>[i+e,t]))))}(this._pending,n,d.pending),this._config=Gn(Jn({},this._config),{[e]:d.block}),this._report(this._config)}_string(e,t){var a;return null!=(a=zt(e.language,t))?a:wt(t)}render(){if(!this.hass||!this._config)return I;const e=this._ctx,t=So.map((t=>this._renderPanel(t,e))).filter((e=>e!==I)),a=0===t.length&&an(this._filter);return $`
|
||||
<div class="card-config">
|
||||
${this._renderFilterBar()} ${t} ${a?this._renderNoMatches(e):F}
|
||||
${this._renderFilterBar()} ${t} ${a?this._renderNoMatches(e):I}
|
||||
</div>
|
||||
`}_renderFilterBar(){return L`
|
||||
`}_renderFilterBar(){return $`
|
||||
<div class="filter-bar">
|
||||
<ha-form
|
||||
class="filter-form"
|
||||
@@ -249,11 +249,11 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
@value-changed=${this._filterChanged}
|
||||
></ha-form>
|
||||
</div>
|
||||
`;var e}_renderNoMatches(e){const t=this._filter.query.trim();return""===t?L`
|
||||
`;var e}_renderNoMatches(e){const t=this._filter.query.trim();return""===t?$`
|
||||
<div class="filter-empty">${this._string(e,"filter.nothing_customized")}</div>
|
||||
`:L`
|
||||
`:$`
|
||||
<div class="filter-empty">
|
||||
${ke(this._string(e,"filter.no_matches"),{query:t})}
|
||||
<div class="filter-empty-note">${this._string(e,"filter.gated_note")}</div>
|
||||
</div>
|
||||
`}}Qn([se({attribute:!1})],Yn.prototype,"hass"),Qn([de()],Yn.prototype,"_config"),Qn([de()],Yn.prototype,"_pending"),Qn([de()],Yn.prototype,"_declaredExceptions"),Qn([de()],Yn.prototype,"_filter");const Xn="4.1.0";export{Yn as CalendarCardProEditor,Xn as EDITOR_VERSION,So as PANELS,qi as applyFormChange,Wi as changedKeys,La as deriveSyntheticData,Da as isCommittableOffset,$a as isSyntheticKey,Bi as stripColumnDefaults,Zi as toStoredConfig,Ao as walkSchema};
|
||||
`}}Qn([se({attribute:!1})],Yn.prototype,"hass"),Qn([de()],Yn.prototype,"_config"),Qn([de()],Yn.prototype,"_pending"),Qn([de()],Yn.prototype,"_declaredExceptions"),Qn([de()],Yn.prototype,"_filter");const Xn="4.2.0";export{Yn as CalendarCardProEditor,Xn as EDITOR_VERSION,So as PANELS,qi as applyFormChange,Wi as changedKeys,$a as deriveSyntheticData,Da as isCommittableOffset,La as isSyntheticKey,Bi as stripColumnDefaults,Zi as toStoredConfig,Ao as walkSchema};
|
||||
Reference in new issue
Block a user