(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18410,e=>{"use strict";let a=(0,e.i(77749).default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["Edit",()=>a],18410)},15914,e=>{"use strict";var a=e.i(20251);e.s(["X",()=>a.default])},9464,e=>{"use strict";let a=(0,e.i(77749).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",()=>a],9464)},13847,e=>{"use strict";var a=e.i(78117),t=e.i(68306),s=e.i(99213),r=e.i(29683),l=e.i(23665);let d=(0,l.createServerReference)("60ec3d23e15ac2b4cd3cfdac3e79e0e03aeea4f1ee",l.callServer,void 0,l.findSourceMapURL,"updateUserQuota");var i=e.i(18410),n=e.i(9464),c=e.i(15914),o=e.i(59441);function u({initialData:e}){let[l,u]=(0,t.useState)(e),[h,m]=(0,t.useState)(null),[x,p]=(0,t.useState)(0),[v,g]=(0,t.useState)(!1),b=()=>{m(null)},j=async e=>{g(!0);try{let a=await d(e,x);a.success?(r.toast.success(a.message),u(l.map(a=>a.id===e?{...a,shortlink_quota:x}:a)),m(null)):r.toast.error(a.message)}catch(e){r.toast.error("Gagal memperbarui kuota",{description:e.message})}finally{g(!1)}},f=l.filter(e=>"admin"!==e.username);return(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsx)("div",{className:"border border-border/50 rounded-xl overflow-hidden bg-background",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,a.jsx)("thead",{className:"bg-muted/50 text-muted-foreground font-medium border-b border-border/50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-3",children:"Nama Akun (Bidang)"}),(0,a.jsx)("th",{className:"px-4 py-3",children:"Username"}),(0,a.jsx)("th",{className:"px-4 py-3 text-center",children:"Kuota LASER"}),(0,a.jsx)("th",{className:"px-4 py-3 text-right",children:"Aksi"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border/50",children:f.length>0?f.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-muted/30 transition-colors",children:[(0,a.jsx)("td",{className:"px-4 py-3 font-medium text-foreground",children:e.name}),(0,a.jsxs)("td",{className:"px-4 py-3 text-muted-foreground font-mono text-xs",children:["@",e.username]}),(0,a.jsx)("td",{className:"px-4 py-3 text-center",children:h===e.id?(0,a.jsx)(o.Input,{type:"number",min:"0",value:x,onChange:e=>p(parseInt(e.target.value)||0),className:"w-20 text-center mx-auto h-8"}):(0,a.jsx)("span",{className:"font-bold text-lg",children:e.shortlink_quota??5})}),(0,a.jsx)("td",{className:"px-4 py-3 text-right",children:(0,a.jsx)("div",{className:"flex justify-end gap-1",children:h===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-emerald-600 hover:text-emerald-700 hover:bg-emerald-50",onClick:()=>j(e.id),disabled:v,children:(0,a.jsx)(n.Save,{className:"h-4 w-4"})}),(0,a.jsx)(s.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-neutral-500 hover:bg-neutral-100",onClick:b,disabled:v,children:(0,a.jsx)(c.X,{className:"h-4 w-4"})})]}):(0,a.jsx)(s.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-blue-600 hover:text-blue-700 hover:bg-blue-50",onClick:()=>{m(e.id),p(e.shortlink_quota||0)},children:(0,a.jsx)(i.Edit,{className:"h-4 w-4"})})})})]},e.id)):(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:4,className:"p-10 text-center text-muted-foreground",children:"Belum ada data akun bidang."})})})]})})})})}e.s(["default",()=>u],13847)}]);