import{C as e,D as t,E as n,F as r,H as i,I as a,Q as o,S as s,T as c,U as l,Y as u,_ as d,a as f,b as p,g as m,i as h,l as g,n as _,p as v,y}from"./app-Dp_mZobc.js";import{t as b}from"./i18n-DYYu2sdh.js";import{t as x}from"./AdminLayout-BGBN5dGX.js";var S={key:0,class:`mb-5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-300`},C={class:`grid gap-6 lg:grid-cols-2`},w={class:`rounded-2xl border border-line bg-surface p-6`},T={class:`mb-4 text-sm font-bold text-ink`},E={class:`block text-sm font-medium text-ink-2`},D={class:`flex items-center gap-3`},O={class:`text-sm text-ink-2`},k=[`disabled`],A={class:`mt-4 text-xs text-ink-muted`},j={class:`rounded-2xl border border-line bg-surface p-6`},M={class:`mb-1 text-sm font-bold text-ink`},N={class:`mb-4 text-xs text-ink-muted`},P={class:`flex flex-wrap items-center gap-3`},F=[`src`],I={class:`mt-4`},L={key:0,class:`ml-2 text-sm text-ink-2`},R=t({__name:`Pwa`,props:{values:{},icons:{}},setup(t){let R=t,z=f(),B=y(()=>z.props.flash?.status),V=h({short_name:R.values.short_name,banner:R.values.banner});function H(){V.post(`/admin/pwa`,{preserveScroll:!0})}let U=h({icon:null});function W(e){let t=e.target.files?.[0]??null;U.icon=t,t&&U.post(`/admin/pwa/icon`,{preserveScroll:!0,forceFormData:!0})}return(f,h)=>(r(),e(d,null,[n(u(_),{title:u(b)(`Admin · PWA`)},null,8,[`title`]),n(x,null,{title:i(()=>[c(o(u(b)(`Progressive Web App`)),1)]),subtitle:i(()=>[c(o(u(b)(`Install experience, icons & push`)),1)]),default:i(()=>[B.value?(r(),e(`div`,S,o(B.value),1)):s(``,!0),p(`div`,C,[p(`section`,w,[p(`h3`,T,o(u(b)(`Install settings`)),1),p(`form`,{class:`space-y-5`,onSubmit:m(H,[`prevent`])},[p(`div`,null,[p(`label`,E,o(u(b)(`App short name (home-screen label)`)),1),l(p(`input`,{"onUpdate:modelValue":h[0]||=e=>u(V).short_name=e,type:`text`,maxlength:`30`,class:`mt-1.5 w-full rounded-lg border-line bg-appbg text-ink focus:border-indigo-500 focus:ring-indigo-500`},null,512),[[v,u(V).short_name]])]),p(`label`,D,[l(p(`input`,{"onUpdate:modelValue":h[1]||=e=>u(V).banner=e,type:`checkbox`,class:`rounded border-line bg-appbg text-indigo-500 focus:ring-indigo-500`},null,512),[[g,u(V).banner]]),p(`span`,O,o(u(b)(`Show the “install app” banner on supported devices`)),1)]),p(`button`,{type:`submit`,disabled:u(V).processing,class:`rounded-lg bg-indigo-500 px-4 py-2 text-sm font-semibold text-white hover:bg-indigo-600 disabled:opacity-60`},o(u(b)(`Save`)),9,k)],32),p(`p`,A,[c(o(u(b)(`The theme color comes from the brand color in`))+` `,1),p(`strong`,null,o(u(b)(`Theme`)),1),c(`. `+o(u(b)(`Push notifications use VAPID (configured server-side).`)),1)])]),p(`section`,j,[p(`h3`,M,o(u(b)(`App icons`)),1),p(`p`,N,o(u(b)(`Upload one square image — every PWA/favicon size is generated automatically (WebP/PNG).`)),1),p(`div`,P,[(r(!0),e(d,null,a(t.icons,t=>(r(),e(`img`,{key:t,src:t,class:`h-12 w-12 rounded-lg border border-line`,alt:``},null,8,F))),128))]),p(`div`,I,[p(`input`,{type:`file`,accept:`image/*`,class:`text-sm text-ink-2`,onChange:W},null,32),u(U).processing?(r(),e(`span`,L,o(u(b)(`Generating…`)),1)):s(``,!0)])])])]),_:1})],64))}});export{R as default};