"use strict";vary=Object.defineProperty;varF=Object.getOwnPropertyDescriptor;varE=Object.getOwnPropertyNames;vark=Object.prototype.hasOwnProperty;varT=(d,i)=>{for(varaini)y(d,a,{get:i[a],enumerable:!0})},L=(d,i,a,n)=>{if(i&&typeofi=="object"||typeofi=="function")for(lettofE(i))!k.call(d,t)&&t!==a&&y(d,t,{get:()=>i[t],enumerable:!(n=F(i,t))||n.enumerable});returnd};varN=d=>L(y({},"__esModule",{value:!0}),d);varM={};T(M,{default:()=>w});module.exports=N(M);varh=require("obsidian");varS=require("obsidian");varu={frames:[],padding:5},C={obsidian:{url:"https://forum.obsidian.md/",displayName:"Obsidian Forum",icon:"edit",hideOnMobile:!0,addRibbonIcon:!0,openInCenter:!0,zoomLevel:1,forceIframe:!1,customCss:"",customJs:""},detexify:{url:"https://detexify.kirelabs.org/classify.html",displayName:"Detexify",icon:"type",hideOnMobile:!0,addRibbonIcon:!0,openInCenter:!1,zoomLevel:.95,forceIframe:!1,customCss:`/* hide info clutter and ad banner */
}`,customJs:""},calendar:{url:"https://calendar.google.com/calendar",displayName:"Google Calendar",icon:"calendar",hideOnMobile:!0,addRibbonIcon:!0,openInCenter:!0,zoomLevel:1,forceIframe:!1,customCss:`/* hide the menu bar "Calendar" text and remove minimum width */
}`,customJs:""},keep:{url:"https://keep.google.com",displayName:"Google Keep",icon:"files",hideOnMobile:!0,addRibbonIcon:!1,openInCenter:!1,zoomLevel:1,forceIframe:!1,customCss:`/* hide the menu bar, the "Keep" text and the Google Apps button */
}`,customJs:""},todoist:{url:"https://todoist.com",displayName:"Todoist",icon:"list-checks",hideOnMobile:!0,addRibbonIcon:!1,openInCenter:!1,zoomLevel:1,forceIframe:!1,customCss:`/* hide the help, home, search, and productivity overview buttons, create extra space, and prevent toast pop-up from acting weird */
}`,customJs:""}};functiong(d){returnd.icon?`lucide-${d.icon}`:"documents"}functionv(d){returnd.displayName.toLowerCase().replace(/\s/g,"-")}varm=class{constructor(i,a){this.settings=i,this.data=a}create(i,a,n,t){lets=`padding: ${this.settings.padding}px;`;if(n&&(s+=n),S.Platform.isDesktopApp&&!this.data.forceIframe){lete=a.doc;this.frame=a.createEl("webview"),this.frame.partition="persist:vault-"+i.appId,a.appendChild(this.frame),this.frame.setAttribute("allowpopups",""),this.frame.addEventListener("dom-ready",()=>{this.frame.setZoomFactor(this.data.zoomLevel),this.frame.insertCSS(this.data.customCss),this.frame.executeJavaScript(this.data.customJs)}),this.frame.addEventListener("destroyed",()=>{e!=a.doc&&(this.frame.detach(),this.create(i,a,n,t))})}elsethis.frame=a.createEl("iframe"),a.appendChild(this.frame),this.frame.setAttribute("sandbox","allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation allow-downloads"),this.frame.setAttribute("allow","encrypted-media; fullscreen; oversized-images; picture-in-picture; sync-xhr; geolocation;"),s+=`transform: scale(${this.data.zoomLevel}); transform-origin: 0 0;`;this.frame.addClass("custom-frames-frame"),this.frame.addClass(`custom-frames-${v(this.data)}`),this.frame.setAttribute("style",s);leto=newURL(this.data.url);if(t){lete=newURL(t,o.origin);e.searchParams.forEach((r,l)=>{o.searchParams.set(l,r)}),e.pathname!=="/"&&(o.pathname+=e.pathname),o.hash=e.hash||o.hash}this.frame.setAttribute("src",o.toString())}refresh(){this.frameinstanceofHTMLIFrameElement?this.frame.contentWindow.location.reload():this.frame.reload()}return(){this.frameinstanceofHTMLIFrameElement?this.frame.contentWindow.open(this.data.url):this.frame.loadURL(this.data.url)}goBack(){this.frameinstanceofHTMLIFrameElement?this.frame.contentWindow.history.back():this.frame.goBack()}goForward(){this.frameinstanceofHTMLIFrameElement?this.frame.contentWindow.history.forward():this.frame.goForward()}toggleDevTools(){this.frameinstanceofHTMLIFrameElement||(this.frame.isDevToolsOpened()?this.frame.closeDevTools():this.frame.openDevTools())}getCurrentUrl(){returnthis.frameinstanceofHTMLIFrameElement?this.frame.contentWindow.location.href:this.frame.getURL()}focus(){this.frameinstanceofHTMLIFrameElement?this.frame.contentWindow.focus():this.frame.focus()}};varc=require("obsidian");varb=classextendsc.PluginSettingTab{constructor(i,a){super(i,a),this.plugin=a}display(){this.containerEl.empty();leti=newc.SettingGroup(this.containerEl);i.addSetting(t=>voidt.setName(createFragment(s=>s.createSpan({text:"Please note that Obsidian has to be restarted or reloaded for most Custom Frames settings to take effect.",cls:"mod-warning"})))),i.addSetting(t=>voidt.setName("Frame padding").setDesc("The padding that should be left around the inside of custom frame panes, in pixels.").addText(s=>{s.inputEl.type="number",s.setValue(String(this.plugin.settings.padding)),s.onChange(asynco=>{this.plugin.settings.padding=o.length?Number(o):u.padding,awaitthis.plugin.saveSettings()})}));for(lettofthis.plugin.settings.frames){lets=newc.SettingGroup(this.containerEl).setHeading(t.displayName||"Unnamed frame");s.addSetting(o=>voido.setName("Display name").setDesc("The display name that this frame should have.").addText(e=>{e.setValue(t.displayName),e.onChange(asyncr=>{t.displayName=r,s.setHeading(t.displayName||"Unnamed frame"),awaitthis.plugin.saveSettings()})})),s.addSetting(o=>voido.setName("Icon").setDesc(createFragment(e=>{e.createSpan({text:"The icon that this frame's pane should have. The names of any "}),e.createEl("a",{text:"Lucide icons",href:"https://lucide.dev/"}),e.createSpan({text:" can be used."})})).addText(e=>{e.setValue(t.icon),e.onChange(asyncr=>{t.icon=r,awaitthis.plugin.saveSettings()})})),s.addSetting(o=>voido.setName("URL").setDesc("The URL that should be opened in this frame.").addText(e=>{e.setValue(t.url),e.onChange(asyncr=>{t.url=r,awaitthis.plugin.saveSettings()})})),s.addSetting(o=>voido.setNam