import{r as j,R as f,j as e,S as w,A as _}from"./app-BCACiV_h.js";import{G as k}from"./GuestLayout-DjhBRjLp.js";import{I as b}from"./input-C0GT1yBI.js";import{L as N}from"./label-C3A8D7NS.js";import{S as g}from"./star-DW2o-B2t.js";import{U as C}from"./users-b23dSEY2.js";import{C as S}from"./clock-BQAhSBG5.js";import{c as p}from"./createLucideIcon-Cb2AHrGc.js";import{D as $}from"./download-CsM8o-Y5.js";import{G as A}from"./graduation-cap-Cv1eM4SE.js";import{C as q}from"./calendar-pb2sv1-U.js";import{A as D}from"./award-Cp-ujg6F.js";import{X as P}from"./x-BZmooK4p.js";import"./toaster-U69lirBO.js";import"./index-BOyYRdd2.js";import"./index-BH6lUORs.js";import"./index-Bjh4LSUj.js";/**
* @license lucide-react v0.474.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const F=[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]],M=p("ChartNoAxesColumnIncreasing",F);/**
* @license lucide-react v0.474.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],v=p("CirclePlay",z);/**
* @license lucide-react v0.474.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],y=p("Globe",I);function R({fields:a,onSubmit:c,loading:h,errors:l}){const[i,m]=f.useState({syarat_pelatihan_id:a.map(s=>s.id)}),o=s=>{s.preventDefault(),c(i)},d=(s,t)=>{m(r=>({...r,[`jawaban_${s}`]:t}))},u=s=>{const t={id:s.id,name:`jawaban_${s.id}`,required:s.required==="required","aria-label":s.description,onChange:r=>{var n;if(s.type=="file"){const x=(n=r.target.files)==null?void 0:n[0];x&&d(s.id,x)}else d(s.id,s.type==="checkbox"?r.target.checked:r.target.value)},value:s.type!="file"?i[`jawaban_${s.id}`]||(s.type==="checkbox"?!1:""):null,checked:s.type==="checkbox"?i[`jawaban_${s.id}`]||!1:void 0};switch(s.type){case"checkbox":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("input",{type:"checkbox",...t,className:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsxs("label",{htmlFor:s.id,className:"ml-2 text-sm text-gray-600",children:[s.description," ",t.required&&e.jsx("small",{className:"text-red-500",children:"*"})]})]}),l!=null&&l[`jawaban_${s.id}`]&&e.jsx("div",{className:"text-red-600",children:l[`jawaban_${s.id}`]})]});case"file":return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(N,{htmlFor:s.id,children:[s.description," ",t.required&&e.jsx("small",{className:"text-red-500",children:"*"})]}),e.jsx(b,{type:"file",id:s.id,name:`jawaban_${s.id}`,required:s.required==="required","aria-label":s.description,onChange:r=>{var x;const n=(x=r.target.files)==null?void 0:x[0];n&&d(s.id,n)},placeholder:s.description,className:"w-full",accept:".pdf,.doc,.docx,image/*,.zip,.rar,.7z"}),l!=null&&l[`jawaban_${s.id}`]&&e.jsx("div",{className:"text-red-600",children:l[`jawaban_${s.id}`]})]});default:return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(N,{htmlFor:s.id,children:[s.description," ",t.required&&e.jsx("small",{className:"text-red-500",children:"*"})]}),e.jsx(b,{type:s.type,...t,placeholder:s.description,className:"w-full"}),l!=null&&l[`jawaban_${s.id}`]&&e.jsx("div",{className:"text-red-600",children:l[`jawaban_${s.id}`]})]})}};return e.jsxs("form",{onSubmit:o,className:"space-y-6",encType:"multipart/form-data",method:"POST",children:[e.jsx("div",{className:"w-full space-y-4",children:a.map(s=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("input",{type:"hidden",name:"syarat_pelatihan_id[]",value:s.id}),u(s)]},s.id))}),e.jsxs("div",{className:"w-full space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("input",{type:"checkbox",id:"checkbox",className:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500",required:!0,onChange:s=>{m(t=>({...t,setuju:s.target.checked}))}}),e.jsx("label",{htmlFor:"checkbox",className:"ml-2 text-sm text-gray-600",children:"Saya telah telah bersedia mengikuti persyaratan yang ada pada formulir komitmen pelatihan ini."})]}),e.jsx("button",{type:"submit",className:"w-full bg-[#0070BA] text-white py-3 rounded-lg font-semibold hover:bg-[#003087] transition-colors",children:h?e.jsx("span",{className:"loader h-6 w-6"}):e.jsx("span",{children:"Daftar"})})]})]})}function se({pelatihan:a}){const[c,h]=j.useState("informasi"),[l,i]=j.useState(!1),[m,o]=f.useState(!1),d=j.useRef(),u=t=>{o(!0),_.post(route("course.join",a.id),t,{forceFormData:!0,onFinish:()=>{o(!1)},onError:r=>{d.current=r,i(!0)},onSuccess:()=>{i(!1)}})},s=()=>l?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-xl max-w-4xl w-full max-h-[85vh] overflow-y-auto",children:[e.jsxs("div",{className:"p-6 border-b border-gray-200",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-2xl font-bold",children:"Daftar Pelatihan"}),e.jsx("button",{onClick:()=>i(!1),className:"text-gray-500 hover:text-gray-700",children:e.jsx(P,{className:"h-6 w-6"})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-between",children:[e.jsx("b",{children:a.title}),e.jsx("div",{className:"text-sm text-gray-600",children:a.description})]})]}),e.jsxs("div",{className:"p-6 border-b border-gray-200",children:[e.jsx("div",{className:"text-sm text-gray-900",children:"Tanggal Pelatihan"}),e.jsxs("div",{className:"text-sm text-gray-900 font-bold",children:[a.start_date," s/d ",a.end_date]}),e.jsx("div",{className:"space-y-8 mt-8 flex flex-col",children:e.jsx(R,{fields:a.syarat_pelatihans,onSubmit:u,loading:m,errors:d.current})})]})]})}):null;return e.jsxs(k,{children:[e.jsx(w,{title:a.title}),e.jsx("div",{className:"pt-16 bg-white",children:e.jsxs("div",{className:"relative h-[400px] overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-900/60 z-10"}),e.jsx("img",{src:route("course.thumbnail",a.id),alt:a.title,className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 z-20",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-full flex items-center",children:e.jsxs("div",{className:"text-white max-w-3xl",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:a.title}),e.jsx("p",{className:"text-xl text-gray-200 mb-6",children:a.short_description}),e.jsxs("div",{className:"flex items-center space-x-6 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(g,{className:"h-5 w-5 text-yellow-400 mr-1"}),e.jsxs("span",{children:[5*((a.pelatihan_pesertas_sum_review!=null?a.pelatihan_pesertas_sum_review:0)/(a.pelatihan_pesertas_review_count*5))||0," (",a.pesertas_count," peserta)"]})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(C,{className:"h-5 w-5 mr-1"}),e.jsxs("span",{children:[a.pesertas_count.toLocaleString()," students"]})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(S,{className:"h-5 w-5 mr-1"}),e.jsxs("span",{children:["Terakhir di update ",a.last_updated]})]})]})]})})})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("div",{className:"border-b border-gray-200 mb-8",children:e.jsx("nav",{className:"flex space-x-8",children:["informasi","silabus","instruktur","peserta"].map(t=>e.jsx("button",{onClick:()=>h(t),className:`
py-4 px-1 border-b-2 font-medium text-sm
${c===t?"border-blue-600 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}
`,children:t.charAt(0).toUpperCase()+t.slice(1)},t))})}),c==="informasi"&&e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Deskripsi Pelatihan"}),e.jsx("p",{className:"text-gray-600",children:a.description})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Konten Pelatihan"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"text-center p-4 bg-white rounded-lg shadow-xs",children:[e.jsx(v,{className:"h-8 w-8 text-blue-600 mx-auto mb-2"}),e.jsx("div",{className:"font-semibold",children:a.duration}),e.jsx("div",{className:"text-sm text-gray-500",children:"Durasi Pertemuan"})]}),e.jsxs("div",{className:"text-center p-4 bg-white rounded-lg shadow-xs",children:[e.jsx($,{className:"h-8 w-8 text-blue-600 mx-auto mb-2"}),e.jsx("div",{className:"font-semibold",children:"Materi"}),e.jsx("div",{className:"text-sm text-gray-500",children:"Materi yang bisa di unduh"})]}),e.jsxs("div",{className:"text-center p-4 bg-white rounded-lg shadow-xs",children:[e.jsx(A,{className:"h-8 w-8 text-blue-600 mx-auto mb-2"}),e.jsx("div",{className:"font-semibold",children:"Certificate"}),e.jsx("div",{className:"text-sm text-gray-500",children:"Of Completion"})]}),e.jsxs("div",{className:"text-center p-4 bg-white rounded-lg shadow-xs",children:[e.jsx(y,{className:"h-8 w-8 text-blue-600 mx-auto mb-2"}),e.jsx("div",{className:"font-semibold",children:"Akses Materi"}),e.jsx("div",{className:"text-sm text-gray-500",children:"Akses materi seumur hidup"})]})]})]})]}),c==="silabus"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Materi Silabus"}),e.jsx("div",{className:"space-y-4",children:a.pelatihan_materis.map((t,r)=>e.jsx("div",{className:"bg-white p-4 rounded-lg shadow-xs",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg",children:t.name}),e.jsx("div",{className:"text-sm text-gray-500 mt-1",children:t.code})]}),e.jsx(v,{className:"h-6 w-6 text-blue-600"})]})},r))})]}),c==="instruktur"&&e.jsx("div",{children:e.jsx("div",{className:"bg-white p-6 rounded-lg shadow-xs",children:e.jsx("div",{className:"flex items-start space-x-4",children:e.jsx("div",{children:e.jsx("h2",{className:"text-2xl font-bold mb-2",children:a.instructor.nama})})})})}),c==="peserta"&&e.jsx("div",{children:e.jsxs("div",{className:"bg-white p-6 rounded-lg shadow-xs",children:[e.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Student Reviews"}),e.jsxs("div",{className:"flex items-center mb-8",children:[e.jsx("div",{className:"text-5xl font-bold text-blue-600 mr-8",children:0}),e.jsxs("div",{children:[e.jsx("div",{className:"flex text-yellow-400 mb-2",children:[...Array(5)].map((t,r)=>e.jsx(g,{className:"h-5 w-5",fill:"currentColor"},r))}),e.jsxs("div",{className:"text-gray-600",children:["Pelatihan Rating • ",a.pesertas_count," Reviews"]})]})]})]})})]}),e.jsx("div",{className:"lg:col-span-1",children:e.jsx("div",{className:"sticky top-24",children:e.jsx("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:e.jsxs("div",{className:"p-6",children:[e.jsx("button",{onClick:()=>i(!0),className:"w-full bg-blue-600 text-white py-3 rounded-lg font-semibold mb-4 hover:bg-blue-700 transition-colors",children:"Daftar Sekarang"}),e.jsxs("div",{className:"mt-6 space-y-4 text-sm",children:[e.jsxs("div",{className:"flex items-center text-gray-600",children:[e.jsx(q,{className:"h-5 w-5 mr-2"}),e.jsxs("span",{children:[a.start_date," s/d ",a.end_date]})]}),e.jsxs("div",{className:"flex items-center text-gray-600",children:[e.jsx(D,{className:"h-5 w-5 mr-2"}),e.jsx("span",{children:"Certificate of completion"})]}),e.jsxs("div",{className:"flex items-center text-gray-600",children:[e.jsx(M,{className:"h-5 w-5 mr-2"}),e.jsx("span",{children:"Beginner hinggaa Advanced"})]}),e.jsxs("div",{className:"flex items-center text-gray-600",children:[e.jsx(y,{className:"h-5 w-5 mr-2"}),e.jsx("span",{children:"Indonesia"})]})]})]})})})})]})}),s()]})}export{se as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]