PageSourceSearch

https://www.fxgrow.com/_next/static/chunks/6398.7890a4d13862a8fd.js

js fxgrow.com collected 2026-10-08 16:43:04 UTC 11,904 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6398],{15074:(e,r,t)=>{t.d(r,{A:()=>i});var s=t(37876),a=t(8291);function i(e){let{children:r,className:t,maxWidth:i="6xl"}=e;return(0,s.jsx)("div",{className:(0,a.cn)("mx-auto px-4 py-6 sm:px-6","5xl"===i?"max-w-5xl":"max-w-6xl",t),children:r})}},26625:(e,r,t)=>{t.d(r,{p:()=>n});var s=t(37876),a=t(14232),i=t(8291);let n=a.forwardRef((e,r)=>{let{className:t,type:a,...n}=e;return(0,s.jsx)("input",{type:a,className:(0,i.cn)("flex h-13 min-h-13 w-full rounded-2xl border border-input bg-white px-3 py-2 text-sm text-gray-700  transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none","1 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n})});n.displayName="Input"},26921:(e,r,t)=>{t.d(r,{jK:()=>o,pi:()=>l,wU:()=>d});var s=t(94184);let a={create:"Created successfully",update:"Updated successfully",delete:"Deleted successfully",save:"Saved successfully"},i={create:"Failed to create",update:"Failed to update",delete:"Failed to delete",save:"Failed to save"};function n(e,r){return("string"==typeof e?e.trim():"")||r}function d(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"save";s.oR.success({description:n(e,a[r])})}function o(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"save";s.oR.error({description:n(e,i[r])})}function l(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"save";o(function(e){if(!e)return;let r="string"==typeof e.message?e.message.trim():"";return r||("string"==typeof e.error?e.error.trim():"")||void 0}(e),r)}},42416:(e,r,t)=>{t.d(r,{Ai:()=>i,ih:()=>a});let s=/[^a-z0-9\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+/g;function a(e){return e.trim().toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(s,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function i(e){return"string"==typeof e?{en:e.trim(),ar:""}:e&&"object"==typeof e&&!Array.isArray(e)&&("en"in e||"ar"in e)?{en:"string"==typeof e.en?e.en.trim():"",ar:"string"==typeof e.ar?e.ar.trim():""}:{en:"",ar:""}}},66553:(e,r,t)=>{t.d(r,{$B:()=>F,A2:()=>a,D_:()=>E,EG:()=>o,F9:()=>n,IZ:()=>A,LJ:()=>c,Lr:()=>f,Nf:()=>p,S6:()=>h,Uo:()=>u,Vf:()=>v,W9:()=>N,Wc:()=>y,Zi:()=>j,i6:()=>x,qO:()=>b,s1:()=>i,sm:()=>l,v8:()=>d,vd:()=>g,wH:()=>s,wl:()=>m,zs:()=>w});let s="mt-2 text-xs text-[var(--admin-text-muted)]",a="mt-1 block text-xs text-[var(--admin-danger)]",i="rounded-xl border border-[var(--admin-border)] bg-[var(--admin-surface)] p-6 text-sm text-[var(--admin-text-muted)]",n="mt-auto flex justify-end gap-2 border-t border-[var(--admin-border)] bg-[var(--admin-bg)] px-4 py-3",d="mb-5",o="font-normal text-[var(--admin-text-muted)]",l="cursor-pointer rounded-lg border-2 border-dashed border-[var(--admin-border)] p-6 text-center transition-colors hover:border-[var(--admin-accent)]",c="mx-auto mb-3 max-h-[220px] max-w-full rounded-md object-cover",u="m-0 text-sm text-[var(--admin-accent)]",m="mb-5 grid gap-4 sm:grid-cols-2",x="mb-5 grid gap-4 sm:grid-cols-2",f="h-9 w-full cursor-pointer rounded-md border border-input bg-white px-3 text-sm text-[var(--admin-text)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",p="min-h-[80px] w-full rounded-md border border-input bg-white px-3 py-2 text-sm text-[var(--admin-text)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",g="mb-3 grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-3",b="relative aspect-square overflow-visible",v="h-full w-full rounded-md border-2 border-[var(--admin-border)] object-cover",h="absolute -right-2 -top-2 flex h-[22px] w-[22px] cursor-pointer items-center justify-center rounded-full border-none bg-[var(--admin-danger)] text-[0.7rem] leading-none text-white transition-colors hover:bg-red-700",y="mb-4 overflow-hidden rounded-xl border border-[var(--admin-border)] bg-[var(--admin-surface)] shadow-sm transition-colors hover:border-[var(--admin-border-strong)]",j="opacity-60",w="flex cursor-pointer select-none items-center gap-2.5 px-4 py-3.5",N="border-t border-[var(--admin-border)] px-4 pb-4",F="inline-flex overflow-hidden rounded-lg border border-[var(--admin-border)]",A="cursor-pointer border-none bg-[var(--admin-surface)] px-3.5 py-1.5 text-[0.82rem] font-semibold text-[var(--admin-text-muted)] transition-colors first:border-r first:border-[var(--admin-border)]",E="bg-[var(--admin-accent)] text-[var(--admin-text-inverse)]"},67745:(e,r,t)=>{t.d(r,{A:()=>s});let s=(0,t(72821).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},72047:(e,r,t)=>{t.d(r,{Fc:()=>o,TN:()=>l});var s=t(37876),a=t(47137),i=t(14232),n=t(8291);let d=(0,a.F)("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-200 bg-green-50 text-green-800",warning:"border-amber-200 bg-amber-50 text-amber-900"}},defaultVariants:{variant:"default"}}),o=i.forwardRef((e,r)=>{let{className:t,variant:a,...i}=e;return(0,s.jsx)("div",{ref:r,role:"alert",className:(0,n.cn)(d({variant:a}),t),...i})});o.displayName="Alert",i.forwardRef((e,r)=>{let{className:t,...a}=e;return(0,s.jsx)("h5",{ref:r,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",t),...a})}).displayName="AlertTitle";let l=i.forwardRef((e,r)=>{let{className:t,...a}=e;return(0,s.jsx)("div",{ref:r,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",t),...a})});l.displayName="AlertDescription"},83373:(e,r,t)=>{t.d(r,{A:()=>a});var s=t(37876);
1function a(e){let{title:r,description:t,actions:a}=e;return(0,s.jsxs)("div",{className:"mb-6 flex flex-wrap items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"m-0 text-2xl font-bold text-[var(--admin-text)]",children:r}),t?(0,s.jsx)("p",{className:"mt-1 text-sm text-[var(--admin-text-muted)]",children:t}):null]}),a?(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:a}):null]})}},99295:(e,r,t)=>{t.r(r),t.d(r,{default:()=>N});var s=t(37876),a=t(14664),i=t(54287),n=t(67745),d=t(89099),o=t(14232),l=t(66553),c=t(15074),u=t(83373),m=t(87140),x=t(63727),f=t(19162),p=t(23156),g=t(26283),b=t(8291);function v(e){let{item:r,disabled:t=!1,onDelete:a}=e,n=(0,d.useRouter)(),{attributes:o,listeners:l,setNodeRef:c,transform:u,transition:m,isDragging:v}=(0,i.gl)({id:r.id,disabled:t});return(0,s.jsxs)("div",{ref:c,style:{transform:x.Ks.Transform.toString(u),transition:m},className:(0,b.cn)("flex flex-wrap items-center justify-between gap-3 rounded-lg border border-gray-200 bg-white p-4",v&&"z-10 border-primary/40 shadow-lg ring-2 ring-primary/20"),children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,s.jsx)(g.$,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 shrink-0 cursor-grab touch-none px-0 active:cursor-grabbing","aria-label":"Drag to reorder ".concat(r.title.en),disabled:t,...o,...l,children:(0,s.jsx)(f.A,{className:"h-4 w-4","aria-hidden":!0})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-gray-400",children:["#",r.sortOrder]}),(0,s.jsx)("h3",{className:"m-0 text-base font-semibold",children:r.title.en}),(0,s.jsx)(p.E,{variant:r.isPublished?"default":"outline",children:r.isPublished?"Published":"Draft"}),(0,s.jsx)(p.E,{variant:"outline",children:r.difficulty})]}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:r.summary.en}),(0,s.jsxs)("p",{className:"mt-0.5 text-xs text-gray-400",children:["/",r.slug.en]})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(g.$,{type:"button",variant:"outline",size:"sm",onClick:()=>n.push("/adminFx/courses/".concat(r.id,"/edit")),children:"Edit"}),(0,s.jsx)(g.$,{type:"button",variant:"destructive",size:"sm",onClick:()=>a(r),children:"Delete"})]})]})}var h=t(72047),y=t(26625),j=t(26921),w=t(1630);function N(){let e=(0,d.useRouter)(),[r,t]=(0,o.useState)([]),[x,f]=(0,o.useState)(!0),[p,b]=(0,o.useState)(""),[N,F]=(0,o.useState)(""),[A,E]=(0,o.useState)(!1),D=(0,o.useCallback)(async()=>{f(!0),b("");try{let e=await fetch("/api/admin/education-courses"),r=await e.json();if(!r.success)throw Error(r.message||"Failed to fetch courses");t(r.items||[])}catch(e){b(e instanceof Error?e.message:"Failed to fetch courses")}finally{f(!1)}},[]);(0,o.useEffect)(()=>{D()},[D]);let S=N.trim().length>0,k=(0,o.useMemo)(()=>{let e=N.trim().toLowerCase();return e?r.filter(r=>[r.title.en,r.title.ar,r.slug.en,r.difficulty].join(" ").toLowerCase().includes(e)):r},[r,N]),C=(0,a.FR)((0,a.MS)(a.AN,{activationConstraint:{distance:8}}),(0,a.MS)(a.uN,{coordinateGetter:i.JR})),R=async(e,r)=>{E(!0);try{let s=await fetch("/api/admin/education-courses",{method:"PATCH",headers:{"Content-Type":"application/json","X-Admin-Username":sessionStorage.getItem("adminUsername")||""},body:JSON.stringify({coursesOrder:e})}),a=await s.json();if(!a.success){t(r),(0,j.pi)(a,"update");return}t(a.items||r),(0,j.wU)(a.message||"Course order updated","update")}catch(e){t(r),(0,j.jK)(e instanceof Error?e.message:"Failed to reorder courses","update")}finally{E(!1)}},z=async e=>{if(confirm('Delete "'.concat(e.title.en,'"?')))try{let r=await fetch("/api/admin/education-courses?id=".concat(encodeURIComponent(e.id)),{method:"DELETE",headers:{"X-Admin-Username":sessionStorage.getItem("adminUsername")||""}}),t=await r.json();if(!t.success)return void(0,j.pi)(t,"delete");(0,j.wU)(t.message||"Deleted","delete"),await D()}catch(e){(0,j.jK)(e instanceof Error?e.message:"Delete failed","delete")}};return(0,s.jsxs)(c.A,{children:[(0,s.jsx)(u.A,{title:"Education courses",description:"Manage Education Hub courses (JSON-backed, draft by default).",actions:(0,s.jsx)(g.$,{type:"button",onClick:()=>e.push("/adminFx/courses/new"),children:"New course"})}),(0,s.jsx)(m.A,{importKind:"course",downloadKinds:["course","lesson","quiz"],onApply:r=>{sessionStorage.setItem(w.dt,JSON.stringify(r)),e.push("/adminFx/courses/new")},hint:"Import a course file to open New course with the form filled (not saved). Lesson and quiz files belong inside a course — open a course, then Add lesson or Add quiz."}),(0,s.jsx)("div",{className:"mb-4 flex items-center gap-2",children:(0,s.jsxs)("div",{className:"relative max-w-sm flex-1 justify-center",children:[(0,s.jsx)(n.A,{className:"absolute left-2 top-4 h-4 w-4 text-gray-400"}),(0,s.jsx)(y.p,{className:"pl-8",placeholder:"Search courses…",value:N,onChange:e=>F(e.target.value)})]})}),S?(0,s.jsx)("p",{className:"mb-3 text-sm text-gray-500",children:"Drag-and-drop reordering is disabled 
1while search is active."}):null,p?(0,s.jsx)(h.Fc,{variant:"destructive",className:"mb-4",children:(0,s.jsx)(h.TN,{children:p})}):null,x?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Loading…"}):0===k.length?(0,s.jsx)("p",{className:l.s1,children:"No courses found."}):S?(0,s.jsx)("div",{className:"space-y-3",children:k.map(e=>(0,s.jsx)(v,{item:e,disabled:!0,onDelete:e=>void z(e)},e.id))}):(0,s.jsx)(a.Mp,{sensors:C,collisionDetection:a.fp,onDragEnd:e=>{let{active:s,over:a}=e;if(!a||s.id===a.id||S||A)return;let n=r.findIndex(e=>e.id===s.id),d=r.findIndex(e=>e.id===a.id);if(n<0||d<0)return;let o=(0,i.be)(r,n,d).map((e,r)=>({...e,sortOrder:r+1}));t(o),R(o.map(e=>e.id),r)},children:(0,s.jsx)(i.gB,{items:r.map(e=>e.id),strategy:i._G,children:(0,s.jsx)("div",{className:"space-y-3",children:r.map(e=>(0,s.jsx)(v,{item:e,disabled:A,onDelete:e=>void z(e)},e.id))})})})]})}}}]);

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.