2 lines
28 KiB
JavaScript
2 lines
28 KiB
JavaScript
var xe=Object.defineProperty,ke=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var oe=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var re=(s,o,i)=>o in s?xe(s,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[o]=i,ne=(s,o)=>{for(var i in o||(o={}))_e.call(o,i)&&re(s,i,o[i]);if(oe)for(var i of oe(o))Se.call(o,i)&&re(s,i,o[i]);return s},le=(s,o)=>ke(s,ye(o));var Z=(s,o,i)=>new Promise((l,f)=>{var p=m=>{try{u(i.next(m))}catch(h){f(h)}},t=m=>{try{u(i.throw(m))}catch(h){f(h)}},u=m=>m.done?l(m.value):Promise.resolve(m.value).then(p,t);u((i=i.apply(s,o)).next())});import{C as be}from"./CrossFade.B9Ap6pL9.js";import{s as B,p as V,b as y,f as v,h as d,i as e,t as x,k as c,F as X,m as U,l as Q,g as q,C as Ie,d as Ae,u as Fe,r as A,w as J,o as Y,j as H,v as ie,x as W,q as j,Q as Pe,U as $e,A as T,B as G,X as Le,J as De}from"./vendor-vue.CmaRnji1.js";import{_ as ee,u as M,a as K,i as $,dC as Ee,f as Qe}from"./index.CjrDwa0W.js";import{i as Oe}from"./swiper.tg5sgs8j.js";import{_ as Re}from"./NoInternet.dMK-ez9k.js";import"./vendor.DSdF8huI.js";const je={class:"w-full h-full pt-[45em]"},Me={class:"font-['SFPRO'] text-[26em] ml-[1em] font-[500] text-black dark:text-white"},Te={class:"w-full h-[91%] px-[20em] pt-[1em] overflow-auto no-scrollbar mt-[12em]"},qe=["onClick"],He={class:"flex items-center gap-x-[8em]"},We=["src"],Be={class:"flex flex-col"},Ve={class:"font-['SFPRO'] text-[12em] font-[500] text-black dark:text-white"},ze={class:"font-['SFPRO'] text-[10em] font-[500] text-black/50 dark:text-white/50 truncate",style:{"max-width":"14em"}},Ze=["onClick"],Ge={class:"font-['SFPRO'] text-[11em] font-[500] text-[#0D71F0] dark:text-[#0A84FF]"},Xe={__name:"apps",props:{apps:{type:Array,required:!0},searchQuery:{type:String,required:!0}},emits:["changepage"],setup(s,{emit:o}){const i=M(),{DarkMode:l,PhoneData:f}=B(i),p=r=>{var g,b;const C=r.name||r.identifier;return(b=(g=f.value)==null?void 0:g.myapps)==null?void 0:b.some(_=>{var I,P;return((I=_.name)==null?void 0:I.toLowerCase())===(C==null?void 0:C.toLowerCase())||((P=_.identifier)==null?void 0:P.toLowerCase())===(C==null?void 0:C.toLowerCase())})},t=r=>(r.isExternal||r.custom)&&r.icon&&(r.icon.startsWith("nui://")||r.icon.startsWith("http://")||r.icon.startsWith("https://"))?r.icon:$["apps/glass/"+r.icon]||$["apps/defaultapp.png"],u=r=>r.title||r.label||r.name,m=o,h=s,{t:w}=K();V(()=>{l.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const F=y(()=>h.searchQuery.length===0?h.apps:h.apps.filter(r=>r.name.toLowerCase().includes(h.searchQuery.toLowerCase())||r.title.toLowerCase().includes(h.searchQuery.toLowerCase())||r.description.toLowerCase().includes(h.searchQuery.toLowerCase())));return(r,C)=>(d(),v("div",je,[e("h1",Me,x(c(w)("appStore.apps")),1),e("div",Te,[(d(!0),v(X,null,U(F.value,(g,b)=>(d(),v("div",{class:Q([{"mb-[10em]":b!==F.value.length-1},"w-full h-[60em] anim-hover-1 cursor-pointer bg-white dark:bg-[#1C1C1E] rounded-[20em] flex items-center justify-between px-[10em]"]),key:g.name||g.identifier,onClick:_=>m("changepage","app",g)},[e("div",He,[e("img",{src:t(g),class:"h-[40em] rounded-[11em] aspect-square",alt:""},null,8,We),e("div",Be,[e("h1",Ve,x(g.isExternal?u(g):c(w)(u(g))),1),e("p",ze,x(g.isExternal?g.description:c(w)(g.description)),1)])]),p(g)?q("",!0):(d(),v("div",{key:0,class:"h-[25em] bg-[#F2F2F2] dark:bg-[#2C2C2E] rounded-[12em] cursor-pointer anim-hover-1 flex items-center justify-center px-[10em]",onClick:Ie(_=>m("changepage","app",g),["stop"])},[e("p",Ge,x(c(w)("appStore.get")),1)],8,Ze))],10,qe))),128)),C[0]||(C[0]=e("div",{class:"w-full h-[100em]"},null,-1))])]))}},Ke=ee(Xe,[["__scopeId","data-v-5340b2bf"]]),ce=Ae("appStore",{state:()=>({loadedImageCache:new Set,isPreloadingImages:!1,preloadProgress:0,preloadTotal:0,apps:[],games:[]}),getters:{isImageCached:s=>o=>s.loadedImageCache.has(o),allSwiperImages:s=>{var f;const o=new Set,i=M();return(((f=i==null?void 0:i.appConfig)==null?void 0:f.AppStoreConfig)||[]).forEach(p=>{p.swiperItems&&Array.isArray(p.swiperItems)&&p.swiperItems.forEach(t=>o.add(t))}),s.games.forEach(p=>{p.swiperItems&&Array.isArray(p.swiperItems)&&p.swiperItems.forEach(t=>o.add(t))}),Array.from(o)}},actions:{addToCache(s){this.loadedImageCache.add(s)},areAllImagesPreloaded(){const s=this.allSwiperImages;return s.length>0&&s.every(o=>this.isImageCached(o))},preloadAllImages(){return Z(this,null,function*(){const s=this.allSwiperImages;if(s.length===0)return;const o=s.filter(l=>!this.isImageCached(l));if(o.length===0)return;this.isPreloadingImages=!0,this.preloadProgress=s.length-o.length,this.preloadTotal=s.length;const i=3;for(let l=0;l<o.length;l+=i){const f=o.slice(l,l+i);yield Promise.all(f.map(p=>this.preloadSingleImage(p)))}this.isPreloadingImages=!1})},preloadSingleImage(s){return new Promise(o=>{if(this.isImageCached(s)){this.preloadProgress++,o();return}const i=new Image;i.onload=()=>{this.addToCache(s),this.preloadProgress++,o()},i.onerror=()=>{this.addToCache(s),this.preloadProgress++,o()},i.src=s})},setApps(s){this.apps=s},setGames(s){this.games=s}}}),Ne={class:"w-full h-full overflow-auto smooth-scroll relative bg-[#F2F2F7] dark:bg-[#000000]"},Je={key:1,class:"w-full h-[165em] rounded-[12em] flex items-center justify-center relative"},Ue={class:"text-black/50 dark:text-white/50 font-['SFPRO'] text-[12em] font-[400] leading-[100%]"},Ye={class:"mt-[12em] flex px-[14em] items-center gap-x-[10em]"},et=["src"],tt={class:"flex flex-col gap-y-[8em]"},st={class:"flex flex-col gap-y-[4em]"},at={class:"text-black dark:text-white font-['SFPRO'] text-[16em] font-[500] leading-[100%]"},ot={class:"text-black/50 dark:text-white/50 font-['SFPRO'] text-[9em] font-[400] leading-[100%]"},rt={key:0},nt={class:"font-['SFPRO'] text-[10em] font-[500] text-white"},lt={class:"font-['SFPRO'] text-[10em] font-[500] text-white"},it={key:1,class:"relative",style:{width:"min-content"}},ct={class:"w-[22em] h-[22em] -rotate-90",viewBox:"0 0 42 42"},pt=["stroke-dashoffset"],dt={class:"w-full flex flex-col"},ut={class:"text-black dark:text-white font-['SFPRO'] text-[16em] font-[500] leading-[100%] px-[1em] mb-[.75em]"},mt={key:0,class:"w-full h-[270em] rounded-[12em] flex flex-col items-center justify-center gap-y-[20em]"},ht={class:"flex flex-col items-center gap-y-[8em]"},ft={class:"text-black/70 dark:text-white/70 font-['SFPRO'] text-[12em] font-[500] leading-[100%]"},gt={class:"text-black/50 dark:text-white/50 font-['SFPRO'] text-[10em] font-[400] leading-[100%]"},vt={class:"w-[200em] h-[4em] bg-gray-300 dark:bg-gray-700 rounded-full overflow-hidden"},wt={key:1,class:"pl-[12em]"},Ct={key:2,class:"w-full h-[270em] rounded-[12em] flex items-center justify-center"},xt={class:"text-black/50 dark:text-white/50 font-['SFPRO'] text-[12em] font-[400] leading-[100%]"},kt={__name:"app",props:{app:{type:Object,required:!1},canDownload:{type:Boolean,default:!0}},emits:["changepage"],setup(s,{emit:o}){const i=Fe(),{t:l}=K(),f=Ee(),p=o,t=s,u=A(!1),m=A(!0),h=A(0),w=A(0),F=ce(),r=M(),{downloadDuration:C,downloadingApps:g,PhoneData:b,DarkMode:_}=B(r);V(()=>{_.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const I=y(()=>Math.ceil(C.value/1e3)),P=y(()=>g.value.some(n=>{var a;return n.name===((a=t.app)==null?void 0:a.name)})),E=y(()=>u.value||P.value),O=y(()=>g.value.find(n=>{var a;return n.name===((a=t.app)==null?void 0:a.name)}));y(()=>O.value?Math.ceil(O.value.remainingTime/1e3):I.value);const pe=y(()=>O.value?O.value.progress:0),te=y(()=>{var a,S,k;const n=((a=t.app)==null?void 0:a.name)||((S=t.app)==null?void 0:S.identifier);return(k=b.value.myapps)==null?void 0:k.some(L=>{var D,z;return((D=L.name)==null?void 0:D.toLowerCase())===(n==null?void 0:n.toLowerCase())||((z=L.identifier)==null?void 0:z.toLowerCase())===(n==null?void 0:n.toLowerCase())})}),R=y(()=>{var n,a;return((n=t.app)==null?void 0:n.isExternal)||((a=t.app)==null?void 0:a.custom)}),de=y(()=>{var n,a;return R.value&&(n=t.app)!=null&&n.icon&&(t.app.icon.startsWith("nui://")||t.app.icon.startsWith("http://")||t.app.icon.startsWith("https://"))?t.app.icon:$["apps/glass/"+((a=t.app)==null?void 0:a.icon)]||$["apps/defaultapp.png"]}),se=y(()=>{var n,a,S;return((n=t.app)==null?void 0:n.title)||((a=t.app)==null?void 0:a.label)||((S=t.app)==null?void 0:S.name)}),ue=y(()=>{var a;return(a=t.app)!=null&&a.headerImage?R.value?t.app.headerImage.startsWith("http://")||t.app.headerImage.startsWith("https://")||t.app.headerImage.startsWith("nui://"):!!$[t.app.headerImage]:!1}),me=y(()=>{var n;return(n=t.app)!=null&&n.headerImage?R.value&&(t.app.headerImage.startsWith("http://")||t.app.headerImage.startsWith("https://")||t.app.headerImage.startsWith("nui://"))?t.app.headerImage:$[t.app.headerImage]:null}),he=y(()=>{var n,a;return m.value&&((a=(n=t.app)==null?void 0:n.swiperItems)==null?void 0:a.length)>0}),fe=y(()=>w.value===0?0:Math.round(h.value/w.value*100)),ae=()=>{var S,k;if(!((k=(S=t.app)==null?void 0:S.swiperItems)!=null&&k.length)){m.value=!1;return}const n=t.app.swiperItems.filter(L=>!F.isImageCached(L));if(n.length===0){h.value=t.app.swiperItems.length,w.value=t.app.swiperItems.length,m.value=!1;return}m.value=!0,h.value=t.app.swiperItems.length-n.length,w.value=t.app.swiperItems.length;const a=setInterval(()=>{const L=t.app.swiperItems.filter(D=>!F.isImageCached(D));L.length===0?(h.value=t.app.swiperItems.length,m.value=!1,clearInterval(a)):h.value=t.app.swiperItems.length-L.length},100);setTimeout(()=>{clearInterval(a),m.value&&(m.value=!1)},1e4)};J(()=>t.app,()=>{ae()},{immediate:!0}),J([te,P],([n,a])=>{n&&!a&&u.value&&(u.value=!1)}),Y(()=>{ae()});const ge=()=>Z(this,null,function*(){var a;if(!t.canDownload){r.TriggerNotification({appname:"apps",header:"App Store",message:l("appStore.insufficientSignalForDownload")||"Insufficient signal to download apps."});return}if(R.value){u.value=!0;const k=f.getStoreAppById(t.app.identifier)||t.app,L=((a=r.PhoneData.myapps)==null?void 0:a.map(N=>N.slot||0))||[];let D=1;for(;L.includes(D);)D++;const z=le(ne({},k),{slot:D,customApp:!0,isExternal:!0,defaultapp:!1});f.addApp(k),r.PhoneData.myapps||(r.PhoneData.myapps=[]),r.PhoneData.myapps.push(z);try{yield Qe("DOWNLOAD_EXTERNAL_APP",{app:{name:k.name||k.identifier,identifier:k.identifier,label:k.label||k.title||k.name,icon:k.icon,path:k.path,slot:D,isExternal:!0,customApp:!0}}),r.TriggerNotification({appname:"apps",header:"App Store",message:`${k.label||k.title||k.name} installed successfully!`})}catch(N){console.error("Error installing external app:",N)}u.value=!1;return}u.value=!0;const n={name:t.app.name,icon:t.app.icon,path:`/${t.app.name}`,label:t.app.title};r.startAppDownload(n)}),ve=()=>{O.value&&(r.cancelAppDownload(O.value.slot),u.value=!1)},we=n=>{i.push(n)},Ce=n=>{const a=r.isVideo(n);r.setPhotoViewerData({image:n,type:a?"video":"image"})};return(n,a)=>(d(),v("div",Ne,[ue.value?(d(),v("div",{key:0,class:"background-image w-full h-[165em]",style:H({backgroundImage:`url(${me.value})`})},[e("div",{class:"sticky top-[40em] left-[20em] z-50 w-[25em] h-[25em] bg-white/90 dark:bg-[#1C1C1E]/90 rounded-full flex items-center justify-center cursor-pointer transition-all duration-300 ease-in-out hover:bg-white dark:hover:bg-[#1C1C1E] hover:scale-105 shadow-lg back-button",onClick:a[0]||(a[0]=S=>p("changepage",s.app.isGame?"games":"apps"))},a[3]||(a[3]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-[16em] h-[16em] transition-transform duration-200",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M15 18L9 12L15 6",stroke:"#0D71F0","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))],4)):(d(),v("div",Je,[e("p",Ue,x(c(l)("appStore.noPreview")),1),e("div",{class:"absolute top-[40em] left-[20em] z-50 w-[25em] h-[25em] bg-white/90 dark:bg-[#1C1C1E]/90 rounded-full flex items-center justify-center cursor-pointer transition-all duration-300 ease-in-out hover:bg-white dark:hover:bg-[#1C1C1E] hover:scale-105 shadow-lg back-button",onClick:a[1]||(a[1]=S=>p("changepage",s.app.isGame?"games":"apps"))},a[4]||(a[4]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-[16em] h-[16em] transition-transform duration-200",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M15 18L9 12L15 6",stroke:"#0D71F0","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))])),e("div",Ye,[e("img",{src:de.value,class:"h-[75em] aspect-square rounded-[15em]",alt:""},null,8,et),e("div",tt,[e("div",st,[e("h1",at,x(R.value?se.value:c(l)(se.value)),1),e("p",ot,x(R.value&&s.app.developer?s.app.developer:c(l)("appStore.developedBy")),1)]),E.value?(d(),v("div",it,[e("div",{class:"square-loading cursor-pointer z-[100]",onClick:ve}),(d(),v("svg",ct,[a[5]||(a[5]=e("circle",{cx:"21",cy:"21",r:"18",fill:"none",stroke:"rgba(0, 136, 254, 0.2)","stroke-width":"4"},null,-1)),e("circle",{cx:"21",cy:"21",r:"18",fill:"none",stroke:"#0088FE","stroke-width":"4","stroke-linecap":"round","stroke-dasharray":113.1,"stroke-dashoffset":113.1-113.1*pe.value/100,class:"transition-all duration-100"},null,8,pt)]))])):(d(),v("div",rt,[te.value?(d(),v("div",{key:1,onClick:a[2]||(a[2]=S=>we(s.app.path)),style:{width:"min-content"},class:"h-[22em] bg-[#0D71F0] rounded-[12em] cursor-pointer anim-hover-1 flex items-center justify-center px-[14em]"},[e("p",lt,x(c(l)("appStore.open")),1)])):(d(),v("div",{key:0,onClick:ge,style:{width:"min-content"},class:Q(["h-[22em] rounded-[12em] flex items-center justify-center px-[14em]",s.canDownload?"bg-[#0D71F0] cursor-pointer anim-hover-1":"bg-gray-400 dark:bg-gray-600 cursor-not-allowed opacity-50"])},[e("p",nt,x(c(l)("appStore.get")),1)],2))]))])]),a[7]||(a[7]=e("div",{class:"w-full h-[1em] bg-black/10 dark:bg-white/10 mt-[10em] mb-[10em]"},null,-1)),e("div",dt,[e("h1",ut,x(c(l)("appStore.preview")),1),he.value?(d(),v("div",mt,[a[6]||(a[6]=e("div",{class:"w-[40em] h-[40em] border-[3em] border-gray-300 dark:border-gray-600 border-t-[#0D71F0] dark:border-t-[#0A84FF] rounded-full animate-spin"},null,-1)),e("div",ht,[e("p",ft,x(c(l)("appStore.loadingPreview")),1),e("p",gt,x(c(l)("appStore.imagesLoaded",{loaded:h.value,total:w.value})),1)]),e("div",vt,[e("div",{class:"h-full bg-[#0D71F0] dark:bg-[#0A84FF] rounded-full transition-all duration-300 ease-out",style:H({width:fe.value+"%"})},null,4)])])):s.app.swiperItems&&s.app.swiperItems.length>0?(d(),v("div",wt,[ie(c($e),{modules:[c(Oe)],"space-between":10,"slides-per-view":1.5,"centered-slides":!1,loop:!1,"free-mode":!0,class:"preview-swiper"},{default:W(()=>[(d(!0),v(X,null,U(s.app.swiperItems,S=>(d(),j(c(Pe),{key:S,class:"preview-slide cursor-pointer",onClick:k=>Ce(S)},{default:W(()=>[e("div",{style:H([{backgroundImage:`url(${S})`},{"background-size":"100% 100%","background-repeat":"no-repeat"}]),class:"w-full h-full rounded-[23em]"},null,4)]),_:2},1032,["onClick"]))),128))]),_:1},8,["modules"])])):(d(),v("div",Ct,[e("p",xt,x(c(l)("appStore.noPreview")),1)]))]),a[8]||(a[8]=e("div",{class:"w-full h-[12em]"},null,-1))]))}},yt=ee(kt,[["__scopeId","data-v-2aa5dc15"]]),_t={class:"w-full h-full"},St={class:"font-['SFPRO'] text-[24em] font-[500] text-white absolute z-[] top-[1.6em] left-[.7em]"},bt={class:"w-full absolute bottom-4 px-6"},It={class:"font-['SFPRO'] text-[22em] font-[500] text-white"},At={class:"font-['SFPRO'] text-[12em] text-opacity-50 font-[500] text-white"},Ft={class:"w-full h-[56%] overflow-auto no-scrollbar mt-4 px-5"},Pt=["onClick"],$t={class:"flex items-center gap-x-[8em]"},Lt=["src"],Dt={class:"flex flex-col"},Et={class:"font-['SFPRO'] text-[12em] font-[500] text-black dark:text-white"},Qt={class:"font-['SFPRO'] text-[10em] font-[500] text-black/50 dark:text-white/50 truncate",style:{"max-width":"17em"}},Ot=["onClick"],Rt={class:"font-['SFPRO'] text-[11em] font-[500] text-[#0D71F0] dark:text-[#0A84FF]"},jt={__name:"games",props:{games:{type:Array,required:!0},searchQuery:{type:String,required:!0}},emits:["changepage"],setup(s,{emit:o}){const i=M(),{DarkMode:l}=B(i),{t:f}=K(),p=o,t=s;V(()=>{l.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const u=y(()=>t.searchQuery.length===0?t.games:t.games.filter(m=>m.name.toLowerCase().includes(t.searchQuery.toLowerCase())||m.title.toLowerCase().includes(t.searchQuery.toLowerCase())||m.description.toLowerCase().includes(t.searchQuery.toLowerCase())));return(m,h)=>(d(),v("div",_t,[e("div",{class:"games-background",style:H({backgroundImage:`url(${c($)["appstore/games.png"]})`})},[e("h1",St,x(c(f)("appStore.games")),1),e("div",bt,[e("h2",It,x(c(f)("appStore.playWithFriends")),1),e("h3",At,x(c(f)("appStore.playWithFriendsDesc")),1)])],4),e("div",Ft,[(d(!0),v(X,null,U(u.value,(w,F)=>(d(),v("div",{class:Q([{"mb-[10em]":F!==u.value.length-1},"w-full cursor-pointer anim-hover-1 h-[60em] bg-white dark:bg-[#1C1C1E] rounded-[20em] flex items-center justify-between px-[10em]"]),key:w.name,onClick:r=>p("changepage","app",w)},[e("div",$t,[e("img",{src:c($)[w.icon],class:"h-[38em] aspect-square",alt:""},null,8,Lt),e("div",Dt,[e("h1",Et,x(c(f)(w.title)),1),e("p",Qt,x(c(f)(w.description)),1)])]),e("div",{class:"h-[25em] bg-[#F2F2F2] dark:bg-[#2C2C2E] rounded-[12em] cursor-pointer anim-hover-1 flex items-center justify-center px-[10em]",onClick:r=>p("changepage","app",w)},[e("p",Rt,x(c(f)("appStore.get")),1)],8,Ot)],10,Pt))),128))])]))}},Mt=ee(jt,[["__scopeId","data-v-db6a7000"]]),Tt={class:"w-full h-[50em] absolute bottom-[14em] flex items-center z-[20] justify-center"},qt={class:"w-[90%] h-full rounded-full flex justify-between relative"},Ht={class:"absolute inset-0 py-[5em] px-[5em] pointer-events-none"},Wt={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},Bt={width:"17em",height:"15em",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Vt=["fill"],zt={class:"w-full h-full flex flex-col items-center justify-center rounded-full"},Zt={width:"17em",height:"13em",viewBox:"0 0 25 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gt=["fill"],Xt={class:"flex-1 flex items-center pl-[16em] pr-[1em]"},Kt={class:"w-[20em] h-full flex items-center justify-center"},Nt=["src"],Jt=["placeholder"],Ut=["src"],Yt=["src"],es={__name:"navbar",props:{AppStorePage:{type:String,required:!0},searchQuery:{type:String,required:!0},setSearchQuery:{type:Function,required:!0}},emits:["changepage"],setup(s,{emit:o}){const i=M(),{DarkMode:l}=B(i),{t:f}=K(),p=A(!1),t=A(null),u=A(""),m=o,h=s;V(()=>{l.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}),Y(()=>{h.setSearchQuery(""),u.value="",t.value.value=""}),J(u,C=>{h.setSearchQuery(C)});const w=C=>{m("changepage",C)},F=()=>{p.value=!p.value,p.value?setTimeout(()=>{var C;(C=t.value)==null||C.focus()},300):(h.setSearchQuery(""),u.value="")},r=()=>{p.value=!1,h.setSearchQuery(""),u.value=""};return(C,g)=>T((d(),v("div",Tt,[e("div",qt,[e("div",{class:Q(["h-full rounded-full bg-white dark:bg-[#1C1C1E] ml-[5em] flex items-center px-[16em] justify-between transition-all duration-300 relative shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.15)]",p.value?"w-0 opacity-0":"w-[50%] opacity-100"])},[e("div",Ht,[e("div",{class:"h-full bg-black/5 dark:bg-white/10 rounded-full transition-transform duration-250 w-[45%] ease-in-out",style:H({transform:s.AppStorePage==="apps"?"translateX(4%)":"translateX(120%)"})},null,4)]),e("div",{class:"w-[33%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:g[0]||(g[0]=b=>w("apps"))},[e("div",Wt,[(d(),v("svg",Bt,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5572 0.75H10.4428C8.2521 0.74999 6.53143 0.74998 5.18802 0.93059C3.81137 1.11568 2.71911 1.50271 1.86091 2.36091C1.00272 3.21911 0.61568 4.31137 0.43059 5.68802C0.24998 7.03144 0.24999 8.75212 0.25 10.9428V11.0572C0.24999 13.2479 0.24998 14.9686 0.43059 16.312C0.61568 17.6886 1.00272 18.7809 1.86091 19.6391C2.71911 20.4973 3.81137 20.8843 5.18802 21.0694C6.53144 21.25 8.2521 21.25 10.4428 21.25H10.5572C12.7479 21.25 14.4686 21.25 15.812 21.0694C17.1886 20.8843 18.2809 20.4973 19.1391 19.6391C19.9973 18.7809 20.3843 17.6886 20.5694 16.312C20.75 14.9686 20.75 13.2479 20.75 11.0572V10.9428C20.75 8.7521 20.75 7.03144 20.5694 5.68802C20.3843 4.31137 19.9973 3.21911 19.1391 2.36091C18.2809 1.50271 17.1886 1.11568 15.812 0.93059C14.4686 0.74998 12.7479 0.74999 10.5572 0.75ZM10.1431 5.61424C9.93 5.25906 9.4693 5.14388 9.1141 5.35699C8.7589 5.5701 8.6438 6.0308 8.8569 6.38599L9.6254 7.66678L6.87536 12.2501H5C4.58579 12.2501 4.25 12.5859 4.25 13.0001C4.25 13.4143 4.58579 13.7501 5 13.7501H5.97536L4.85688 15.6142C4.64377 15.9694 4.75894 16.4301 5.11413 16.6432C5.46931 16.8563 5.93001 16.7412 6.14312 16.386L7.72464 13.7501H11C11.4142 13.7501 11.75 13.4143 11.75 13.0001C11.75 12.5859 11.4142 12.2501 11 12.2501H8.6246L11.1351 8.06596C11.1404 8.05755 11.1455 8.04905 11.1504 8.04045L12.1431 6.38599C12.3562 6.0308 12.2411 5.5701 11.8859 5.35699C11.5307 5.14388 11.07 5.25906 10.8569 5.61424L10.5 6.20904L10.1431 5.61424ZM12.5431 9.6142C12.33 9.2591 11.8693 9.1439 11.5141 9.357C11.1589 9.5701 11.0438 10.0308 11.2569 10.386L14.8569 16.386C15.07 16.7412 15.5307 16.8563 15.8859 16.6432C16.2411 16.4301 16.3562 15.9694 16.1431 15.6142L15.0246 13.7501H16C16.4142 13.7501 16.75 13.4143 16.75 13.0001C16.75 12.5859 16.4142 12.2501 16 12.2501H14.1246L12.5431 9.6142Z",fill:s.AppStorePage=="apps"?"#0D71F0":c(l)?"#FFF":"#000","fill-opacity":"0.7"},null,8,Vt)])),e("p",{class:Q([s.AppStorePage=="apps"?"!text-[#2e85f7]":"","text-[8em] font-['SFPRO'] text-black/70 dark:text-white/70 font-[400] leading-[100%] fixtext"]),style:{"margin-top":".55em"}},x(c(f)("appStore.apps")),3)])]),e("div",{class:"w-[33%] h-full flex py-[5em] px-[5em] cursor-pointer relative z-10",onClick:g[1]||(g[1]=b=>w("games"))},[e("div",zt,[(d(),v("svg",Zt,[e("path",{d:"M5.77052 6.22516C5.77052 6.00735 5.83148 5.83369 5.9534 5.70419C6.07533 5.57468 6.24436 5.50993 6.4605 5.50993H7.95687V3.96467C7.95687 3.74098 8.01506 3.56438 8.13144 3.43487C8.24782 3.30537 8.40854 3.24061 8.6136 3.24061C8.81866 3.24061 8.97939 3.30537 9.0958 3.43487C9.21214 3.56438 9.27031 3.74098 9.27031 3.96467V5.50993H10.6752C10.908 5.50993 11.0895 5.57468 11.2198 5.70419C11.35 5.83369 11.4152 6.00735 11.4152 6.22516C11.4152 6.45474 11.35 6.63575 11.2198 6.76821C11.0895 6.90065 10.908 6.96688 10.6752 6.96688H9.27031V8.51213C9.27031 8.73582 9.21214 8.91388 9.0958 9.0463C8.97939 9.1788 8.81866 9.24504 8.6136 9.24504C8.40854 9.24504 8.24782 9.1788 8.13144 9.0463C8.01506 8.91388 7.95687 8.73582 7.95687 8.51213V6.96688H6.4605C6.24436 6.96688 6.07533 6.90065 5.9534 6.76821C5.83148 6.63575 5.77052 6.45474 5.77052 6.22516ZM13.9423 7.46136C13.9423 7.10228 14.0587 6.79911 14.2915 6.55187C14.5242 6.30463 14.8069 6.18101 15.1394 6.18101C15.4775 6.18101 15.7615 6.30463 15.9915 6.55187C16.2215 6.79911 16.3365 7.10228 16.3365 7.46136C16.3365 7.82045 16.2215 8.12214 15.9915 8.36644C15.7615 8.61073 15.4775 8.73288 15.1394 8.73288C14.8069 8.73288 14.5242 8.61073 14.2915 8.36644C14.0587 8.12214 13.9423 7.82045 13.9423 7.46136ZM16.3947 4.84767C16.3947 4.48859 16.5097 4.18542 16.7396 3.93818C16.9696 3.69094 17.2509 3.56733 17.5835 3.56733C17.9216 3.56733 18.2056 3.69094 18.4355 3.93818C18.6655 4.18542 18.7805 4.48859 18.7805 4.84767C18.7805 5.20676 18.6655 5.50699 18.4355 5.74834C18.2056 5.98969 17.9216 6.11037 17.5835 6.11037C17.2509 6.11037 16.9696 5.98969 16.7396 5.74834C16.5097 5.50699 16.3947 5.20676 16.3947 4.84767ZM3.66729 16C4.23813 16 4.72999 15.8882 5.14287 15.6645C5.55576 15.4408 5.93678 15.0993 6.28593 14.6402L7.7906 12.7064C7.90145 12.5651 8.01783 12.4621 8.13975 12.3973C8.26168 12.3326 8.3836 12.3002 8.50553 12.3002H16.4945C16.6164 12.3002 16.7383 12.3326 16.8603 12.3973C16.9822 12.4621 17.0985 12.5651 17.2094 12.7064L18.7141 14.6402C19.0632 15.0993 19.4442 15.4408 19.8571 15.6645C20.27 15.8882 20.7619 16 21.3327 16C21.9645 16 22.5187 15.8602 22.9953 15.5805C23.4719 15.3009 23.8418 14.905 24.1051 14.3929C24.3684 13.8808 24.5 13.2803 24.5 12.5916C24.5 12.1501 24.4543 11.6762 24.3628 11.17C24.2714 10.6637 24.1453 10.1251 23.9846 9.5541C23.8183 8.94775 23.6132 8.28843 23.3694 7.57615C23.1255 6.86386 22.8636 6.14422 22.5838 5.41721C22.3039 4.69021 22.0227 4.00882 21.74 3.37306C21.5017 2.84326 21.2772 2.40176 21.0667 2.04856C20.8561 1.69536 20.5887 1.40691 20.2645 1.18322C19.9402 0.959528 19.4844 0.777041 18.8969 0.635761C18.1155 0.447388 17.1872 0.294334 16.112 0.1766C15.0368 0.0588667 13.8342 0 12.5042 0C11.174 0 9.97002 0.0588667 8.89209 0.1766C7.81416 0.294334 6.88447 0.447388 6.10304 0.635761C5.51558 0.777041 5.05975 0.959528 4.73554 1.18322C4.41132 1.40691 4.14392 1.69536 3.93331 2.04856C3.72272 2.40176 3.49826 2.84326 3.25996 3.37306C2.97731 4.00882 2.69605 4.69021 2.41618 5.41721C2.1363 6.14422 1.87443 6.86386 1.63058 7.57615C1.38673 8.28843 1.18168 8.94775 1.01541 9.5541C0.854693 10.1251 0.728611 10.6637 0.637167 11.17C0.545722 11.6762 0.5 12.1501 0.5 12.5916C0.5 13.2803 0.631624 13.8808 0.894873 14.3929C1.15812 14.905 1.52806 15.3009 2.00468 15.5805C2.48129 15.8602 3.0355 16 3.66729 16Z",fill:s.AppStorePage=="games"?"#0D71F0":c(l)?"#FFF":"#000","fill-opacity":"0.7"},null,8,Gt)])),e("p",{class:Q([s.AppStorePage=="games"?"!text-[#2e85f7]":"","text-[8em] font-['SFPRO'] text-black/70 dark:text-white/70 font-[400] leading-[100%] fixtext"]),style:{"margin-top":".55em"}},x(c(f)("appStore.games")),3)])])],2),e("div",{class:Q(["h-full rounded-full bg-white dark:bg-[#1C1C1E] flex items-center justify-between cursor-pointer transition-all duration-300 ease-out absolute right-0 shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.15)]",p.value?"w-full":"w-[50em]"])},[T(e("div",Xt,[e("div",Kt,[e("img",{src:c($)["call/searchwhite.svg"],class:"h-[35%] transition-opacity duration-300 absolute dark:invert",alt:"Search"},null,8,Nt)]),T(e("input",{ref_key:"searchInput",ref:t,"onUpdate:modelValue":g[2]||(g[2]=b=>u.value=b),type:"text",placeholder:c(f)("appStore.searchApps"),class:"w-full h-full border-none outline-none bg-transparent text-[11.5em] font-[400] text-black dark:text-white placeholder:text-black/50 dark:placeholder:text-white/50",onKeyup:Le(r,["escape"]),style:{"line-height":"normal","letter-spacing":"-0.23px","margin-left":"1em"}},null,40,Jt),[[De,u.value]])],512),[[G,p.value]]),e("div",{class:"min-w-[50em] w-[50em] h-full rounded-full flex items-center justify-center relative",onClick:F},[T(e("img",{src:c($)["call/searchwhite.svg"],class:"h-[32%] transition-opacity duration-300 absolute dark:invert",alt:"Search"},null,8,Ut),[[G,!p.value]]),T(e("img",{src:c($)["call/closewhite.svg"],class:"h-[32%] dark:invert",alt:""},null,8,Yt),[[G,p.value]])])],2)])],512)),[[G,!1]])}},ts={class:"w-full h-full rounded-[44em] overflow-hidden bg-[#F2F2F7] dark:bg-[#000000]"},cs={__name:"AppStoreApp",setup(s){const o=A(""),i=A([{key:"apps"},{key:"games"},{key:"app"}]),l=A("apps"),f=A(null),p=M(),{DarkMode:t,appConfig:u,networkSignal:m}=B(p);V(()=>{t.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const h=ce(),w=A(u.value.AppStoreConfig||[]),F=y(()=>{var I,P,E;const _=((E=(P=(I=u.value)==null?void 0:I.TowerConfig)==null?void 0:P.AppRequirements)==null?void 0:E.appstore)||2;return m.value>=_}),r=y(()=>{var I,P,E;const _=((E=(P=(I=u.value)==null?void 0:I.TowerConfig)==null?void 0:P.AppRequirements)==null?void 0:E.appstore_download)||3;return m.value>=_}),C=A([]),g=_=>{o.value=_},b=(_,I)=>{_==="app"?f.value=I:f.value=null,l.value=_};return Y(()=>Z(this,null,function*(){h.setApps(w.value),h.setGames(C.value),h.areAllImagesPreloaded()||h.preloadAllImages()})),(_,I)=>(d(),v("div",ts,[F.value?(d(),v(X,{key:1},[ie(be,{"current-key":l.value,items:i.value,duration:300,easing:"ease-in-out"},{apps:W(()=>[l.value==="apps"?(d(),j(Ke,{key:0,searchQuery:o.value,apps:w.value,onChangepage:b,AppStorePage:l.value,canDownload:r.value},null,8,["searchQuery","apps","AppStorePage","canDownload"])):q("",!0)]),games:W(()=>[l.value==="games"?(d(),j(Mt,{key:0,searchQuery:o.value,games:C.value,onChangepage:b,AppStorePage:l.value,canDownload:r.value},null,8,["searchQuery","games","AppStorePage","canDownload"])):q("",!0)]),app:W(()=>[l.value==="app"?(d(),j(yt,{key:0,onChangepage:b,app:f.value,canDownload:r.value},null,8,["app","canDownload"])):q("",!0)]),_:1},8,["current-key","items"]),l.value!=="app"?(d(),j(es,{key:0,searchQuery:o.value,setSearchQuery:g,AppStorePage:l.value,onChangepage:b},null,8,["searchQuery","AppStorePage"])):q("",!0)],64)):(d(),j(Re,{key:0}))]))}};export{cs as default};
|