var m=Object.create;var r=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var v=(n,e)=>{for(var t in e)r(n,t,{get:e[t],enumerable:!0})},d=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of h(e))!T.call(n,a)&&a!==t&&r(n,a,{get:()=>e[a],enumerable:!(i=y(e,a))||i.enumerable});return n};var P=(n,e,t)=>(t=n!=null?m(u(n)):{},d(e||!n||!n.__esModule?r(t,"default",{value:n,enumerable:!0}):t,n)),b=n=>d(r({},"__esModule",{value:!0}),n);var w={};v(w,{default:()=>p});module.exports=b(w);var o=require("electron/main"),s=require("../../common/modules/client"),c=P(require("../../common/modules/l10n")),f=require("../modules/parent"),g=require("deepmerge-ts"),l=require("../modules/config");function C(){const n=(0,g.deepmerge)(l.appConfig.value.settings,new c.default().settings),e=n,t=Object.freeze({algolia:"Algolia",spotify:"Spotify",hcaptcha:"hCaptcha",paypal:"PayPal",audius:"Audius",gif:n.advanced.cspThirdParty.labels.gif,reddit:"Reddit",soundcloud:"SoundCloud",streamable:"Streamable",twitch:"Twitch",twitter:"Twitter",vimeo:"Vimeo",youtube:"YouTube",googleStorageApi:"Google Storage API"});return Object.entries(t).map(i=>{e.advanced?.cspThirdParty?.labels&&e.advanced.cspThirdParty.labels[i[0]]===void 0&&(e.advanced.cspThirdParty.labels[i[0]]=i[1]),e.advanced?.cspThirdParty&&(e.advanced.cspThirdParty.info!==void 0?e.advanced.cspThirdParty.info.gif="Imgur, Gfcat, Tenor":e.advanced.cspThirdParty.info={gif:"Imgur, Gfcat, Tenor"})}),e.advanced?.cspThirdParty?.name!==void 0&&(e.advanced.cspThirdParty.name=n.advanced.csp.name+" \u2013 "+n.advanced.cspThirdParty.name),e}function p(n){const e=C(),t=Object.freeze([Object.freeze(["general",e.general]),Object.freeze(["privacy",e.privacy]),Object.freeze(["advanced",e.advanced])]);n.isVisible()||n.show();const i=(0,f.initWindow)("settings",n,{minWidth:s.appInfo.minWinWidth,minHeight:s.appInfo.minWinHeight});if(i!==void 0)return o.ipcMain.handle("settings-generate-html",a=>{if(!(a.senderFrame&&new URL(a.senderFrame.url).protocol!=="file:"))return i.isDestroyed()||i.show(),t}),i.once("closed",()=>{o.ipcMain.removeHandler("settings-generate-html")}),i}
