"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["44722"],{58548:function(t,o,i){i.d(o,{A:function(){return r}});i(16280),i(34782),i(27495),i(99449),i(25440);var e=function(t){var o=parseFloat(t);if(isNaN(o))throw new Error("".concat(t," is not a number"));return o};function r(t){if(!t)return null;try{if(t.endsWith("%"))return{w:100,h:e(t.slice(0,-1))};var o=t.replace(":","x").split("x");return 0===o.length?null:1===o.length?{w:e(o[0]),h:1}:{w:e(o[0]),h:e(o[1])}}catch(i){}return null}},56393:function(t,o,i){i.r(o),i.d(o,{HuiIframeCard:function(){return b}});var e,r,n,a=i(61397),l=i(50264),c=i(72153),s=i(44734),u=i(43080),h=i(69683),f=i(6454),d=(i(16280),i(28706),i(23792),i(2892),i(26099),i(3362),i(27495),i(38781),i(47764),i(25440),i(62953),i(3296),i(27208),i(48408),i(14603),i(47566),i(98721),i(40445)),p=i(96196),g=i(77845),w=i(94333),_=i(32288),v=i(6415),m=i(58548),y=(i(38962),i(76776),i(47222)),b=function(t){function o(){return(0,s.A)(this,o),(0,h.A)(this,o,arguments)}return(0,f.A)(o,t),(0,u.A)(o,[{key:"getCardSize",value:function(){return this._config?1+(this._config.aspect_ratio?Number(this._config.aspect_ratio.replace("%","")):50)/25:5}},{key:"setConfig",value:function(t){if(!t.url)throw new Error("URL required");this._config=t}},{key:"render",value:function(){var t;if(!this._config||!this.hass)return p.s6;var o="";if(!("panel"===this.layout||"grid"===this.layout))if(this._config.aspect_ratio){var i=(0,m.A)(this._config.aspect_ratio);i&&i.w>0&&i.h>0&&(o="".concat((100*i.h/i.w).toFixed(2),"%"))}else o="50%";var n=new URL(this._config.url,location.toString()).protocol;if("https:"===location.protocol&&"https:"!==n)return(0,p.qy)(e||(e=(0,c.A)([' <ha-alert alert-type="error"> '," </ha-alert> "])),this.hass.localize("ui.panel.lovelace.cards.iframe.error_secure_context",{target_protocol:n,context_protocol:location.protocol}));var a="";this._config.allow_open_top_navigation&&(a+="allow-top-navigation-by-user-activation");var l=this._config.disable_sandbox?void 0:"".concat(a," ").concat(y.D);return(0,p.qy)(r||(r=(0,c.A)([' <ha-card class="','" .header="','"> <div id="root" style="','"> <iframe title="','" src="','" sandbox="','" allow="','"></iframe> </div> </ha-card> '])),(0,w.H)({"hide-background":this._config.hide_background}),this._config.title,(0,v.W)({"padding-top":o}),(0,_.J)(this._config.title),this._config.url,(0,_.J)(l),null!==(t=this._config.allow)&&void 0!==t?t:"fullscreen")}},{key:"getGridOptions",value:function(){return{columns:"full",rows:4,min_columns:3,min_rows:2}}}],[{key:"getConfigElement",value:(n=(0,l.A)((0,a.A)().m(function t(){return(0,a.A)().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,i.e("21833").then(i.bind(i,976));case 1:return t.a(2,document.createElement("hui-iframe-card-editor"))}},t)})),function(){return n.apply(this,arguments)})},{key:"getStubConfig",value:function(){return{type:"iframe",url:"https://www.home-assistant.io",aspect_ratio:"50%"}}}]);var n}(p.WF);b.styles=(0,p.AH)(n||(n=(0,c.A)(["ha-card{overflow:hidden;width:100%;height:100%;display:flex;flex-direction:column}ha-card.hide-background{background:0 0;box-shadow:none;border:none}#root{width:100%;height:100%;position:relative}iframe{position:absolute;border:none;width:100%;height:100%;top:0;left:0}"]))),(0,d.Cg)([(0,g.MZ)({attribute:!1})],b.prototype,"layout",void 0),(0,d.Cg)([(0,g.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,d.Cg)([(0,g.wk)()],b.prototype,"_config",void 0),b=(0,d.Cg)([(0,g.EM)("hui-iframe-card")],b)},47222:function(t,o,i){i.d(o,{D:function(){return e}});var e="allow-forms allow-popups allow-pointer-lock allow-same-origin allow-scripts allow-modals allow-downloads"}}]);
//# sourceMappingURL=44722.eadf3bd27e16c4df.js.map