/**
* Minified by jsDelivr using Terser v3.14.1.
* Original file: /gh/bramkragten/custom-ui@null/weather-card/weather-card.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
const LitElement=Object.getPrototypeOf(customElements.get("ha-panel-lovelace")),html=LitElement.prototype.html,weatherIconsDay={clear:"day","clear-night":"night",cloudy:"cloudy",fog:"cloudy",hail:"rainy-7",lightning:"thunder","lightning-rainy":"thunder",partlycloudy:"cloudy-day-3",pouring:"rainy-6",rainy:"rainy-5",snowy:"snowy-6","snowy-rainy":"rainy-7",sunny:"day",windy:"cloudy","windy-variant":"cloudy-day-3",exceptional:"!!"},weatherIconsNight={...weatherIconsDay,clear:"night",sunny:"night",partlycloudy:"cloudy-night-3","windy-variant":"cloudy-night-3"},windDirections=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW","N"],fireEvent=(t,e,i,n)=>{n=n||{},i=null==i?{}:i;const a=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return a.detail=i,t.dispatchEvent(a),a};function hasConfigOrEntityChanged(t,e){if(e.has("_config"))return!0;const i=e.get("hass");return!i||(i.states[t._config.entity]!==t.hass.states[t._config.entity]||i.states["sun.sun"]!==t.hass.states["sun.sun"])}class WeatherCard extends LitElement{static get properties(){return{_config:{},hass:{}}}static async getConfigElement(){return await import("./weather-card-editor.js"),document.createElement("weather-card-editor")}static getStubConfig(){return{}}setConfig(t){if(!t.entity)throw new Error("Please define a weather entity");this._config=t}shouldUpdate(t){return hasConfigOrEntityChanged(this,t)}render(){if(!this._config||!this.hass)return html``;const t=this.hass.states[this._config.entity];if(!t)return html`