1import{_ as Et,o as St,c as n,b as t,k as D,l as d,n as y,t as r,u as Tt,F as x,i as h,y as m,z as v,ad as ye,e as b,B as $,ai as ke,x as Oe,C as Bt,p as It,w as M,h as oe,bp as Vt,bq as jt,br as Lt,bs as Fe,O as p,bt as Dt,r as u,aL as he,bu as $t,bv as Kt,m as ne,bw as Ot,A as Ft,bx as Re,by as Rt,bz as zt,bA as Gt,I as ze,bB as Ht,bC as Wt,a as o,L as qt,j as we,K as Jt,bD as Yt,bE as Qt,bF as Xt,bG as Zt,bH as es,M as ts}from"./index-BaA6VAlU.js";import{_ as Ce}from"./EduIcon-CmeCG9iu.js";import{l as ss}from"./richText-DX0qMbcU.js";const ls={class:"page-root"},as={class:"canvas"},os={class:"outer"},ns={class:"main"},rs={class:"mb-6 flex items-center justify-between flex-wrap gap-3"},is={class:"flex items-center gap-3"},us={class:"flex cursor-pointer items-center gap-2 rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-slate-600"},ds=["checked"],ps={class:"mb-4 flex gap-2"},ms={key:0,class:"rounded-2xl bg-white px-5 py-12 text-center text-sm text-slate-400"},bs={key:1,class:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3"},cs={class:"relative aspect-[4/3]"},xs=["src"],vs={key:1,class:"flex h-full w-full items-center justify-center bg-slate-100 text-slate-400"},gs={class:"absolute right-2 top-2 rounded-full bg-blue-600 px-2.5 py-0.5 text-[10px] font-bold text-white"},fs={key:2,class:"absolute left-2 top-2 rounded-full bg-slate-800 px-2.5 py-0.5 text-[10px] font-bold text-white"},ys={class:"p-3"},ks={class:"text-sm font-bold text-slate-800"},hs={class:"mt-1 line-clamp-2 text-xs text-slate-500"},ws={class:"mt-2 text-[11px] font-semibold text-slate-400"},Cs={key:0,class:"mt-1.5 inline-flex items-center gap-1 rounded-full bg-violet-50 px-2 py-0.5 text-[10px] font-bold text-violet-600"},Ms={class:"mt-3 flex gap-2"},Us=["onClick"],Ns=["onClick"],Ps={key:0,class:"rounded-2xl bg-white px-5 py-12 text-center text-sm text-slate-400"},_s={key:1,class:"overflow-hidden rounded-2xl border border-slate-100 bg-white shadow-sm"},As={class:"overflow-x-auto"},Es={class:"w-full text-xs"},Ss={class:"divide-y divide-slate-50"},Ts={class:"px-4 py-3 font-semibold text-slate-700"},Bs={class:"px-4 py-3"},Is={class:"font-semibold text-slate-700"},Vs={class:"text-slate-400"},js={class:"px-4 py-3"},Ls=["href"],Ds={class:"px-4 py-3 text-slate-500"},$s={class:"px-4 py-3"},Ks={class:"px-4 py-3 text-center"},Os=["onClick"],Fs=["onClick"],Rs={key:2,class:"text-slate-300"},zs={class:"mb-3 flex flex-wrap items-center gap-2"},Gs=["onClick"],Hs={class:"flex w-full flex-wrap gap-3 rounded-xl bg-white px-4 py-2.5 text-xs shadow-sm"},Ws={class:"text-slate-500"},qs={class:"text-slate-800"},Js={class:"text-slate-500"},Ys={class:"text-emerald-600"},Qs={class:"text-slate-500"},Xs={class:"text-blue-600"},Zs={key:0,class:"rounded-2xl bg-white px-5 py-12 text-center text-sm text-slate-400"},el={key:1,class:"overflow-hidden rounded-2xl border border-slate-100 bg-white shadow-sm"},tl={class:"overflow-x-auto"},sl={class:"w-full text-xs"},ll={class:"divide-y divide-slate-50"},al={class:"px-4 py-3"},ol={class:"font-mono font-semibold text-slate-700"},nl={class:"text-slate-400"},rl={key:0,class:"text-violet-500"},il={class:"px-4 py-3"},ul={class:"font-semibold text-slate-700"},dl=["href"],pl={class:"px-4 py-3 text-slate-600"},ml={class:"px-4 py-3 font-bold text-slate-800"},bl={class:"px-4 py-3"},cl={key:0,class:"mt-1 text-slate-400"},xl={class:"px-4 py-3 text-center"},vl=["disabled","onClick"],gl={key:1,class:"text-slate-300"},fl={key:0,class:"rounded-2xl bg-white px-5 py-12 text-center text-sm text-slate-400"},yl={key:1,class:"overflow-hidden rounded-2xl border border-slate-100 bg-white shadow-sm"},kl={class:"overflow-x-auto"},hl={class:"w-full text-xs"},wl={class:"divide-y divide-slate-50"},Cl={class:"px-4 py-3"},Ml={class:"font-semibold text-slate-700"},Ul={class:"text-slate-400"},Nl={class:"px-4 py-3"},Pl={class:"font-semibold text-slate-700"},_l={class:"text-slate-400"},Al={class:"px-4 py-3"},El=["href"],Sl={key:1,class:"text-slate-300"},Tl={class:"px-4 py-3"},Bl={class:"px-4 py-3 text-center"},Il=["onClick"],Vl=["onClick"],jl=["onClick"],Ll={key:3,class:"text-slate-300"},Dl={class:"max-w-2xl"},$l={key:0,class:"rounded-2xl bg-white px-5 py-12 text-center text-sm text-slate-400"},Kl={key:1,class:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3"},Ol={class:"min-w-0 flex-1"},Fl={class:"truncate text-sm font-bold text-slate-800"},Rl={class:"mt-0.5 text-xs text-slate-400"},zl={class:"rounded bg-slate-100 px-1"},Gl={class:"mt-1 flex flex-wrap items-center gap-1.5"},Hl={key:0,class:"rounded-md bg-slate-100 px-1.5 py-0.5 text-[10px] font-bold text-slate-500"},Wl={class:"flex shrink-0 flex-col gap-1.5"},ql=["onClick"],Jl=["onClick"],Yl={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4"},Ql={class:"w-full max-w-lg overflow-hidden rounded-2xl bg-white shadow-2xl"},Xl={class:"flex items-center justify-between border-b border-slate-100 px-6 py-4"},Zl={class:"text-base font-bold text-slate-800"},ea={class:"space-y-4 p-6 pt-4"},ta=["value"],sa={class:"mt-1.5 flex flex-wrap gap-2"},la=["title","onClick"],aa={class:"mt-1.5 flex flex-wrap gap-2"},oa=["onClick"],na={class:"grid grid-cols-2 gap-3"},ra={class:"flex items-end"},ia={class:"flex cursor-pointer items-center gap-2.5 pb-2"},ua={class:"flex justify-end gap-2 border-t border-slate-100 px-6 py-4"},da=["disabled"],pa={key:1,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4"},ma={class:"relative flex max-h-[90vh] w-full max-w-lg flex-col overflow-hidden rounded-2xl bg-white shadow-2xl"},ba={class:"flex shrink-0 items-center justify-between gap-3 border-b border-slate-100 bg-white px-6 py-4"},ca={class:"text-lg font-bold text-slate-800"},xa=["disabled"],va={class:"flex-1 space-y-4 overflow-y-auto p-6 pt-4"},ga={key:0,class:"mt-1 text-xs text-slate-400"},fa=["src"],ya={key:0,class:"mt-1 text-xs text-blue-500"},ka={key:1,class:"mt-2"},ha=["src"],wa={key:2,class:"mt-1 text-xs font-semibold text-rose-500"},Ca={key:0,class:"mt-1 text-xs text-blue-500"},Ma={key:1,class:"mt-2 flex items-center justify-between gap-2 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2"},Ua={class:"truncate text-xs font-medium text-slate-600"},Na=["href"],Pa={key:2,class:"mt-1 text-xs font-semibold text-rose-500"},_a={class:"mt-1 overflow-hidden rounded-xl border border-slate-200 focus-within:border-blue-400 focus-within:ring-2 focus-within:ring-blue-200"},Aa={class:"flex flex-wrap items-center gap-0.5 border-b border-slate-100 bg-slate-50 px-1.5 py-1"},Ea={key:0,class:"flex items-center gap-2 border-b border-slate-100 bg-[#E7EDFE] px-2 py-1.5"},Sa=["onKeydown"],Ta={class:"grid grid-cols-2 gap-3"},Ba={class:"rounded-2xl border border-slate-200 bg-slate-50/70 p-4"},Ia={class:"mt-3"},Va={class:"mt-3"},ja={key:0,class:"mt-2 rounded-xl border border-dashed border-slate-200 px-3 py-2 text-xs text-slate-400"},La=["onUpdate:modelValue"],Da=["onUpdate:modelValue"],$a=["onClick"],Ka={class:"grid grid-cols-2 gap-3"},Oa={class:"grid grid-cols-2 gap-3"},Fa=["value"],Ra={key:0,class:"mt-1 flex items-center gap-2 rounded-xl border border-blue-200 bg-blue-50 px-3 py-2"},za={class:"flex-1 truncate font-mono text-sm font-semibold text-blue-700"},Ga={key:1},Ha={class:"relative mt-1"},Wa={key:0,class:"mt-2 max-h-56 overflow-y-auto rounded-xl border border-slate-200 bg-white"},qa={key:0,class:"px-3 py-2 text-xs text-slate-400"},Ja={key:1,class:"px-3 py-2 text-xs text-slate-400"},Ya=["onClick"],Qa={class:"font-mono text-xs font-bold text-slate-800"},Xa={class:"text-[11px] text-slate-400"},Za={class:"rounded-2xl border border-slate-200 bg-slate-50/70 p-4"},eo={class:"mt-3 flex cursor-pointer items-center gap-2.5"},to={class:"mt-3 grid grid-cols-2 gap-3"},so={key:0,class:"mt-2 rounded-lg bg-rose-50 px-3 py-2 text-xs text-rose-600"},lo=["value"],ao={key:0,class:"mt-1.5 rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-700"},oo={key:1,class:"mt-1.5 rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-700"},no={key:0,class:"mt-2 flex flex-wrap gap-2"},ro=["onClick"],io={key:1,class:"mt-2 text-xs text-slate-400"},uo={class:"grid grid-cols-2 gap-3"},po={class:"flex items-center gap-6"},mo={class:"flex cursor-pointer items-center gap-2 text-sm font-medium text-slate-600"},bo={class:"flex-1"},co={class:"shrink-0 border-t border-slate-100 bg-white px-6 py-4"},xo={key:0,class:"mb-2 rounded-xl border border-blue-300 bg-blue-50 px-3 py-2 text-xs font-semibold text-blue-800"},vo={key:1,class:"mb-2 rounded-xl border border-amber-300 bg-amber-50 px-3 py-2 text-xs font-semibold text-amber-800"},go={key:2,class:"mb-2 text-xs font-semibold text-rose-500"},fo={class:"flex gap-3"},yo=["disabled"],ko=["disabled"],ho={__name:"AdminEduMallView",setup(wo){const Me=[{label:"Home",to:"/",icon:"home"},{label:"Class",to:"/class",icon:"class"},{label:"Tutor",to:"/tutor",icon:"tutor"},{label:"Profile",to:"/profile",icon:"profile"},{label:"Pickuiz",to:"/quiz/utama",icon:"pickuiz"},{label:"Games",to:"/games",icon:"games"}],g=()=>ze()?.userId||ze()?.data?.userId||0,C=u("posters"),re=u(!0),K=u(!0),O=u([]),F=u([]),ie=u([]),U=u([]),Ue=u({}),Ne=u({}),w=u(!1),R=u(!1),z=u(0),T=u(!1),Ge=["video","book","file-pen","play-circle","book-open","box","headset"],He=["#2E5AF0","#7B5CFA","#12B76A","#F79009","#0BA5EC","#F04438","#9E77ED"],Pe=[{value:"program",label:"Program / Kelas"},{value:"digital",label:"Digital (nota, ebook, rakaman)"},{value:"service",label:"Perkhidmatan"},{value:"physical",label:"Fizikal (barang)"}],_e=()=>({name:"",slug:"",defaultKind:"digital",icon:"book",colour:"#2E5AF0",sortOrder:0,isActive:!0}),f=u(_e()),G=u([]),H=u({total:0,totalPaid:0,revenue:0}),ue=u("all"),de=u(""),W=u(null),We=[{value:"all",label:"Semua"},{value:"pending",label:"Menunggu"},{value:"paid",label:"Dibayar"},{value:"refunded",label:"Direfund"},{value:"expired",label:"Luput"}],q=u([]),V=u(!1),B=u(null),J=u(!1),pe=u(!1),Y=u(!1),Q=u(!1),P=u({promoVideoUrl:"",sampleNoteUrl:"",sampleNoteName:""}),k=u(""),_=ne(()=>Y.value||Q.value),Ae=()=>({id:0,title:"",description:"",posterImageUrl:"",price:0,venue:"",startDate:"",startTime:"",endDate:"",endTime:"",type:"",classType:"",isActive:!0,sortOrder:0,tutorUserId:null,classCode:"",isFeatured:!1,promoLabel:"",promoPrice:null,promoStartAt:"",promoEndAt:"",priceUnit:"",priceOptions:[],promoVideoUrl:"",sampleNoteUrl:"",sampleNoteName:"",kind:"program",category:"",tags:"",accessDays:null,groupSize:null,categoryIds:[]}),a=u(Ae()),qe=()=>{a.value.priceOptions.push({label:"",price:null})},Je=l=>{a.value.priceOptions.splice(l,1)},X=ne(()=>{const l=P.value,e=a.value;return(e.promoVideoUrl||"")!==(l.promoVideoUrl||"")||(e.sampleNoteUrl||"")!==(l.sampleNoteUrl||"")||(e.sampleNoteName||"")!==(l.sampleNoteName||"")}),Ye=ne(()=>_.value?"Menunggu muat naik media...":J.value?"Menyimpan...":X.value?"Simpan sekarang (perubahan media belum disimpan)":"Simpan"),E=u(""),S=u([]),me=u(!1),Z=u(!1);let Ee=null;const be=l=>{Z.value=!0,clearTimeout(Ee),Ee=setTimeout(async()=>{const e=g();if(!e){S.value=[];return}me.value=!0;try{const s=await Rt(e,l||"");S.value=Array.isArray(s?.items)?s.items:[]}catch{S.value=[]}finally{me.value=!1}},300)},Qe=()=>
1{a.value.classCode="",E.value="",S.value=[],be("")},Xe=l=>{a.value.classCode=l?.code||"",Z.value=!1,E.value=""},Ze=()=>{a.value.classCode="",E.value="",S.value=[],Z.value=!1},Se=l=>{if(!l)return"";const e=new Date(l);if(Number.isNaN(e.getTime()))return"";const s=i=>String(i).padStart(2,"0");return`${e.getFullYear()}-${s(e.getMonth()+1)}-${s(e.getDate())}T${s(e.getHours())}:${s(e.getMinutes())}`},et=ne(()=>{const l=Number(a.value.promoPrice);return l>0?l>=Number(a.value.price||0):!1}),N=u(null),A=(l,e=null)=>{N.value?.focus(),document.execCommand(l,!1,e),te()},ce=u(!1),j=u(""),Te=u(null);let ee=null;const tt=()=>{if(!N.value)return;const e=window.getSelection();if(!e||e.rangeCount===0||e.isCollapsed){p({message:"Pilih teks dahulu, kemudian klik Pautan.",type:"error"});return}ee=e.getRangeAt(0).cloneRange(),j.value="https://",ce.value=!0,he(()=>Te.value?.focus())},L=()=>{ce.value=!1,j.value="",ee=null},Be=()=>{const l=String(j.value||"").trim();if(!l||l==="https://"){p({message:"Masukkan alamat web yang sah.",type:"error"});return}const e=/^(?:https?:\/\/|mailto:|tel:|\/)/i.test(l)?l:`https://${l}`,s=N.value;if(s&&ee){s.focus();const i=window.getSelection();i.removeAllRanges(),i.addRange(ee)}document.execCommand("createLink",!1,e),te(),L(),p({message:"Pautan ditambah.",type:"success"})},st=()=>A("unlink"),te=()=>{a.value.description=N.value?.innerHTML||""},xe=l=>l?/^https?:\/\//i.test(l)?l:`${Ft}kiddo/Aws/S3File?key=${encodeURIComponent(l)}`:"",lt=l=>{const e=Number(l)||0;return e>0?`RM${e.toLocaleString("en-MY")}`:"Percuma"},se=l=>l?String(l).slice(0,10):"â",at=l=>({one_to_one:"1:1",small_group:"Kump. Kecil",medium_group:"Kump. Sederhana",group:"Berkumpulan"})[l]||l||"",ot=l=>({pending:"Pending",approved:"Lulus",rejected:"Tolak",contacted:"Dihubungi"})[l]||l,nt=l=>l==="approved"?"bg-emerald-100 text-emerald-700":l==="rejected"?"bg-rose-100 text-rose-600":"bg-amber-100 text-amber-700",ve=l=>`RM${(Number(l)||0).toLocaleString("en-MY",{minimumFractionDigits:2,maximumFractionDigits:2})}`,rt=l=>({pending:"Menunggu Bayaran",paid:"Dibayar",cancelled:"Dibatalkan",refunded:"Direfund",expired:"Luput"})[l]||l,it=l=>({pending:"bg-amber-100 text-amber-700",paid:"bg-emerald-100 text-emerald-700",cancelled:"bg-slate-100 text-slate-500",refunded:"bg-violet-100 text-violet-700",expired:"bg-slate-100 text-slate-500"})[l]||"bg-slate-100 text-slate-500",ut=l=>({waiting:"Menunggu",offered:"Ditawarkan",converted:"Selesai",cancelled:"Dibatalkan"})[l]||l,dt=l=>({waiting:"bg-amber-100 text-amber-700",offered:"bg-blue-100 text-blue-700",converted:"bg-emerald-100 text-emerald-700",cancelled:"bg-slate-100 text-slate-500"})[l]||"bg-slate-100 text-slate-500",ge=l=>{let e=String(l||"").replace(/\D/g,"");return e&&!e.startsWith("60")&&(e.startsWith("0")&&(e=e.substring(1)),e="60"
1+e),`https://wa.me/${e}`},le=async()=>{re.value=!0;try{const l=g();if(!l)return;const[e,s,i,c]=await Promise.all([Vt(l),jt(l,"all"),Lt(l).catch(()=>({items:[]})),Fe(l).catch(()=>({items:[]}))]);K.value=!!e?.enabled,O.value=Array.isArray(e?.items)?e.items:[],F.value=Array.isArray(s?.items)?s.items:[],ie.value=Array.isArray(i?.items)?i.items:[],Ue.value=e?.posterCategories||{},Ne.value=e?.posterPriceOptions||{},U.value=Array.isArray(c?.items)?c.items:[],w.value=!!c?.physicalEnabled,await Promise.all([ae(),Ve()])}catch(l){p({message:l?.message||"Gagal memuatkan.",type:"error"})}finally{re.value=!1}},Ie=async()=>{const l=g();if(l)try{const e=await Fe(l);U.value=Array.isArray(e?.items)?e.items:[],w.value=!!e?.physicalEnabled}catch(e){p({message:e?.message||"Gagal memuatkan kategori.",type:"error"})}},pt=l=>{const e=a.value.categoryIds||[];if(a.value.categoryIds=e.includes(l)?e.filter(s=>s!==l):[...e,l],!e.length&&l){const s=U.value.find(i=>i.id===l);s?.defaultKind&&(a.value.kind=s.defaultKind)}},mt=l=>U.value.find(e=>e.id===l)?.posterCount??0,bt=()=>{z.value=0,f.value=_e(),T.value=!0},ct=l=>{z.value=l.id,f.value={name:l.name||"",slug:l.slug||"",defaultKind:l.defaultKind||"digital",icon:l.icon||"book",colour:l.colour||"#2E5AF0",sortOrder:l.sortOrder??0,isActive:l.isActive!==!1},T.value=!0},xt=async()=>{if(!f.value.name.trim()){p({message:"Nama kategori diperlukan.",type:"error"});return}R.value=!0;try{const l=await Kt(g(),{id:z.value,...f.value});if(!l?.success){p({message:l?.message||"Gagal menyimpan kategori.",type:"error"});return}p({message:"Kategori disimpan.",type:"success"}),T.value=!1,await Ie()}catch(l){p({message:l?.message||"Gagal menyimpan kategori.",type:"error"})}finally{R.value=!1}},vt=async l=>{const e=mt(l.id),s=e>0?`Kategori "${l.name}" masih digunakan oleh ${e} poster. Ia akan DINYAHKAN (bukan dipadam) supaya poster tidak hilang dari katalog. Teruskan?`:`Padam kategori "${l.name}"?`;if(window.confirm(s))try{const i=await es(g(),l.id);p({message:i?.message||(i?.softDeleted?"Kategori dinyahaktifkan.":"Kategori dipadam."),type:"success"}),await Ie()}catch(i){p({message:i?.message||"Gagal memadam kategori.",type:"error"})}},gt=async()=>{const l=!w.value;try{const e=await $t(g(),l);if(!e?.success){p({message:e?.message||"Gagal menukar suis.",type:"error"});return}w.value=l,p({message:l?"Barang fizikal DIBUKA â ia kini muncul di Edu Mall.":"Barang fizikal ditutup â ia disembunyikan dari Edu Mall.",type:"success"})}catch(e){p({message:e?.message||"Gagal menukar suis.",type:"error"})}},Ve=async()=>{const l=g();if(l)try{const e=await Wt(l);q.value=Array.isArray(e?.items)?e.items:[]}catch(e){p({message:e?.message||"Gagal memuatkan senarai menunggu.",type:"error"})}},fe=async(l,e)=>{if(l)try{const s=await Zt(g(),l.id,e);s?.success?(p({message:"Status dikemas kini.",type:"success"}),await Ve()):p({message:s?.message||"Gagal mengemas kini.",type:"error"})}catch(s){p({message:s?.message||"Gagal mengemas kini.",type:"error"})}},ae=async()=>{const l=g();if(l)try{const e=await Ht(l,ue.value,de.value.trim());G.value=Array.isArray(e?.items)?e.items:[],H.value={total:Number(e?.total)||0,totalPaid:Number(e?.totalPaid)||0,revenue:Number(e?.revenue)||0}}catch(e){p({message:e?.message||"Gagal memuatkan order.",type:"error"})}},ft=async l=>{ue.value=l,await ae()},yt=async l=>{if(!(!l||!window.confirm(`Refund ${ve(l.totalAmount)} kepada ${l.parentName||"parent"}? 2 3Baki akan dikreditkan ke e-Wallet mereka.`))){W.value=l.id;try{const s=await Xt(g(),l.id);s?.success?(p({message:`Refund berjaya. Order ${l.orderNo}.`,type:"success"}),await ae()):p({message:s?.message||"Gagal refund.",type:"error"})}catch(s){p({message:s?.message||"Gagal refund.",type:"error"})}finally{W.value=null}}},je=l=>l?.tutorName?l.tutorName:ie.value.find(s=>Number(s.userId)===Number(l?.tutorUserId))?.name||"",I=l=>{C.value=l},kt=async l=>{const e=l.target.checked;try{await Dt(g(),e),K.value=e,p({message:e?"Edu Mall diaktifkan.":"Edu Mall dinyahaktifkan.",type:"success"})}catch(s){p({message:s?.message||"Gagal mengemas kini.",type:"error"}),l.target.checked=K.value}},ht=()=>{B.value=null,a.value=Ae(),k.value="",L(),P.value={promoVideoUrl:"",sampleNoteUrl:"",sampleNoteName:""},V.value=!0,he(()=>{N.value&&(N.value.innerHTML="")})},wt=l=>{B.value=l.id,a.value={id:l.id,title:l.title||"",description:l.description||"",posterImageUrl:l.posterImageUrl||"",price:Number(l.price)||0,venue:l.venue||"",startDate:l.startDate?String(l.startDate).slice(0,10):"",startTime:l.startTime?String(l.startTime).slice(0,5):"",endDate:l.endDate?String(l.endDate).slice(0,10):"",endTime:l.endTime?String(l.endTime).slice(0,5):"",type:l.type||"",classType:l.classType||"",isActive:!!l.isActive,sortOrder:Number(l.sortOrder)||0,tutorUserId:l.tutorUserId!=null?Number(l.tutorUserId):null,classCode:l.classCode||"",isFeatured:!!l.isFeatured,promoLabel:l.promoLabel||"",promoPrice:l.promoPrice!=null?Number(l.promoPrice):null,promoStartAt:Se(l.promoStartAt),promoEndAt:Se(l.promoEndAt),promoVideoUrl:l.promoVideoUrl||"",sampleNoteUrl:l.sampleNoteUrl||"",sampleNoteName:l.sampleNoteName||"",kind:l.kind||"program",category:l.category||"",tags:l.tags||"",accessDays:l.accessDays!=null?Number(l.accessDays):null,groupSize:l.groupSize!=null?Number(l.groupSize):null,categoryIds:(Ue.value[l.id]||[]).map(e=>e.id),priceUnit:l.priceUnit||"",priceOptions:(Ne.value[l.id]||[]).map(e=>({label:e.label||"",price:e.price!=null?Number(e.price):null}))},k.value="",L(),P.value={promoVideoUrl:l.promoVideoUrl||"",sampleNoteUrl:l.sampleNoteUrl||"",sampleNoteName:l.sampleNoteName||""},V.value=!0,he(()=>{N.value&&(N.value.innerHTML=a.value.description)})},Ct=async l=>{const e=l.target.files?.[0];if(e){pe.value=!0;try{const s=await Ot(g(),e);s?.success&&s?.key?(a.value.posterImageUrl=s.key,p({message:"Poster dimuat naik.",type:"success"})):k.value=s?.message||"Gagal muat naik poster."}catch(s){k.value=s?.message||"Gagal muat naik poster."}finally{pe.value=!1,l.target.value=""}}},Mt=async l=>{const e=l.target.files?.[0];if(!e)return;if(e.size>200*1024*1024){k.value="Video terlalu besar. Maksimum 200 MB.",l.target.value="";return}Y.value=!0;let s=!1;try{const c=await Re(g(),"video",e);c?.success&&c?.key?(a.value.promoVideoUrl=c.key,s=!0):k.value=c?.message||"Gagal muat naik video."}catch(c){k.value=c?.message||"Gagal muat naik video."}finally{Y.value=!1,l.target.value=""}if(!s)return;const i=await Le();p({message:i?"Video dimuat naik dan disimpan pada poster.":"Video dimuat naik. Klik Simpan untuk menyimpannya pada poster.",type:"success"})},Ut=async l=>{const e=l.target.files?.[0];if(!e)return;if(e.size>25*1024*1024){k.value="Fail terlalu besar. Maksimum 25 MB.",l.target.value="";return}Q.value=!0;let s=!1;try{const c=await Re(g(),"sample",e);c?.success&&c?.key?(a.value.sampleNoteUrl=c.key,a.value.sampleNoteName=c.fileName||e.name,s=!0):k.value=c?.message||"Gagal muat naik contoh nota."}catch(c){k.value=c?.message||"Gagal muat naik contoh nota."}finally{Q.value=!1,l.target.value=""}if(!s)return;const i=await Le();p({message:i?"Contoh nota dimuat naik dan disimpan pada poster.":"Contoh nota dimuat naik. Klik Simpan untuk menyimpannya pada poster.",type:"success"})},Nt=()=>{a.value.promoVideoUrl=""},Pt=()=>{a.value.sampleNoteUrl="",a.value.sampleNoteName=""},Le=async()=>!B.value||!a.value.title?.trim()?!1:(await $e({auto:!0}),!0),_t=()=>{a.value.sampleNoteUrl=P.value.sampleNoteUrl,a.value.sampleNoteName=P.value.sampleNoteName},De=()=>
3{if(_.value){window.alert(`Muat naik media masih berjalan. 4 5Tunggu sehingga ia selesai sebelum menutup borang ini â jika tidak video itu tidak akan dipautkan pada poster.`);return}X.value&&!window.confirm(`Perubahan video / contoh nota BELUM disimpan pada poster ini. 6 7Tutup dan buang perubahan itu?`)||(V.value=!1)},$e=async({auto:l=!1}={})=>{if(_.value){k.value="Muat naik media masih berjalan. Tunggu sehingga ia selesai.";return}if(!a.value.title?.trim()){if(l)return;k.value="Tajuk diperlukan.";return}J.value=!0,k.value="";try{const e={...a.value,description:ss(a.value.description||""),promoLabel:(a.value.promoLabel||"").trim()||null,promoPrice:a.value.promoPrice===""||a.value.promoPrice==null?null:Number(a.value.promoPrice),promoStartAt:a.value.promoStartAt||null,promoEndAt:a.value.promoEndAt||null,priceUnit:(a.value.priceUnit||"").trim()||null,priceOptions:(a.value.priceOptions||[]).map(i=>({label:String(i.label||"").trim(),price:Number(i.price)})).filter(i=>i.label&&Number.isFinite(i.price)&&i.price>0)},s=B.value?await zt(g(),e):await Gt(g(),e);s?.success?(p({message:B.value?"Poster dikemas kini.":"Poster ditambah.",type:"success"}),V.value=!1,await le()):k.value=s?.message||"Gagal menyimpan poster."}catch(e){k.value=e?.message||"Gagal menyimpan poster."}finally{J.value=!1}},At=async l=>{if(window.confirm(`Padam poster "${l.title}"?`))try{const e=await Yt(g(),l.id);e?.success?(p({message:"Poster dipadam.",type:"success"}),await le()):p({message:e?.message||"Gagal memadam.",type:"error"})}catch(e){p({message:e?.message||"Gagal memadam.",type:"error"})}},Ke=async(l,e)=>{try{const s=await Qt(g(),l.id,e);s?.success?(p({message:e==="approved"?"Permohonan diluluskan.":"Permohonan ditolak.",type:"success"}),await le()):p({message:s?.message||"Gagal.",type:"error"})}catch(s){p({message:s?.message||"Gagal.",type:"error"})}};return St(le),(l,e)=>(o(),n("div",ls,[t("div",as,[t("div",os,[D(qt,{links:Me}),t("div",ns,[t("div",rs,[e[58]||(e[58]=t("div",null,[t("h1",{class:"text-2xl font-bold text-slate-800"},"Edu Mall"),t("p",{class:"mt-1 text-sm text-slate-500"},"Urus poster kelas/program & permohonan join")],-1)),t("div",is,[t("label",us,[t("input",{type:"checkbox",class:"h-4 w-4 accent-blue-600",checked:K.value,onChange:kt},null,40,ds),e[57]||(e[57]=d(" Aktif ",-1))]),t("button",{type:"button",class:"rounded-xl bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-700",onClick:e[0]||(e[0]=s=>{I("posters"),ht()})}," + Tambah Poster ")])]),t("div",ps,[t("button",{type:"button",class:y(["rounded-xl px-4 py-2 text-sm font-semibold transition",C.value==="posters"?"bg-blue-600 text-white":"bg-white text-slate-600 border border-slate-200"]),onClick:e[1]||(e[1]=s=>I("posters"))}," Poster ("+r(O.value.length)+") ",3),t("button",{type:"button",class:y(["rounded-xl px-4 py-2 text-sm font-semibold transition",C.value==="requests"?"bg-blue-600 text-white":"bg-white text-slate-600 border border-slate-200"]),onClick:e[2]||(e[2]=s=>I("requests"))}," Permohonan Join ("+r(F.value.length)+") ",3),t("button",{type:"button",class:y(["rounded-xl px-4 py-2 text-sm font-semibold transition",C.value==="orders"?"bg-blue-600 text-white":"bg-white text-slate-600 border border-slate-200"]),onClick:e[3]||(e[3]=s=>I("orders"))}," Order ("+r(G.value.length)+") ",3),t("button",{type:"button",class:y(["rounded-xl px-4 py-2 text-sm font-semibold transition",C.value==="waitlist"?"bg-blue-600 text-white":"bg-white text-slate-600 border border-slate-200"]),onClick:e[4]||(e[4]=s=>I("waitlist"))}," Senarai Menunggu ("+r(q.value.length)+") ",3),t("button",{type:"button",class:y(["rounded-xl px-4 py-2 text-sm font-semibold transition",C.value==="categories"?"bg-blue-600 text-white":"bg-white text-slate-600 border border-slate-200"]),onClick:e[5]||(e[5]=s=>I("categories"))}," Kategori ("+r(U.value.length)+") ",3)]),re.value?(o(),Tt(ts,{key:0,label:"Memuatkan...",size:"lg"})):C.value==="posters"?(o(),n(x,{key:1},[O.value.length?(o(),n("div",bs,[(o(!0),n(x,null,h(O.value,s=>(o(),n("article",{key:s.id,class:"overflow-hidden rounded-2xl border border-slate-100 bg-white shadow-sm"},[t("div",cs,[xe(s.posterImageUrl)?(o(),n("img",{key:0,src:xe(s.posterImageUrl),class:"h-full w-full object-cover",alt:"poster"},null,8,xs)):(o(),n("div",vs,"â")),t("span",gs,r(lt(s.price)),1),s.isActive?b("",!0):(o(),n("span",fs,"Nonaktif"))]),t("div",ys,[t("p",ks,r(s.title),1),t("p",hs,r(s.description||"â"),1),t("p",ws,r(se(s.startDate))+" · "+r([s.type,at(s.classType)].filter(
7Boolean).join(" / ")||"â"),1),je(s)?(o(),n("p",Cs,[e[59]||(e[59]=oe('<svg class="h-3 w-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c5d5101e><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" data-v-c5d5101e></path><circle cx="9" cy="7" r="4" data-v-c5d5101e></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87" data-v-c5d5101e></path><path d="M16 3.13a4 4 0 0 1 0 7.75" data-v-c5d5101e></path></svg>',1)),d(" Tutor: "+r(je(s)),1)])):b("",!0),t("div",Ms,[t("button",{type:"button",class:"flex-1 rounded-lg bg-blue-500 py-1.5 text-[11px] font-semibold text-white hover:bg-blue-600",onClick:i=>wt(s)},"Edit",8,Us),t("button",{type:"button",class:"flex-1 rounded-lg bg-rose-500 py-1.5 text-[11px] font-semibold text-white hover:bg-rose-600",onClick:i=>At(s)},"Padam",8,Ns)])])]))),128))])):(o(),n("div",ms,' Tiada poster. Klik "Tambah Poster". '))],64)):C.value==="requests"?(o(),n(x,{key:2},[F.value.length?(o(),n("div",_s,[t("div",As,[t("table",Es,[e[61]||(e[61]=t("thead",null,[t("tr",{class:"bg-slate-50 text-left"},[t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Poster"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Parent"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"WhatsApp"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Affiliate"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Status"),t("th",{class:"px-4 py-3 font-semibold text-slate-500 text-center"},"Tindakan")])],-1)),t("tbody",Ss,[(o(!0),n(x,null,h(F.value,s=>(o(),n("tr",{key:s.id,class:"hover:bg-slate-50"},[t("td",Ts,r(s.posterTitle),1),t("td",Bs,[t("p",Is,r(s.parentName),1),t("p",Vs,r(s.parentPhone),1)]),t("td",js,[t("a",{href:ge(s.parentPhone),target:"_blank",rel:"noopener",class:"inline-flex items-center gap-1 font-semibold text-emerald-600 hover:underline"},[...e[60]||(e[60]=[t("svg",{class:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"currentColor"},[t("path",{d:"M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-3-.2-.3A8.2 8.2 0 1 1 12 20.2zm4.6-6.1c-.3-.1-1.5-.7-1.7-.8-.2-.1-.4-.1-.6.1l-.8 1c-.2.2-.3.2-.6.1a6.7 6.7 0 0 1-3.9-3.9c-.1-.3 0-.4.1-.6l.9-1c.1-.2.1-.4 0-.6l-.8-1.7c-.2-.4-.4-.3-.6-.3h-.6c-.2 0-.5.1-.8.4-.2.3-.9.9-.9 2.2s.9 2.6 1 2.8c.1.2 1.8 2.7 4.3 3.8 1.6.7 2.2.7 3 .6.5-.1 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2-.1-.1-.2-.2-.4-.3z"})],-1),d(" WhatsApp ",-1)])],8,Ls)]),t("td",Ds,r(s.referrerCode||"â"),1),t("td",$s,[t("span",{class:y(["inline-block rounded-full px-2.5 py-0.5 text-[10px] font-bold",nt(s.status)])},r(ot(s.status)),3)]),t("td",Ks,[s.status==="pending"?(o(),n("button",{key:0,type:"button",class:"mr-1 rounded-lg bg-emerald-500 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-emerald-600",onClick:i=>Ke(s,"approved")},"Lulus",8,Os)):b("",!0),s.status==="pending"?(o(),n("button",{key:1,type:"button",class:"rounded-lg bg-rose-500 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-rose-600",onClick:i=>Ke(s,"rejected")},"Tolak",8,Fs)):(o(),n("span",Rs,"â"))])]))),128))])])])])):(o(),n("div",Ps," Tiada permohonan join. "))],64)):C.value==="orders"?(o(),n(x,{key:3},[t("div",zs,[(o(),n(x,null,h(We,s=>t("button",{key:s.value,type:"button",class:y(["rounded-lg px-3 py-1.5 text-xs font-semibold transition",ue.value===s.value?"bg-slate-800 text-white":"bg-white text-slate-600 border border-slate-200"]),onClick:i=>ft(s.value)},r(s.label),11,Gs)),64)),m(t("input",{"onUpdate:modelValue":e[6]||(e[6]=s=>de.value=s),type:"text",placeholder:"Cari no. order / nama / telefon",class:"ml-auto w-full max-w-xs rounded-lg border border-slate-200 px-3 py-1.5 text-xs focus:border-blue-500 focus:outline-none",onKeyup:ye(ae,["enter"])},null,544),[[v,de.value]]),t("div",Hs,[t("span",Ws,[e[62]||(e[62]=d("Jumlah order: ",-1)),t("b",qs,r(H.value.total||0),1)]),t("span",Js,[e[63]||(e[63]=d("Dibayar: ",-1)),t("b",Ys,r(H.value.totalPaid||0),1)]),t("span",Qs,[e[64]||(e[64]=d("Hasil: ",-1)),t("b",Xs,r(ve(H.value.revenue)),1)])])]),G.value.length?(o(),n("div",el,[t("div",tl,[t("table",sl,[e[65]||(e[65]=t("thead",null,[t("tr",{class:"bg-slate-50 text-left"},[t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Order"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Parent"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Item"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Jumlah"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Status"),t("th",{class:"px-4 py-3 text-center font-semibold text-slate-500"},"Tindakan")])],-1)),t("tbody",ll,[(o(!0),n(x,null,h(G.value,s=>(o(),n("tr",{key:s.id,class:"align-top hover:bg-slate-50"},[t("td",al,[t("p",ol,r(s.orderNo),1),t("p",nl,r(se(s.createdAt)),1),s.referrerCode?(o(),n("p",rl,"ref: "+r(s.referrerCode),1)):b("",!0)]),t("td",il,[t("p",ul,r(s.parentName||"â"),1),s.parentPhone?(o(),n("a",{key:0,href:ge(s.parentPhone),target:"_blank",rel:"noopener",class:"text-emerald-600 hover:underline"},r(s.parentPhone),9,dl)):b("",!0)]),t("td",pl,[(o(!0),n(x,null,h(s.items,(i,c)=>(o(),n("p",{key:c},"⢠"+r(i.posterTitle),1))),128))]),t("td",ml,r(ve(s.totalAmount)),1),t("td",bl,[t("span",{class:y(["inline-block rounded-full px-2.5 py-0.5 text-[10px] font-bold",it(s.status)])},r(rt(s.status)),3),s.paidAt?(o(),n("p",cl,r(se(s.paidAt)),1)):b("",!0)]),t("td",xl,[s.status==="paid"?(o(),n("button",{key:0,t
7ype:"button",class:"rounded-lg bg-rose-500 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-rose-600 disabled:opacity-60",disabled:W.value===s.id,onClick:i=>yt(s)},r(W.value===s.id?"...":"Refund"),9,vl)):(o(),n("span",gl,"â"))])]))),128))])])])])):(o(),n("div",Zs," Tiada order. "))],64)):C.value==="waitlist"?(o(),n(x,{key:4},[q.value.length?(o(),n("div",yl,[t("div",kl,[t("table",hl,[e[66]||(e[66]=t("thead",null,[t("tr",{class:"bg-slate-50 text-left"},[t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Program"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Parent"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"WhatsApp"),t("th",{class:"px-4 py-3 font-semibold text-slate-500"},"Status"),t("th",{class:"px-4 py-3 text-center font-semibold text-slate-500"},"Tindakan")])],-1)),t("tbody",wl,[(o(!0),n(x,null,h(q.value,s=>(o(),n("tr",{key:s.id,class:"hover:bg-slate-50"},[t("td",Cl,[t("p",Ml,r(s.posterTitle||"#"+s.posterId),1),t("p",Ul,r(se(s.createdAt)),1)]),t("td",Nl,[t("p",Pl,r(s.parentName||"â"),1),t("p",_l,"#"+r(s.userId),1)]),t("td",Al,[s.parentPhone?(o(),n("a",{key:0,href:ge(s.parentPhone),target:"_blank",rel:"noopener",class:"font-semibold text-emerald-600 hover:underline"},r(s.parentPhone),9,El)):(o(),n("span",Sl,"â"))]),t("td",Tl,[t("span",{class:y(["inline-block rounded-full px-2.5 py-0.5 text-[10px] font-bold",dt(s.status)])},r(ut(s.status)),3)]),t("td",Bl,[s.status==="waiting"?(o(),n("button",{key:0,type:"button",class:"mr-1 rounded-lg bg-blue-500 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-blue-600",onClick:i=>fe(s,"offered")},"Tawar",8,Il)):b("",!0),s.status==="waiting"||s.status==="offered"?(o(),n("button",{key:1,type:"button",class:"mr-1 rounded-lg bg-emerald-500 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-emerald-600",onClick:i=>fe(s,"converted")},"Selesai",8,Vl)):b("",!0),s.status==="waiting"||s.status==="offered"?(o(),n("button",{key:2,type:"button",class:"rounded-lg bg-rose-500 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-rose-600",onClick:i=>fe(s,"cancelled")},"Batal",8,jl)):b("",!0),s.status==="converted"||s.status==="cancelled"?(o(),n("span",Ll,"â")):b("",!0)])]))),128))])])])])):(o(),n("div",fl," Tiada rekod senarai menunggu. "))],64)):C.value==="categories"?(o(),n(x,{key:5},[t("div",{class:"mb-4 flex flex-wrap items-start justify-between gap-3 rounded-2xl border border-slate-200 bg-slate-50/70 p-4"},[e[67]||(e[67]=t("div",{class:"max-w-2xl"},[t("p",{class:"text-sm font-bold text-slate-700"},"Section Edu Mall"),t("p",{class:"mt-0.5 text-xs text-slate-500"},[d(" Setiap kategori menjadi satu section di halaman Edu Mall. Section yang "),t("b",null,"tiada poster tersembunyi sendiri"),d(" â anda tidak perlu menyembunyikannya secara manual. Satu poster boleh berada dalam lebih daripada satu kategori (cth Buku Rujukan di Ebook dan Buku Rujukan). ")])],-1)),t("button",{type:"button",class:"rounded-xl bg-blue-600 px-4 py-2 text-sm font-semibold text-white hover:bg-blue-700",onClick:bt},"+ Tambah Kategori")]),t("div",{class:y(["mb-4 flex flex-wrap items-center justify-between gap-3 rounded-2xl border p-4",w.value?"border-emerald-200 bg-emerald-50":"border-amber-200 bg-amber-50"])},[t("div",Dl,[t("p",{class:y(["text-sm font-bold",w.value?"text-emerald-800":"text-amber-800"])}," Barang fizikal "+r(w.value?"DIBUKA":"DITUTUP"),3),t("p",{class:y(["mt-0.5 text-xs",w.value?"text-emerald-700":"text-amber-700"])},[w.value?(o(),n(x,{key:0},[e[68]||(e[68]=d(' Item "Fizikal" muncul di Edu Mall. Alamat penghantaran ',-1)),e[69]||(e[69]=t("b",null,"belum",-1)),e[70]||(e[70]=d(" dikumpul â admin perlu hubungi pembeli untuk urusan penghantaran. ",-1))],64)):(o(),n(x,{key:1},[d(' Item "Fizikal" disembunyikan dari Edu Mall dan pesanan fizikal disekat di server. Buka suis ini apabila aliran penghantaran sedia. ')],64))],2)]),t("button",{type:"button",class:y(["rounded-xl px-4 py-2 text-sm font-semibold text-white transition",w.value?"bg-amber-600 hover:bg-amber-700":"bg-emerald-600 hover:bg-emerald-700"]),onClick:gt},r(w.value?"Tutup jualan fizikal":"Buka jualan fizikal"),3)],2),U.value.length?(o(),n("div",Kl,[(o(!0),n(x,null,h(U.value,s=>(o(),n("div",{key:s.id,class:"flex items-start gap-3 rounded-2xl border border-slate-100 bg-white p-4 shadow-sm"},[t("span",{class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl",style:we({background:(s.
7colour||"#2E5AF0")+"1f",color:s.colour||"#2E5AF0"})},[D(Ce,{name:s.icon,class:"h-5 w-5"},null,8,["name"])],4),t("div",Ol,[t("p",Fl,r(s.name),1),t("p",Rl,[t("code",zl,r(s.slug),1),d(" · "+r(s.posterCount)+" poster ",1)]),t("p",Gl,[t("span",{class:y(["rounded-md px-1.5 py-0.5 text-[10px] font-bold",s.isActive?"bg-emerald-50 text-emerald-700":"bg-slate-100 text-slate-500"])},r(s.isActive?"AKTIF":"TERSEMBUNYI"),3),s.posterCount===0?(o(),n("span",Hl,"TIADA POSTER â SECTION TERSEMBUNYI")):b("",!0)])]),t("div",Wl,[t("button",{type:"button",class:"rounded-lg border border-slate-200 px-2.5 py-1 text-[11px] font-semibold text-slate-600 hover:bg-slate-50",onClick:i=>ct(s)},"Edit",8,ql),t("button",{type:"button",class:"rounded-lg border border-rose-200 px-2.5 py-1 text-[11px] font-semibold text-rose-600 hover:bg-rose-50",onClick:i=>vt(s)},"Padam",8,Jl)])]))),128))])):(o(),n("div",$l,' Tiada kategori. Klik "+ Tambah Kategori". '))],64)):b("",!0)]),T.value?(o(),n("div",Yl,[t("div",Ql,[t("div",Xl,[t("h3",Zl,r(z.value?"Edit Kategori":"Tambah Kategori"),1),t("button",{type:"button",class:"rounded-lg p-1.5 text-slate-400 hover:bg-slate-100",onClick:e[7]||(e[7]=s=>T.value=!1)},[...e[71]||(e[71]=[t("svg",{class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4"},[t("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])])]),t("div",ea,[t("div",null,[e[72]||(e[72]=t("label",{class:"text-sm font-medium text-slate-600"},"Nama kategori",-1)),m(t("input",{"onUpdate:modelValue":e[8]||(e[8]=s=>f.value.name=s),placeholder:"cth Ebook",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,f.value.name]]),e[73]||(e[73]=t("p",{class:"mt-1 text-xs text-slate-400"},"Nama ini dipaparkan kepada pembeli sebagai tajuk section.",-1))]),t("div",null,[e[74]||(e[74]=t("label",{class:"text-sm font-medium text-slate-600"},"Slug URL",-1)),m(t("input",{"onUpdate:modelValue":e[9]||(e[9]=s=>f.value.slug=s),placeholder:"(auto daripada nama)",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,f.value.slug]]),e[75]||(e[75]=t("p",{class:"mt-1 text-xs text-slate-400"},"Dijana automatik jika dibiarkan kosong. Digunakan dalam pautan seperti /edu-mall?cat=ebook",-1))]),t("div",null,[e[76]||(e[76]=t("label",{class:"text-sm font-medium text-slate-600"},"Cara penyerahan lalai",-1)),m(t("select",{"onUpdate:modelValue":e[10]||(e[10]=s=>f.value.defaultKind=s),class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},[(o(),n(x,null,h(Pe,s=>t("option",{key:s.value,value:s.value},r(s.label),9,ta)),64))],512),[[$,f.value.defaultKind]]),e[77]||(e[77]=t("p",{class:"mt-1 text-xs text-slate-400"},"Hanya CADANGAN â ia pra-isi borang poster. Poster individu tetap boleh memilih jenis lain.",-1))]),t("div",null,[e[78]||(e[78]=t("label",{class:"text-sm font-medium text-slate-600"},"Ikon",-1)),t("div",sa,[(o(),n(x,null,h(Ge,s=>t("button",{key:s,type:"button",class:y(["flex h-10 w-10 items-center justify-center rounded-xl border transition",f.value.icon===s?"border-blue-500 bg-blue-50 text-blue-600":"border-slate-200 text-slate-500 hover:bg-slate-50"]),title:s,onClick:i=>f.value.icon=s},[D(Ce,{name:s,class:"h-5 w-5"},null,8,["name"])],10,la)),64))])]),t("div",null,[e[79]||(e[79]=t("label",{class:"text-sm font-medium text-slate-600"},"Warna",-1)),t("div",aa,[(o(),n(x,null,h(He,s=>t("button",{key:s,type:"button",class:y(["h-8 w-8 rounded-full border-2 transition",f.value.colour===s?"border-slate-800":"border-transparent"]),style:we({background:s}),onClick:i=>f.value.colour=s},null,14,oa)),64))])]),t("div",na,[t("div",null,[e[80]||(e[80]=t("label",{class:"text-sm font-medium text-slate-600"},"Susunan",-1)),m(t("input",{"onUpdate:modelValue":e[11]||(e[11]=s=>f.value.sortOrder=s),type:"number",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,f.value.sortOrder,void 0,{number:!0}]]),e[81]||(e[81]=t("p",{class:"mt-1 text-xs text-slate-400"},"Kecil = lebih awal.",-1))]),t("div",ra,[t("label",ia,[m(t("input",{"onUpdate:modelValue":e[12]||(e[12]=s=>
7f.value.isActive=s),type:"checkbox",class:"h-4 w-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500"},null,512),[[ke,f.value.isActive]]),e[82]||(e[82]=t("span",{class:"text-sm font-medium text-slate-700"},"Aktif",-1))])])])]),t("div",ua,[t("button",{type:"button",class:"rounded-xl border border-slate-200 px-4 py-2 text-sm font-semibold text-slate-600 hover:bg-slate-50",onClick:e[13]||(e[13]=s=>T.value=!1)},"Batal"),t("button",{type:"button",class:"rounded-xl bg-blue-600 px-4 py-2 text-sm font-semibold text-white hover:bg-blue-700 disabled:opacity-50",disabled:R.value,onClick:xt},r(R.value?"Menyimpan...":"Simpan"),9,da)])])])):b("",!0),V.value?(o(),n("div",pa,[t("div",ma,[t("div",ba,[t("p",ca,r(B.value?"Edit Poster":"Tambah Poster"),1),t("button",{type:"button",class:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-slate-400 transition hover:bg-slate-100 hover:text-slate-700 disabled:cursor-not-allowed disabled:opacity-40",title:"Tutup",disabled:_.value,onClick:De},[...e[83]||(e[83]=[t("svg",{class:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,xa)]),t("div",va,[t("div",null,[e[84]||(e[84]=t("label",{class:"text-sm font-medium text-slate-600"},"Tajuk *",-1)),m(t("input",{"onUpdate:modelValue":e[14]||(e[14]=s=>a.value.title=s),type:"text",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.title]])]),t("div",null,[e[85]||(e[85]=t("label",{class:"text-sm font-medium text-slate-600"},"Poster (Imej)",-1)),t("input",{type:"file",accept:"image/*",class:"mt-1 w-full text-sm",onChange:Ct},null,32),pe.value?(o(),n("p",ga,"Memuat naik...")):b("",!0),a.value.posterImageUrl?(o(),n("img",{key:1,src:xe(a.value.posterImageUrl),class:"mt-2 h-32 w-full rounded-xl object-cover",alt:"preview"},null,8,fa)):b("",!0)]),t("div",null,[e[87]||(e[87]=t("label",{class:"text-sm font-medium text-slate-600"},[d("Video Promosi "),t("span",{class:"font-normal text-slate-400"},"(pilihan)")],-1)),t("input",{type:"file",accept:"video/mp4,video/webm,video/quicktime",class:"mt-1 w-full text-sm",onChange:Mt},null,32),e[88]||(e[88]=t("p",{class:"mt-1 text-xs text-slate-400"},"MP4 / WEBM / MOV, maksimum 200 MB. Kad akan paparkan butang main; video dimainkan hanya bila diklik.",-1)),Y.value?(o(),n("p",ya,"Memuat naik video... fail besar boleh mengambil beberapa minit. Jangan tutup tetingkap ini.")):b("",!0),a.value.promoVideoUrl?(o(),n("div",ka,[t("video",{src:Oe(Bt)(a.value.promoVideoUrl),controls:"",preload:"metadata",class:"w-full rounded-xl bg-black",style:{"max-height":"180px"}},null,8,ha),t("button",{type:"button",class:"mt-1 text-xs font-semibold text-red-600 hover:underline",onClick:Nt},"Buang video")])):P.value.promoVideoUrl?(o(),n("p",wa,[e[86]||(e[86]=d(" Video ditanda untuk dibuang â ia hilang hanya selepas anda klik Simpan. ",-1)),t("button",{type:"button",class:"underline",onClick:e[15]||(e[15]=s=>a.value.promoVideoUrl=P.value.promoVideoUrl)},"Batalkan")])):b("",!0)]),t("div",null,[e[90]||(e[90]=t("label",{class:"text-sm font-medium text-slate-600"},[d("Contoh Nota "),t("span",{class:"font-normal text-slate-400"},"(pilihan)")],-1)),t("input",{type:"file",accept:".pdf,.doc,.docx,.ppt,.pptx",class:"mt-1 w-full text-sm",onChange:Ut},null,32),e[91]||(e[91]=t("p",{class:"mt-1 text-xs text-slate-400"},"PDF / Word / PowerPoint, maksimum 25 MB. Boleh dipratonton oleh SEMUA pelawat di halaman poster.",-1)),Q.value?(o(),n("p",Ca,"Memuat naik fail... jangan tutup tetingkap ini.")):b("",!0),a.value.sampleNoteUrl?(o(),n("div",Ma,[t("span",Ua,r(a.value.sampleNoteName||"Contoh nota"),1),t("a",{href:Oe(It)(a.value.sampleNoteUrl,a.value.sampleNoteName),target:"_blank",rel:"noopener",class:"shrink-0 text-xs font-semibold text-blue-600 hover:underline"},"Lihat",8,Na),t("button",{type:"button",class:"shrink-0 text-xs font-semibold text-red-600 hover:underline",onClick:Pt},"Buang")])):P.value.sampleNoteUrl?(o(),n("p",Pa,[e[89]||(e[89]=d(" Contoh nota ditanda untuk dibuang â ia hilang hanya selepas anda klik Simpan. ",-1)),t("button",{type:"button",class:"underline",onClick:_t},"Batalkan")])):b("",!0)]),t("div",null,[e[103]||(e[103]=t("label",{class:"text-sm font-medium text-slate-600"},"Keterangan",-1)),t("div",_a,[t("div",Aa,[t("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-lg text-sm font-extrabold text-slate-600 hover:bg-white hover:shadow-sm",title:"Bold",onMousedown:e[16]||(e[16]=M(()=>{},["prevent"])),onClick:e[17]||(e[17]=s=>A("bold"))},[...e[92]||(e[92]=[t("b",null,"B",-1)])],32),t("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-lg text-sm italic text-slate-600 hover:bg-white hover:shadow-sm",title:"Italic",onMousedown:e[18]||(e[18]=M(()=>{},["prevent"])),onClick:e[19]||(e[19]=s=>A("italic"))},[...e[93]||(e[93]=[t("i",null,"I",-1)])],32),t("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-lg text-sm underline text-slate-600 hover:bg-white hover:shadow-sm",title:"Underline",onMousedown:e[20]||(e[20]=M(()=>{},["prevent"])),onClick:e[21]||(e[21]=s=>A("underline"))},[...e[94]||(e[94]=[t("u",null,"U",-1)])],32),e[99]||(e[99]=t("span",{class:"mx-1 h-5 w-px bg-slate-200"},null,-1)),t("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-lg text-base font-extrabold text-blue-600 hover:bg-white hover:shadow-sm",title:"Teks besar (Heading)",onMousedown:e[22]||(e[22]=M(()=>{},["prevent"])),onClick:e[23]||(e[23]=s=>A("formatBlock","H3"))},"H",32),t("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-lg text-slate-600 hover:bg-white hover:shadow-sm",title:"Senarai berbulet",onMousedown:e[24]||(e[24]=M(()=>{},["prevent"])),onClick:e[25]||(e[25]=s=>A("insertUnorderedList"))},[...e[95]||(e[95]=[oe('<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c5d5101e>
7<path d="M9 6h12M9 12h12M9 18h12" data-v-c5d5101e></path><circle cx="4" cy="6" r="1.4" fill="currentColor" data-v-c5d5101e></circle><circle cx="4" cy="12" r="1.4" fill="currentColor" data-v-c5d5101e></circle><circle cx="4" cy="18" r="1.4" fill="currentColor" data-v-c5d5101e></circle></svg>',1)])],32),t("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-lg text-slate-600 hover:bg-white hover:shadow-sm",title:"Senarai bernombor",onMousedown:e[26]||(e[26]=M(()=>{},["prevent"])),onClick:e[27]||(e[27]=s=>A("insertOrderedList"))},[...e[96]||(e[96]=[t("svg",{class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M10 6h11M10 12h11M10 18h11"}),t("path",{d:"M4 5l2 2v-3M3 11h2.5L3 14h3"})],-1)])],32),e[100]||(e[100]=t("span",{class:"mx-1 h-5 w-px bg-slate-200"},null,-1)),t("button",{type:"button",class:"flex h-8 items-center gap-1 rounded-lg px-2 text-xs font-semibold text-blue-600 hover:bg-white hover:shadow-sm",title:"Jadikan teks terpilih sebagai pautan yang boleh diklik",onMousedown:e[28]||(e[28]=M(()=>{},["prevent"])),onClick:tt},[...e[97]||(e[97]=[t("svg",{class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M10 13a5 5 0 0 0 7.1 0l2.4-2.4a5 5 0 0 0-7.1-7.1l-1.4 1.4"}),t("path",{d:"M14 11a5 5 0 0 0-7.1 0l-2.4 2.4a5 5 0 0 0 7.1 7.1l1.4-1.4"})],-1),d(" Pautan ",-1)])],32),t("button",{type:"button",class:"flex h-8 items-center gap-1 rounded-lg px-2 text-xs font-semibold text-slate-500 hover:bg-white hover:shadow-sm",title:"Buang pautan pada teks terpilih",onMousedown:e[29]||(e[29]=M(()=>{},["prevent"])),onClick:st},[...e[98]||(e[98]=[t("svg",{class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M10 13a5 5 0 0 0 7.1 0l2.4-2.4a5 5 0 0 0-7.1-7.1l-1.4 1.4"}),t("path",{d:"M4 20L20 4"})],-1),d(" Buang pautan ",-1)])],32),e[101]||(e[101]=t("span",{class:"mx-1 h-5 w-px bg-slate-200"},null,-1)),t("button",{type:"button",class:"flex h-8 items-center rounded-lg px-2 text-xs font-semibold text-slate-500 hover:bg-white hover:shadow-sm",title:"Buang format",onMousedown:e[30]||(e[30]=M(()=>{},["prevent"])),onClick:e[31]||(e[31]=s=>A("removeFormat"))},"Clear",32)]),ce.value?(o(),n("div",Ea,[e[102]||(e[102]=t("svg",{class:"h-4 w-4 shrink-0 text-[#2E5AF0]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M10 13a5 5 0 0 0 7.1 0l2.4-2.4a5 5 0 0 0-7.1-7.1l-1.4 1.4"}),t("path",{d:"M14 11a5 5 0 0 0-7.1 0l-2.4 2.4a5 5 0 0 0 7.1 7.1l1.4-1.4"})],-1)),m(t("input",{ref_key:"linkInput",ref:Te,"onUpdate:modelValue":e[32]||(e[32]=s=>j.value=s),type:"text",placeholder:"https://example.com",class:"min-w-0 flex-1 rounded-lg border border-slate-200 px-2 py-1 text-xs text-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-300",onKeydown:[ye(M(Be,["prevent"]),["enter"]),ye(M(L,["prevent"]),["esc"])]},null,40,Sa),[[v,j.value]]),t("button",{type:"button",class:"shrink-0 rounded-lg bg-[#2E5AF0] px-2.5 py-1 text-xs font-semibold text-white hover:bg-[#1B2559]",onClick:Be},"Tambah pautan"),t("button",{type:"button",class:"shrink-0 rounded-lg px-2 py-1 text-xs font-semibold text-slate-500 hover:bg-white",onClick:L},"Batal")])):b("",!0),t("div",{ref_key:"descEditor",ref:N,contenteditable:"true",class:"desc-editor min-h-[120px] w-full bg-white px-3 py-2 text-sm leading-relaxed text-slate-700 outline-none","data-placeholder":"Taip keterangan... (guna toolbar untuk format teks)",onInput:te,onBlur:te},null,544)]),e[104]||(e[104]=t("p",{class:"mt-1 text-xs text-slate-400"},"Format teks: bold, italic, teks besar, senarai, pautan dll. Alamat web yang ditaip sendiri (cth https://example.com) akan jadi pautan yang boleh diklik oleh pengguna.",-1))]),t("div",Ta,[t("div",null,[e[105]||(e[105]=t("label",{class:"text-sm font-medium text-slate-600"},"Harga (RM)",-1)),m(t("input",{"onUpdate:modelValue":e[33]||(e[33]=s=>a.value.price=s),type:"number",min:"0",step:"0.01",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.price,void 0,{number:!0}]])]),t("div",null,[e[106]||(e[106]=t("label",{class:"text-sm font-medium text-slate-600"},"Lokasi",-1)),m(t("input",{"onUpdate:modelValue":e[34]||(e[34]=s=>a.value.venue=s),type:"text",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.venue]])])]),t("div",Ba,[e[110]||(e[110]=t("p",{class:"text-sm font-bold text-slate-700"},"Pilihan Harga (paparan)",-1)),e[111]||(e[111]=t("p",{class:"mt-0.5 text-xs text-slate-400"},[d(" Paparan sahaja â "),t("b",null,"tidak"),d(' mengubah jumlah yang dicaj; pembeli tetap membayar Harga di atas. Unit muncul sebagai "RM35 / 2 jam". Baris tambahan dipaparkan sebagai senarai pilihan pada halaman butiran. ')
7],-1)),t("div",Ia,[e[107]||(e[107]=t("label",{class:"text-sm font-medium text-slate-600"},"Unit Harga",-1)),m(t("input",{"onUpdate:modelValue":e[35]||(e[35]=s=>a.value.priceUnit=s),type:"text",maxlength:"30",placeholder:"cth 2 jam, 4 sesi, sebulan",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.priceUnit]])]),t("div",Va,[t("div",{class:"flex items-center justify-between"},[e[108]||(e[108]=t("label",{class:"text-sm font-medium text-slate-600"},"Baris Pilihan Lain",-1)),t("button",{type:"button",class:"text-xs font-semibold text-blue-600 hover:text-blue-700",onClick:qe},"Tambah baris")]),a.value.priceOptions.length?b("",!0):(o(),n("p",ja,' Belum ada baris. Contoh: label "4 sesi" dengan harga 130. ')),(o(!0),n(x,null,h(a.value.priceOptions,(s,i)=>(o(),n("div",{key:i,class:"mt-2 flex items-center gap-2"},[m(t("input",{"onUpdate:modelValue":c=>s.label=c,type:"text",maxlength:"30",placeholder:"Label (cth 4 sesi)",class:"min-w-0 flex-1 rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,8,La),[[v,s.label]]),m(t("input",{"onUpdate:modelValue":c=>s.price=c,type:"number",min:"0",step:"0.01",placeholder:"RM",class:"w-28 rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,8,Da),[[v,s.price,void 0,{number:!0}]]),t("button",{type:"button",class:"rounded-xl p-2 text-slate-400 transition hover:text-rose-600","aria-label":"Buang baris",onClick:c=>Je(i)},[...e[109]||(e[109]=[t("svg",{class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[t("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,$a)]))),128))])]),t("div",Ka,[t("div",null,[e[112]||(e[112]=t("label",{class:"text-sm font-medium text-slate-600"},"Mula (Tarikh)",-1)),m(t("input",{"onUpdate:modelValue":e[36]||(e[36]=s=>a.value.startDate=s),type:"date",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.startDate]])]),t("div",null,[e[113]||(e[113]=t("label",{class:"text-sm font-medium text-slate-600"},"Mula (Masa)",-1)),m(t("input",{"onUpdate:modelValue":e[37]||(e[37]=s=>a.value.startTime=s),type:"time",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.startTime]])]),t("div",null,[e[114]||(e[114]=t("label",{class:"text-sm font-medium text-slate-600"},"Tamat (Tarikh)",-1)),m(t("input",{"onUpdate:modelValue":e[38]||(e[38]=s=>a.value.endDate=s),type:"date",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.endDate]])]),t("div",null,[e[115]||(e[115]=t("label",{class:"text-sm font-medium text-slate-600"},"Tamat (Masa)",-1)),m(t("input",{"onUpdate:modelValue":e[39]||(e[39]=s=>a.value.endTime=s),type:"time",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.endTime]])])]),t("div",Oa,[t("div",null,[e[117]||(e[117]=t("label",{class:"text-sm font-medium text-slate-600"},"Label Kad",-1)),m(t("select",{"onUpdate:modelValue":e[40]||(e[40]=s=>a.value.type=s),class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},[...e[116]||(e[116]=[oe('<option value="" data-v-c5d5101e>â</option><option value="Kelas" data-v-c5d5101e>Kelas</option><option value="Event" data-v-c5d5101e>Event</option><option value="Webinar" data-v-c5d5101e>Webinar</option><option value="Bootcamp" data-v-c5d5101e>Bootcamp</option>',5)])],512),[[$,a.value.type]])]),t("div",null,[e[119]||(e[119]=t("label",{class:"text-sm font-medium text-slate-600"},"Kumpulan",-1)),m(t("select",{"onUpdate:modelValue":e[41]||(e[41]=s=>a.value.classType=s),class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},[...e[118]||(e[118]=[oe('<option value="" data-v-c5d5101e>â</option><option value="one_to_one" data-v-c5d5101e>1:1</option><option value="small_group" data-v-c5d5101e>
7Kumpulan Kecil</option><option value="medium_group" data-v-c5d5101e>Kumpulan Sederhana</option><option value="group" data-v-c5d5101e>Berkumpulan</option>',5)])],512),[[$,a.value.classType]])])]),t("div",null,[e[121]||(e[121]=t("label",{class:"text-sm font-medium text-slate-600"},"Assign Tutor",-1)),m(t("select",{"onUpdate:modelValue":e[42]||(e[42]=s=>a.value.tutorUserId=s),class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},[e[120]||(e[120]=t("option",{value:null},"â Tiada tutor â",-1)),(o(!0),n(x,null,h(ie.value,s=>(o(),n("option",{key:s.userId,value:Number(s.userId)},[d(r(s.name),1),s.email?(o(),n(x,{key:0},[d(" ("+r(s.email)+")",1)],64)):b("",!0)],8,Fa))),128))],512),[[$,a.value.tutorUserId]]),e[122]||(e[122]=t("p",{class:"mt-1 text-xs text-slate-400"},"Pilih tutor yang akan mengajar/urus kelas ini. Tutor ini akan dapat akses untuk bahan kelas (nota, rakaman, dll).",-1))]),t("div",null,[e[126]||(e[126]=t("label",{class:"text-sm font-medium text-slate-600"},"Kod Kelas",-1)),a.value.classCode?(o(),n("div",Ra,[e[124]||(e[124]=t("svg",{class:"h-4 w-4 shrink-0 text-blue-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M4 7h16M4 12h16M4 17h10"})],-1)),t("span",za,r(a.value.classCode),1),t("button",{type:"button",class:"rounded-lg px-2 py-1 text-xs font-semibold text-slate-500 hover:bg-white",onClick:Qe},"Tukar"),t("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full text-slate-400 hover:bg-white hover:text-rose-500",title:"Buang kod kelas",onClick:Ze},[...e[123]||(e[123]=[t("svg",{class:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4"},[t("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])])])):(o(),n("div",Ga,[t("div",Ha,[e[125]||(e[125]=t("svg",{class:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"7"}),t("path",{d:"M20 20l-3.5-3.5"})],-1)),m(t("input",{"onUpdate:modelValue":e[43]||(e[43]=s=>E.value=s),type:"text",placeholder:"Cari kod kelas, cth C5342 atau PKP",class:"w-full rounded-xl border border-slate-200 py-2 pl-9 pr-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",onInput:e[44]||(e[44]=s=>be(E.value)),onFocus:e[45]||(e[45]=s=>be(E.value))},null,544),[[v,E.value]])]),Z.value?(o(),n("div",Wa,[me.value?(o(),n("p",qa,"Mencari kelas...")):S.value.length?b("",!0):(o(),n("p",Ja,"Tiada kelas ditemui.")),(o(!0),n(x,null,h(S.value,s=>(o(),n("button",{key:s.id,type:"button",class:"flex w-full flex-col items-start gap-0.5 border-b border-slate-100 px-3 py-2 text-left transition last:border-0 hover:bg-blue-50",onClick:i=>Xe(s)},[t("span",Qa,r(s.code),1),t("span",Xa,[d(r(s.grade||"â"),1),s.className?(o(),n(x,{key:0},[d(" · "+r(s.className),1)],64)):b("",!0),s.fee!=null?(o(),n(x,{key:1},[d(" · RM"+r(Number(s.fee).toFixed(2)),1)],64)):b("",!0)])],8,Ya))),128))])):b("",!0)])),e[127]||(e[127]=t("p",{class:"mt-1 text-xs text-slate-400"},"Kelas sebenar Pickiddo (pusat 2075). Simpan sebagai rujukan â tidak dipaparkan kepada pembeli.",-1))]),t("div",Za,[e[133]||(e[133]=t("p",{class:"text-sm font-bold text-slate-700"},"Promosi & Paparan Utama",-1)),e[134]||(e[134]=t("p",{class:"mt-0.5 text-xs text-slate-400"},"Harga promosi mesti LEBIH RENDAH daripada harga biasa. Kiraan undur hanya muncul bila ada harga promosi aktif.",-1)),t("label",eo,[m(t("input",{"onUpdate:modelValue":e[46]||(e[46]=s=>a.value.isFeatured=s),type:"checkbox",class:"h-4 w-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500"},null,512),[[ke,a.value.isFeatured]]),e[128]||(e[128]=t("span",{class:"text-sm font-medium text-slate-700"},"Papar di Utama (carousel main page)",-1))]),t("div",to,[t("div",null,[e[129]||(e[129]=t("label",{class:"text-sm font-medium text-slate-600"},"Label Promosi",-1)),m(t("input",{"onUpdate:modelValue":e[47]||(e[47]=s=>a.value.promoLabel=s),type:"text",maxlength:"50",placeholder:"cth PROMOSI",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.promoLabel]])]),t("div",null,[e[130]||(e[130]=t("label",{class:"text-sm font-medium text-slate-600"},"Harga Promosi (RM)",-1)),m(t("input",{"onUpdate:modelValue":e[48]||(e[48]=s=>a.value.promoPrice=s),type:"number",step:"0.01",min:"0",placeholder:"cth 25",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.promoPrice,void 0,{number:!0}]])]),t("div",null,[e[131]||(e[131]=t("label",{class:"text-sm font-medium text-slate-600"},"Mula",-1)),m(t("input",{"onUpdate:modelValue":e[49]||(e[49]=s=>a.value.promoStartAt=s),type:"datetime-local",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.promoStartAt]])]),t("div",null,[e[132]||(e[132]=t("label",{class:"text-sm font-medium text-slate-600"},"Tamat",-1)),m(t("input",{"onUpdate:modelValue":e[50]||(e[50]=s=>a.value.promoEndAt=s),type:"datetime-local",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.promoEndAt]])])]),et.value?(o(),n("p",so," Harga promosi mesti lebih rendah daripada harga biasa (RM"+r(Number(a.value.price||0).toFixed(2))+"). Jika tidak, ia akan diabaikan. ",1)):b("",!0)]),t("div",null,[e[136]||(e[136]=t("label",{class:"text-sm font-medium text-slate-600"},"Cara Penyerahan",-1)),m(t("select",{"onUpdate:modelValue":e[51]||
7(e[51]=s=>a.value.kind=s),class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},[(o(),n(x,null,h(Pe,s=>t("option",{key:s.value,value:s.value},r(s.label),9,lo)),64))],512),[[$,a.value.kind]]),a.value.kind==="physical"&&!w.value?(o(),n("p",ao,[...e[135]||(e[135]=[d(" Barang fizikal sedang ",-1),t("b",null,"DITUTUP",-1),d(" â poster ini akan disembunyikan dari Edu Mall sehingga anda membuka suis di tab Kategori. ",-1)])])):a.value.kind==="physical"?(o(),n("p",oo," Barang fizikal â alamat penghantaran belum dikumpul, jadi admin perlu hubungi pembeli. ")):b("",!0)]),t("div",null,[e[137]||(e[137]=t("label",{class:"text-sm font-medium text-slate-600"},"Section (kategori)",-1)),e[138]||(e[138]=t("p",{class:"mt-0.5 text-xs text-slate-400"}," Boleh pilih lebih daripada satu. Section yang tiada poster tersembunyi sendiri. ",-1)),U.value.length?(o(),n("div",no,[(o(!0),n(x,null,h(U.value,s=>(o(),n("button",{key:s.id,type:"button",class:y(["inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-bold transition",(a.value.categoryIds||[]).includes(s.id)?"border-transparent text-white":"border-slate-200 bg-white text-slate-500 hover:bg-slate-50"]),style:we((a.value.categoryIds||[]).includes(s.id)?{background:s.colour||"#2E5AF0"}:{}),onClick:i=>pt(s.id)},[D(Ce,{name:s.icon,class:"h-3.5 w-3.5"},null,8,["name"]),d(" "+r(s.name),1)],14,ro))),128))])):(o(),n("p",io," Tiada kategori lagi. Tambah di tab Kategori. "))]),t("div",null,[e[139]||(e[139]=t("label",{class:"text-sm font-medium text-slate-600"},"Tag carian",-1)),m(t("input",{"onUpdate:modelValue":e[52]||(e[52]=s=>a.value.tags=s),placeholder:"cth: spm, matematik, tingkatan4",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.tags]]),e[140]||(e[140]=t("p",{class:"mt-1 text-xs text-slate-400"},"Pisahkan dengan koma. Digunakan oleh carian di halaman Edu Mall.",-1))]),t("div",uo,[t("div",null,[e[141]||(e[141]=t("label",{class:"text-sm font-medium text-slate-600"},"Kuota Tempat",-1)),m(t("input",{"onUpdate:modelValue":e[53]||(e[53]=s=>a.value.groupSize=s),type:"number",min:"0",placeholder:"kosong = tiada had",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.groupSize,void 0,{number:!0}]]),e[142]||(e[142]=t("p",{class:"mt-1 text-xs text-slate-400"},"Bila penuh, pembelian disekat dan pembeli boleh masuk senarai menunggu.",-1))]),t("div",null,[e[143]||(e[143]=t("label",{class:"text-sm font-medium text-slate-600"},"Tempoh akses bahan (hari)",-1)),m(t("input",{"onUpdate:modelValue":e[54]||(e[54]=s=>a.value.accessDays=s),type:"number",min:"0",placeholder:"kosong = tiada had",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.accessDays,void 0,{number:!0}]]),e[144]||(e[144]=t("p",{class:"mt-1 text-xs text-slate-400"},"Selepas tamat, bahan kelas tidak lagi dapat diakses pembeli.",-1))])]),t("div",po,[t("label",mo,[m(t("input",{"onUpdate:modelValue":e[55]||(e[55]=s=>a.value.isActive=s),type:"checkbox",class:"h-4 w-4 accent-blue-600"}
7,null,512),[[ke,a.value.isActive]]),e[145]||(e[145]=d(" Aktif ",-1))]),t("div",bo,[e[146]||(e[146]=t("label",{class:"text-sm font-medium text-slate-600"},"Susunan",-1)),m(t("input",{"onUpdate:modelValue":e[56]||(e[56]=s=>a.value.sortOrder=s),type:"number",class:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[v,a.value.sortOrder,void 0,{number:!0}]])])])]),t("div",co,[_.value?(o(),n("p",xo,[...e[147]||(e[147]=[d(" Muat naik media sedang berjalan. ",-1),t("strong",null,"Simpan dikunci",-1),d(" sehingga ia selesai â jika tidak, poster akan tersimpan ",-1),t("strong",null,"tanpa",-1),d(" video itu. ",-1)])])):X.value?(o(),n("p",vo,[...e[148]||(e[148]=[d(" Perubahan video / contoh nota ",-1),t("strong",null,"BELUM disimpan",-1),d(". Klik ",-1),t("strong",null,"Simpan",-1),d(" di bawah, jika tidak ia tidak akan berkuat kuasa. ",-1)])])):b("",!0),k.value?(o(),n("p",go,r(k.value),1)):b("",!0),t("div",fo,[t("button",{type:"button",class:y(["flex-1 rounded-xl py-2.5 text-sm font-semibold text-white disabled:cursor-not-allowed disabled:opacity-60",X.value&&!_.value?"animate-pulse bg-amber-500 hover:bg-amber-600":"bg-blue-600 hover:bg-blue-700"]),disabled:J.value||_.value,onClick:$e},r(Ye.value),11,yo),t("button",{type:"button",class:"rounded-xl border border-slate-200 px-5 py-2.5 text-sm font-semibold text-slate-600 disabled:cursor-not-allowed disabled:opacity-50",disabled:_.value,onClick:De},"Batal",8,ko)])])])])):b("",!0),D(Jt,{links:Me})])])]))}},No=Et(ho,[["__scopeId","data-v-c5d5101e"]]);export{No 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.