(()=>{"use strict";var e={770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeSeparatorsNative=t.normalizeSeparators=t.checkForNewLanguage=void 0;const n=e=>{if("undefined"!=typeof window){const t=window.localStorage.getItem(e);return{isSet:""!==t&&!!t,value:t}}return{isSet:!1,value:""}};function r(e,t="/"){return e.replace(/[\\/]+/g,t)}t.checkForNewLanguage=()=>new Promise((e=>{const t=(new Date).getTime(),r=setInterval((()=>{if((new Date).getTime()>t+5e3)clearInterval(r),e("en");else{const i=n("LAST_TIME");if(i.isSet){const o=n("LOCALE");o.isSet&&t<=parseInt(""+i.value,10)+3e3&&(clearInterval(r),e(""+o.value))}}}),100)})),t.normalizeSeparators=r,t.normalizeSeparatorsNative=function(e){return r(e,"win32"===process.platform?"\\":"/")}},794:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(298),o=n(147),a=r(n(17)),s=n(770);i.ipcRenderer.on("css",((e,t)=>{const n=document.createElement("style");n.setAttribute("language","text/css"),n.innerText=t,document.head.appendChild(n)})),i.ipcRenderer.on("initialize",((e,t)=>{const n=t.default32bitPath;let r=!1;if(n){const e=document.getElementById("use-default-32");e?.removeAttribute("disabled"),l(""+t.selectedRVersion,n+"/bin/i386/R.exe")&&(e.checked=!0,r=!0)}const i=t.default64bitPath;let c=!1;if(i){const e=document.getElementById("use-default-64");e?.removeAttribute("disabled"),l(""+t.selectedRVersion,i+"/bin/x64/R.exe")&&(e.checked=!0,c=!0)}const u=t.rInstalls,d=t.renderingEngine;document.getElementById("rendering-engine").value=d;const m=document.getElementById("select"),p={};u.sort(((e,t)=>t.localeCompare(e)));const f=document.getElementById("select");f.disabled=!0,u.forEach((e=>{if(e=(0,s.normalizeSeparatorsNative)(a.default.normalize(e)),p[e])return;p[e]=!0;const n=`${e}/bin/x64/R.exe`;if((0,o.existsSync)(n)){const r=window.document.createElement("option");r.value=n,r.innerText=`[64-bit] ${e}`,m.appendChild(r),l(t.selectedRVersion,n)&&!c&&(document.getElementById("use-custom").checked=!0,m.value=n,f.disabled=!1,f.focus())}const i=`${e}/bin/i386/R.exe`;if((0,o.existsSync)(i)){const n=window.document.createElement("option");n.value=i,n.innerText=`[32-bit] ${e}`,m.appendChild(n),l(t.selectedRVersion,i)&&!r&&(document.getElementById("use-custom").checked=!0,f.disabled=!1,m.value=i,f.focus())}}))}));const c={useDefault32bit:async e=>await i.ipcRenderer.invoke("use-default-32bit",e),useDefault64bit:async e=>await i.ipcRenderer.invoke("use-default-64bit",e),use:async e=>await i.ipcRenderer.invoke("use-custom",e),browse:async e=>await i.ipcRenderer.invoke("browse-r-exe",e),cancel:()=>{i.ipcRenderer.send("cancel")}};function l(e,t){return(0,s.normalizeSeparatorsNative)(e)===(0,s.normalizeSeparatorsNative)(t)}i.contextBridge.exposeInMainWorld("callbacks",c)},298:e=>{e.exports=require("electron")},147:e=>{e.exports=require("fs")},17:e=>{e.exports=require("path")}},t={};!function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}(794)})();
//# sourceMappingURL=preload.js.map