1import{f as e,u as s,e as t,l as a,$ as l,y as n}from"./app-BwiOD-xT.js";import{_ as c}from"./SettingsHeader-D_yAUxyG.js";import{aD as o,r as d,B as i,c as r,s as u,o as _,p,x as m,u as f,q as h,y,ad as b,bU as v,V as g,W as x,aG as w,z as k,w as j,N as A,a as E,l as O}from"./vendor-eWDfdwlh.js";import{s as S}from"./axiosErrors-BLKeM6QF.js";/* empty css */import"./media-vendor-aRMZHiv3.js";const U={class:"block bg-background sm:rounded-lg pb-2 w-full"},P={class:"flex flex-col gap-4 lg:gap-6 p-4 lg:p-6"},I={class:"flex items-center justify-between gap-2"},L={class:"flex flex-col"},N={class:"text-xs"},F={class:"flex items-center justify-between gap-2"},G={class:"flex items-center justify-between gap-2"},V={class:"flex flex-col"},W={class:"text-xs"},B={class:"flex items-center justify-between gap-2"},C={class:"border-t pt-4 mt-2"},D={class:"text-sm font-medium mb-4"},J={class:"flex flex-col gap-4"},q={class:"flex items-center justify-between gap-2"},z={class:"flex flex-col"},H={class:"text-xs text-muted-foreground"},K={class:"flex items-center justify-between gap-2"},M={class:"flex flex-col"},T={class:"text-xs text-muted-foreground"},$={class:"border-t pt-4 mt-2"},Q={class:"text-sm font-medium mb-4"},R={class:"grid gap-3 grid-cols-2 sm:grid-cols-3"},X={class:"block cursor-pointer"},Y=["disabled"],Z=["aria-disabled"],ee={class:"font-semibold"},se={class:"text-xs text-muted-foreground"},te=["value","disabled"],ae={class:"p-3 rounded border theme-tile"},le={class:"font-semibold"},ne={class:"text-xs mt-1",style:{display:"flex",gap:"6px"}},ce={class:"mt-4 text-xs text-muted-foreground"},oe={class:"flex items-center gap-4"},de={layout:e},ie=Object.assign(de,{__name:"Preference",props:{user:Object,userPreferenceSettings:Object},setup(e){const de=e,ie=s(),re=t(),ue=ie.props.themes??{},_e=ie.props.current_theme??null,pe=ie.props.theme_permissions??!1,me=()=>{const e=de.userPreferenceSettings?.preference_settings??{};return{show_nsfw:e.show_nsfw??!1,blur_nsfw:e.blur_nsfw??!1,show_ai:e.show_ai??!0,open_posts_new_tab:e.open_posts_new_tab??!1,autoplay_gifs:e.autoplay_gifs??!0,autoplay_videos:e.autoplay_videos??!0,theme:de.user?.theme??(_e?_e.key:null)}},fe=o(me()),he=d(me()),ye=o({}),be=d(!1);let ve=JSON.stringify(fe);i(()=>de.userPreferenceSettings,()=>{const e=me(),s=JSON.stringify(e);s!==ve&&(ve=s,Object.assign(fe,e),he.value={...e})});const ge=r(()=>Object.keys(fe).some(e=>fe[e]!==he.value[e]));function xe(e){try{if(!e)return;const t=ue[e];if(!t||!t.palette)return;if(t.palette,!document.documentElement&&!document.body)return;try{Array.from(document.documentElement.classList||[]).forEach(e=>{e.startsWith("theme-")&&document.documentElement.classList.remove(e)})}catch(s){}try{document.documentElement.classList.add("theme-"+e)}catch(s){}try{document.body&&document.body.setAttribute("data-theme",e)}catch(s){}try{document.documentElement&&document.documentElement.setAttribute("data-theme",e)}catch(s){}}catch(s){}}const we=async()=>{if(!be.value){be.value=!0,Object.keys(ye).forEach(e=>delete ye[e]);try{await E.post(route("user.settings.preference.update",de.user),{...fe}),he.value={...fe};const e=fe.theme||(_e?_e.key:null);e&&pe?(xe(e),ue[e]&&(re.currentTheme={key:e,palette:ue[e].palette||{}})):!pe&&_e?.key&&xe(_e.key),O.success(a("СоÑ
Ñанено"),{autoClose:3e3})}catch(e){e.response?.data?.errors&&Object.assign(ye,e.response.data.errors),S(e,a("Ðе ÑдалоÑÑ ÑоÑ
ÑаниÑÑ"))}finally{be.value=!1}}};return u(()=>{try{const e=fe.theme||(_e?_e.key:null);e&&xe(e)}catch(e){}}),(s,t)=>{const o=c,d=l,i=n;return _(),p("div",U,[m(o,{user:e.user,title:("__"in s?s.__:f(a))("Preferences")},null,8,["user","title"]),h("div",P,[h("div",I,[h("div",L,[h("span",null,y(("__"in s?s.__:f(a))("Show mature 18+ content")),1),h("span",N,y(("__"in s?s.__:f(a))("Enable to view adult and NSFW content in your feeds and search results")),1)]),m(d,{checked:fe.show_nsfw,"onUpdate:checked":t[0]||(t[0]=e=>fe.show_nsfw=e)},null,8,["checked"])]),h("div",F,[h("span",null,y(("__"in s?s.__:f(a))("Blur mature 18+ images and media in feed")),1),m(d,{checked:fe.blur_nsfw,"onUpdate:checked":t[1]||(t[1]=e=>fe.blur_nsfw=e),disabled:!fe.show_nsfw},null,8,["checked","disabled"])]),h("div",G,[h("div",V,[h("span",null,y(("__"in s?s.__:f(a))("Show AI-labeled content")),1),h("span",W,y(("__"in s?s.__:f(a))("Disable to hide posts marked as AI-generated from feeds and search")),1)]),m(d,{checked:fe.show_ai,"onUpdate:checked":t[2]||(t[2]=e=>fe.show_ai=e)},null,8,["checked"])]),h("div",B,[h("span",null,y(("__"in s?s.__:f(a))("Open posts in new tab")),1),m(d,{checked:fe.open_posts_new_tab,"onUpdate:checked":t[3]||(t[3]=e=>fe.open_posts_new_tab=e)},null,8,["checked"])]),h("div",C,[h("h3",D,y(("__"in s?s.__:f(a))("Media Autoplay")),1),h("div",J,[h("div",q,[h("div",z,[h("span",null,y(("__"in s?s.__:f(a))("Autoplay GIFs and animations")),1),h("span",H,y(("__"in s?s.__:f(a))("Automatically play animated GIFs and images in feeds")),1)]),m(d,{checked:fe.autoplay_gifs,"onUpdate:checked":t[4]||(t[4]=e=>fe.autoplay_gifs=e)},null,8,["checked"])]),h("div",K,[h("div",M,[h("span",null,y(("__"in s?s.__:f(a))("Autoplay videos")),1
1),h("span",T,y(("__"in s?s.__:f(a))("Automatically play videos when they come into view")),1)]),m(d,{checked:fe.autoplay_videos,"onUpdate:checked":t[5]||(t[5]=e=>fe.autoplay_videos=e)},null,8,["checked"])])])]),h("div",$,[h("h3",Q,y(("__"in s?s.__:f(a))("Тема")),1),h("div",R,[h("label",X,[b(h("input",{type:"radio",name:"theme",value:null,"onUpdate:modelValue":t[6]||(t[6]=e=>fe.theme=e),class:"sr-only",disabled:!f(pe)},null,8,Y),[[v,fe.theme]]),h("div",{class:"p-3 rounded border theme-tile","aria-disabled":!f(pe)},[h("div",ee,y(("__"in s?s.__:f(a))("Ðо ÑмолÑаниÑ")),1),h("div",se,y(("__"in s?s.__:f(a))("ÐÑполÑзоваÑÑ Ð³Ð»Ð¾Ð±Ð°Ð»ÑнÑÑ ÑÐµÐ¼Ñ ÑайÑа")),1)],8,Z)]),(_(!0),p(g,null,x(f(ue),(e,s)=>(_(),p("label",{key:s,class:"block cursor-pointer"},[b(h("input",{type:"radio",name:"theme",value:s,"onUpdate:modelValue":t[7]||(t[7]=e=>fe.theme=e),class:"sr-only",disabled:!f(pe)},null,8,te),[[v,fe.theme]]),h("div",ae,[h("div",le,y(e.name),1),h("div",ne,[h("span",{class:"theme-swatch",style:w({background:e.palette?.primary})},null,4),h("span",{class:"theme-swatch",style:w({background:e.palette?.secondary})},null,4),h("span",{class:"theme-swatch",style:w({background:e.palette?.header})},null,4)])])]))),128))]),h("div",ce,[f(pe)?(_(),p(g,{key:0},[k(y(("__"in s?s.__:f(a))("ÐоÑÑÑп к каÑÑомнÑм Ñемам доÑÑÑпен ÑолÑко бÑÑÑеÑам.")),1)],64)):(_(),p(g,{key:1},[k(y(("__"in s?s.__:f(a))("У Ð²Ð°Ñ Ð½ÐµÑ ÑазÑеÑÐµÐ½Ð¸Ñ Ð½Ð° вÑÐ±Ð¾Ñ ÐºÐ°ÑÑомной ÑемÑ. ÐÑÐ´ÐµÑ Ð¸ÑполÑзована Ñема по ÑмолÑаниÑ.")),1)],64))])]),h("div",oe,[m(i,{disabled:be.value||!ge.value,onClick:A(we,["prevent"])},{default:j(()=>[k(y(("__"in s?s.__:f(a))("Ð¡Ð¾Ñ ÑаниÑÑ")),1)]),_:1},8,["disabled"])])])])}}});export{ie as default}; 2//# sourceMappingURL=Preference-BNMOm7O1.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.