Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64 User : User ( 0) PHP Version : 7.4.6 Disable Function : NONE Directory : C:/Program Files/Avast Software/Avast/gui_resources/1.0.663/ |
//{"name":"DoNotDisturb","version":"1.2.492","created":"2021-09-06T10:49:22.372Z"} import e from"./ractive.js";import{serviceRequest as t,napiTracker as s,eventer as n,burgerTracker as i,windowApi as o}from"./napi.js";import{logger as a}from"./libs.js";import l from"./ractiveComponents.js";import{nls as d}from"./i18n.js";import{napiUtils as r}from"./napiExtensions.js";const p=e.extend({template:{v:3,t:[{t:7,e:"Modal",a:{title:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.rename.title")'}}],subtitle:[{t:2,r:"appToRename.path"}]},f:[{t:7,e:"div",a:{class:"form__row"},v:{click:"clearInputErrors"},f:[{t:7,e:"Input",a:{id:"changeAppName",innerValue:[{t:2,r:"newAppName"}],label:[{t:3,x:{r:["nls"],s:'_0("global.appName")'}}],type:"text",error:[{t:2,r:"inputError"}]}}]}," ",{t:7,e:"div",a:{class:"modal__actions"},f:[{t:7,e:"kin-button",a:{"data-test":"dnd_confirmRenameApp"},v:{click:"rename"},f:[{t:3,x:{r:["nls"],s:'_0("global.rename")'}}]}]}]}]},data:()=>({appToRename:void 0,newAppName:"",inputError:!1}),oninit(){this.log=a.createLogger("doNotDisturb.renameAppModal");const e=this.get("appToRename.name");this.set("newAppName",e),this.on("Modal.close",(()=>{this.fire("closeModal")})),this.on("rename",(()=>{const e=this.get("newAppName");if(!e)return void this.set("inputError",!0);const s=this.get("appToRename");if(e!==s.name){const n=s;n.name=e,t("app.gameMode.SetGame",n).then((()=>{this.fire("appRenamed"),this.fire("closeModal")}))}else this.fire("closeModal")})),this.on("clearInputErrors",(()=>{this.set("inputError",!1)}))}}),c=e.extend({template:{v:3,t:[{t:4,f:[{t:7,e:"Modal",a:{title:[{t:3,x:{r:["nls","appsToRemove.length"],s:'_0("doNotDisturb.removeApps.title",_1)'}}],subtitle:[{t:3,x:{r:["nls","appsToRemove.length"],s:'_0("doNotDisturb.removeApps.subtitle",_1)'}}]},f:[{t:7,e:"div",a:{class:"modal__actions"},f:[{t:7,e:"kin-button",a:{"data-test":"dnd_confirmRemoveApp"},v:{click:"remove"},f:[{t:3,x:{r:["nls"],s:'_0("global.remove")'}}]}," ",{t:7,e:"kin-button",a:{"data-test":"dnd_closeModal",type:"secondary",class:"g-margin-left--10"},v:{click:"Modal.close"},f:[{t:3,x:{r:["nls"],s:'_0("global.cancel")'}}]}]}]}],n:50,x:{r:["appsToRemove.length"],s:"_0>1"}},{t:4,n:51,f:[{t:7,e:"Modal",a:{title:[{t:3,x:{r:["nls","appsToRemove.0.name"],s:'_0("doNotDisturb.removeApp.title",_1)'}}],subtitle:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.remove.title")'}}]},f:[{t:7,e:"div",a:{class:"modal__actions"},f:[{t:7,e:"kin-button",a:{"data-test":"dnd_confirmRemoveApp"},v:{click:"remove"},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.remove.confirm")'}}]}," ",{t:7,e:"kin-button",a:{"data-test":"dnd_closeModal",type:"secondary",class:"g-margin-left--10"},v:{click:"Modal.close"},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.remove.cancel")'}}]}]}]}],x:{r:["appsToRemove.length"],s:"_0>1"}}]},data:()=>({appsToRemove:[]}),oninit(){this.log=a.createLogger("doNotDisturb.removeAppsModal"),this.on("remove",(()=>{const e=this.get("appsToRemove").map((e=>t("app.gameMode.RemoveGame",e.path)));Promise.all(e).then((()=>{this.fire("appsRemoved"),this.fire("closeModal"),this.log.info("apps successfully removed")})).catch((e=>{this.log.error("error while executing app.gameMode.RemoveGame",JSON.stringify(e))}))})),this.on("Modal.close",(()=>{this.fire("closeModal")}))}}),h=1,m=e.extend({twoway:!1,template:{v:3,t:[{t:7,e:"kin-table",a:{datalength:[{t:2,r:"addedApps.length"}],selecteditems:[{t:2,r:"selectedAppsPaths.length"}]},f:[{t:7,e:"div",a:{slot:"table-header",role:"row",class:"dnd_table__header"},f:[{t:7,e:"input",v:{click:"selectAllApps"},a:{type:"checkbox",class:["checkbox ",{t:4,f:["-checked"],n:50,x:{r:["addedApps.length","selectedAppsPaths.length"],s:"_0===_1&&_1>0"}}],disabled:[{t:2,x:{r:["addedApps.length"],s:"_0===0"}}],checked:[{t:4,f:["true"],n:50,x:{r:["selectedAppsPaths.length"],s:"_0>0"}},{t:4,n:51,f:["false"],x:{r:["selectedAppsPaths.length"],s:"_0>0"}}],title:[{t:2,x:{r:["nls"],s:'_0("global.selectAllItems")'}}]},m:[{t:4,f:['aria-checked="mixed"'],n:50,x:{r:["addedApps.length","selectedAppsPaths.length"],s:"_0!==_1&&_1>0"}}]}," ",{t:7,e:"div"}," ",{t:7,e:"div",a:{role:"columnheader"},f:[{t:3,x:{r:["nls"],s:'_0("global.appName")'}}]}," ",{t:7,e:"div",a:{role:"columnheader"},f:[{t:3,x:{r:["nls"],s:'_0("global.location")'}}]}," ",{t:7,e:"div"}," ",{t:7,e:"div"}]}," ",{t:7,e:"div",a:{slot:"table-body"},f:[{t:4,f:[{t:7,e:"div",a:{role:"row",class:["kin_table__row -hoverable ",{t:2,x:{r:["selectedAppsPaths","./path"],s:'_0.includes(_1)?"-selected":""'}}," ",{t:2,x:{r:["runningAppPath","./path"],s:'_0&&_0===_1?"dnd_running__app":""'}}," ",{t:2,x:{r:["runningAppPath","./path"],s:'_0&&_0!==_1?"-inactive":""'}}],"data-test":["table-row-",{t:2,r:"@index"}],"aria-rowindex":[{t:2,r:"@index"}]},f:[{t:7,e:"input",v:{click:{n:"selectApp",d:[{t:2,r:"."}]}},a:{type:"checkbox",class:"checkbox",checked:[{t:2,x:{r:["selectedAppsPaths","./path"],s:"_0.includes(_1)?true:false"}}],id:["dnd-item-",{t:2,r:"@index"}],title:[{t:2,x:{r:["nls"],s:'_0("global.selectItem")'}}," - ",{t:2,r:"./name"}]}}," ",{t:7,e:"div",a:{class:"kin_table__icon"},f:[{t:7,e:"ImgIcon",a:{src:["data:image/png;base64,",{t:2,r:"icon"}]}}," ",{t:4,f:[{t:7,e:"Icon",a:{cssCls:"color-ok -text dnd_playing",name:"run-small"}}],n:50,x:{r:["runningAppPath","./path"],s:"_0===_1"}}]}," ",{t:7,e:"div",a:{class:"kin_table__name"},f:[{t:7,e:"label",a:{for:["dns-item-",{t:2,r:"@index"}]},f:[{t:2,r:"./name"}]}]}," ",{t:7,e:"div",a:{dir:"ltr"},f:[{t:7,e:"kin-tooltip",a:{ellipsis:"true"},f:[{t:7,e:"div",a:{slot:"tooltip-activator","data-test":"dnd_list__item-path"},f:[{t:2,r:"./path"}]}," ",{t:7,e:"div",a:{slot:"tooltip"},f:[{t:2,r:"./path"}]}]}]}," ",{t:4,f:[{t:7,e:"div",a:{class:"kin_table__end"},f:[{t:7,e:"label",a:{for:["dnd_list__item-switch_",{t:2,r:"@index"}],class:[{t:2,x:{r:["./enabled"],s:'_0?"color-ok":"color-critical"'}}," -text span -small g-margin-right--10"]},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.switch")'}}]}," ",{t:7,e:"kin-switch",a:{"data-test":["dnd_list__item-switch_",{t:2,r:"@index"}],id:["dnd_list__item-switch_",{t:2,r:"@index"}],"kin-checked":[{t:2,r:"./enabled"}],size:"small",title:[{t:2,r:"./name"}," - ",{t:2,x:{r:["./enabled","nls"],s:'_0?_1("global.turnOff"):_1("global.turnOn")'}}," ",{t:2,x:{r:["nls"],s:'_0("doNotDisturb.name")'}}],class:"g-margin-right--5"},v:{click:{n:"toggleAppMode",d:[{t:2,r:"."}]}}}]}," ",{t:7,e:"div",a:{class:"kin_table__actions"},f:[{t:7,e:"kin-dropdown",f:[{t:7,e:"div",a:{slot:"dropdown-activator"},f:[{t:7,e:"kin-button",a:{icononly:0,type:"blank",size:"tiny",class:["moreOptions-tooltip-",{t:2,r:"@index"}],title:[{t:2,x:{r:["nls"],s:'_0("global.moreOptions")'}}],"data-test":"kin_table-item-options"},f:[{t:7,e:"kin-icon",a:{name:"icon-s-controls-menu-more",size:"14"}}]}]}," ",{t:7,e:"kin-dropdown-item",a:{"data-test":["dnd_list__item-launch_",{t:2,r:"@index"}]},v:{click:{n:"runApp",d:[{t:2,r:"."}]}},f:[{t:3,x:{r:["nls"],s:'_0("global.launch")'}}]}," ",{t:7,e:"kin-dropdown-item",a:{"data-test":["dnd_list__item-rename_",{t:2,r:"@index"}]},v:{click:{n:"renameApp",d:[{t:2,r:"."}]}},f:[{t:3,x:{r:["nls"],s:'_0("global.rename")'}}]}," ",{t:7,e:"kin-dropdown-item",a:{"data-test":["dnd_list__item-remove_",{t:2,r:"@index"}]},v:{click:{n:"removeApp",d:[{t:2,r:"."}]}},f:[{t:3,x:{r:["nls"],s:'_0("global.remove")'}}]}," ",{t:7,e:"kin-dropdown-item",a:{type:"custom"},f:[{t:7,e:"label",a:{class:"dnd_table__tooltip g-nowrap"},f:[{t:7,e:"input",a:{type:"checkbox",class:"checkbox","data-test":["dnd_list__item-checkbox-maximizePerformance_",{t:2,r:"@index"}],checked:[{t:2,x:{r:["./category"],s:"_0===1"}}]},v:{click:{n:"maximizeAppPerformance",d:[{t:2,r:"."}]}}}," ",{t:7,e:"span",a:{class:"g-nowrap"},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.menu.maxPerformance.label")'}}]}]}," ",{t:7,e:"p",a:{class:"p -small dnd_table__tooltip g-margin-top--5"},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.menu.maxPerformance.tooltip")'}}]}]}]}]}],n:50,x:{r:["runningAppPath","./path"],s:"_0!==_1"}},{t:4,n:51,f:[{t:7,e:"div",f:[{t:7,e:"div",a:{class:"dnd_table__running"},f:[{t:7,e:"div",f:[{t:7,e:"p",a:{class:"p"},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.running.title")'}}]}," ",{t:7,e:"p",a:{class:"-small p -secondary"},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.running.subtitle")'}}]}]}]}]}," ",{t:7,e:"div",f:[{t:7,e:"Icon",a:{cssCls:"g-font--24",name:"dnd-mode"}}]}],x:{r:["runningAppPath","./path"],s:"_0!==_1"}}]}],n:52,r:"addedApps"}]}," ",{t:7,e:"div",a:{slot:"table-empty-icon",class:"svg -empty-table"}}," ",{t:7,e:"div",a:{slot:"table-empty"},f:[{t:7,e:"p",f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.empty.desc.1")'}}]}," ",{t:7,e:"p",f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.empty.desc.2")'}}]}]}]}," ",{t:4,f:[{t:7,e:"RenameAppModal",a:{appToRename:[{t:2,r:"appToRename"}]}}],n:50,x:{r:["modalDialog"],s:'_0==="renameApp"'}},{t:4,f:[{t:7,e:"RemoveAppsModal",a:{appsToRemove:[{t:2,r:"appsToRemove"}]}}],n:50,x:{r:["modalDialog"],s:'_0==="removeApps"'}}]},components:{RenameAppModal:p,RemoveAppsModal:c},data:()=>({addedApps:[],selectedAppsPaths:[],modalDialog:void 0,appToRename:void 0,appsToRemove:[],runningAppPath:void 0}),oninit(){this._deselectAll=function(){this.get("selectedAppsPaths").length>0&&this._selectAllApps(!1)},this._deselectAllBind=this._deselectAll.bind(this),window.addEventListener("kin-deselectAll",this._deselectAllBind),this.listeners=[],this.log=a.createLogger("doNotDisturb.games"),this.initAddedApps(),this._addListeners(),this.on("selectAllApps",(e=>{this._selectAllApps(e.node.checked)})),this.on("toggleAppMode",((e,s)=>{const n={name:s.name,path:s.path,icon:s.icon,enabled:!s.enabled};t("app.gameMode.SetGame",n).then((()=>{this.initAddedApps()})).catch((()=>{this.initAddedApps()}))})),this.on("maximizeAppPerformance",((e,n)=>{n.category=1===n.category?2:1,s.event("DoNotDisturb",1===n.category?"Maximize perf checked":"Maximize perf unchecked",n.name),t("app.gameMode.SetGame",n).then((()=>{this.initAddedApps()})).catch((e=>{this.log.error("error while executing app.gameMode.SetGame",JSON.stringify(e))}))})),this.on("runApp",((e,n)=>{this.log.info("run app requested"),s.event("DoNotDisturb","Launch",n.name),t("app.gameMode.RunGame",n.path).then((()=>{this.log.info("game successfully run")})).catch((e=>{this.log.error("error while executing app.gameMode.RunGame",JSON.stringify(e))}))})),this.on("removeApp",((e,t)=>{this.log.info("remove app requested"),s.event("DoNotDisturb","Remove",t.name),this.set("appsToRemove",[t]),this.set("modalDialog","removeApps")})),this.on("removeApps",(()=>{this.log.info("remove multiple apps requested");const e=this.get("selectedAppsPaths"),t=this.get("addedApps").filter((t=>e.includes(t.path)));this.set("appsToRemove",t),this.set("modalDialog","removeApps")})),this.on("renameApp",((e,t)=>{this.log.info("remame app requested"),s.event("DoNotDisturb","Rename",t.name),this.set("appToRename",t),this.set("modalDialog","renameApp")})),this.on("selectApp",((e,t)=>{const s=this.get("selectedAppsPaths");e.node.checked?s.includes(t.path)||s.push(t.path):s.splice(s.indexOf(t.path),1),this.set("selectedAppsPaths",s),this.fire("selectedAppsPathsUpdate",s)})),this.on("RenameAppModal.appRenamed",(()=>{this.set("appToRename",void 0),this.initAddedApps()})),this.on("RemoveAppModal.appRemoved",(()=>{this._appRemovedCheckSelected(this.get("appToRemove")),this.set("appToRemove",void 0),this.initAddedApps()})),this.on("RemoveAppsModal.appsRemoved",(()=>{this._appsRemovedCheckSelected(),this.initAddedApps()})),this.on("*.closeModal",(()=>{this.set("modalDialog",void 0)}))},_appRemovedCheckSelected(e){const t=this.get("selectedAppsPaths");t.includes(e.path)&&(t.splice(t.indexOf(e.path),1),this.set("selectedAppsPaths",t),this.fire("selectedAppsPathsUpdate",t))},_appsRemovedCheckSelected(){this.set("selectedAppsPaths",[]),this.fire("selectedAppsPathsUpdate",[])},_selectAllApps(e){const t=this.get("addedApps");if(this.set("selectedAppsPaths",[]),e){const e=t.map((e=>e.path));this.set("selectedAppsPaths",e),this.fire("selectedAppsPathsUpdate",e)}else this.fire("selectedAppsPathsUpdate",[])},addNewApp(){this.set("modalDialog","selectNewApp")},initAddedApps(){this.log.info("polling addedApps"),t("app.gameMode.GetApps",{sort_by:h}).then((e=>{this.log.info("addedApps polled"),this.log.debug("addedApps: "+JSON.stringify(e)),this.merge("addedApps",e,{compare:"path"}),this.fire("loading",!1),this.fire("addedAppsUpdate",e)})).catch((e=>{this.log.error("error while executing app.gameMode.GetApps",e)}))},_setRunningApp(e){e&&e.path?(this.set("runningAppPath",e.path),setTimeout((()=>{const e=document.getElementsByClassName("dnd_running__app")[0],t=document.getElementById("dnd-scroll-cont");e&&t&&(t.scrollTop=e.offsetTop)}))):this.set("runningAppPath",void 0),this.update("addedApps")},_addListeners(){this.listeners.push(n.on("gameMode.onStatusChanged.GameModeStarted",(e=>{this._setRunningApp(e?e.game:void 0)}))),this.listeners.push(n.on("gameMode.onStatusChanged.GameModeStopped",(()=>{this._setRunningApp(void 0)}))),this.listeners.push(n.on("gameMode.onStatusChanged.GameDetected",(()=>{this.log.info("game change detected"),this.initAddedApps()}))),this.listeners.push(n.on("app.gameMode.GameRemoved",(()=>{this.log.info("game change removed"),this.initAddedApps()}))),this.listeners.push(n.on("gameMode.onStatusChanged.GameRemoved",(()=>{this.log.info("game change removed"),this.initAddedApps()})))},onteardown(){this.listeners.forEach((e=>{e()})),window.removeEventListener("kin-deselectAll",this._deselectAllBind),this._deselectAllBind=void 0}});const u=e.extend({template:{v:3,t:[{t:7,e:"Page",a:{heading:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.name")'}}],cssCls:"dnd",settingsUrl:"#Settings/DoNotDisturb",backHash:"#performance"},f:[{t:7,e:"div",a:{slot:"breadcrumbs"},f:[{t:7,e:"Crumbs",a:{section:"performance",customBreadcrumbs:0,moduleId:"gaming",moduleTranslationId:"doNotDisturb.name"}}]}," ",{t:7,e:"div",a:{slot:"page-content",class:"dnd"},f:[{t:7,e:"View",a:{loading:[{t:2,r:"loading"}]},f:[{t:7,e:"div",a:{slot:"description"},f:[{t:7,e:"p",a:{class:"kin_description__text"},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.desc")'}}]}]}," ",{t:7,e:"div",a:{slot:"cta"},f:[{t:7,e:"kin-button",a:{"data-test":"dnd_addNewApp"},v:{click:"addNewApp"},f:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.addApp.btn")'}}]}]}," ",{t:7,e:"div",a:{slot:"view-content"},f:[{t:7,e:"AddedAppsList"}]}," ",{t:7,e:"div",a:{slot:"view-actions"},f:[{t:7,e:"div",a:{class:"kin_actions__left"},f:[{t:3,x:{r:["nls","selectedAppsPaths.length"],s:'_0("doNotDisturb.applicationsSelected",_1)'}}]}," ",{t:7,e:"div",f:[{t:7,e:"kin-button",a:{size:"small","data-test":"dnd_table_mainCTA"},v:{click:"removeApps"},f:[{t:2,x:{r:["nls","addedApps.length","selectedAppsPaths.length"],s:'_0(_1===_2?"global.removeAll":"global.removeSelected")'}}]}]}," ",{t:7,e:"div",a:{class:"kin_actions__right"},f:[{t:3,x:{r:["nls"],s:'_0("global.escToDeselect")'}}]}]}]}]}]}," ",{t:4,f:[{t:7,e:"SelectNewAppModal",a:{title:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.selectApp.title")'}}],desc:[{t:3,x:{r:["nls"],s:'_0("doNotDisturb.selectApp.subtitle")'}}],addedAppPaths:[{t:2,r:"addedAppPaths"}]}}],n:50,x:{r:["modalDialog"],s:'_0==="selectNewApp"'}}]},css:"[slot='table-header'],\n.kin_table__row {\n grid-template-columns: 3.5rem 5% 22% auto 30% 5%;\n}\n[slot='table-header'] > div:first-of-type,\n.kin_table__row > div:first-of-type {\n position: relative;\n}\n.dnd_table__tooltip {\n cursor: pointer;\n padding-left: 2.4rem;\n position: relative;\n min-width: 20rem;\n display: block;\n}\n.dnd_table__tooltip input {\n transform: none !important;\n opacity: 1 !important;\n position: absolute !important;\n margin: 1px -2.5rem 0;\n}\n.dnd .dnd_table__icon {\n font-size: 24px;\n}\n.dnd .-inactive {\n pointer-events: none;\n}\n.dnd .dnd_hidden {\n display: none;\n}\n.dnd .dnd_table__running {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n}\n.dnd .dnd_playing {\n position: absolute;\n font-size: 14px;\n bottom: 0.5rem;\n border-radius: 20px;\n background-color: #fff;\n width: 2rem;\n height: 2rem;\n line-height: 2rem;\n text-align: center;\n margin: 0 1.5rem;\n}\n[dir=rtl] .dnd_table__tooltip {\n padding-left: 0;\n padding-right: 2.4rem;\n}\n",components:{AddedAppsList:m,SelectNewAppModal:l.InstalledApps,View:l.View},data:()=>({addedApps:[],selectedAppsPaths:[],modalDialog:void 0,loading:!0}),computed:{addedAppPaths:{get:function(){return this.get("addedApps").map((e=>e.path))},set:function(){}}},oninit(){this.listeners=[],this.addedAppsList=this.findComponent("AddedAppsList"),this.on("AddedAppsList.addedAppsUpdate",(e=>{this.set("addedApps",e)})),this.on("AddedAppsList.selectedAppsPathsUpdate",(e=>{this.set("selectedAppsPaths",e)})),this.on("AddedAppsList.loading",(e=>{this.set("loading",e)})),this.on("addNewApp",(()=>{this.set("modalDialog","selectNewApp"),s.event("DoNotDisturb","Add App modal open")})),this.on("SelectNewAppModal.appSelected",this.addApp.bind(this)),this.on("SelectNewAppModal.selectAppPath",(()=>{s.event("DoNotDisturb","Select path"),this.set("modalDialog",void 0)})),this.on("SelectNewAppModal.close",(()=>{this.set("modalDialog",void 0)})),this.on("removeApps",(()=>{const e=this.findComponent("AddedAppsList");e&&e.fire("removeApps")}))},addApp(e){s.event("DoNotDisturb","Add app",e.name),t("app.gameMode.SetGame",{name:e.name,path:e.path,icon:e.icon,enabled:!0,category:2,appType:e.appType,appUserModelId:e.appUserModelId}).then((()=>{this.addedAppsList.initAddedApps()}))},onteardown(){this.listeners.forEach((e=>e()))}}),g=a.createLogger("gaming.whitelist"),f={whitelistTitle:"doNotDisturb.settings.whitelist.title",whitelistDesc:"doNotDisturb.settings.whitelist.desc",whitelistAddApp:"doNotDisturb.settings.whitelist.addApp",whitelistConfirmRemove:"doNotDisturb.settings.whitelist.confirmRemove",whitelistCancelRemove:"doNotDisturb.settings.whitelist.cancelRemove",whitelistNoApps:"doNotDisturb.settings.whitelist.noApps",whitelistClose:"global.close",appListTitle:"doNotDisturb.settings.whitelist.appList.title"},b=e.extend({template:{v:3,t:[{t:7,e:"Modal",a:{title:[{t:3,x:{r:["nls","STRINGS.whitelistTitle"],s:"_0(_1)"}}],subtitle:[{t:3,x:{r:["nls","STRINGS.whitelistDesc"],s:"_0(_1)"}}],scrollable:0},f:[{t:7,e:"div",a:{class:"modal"},f:[{t:4,f:[{t:7,e:"kin-loading"}],n:50,x:{r:["ignoredApps"],s:"_0==null"}},{t:4,n:51,f:[{t:4,f:[{t:7,e:"table",a:{class:"table -small -compact"},f:[{t:4,f:[{t:7,e:"tr",a:{class:["-hoverable ",{t:4,f:["-expanded -selected"],n:50,x:{r:["showRemoveConfirmationIndex","index"],s:"_0===_1"}}]},f:[{t:7,e:"td",f:[{t:2,r:"name"}]}," ",{t:7,e:"td",f:[{t:2,r:"filePath"}]}," ",{t:7,e:"td",a:{class:"table__delete"},f:[{t:7,e:"kin-button",a:{size:"tiny",type:"blank",icononly:0,title:[{t:3,x:{r:["nls"],s:'_0("global.remove")'}}]},v:{click:"remove"},f:[{t:7,e:"kin-icon",a:{name:"icon-s-controls-bin",size:"14"}}]}]}]}," ",{t:4,f:[{t:7,e:"tr",f:[{t:7,e:"td",a:{colspan:"3",class:"table__last"},f:[{t:7,e:"kin-button",a:{size:"small",type:"critical",class:"g-margin-right--5"},v:{click:"confirmRemove"},f:[{t:3,x:{r:["nls","STRINGS.whitelistConfirmRemove"],s:"_0(_1)"}}]}," ",{t:7,e:"kin-button",a:{size:"small",type:"secondary"},v:{click:"cancelRemove"},f:[{t:3,x:{r:["nls","STRINGS.whitelistCancelRemove"],s:"_0(_1)"}}]}]}]}],n:50,x:{r:["showRemoveConfirmationIndex","index"],s:"_0===_1"}}],i:"index",r:"ignoredApps"}]}],n:50,r:"ignoredApps.length"},{t:4,n:51,f:[{t:3,x:{r:["nls","STRINGS.whitelistNoApps"],s:"_0(_1)"}}],r:"ignoredApps.length"}],x:{r:["ignoredApps"],s:"_0==null"}}]}," ",{t:7,e:"div",a:{class:"modal__footer"},f:[{t:7,e:"kin-button",v:{click:"showAppList"},f:[{t:3,x:{r:["nls","STRINGS.whitelistAddApp"],s:"_0(_1)"}}]}," ",{t:7,e:"kin-button",a:{type:"secondary",class:"g-margin-left--10"},v:{click:"close"},f:[{t:3,x:{r:["nls","STRINGS.whitelistClose"],s:"_0(_1)"}}]}]}]}," ",{t:4,f:[{t:7,e:"InstalledApps",a:{title:[{t:3,x:{r:["nls","STRINGS.appListTitle"],s:"_0(_1)"}}],desc:[{t:3,x:{r:["nls","STRINGS.whitelistDesc"],s:"_0(_1)"}}],addedAppPaths:[{t:2,r:"ignoredAppPaths"}]}}],n:50,r:"showAppList"}]},components:{InstalledApps:l.InstalledApps},data:function(){return{STRINGS:f,ignoredApps:null,ignoredAppPaths:[],showRemoveConfirmationIndex:null,showAppList:!1}},oninit(){g.debug("oninit"),this.on("Modal.modalClose",(()=>{this.fire("close")})),this.on("InstalledApps.close",(()=>{n.emit("Settings.gaTrack","Whitelist","Close app list"),this.set("showAppList",!1)})),this.on("showAppList",(()=>{n.emit("Settings.gaTrack","Whitelist","Open app list"),this.set("showAppList",!0)})),this.on("InstalledApps.appSelected",(e=>{n.emit("Settings.gaTrack","Whitelist","Add app",e.name),this.setApp({name:e.name,filePath:e.path,ignore:!0})})),this.on("remove",(e=>{this.set("showRemoveConfirmationIndex",e.index.index)})),this.on("cancelRemove",(()=>{this.set("showRemoveConfirmationIndex",null)})),this.on("confirmRemove",(e=>{const t=this.get(e.keypath);n.emit("Settings.gaTrack","Whitelist","Remove app",t.name),t.ignore=!1,this.get("ignoredApps").splice(e.index.index,1),this.set("showRemoveConfirmationIndex",null),this.setApp(t)})),this.loadIgnoredApps()},loadIgnoredApps(){return t("app.gameMode.GetDdowIgnoreList").then((e=>{const t=e.filter((e=>e.ignore));this.set("ignoredApps",t),this.set("ignoredAppPaths",t.map((e=>e.filePath)))})).catch((e=>{g.error("loading ignored apps failed",e)}))},setApp(e){t("app.gameMode.SetDdowIgnoredApp",e).then(this.loadIgnoredApps.bind(this)).catch((t=>{g.error("setting app failed",e,t)}))}}),_="TOASTER_ID_GM_GAME_ADDED",A=a.createLogger("gaming.settings"),v={title:"doNotDisturb.name",desc:"doNotDisturb.settings.desc",disableDrawOverWindow:"doNotDisturb.settings.disableDrawOverWindow",disableDrawOverWindowDesc:"doNotDisturb.settings.disableDrawOverWindow.desc",pauseAllAvInterruptions:"doNotDisturb.settings.pauseAllAvInterruptions",pauseAllAvInterruptionsDesc:"doNotDisturb.settings.pauseAllAvInterruptions.desc",pauseAllWindowsUpdates:"doNotDisturb.settings.pauseAllWindowsUpdates",pauseAllWindowsUpdatesDesc:"doNotDisturb.settings.pauseAllWindowsUpdates.desc",enableAutoDetections:"doNotDisturb.settings.enableAutoDetections",enableAutoDetectionsDesc:"doNotDisturb.settings.enableAutoDetections.desc",whitelistLinkLabel:"doNotDisturb.settings.whitelist.linkLabel",dontShowDnDToaster:"doNotDisturb.settings.dontShowToaster.title",dontShowDnDToasterDesc:"doNotDisturb.settings.dontShowToaster.desc"},w={disableDrawOverWindow:{path:"avcfg://settings/GamingMode/GameRule_BlockDistractions_Enabled",label:d(v.disableDrawOverWindow),desc:d(v.disableDrawOverWindowDesc),track:{subject:"Silence notifications from 3rd-party apps"},search:{title:v.disableDrawOverWindow,desc:v.disableDrawOverWindowDesc}},whitelistLink:{id:"dnd_settings_whitelistLink",label:d(v.whitelistLinkLabel),search:v.whitelistLinkLabel},pauseAllAvInterruptions:{path:"avcfg://settings/GamingMode/GameRule_NoAvastInterruptions_Enabled",label:d(v.pauseAllAvInterruptions),desc:d(v.pauseAllAvInterruptionsDesc),track:{subject:"Silence Avast notifications"},search:{title:v.pauseAllAvInterruptions,desc:v.pauseAllAvInterruptionsDesc}},pauseAllWindowsUpdates:{path:"avcfg://settings/GamingMode/GameRule_PauseAllUpdateTasks_Enabled",label:d(v.pauseAllWindowsUpdates),desc:d(v.pauseAllWindowsUpdatesDesc),track:{subject:"Pause Windows updates"},search:{title:v.pauseAllWindowsUpdates,desc:v.pauseAllWindowsUpdatesDesc}},enableAutoDetections:{path:"avcfg://settings/GamingMode/GameRule_AutoDetectNewApps_Enabled",label:d(v.enableAutoDetections),desc:d(v.enableAutoDetectionsDesc),track:{subject:"Automatically add new apps"},search:{title:v.enableAutoDetections,desc:v.enableAutoDetectionsDesc}}};r.supportedSince("21.5")&&(w.dontShowDnDToaster={id:"dnd-settings-dontShowToaster",label:d(v.dontShowDnDToaster),desc:d(v.dontShowDnDToasterDesc),track:{subject:"Don't Do Not Disturb notifications Toaster"},search:{title:v.dontShowDnDToaster,desc:v.dontShowDnDToasterDesc},load:()=>t("app.windowManager.GetToasterVisibility",{id:_}).then((e=>({value:!e}))),change:e=>t("app.windowManager.SetToasterVisibility",{id:_,visible:!e})});const x={title:v.title,desc:v.desc,items:w},k=e.extend({template:{v:3,t:[{t:7,e:"SettingsContainer",a:{component:[{t:2,r:"component"}],title:[{t:3,x:{r:["nls","STRINGS.title"],s:"_0(_1)"}}],desc:[{t:3,x:{r:["nls","STRINGS.desc"],s:"_0(_1)"}}],noEnable:"true"},f:[{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.disableDrawOverWindow"}]},f:[{t:7,e:"button",a:{class:"settings__indent a -small",id:[{t:2,r:"properties.whitelistLink.id"}],"data-test":"openWhitelist"},v:{click:"openWhitelist"},f:[{t:3,r:"properties.whitelistLink.label"}]}]}," ",{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.pauseAllAvInterruptions"}]}}," ",{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.pauseAllWindowsUpdates"}]}}," ",{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.enableAutoDetections"}]}}," ",{t:4,f:[{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.dontShowDnDToaster"}]}}],n:50,r:"properties.dontShowDnDToaster"}]}," ",{t:4,f:[{t:7,e:"Whitelist"}],n:50,r:"showWhitelist"}]},components:{Whitelist:b},data:()=>({STRINGS:v,component:"GamingMode",showWhitelist:!1,properties:w}),oninit(){A.debug("oninit"),this.on("openWhitelist",(()=>{n.emit("Settings.gaTrack","Whitelist","Open"),A.info("opening Notification Whitelist"),this.set("showWhitelist",!0)})),this.on("Whitelist.close",(()=>{n.emit("Settings.gaTrack","Whitelist","Close"),this.set("showWhitelist",!1)}))}}),D=[{path:"avcfg://settings/GamingMode/GameRule_MaximumPerformance_Enabled",label:"Maximum performance",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_DisableAvNotifications_Enabled",label:"Disable AV notifications",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_DisableDrawOverWindow_Enabled",label:"Disable draw over window",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_PauseWindowsUpdate_Enabled",label:"Pause Windows updates",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_PauseAvBackgroundTasks_Enabled",label:"Pause AV background tasks",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_PauseSystemBackgroundTasks_Enabled",label:"Pause system background tasks",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_SetHighPerformanceMode_Enabled",label:"Set high performance mode",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_SetHighPriority_Enabled",label:"Set high priority",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_DisableWinUpdateAutoReboot_Enabled",label:"Disable Windows update auto reboot",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_DisableWindowsNotifications_Enabled",label:"Disable Windows notifications",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_EnableAutoDetections_Enabled",label:"Enable auto detections",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_SetProcessAffinity_Enabled",label:"Set process affinity",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_MeasurePerformance_Enabled",label:"Measure performance",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_SuspendNongamingUserProcesses_Enabled",label:"Suspend Non-gaming user processes",type:"checkbox"},{path:"avcfg://settings/GamingMode/GameRule_SetCpuLimit_Enabled",label:"Set CPU limit",type:"checkbox"}];function y(){}function N(e){return e()}function S(){return Object.create(null)}function R(e){e.forEach(N)}function T(e){return"function"==typeof e}function M(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function G(e,t,s,n){return e[1]&&n?function(e,t){for(const s in t)e[s]=t[s];return e}(s.ctx.slice(),e[1](n(t))):s.ctx}function $(e,t,s,n,i,o,a){const l=function(e,t,s,n){if(e[2]&&n){const i=e[2](n(s));if(void 0===t.dirty)return i;if("object"==typeof i){const e=[],s=Math.max(t.dirty.length,i.length);for(let n=0;n<s;n+=1)e[n]=t.dirty[n]|i[n];return e}return t.dirty|i}return t.dirty}(t,n,i,o);if(l){const i=G(t,s,n,a);e.p(i,l)}}function P(e){return e&&T(e.destroy)?e.destroy:y}function I(e,t){e.appendChild(t)}function E(e,t,s){e.insertBefore(t,s||null)}function L(e){e.parentNode.removeChild(e)}function C(e){return document.createElement(e)}function W(e){return document.createTextNode(e)}function O(){return W(" ")}function U(e,t,s,n){return e.addEventListener(t,s,n),()=>e.removeEventListener(t,s,n)}function z(e,t,s){null==s?e.removeAttribute(t):e.getAttribute(t)!==s&&e.setAttribute(t,s)}function j(e,t,s){t in e?e[t]=s:z(e,t,s)}function H(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function B(e,t,s,n){e.style.setProperty(t,s,n?"important":"")}class V{constructor(e=null){this.a=e,this.e=this.n=null}m(e,t,s=null){this.e||(this.e=C(t.nodeName),this.t=t,this.h(e)),this.i(s)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)E(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(L)}}let q;function J(e){q=e}function F(){if(!q)throw new Error("Function called outside component initialization");return q}function Z(){const e=F();return(t,s)=>{const n=e.$$.callbacks[t];if(n){const i=function(e,t){const s=document.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}(t,s);n.slice().forEach((t=>{t.call(e,i)}))}}}const K=[],Q=[],X=[],Y=[],ee=Promise.resolve();let te=!1;function se(e){X.push(e)}let ne=!1;const ie=new Set;function oe(){if(!ne){ne=!0;do{for(let e=0;e<K.length;e+=1){const t=K[e];J(t),ae(t.$$)}for(J(null),K.length=0;Q.length;)Q.pop()();for(let e=0;e<X.length;e+=1){const t=X[e];ie.has(t)||(ie.add(t),t())}X.length=0}while(K.length);for(;Y.length;)Y.pop()();te=!1,ne=!1,ie.clear()}}function ae(e){if(null!==e.fragment){e.update(),R(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(se)}}const le=new Set;function de(e,t){e&&e.i&&(le.delete(e),e.i(t))}function re(e,t,s,n){if(e&&e.o){if(le.has(e))return;le.add(e),undefined.c.push((()=>{le.delete(e),n&&(s&&e.d(1),n())})),e.o(t)}}function pe(e,t,s,n){const{fragment:i,on_mount:o,on_destroy:a,after_update:l}=e.$$;i&&i.m(t,s),n||se((()=>{const t=o.map(N).filter(T);a?a.push(...t):R(t),e.$$.on_mount=[]})),l.forEach(se)}function ce(e,t){const s=e.$$;null!==s.fragment&&(R(s.on_destroy),s.fragment&&s.fragment.d(t),s.on_destroy=s.fragment=null,s.ctx=[])}function he(e,t){-1===e.$$.dirty[0]&&(K.push(e),te||(te=!0,ee.then(oe)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function me(e,t,s,n,i,o,a=[-1]){const l=q;J(e);const d=e.$$={fragment:null,ctx:null,props:o,update:y,not_equal:i,bound:S(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:[]),callbacks:S(),dirty:a,skip_bound:!1};let r=!1;if(d.ctx=s?s(e,t.props||{},((t,s,...n)=>{const o=n.length?n[0]:s;return d.ctx&&i(d.ctx[t],d.ctx[t]=o)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](o),r&&he(e,t)),s})):[],d.update(),r=!0,R(d.before_update),d.fragment=!!n&&n(d.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);d.fragment&&d.fragment.l(e),e.forEach(L)}else d.fragment&&d.fragment.c();t.intro&&de(e.$$.fragment),pe(e,t.target,t.anchor,t.customElement),oe()}J(l)}class ue{$destroy(){ce(this,1),this.$destroy=y}$on(e,t){const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(t),()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},fe="object"==typeof ge&&ge&&ge.Object===Object&&ge,be="object"==typeof self&&self&&self.Object===Object&&self;function _e(e){let t,s,n,i;return{c(){t=C("div"),s=C("kin-icon"),j(s,"name",e[4]),z(t,"class",n="sve_toaster__theme "+(e[3]?"color-"+e[3]:"color-dark -bg")),z(t,"style",i=e[5]?"font-size:"+e[5]:"")},m(e,n){E(e,t,n),I(t,s)},p(e,o){16&o&&j(s,"name",e[4]),8&o&&n!==(n="sve_toaster__theme "+(e[3]?"color-"+e[3]:"color-dark -bg"))&&z(t,"class",n),32&o&&i!==(i=e[5]?"font-size:"+e[5]:"")&&z(t,"style",i)},d(e){e&&L(t)}}}function Ae(e){let t,s;return{c(){t=C("kin-icon"),j(t,"name",e[4]),j(t,"class",s="g-margin-bottom--20 "+(e[3]?"color-"+e[3]+" -text":""))},m(e,s){E(e,t,s)},p(e,n){16&n&&j(t,"name",e[4]),8&n&&s!==(s="g-margin-bottom--20 "+(e[3]?"color-"+e[3]+" -text":""))&&j(t,"class",s)},d(e){e&&L(t)}}}function ve(e){let t,s;return{c(){t=C("h2"),s=W(e[6]),z(t,"class","sve_toaster__title h3")},m(e,n){E(e,t,n),I(t,s)},p(e,t){64&t&&H(s,e[6])},d(e){e&&L(t)}}}function we(e){let t,s;function n(e,t){return e[10]?ke:xe}let i=n(e),o=i(e),a=e[8]&&De(e);return{c(){t=C("p"),o.c(),s=O(),a&&a.c(),z(t,"class","sve_toaster__text p -small")},m(e,n){E(e,t,n),o.m(t,null),I(t,s),a&&a.m(t,null)},p(e,l){i===(i=n(e))&&o?o.p(e,l):(o.d(1),o=i(e),o&&(o.c(),o.m(t,s))),e[8]?a?a.p(e,l):(a=De(e),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},d(e){e&&L(t),o.d(),a&&a.d()}}}function xe(e){let t;return{c(){t=W(e[7])},m(e,s){E(e,t,s)},p(e,s){128&s&&H(t,e[7])},d(e){e&&L(t)}}}function ke(e){let t,s;return{c(){s=W(""),t=new V(s)},m(n,i){t.m(e[7],n,i),E(n,s,i)},p(e,s){128&s&&t.p(e[7])},d(e){e&&L(s),e&&t.d()}}}function De(e){let t,s,n,i,o;return{c(){t=W(" "),s=C("button"),n=W(e[8]),z(s,"class","a g-font--capital")},m(a,l){E(a,t,l),E(a,s,l),I(s,n),i||(o=U(s,"click",e[14]),i=!0)},p(e,t){256&t&&H(n,e[8])},d(e){e&&L(t),e&&L(s),i=!1,o()}}}function ye(e){let t;function s(e,t){return e[11]<0||100<e[11]?Se:Ne}let n=s(e),i=n(e);return{c(){t=C("div"),i.c(),z(t,"class","sve_toaster__progress")},m(e,s){E(e,t,s),i.m(t,null)},p(e,o){n===(n=s(e))&&i?i.p(e,o):(i.d(1),i=n(e),i&&(i.c(),i.m(t,null)))},d(e){e&&L(t),i.d()}}}function Ne(e){let t,s,n,i,o;return{c(){t=C("kin-progress"),s=O(),n=C("p"),i=W(e[11]),o=W("%"),j(t,"percentage",e[11]),j(t,"csscls","-standalone"),z(n,"class","p")},m(e,a){E(e,t,a),E(e,s,a),E(e,n,a),I(n,i),I(n,o)},p(e,s){2048&s&&j(t,"percentage",e[11]),2048&s&&H(i,e[11])},d(e){e&&L(t),e&&L(s),e&&L(n)}}}function Se(e){let t;return{c(){t=C("kin-progress"),j(t,"percentage",e[11]),j(t,"csscls","-standalone -unknown")},m(e,s){E(e,t,s)},p(e,s){2048&s&&j(t,"percentage",e[11])},d(e){e&&L(t)}}}function Re(e){let t,s,n,i;return{c(){t=C("kin-button"),s=W(e[9]),j(t,"class","sve_toaster__btn")},m(o,a){E(o,t,a),I(t,s),n||(i=U(t,"click",e[15]),n=!0)},p(e,t){512&t&&H(s,e[9])},d(e){e&&L(t),n=!1,i()}}}function Te(e){let t,s,n,i,o,a,l,r,p,c,h,m,u,g,f,b,_,A,v=e[1]&&_e(e),w=e[4]&&!e[1]&&Ae(e),x=e[6]&&ve(e),k=e[7]&&we(e),D=(e[11]||0===e[11])&&ye(e);const y=e[23].default,N=function(e,t,s,n){if(e){const i=G(e,t,s,n);return e[0](i)}}(y,e,e[22],null);let S=e[9]&&Re(e);return{c(){t=C("div"),s=C("div"),n=C("h1"),n.innerHTML='<span class="logo -white -width-70"></span>',i=O(),o=C("div"),a=C("button"),l=O(),r=C("div"),v&&v.c(),p=O(),w&&w.c(),c=O(),x&&x.c(),h=O(),k&&k.c(),m=O(),D&&D.c(),u=O(),N&&N.c(),g=O(),S&&S.c(),z(n,"class","nui_logo"),z(a,"class","nui_controls__item -close nui_caption_client"),z(a,"title",d("global.closeModalWindow")),z(o,"class","nui_controls"),z(s,"class","nui_titlebar -toaster nui_caption"),z(r,"class",f="nui_main -toaster\n\t\t"+(e[2]?"color-"+e[2]+" -bg":"")+"\n\t\t"+(e[1]?e[1]+"-toaster-icon":"")+"\n\t"),z(t,"class","sve_toaster"),B(t,"width",e[0]+"px")},m(d,f){E(d,t,f),I(t,s),I(s,n),I(s,i),I(s,o),I(o,a),I(t,l),I(t,r),v&&v.m(r,null),I(r,p),w&&w.m(r,null),I(r,c),x&&x.m(r,null),I(r,h),k&&k.m(r,null),I(r,m),D&&D.m(r,null),I(r,u),N&&N.m(r,null),I(r,g),S&&S.m(r,null),b=!0,_||(A=[U(a,"click",e[13]),P(e[16].call(null,s)),P(e[17].call(null,r)),U(t,"click",e[12])],_=!0)},p(e,[s]){e[1]?v?v.p(e,s):(v=_e(e),v.c(),v.m(r,p)):v&&(v.d(1),v=null),e[4]&&!e[1]?w?w.p(e,s):(w=Ae(e),w.c(),w.m(r,c)):w&&(w.d(1),w=null),e[6]?x?x.p(e,s):(x=ve(e),x.c(),x.m(r,h)):x&&(x.d(1),x=null),e[7]?k?k.p(e,s):(k=we(e),k.c(),k.m(r,m)):k&&(k.d(1),k=null),e[11]||0===e[11]?D?D.p(e,s):(D=ye(e),D.c(),D.m(r,u)):D&&(D.d(1),D=null),N&&N.p&&4194304&s&&$(N,y,e,e[22],s,null,null),e[9]?S?S.p(e,s):(S=Re(e),S.c(),S.m(r,null)):S&&(S.d(1),S=null),(!b||6&s&&f!==(f="nui_main -toaster\n\t\t"+(e[2]?"color-"+e[2]+" -bg":"")+"\n\t\t"+(e[1]?e[1]+"-toaster-icon":"")+"\n\t"))&&z(r,"class",f),(!b||1&s)&&B(t,"width",e[0]+"px")},i(e){b||(de(N,e),b=!0)},o(e){re(N,e),b=!1},d(e){e&&L(t),v&&v.d(),w&&w.d(),x&&x.d(),k&&k.d(),D&&D.d(),N&&N.d(e),S&&S.d(),_=!1,R(A)}}}function Me(e,t,n){let a,{$$slots:l={},$$scope:d}=t,{windowWidth:r=360}=t,{windowHeight:p=360}=t,{theme:c}=t,{skin:h}=t,{severity:m}=t,{icon:u}=t,{iconSize:g}=t,{title:f}=t,{text:b}=t,{progress:_}=t,{textActionLabel:A}=t,{buttonLabel:v}=t,{burgerToasterTracker:w}=t,{handleClose:x}=t,{allowHtml:k}=t;const D=Z();let y,N,S;var R;function T(){n(18,p=N.scrollHeight+y.scrollHeight),o.resize(r,p)}return R=()=>{T(),S=new MutationObserver(T.bind(this)),S.observe(N,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),w?.toasterView&&i.toaster.view()},F().$$.after_update.push(R),function(e){F().$$.on_destroy.push(e)}((()=>{S&&S.disconnect()})),e.$$set=e=>{"windowWidth"in e&&n(0,r=e.windowWidth),"windowHeight"in e&&n(18,p=e.windowHeight),"theme"in e&&n(1,c=e.theme),"skin"in e&&n(2,h=e.skin),"severity"in e&&n(3,m=e.severity),"icon"in e&&n(4,u=e.icon),"iconSize"in e&&n(5,g=e.iconSize),"title"in e&&n(6,f=e.title),"text"in e&&n(7,b=e.text),"progress"in e&&n(19,_=e.progress),"textActionLabel"in e&&n(8,A=e.textActionLabel),"buttonLabel"in e&&n(9,v=e.buttonLabel),"burgerToasterTracker"in e&&n(20,w=e.burgerToasterTracker),"handleClose"in e&&n(21,x=e.handleClose),"allowHtml"in e&&n(10,k=e.allowHtml),"$$scope"in e&&n(22,d=e.$$scope)},e.$$.update=()=>{524288&e.$$.dirty&&n(11,a=Number.isNaN(parseInt(_))?_:parseInt(_))},[r,c,h,m,u,g,f,b,A,v,k,a,function(){s.event("Toaster","Click","Area"),D("areaAction")},function(){s.event("Toaster","Close"),w?.toasterClose&&i.toaster.close(),x?D("close"):o.close()},function(){D("doTextAction")},function(){D("doAction")},function(e){y=e},function(e){N=e},p,_,w,x,d,l]}fe||be||Function("return this")();class Ge extends ue{constructor(e){super(),me(this,e,Me,Te,M,{windowWidth:0,windowHeight:18,theme:1,skin:2,severity:3,icon:4,iconSize:5,title:6,text:7,progress:19,textActionLabel:8,buttonLabel:9,burgerToasterTracker:20,handleClose:21,allowHtml:10})}}function $e(e){let t,s;return{c(){t=C("img"),z(t,"alt",e[0]),t.src!==(s="data:image/png;base64,"+e[1])&&z(t,"src",s),z(t,"height","48"),z(t,"class","toaster__icon")},m(e,s){E(e,t,s)},p(e,n){1&n&&z(t,"alt",e[0]),2&n&&t.src!==(s="data:image/png;base64,"+e[1])&&z(t,"src",s)},d(e){e&&L(t)}}}function Pe(e){let t,s,n,i,o,a,l,r,p,c,h,m,u,g,f,b,_,A=d("doNotDisturb.gameAddedToaster.title",e[0])+"",v=d("doNotDisturb.gameAddedToaster.desc")+"",w=e[1]&&$e(e);return{c(){w&&w.c(),t=O(),s=C("p"),i=O(),o=C("p"),a=C("p"),l=C("button"),r=O(),p=C("kin-button"),p.textContent=`${d("global.gotIt")}`,c=O(),h=C("div"),m=C("div"),u=C("input"),g=O(),f=C("label"),f.textContent=`${d("system.toasters.wrongTime.dontShowAgain")}`,n=new V(i),z(s,"class","toaster__text p"),z(a,"class","toaster__text p -small"),j(p,"class","toaster__btn"),z(u,"type","checkbox"),z(u,"id","dontShowAgain"),z(u,"class","checkbox -small"),z(f,"for","dontShowAgain"),z(f,"class","checkbox__label text -secondary -small dnd_checkbox__label svelte-19pvrng"),z(m,"class","checkbox__row"),z(h,"class","toaster__footer")},m(d,x){w&&w.m(d,x),E(d,t,x),E(d,s,x),n.m(A,s),I(s,i),E(d,o,x),E(d,a,x),I(a,l),l.innerHTML=v,E(d,r,x),E(d,p,x),E(d,c,x),E(d,h,x),I(h,m),I(m,u),I(m,g),I(m,f),b||(_=[U(l,"click",e[4]),U(p,"click",e[3]),U(u,"click",e[5])],b=!0)},p(e,s){e[1]?w?w.p(e,s):(w=$e(e),w.c(),w.m(t.parentNode,t)):w&&(w.d(1),w=null),1&s&&A!==(A=d("doNotDisturb.gameAddedToaster.title",e[0])+"")&&n.p(A)},d(e){w&&w.d(e),e&&L(t),e&&L(s),e&&L(o),e&&L(a),e&&L(r),e&&L(p),e&&L(c),e&&L(h),b=!1,R(_)}}}function Ie(e){let t,s;return t=new Ge({props:{burgerToasterTracker:e[2],$$slots:{default:[Pe]},$$scope:{ctx:e}}}),{c(){var e;(e=t.$$.fragment)&&e.c()},m(e,n){pe(t,e,n),s=!0},p(e,[s]){const n={};1027&s&&(n.$$scope={dirty:s,ctx:e}),t.$set(n)},i(e){s||(de(t.$$.fragment,e),s=!0)},o(e){re(t.$$.fragment,e),s=!1},d(e){ce(t,e)}}}function Ee(e,n,a){const l=o.getUrlParams().gamePath;let d,r,p=!1;return t("app.gameMode.GetGame",l).then((e=>{a(0,d=e.name),a(1,r=e.icon),i.toaster.view({custom:{a1:d}}),s.event("DoNotDisturb","DND toaster opened",d),o.init()})).catch((e=>{o.close({reason:o.CLOSE_REASONS.error})})),window.addEventListener("beforeunload",(()=>{p&&t("app.windowManager.SetToasterVisibility",{id:_,visible:!1})}),!1),[d,r,{toasterView:!0,toasterClose:!0},function(){s.event("DoNotDisturb","Got It Button",d),i.toaster.click({label:"Got It - "+d}),o.close({reason:o.CLOSE_REASONS.navigateToOtherWindow})},function(){s.event("DoNotDisturb","DND list click",d),i.toaster.click({label:"Open DND mode"}),t("app.windowManager.ShowMainWindow",{route:"DoNotDisturb"}).then((function(){o.close({reason:o.CLOSE_REASONS.navigateToOtherWindow})}))},function(){p=!p,i.toaster.click({label:"checkbox_dontShowAgain_"+p})},!0]}class Le extends ue{constructor(e){var t;super(),document.getElementById("svelte-19pvrng-style")||((t=C("style")).id="svelte-19pvrng-style",t.textContent=".dnd_checkbox__label.svelte-19pvrng{margin-top:0.2rem}",I(document.head,t)),me(this,e,Ee,Ie,M,{handlesWindowInit:6})}get handlesWindowInit(){return this.$$.ctx[6]}}export default u;export{Le as gameAddedToaster,k as settings,D as settingsGeek,x as settingsSearchStrings};const Ce={name:"DoNotDisturb",version:"1.2.492",created:"2021-09-06T10:49:22.372Z"};export{Ce as metadata};