//!wrt $BSPEC:{"icn":null,"cpr":"Copyright (C) Windows 96 Team 2023.","dsc":"","frn":"Donation UI","ver":1,"ssy":"gui"}

const{Theme:Theme}=w96.ui,{TabControl:TabControl}=w96.ui.components,{WindowParams:WindowParams}=w96,cryptoInfo={btc:{title:"Bitcoin",address:"bc1qscpuz64p38lt30yngpdq3x9felrsgr6kuyh350",qr:"/system/resource/app/support/crypto-qr/btc.png"},eth:{title:"Ethereum",address:"0x3304D1f06E078DD7da99B2df7c2FE6044b071f42",qr:"/system/resource/app/support/crypto-qr/eth.png"},ltc:{title:"Litecoin",address:"ltc1qz0ymkdrvmp7quapptmungxa0hwfnxr9zq578cg",qr:"/system/resource/app/support/crypto-qr/ltc.png"},doge:{title:"Dogecoin",address:"DPbAeBA3uLyKqmWeRitgcukFFryUvcNbbq",qr:"/system/resource/app/support/crypto-qr/doge.png"}};class DonationUIApplication extends WApplication{constructor(){super()}async main(t){const e=new WindowParams;e.resizable=!1,e.title="Support Us",e.initialWidth=375,e.initialHeight=350,e.mobResize=!0;const n=this.createWindow(e,!0);n.registerWindow(),n.setWindowIcon(await Theme.getIconUrl("misc/coin","16x16")),n.setControlBoxStyle("WS_CBX_CLOSE"),n.setHtml("\n            \n        ");const o=new TabControl,s=o.addPage("Donate",(t=>{t.innerHTML='<div class="container">\n                <div class="w96-panel p1">\n                Windows 96 is a project developed by independent programmers.<br><br>\n                If you like what we make, please consider donating to help us keep this thing alive.\n                <br><br>\n                All donations will go straight to the funding of costs (server costs, etc.) and the lives of the developers.<br><br>\n                Many thanks!\n                </div>\n                <div class="e"></div>\n            </div>';const e=new TabControl;e.openPage(e.addPage("Crypto (BTC, etc.)",(t=>{t.innerHTML='<div class="currency btc">\n    <button class="w96-button"></button>\n    <div class="title">Bitcoin</div>\n</div>\n<div class="currency eth">\n    <button class="w96-button"></button>\n    <div class="title">Ethereum</div>\n</div>\n<div class="currency ltc">\n    <button class="w96-button"></button>\n    <div class="title">Litecoin</div>\n</div>\n<div class="currency doge">\n    <button class="w96-button"></button>\n    <div class="title">Dogecoin</div>\n</div>',t.querySelector(".currency.btc").onclick=()=>this.showCryptoInfo("btc"),t.querySelector(".currency.eth").onclick=()=>this.showCryptoInfo("eth"),t.querySelector(".currency.ltc").onclick=()=>this.showCryptoInfo("ltc"),t.querySelector(".currency.doge").onclick=()=>this.showCryptoInfo("doge"),t.classList.add("cryptos")}))),e.addPage("Patreon",(t=>{t.innerHTML='<span class="bold-noaa">Patreon: </span><a href="https://www.patreon.com/win96" target="_blank">https://www.patreon.com/win96</a>'}));const n=e.getElement();n.classList.add("p2"),t.querySelector(".e").replaceWith(n)}));o.addPage("Supporters",(t=>{t.innerHTML='<iframe src="https://etc.windows96.net/supporters/supporters.html" target="_blank"></iframe>';t.querySelector("iframe").onload=()=>{}}));const r=n.getBodyContainer();r.classList.add("support-us-ui"),r.appendChild(o.getElement()),n.show(),n.center(),o.openPage(s)}showCryptoInfo(t){const e=cryptoInfo[t];if(null==e)return;const n=new WindowParams;n.title="Send "+e.title,n.resizable=!1,n.initialHeight=390,n.initialWidth=290;const o=this.createWindow(n,!1);o.registerWindow(),o.setControlBoxStyle("WS_CBX_CLOSE");const s=o.getBodyContainer();s.classList.add("crypto-info-dlg"),s.innerHTML=`<div class="qr" style="background-image: url(${e.qr})"></div><div class="address">${e.address}</div>`,o.show(),o.center()}}

return await WApplication.execAsync(new DonationUIApplication(), this.boxedEnv.args, this);