PageSourceSearch

https://app.aeroidx.com/build/assets/AccountSettingsEditor-D71ZeofF.js

js aeroidx.com collected 2026-10-07 02:48:43 UTC 8,103 bytes, 1 lines download raw bytes

1import{w as O,a as k,e as d,k as o,l,B as g,C as J,A as B,n as e,p as v,y as u,F as _,t as V,v as n,D as F,H as M,g as C}from"./_plugin-vue_export-helper-D-DLBFXG.js";import{A as $}from"./AuthenticatedLayout-BJfSs0SQ.js";import{h as E,_ as L}from"./app-CIT4hbzU.js";import{T as z,u as D}from"./ToastMessage-DSYX9ovi.js";import{_ as q}from"./InputLabel-aaeK22A4.js";import"./Modal-CFNr_Hq7.js";import"./useTheme-CQu7LMDX.js";import"./useJennaRestrictedSettingsNav-BIi3IGix.js";import"./index-P0QL1Peh.js";import"./index-Dh0--Pjx.js";/* empty css                                                                            *//* empty css                                                     */const H={class:"min-h-screen flex flex-col py-8 px-6 md:px-10 lg:px-12"},U={class:"max-w-4xl w-full mx-auto flex flex-col flex-1"},I={class:"bg-white dark:bg-[hsla(220,20%,20%,.15)] border dark:border-[hsla(220,20%,40%,.2)] rounded-3xl shadow-sm mb-5"},P={class:"px-6 py-6"},R={class:"relative mt-2"},W={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 text-xs"},G={key:1,class:"absolute z-20 mt-1 w-full bg-white dark:bg-[#1A1B21] border border-gray-200 dark:border-[hsla(220,20%,40%,.2)] rounded-2xl shadow-lg overflow-hidden"},K=["onClick"],Q={class:"font-medium text-gray-900 dark:text-white"},X={class:"font-normal text-gray-500 dark:text-gray-400 ml-1"},Y={class:"ml-4 text-xs text-gray-400 dark:text-gray-500 shrink-0"},Z={key:0,class:"mt-3 flex items-center gap-2 px-3 py-2 bg-violet-50 dark:bg-violet-900/20 border border-violet-200 dark:border-violet-800 rounded-2xl text-sm"},ee={class:"font-medium text-violet-900 dark:text-violet-300"},te={class:"text-violet-500 dark:text-violet-400"},ae={key:0,class:"bg-white dark:bg-[hsla(220,20%,20%,.15)] border dark:border-[hsla(220,20%,40%,.2)] rounded-3xl shadow-sm"},se={class:"px-6 py-5 border-b border-gray-200 dark:border-[hsla(220,20%,40%,.2)] rounded-t-3xl flex items-center justify-between gap-3"},re=["disabled"],oe={class:"px-6 py-6"},le=["disabled"],ne={key:0,class:"mt-2 text-sm text-red-600 dark:text-red-400"},ie={class:"mt-4 flex justify-end"},de=["disabled"],ue={key:0,class:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24"},Ne={__name:"AccountSettingsEditor",setup(ce){const y=D(),x=d(""),c=d([]),h=d(!1),r=d(null);let w=null,f=!1;O(x,a=>{if(f){f=!1;return}if(r.value=null,i.value="",clearTimeout(w),a.trim().length<2){c.value=[];return}h.value=!0,w=setTimeout(async()=>{try{const{data:t}=await k.get(route("admin.account-settings.search"),{params:{q:a.trim()}});c.value=t}finally{h.value=!1}},300)});async function A(a){f=!0,r.value=a,x.value=`${a.user_name} (${a.user_email})`,c.value=[],await S()}function T(){r.value=null,x.value="",c.value=[],i.value=""}const i=d(""),m=d(!1),p=d(!1);async function S(){if(r.value){m.value=!0;try{const{data:a}=await k.get(route("admin.account-settings.show",{accountSettings:r.value.id}));i.value=JSON.stringify(a.settings??{},null,2)}catch(a){console.error("Failed to load account settings:",a),y("error","Failed to load settings.")}finally{m.value=!1}}}const b=C(()=>{if(!i.value.trim())return"Settings cannot be empty — use {} for a blank object.";try{const a=JSON.parse(i.value);return a===null||Array.isArray(a)||typeof a!="object"?"Settings must be a JSON object ({ ... }).":null}catch(a){return a.message}}),N=C(()=>r.value&&!b.value&&!p.value&&!m.value);async function j(){var a,t;if(N.value&&window.confirm(`Overwrite the settings JSON for account #${r.value.id}? This replaces the whole blob.`)){p.value=!0;try{await k.post(route("admin.account-settings.update",{accountSettings:r.value.id}),{settings:JSON.parse(i.value)}),y("success","Settings saved.")}catch(s){console.error("Failed to save account settings:",s),y("error",((t=(a=s.response)==null?void 0:a.data)==null?void 0:t.message)||"Failed to save settings.")}finally{p.value=!1}}}return(a,t)=>(o(),l(_,null,[g(J(E),{title:"Account Settings JSON"}),g($,null,{default:B(()=>[e("div",H,[e("div",U,[t[7]||(t[7]=e("div",{class:"mb-6"},[e("h1",{class:"text-2xl font-bold font-clash text-[#111827] dark:text-white"}," Account Settings JSON "),e("p",{class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},[v(" Edit the raw "),e("code",{class:"text-xs bg-gray-100 dark:bg-gray-700 px-1 py-0.5 rounded"},"account_settings.settings"),v(" blob for any account — per-account feature flags (e.g. "),e("code",{class:"text-xs bg-gray-100 dark:bg-gray-700 px-1 py-0.5 rounded"},"features.market_stats"),v("), email preferences, onboarding state. Saving replaces the whole object, so edit in place rather than retyping. ")])],-1)),e("div",I,[t[4]||(t[4]=e("div",{class:"px-6 py-5 border-b border-gray-200 dark:border-[hsla(220,20%,40%,.2)] rounded-t-3xl"},[e("h2",{class:"text-base font-semibold text-gray-900 dark:text-white"}," 1. Find an account "),e("p",{class:"mt-0.5 text-sm text-gray-500 dark:text-gray-400"}," Search by the master user's name or email, or by company name. ")],-1)),e("div",P,[g(q,{value:"Search"}),e("div",R,[g(L,{modelValue:x.value,"onUpdate:modelValue":t[0]||(t[0]=s=>x.value=s),type:"text",placeholder:"Name, email or company…",autocomplete:"off",class:"w-full"},null,8,["modelValue"]),h.value?(o(),l("span",W," Searching… ")):u("",!0),c.value.length?(o(),l("ul",G,[(o(!0),l(_,null,V(c.value,s=>(o(),l("li",{key:s.id,onClick:me=>A(s),class:"flex items-center justify-between px-4 py-3 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-[hsla(220,20%,28%,.5)] transition-colors"},[e("span",Q,[v(n(s.user_name)+" ",1),e("span",X,n(s.user_email),1)]),e("span",Y,[v(" #"+n(s.id)+" ",1),s.company_name?(o(),l(_,{key:0},[v(" · "+n(s.company_name),1)],64)):u("",!0)])],8,K))),128))])):u("",!0)]),r.value?(o(),l("div",Z,[t[3]||(t[3]=e("svg",{class:"w-4 h-4 text-violet-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.121 17.804A7 7 0 1118.364 5.636M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),e("span",ee,n(r.value.user_name),1),e("span",te," account #"+n(r.value.id),1),e("button",{type:"button",onClick:T,class:"ml-auto text-violet-400 hover:text-violet-700 dark:hover:text-violet-200 transition-colors",title:"Clear"},[...t[2]||(t[2]=[e("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):u("",!0)])]),r.value?(o(),l("div",ae,[e("div",se,[t[5]||(t[5]=e("div",null,[e("h2",{class:"text-base font-semibold text-gray-900 dark:text-white"}," 2. Edit the settings JSON "),e("p",{class:"mt-0.5 text-sm text-gray-500 dark:text-gray-400"}," The blob may contain API keys — treat it like a password field. ")],-1)),e("button",{type:"button",disabled:m.value,onClick:S,class:"shrink-0 text-sm font-medium text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white disabled:opacity-50 transition-colors"},n(m.value?"Loading…":"Reload"),9,re)]),e("div",oe,[F(e("textarea",{"onUpdate:modelValue":t[1]||(t[1]=s=>i.value=s),rows:"24",spellcheck:"false",disabled:m.value,"aria-label":"Settings JSON",class:"w-full font-mono text-xs leading-5 rounded-2xl border-gray-300 dark:border-[hsla(220,20%,40%,.2)] dark:bg-[hsla(220,20%,20%,.3)] text-gray-900 dark:text-gray-100 focus:border-violet-500 focus:ring-violet-500 disabled:opacity-50"},null,8,le),[[M,i.value]]),b.value?(o(),l("p",ne,n(b.value),1)):u("",!0),e("div",ie,[e("button",{type:"button",disabled:!N.value,onClick:j,class:"inline-flex items-center gap-2 px-5 py-2.5 rounded-3xl text-sm font-medium text-white btn-primary transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed"},[p.value?(o(),l("svg",ue,[...t[6]||(t[6]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"},null,-1)])])):u("",!0),e("span",null,n(p.value?"Saving…":"Save settings"),1)],8,de)])])])):u("",!0)])])]),_:1}),g(z)],64))}};export{Ne as default};

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.