(self.webpackChunkpyesasky=self.webpackChunkpyesasky||[]).push([[209],{209:(e,s,t)=>{"use strict";t.r(s),t.d(s,{ESASkyJSModel:()=>l,ESASkyJSView:()=>o,default:()=>n,version:()=>a});var i=t(449),d=t(185);class l extends i.DOMWidgetModel{initialize(e,s){super.initialize(e,s)}defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ESASkyJSModel",_view_name:"ESASkyJSView",_model_module:"pyesasky",_view_module:"pyesasky",view_module_ids:[]})}}class o extends i.DOMWidgetView{render(){var e=document.createElement("div");this.base_url=d.PageConfig.getBaseUrl(),this.base_url=d.PageConfig.getBaseUrl(),this.modelId="esaskyFrame"+Math.random().toString(36).substr(2,10);var s=this.model.get("_view_module_ids");s.push(this.modelId),this.model.set("_view_module_ids",s);var t=this.model.get("_view_language");console.log(t),e.innerHTML="<iframe id="+this.modelId+" width='100%' height='800px' style='border: none;' src='https://sky.esa.int?hide_welcome=true&hide_sci_switch=true&hide_banner_info=true'</iframe>",this.el.appendChild(e);let i=this.el;new MutationObserver((()=>{i.style.height="auto"})).observe(i,{attributes:!0,childList:!0}),this.model.on("msg:custom",this.handle_custom_message,this),this.listenTo(this.model,"change:view_height",this.height_changed),this.oldMsgId=null,this.oldMsgIdToFront=null;var l=this;window.addEventListener("message",(function(e){var s=e.data;console.log("Back inside pyesasky.js"),l.oldMsgId!=s.msgId&&(l.oldMsgId=s.msgId,l.model.send(s,null,null))}))}height_changed(){console.log("Changing view height");var e=this.model.get("view_height");let s=this.model.get("_view_module_ids");for(var t=s.length-1;t>=0;t--){let i=s[t];if(null!=document.getElementById(i)){document.getElementById(i).style.height=e;break}}}handle_custom_message(e){let s,t=this.model.get("_view_module_ids");for(var i=t.length-1;i>=0&&(s=t[i],null==document.getElementById(s));i--);this.oldMsgIdToFront!=e.msgId&&this.modelId==s&&(this.oldMsgIdToFront=e.msgId,console.log("Inside pyesasky.js"),document.getElementById(this.modelId).contentWindow.postMessage(e,"https://sky.esa.int"))}}const n={id:"pyesasky:plugin",autoStart:!0,activate:(e,s)=>{console.log("JupyterLab extension pyesasky is activated!")}},a=t(306).i8},306:e=>{"use strict";e.exports={i8:"1.9.1"}}}]);