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,X as u,Y as d,_ as f,a as p,b as m,d as h,et as g,g as _,i as v,o as y}from"./app-Bux8mGpp.js";import{t as b}from"./InputLabel-D-ubuO6c.js";import{t as x}from"./PrimaryButton-F7NUBYQY.js";var S={class:`mt-2 space-y-2`},C=[`value`],w={class:`block text-sm font-medium text-gray-900 dark:text-gray-100`},T={class:`block text-sm text-gray-500 dark:text-gray-400`},E={class:`flex items-center gap-4`},D={key:0,class:`text-sm text-gray-600 dark:text-gray-400`},O=t({__name:`DigestPreferenceForm`,setup(t){let g=v({digest_frequency:p().props.auth?.user?.digest_frequency??`weekly`}),O=[{value:`off`,label:`Off`,hint:`No digest emails.`},{value:`daily`,label:`Daily`,hint:`A summary every morning.`},{value:`weekly`,label:`Weekly`,hint:`A summary once a week.`}];function k(){g.post(route(`notifications.preferences`),{preserveScroll:!0})}return(t,p)=>(r(),e(`section`,null,[p[2]||=m(`header`,null,[m(`h2`,{class:`text-lg font-medium text-gray-900 dark:text-gray-100`},`Email digest`),m(`p`,{class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},` Choose how often we email you a summary of new topics and unread notifications. `)],-1),m(`form`,{class:`mt-6 space-y-6`,onSubmit:_(k,[`prevent`])},[m(`div`,null,[n(b,{value:`Frequency`}),m(`div`,S,[(r(),e(f,null,a(O,e=>m(`label`,{key:e.value,class:u([`flex cursor-pointer items-start gap-3 rounded-lg border border-gray-200 p-3 dark:border-gray-700`,d(g).digest_frequency===e.value?`border-indigo-500 ring-1 ring-indigo-500`:``])},[l(m(`input`,{type:`radio`,class:`mt-0.5 text-indigo-600 focus:ring-indigo-500`,value:e.value,"onUpdate:modelValue":p[0]||=e=>d(g).digest_frequency=e},null,8,C),[[h,d(g).digest_frequency]]),m(`span`,null,[m(`span`,w,o(e.label),1),m(`span`,T,o(e.hint),1)])],2)),64))])]),m(`div`,E,[n(x,{disabled:d(g).processing},{default:i(()=>[...p[1]||=[c(`Save`,-1)]]),_:1},8,[`disabled`]),n(y,{"enter-active-class":`transition ease-in-out`,"enter-from-class":`opacity-0`,"leave-active-class":`transition ease-in-out`,"leave-to-class":`opacity-0`},{default:i(()=>[d(g).recentlySuccessful?(r(),e(`p`,D,`Saved.`)):s(``,!0)]),_:1})])],32)]))}}),k=g({default:()=>A}),A=O;export{k as n,A as t};