PageSourceSearch

https://plant4growthuk-production-a1cd.up.railway.app/static/js/5372.07eca0e5.chunk.js

js plant4growthuk-production-a1cd.up.railway.app collected 2026-10-03 12:14:29 UTC 63,653 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[5372],{1654(e,a,s){s.d(a,{d:()=>c});var l=s(9379),t=s(3986),r=s(5043),i=s(7943),o=s(9766),n=s(579);const d=["className"],c=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,d);return(0,n.jsx)(i.bL,(0,l.A)((0,l.A)({className:(0,o.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s)},r),{},{ref:a,children:(0,n.jsx)(i.zi,{className:(0,o.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});c.displayName=i.bL.displayName},4370(e,a,s){s.d(a,{TR:()=>C,bq:()=>b,eb:()=>k,gC:()=>w,l6:()=>j,mi:()=>R,s3:()=>f,yv:()=>N});var l=s(9379),t=s(3986),r=s(5043),i=s(962),o=s(6210),n=s(2382),d=s(5711),c=s(9766),m=s(579);const u=["className","children"],g=["className"],h=["className"],p=["className","children","position"],x=["className"],v=["className","children"],y=["className"],j=i.bL,f=i.YJ,N=i.WT,b=r.forwardRef((e,a)=>{let{className:s,children:r}=e,o=(0,t.A)(e,u);return(0,m.jsxs)(i.l9,(0,l.A)((0,l.A)({ref:a,className:(0,c.cn)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s)},o),{},{children:[r,(0,m.jsx)(i.In,{asChild:!0,children:(0,m.jsx)(n.A,{className:"h-4 w-4 opacity-50"})})]}))});b.displayName=i.l9.displayName;const _=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,g);return(0,m.jsx)(i.PP,(0,l.A)((0,l.A)({ref:a,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s)},r),{},{children:(0,m.jsx)(d.A,{className:"h-4 w-4"})}))});_.displayName=i.PP.displayName;const A=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,h);return(0,m.jsx)(i.wn,(0,l.A)((0,l.A)({ref:a,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s)},r),{},{children:(0,m.jsx)(n.A,{className:"h-4 w-4"})}))});A.displayName=i.wn.displayName;const w=r.forwardRef((e,a)=>{let{className:s,children:r,position:o="popper"}=e,n=(0,t.A)(e,p);return(0,m.jsx)(i.ZL,{children:(0,m.jsxs)(i.UC,(0,l.A)((0,l.A)({ref:a,className:(0,c.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:o},n),{},{children:[(0,m.jsx)(_,{}),(0,m.jsx)(i.LM,{className:(0,c.cn)("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,m.jsx)(A,{})]}))})});w.displayName=i.UC.displayName;const C=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,x);return(0,m.jsx)(i.JU,(0,l.A)({ref:a,className:(0,c.cn)("px-2 py-1.5 text-sm font-semibold",s)},r))});C.displayName=i.JU.displayName;const k=r.forwardRef((e,a)=>{let{className:s,children:r}=e,n=(0,t.A)(e,v);return(0,m.jsxs)(i.q7,(0,l.A)((0,l.A)({ref:a,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s)},n),{},{children:[(0,m.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,m.jsx)(i.VF,{children:(0,m.jsx)(o.A,{className:"h-4 w-4"})})}),(0,m.jsx)(i.p4,{children:r})]}))});k.displayName=i.q7.displayName;const R=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,y);
1return(0,m.jsx)(i.wv,(0,l.A)({ref:a,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",s)},r))});R.displayName=i.wv.displayName},5228(e,a,s){s.d(a,{V:()=>h});var l=s(9379),t=s(3986),r=(s(5043),s(9463)),i=s(8326),o=s(9277),n=s(9766),d=s(3390),c=s(579);const m=["className","classNames","showOutsideDays"],u=["className"],g=["className"];function h(e){let{className:a,classNames:s,showOutsideDays:h=!0}=e,p=(0,t.A)(e,m);return(0,c.jsx)(o.hv,(0,l.A)({showOutsideDays:h,className:(0,n.cn)("p-3",a),classNames:(0,l.A)({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:(0,n.cn)((0,d.r)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:(0,n.cn)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===p.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:(0,n.cn)((0,d.r)({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible"},s),components:{IconLeft:e=>{let{className:a}=e,s=(0,t.A)(e,u);return(0,c.jsx)(r.A,(0,l.A)({className:(0,n.cn)("h-4 w-4",a)},s))},IconRight:e=>{let{className:a}=e,s=(0,t.A)(e,g);return(0,c.jsx)(i.A,(0,l.A)({className:(0,n.cn)("h-4 w-4",a)},s))}}},p))}h.displayName="Calendar"},5372(e,a,s){s.r(a),s.d(a,{default:()=>O});var l=s(9379),t=s(5043),r=s(9970),i=s(1140),o=s(3390),n=s(2264),d=s(9938),c=s(3416),m=s(5949),u=s(1654),g=s(5598),h=s(9690),p=s(4370),x=s(5395),v=s(5228),y=s(8615),j=s(4980),f=s(7584),N=s(6328),b=s(2764),_=s(2054),A=s(2024),w=s(6533),C=s(8646),k=s(764),R=s(4651),U=s(5087),P=s(1680),L=s(67),E=s(1360),T=s(9855),J=s(797),z=s(614),S=s(579);const D="#0B1F3A",$="#C9A84C",B="#41EAD4",M=e=>{let{progress:a,fileName:s,isUploading:l}=e;return l?(0,S.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,S.jsxs)("div",{className:"flex items-center justify-between text-xs text-slate-600",children:[(0,S.jsx)("span",{className:"truncate max-w-[200px]",children:s||"Uploading..."}),(0,S.jsxs)("span",{className:"font-medium",children:[Math.round(a),"%"]})]}),(0,S.jsx)(x.k,{value:a,className:"h-2"}),a<100&&(0,S.jsx)("p",{className:"text-xs text-slate-500",children:"Please wait, uploading..."}),100===a&&(0,S.jsxs)("p",{className:"text-xs text-green-600 flex items-center gap-1",children:[(0,S.jsx)(_.A,{className:"w-3 h-3"})," Processing..."]})]}):null},F=e=>{if(e.type&&""!==e.type)return e.type;return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",heic:"image/heic",heif:"image/heif",svg:"image/svg+xml",bmp:"image/bmp",mp4:"video/mp4",mov:"video/quicktime",webm:"video/webm",avi:"video/x-msvideo"}[e.name.toLowerCase().split(".").pop()]||"application/octet-stream"},I={slug:"",linked_course_id:"",category:"",is_active:!0,is_featured:!1,is_sold_out:!1,display_order:0,card:{title:"",subtitle:"",description:"",duration:"",type:"",color_scheme:"teal",icon:"target",image_url:"",date:""},hero:{title:"",subtitle:"",badge_text:"",trust_badges:[],cta_book_text:"Book Your Place",cta_advisor_text:"Speak to Course Advisor",hero_image_url:""},overview:{video_url:"",video_thumbnail_url:"",course_type:"",duration:"",cpd_hours:"",max_delegates:"",description:""},academy:{academy_video_url:"",academy_video_thumbnail_url:"",academy_title:"World-Class Training Facility",academy_description:"",academy_features:[]},about:{who_its_for:[],learning_outcomes:[],curriculum:[]},gallery:{academy_images:[],case_results:[]},testimonials:[],booking:{full_price:0,deposit_amount:1e3,vat_rate:20,monthly_payment_enabled:!1,monthly_amount:0,monthly_duration_months:0,monthly_note:"",ghl_advisor_calendar_url:"",ghl_direct_booking_url:"",upcoming_dates:[]},seo:{meta_title:"",meta_description:"",og_image_url:""}},O=()=>{var e,a,s,x,O,V,W,q,H,Z,X,G,Y,K;const[Q,ee]=(0,t.useState)([]),[ae,se]=(0,t.useState)([]),[le,te]=(0,t.useState)(!0),[re,ie]=(0,t.useState)(!1),[oe,ne]=(0,t.useState)(!1),[de,ce]=(0,t.useState)(null),[me,ue]=(0,t.useState)(I),[ge,he]=(0,t.useState)("basic"),[pe,xe]=(0,t.useState)({}),[ve,ye]=(0,t.useState)({}),[je,fe]=(0,t.useState)({});(0,t.useRef)(null);(0,t.useEffect)(()=>{Ne(),be()},[]);const Ne=async()=>{try{te(!0);const e=await j.WZ.getAll();ee(e.data.programmes||[])}catch(e){console.error("Error fetching programmes:",e),N.oR.error("Failed to load programmes")}finally{te(!1)}},be=async()=>{try{const e=await j.BP.getAll();se(e.data||[])}catch(e){console.error("Failed to load courses",e)}},_e=()=>{ce(null),ue(I),he("basic"),ne(!0)},Ae=(e,a)=>{const s=e.split(".");ue(e=>{const t=(0,l.A)({},e);let r=t;for(let a=0;a<s.length-1;a++)r[s[a]]=(0,l.A)({},r[s[a]]),r=r[s[a]];return r[s[s.length-1]]=a,t})},we=(e,a)=>{const s=e.split(".");ue(e=>{const t=(0,l.A)({},e);let r=t;for(let a=0;a<s.length-1;a++)r[s[a]]=(0,l.A)({},r[s[a]]),r=r[s[a]];return r[s[s.length-1]]=[...r[s[s.length-1]]||[],a],t})},Ce=(e,a)=>{const s=e.split(".");ue(e=>{const t=(0,l.A)({},e);let r=t;for(let a=0;a<s.length-1;a++)r[s[a]]=(0,l.A)({},r[s[a]]),r=r[s[a]];return r[s[s.length-1]]=r[s[s.length-1]].filter((e,s)=>s!==a),t})},ke=(e,a,s)=>{const t=e.split(".");ue(e=>{const r=(0,l.A)({},e);let i=r;for(let a=0;a<t.length-1;a++)i[t[a]]=(0,l.A)({},i[t[a]]),i=i[t[a]];const o=[...i[t[t.length-1]]];return o[a]=s,i[t[t.length-1]]=o,r})},Re=e=>{let{fieldPath:a,uploadType:s="image",currentUrl:t,label:r}=e;const i="file-".concat(a.replace(/\./g,"-")),c=pe[a],m=ve[a]||0,u=je[a]||"";return(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:r}),(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsx)(n.p,{value:t||"",onChange:e=>Ae(a,e.target.value),placeholder:"".concat("video"===s?"Video":"Image"," URL"),className:"flex-1",disabled:c}),(0,S.jsx)("input",{id:i,type:"file",accept:"video"===s?"video/*":"image/*",className:"hidden",onChange:e=>{var t;const r=null===(t=e.target.files)||void 0===t?void 0:t[0];r&&async function(e,a){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image";if(null===de||void 0===de||!de.programme_id)return void N.oR.error("Please save the programme first before uploading media");const t=a;xe(e=>(0,l.A)((0,l.A)({},e),{},{[t]:!0})),ye(e=>(0,l.A)((0,l.A)({},e),{},{[t]:0})),fe(a=>(0,l.A)((0,l.A)({},a),{},{[t]:e.name}));try{const r=F(e),i=await j.WZ.getPresignedUploadUrl(de.programme_id,{filename:e.name,content_type:r,upload_type:s,file_size:e.size}),{presigned_url:o,public_url:n}=i.data;await new Promise((a,s)=>{const i=new XMLHttpRequest;i.upload.addEventListener("progress",e=>{if(e.lengthComputable){const a=e.loaded/e.total*100;ye(e=>(0,l.A)((0,l.A)({},e),{},{[t]:a}))}}),i.addEventListener("load",()=>{i.status>=200&&i.status<300?a():s(new Error("Upload failed with status ".concat(i.status)))}),i.addEventListener("error",()=>s(new Error("Upload failed"))),i.addEventListener("abort",()=>s(new Error("Upload aborted"))),i.open("PUT",o),i.setRequestHeader("Content-Type",r),i.send(e)});const d=a.split(".");ue(e=>{const a=(0,l.A)({},e);let s=a;for(let t=0;t<d.length-1;t++)s[d[t]]=(0,l.A)({},s[d[t]]),s=s[d[t]];return s[d[d.length-1]]=n,a}),N.oR.success("File uploaded successfully")}catch(o){var r,i;console.error("Error uploading file:",o);const e=(null===o||void 0===o||null===(r=o.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.detail)||(null===o||void 0===o?void 0:o.message)||"Failed to upload file";N.oR.error(e)}finally{xe(e=>(0,l.A)((0,l.A)({},e),{},{[t]:!1})),ye(e=>(0,l.A)((0,l.A)({},e),{},{[t]:0})),fe(e=>(0,l.A)((0,l.A)({},e),{},{[t]:""}))}}(r,a,s),e.target.value=""}}),(0,S.jsx)(o.$,{type:"button",variant:"outline",size:"icon",disabled:c||!de,onClick:()=>{var e;return null===(e=document.getElementById(i))||void 0===e?void 0:e.click()},children:c?(0,S.jsx)(A.A,{className:"w-4 h-4 animate-spin"}):(0,S.jsx)(J.A,{className:"w-4 h-4"})})]}),(0,S.jsx)(M,{progress:m,fileName:u,isUploading:c}),t&&!c&&(0,S.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,S.jsx)(_.A,{className:"w-4 h-4 text-green-500"}),(0,S.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"truncate hover:underline",children:t.split("/").pop()})]})]})};return(0,S.jsx)(r.NI,{children:(0,S.jsxs)("div",{className:"space-y-6",children:[(0,S.jsxs)("div",{className:"flex justify-between items-center",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("h1",{className:"text-2xl font-bold text-[#0D1B2A]",children:"Programmes"}),(0,S.jsx)("p",{className:"text-gray-500",children:"Manage your course programme pages"})]}),(0,S.jsxs)(o.$,{onClick:_e,className:"bg-[#41EAD4] text-[#0D1B2A] hover:bg-[#35c4b0]",children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Programme"]})]}),le?(0,S.jsx)("div",{className:"flex justify-center py-12",children:(0,S.jsx)(A.A,{className:"w-8 h-8 animate-spin text-gray-400"})}):(0,S.jsxs)(h.tU,{defaultValue:"active",className:"w-full",children:[(0,S.jsxs)(h.j7,{className:"mb-6",children:[(0,S.jsxs)(h.Xi,{value:"active",className:"gap-2",children:["Active",(0,S.jsx)(m.E,{variant:"secondary",className:"ml-1",children:Q.filter(e=>e.is_active&&!e.is_sold_out).length})]}),(0,S.jsxs)(h.Xi,{value:"sold_out",className:"gap-2",children:["Sold Out",(0,S.jsx)(m.E,{variant:"secondary",className:"ml-1",children:Q.filter(e=>e.is_sold_out).length})]}),(0,S.jsxs)(h.Xi,{value:"upcoming",className:"gap-2",children:["Upcoming",(0,S.jsx)(m.E,{variant:"secondary",className:"ml-1",children:Q.filter(e=>!e.is_active&&!e.is_sold_out).length})]})]}),[{key:"active",filter:e=>e.is_active&&!e.is_sold_out,emptyText:"No active programmes."},{key:"sold_out",filter:e=>e.is_sold_out,emptyText:"No sold out programmes."},{key:"upcoming",filter:e=>!e.is_active&&!e.is_sold_out,emptyText:"No upcoming programmes."}].map(e=>{let{key:a,filter:s,emptyText:t}=e;const r=Q.filter(s);return(0,S.jsx)(h.av,{value:a,children:0===r.length?(0,S.jsx)(i.Zp,{children:(0,S.jsxs)(i.Wu,{className:"py-12 text-center",children:[(0,S.jsx)(P.A,{className:"w-12 h-12 mx-auto mb-4 text-gray-300"}),(0,S.jsx)("p",{className:"text-gray-500 mb-4",children:t}),"active"===a&&(0,S.jsxs)(o.$,{onClick:_e,variant:"outline",children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Create Your First Programme"]})]})}):(0,S.jsx)("div",{className:"grid gap-4",children:r.map(e=>{var a,s,t,r,n;return(0,S.jsx)(i.Zp,{className:"".concat(e.is_active?"":"opacity-60"),children:(0,S.jsx)(i.Wu,{className:"py-4",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-4",children:[(0,S.jsx)("div",{className:"w-12 h-12 rounded-lg overflow-hidden flex items-center justify-center flex-shrink-0",style:{backgroundColor:"gold"===(null===(a=e.card)||void 0===a?void 0:a.color_scheme)?$:B},children:null!==(s=e.card)&&void 0!==s&&s.image_url?(0,S.jsx)("img",{src:(0,f.S)(e.card.image_url),alt:(null===(t=e.card)||void 0===t?void 0:t.t
1itle)||e.slug,className:"w-full h-full object-cover"}):(0,S.jsx)(P.A,{className:"w-6 h-6",style:{color:D}})}),(0,S.jsxs)("div",{children:[(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("h3",{className:"font-semibold text-[#0D1B2A]",children:(null===(r=e.card)||void 0===r?void 0:r.title)||e.slug}),e.category&&(0,S.jsx)(m.E,{className:"bg-slate-100 text-slate-700 capitalize",children:e.category.replace(/_/g," ")}),e.is_featured&&(0,S.jsx)(m.E,{className:"bg-amber-100 text-amber-800",children:"Featured"}),e.is_sold_out&&(0,S.jsx)(m.E,{className:"bg-red-100 text-red-700",children:"Sold Out"}),!e.is_active&&!e.is_sold_out&&(0,S.jsx)(m.E,{variant:"secondary",children:"Inactive"})]}),(0,S.jsxs)("p",{className:"text-sm text-gray-500",children:["/programmes/",e.slug]}),(null===(n=e.card)||void 0===n?void 0:n.date)&&(0,S.jsxs)("p",{className:"text-sm text-[#41EAD4] font-medium mt-1",children:[(0,S.jsx)(C.A,{className:"w-3 h-3 inline mr-1"}),new Date(e.card.date).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})]})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("a",{href:"/programmes/".concat(e.slug),target:"_blank",rel:"noopener noreferrer",className:"p-2 hover:bg-gray-100 rounded-lg",children:(0,S.jsx)(k.A,{className:"w-4 h-4 text-gray-500"})}),(0,S.jsx)(o.$,{variant:"ghost",size:"icon",onClick:()=>(async e=>{try{await j.WZ.toggleActive(e.programme_id),N.oR.success("Programme ".concat(e.is_active?"deactivated":"activated")),Ne()}catch(a){console.error("Error toggling programme:",a),N.oR.error("Failed to update programme status")}})(e),children:e.is_active?(0,S.jsx)(U.A,{className:"w-4 h-4 text-green-600"}):(0,S.jsx)(R.A,{className:"w-4 h-4 text-gray-400"})}),(0,S.jsx)(o.$,{variant:"ghost",size:"icon",onClick:()=>(e=>{ce(e),ue((0,l.A)((0,l.A)((0,l.A)({},I),e),{},{card:(0,l.A)((0,l.A)({},I.card),e.card),hero:(0,l.A)((0,l.A)({},I.hero),e.hero),overview:(0,l.A)((0,l.A)({},I.overview),e.overview),about:(0,l.A)((0,l.A)({},I.about),e.about),gallery:(0,l.A)((0,l.A)({},I.gallery),e.gallery),booking:(0,l.A)((0,l.A)({},I.booking),e.booking),seo:(0,l.A)((0,l.A)({},I.seo),e.seo)})),he("basic"),ne(!0)})(e),children:(0,S.jsx)(w.A,{className:"w-4 h-4"})}),(0,S.jsx)(o.$,{variant:"ghost",size:"icon",onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this programme?"))try{await j.WZ.delete(e),N.oR.success("Programme deleted"),Ne()}catch(a){console.error("Error deleting programme:",a),N.oR.error("Failed to delete programme")}})(e.programme_id),children:(0,S.jsx)(T.A,{className:"w-4 h-4 text-red-500"})})]})]})})},e.programme_id)})})},a)})]}),(0,S.jsx)(g.lG,{open:oe,onOpenChange:ne,children:(0,S.jsxs)(g.Cf,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,S.jsx)(g.c7,{children:(0,S.jsx)(g.L3,{children:de?"Edit Programme":"Create Programme"})}),(0,S.jsxs)(h.tU,{value:ge,onValueChange:he,children:[(0,S.jsxs)(h.j7,{className:"grid grid-cols-6 w-full",children:[(0,S.jsx)(h.Xi,{value:"basic",children:"Basic"}),(0,S.jsx)(h.Xi,{value:"hero",children:"Hero"}),(0,S.jsx)(h.Xi,{value:"content",children:"Content"}),(0,S.jsx)(h.Xi,{value:"academy",children:"Academy"}),(0,S.jsx)(h.Xi,{value:"gallery",children:"Gallery"}),(0,S.jsx)(h.Xi,{value:"booking",children:"Booking"}),(0,S.jsx)(h.Xi,{value:"seo",children:"SEO"})]}),(0,S.jsxs)(h.av,{value:"basic",className:"space-y-4 mt-4",children:[(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Slug (URL) *"}),(0,S.jsx)(n.p,{value:me.slug,onChange:e=>Ae("slug",e.target.value.toLowerCase().replace(/\s+/g,"-")),placeholder:"my-programme","data-testid":"programme-slug-input"}),(0,S.jsxs)("p",{className:"text-xs text-gray-500",children:["/programmes/",me.slug||"your-slug"]}),de&&(0,S.jsxs)("p",{className:"text-xs text-amber-600",children:["Heads up: changing the slug will break existing links/bookmarks to ",(0,S.jsxs)("code",{children:["/programmes/",de.slug]}),"."]})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Display Order"}),(0,S.jsx)(n.p,{type:"number",value:me.display_order,onChange:e=>Ae("display_order",parseInt(e.target.value)||0)})]})]}),(0,S.jsxs)("div",{className:"flex gap-6 flex-wrap",children:[(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(u.d,{checked:me.is_active,onCheckedChange:e=>Ae("is_active",e)}),(0,S.jsx)(d.J,{children:"Active"})]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(u.d,{checked:me.is_featured,onCheckedChange:e=>Ae("is_featured",e)}),(0,S.jsx)(d.J,{children:"Featured"})]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(u.d,{checked:me.is_sold_out,onCheckedChange:e=>Ae("is_sold_out",e)}),(0,S.jsx)(d.J,{className:"text-red-600 font-medium",children:"Sold Out"})]})]}),me.is_sold_out&&(0,S.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,S.jsxs)("p",{className:"text-sm text-red-700",children:[(0,S.jsx)("strong",{children:"Sold Out:"}),' This programme will be displayed with a red "Sold Out" badge and users won\'t be able to make payments.']})}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Linked Course (for enrollment after payment)"}),(0,S.jsxs)(p.l6,{value:me.linked_course_id||"none",onValueChange:e=>Ae("linked_course_id","none"===e?"":e),children:[(0,S.jsx)(p.bq,{children:(0,S.jsx)(p.yv,{placeholder:"Select a course..."})}),(0,S.jsxs)(p.gC,{children:[(0,S.jsx)(p.eb,{value:"none",children:"\u2014 No course linked \u2014"}),ae.map(e=>(0,S.jsx)(p.eb,{value:e.course_id,children:e.title},e.course_id))]})]}),(0,S.jsx)("p",{className:"text-xs text-gray-500",children:"When a user pays for this programme, they will be automatically enrolled in the selected course."})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Landing Page Category Tab"}),(0,S.jsxs)(p.l6,{value:me.category||"none",onValueChange:e=>Ae("category","none"===e?"":e),children:[(0,S.jsx)(p.bq,{children:(0,S.jsx)(p.yv,{})}),(0,S.jsxs)(p.gC,{children:[(0,S.jsx)(p.eb,{value:"none",children:"\u2014 No category \u2014"}),(0,S.jsx)(p.eb,{value:"dental_implantology",children:"Dental Implantology Courses"}),(0,S.jsx)(p.eb,{value:"business_dentistry",children:"Business Dentistry"}),(0,S.jsx)(p.eb,{value:"biological_clinician",children:"Biological Clinician Courses"})]})]}),(0,S.jsx)("p",{className:"text-xs text-gray-500",children:"Assign this programme to a tab on the Courses page. Only programmes with a category are shown in the tabs."})]}),(0,S.jsxs)("div",{className:"border-t pt-4 mt-4",children:[(0,S.jsx)("h4",{className:"font-medium mb-4",children:"Card Display (Programmes List)"}),(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Card Title"}),(0,S.jsx)(n.p,{value:me.card.title,onChange:e=>Ae("card.title",e.target.value),placeholder:"Programme Title"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Card Subtitle"}),(0,S.jsx)(n.p,{value:me.card.subtitle,onChange:e=>Ae("card.subtitle",e.target.value),placeholder:"Short subtitle"})]})]}),(0,S.jsxs)("div",{className:"space-y-2 mt-4",children:[(0,S.jsx)(d.J,{children:"Card Description"}),(0,S.jsx)(c.T,{value:me.card.description,onChange:e=>Ae("card.description",e.target.value),placeholder:"Brief description for the card",rows:2})]}),(0,S.jsxs)("div",{className:"grid grid-cols-3 gap-4 mt-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Duration"}),(0,S.jsx)(n.p,{value:me.card.duration,onChange:e=>Ae("card.duration",e.target.value),placeholder:"e.g., 2 Days"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Type"}
1),(0,S.jsx)(n.p,{value:me.card.type,onChange:e=>Ae("card.type",e.target.value),placeholder:"e.g., Clinical Training"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Color Scheme"}),(0,S.jsxs)(p.l6,{value:me.card.color_scheme,onValueChange:e=>Ae("card.color_scheme",e),children:[(0,S.jsx)(p.bq,{children:(0,S.jsx)(p.yv,{})}),(0,S.jsxs)(p.gC,{children:[(0,S.jsx)(p.eb,{value:"teal",children:"Teal"}),(0,S.jsx)(p.eb,{value:"gold",children:"Gold"})]})]})]})]}),(0,S.jsxs)("div",{className:"space-y-2 mt-4",children:[(0,S.jsx)(d.J,{children:"Programme Date"}),(0,S.jsxs)(y.AM,{modal:!0,children:[(0,S.jsx)(y.Wv,{asChild:!0,children:(0,S.jsxs)(o.$,{type:"button",variant:"outline",className:"w-full justify-start text-left font-normal h-12 cursor-pointer hover:bg-slate-50 ".concat(!me.card.date&&"text-muted-foreground"),children:[(0,S.jsx)(C.A,{className:"mr-3 h-5 w-5 text-[#41EAD4]"}),me.card.date?(0,S.jsx)("span",{className:"text-[#0D1B2A] font-medium",children:(0,b.GP)(new Date(me.card.date),"PPP")}):(0,S.jsx)("span",{children:"Select programme date"})]})}),(0,S.jsx)(y.hl,{className:"w-auto p-0 z-[9999]",align:"start",sideOffset:5,children:(0,S.jsx)(v.V,{mode:"single",selected:me.card.date?new Date(me.card.date):void 0,onSelect:e=>Ae("card.date",e?(0,b.GP)(e,"yyyy-MM-dd"):""),initialFocus:!0,className:"rounded-md border shadow-lg"})})]})]}),(0,S.jsxs)("div",{className:"space-y-2 mt-4",children:[(0,S.jsx)(d.J,{children:"Card Image"}),me.card.image_url&&(0,S.jsxs)("div",{className:"relative w-full h-40 rounded-lg overflow-hidden bg-slate-100 mb-2",children:[(0,S.jsx)("img",{src:(0,f.S)(me.card.image_url),alt:"Card preview",className:"w-full h-full object-cover"}),(0,S.jsx)(o.$,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 w-7 h-7",onClick:()=>Ae("card.image_url",""),children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]}),(0,S.jsx)(Re,{fieldPath:"card.image_url",label:"Card Image",currentUrl:me.card.image_url})]})]})]}),(0,S.jsxs)(h.av,{value:"hero",className:"space-y-4 mt-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Hero Title"}),(0,S.jsx)(n.p,{value:me.hero.title,onChange:e=>Ae("hero.title",e.target.value),placeholder:"Main headline"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Hero Subtitle"}),(0,S.jsx)(c.T,{value:me.hero.subtitle,onChange:e=>Ae("hero.subtitle",e.target.value),placeholder:"Supporting text under the headline",rows:2})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Badge Text"}),(0,S.jsx)(n.p,{value:me.hero.badge_text,onChange:e=>Ae("hero.badge_text",e.target.value),placeholder:"e.g., New Course"})]}),(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Book CTA Text"}),(0,S.jsx)(n.p,{value:me.hero.cta_book_text,onChange:e=>Ae("hero.cta_book_text",e.target.value),placeholder:"Book Your Place"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Advisor CTA Text"}),(0,S.jsx)(n.p,{value:me.hero.cta_advisor_text,onChange:e=>Ae("hero.cta_advisor_text",e.target.value),placeholder:"Speak to Course Advisor"})]})]}),(0,S.jsx)(Re,{fieldPath:"hero.hero_image_url",label:"Hero Image",currentUrl:me.hero.hero_image_url}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Trust Badges"}),(0,S.jsxs)("div",{className:"space-y-2",children:[null===(e=me.hero.trust_badges)||void 0===e?void 0:e.map((e,a)=>(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsx)(n.p,{value:e,onChange:e=>ke("hero.trust_badges",a,e.target.value),placeholder:"Badge text"}),(0,S.jsx)(o.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>Ce("hero.trust_badges",a),children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]},a)),(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:()=>we("hero.trust_badges",""),children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Badge"]})]})]})]}),(0,S.jsxs)(h.av,{value:"content",className:"space-y-6 mt-4",children:[(0,S.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,S.jsx)("h4",{className:"font-medium mb-4",children:"Overview Section"}),(0,S.jsxs)("div",{className:"space-y-4",children:[(0,S.jsx)(Re,{fieldPath:"overview.video_url",uploadType:"video",label:"Overview Video URL (YouTube/Vimeo embed URL)",currentUrl:me.overview.video_url}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Description"}),(0,S.jsx)(c.T,{value:me.overview.description,onChange:e=>Ae("overview.description",e.target.value),placeholder:"Course overview description",rows:3})]}),(0,S.jsxs)("div",{className:"grid grid-cols-4 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Course Type"}
1),(0,S.jsx)(n.p,{value:me.overview.course_type,onChange:e=>Ae("overview.course_type",e.target.value),placeholder:"e.g., Clinical"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Duration"}),(0,S.jsx)(n.p,{value:me.overview.duration,onChange:e=>Ae("overview.duration",e.target.value),placeholder:"e.g., 2 Days"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"CPD Hours"}),(0,S.jsx)(n.p,{value:me.overview.cpd_hours,onChange:e=>Ae("overview.cpd_hours",e.target.value),placeholder:"e.g., 16"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Max Delegates"}),(0,S.jsx)(n.p,{value:me.overview.max_delegates,onChange:e=>Ae("overview.max_delegates",e.target.value),placeholder:"e.g., 12"})]})]})]})]}),(0,S.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,S.jsx)("h4",{className:"font-medium mb-4",children:"About Section"}),(0,S.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,S.jsx)(d.J,{children:"Who It's For"}),null===(a=me.about.who_its_for)||void 0===a?void 0:a.map((e,a)=>(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsx)(n.p,{value:e,onChange:e=>ke("about.who_its_for",a,e.target.value),placeholder:"Target audience point"}),(0,S.jsx)(o.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>Ce("about.who_its_for",a),children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]},a)),(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:()=>we("about.who_its_for",""),children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Point"]})]}),(0,S.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,S.jsx)(d.J,{children:"Learning Outcomes"}),null===(s=me.about.learning_outcomes)||void 0===s?void 0:s.map((e,a)=>(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsx)(n.p,{value:e,onChange:e=>ke("about.learning_outcomes",a,e.target.value),placeholder:"Learning outcome"}),(0,S.jsx)(o.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>Ce("about.learning_outcomes",a),children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]},a)),(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:()=>we("about.learning_outcomes",""),children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Outcome"]})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Curriculum Modules"}),null===(x=me.about.curriculum)||void 0===x?void 0:x.map((e,a)=>{var s;return(0,S.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsx)(n.p,{value:e.label,onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{label:s.target.value});ke("about.curriculum",a,t)},placeholder:"Module title"}),(0,S.jsx)(o.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>Ce("about.curriculum",a),children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]}),(0,S.jsx)(c.T,{value:(null===(s=e.items)||void 0===s?void 0:s.join("\n"))||"",onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{items:s.target.value.split("\n").filter(e=>e.trim())});ke("about.curriculum",a,t)},placeholder:"Module items (one per line)",rows:3})]},a)}),(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:()=>we("about.curriculum",{label:"",items:[]}),children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Module"]})]})]})]}),(0,S.jsxs)(h.av,{value:"academy",className:"space-y-6 mt-4",children:[(0,S.jsxs)(i.Zp,{children:[(0,S.jsxs)(i.aR,{children:[(0,S.jsx)(i.ZB,{children:"Academy Video Section"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"Showcase your training facility with an academy tour video. Supports both portrait and landscape videos."})]}),(0,S.jsxs)(i.Wu,{className:"space-y-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Academy Section Title"}),(0,S.jsx)(n.p,{value:(null===(O=me.academy)||void 0===O?void 0:O.academy_title)||"",onChange:e=>Ae("academy.academy_title",e.target.value),placeholder:"World-Class Training Facility"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Academy Description"}),(0,S.jsx)(c.T,{value:(null===(V=me.academy)||void 0===V?void 0:V.academy_description)||"",onChange:e=>Ae("academy.academy_description",e.target.value),placeholder:"Experience our state-of-the-art facilities designed for hands-on clinical training...",rows:3})]}),(0,S.jsx)(Re,{fieldPath:"academy.academy_video_url",uploadType:"video",label:"Academy Tour Video (Portrait or Landscape)",currentUrl:null===(W=me.academy)||void 0===W?void 0:W.academy_video_url}),(0,S.jsx)(Re,{fieldPath:"academy.academy_video_thumbnail_url",uploadType:"image",label:"Video Thumbnail (Optional)",currentUrl:null===(q=me.academy)||void 0===q?void 0:q.academy_video_thumbnail_url})]})]}),(0,S.jsxs)(i.Zp,{children:[(0,S.jsxs)(i.aR,{children:[(0,S.jsx)(i.ZB,{children:"Academy Features"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:'Highlight 
1key features of your academy (e.g., "12 Treatment Rooms", "Latest Equipment")'})]}),(0,S.jsxs)(i.Wu,{className:"space-y-4",children:[((null===(H=me.academy)||void 0===H?void 0:H.academy_features)||[]).map((e,a)=>(0,S.jsxs)("div",{className:"flex gap-2 items-center bg-gray-50 p-3 rounded-lg",children:[(0,S.jsxs)("div",{className:"flex-1 grid grid-cols-2 gap-2",children:[(0,S.jsx)(n.p,{value:e.value||"",onChange:s=>{var t;const r=(0,l.A)((0,l.A)({},e),{},{value:s.target.value}),i=[...(null===(t=me.academy)||void 0===t?void 0:t.academy_features)||[]];i[a]=r,Ae("academy.academy_features",i)},placeholder:"12+"}),(0,S.jsx)(n.p,{value:e.label||"",onChange:s=>{var t;const r=(0,l.A)((0,l.A)({},e),{},{label:s.target.value}),i=[...(null===(t=me.academy)||void 0===t?void 0:t.academy_features)||[]];i[a]=r,Ae("academy.academy_features",i)},placeholder:"Treatment Rooms"})]}),(0,S.jsx)(o.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>{var e;const s=((null===(e=me.academy)||void 0===e?void 0:e.academy_features)||[]).filter((e,s)=>s!==a);Ae("academy.academy_features",s)},children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]},a)),(0,S.jsxs)(o.$,{type:"button",variant:"outline",onClick:()=>{var e;const a=[...(null===(e=me.academy)||void 0===e?void 0:e.academy_features)||[],{value:"",label:""}];Ae("academy.academy_features",a)},children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Feature"]})]})]})]}),(0,S.jsxs)(h.av,{value:"gallery",className:"space-y-6 mt-4",children:[!(null!==de&&void 0!==de&&de.programme_id)&&(0,S.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-4",children:(0,S.jsxs)("p",{className:"text-sm text-yellow-800",children:[(0,S.jsx)("strong",{children:"Note:"})," Please save the programme first before uploading images. You can add images after the initial save."]})}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Academy Images"}),(0,S.jsx)("div",{className:"grid grid-cols-3 gap-4",children:null===(Z=me.gallery.academy_images)||void 0===Z?void 0:Z.map((e,a)=>(0,S.jsxs)("div",{className:"relative",children:[(0,S.jsx)("div",{className:"aspect-video rounded-lg overflow-hidden bg-gray-100",children:e?(0,S.jsx)("img",{src:e,alt:"Academy ".concat(a+1),className:"w-full h-full object-cover"}):(0,S.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,S.jsx)(L.A,{className:"w-8 h-8 text-gray-300"})})}),(0,S.jsx)(o.$,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 w-6 h-6",onClick:()=>Ce("gallery.academy_images",a),children:(0,S.jsx)(z.A,{className:"w-3 h-3"})})]},a))}),(0,S.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,S.jsx)("input",{type:"file",id:"gallery-image-upload",accept:"image/*",className:"hidden",onChange:async e=>{var a;const s=null===(a=e.target.files)||void 0===a?void 0:a[0];if(s&&null!==de&&void 0!==de&&de.programme_id){const e="gallery.academy_images.new";xe(a=>(0,l.A)((0,l.A)({},a),{},{[e]:!0})),ye(a=>(0,l.A)((0,l.A)({},a),{},{[e]:0})),fe(a=>(0,l.A)((0,l.A)({},a),{},{[e]:s.name}));try{const a=F(s),t=await j.WZ.getPresignedUploadUrl(de.programme_id,{filename:s.name,content_type:a,upload_type:"image",file_size:s.size});await new Promise((r,i)=>{const o=new XMLHttpRequest;o.upload.addEventListener("progress",a=>{if(a.lengthComputable){const s=a.loaded/a.total*100;ye(a=>(0,l.A)((0,l.A)({},a),{},{[e]:s}))}}),o.addEventListener("load",()=>o.status>=200&&o.status<300?r():i()),o.addEventListener("error",()=>i(new Error("Upload failed"))),o.open("PUT",t.data.presigned_url),o.setRequestHeader("Content-Type",a),o.send(s)}),we("gallery.academy_images",t.data.public_url),N.oR.success("Image uploaded!")}catch(i){var t,r;const e=(null===i||void 0===i||null===(t=i.response)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.detail)||(null===i||void 0===i?void 0:i.message)||"Upload failed";N.oR.error(e)}finally{xe(a=>(0,l.A)((0,l.A)({},a),{},{[e]:!1})),ye(a=>(0,l.A)((0,l.A)({},a),{},{[e]:0})),fe(a=>(0,l.A)((0,l.A)({},a),{},{[e]:""}))}}e.target.value=""}}),(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsxs)(o.$,{type:"button",variant:"outline",disabled:!(null!==de&&void 0!==de&&de.programme_id)||pe["gallery.academy_images.new"],onClick:()=>{var e;return null===(e=document.getElementById("gallery-image-upload"))||void 0===e?void 0:e.click()},children:[pe["gallery.academy_images.new"]?(0,S.jsx)(A.A,{className:"w-4 h-4 mr-2 animate-spin"}):(0,S.jsx)(J.A,{className:"w-4 h-4 mr-2"}),"Upload Image"]}),(0,S.jsx)("span",{className:"text-gray-400 self-center",children:"or"}),(0,S.jsx)(n.p,{placeholder:"Paste image URL",onKeyDown:e=>{"Enter"===e.key&&e.target.value&&(we("gallery.academy_images",e.target.value),e.target.value="")},className:"flex-1"}),(0,S.jsx)(o.$,{type:"button",variant:"outline",onClick:()=>{const e=document.querySelector('input[placeholder="Paste image URL"]');null!==e&&void 0!==e&&e.value&&(we("gallery.academy_images",e.value),e.value="")},children:(0,S.jsx)(E.A,{className:"w-4 h-4"})})]}),(0,S.jsx)(M,{progress:ve["gallery.academy_images.new"]||0,fileName:je["gallery.academy_images.new"]||"",isUploading:pe["gallery.academy_images.new"]})]})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Case Results (Before/After)"}),null===(X=me.gallery.case_results)||void 0===X?void 0:X.map((e,a)=>(0,S.jsxs)("div",{className:"border rounded p-4 space-y-3 bg-gray-50",children:[(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsx)(n.p,{value:e.title,onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{title:s.target.value});ke("gallery.case_results",a,t)},placeholder:"Case title (e.g., Full Arch Restoration)"}),(0,S.jsx)(o.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>Ce("gallery.case_results",a),children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]}),(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{className:"text-sm text-gray-600",children:"Before"}),e.before_image_url&&(0,S.jsxs)("div",{className:"relative aspect-video rounded-lg overflow-hidden bg-gray-100",children:[(0,S.jsx)("img",{src:(0,f.S)(e.before_image_url),alt:"Before",className:"w-full h-full object-cover"}),(0,S.jsx)(o.$,{type:"button",variant:"destructive",size:"icon",className:"absolute top-1 right-1 w-5 h-5",onClick:()=>{const s=(0,l.A)((0,l.A)({},e),{},{before_image_url:""});ke("gallery.case_results",a,s)},children:(0,S.jsx)(z.A,{className:"w-3 h-3"})})]}),(0,S.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,S.jsx)("input",{type:"file",id:"case-before-".concat(a),accept:"image/*",className:"hidden",onChange:async s=>{var t;const r=null===(t=s.target.files)||void 0===t?void 0:t[0];if(r&&null!==de&&void 0!==de&&de.programme_id){const s="case.before.".concat(a);xe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:!0})),ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:0})),fe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:r.name}));try{const t=F(r),i=await j.WZ.getPresignedUploadUrl(de.programme_id,{filename:r.name,content_type:t,upload_type:"image",f
1ile_size:r.size});await new Promise((e,a)=>{const o=new XMLHttpRequest;o.upload.addEventListener("progress",e=>{if(e.lengthComputable){const a=e.loaded/e.total*100;ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:a}))}}),o.addEventListener("load",()=>o.status>=200&&o.status<300?e():a()),o.addEventListener("error",()=>a(new Error("Upload failed"))),o.open("PUT",i.data.presigned_url),o.setRequestHeader("Content-Type",t),o.send(r)});const o=(0,l.A)((0,l.A)({},e),{},{before_image_url:i.data.public_url});ke("gallery.case_results",a,o),N.oR.success("Before image uploaded!")}catch(n){var i,o;const e=(null===n||void 0===n||null===(i=n.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.detail)||(null===n||void 0===n?void 0:n.message)||"Upload failed";N.oR.error(e)}finally{xe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:!1})),ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:0})),fe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:""}))}}s.target.value=""}}),(0,S.jsxs)("div",{className:"flex gap-1",children:[(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",disabled:!(null!==de&&void 0!==de&&de.programme_id)||pe["case.before.".concat(a)],onClick:()=>{var e;return null===(e=document.getElementById("case-before-".concat(a)))||void 0===e?void 0:e.click()},children:[pe["case.before.".concat(a)]?(0,S.jsx)(A.A,{className:"w-3 h-3 mr-1 animate-spin"}):(0,S.jsx)(J.A,{className:"w-3 h-3 mr-1"}),"Upload"]}),(0,S.jsx)(n.p,{value:e.before_image_url,onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{before_image_url:s.target.value});ke("gallery.case_results",a,t)},placeholder:"or paste URL",className:"flex-1 text-xs",disabled:pe["case.before.".concat(a)]})]}),(0,S.jsx)(M,{progress:ve["case.before.".concat(a)]||0,fileName:je["case.before.".concat(a)]||"",isUploading:pe["case.before.".concat(a)]})]})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{className:"text-sm text-gray-600",children:"After"}),e.after_image_url&&(0,S.jsxs)("div",{className:"relative aspect-video rounded-lg overflow-hidden bg-gray-100",children:[(0,S.jsx)("img",{src:(0,f.S)(e.after_image_url),alt:"After",className:"w-full h-full object-cover"}),(0,S.jsx)(o.$,{type:"button",variant:"destructive",size:"icon",className:"absolute top-1 right-1 w-5 h-5",onClick:()=>{const s=(0,l.A)((0,l.A)({},e),{},{after_image_url:""});ke("gallery.case_results",a,s)},children:(0,S.jsx)(z.A,{className:"w-3 h-3"})})]}),(0,S.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,S.jsx)("input",{type:"file",id:"case-after-".concat(a),accept:"image/*",className:"hidden",onChange:async s=>{var t;const r=null===(t=s.target.files)||void 0===t?void 0:t[0];if(r&&null!==de&&void 0!==de&&de.programme_id){const s="case.after.".concat(a);xe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:!0})),ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:0})),fe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:r.name}));try{const t=F(r),i=await j.WZ.getPresignedUploadUrl(de.programme_id,{filename:r.name,content_type:t,upload_type:"image",file_size:r.size});await new Promise((e,a)=>{const o=new XMLHttpRequest;o.upload.addEventListener("progress",e=>{if(e.lengthComputable){const a=e.loaded/e.total*100;ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:a}))}}),o.addEventListener("load",()=>o.status>=200&&o.status<300?e():a()),o.addEventListener("error",()=>a(new Error("Upload failed"))),o.open("PUT",i.data.presigned_url),o.setRequestHeader("Content-Type",t),o.send(r)});const o=(0,l.A)((0,l.A)({},e),{},{after_image_url:i.data.public_url});ke("gallery.case_results",a,o),N.oR.success("After image uploaded!")}catch(n){var i,o;const e=(null===n||void 0===n||null===(i=n.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.detail)||(null===n||void 0===n?void 0:n.message)||"Upload failed";N.oR.error(e)}finally{xe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:!1})),ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:0})),fe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:""}))}}s.target.value=""}}),(0,S.jsxs)("div",{className:"flex gap-1",children:[(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",disabled:!(null!==de&&void 0!==de&&de.programme_id)||pe["case.after.".concat(a)],onClick:()=>{var e;return null===(e=document.getElementById("case-after-".concat(a)))||void 0===e?void 0:e.click()},children:[pe["case.after.".concat(a)]?(0,S.jsx)(A.A,{className:"w-3 h-3 mr-1 animate-spin"}):(0,S.jsx)(J.A,{className:"w-3 h-3 mr-1"}),"Upload"]}),(0,S.jsx)(n.p,{value:e.after_image_url,onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{after_image_url:s.target.value});ke("gallery.case_results",a,t)},placeholder:"or paste URL",className:"flex-1 text-xs",disabled:pe["case.after.".concat(a)]})]}),(0,S.jsx)(M,{progress:ve["case.after.".concat(a)]||0,fileName:je["case.after.".concat(a)]||"",isUploading:pe["case.after.".concat(a)]})]})]})]})]},a)),(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:()=>we("gallery.case_results",{title:"",before_image_url:"",after_image_url:""}),children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Case"]})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Testimonials"}),null===(G=me.testimonials)||void 0===G?void 0:G.map((e,a)=>(0,S.jsxs)("div",{className:"border rounded p-4 space-y-3 bg-gray-50",children:[(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsx)(n.p,{value:e.delegate_name,onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{delegate_name:s.target.value});ke("testimonials",a,t)},placeholder:"Delegate name",className:"flex-1"}),(0,S.jsx)(o.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>Ce("testimonials",a),children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]}),(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,S.jsx)(n.p,{value:e.role,onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{role:s.target.value});ke("testimonials",a,t)},placeholder:"Role (e.g., General Dentist)"}),(0,S.jsx)(n.p,{value:e.location,onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{location:s.target.value});ke("testimonials",a,t)},placeholder:"Location (e.g., London)"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{className:"text-sm text-gray-600",children:"Video"}),e.video_url&&(0,S.jsxs)("div",{className:"relative bg-black rounded-lg overflow-hidden aspect-video",children:[(0,S.jsx)("video",{src:e.video_url,controls:!0,className:"w-full h-full"}),(0,S.jsx)(o.$,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 w-6 h-6",onClick:()=>{const s=(0,l.A)((0,l.A)({},e),{},{video_url:""});ke("testimonials",a,s)},children:(0,S.jsx)(z.A,{className:"w-3 h-3"})})]}),(0,S.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,S.jsx)("input",{type:"file",id:"testimonial-video-".concat(a),accept:"video/*",className:"hidden",onChange:async s=>{var t;const r=null===(t=s.target.files)||void 0===t?void 0:t[0];if(r&&null!==de&&void 0!==de&&de.programme_id){const s="testimonial.video.".concat(a);xe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:!0})),ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:0})),fe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:r.name}));try{const t=F(r),i=await j.WZ.getPresignedUploadUrl(de.programme_id,{filename:r.name,content_type:t,upload_type:"video",file_size:r.size});await new Promise((e,a)=>{const o=new XMLHttpRequest;o.upload.addEventListener("progress",e=>{if(e.lengthComputable){const a=e.loaded/e.total*100;ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:a}))}}),o.addEventListener("load",()=>o.status>=200&&o.status<300?e():a()),o.addEventListener("error",()=>
1a(new Error("Upload failed"))),o.open("PUT",i.data.presigned_url),o.setRequestHeader("Content-Type",t),o.send(r)});const o=(0,l.A)((0,l.A)({},e),{},{video_url:i.data.public_url});ke("testimonials",a,o),N.oR.success("Video uploaded!")}catch(n){var i,o;const e=(null===n||void 0===n||null===(i=n.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.detail)||(null===n||void 0===n?void 0:n.message)||"Video upload failed";N.oR.error(e)}finally{xe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:!1})),ye(e=>(0,l.A)((0,l.A)({},e),{},{[s]:0})),fe(e=>(0,l.A)((0,l.A)({},e),{},{[s]:""}))}}s.target.value=""}}),(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",disabled:!(null!==de&&void 0!==de&&de.programme_id)||pe["testimonial.video.".concat(a)],onClick:()=>{var e;return null===(e=document.getElementById("testimonial-video-".concat(a)))||void 0===e?void 0:e.click()},children:[pe["testimonial.video.".concat(a)]?(0,S.jsx)(A.A,{className:"w-4 h-4 mr-2 animate-spin"}):(0,S.jsx)(J.A,{className:"w-4 h-4 mr-2"}),"Upload Video"]}),(0,S.jsx)("span",{className:"text-gray-400 self-center text-sm",children:"or"}),(0,S.jsx)(n.p,{value:e.video_url,onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{video_url:s.target.value});ke("testimonials",a,t)},placeholder:"Paste video URL",className:"flex-1",disabled:pe["testimonial.video.".concat(a)]})]}),(0,S.jsx)(M,{progress:ve["testimonial.video.".concat(a)]||0,fileName:je["testimonial.video.".concat(a)]||"",isUploading:pe["testimonial.video.".concat(a)]})]})]})]},a)),(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:()=>we("testimonials",{delegate_name:"",role:"",location:"",video_url:""}),children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Testimonial"]})]})]}),(0,S.jsxs)(h.av,{value:"booking",className:"space-y-6 mt-4",children:[(0,S.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,S.jsx)("h4",{className:"font-medium mb-4",children:"Pricing"}),(0,S.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Full Price (\xa3)"}),(0,S.jsx)(n.p,{type:"number",value:me.booking.full_price,onChange:e=>Ae("booking.full_price",parseFloat(e.target.value)||0),placeholder:"0"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Deposit Amount (\xa3)"}),(0,S.jsx)(n.p,{type:"number",value:me.booking.deposit_amount,onChange:e=>Ae("booking.deposit_amount",parseFloat(e.target.value)||0),placeholder:"1000"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"VAT Rate (%)"}),(0,S.jsx)(n.p,{type:"number",value:me.booking.vat_rate,onChange:e=>Ae("booking.vat_rate",parseFloat(e.target.value)||20),placeholder:"20"})]})]}),me.booking.full_price>0&&(0,S.jsxs)("div",{className:"mt-4 p-3 bg-gray-50 rounded-lg",children:[(0,S.jsxs)("p",{className:"text-sm text-gray-600",children:["Full price with VAT: ",(0,S.jsxs)("strong",{children:["\xa3",(me.booking.full_price*(1+me.booking.vat_rate/100)).toFixed(2)]})]}),(0,S.jsxs)("p",{className:"text-sm text-gray-600",children:["Deposit with VAT: ",(0,S.jsxs)("strong",{children:["\xa3",(me.booking.deposit_amount*(1+me.booking.vat_rate/100)).toFixed(2)]})]})]})]}),(0,S.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,S.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("h4",{className:"font-medium",children:"Monthly Payments"}),(0,S.jsx)("p",{className:"text-xs text-slate-500 mt-0.5",children:'Shown on the public /programmes cards as "Monthly payments available".'})]}),(0,S.jsx)(u.d,{checked:me.booking.monthly_payment_enabled||!1,onCheckedChange:e=>Ae("booking.monthly_payment_enabled",e),"data-testid":"monthly-payment-toggle"})]}),me.booking.monthly_payment_enabled&&(0,S.jsxs)("div",{className:"space-y-4",children:[(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Monthly Amount (\xa3)"}),(0,S.jsx)(n.p,{type:"number",value:me.booking.monthly_amount||"",onChange:e=>Ae("booking.monthly_amount",parseFloat(e.target.value)||0),placeholder:"e.g. 495","data-testid":"monthly-amount-input"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Number of Months"}),(0,S.jsx)(n.p,{type:"number",value:me.booking.monthly_duration_months||"",onChange:e=>Ae("booking.monthly_duration_months",parseInt(e.target.value)||0),placeholder:"e.g. 12","data-testid":"monthly-months-input"})]})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Note (optional)"}),(0,S.jsx)(n.p,{value:me.booking.monthly_note||"",onChange:e=>Ae("booking.monthly_note",e.target.value),placeholder:"e.g. 0% interest, subject to eligibility","data-testid":"monthly-note-input"})]}),me.booking.monthly_amount>0&&(0,S.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg text-sm text-gray-600",children:["Card will show: ",(0,S.jsxs)("strong",{children:["Monthly payments available \u2014 from \xa3",Number(me.booking.monthly_amount).toFixed(2),"/month",me.booking.monthly_duration_months>0?" for ".concat(me.booking.monthly_duration_months," months"):""]})]})]})]}),(0,S.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,S.jsx)("h4",{className:"font-medium mb-4",children:"GHL Calendar Integration"}),(0,S.jsxs)("div",{className:"space-y-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Adv
1isor Calendar URL"}),(0,S.jsx)(n.p,{value:me.booking.ghl_advisor_calendar_url,onChange:e=>Ae("booking.ghl_advisor_calendar_url",e.target.value),placeholder:"https://..."})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Direct Booking Calendar URL"}),(0,S.jsx)(n.p,{value:me.booking.ghl_direct_booking_url,onChange:e=>Ae("booking.ghl_direct_booking_url",e.target.value),placeholder:"https://..."})]})]})]}),(0,S.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,S.jsx)("h4",{className:"font-medium mb-4",children:"Upcoming Dates"}),null===(Y=me.booking.upcoming_dates)||void 0===Y?void 0:Y.map((e,a)=>(0,S.jsxs)("div",{className:"border rounded p-3 mb-2 space-y-3",children:[(0,S.jsxs)("div",{className:"flex gap-2 items-start",children:[(0,S.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,S.jsx)(d.J,{className:"text-sm",children:"Module Title"}),(0,S.jsx)(n.p,{value:e.module_title||"",onChange:s=>{const t=(0,l.A)((0,l.A)({},e),{},{module_title:s.target.value});ke("booking.upcoming_dates",a,t)},placeholder:"e.g., Module 1: Introduction"})]}),(0,S.jsx)(o.$,{type:"button",variant:"ghost",size:"icon",className:"mt-6",onClick:()=>Ce("booking.upcoming_dates",a),children:(0,S.jsx)(z.A,{className:"w-4 h-4"})})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{className:"text-sm",children:"Date"}),(0,S.jsxs)(y.AM,{children:[(0,S.jsx)(y.Wv,{asChild:!0,children:(0,S.jsxs)(o.$,{type:"button",variant:"outline",className:"w-full justify-start text-left font-normal",children:[(0,S.jsx)(C.A,{className:"mr-2 h-4 w-4"}),e.date?e.date:(0,S.jsx)("span",{className:"text-muted-foreground",children:"Select date"})]})}),(0,S.jsx)(y.hl,{className:"w-auto p-0",align:"start",children:(0,S.jsx)(v.V,{mode:"single",selected:e.date?new Date(e.date):void 0,onSelect:s=>{const t=s?(0,b.GP)(s,"dd MMMM yyyy"):"",r=(0,l.A)((0,l.A)({},e),{},{date:t});ke("booking.upcoming_dates",a,r)},initialFocus:!0})})]})]})]},a)),(0,S.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:()=>we("booking.upcoming_dates",{date:"",module_title:""}),children:[(0,S.jsx)(E.A,{className:"w-4 h-4 mr-2"}),"Add Date"]})]})]}),(0,S.jsxs)(h.av,{value:"seo",className:"space-y-4 mt-4",children:[(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Meta Title"}),(0,S.jsx)(n.p,{value:me.seo.meta_title,onChange:e=>Ae("seo.meta_title",e.target.value),placeholder:"SEO page title"})]}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(d.J,{children:"Meta Description"}),(0,S.jsx)(c.T,{value:me.seo.meta_description,onChange:e=>Ae("seo.meta_description",e.target.value),placeholder:"SEO description (150-160 characters)",rows:3}),(0,S.jsxs)("p",{className:"text-xs text-gray-500",children:[(null===(K=me.seo.meta_description)||void 0===K?void 0:K.length)||0,"/160 characters"]})]}),(0,S.jsx)(Re,{fieldPath:"seo.og_image_url",label:"OG Image (Social sharing)",currentUrl:me.seo.og_image_url})]})]}),(0,S.jsxs)(g.Es,{children:[(0,S.jsx)(o.$,{variant:"outline",onClick:()=>ne(!1),children:"Cancel"}),(0,S.jsxs)(o.$,{onClick:async()=>{if(me.slug){ie(!0);try{de?(await j.WZ.update(de.programme_id,me),N.oR.success("Programme updated successfully")):(await j.WZ.create(me),N.oR.success("Programme created successfully")),ne(!1),Ne()}catch(s){var e,a;console.error("Error saving programme:",s),N.oR.error((null===(e=s.response)||void 0===e||null===(a=e.data)||void 0===a?void 0:a.detail)||"Failed to save programme")}finally{ie(!1)}}else N.oR.error("Slug is required")},disabled:re,className:"bg-[#41EAD4] text-[#0D1B2A]",children:[re?(0,S.jsx)(A.A,{className:"w-4 h-4 animate-spin mr-2"}):null,de?"Update":"Create"," Programme"]})]})]})})]})})}},5395(e,a,s){s.d(a,{k:()=>c});var l=s(9379),t=s(3986),r=s(5043),i=s(7989),o=s(9766),n=s(579);const d=["className","value"],c=r.forwardRef((e,a)=>{let{className:s,value:r}=e,c=(0,t.A)(e,d);return(0,n.jsx)(i.bL,(0,l.A)((0,l.A)({ref:a,className:(0,o.cn)("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s)},c),{},{children:(0,n.jsx)(i.C1,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:"translateX(-".concat(100-(r||0),"%)")}})}))});c.displayName=i.bL.displayName},5598(e,a,s){s.d(a,{Cf:()=>j,Es:()=>N,L3:()=>b,c7:()=>f,lG:()=>x,rr:()=>_});var l=s(9379),t=s(3986),r=s(5043),i=s(7427),o=s(614),n=s(9766),d=s(579);const c=["className"],m=["className","children"],u=["className"],g=["className"],h=["className"],p=["className"],x=i.bL,v=(i.l9,i.ZL),y=(i.bm,r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,c);return(0,d.jsx)(i.hJ,(0,l.A)({ref:a,className:(0,n.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s)},r))}));y.displayName=i.hJ.displayName;const j=r.forwardRef((e,a)=>{let{className:s,children:r}=e,c=(0,t.A)(e,m);return(0,d.jsxs)(v,{children:[(0,d.jsx)(y,{}),(0,d.jsxs)(i.UC,(0,l.A)((0,l.A)({ref:a,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
1nded-lg",s)},c),{},{children:[r,(0,d.jsxs)(i.bm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,d.jsx)(o.A,{className:"h-4 w-4"}),(0,d.jsx)("span",{className:"sr-only",children:"Close"})]})]}))]})});j.displayName=i.UC.displayName;const f=e=>{let{className:a}=e,s=(0,t.A)(e,u);return(0,d.jsx)("div",(0,l.A)({className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",a)},s))};f.displayName="DialogHeader";const N=e=>{let{className:a}=e,s=(0,t.A)(e,g);return(0,d.jsx)("div",(0,l.A)({className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a)},s))};N.displayName="DialogFooter";const b=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,h);return(0,d.jsx)(i.hE,(0,l.A)({ref:a,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",s)},r))});b.displayName=i.hE.displayName;const _=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,p);return(0,d.jsx)(i.VY,(0,l.A)({ref:a,className:(0,n.cn)("text-sm text-muted-foreground",s)},r))});_.displayName=i.VY.displayName},7584(e,a,s){s.d(a,{S:()=>r});const l="https://plant4growthuk-production-a1cd.up.railway.app".replace(/\/+$/,""),t=/^https:\/\/[^/]*\.amazonaws\.com\/mentors\/([^/?#]+)/,r=e=>{if(!e)return e;const a=e.match(t);return a?"".concat(l,"/api/files/mentor-images/").concat(a[1]):e.startsWith("/api/")?"".concat(l).concat(e):e}},8615(e,a,s){s.d(a,{AM:()=>c,Wv:()=>m,hl:()=>u});var l=s(9379),t=s(3986),r=s(5043),i=s(942),o=s(9766),n=s(579);const d=["className","align","sideOffset"],c=i.bL,m=i.l9,u=(i.Mz,r.forwardRef((e,a)=>{let{className:s,align:r="center",sideOffset:c=4}=e,m=(0,t.A)(e,d);return(0,n.jsx)(i.ZL,{children:(0,n.jsx)(i.UC,(0,l.A)({ref:a,align:r,sideOffset:c,className:(0,o.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",s)},m))})}));u.displayName=i.UC.displayName},9690(e,a,s){s.d(a,{Xi:()=>h,av:()=>p,j7:()=>g,tU:()=>u});var l=s(9379),t=s(3986),r=s(5043),i=s(7127),o=s(9766),n=s(579);const d=["className"],c=["className"],m=["className"],u=i.bL,g=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,d);return(0,n.jsx)(i.B8,(0,l.A)({ref:a,className:(0,o.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s)},r))});g.displayName=i.B8.displayName;const h=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,c);return(0,n.jsx)(i.l9,(0,l.A)({ref:a,className:(0,o.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s)},r))});h.displayName=i.l9.displayName;const p=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,m);return(0,n.jsx)(i.UC,(0,l.A)({ref:a,className:(0,o.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s)},r))});p.displayName=i.UC.displayName},9938(e,a,s){s.d(a,{J:()=>u});var l=s(9379),t=s(3986),r=s(5043),i=s(5131),o=s(917),n=s(9766),d=s(579);const c=["className"],m=(0,o.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=r.forwardRef((e,a)=>{let{className:s}=e,r=(0,t.A)(e,c);return(0,d.jsx)(i.b,(0,l.A)({ref:a,className:(0,n.cn)(m(),s)},r))});u.displayName=i.b.displayName}}]);
2//# sourceMappingURL=5372.07eca0e5.chunk.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.