PageSourceSearch

https://moreden.co.kr/assets/KlassRoute-75fc0066.js

js moreden.co.kr collected 2026-10-03 21:15:23 UTC 107,826 bytes, 2 lines download raw bytes

1import{r as N,j as e,bL as pe,L as K,C as R,bM as ve,g as Q,k as E,i as le,bb as Le,q as Pe,bN as it,ab as Ne,p as z,c as V,R as ae,t as ie,aa as me,bO as nt,bP as Ve,bQ as Z,bR as We,aq as ee,bS as de,b as dt,e as ct,B as X,aU as Nt,a4 as ot,w as xt,n as Be,f as $,bT as re,aw as wt,m as kt,P as Ct,bU as pt,bV as be,aZ as Ee,av as $e,bW as Se,aQ as It,M as St,am as Pt,an as Ie,N as _t}from"./index-1d0942b5.js";import{S as Me,a as te}from"./swiper-slide-1370b99d.js";import{N as mt}from"./navigation-2fdeec06.js";import{c as Qe}from"./index-2ddb66c8.js";import{C as se}from"./CourseCard-3afd181b.js";import{L as je}from"./LevelIcon-3a18e6cf.js";import{B as oe}from"./banner-ca4fbd95.js";import{a as _e,u as Ft}from"./hooks-1876da88.js";import{u as $t}from"./hooks-c1d9f5e5.js";import{R as At}from"./RecommendedChannels-03d85fd1.js";import{f as Tt}from"./free-mode-1ce85a39.js";import{S as Et}from"./StyledSelect-94f2370b.js";import{D as Lt}from"./channelCategory-5997d489.js";import{B as Bt}from"./Blur-d643cf13.js";import{P as Mt}from"./ProductUnit-93bd24af.js";import{M as Rt}from"./Modal-465b1e93.js";import{P as Xe}from"./ProseMirrorEditorView-11ad7c11.js";import{R as Dt}from"./RecommendedSeminarItem-43aa3bf9.js";import{i as Ot}from"./hooks-daae72cb.js";import{Z as Je}from"./ZoomImg-52ae5783.js";import"./create-element-if-not-defined-0a26d177.js";import"./autoplay-500a3294.js";import"./react-select.esm-a9ce8259.js";import"./react-content-loader.es-50f66e91.js";import"./seminarUtil-49c8bae4.js";import"./ImageWrapper-af54aea8.js";import"./useScrapMutation-34270ca6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="73b4be71-cee1-43c1-a7b2-f753607c7915",t._sentryDebugIdIdentifier="sentry-dbid-73b4be71-cee1-43c1-a7b2-f753607c7915")}catch{}})();const xe=({children:t,options:s={},hasNavigation:r=!0,navigationTop:o="top-1/2 -translate-y-1/2"})=>{const[u]=N.useState(Math.random().toString(36).substring(2,7));return e.jsxs("div",{id:`swiper-${u}`,className:"relative",children:[e.jsx(Me,{modules:[mt],breakpoints:{0:{slidesPerView:1.1,spaceBetween:15},375:{slidesPerView:1.3,spaceBetween:15},480:{slidesPerView:1.5,spaceBetween:15},540:{slidesPerView:1.8,spaceBetween:15},760:{slidesPerView:2.1,spaceBetween:15},820:{slidesPerView:2.3,spaceBetween:15},1024:{slidesPerView:4,spaceBetween:15}},className:"swiper-container swiper-container-initialized swiper-container-horizontal swiper-container-pointer-events",style:{padding:"1px"},parallax:!0,navigation:{nextEl:`#swiper-${u} .swiper-next-btn`,prevEl:`#swiper-${u} .swiper-prev-btn`},...s,children:t}),r&&e.jsxs("div",{className:"hidden lg:block",children:[e.jsx("button",{className:Qe("swiper-next-btn border px-[9px] py-[8px] absolute -right-5 z-10",o),children:e.jsx("i",{className:"ii ii-chevron-right ii-weight-600 text-[20px] flex items-center justify-center"})}),e.jsx("button",{className:Qe("swiper-prev-btn px-[9px] py-[8px] absolute -left-5 z-10",o),children:e.jsx("i",{className:"ii ii-chevron-left ii-weight-600 text-[20px] flex items-center justify-center"})})]})]})},qt=()=>{const[t,s]=N.useState(!1);return e.jsxs("div",{className:"bg-gray-50 lg:bg-transparent",children:[e.jsxs("ul",{className:"grid grid-cols-5 lg:grid-cols-10 pt-4 pb-1 lg:pt-0 lg:pb-6",children:[pe.filter(r=>["IMPL","GBR","ENDO","PROS","MGMT","SKIN_BEAUTY","EXT","ESTHE","OMFS"].includes(r.name)).map(r=>e.jsx("li",{className:"text-center pb-3 lg:pb-0 group",children:e.jsxs(K,{className:"block",to:`/${R}/search?topics=${r.label.replace(/\s+/g,"").replace("/",encodeURIComponent("/")).replace("&",encodeURIComponent("&"))}`,onClick:()=>ve({topic:r.label}),children:[e.jsx("div",{className:"inline-block relative w-[35px] h-[35px] lg:w-[74px] lg:h-[74px] rounded-[15px] lg:rounded-full shadow-custom lg:transition lg:group-hover:transform lg:group-hover:scale-105 overflow-hidden",children:e.jsx("img",{className:"absolute top-[50%] left-[50%] transform translate-x-[-50%] translate-y-[-50%] w-[22px] h-[22px] object-contain lg:w-auto lg:h-auto lg:scale-100",src:Q(`klass/${r.img}`),alt:""})}),e.jsx("span",{className:"block mt-1.5 lg:mt-2 !text-gray-800 text-[11px] lg:text-[16
1px] font-medium lg:font-semibold whitespace-nowrap",children:r.label})]})},r.name)),e.jsx("li",{className:"text-center pb-3 lg:pb-0 group",children:e.jsxs("button",{type:"button",onClick:()=>s(!0),children:[e.jsx("div",{className:"inline-block relative w-[35px] h-[35px] lg:w-[74px] lg:h-[74px] rounded-[15px] lg:rounded-full bg-primary-50 shadow-custom lg:transition lg:group-hover:transform lg:group-hover:scale-105",children:e.jsx("img",{className:"absolute top-[50%] left-[50%] transform translate-x-[-50%] translate-y-[-50%] scale-[0.55] lg:scale-100",src:Q("klass/ico-topic-all.svg"),alt:""})}),e.jsx("span",{className:"block mt-1.5 lg:mt-2 !text-gray-800 text-[11px] lg:text-[16px] font-medium lg:font-semibold whitespace-nowrap",children:"전체보기"})]})})]}),t&&e.jsx(gt,{setTopicsMenuDisplay:s})]})},gt=({setTopicsMenuDisplay:t})=>e.jsx("div",{className:"relative",children:e.jsxs("div",{className:E("z-[520] overflow-auto w-full p-[30px] bg-white shadow-custom","fixed top-0 bottom-0","lg:absolute lg:bottom-auto lg:rounded-md"),children:[e.jsx("button",{className:"absolute top-[20px] right-[20px] w-[40px] h-[40px] rounded-full hover:bg-gray-100",type:"button",title:"닫기",onClick:()=>t(!1),children:e.jsx("i",{className:"ii ii-remove text-[24px]"})}),e.jsx("h4",{className:"text-gray-800 text-[20px] font-semibold",children:"카테고리"}),e.jsxs("ul",{className:"mt-7 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 gap-y-3",children:[e.jsx("li",{children:e.jsx(K,{className:"font-medium block px-[4px] py-[8px] rounded-md bg-gray-100 hover:bg-primary-100 text-gray-900 text-[15px] text-center whitespace-nowrap",to:`/${R}/search`,onClick:()=>{ve({topic:"전체"}),t(!1)},children:"전체"})}),pe.map(s=>e.jsx("li",{children:e.jsx(K,{className:"font-medium block px-[4px] py-[8px] rounded-md bg-gray-100 hover:bg-primary-100 text-gray-900 text-[15px] text-center whitespace-nowrap",to:`/${R}/search?topics=${s.label.replace(/\s+/g,"").replace("/",encodeURIComponent("/")).replace("&",encodeURIComponent("&"))}`,onClick:()=>{ve({topic:s.label}),t(!1)},children:s.label},s.name)},s.name))]})]})}),Kt=({thumbnail:t,lecturers:s,title:r,topic:o,topicCategory:u,highlightedText:d,imageWidth:y="100%",channel:l,isShowClassNameBox:f=!0})=>{const j=le(),v=Le();return e.jsxs("section",{className:"cursor-pointer rounded-lg flex flex-row group lg:gap-4 gap-[10px] lg:hover:shadow-card lg:p-[8px]",children:[e.jsxs("div",{style:{width:y},className:"relative flex-shrink-0",children:[e.jsx("div",{className:"flex justify-center w-full aspect-class overflow-hidden rounded-md",children:e.jsx("img",{src:Pe(t,"560"),alt:"",className:"rounded-md scale-100 duration-200 lg:group-hover:scale-105"})}),f&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"classnamebox"}),e.jsxs("div",{className:"flex items-center space-x-1 absolute bottom-0 px-2 py-1 w-full truncate",children:[e.jsx("i",{className:"ii-user text-sm text-secondary-50 z-20"}),e.jsx("div",{className:"text-xs font-medium !text-secondary-50 truncate z-20 mt-[2px]",children:s.join(",")})]})]})]}),e.jsxs("div",{className:"flex flex-col justify-start flex-1 min-w-0",children:[e.jsx("div",{className:E("text-[14px] leading-[20px] tracking-[-0.1px] !text-medi-text-primary font-bold line-clamp-1 pt-[3px]","lg:text-[18px lg:leading-[28px] lg:tracking-[-0.12px] lg:line-clamp-2 lg:pt-[8px]"),children:d?d(r):r}),!!l&&e.jsx("div",{className:E("truncate w-full line-clamp-1 text-[14px] font-semibold text-medi-text-tertiary leading-[20px] tracking-[-0.1px]",l!=null&&l.channelId?"hover:underline cursor-pointer":""),onClick:m=>{m.preventDefault(),m.stopPropagation(),j(`/${it}/${l==null?void 0:l.channelId}`)},children:l==null?void 0:l.title}),o!=null&&o.length||u!=null&&u.length?e.jsxs("div",{className:"overflow-hidden h-[22px] mt-[8px]",children:[o==null?void 0:o.map((m,C)=>e.jsx("div",{className:E("inline-block bg-secondary-100 mr-2 px-[6px] py-[2px] rounded-[3px] !text-medi-text-secondary text-[12px] leading-[18px] tracking-[-0.08px] font-medium whitespace-nowrap",v&&C>=2?"hidden":"block"),children:v&&C===2&&o.length>2?"...":m},`topic-${C}`)),u==null?void 0:u.map((m,C)=>e.jsx("div",{className:"inline-block bg-secondary-100 mr-2 px-[6px] py-[2px] rounded-[3px] !text-medi-text-secondary text-[12px] leading-[18px] tracking-[-0.08px] font-medium whitespace-nowrap",children:m},`cat-${C}`))]}):null]})]})},Ze=()=>e.jsxs(e.Fragment,{children:[e.jsxs(K,{className:"flex items-center justify-center h-[32px] leading-[32px] mr-2 px-2 py-[6px] rounded-full bg-teal-50 hover:bg-white shadow-custom",to:`/${R}/search?free=true`,children:[e.jsx("i",{className:"ii ii-currency-krw-outline text-teal-600 align-top text-[20px]"}),e.jsx("span",{className:"ml-[2px] text-[15px] font-semibold !text-teal-600",children:"무료"})]}),e.jsxs(K,{className:"flex items-center justify-center h-[32px] leading-[32px] mr-2 px-2 py-[6px] rounded-full bg-blue-50 hover:bg-white shadow-custom",to:`/${R}/search?level=입문`,children:[e.jsx(je,{level:"입문",background:"bg-blue-600"}),e.jsx("span",{className:"ml-1.5 text-[15px] font-semibold !text-blue-600",children:"입문"})]}),e.jsxs(K,{className:"flex items-center justify-center h-[32px] leading-[32px] mr-2 px-2 py-[6px] rounded-full bg-blue-50 hover:bg-white shadow-custom",to:`/${R}/search?level=초급`,children:[e.jsx(je,{level:"초급",background:"bg-blue-600"}),e.jsx("span",{className:"ml-1.5 text-[15px] font-semibold !text-blue-600",children:"초급"})]}),e.jsxs(K,{className:"flex items-center justify-center h-[32px] leading-[32px] mr-2 px-2 py-[6px] rounded-full bg-blue-50 hover:bg-white shadow-custom",to:`/${R}/search?level=중급`,children:[e.jsx(je,{level:"중급",background:"bg-blue-600"}),e.jsx("span",{className:"ml-1.5 text-[15px] font-semibold !text-blue-600",children:"중급"})]}),e.jsxs(K,{className:"flex items-center justify-center h-[32px] leading-[32px] mr-2 px-2 py-[6px] rounded-full bg-blue-50 hover:bg-white shadow-custom",to:`/${R}/search?level=고급`,children:[e.jsx(je,{level:"고급",background:"bg-blue-600"}),e.jsx("span",{className:"ml-1.5 text-[15px] font-semibold !text-blue-600",children:"고급"})]})]}),ut=()=>{const t=le(),[s]=Ne(),r=s.get("q")||"",[o,u]=N.useState(r);N.useEffect(()=>{u(s.get("q")||"")},[s]);const d=f=>{const{currentTarget:{value:j}}=f;u(j)},y=()=>{u("");const f=new URLSearchParams(s);f.delete("q");const j=f.toString();t(`/${R}/search${j?`?${j}`:""}`)},l=f=>
1{if(f.preventDefault(),o===""){y();return}const j=new URLSearchParams(s);j.set("q",o),t(`/${R}/search?${j}`)};return e.jsxs("form",{className:"relative",onSubmit:l,children:[e.jsx("i",{className:"ii ii-search z-[10] absolute top-[10px] left-[12px] h-[20px] leading-[20px] text-[20px] text-medi-text-secondary"}),e.jsx("input",{className:"flex items-center w-full bg-gray-50 focus:bg-white focus:drop-shadow-md h-[44px] px-[40px] rounded-md text-[16px] placeholder:text-medi-text-placeholder",type:"text",value:o,placeholder:"검색어를 입력해주세요.",onChange:d,onBlur:f=>{f.target.value||y()}}),o&&e.jsx("button",{className:"absolute top-0 right-0 w-[40px] h-[40px]",type:"button",onClick:y,children:e.jsx("i",{className:"ii ii-remove text-[20px] text-gray-800"})}),e.jsx("button",{className:"hidden",type:"submit",children:"검색"})]})},Ht=async({curationId:t})=>{if(!z)throw new Error("[getClassCurationsDetailApi] publicApi 주입에 실패했습니다.");if(!t)throw new Error("[getClassCurationsDetailApi] curationId가 없습니다.");const s=await z.get(`/class/curations/${t}`);if(s.status>=200&&s.status<300&&s.data)return s.data;throw new Error("[getClassCurationsDetailApi] 서버 요청에 실패했습니다.")},ht=async({curationId:t})=>{if(!z)throw new Error("[getClassPublicCurationsDetailApi] publicApi 주입에 실패했습니다.");if(!t)throw new Error("[getClassPublicCurationsDetailApi] curationId가 없습니다.");const s=await z.get(`/class/public/curations/${t}`);if(s.status>=200&&s.status<300&&s.data)return s.data;throw new Error("[getClassPublicCurationsDetailApi] 서버 요청에 실패했습니다.")},ft=async t=>{var s;try{const r=await((s=z)==null?void 0:s.get("/class/public/courses/search",{params:t}));return r==null?void 0:r.data.results.hits}catch(r){return console.error("getCoursesSearchApi API error:",r),[]}},Yt=async t=>ft({free:!0,...t&&{limit:t}}),Ut=async t=>{var s;try{const{data:r}=await((s=z)==null?void 0:s.get(`/market/products/${t.productId}/related-contents?contentType=${t.contentType}`));return r.data}catch(r){return console.error("getCourseRelatedContentsApi API error:",r),[]}},zt=async t=>{var s;try{const{data:r}=await((s=z)==null?void 0:s.get(`/class/public/courses/product/${t.productId}`));return r}catch(r){return console.error("getCourse API error:",r),[]}},Fe={all:["klass"],search:t=>["/class/public/courses/search",t],free:()=>["/class/public/courses/search",{free:!0}],relatedContents:t=>["/market/products",t.productId,"related-contents",t.contentType],product:t=>["/class/public/courses/product",t.productId],relatedProducts:t=>["/class/public/courses/product","related",t]},Gt=(t,s)=>V({queryKey:Fe.search(t),queryFn:()=>ft(t),...s}),Vt=(t,s)=>V({queryKey:Fe.free(),queryFn:()=>Yt(t),cacheTime:15*60*1e3,staleTime:15*60*1e3,...s}),et=(t,s)=>V({queryKey:Fe.relatedContents(t),queryFn:()=>Ut(t),enabled:!!t.productId&&!!t.contentType,...s}),Wt=(t,s)=>V({queryKey:Fe.relatedProducts(t),queryFn:()=>Promise.all(t.map(r=>zt({productId:r}))),enabled:(t==null?void 0:t.length)>0,select:r=>r.map(o=>o.course),...s}),Qt=()=>{var C,A,b,h;const t=ae(ie),s=Le(),{data:r,isLoading:o}=V("KlassCurations",()=>{var i;return(i=z)==null?void 0:i.get("/class/public/curations").then(c=>c.data.curations)},{refetchOnWindowFocus:!1}),{data:u,isLoading:d}=Vt(3),{data:y,isLoading:l}=$t(),f=r==null?void 0:r.reduce((i,c)=>{var P;return[...i,...((P=c.courses)==null?void 0:P.map(x=>{var g;return(g=x==null?void 0:x.products[0])==null?void 0:g.productId}))||[]]},[]).filter(i=>i),{data:j}=_e({ids:f},{select:i=>(i==null?void 0:i.hits)||[],enabled:!!(t!=null&&t.uid)&&((C=f||[])==null?void 0:C.length)>0}),v=i=>{var c;return(c=j==null?void 0:j.find(P=>P.id===i))==null?void 0:c.is_sold_out};N.useEffect(()=>{r&&ht({curationId:r[0].curationId})},[r]);const m=!!y&&(y.channels.length??0)>=3;return!r||o||d||l?e.jsx(me,{small:!0}):e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsxs("div",{className:"w-full max-w-[1200px] lg:px-4 lg:pt-4 xl:px-0",children:[e.jsx("div",{className:"hidden lg:block",children:e.jsx(oe,{name:"pc_Klass_top",page:"Klass"})}),e.jsx(qt,{}),e.jsx("hr",{className:"hidden lg:block h-[1px] bg-gray-200 border-0"})]}),e.jsxs("div",{className:"w-full max-w-[1200px] px-4 xl:px-0",children:[e.jsxs("div",{className:"lg:mt-5 lg:mb-10",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row items-center",children:[e.jsx("div",{className:"w-full my-[12px] lg:flex-1 lg:mr-2.5 lg:my-0",children:e.jsxs(K,{className:"flex items-center justify-center gap-[5px] h-[44px] lg:w-[134px] p-[10px] rounded-md bg-secondary-800 text-[15px] font-semibold leading-[22px] tracking-[-0.1px] text-white whitespace-nowrap hover:bg-secondary-900",to:`/mypage/${R}`,children:[e.jsx("i",{className:"ii ii-user-screen-outline text-[24px] text-white"}),"내 강의실 이동"]})}),e.jsx("div",{className:"hidden lg:flex flex-0 pr-2",children:e.jsx(Ze,{})}),e.jsx("div",{className:"flex-0 border border-medi-border-primary w-full lg:w-[328px] my-[12px] lg:my-0 rounded-[5px]",children:e.jsx(ut,{})})]}),e.jsx("div",{className:"flex lg:hidden overflow-auto whitespace-nowrap border-t border-b border-medi-border-primary py-[12px] mx-[-16px] pl-[16px]",children:e.jsx(Ze,{})})]}),e.jsxs("div",{className:"mb-10 lg:mb-14 grid grid-cols-1 lg:grid-cols-2 gap-[43px]",children:[r[0]&&e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between py-[14px]",children:[e.jsx("h3",{className:"leading-[36px] tracking-[-0.14px] text-medi-text-primary text-[24px] font-bold",children:r[0].title}),e.jsx(K,{className:"block",to:`/${R}/curation/${r[0].curationId}`,children:e.jsxs("span",{className:"flex items-center justify-center whitespace-nowrap rounded-[4px] px-[8px] py-[4px] text-[13px] font-semibold tracking-[-0.33px] leading-[20px] text-secondary-700 hover:cursor-pointer hover:bg-gray-200 hover:text-secondary-800",children:[e.jsx("i",{className:"ii ii-plus ii-weight-600 text-secondary-800 mr-0.5 text-[12px]"}),"더보기"]})})]}),e.jsx("div",{className:"grid grid-cols-2 gap-x-[11px] gap-y-[24px]",children:(A=r[0].courses)==null?void 0:A.slice(0,4).map(i=>{var P,x,g,p,F;const c=((P=i.courses)==null?void 0:P.find(T=>T.courseId===i.defaultCourseId))||i;return e.jsx(K,{className:"block",to:`/${R}/course/${c.courseId}`,children:e.jsx(se,{thumbnail:c.thumbnailImage.link,lecturers:c.lecturerNames,title:c.title,regularPrice:(x=c.products[0])==null?void 0:x.regularPrice,salePrice:(g=c.products[0])==null?void 0:g.salePrice,topic:c.groupedBadges.topics,topicCategory:c.groupedBadges.topicCategory,level:(p=c.groupedBadges.level)==null?void 0:p.join(","),isFree:c.isFree,isSoldOut:v(((F=c.products[0])==null?void 0:F.productId)||""),channel:c.channel})},c.courseId)})})]}),u&&u.length>0&&e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"mb-[16px] sm:mb-[12px] relative mx-[-16px] lg:mx-0",children:[e.jsx("img",{src:"/img/klass/klass-home-free-banner.png",alt:"무료 강의 배너",className:"w-full lg:h-[246px] lg:rounded-md"}),e.jsxs("div",{className:E("p-[16px] absolute top-0 left-0 w-full h-full gap-[16px] text-center flex flex-col items-center justify-center","sm:justify-between sm:gap-[10px] sm:text-left sm:w-auto 
1sm:h-auto sm:bottom-[26px] sm:left-[26px] sm:px-0 sm:right-[26px] sm:flex-row sm:items-end"),children:[e.jsxs("p",{className:"text-[20px] sm:text-[28px] font-bold text-white tracking-[-0.12px] sm:tracking-[-0.14px] leading-[30px] sm:leading-[42px]",children:["모어덴에서 제공하는 ",e.jsx("br",{}),"놓치지 말아야 할 무료 강의"]}),e.jsxs(K,{to:`/${R}/search?free=true`,className:"w-full sm:w-auto whitespace-nowrap justify-center font-bold text-white text-[14px] leading-[20px] tracking-[-0.1px] px-[14px] py-[10px] flex items-center gap-[4px] rounded-[999px] border border-[rgba(255,255,255,0.10)] bg-[rgba(255,255,255,0.30)] hover:bg-[rgba(255,255,255,0.40)] backdrop-blur-[4px]",children:["무료 강의 더보기",e.jsx("i",{className:"ii ii-arrow-right ii-weight-600 text-white text-[16px]"})]})]})]}),e.jsx("div",{className:"flex flex-col gap-[16px] sm:gap-[8px]",children:u.slice(0,3).map(i=>{var c,P,x,g,p,F;return e.jsx(K,{className:"block",to:`/${R}/course/${i.id}`,children:e.jsx(Kt,{thumbnail:i.thumbnailImageUrl,lecturers:i.lecturers,title:i.title,regularPrice:(c=i==null?void 0:i.product)==null?void 0:c.regularPrice,salePrice:(P=i==null?void 0:i.product)==null?void 0:P.salePrice,topic:(x=i==null?void 0:i.groupedBadges)==null?void 0:x.topics,topicCategory:(g=i==null?void 0:i.groupedBadges)==null?void 0:g.topicCategory,level:(F=(p=i==null?void 0:i.groupedBadges)==null?void 0:p.level)==null?void 0:F.join(","),isFree:i.isFree,imageWidth:s||window.innerWidth<1024?"128px":"224px",channel:i.channel,isShowClassNameBox:!s})},i.id)})})]})]}),e.jsxs("div",{className:"mb-10 lg:mb-14 md:grid grid grid-flow-row md:grid-flow-col md:grid-cols-3 gap-5 md:gap-5 lg:gap-11",children:[e.jsx(oe,{name:"pc_Klass_middle_left",page:"Klass",width:"full"}),e.jsx(oe,{name:"pc_Klass_middle_center",page:"Klass",width:"full"}),e.jsx(oe,{name:"pc_Klass_middle_right",page:"Klass",width:"full"})]}),r[1]&&e.jsxs("div",{className:"mb-10 lg:mb-14",children:[e.jsxs("div",{className:"flex items-center justify-between py-[14px]",children:[e.jsx("h3",{className:"leading-[36px] tracking-[-0.14px] text-medi-text-primary text-[24px] font-bold",children:r[1].title}),e.jsx(K,{className:"block",to:`/${R}/curation/${r[1].curationId}`,children:e.jsxs("span",{className:"flex items-center justify-center whitespace-nowrap rounded-[4px] px-[8px] py-[4px] text-[13px] font-semibold tracking-[-0.33px] leading-[20px] text-secondary-700 hover:cursor-pointer hover:bg-gray-200 hover:text-secondary-800",children:[e.jsx("i",{className:"ii ii-plus ii-weight-600 text-secondary-800 mr-0.5 text-[12px]"}),"더보기"]})})]}),e.jsx(xe,{navigationTop:"top-[67px]",children:(b=r[1].courses)==null?void 0:b.map(i=>{var P,x,g,p;const c=((P=i.courses)==null?void 0:P.find(F=>F.courseId===i.defaultCourseId))||i;return e.jsx(te,{children:e.jsx(K,{className:"block",to:`/${R}/course/${c.courseId}`,children:e.jsx(se,{thumbnail:c.thumbnailImage.link,lecturers:c.lecturerNames,title:c.title,regularPrice:(x=c.products[0])==null?void 0:x.regularPrice,salePrice:(g=c.products[0])==null?void 0:g.salePrice,topic:c.groupedBadges.topics,topicCategory:c.groupedBadges.topicCategory,level:(p=c.groupedBadges.level)==null?void 0:p.join(","),isSwiper:!0,isFree:c.isFree,channel:c.channel})})},c.courseId)})})]}),e.jsx("div",{className:"hidden lg:block mb-10 lg:mb-14",children:e.jsx(oe,{name:"pc_Klass_middle_second",page:"Klass"})}),r[2]&&e.jsxs("div",{className:"mb-10 lg:mb-14",children:[e.jsxs("div",{className:"flex items-center justify-between py-[14px]",children:[e.jsx("h3",{className:"leading-[36px] tracking-[-0.14px] text-medi-text-primary text-[24px] font-bold",children:r[2].title}),e.jsx(K,{className:"block",to:`/${R}/curation/${r[2].curationId}`,children:e.jsxs("span",{className:"flex items-center justify-center whitespace-nowrap rounded-[4px] px-[8px] py-[4px] text-[13px] font-semibold tracking-[-0.33px] leading-[20px] text-secondary-700 hover:cursor-pointer hover:bg-gray-200 hover:text-secondary-800",children:[e.jsx("i",{className:"ii ii-plus ii-weight-600 text-secondary-800 mr-0.5 text-[12px]"}),"더보기"]})})]}),e.jsx(xe,{navigationTop:"top-[67px]",children:(h=r[2].courses)==null?void 0:h.map(i=>{var P,x,g,p;const c=((P=i.courses)==null?void 0:P.find(F=>F.courseId===i.defaultCourseId))||i;return e.jsx(te,{children:e.jsx(K,{className:"block",to:`/${R}/course/${c.courseId}`,children:e.jsx(se,{thumbnail:c.thumbnailImage.link,lecturers:c.lecturerNames,title:c.title,regularPrice:(x=c.products[0])==null?void 0:x.regularPrice,salePrice:(g=c.products[0])==null?void 0:g.salePrice,topic:c.groupedBadges.topics,topicCategory:c.groupedBadges.topicCategory,level:(p=c.groupedBadges.level)==null?void 0:p.join(","),isSwiper:!0,isFree:c.isFree,channel:c.channel})})},c.courseId)})})]})]}),m&&e.jsx("section",{className:"w-full mb-10 lg:mb-14",children:e.jsx(At,{channelListResponse:y,page:"클래스 홈"})}),e.jsx("div",{className:"w-full max-w-[1200px] px-4 xl:px-0",children:r==null?void 0:r.filter((i,c)=>i&&c>2).map(i=>{var c,P;return e.jsxs("div",{className:"mb-10 lg:mb-14",children:[e.jsxs("div",{className:"flex items-center justify-between py-[14px]",children:[e.jsx("h3",{className:"leading-[36px] tracking-[-0.14px] text-medi-text-primary text-[24px] font-bold",children:i.title}),e.jsx(K,{className:"block",to:`/${R}/curation/${i.curationId}`,children:e.jsxs("span",{className:"flex items-center justify-center whitespace-nowrap rounded-[4px] px-[8px] py-[4px] text-[13px] font-semibold tracking-[-0.33px] leading-[20px] text-secondary-700 hover:cursor-pointer hover:bg-gray-200 hover:text-secondary-800",children:[e.jsx("i",{className:"ii ii-plus ii-weight-600 text-secondary-800 mr-0.5 text-[12px]"}),"더보기"]})})]}),e.jsx("div",{className:"hidden lg:block",children:e.jsx(xe,{navigationTop:"top-[67px]",children:(c=i.courses)==null?void 0:c.map(x=>{var p,F,T,M;const g=((p=x.courses)==null?void 0:p.find(H=>H.courseId===x.defaultCourseId))||x;return e.jsx(te,{children:e.jsx(K,{className:"block",to:`/${R}/course/${g.courseId}`,children:e.jsx(se,{thumbnail:g.thumbnailImage.link,lecturers:g.lecturerNames,title:g.title,regularPrice:(F=g.products[0])==null?void 0:F.regularPrice,salePrice:(T=g.products[0])==null?void 0:T.salePrice,topic:g.groupedBadges.topics,topicCategory:g.groupedBadges.topicCategory,level:(M=g.groupedBadges.level)==null?void 0:M.join(","),isSwiper:!0,isFree:g.isFree,channel:g.channel})})},g.courseId)})})}),e.jsx("div",{className:"lg:hidden",children:e.jsx(xe,{navigationTop:"top-[67px]",children:(P=i.courses)==null?void 0:P.map(x=>{var p,F,T,M;const g=((p=x.courses)==null?void 0:p.find(H=>H.courseId===x.defaultCourseId))||x;return e.jsx(te,{children:e.jsx(K,{className:"block",to:`/${R}/course/${g.courseId}`,children:e.jsx(se,{thumbnail:g.thumbnailImage.link,lecturers:g.lecturerNames,title:g.title,regularPrice:(F=g.products[0])==null?void 0:F.regularPrice,salePrice:(T=g.products[0])==null?void 0:T.salePrice,topic:g.groupedBadges.topics,topicCategory:g.groupedBadges.topicCategory,level:(M=g.groupedBadges.level)==null?void 0:M.join(","),isFree:g.isFree,isSwiper:!0,channel:g.channel})})},g.courseId)})})})]},i.curationId)})})]})},Xt=()=>{const[t,s]=N.useState(!1),[r]=Ne(),o=r.get("topics")||"전체",[u,d]=N.useState(null),y=o==="전체"?0:pe.findIndex(l=>l.label.replace(/\s+/g,"")===o)+1;return N.useEffect(()=>{u==null||u.slideTo(y,0)},[u,y]),e.jsxs("div",{className:"h-[44px] lg:h-[50px] border-b border-solid border-b-gray-300 relative",children:[e.jsxs(Me,{modules:[Tt],freeMode:!0,grabCursor:!0,slidesPerView:"auto",initialSlide:y,onSwiper:d,breakpoints:{1024:{slidesOffsetAfter:100}},className:"mx-[6px] h-[44px] lg:h-[50px] text-[18px] lg:mx-[-10px]",children:[e.jsx(te,{className:"!w-auto",children:e.jsxs(K,{className:E("block relative h-[44px] lg:h-[50px] leading-[50px] px-[10px] font-medium text-[16px] lg:font-semibold lg:text-[18px]",o==="전체"?"text-medi-color-purple-600":"text-medi-text-primary"),to:`/${R}/search`,onClick:()=>ve({topic:"전체"}),children:["전체",e.jsx("span",{className:E("absolute right-[10px] bottom-0 left-[10px] h-[4px]",o==="전체"?"bg-medi-color-purple-600":"bg-transparent")})]})}),pe.map(l=>e.jsx(te,{className:"!w-auto",children:e.jsxs(K,{className:E("block relative h-[44px] lg:h-[50px] leading-[50px] px-[10px] font-medium text-[16px] lg:font-semibold lg:text-[18px]",l.label.replace(/\s+/g,"")===o?"text-medi-color-purple-600":"text-medi-text-primary"),to:`/${R}/search?topics=${l.label.replace(/\s+/g,"").replace("/",encodeURIComponent("/")).replace("&",encodeURIComponent("&"))}`,onClick:()=>ve({topic:l.label}),children:[l.label,e.jsx("span",{className:E("absolute right-[10px] bottom-0 left-[10px] h-[4px]",l.label.replace(/\s+/g,"")===o?"bg-medi-color-purple-600":"bg-transparent")})]})},l.name))]}),e.jsx("div",{className:"pointer-events-none z-10 hidden lg:flex lg:items-center lg:justify-end lg:pr-[10px] w-[100px] h-full cursor-pointer absolute right-[-10px] top-0",style:{background:"linear-gradient(270deg, #FFFFFF 70%, rgba(255, 255, 255, 0) 100%)"},children:e.jsx("div",{onClick:()=>s(!t),className:"pointer-events-auto hidden lg:flex lg:justify-center lg:items-center shadow-card bg-white w-[35px] h-[35px] rounded-full",children:e.jsx("i",{className:E(t?"ii-chevron-up":"ii-chevron-down","text-gray-900 text-[20px]")})})}),t&&e.jsx(gt,{setTopicsMenuDisplay:s})]})},ne="ALL",tt="__dummy__",ye="drYoungAcademy",Ae=()=>e.jsx("span",{className:"mr-[5px] inline-block h-[5px] w-[5px] shrink-0 rounded-full bg-[#FF228C] align-middle"}),Jt=t=>{const[s,r]=Ne(),o=s.get("topics"),u=s.get("topicCategory")||ne,d=s.get("topicSubCategory")||ne,y=s.get("categoryGroup"),l=pe.find(p=>p.label.replace(/\s+/g,"")===o),f=l?nt[l.name]:void 0,j=new Set,v=new Set;t==null||t.forEach(p=>{var F,T,M,H;(T=(F=p.groupedBadges)==null?void 0:F.topicCategory)==null||T.forEach(U=>j.add(U)),(H=(M=p.groupedBadges)==null?void 0:M.topicSubCategory)==null||H.forEach(U=>v.add(U))});const m=t?f==null?void 0:f.filter(p=>j.has(p.label)):f,C=!!m&&m.length>0,A=!!(m!=null&&m.some(p=>p.isDrYoungAcademy)),b=y===ye?m==null?void 0:m.filter(p=>p.isDrYoungAcademy):m,h=m==null?void 0:m.find(p=>p.name===u),i=(h==null?void 0:h.children)??[],c=t?i.filter(p=>v.has(p.label)):i;return{currentTopic:l,topicCategoryList:m,visibleTopicCategoryList:b,topicSubCategoryList:c,selectedTopicCategoryName:u,selectedTopicSubCategoryName:d,categoryGroup:y,hasDyGroup:A,selectGroup:p=>{r(F=>(F.delete("topicCategory"),F.delete("topicSubCategory"),F.delete("q"),p?F.set("categoryGroup",p):F.delete("categoryGroup"),F))},hasCategoryNav:C,selectTopicCategory:p=>{var F;p!==ne&&Ve({depth:"category",topic:l==null?void 0:l.label,category:((F=f==null?void 0:f.find(T=>T.name===p))==null?void 0:F.label)??p}),r(T=>(T.delete("topicSubCategory"),T.delete("q"),p===ne?T.delete("topicCategory"):T.set("topicCategory",p),T))},selectTopicSubCategory:p=>{var F,T;p!==ne&&Ve({depth:"subcategory",topic:l==null?void 0:l.label,category:h==null?void 0:h.label,subcategory:((T=(F=h==null?void 0:h.children)==null?void 0:F.find(M=>M.name===p))==null?void 0:T.label)??p}),r(M=>(M.delete("q"),p===ne?M.delete("topicSubCategory"):M.set("topicSubCategory",p),M))},ALL:ne}},Zt=({nav:t})=>{const{currentTopic:s,topicCategoryList:r,visibleTopicCategoryList:o,topicSubCategoryList:u,selectedTopicCategoryName:d,selectedTopicSubCategoryName:y,categoryGroup:l,hasDyGroup:f,selectGroup:j,selectTopicCategory:v,selectTopicSubCategory:m,ALL:C}=t,[A,b]=N.useState(!1),[h,i]=N.useState(16),[c,P]=N.useState(100),x=N.useRef(null),g=N.useRef(null),p=N.useRef(null);N.useEffect(()=>{const S=Y=>{x.current&&!x.current.contains(Y.target)&&b(!1)};
1return A&&document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[A]);const F=()=>{g.current&&i(g.current.offsetLeft),p.current&&P(p.current.offsetTop+p.current.offsetHeight),b(S=>!S)};if(!s||!r)return null;const T=r.find(S=>S.name===d),M=d!==C&&!!T,H=u.find(S=>S.name===y),U=M&&u.length>0,O=U?[{name:C,label:"전체"},...u]:[{name:C,label:"전체"},...o??[]],_=O.length%2>0?[...O,{name:`${tt}-0`,label:""}]:O,q=S=>{U?m(S):v(S),b(!1)},L=S=>U?y===S:d===S;return e.jsxs("div",{className:"relative flex flex-col",ref:x,children:[e.jsxs("div",{ref:p,className:"flex items-center gap-2 p-3 lg:px-4 lg:pt-4 xl:px-0",children:[f&&e.jsx("div",{className:"inline-flex shrink-0 gap-1 rounded-[8px] bg-secondary-100 p-[2px] text-[13px] font-semibold lg:p-[3px] lg:text-[14px]",children:[[null,"피부미용 카테고리"],[ye,"최재영 카테고리"]].map(([S,Y])=>{const W=S===ye?l===ye:l!==ye;return e.jsx("button",{type:"button",onClick:()=>{j(S),b(!1)},className:E("whitespace-nowrap rounded-[5px] px-[10px] py-[5px] lg:rounded-[6px] lg:px-4 lg:py-[6px]",W?"bg-white text-primary-700 shadow-sm":"text-secondary-600"),children:Y},Y)})}),!f&&e.jsx("div",{className:"inline-flex shrink-0 gap-1 rounded-[8px] bg-secondary-100 p-[2px] text-[13px] font-semibold lg:p-[3px] lg:text-[14px]",children:e.jsxs("button",{type:"button",onClick:()=>{v(C),b(!1)},className:"whitespace-nowrap rounded-[5px] bg-white px-[10px] py-[5px] text-primary-700 shadow-sm lg:rounded-[6px] lg:px-4 lg:py-[6px]",children:[s.label," 카테고리"]})}),e.jsxs("div",{className:"flex h-[16px] min-w-0 items-center gap-[4px] overflow-x-auto overflow-y-hidden whitespace-nowrap text-[13px] scroll_none lg:text-[14px]",children:[M?e.jsxs("button",{ref:g,type:"button",className:E("flex items-center font-medium leading-normal text-medi-text-tertiary",y===C&&!A&&"!text-medi-text-primary",y!==C&&A&&"!font-bold !text-medi-text-secondary",y===C&&A&&"!font-bold !text-medi-text-primary"),onClick:F,children:[T.label,e.jsx("i",{className:"ii ii-caret-down ii-weight-600 text-[24px] text-secondary-900"})]}):null,M&&H&&y!==C&&e.jsxs(e.Fragment,{children:[e.jsx("i",{className:"ii ii-chevron-right ii-weight-600 flex h-[16px] items-center justify-center text-[16px] text-secondary-500"}),e.jsx("span",{className:"font-medium leading-normal text-medi-text-primary",children:H.label})]})]})]}),e.jsx("div",{className:"border-b-[8px] border-solid border-secondary-100 lg:hidden",children:e.jsx("div",{className:"flex flex-wrap border-l border-t border-solid border-secondary-200",children:_.map(S=>{const Y=S.name.startsWith(tt);return e.jsxs("button",{type:"button",disabled:Y,className:E("flex w-1/2 items-center border-b border-r border-solid border-secondary-200 px-4 py-[8px] text-left","text-[14px] leading-[20px] tracking-[0.1px] text-medi-text-primary",L(S.name)&&"bg-primary-100 font-bold !text-primary-700",Y&&"cursor-default"),onClick:()=>!Y&&q(S.name),children:["isDrYoungAcademy"in S&&S.isDrYoungAcademy?e.jsx(Ae,{}):null,e.jsx("span",{className:"min-w-0 break-keep",children:S.label})]},S.name)})})}),e.jsx("div",{className:"hidden lg:block lg:px-4 xl:px-0",children:e.jsx("ul",{className:"box-border flex w-fit flex-wrap items-center overflow-hidden rounded-md border border-solid border-secondary-200",children:O.map(S=>e.jsxs("li",{className:E("relative flex cursor-pointer items-center px-[12px] py-[10px] text-[14px] leading-[17px] tracking-[-0.35px]","after:absolute after:right-0 after:top-1/2 after:block after:h-[16px] after:w-[1px] after:-translate-y-1/2 after:bg-secondary-300 after:content-[''] last:after:hidden",L(S.name)?"bg-primary-100 font-semibold text-primary-700 hover:bg-primary-200":"text-secondary-600 hover:bg-secondary-100"),onClick:()=>q(S.name),children:["isDrYoungAcademy"in S&&S.isDrYoungAcademy?e.jsx(Ae,{}):null,S.label]},S.name))})}),A&&e.jsx("div",{style:{top:c},className:"absolute left-0 right-0 z-[999] h-screen bg-black/40 backdrop-blur-sm lg:hidden",onClick:()=>b(!1)}),A&&e.jsx("div",{style:{top:c,"--topic-category-dropdown-left":`${h}px`},className:E("absolute z-[1000] p-[10px]","grid grid-cols-2 gap-[4px] lg:grid-cols-3","left-0 right-0 w-full lg:left-[var(--topic-category-dropdown-left)] lg:right-auto lg:w-[502px]","bg-white lg:rounded-[6px]","max-h-[473px] overflow-y-auto","shadow-[0px_0px_0px_1px_rgba(212,215,223,0.50),0px_6px_16px_0px_rgba(37,40,46,0.10),0px_6px_16px_-4px_rgba(37,40,46,0.10)]"),children:r.map(S=>e.jsxs("button",{type:"button",className:E("flex items-center rounded-[4px] p-[8px] text-left text-[14px] leading-[20px]",d===S.name?"bg-primary-100 font-bold text-primary-700 lg:hover:bg-primary-200":"font-normal text-medi-text-secondary lg:hover:bg-secondary-100"),onClick:Y=>{Y.stopPropagation(),v(S.name),b(!1)},children:[S.isDrYoungAcademy&&e.jsx(Ae,{}),S.label]},S.name))})]})},st=[{value:"",label:"정렬"},{value:"createdAt:desc",label:"최신순"},{value:"isFree:asc,product.salePrice:asc",label:"가격순"},{value:"title:asc",label:"이름순"},{value:"threeMonthlySales:desc",label:"인기순"}],he=[{param:void 0,value:"전체"},{param:"true",value:"무료"},{param:"false",value:"유료"}],fe=[{param:void 0,value:"전체"},{param:"입문",value:"입문"},{param:"초급",value:"초급"},{param:"중급",value:"중급"},{param:"고급",value:"고급"}],es=[{name:"upper R",value:"upper-right"},{name:"upper L",value:"upper-left"},{name:"lower R",value:"lower-right"},{name:"lower L",value:"lower-left"}],ts=200,ss=()=>{var S,Y,W,J;const[t,s]=Ne(),r={free:((S=he.filter(a=>a.param===t.get("free"))[0])==null?void 0:S.value)||he[0].value,level:((Y=fe.filter(a=>a.param===t.get("level"))[0])==null?void 0:Y.value)||fe[0].value,lecturers:((W=t.get("lecturers"))==null?void 0:W.split(","))||[],toothNumbers:((J=t.get("toothNumbers"))==null?void 0:J.split(",").map(a=>parseInt(a,10)))||[],sort:t.get("sort")||"threeMonthlySales:desc"},[o,u]=N.useState(0),[d,y]=N.useState(0),[l,f]=N.useState(!1),[j,v]=N.useState(r.free),[m,C]=N.useState(r.level),[A,b]=N.useState(r.lecturers),[h,i]=N.useState(r.toothNumbers),[c,P]=N.useState([]),[x,g]=N.useState(r.sort),{data:p,isLoading:F}=V("KlassLecturers",()=>{var a;return(a=z)==null?void 0:a.get("/class/public/lecturers").then(n=>n.data)}),T=N.useCallback(()=>{var B,D;const a={},n=(B=he.filter(G=>G.value===j)[0])==null?void 0:B.param,I=(D=fe.filter(G=>G.value===m)[0])==null?void 0:D.param;return n&&(a.free=n),I&&(a.level=I),A.length>
10&&(a.lecturers=A.join(",")),h.length>0&&(a.toothNumbers=h.join(",")),x&&(a.sort=x),a},[j,m,A,h,x]),M=a=>{const n=a.currentTarget.value;v(n)},H=a=>{const n=a.currentTarget.value;C(n)},U=a=>{const n=a.currentTarget.checked,I=a.currentTarget.value;b(B=>{if(n){if(!B.includes(I))return[...B,I]}else{const D=B.indexOf(I);if(D!==-1)return[...B.slice(0,D),...B.slice(D+1)]}return B})},O=a=>{const n=a.currentTarget.checked,I=a.currentTarget.value,B=parseInt(I,10);i(D=>{if(n){if(!D.includes(B))return[...D,B]}else{const G=D.indexOf(B);if(G!==-1)return[...D.slice(0,G),...D.slice(G+1)]}return D})},_=a=>{const n=a.currentTarget.checked,I=a.currentTarget.value;P(B=>{if(n){if(!B.includes(I))return[...B,I]}else{const D=B.indexOf(I);if(D!==-1)return[...B.slice(0,D),...B.slice(D+1)]}return B}),Z.filter(B=>B.zone===I).forEach(B=>{i(D=>{if(n){if(!D.includes(B.id))return[...D,B.id]}else{const G=D.indexOf(B.id);if(G!==-1)return[...D.slice(0,G),...D.slice(G+1)]}return D})})},q=()=>{v(he[0].value),C(fe[0].value),b([]),i([])},L=()=>{const a=T();t.get("q")&&(a.q=t.get("q")||void 0),t.get("topics")&&(a.topics=t.get("topics")||void 0),t.get("topicCategory")&&(a.topicCategory=t.get("topicCategory")||void 0),t.get("topicSubCategory")&&(a.topicSubCategory=t.get("topicSubCategory")||void 0),t.get("categoryGroup")&&(a.categoryGroup=t.get("categoryGroup")||void 0),s(a,{replace:!0}),f(!1)};return N.useEffect(()=>{const a=T();t.get("q")&&(a.q=t.get("q")||void 0),t.get("topics")&&(a.topics=t.get("topics")||void 0),t.get("topicCategory")&&(a.topicCategory=t.get("topicCategory")||void 0),t.get("topicSubCategory")&&(a.topicSubCategory=t.get("topicSubCategory")||void 0),t.get("categoryGroup")&&(a.categoryGroup=t.get("categoryGroup")||void 0),s(a,{replace:!0})},[x]),N.useEffect(()=>{var n;const a=T();t.get("q")&&(a.q=t.get("q")||void 0),t.get("topics")&&(a.topics=t.get("topics")||void 0),(n=z)==null||n.get("/class/public/courses/search",{params:{q:a.q,topics:a.topics,free:a.free,level:a.level,lecturers:a.lecturers,toothNumbers:a.toothNumbers,limit:ts}}).then(I=>{var D,G;const B=((G=(D=I.data)==null?void 0:D.results)==null?void 0:G.estimatedTotalHits)||0;u(B)})},[j,m,A,h]),N.useEffect(()=>{let a=0;t.get("free")&&(a+=1),t.get("level")&&(a+=1),t.get("lecturers")&&(a+=1),t.get("toothNumbers")&&(a+=1),y(a)},[t]),N.useEffect(()=>{const a={"upper-right":0,"upper-left":0,"lower-right":0,"lower-left":0};Z.forEach(n=>{h.includes(n.id)&&(a[n.zone]+=1)}),Object.keys(a).forEach(n=>{P(I=>{if(a[n]===8){if(!I.includes(n))return[...I,n]}else{const B=I.indexOf(n);if(B!==-1)return[...I.slice(0,B),...I.slice(B+1)]}return I})})},[h]),e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:E("inline-block relative min-w-[80px] h-[36px] leading-[36px] pr-[30px] pl-[8px] rounded text-left",d>0?"bg-medi-color-purple-600 hover:bg-medi-color-purple-700 text-white":"border border-solid border-gray-800 bg-transparent hover:bg-gray-50 text-gray-800"),type:"button",onClick:()=>f(!0),children:[d||""," 필터",e.jsx("i",{className:E("ii ii-sliders ii-weight-600","text-[17px] absolute top-0 right-[8px]",d>0?"text-white":"text-gray-800")})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(Et,{options:st,value:st.filter(a=>a.value===x)[0],onChange:a=>{a&&g(a.value)},className:"w-[85px] text-left"})}),l&&e.jsxs("div",{className:"z-[520] relative inline-block text-left",children:[e.jsx("div",{className:"z-1 fixed top-0 right-0 bottom-0 left-0 bg-black/50"}),e.jsxs("div",{className:"z-2 flex flex-col overflow-hidden fixed top-0 right-0 bottom-0 left-0 lg:top-[50%] lg:right-auto lg:bottom-auto lg:left-[50%] lg:transform lg:translate-x-[-50%] lg:translate-y-[-50%] w-[100%] lg:max-w-[800px] lg:max-h-[90vh] lg:rounded-lg bg-white shadow-custom",children:[e.jsx("button",{className:"absolute top-[20px] right-[20px] w-[40px] h-[40px]",type:"button",title:"닫기",onClick:()=>f(!1),children:e.jsx("i",{className:"ii ii-remove text-[24px]"})}),e.jsxs("form",{className:"overflow-auto flex-1 p-[16px] lg:p-[40px]",children:[e.jsx("strong",{children:"가격"}),e.jsx("div",{className:"my-5",children:he.map(a=>
1e.jsxs("label",{className:"mr-2.5 cursor align-bottom",children:[e.jsx("input",{className:"hidden peer",type:"radio",name:"free",value:a.value,checked:a.value===j,onChange:n=>{M(n)}}),e.jsx("span",{className:E("inline-block h-[40px] leading-[40px] px-[15px] rounded border border-solid border-gray-300","hover:bg-gray-50 peer-checked:hover:bg-primary-50 peer-checked:border-primary-700 peer-checked:text-medi-color-purple-600"),children:a.value})]},a.value))}),e.jsx("strong",{children:"레벨"}),e.jsx("div",{className:"my-5",children:fe.map(a=>e.jsxs("label",{className:"mr-2.5 mb-2.5 cursor align-bottom",children:[e.jsx("input",{className:"hidden peer",type:"radio",name:"level",value:a.value,checked:a.value===m,onChange:n=>{H(n)}}),e.jsxs("span",{className:E("inline-block h-[40px] leading-[40px] px-[15px] rounded border border-solid border-gray-300","hover:bg-gray-50 peer-checked:hover:bg-primary-50 peer-checked:border-primary-700 peer-checked:text-medi-color-purple-600"),children:[a.value!=="전체"&&e.jsx("span",{className:"mr-1.5",children:e.jsx(je,{level:a.value,background:a.value===m?"bg-primary-700":"bg-secondary-800"})}),a.value]})]},a.value))}),!F&&p&&p.lecturers.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"연자"}),e.jsx("div",{className:"my-5",children:p==null?void 0:p.lecturers.map(a=>e.jsxs("label",{className:"mr-2.5 mb-2.5 cursor align-bottom",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"lecturers",value:a.name,checked:A.includes(a.name),onChange:n=>{U(n)}}),e.jsx("span",{className:E("inline-block h-[40px] leading-[40px] px-[15px] rounded border border-solid border-gray-300","hover:bg-gray-50 peer-checked:hover:bg-primary-50 peer-checked:border-primary-700 peer-checked:text-medi-color-purple-600"),children:a.name})]},a.name))})]}),e.jsx("strong",{children:"치식번호"}),e.jsx("div",{className:"my-5",children:es.map(a=>e.jsxs("label",{className:"mr-2.5 mb-2.5 cursor align-bottom",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbersZones",value:a.value,checked:c.includes(a.value),onChange:_}),e.jsx("span",{className:E("inline-block h-[40px] leading-[40px] px-[15px] rounded border border-solid border-gray-300","hover:bg-gray-50 peer-checked:hover:bg-primary-50 peer-checked:border-primary-700 peer-checked:text-medi-color-purple-600"),children:a.name})]},a.value))}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 lg:gap-5",children:[e.jsxs("div",{className:"grid grid-rows-2 md:grid-rows-1 md:grid-cols-2",children:[e.jsx("div",{className:"md:order-1 grid grid-cols-4 items-end",children:[18,17,16,15].map(a=>{const n=Z.find(I=>I.id===a);return n?e.jsxs("label",{className:"group flex flex-col cursor",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbers",value:n.id,checked:h.includes(n.id),onChange:I=>{O(I)}}),e.jsx("img",{className:"block mx-auto transform scale-[60%] md:scale-[100%]",src:Q(`klass/${n.img}`),alt:""}),e.jsx("code",{className:E("block w-[30px] h-[30px] leading-[30px] rounded border border-solid border-gray-300 bg-white mx-auto text-center","mt-1 md:mt-4","group-hover:bg-gray-50 peer-checked:border-primary-700 peer-checked:bg-primary-50 peer-checked:text-medi-color-purple-600"),children:n.id})]},n.id):""})}),e.jsx("div",{className:"md:order-2 grid grid-cols-4 items-end",children:[14,13,12,11].map(a=>{const n=Z.find(I=>I.id===a);return n?e.jsxs("label",{className:"group flex flex-col cursor",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbers",value:n.id,checked:h.includes(n.id),onChange:I=>{O(I)}}),e.jsx("img",{className:"block mx-auto transform scale-[60%] md:scale-[100%]",src:Q(`klass/${n.img}`),alt:""}),e.jsx("code",{className:E("block w-[30px] h-[30px] leading-[30px] rounded border border-solid border-gray-300 bg-white mx-auto text-center","mt-1 md:mt-4","group-hover:bg-gray-50 peer-checked:border-primary-700 peer-checked:bg-primary-50 peer-checked:text-medi-color-purple-600"),children:n.id})]},n.id):""})})]}),e.jsxs("div",{className:"grid grid-rows-2 md:grid-rows-1 md:grid-cols-2",children:[e.jsx("div",{className:"md:order-2 grid grid-cols-4 items-end",children:[25,26,27,28].map(a=>{const n=Z.find(I=>I.id===a);return n?e.jsxs("label",{className:"group flex flex-col cursor",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbers",value:n.id,checked:h.includes(n.id
1),onChange:I=>{O(I)}}),e.jsx("img",{className:"block mx-auto transform scale-[60%] md:scale-[100%]",src:Q(`klass/${n.img}`),alt:""}),e.jsx("code",{className:E("block w-[30px] h-[30px] leading-[30px] rounded border border-solid border-gray-300 bg-white mx-auto text-center","mt-1 md:mt-4","group-hover:bg-gray-50 peer-checked:border-primary-700 peer-checked:bg-primary-50 peer-checked:text-medi-color-purple-600"),children:n.id})]},n.id):""})}),e.jsx("div",{className:"md:order-1 grid grid-cols-4 items-end",children:[21,22,23,24].map(a=>{const n=Z.find(I=>I.id===a);return n?e.jsxs("label",{className:"group flex flex-col cursor",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbers",value:n.id,checked:h.includes(n.id),onChange:I=>{O(I)}}),e.jsx("img",{className:"block mx-auto transform scale-[60%] md:scale-[100%]",src:Q(`klass/${n.img}`),alt:""}),e.jsx("code",{className:E("block w-[30px] h-[30px] leading-[30px] rounded border border-solid border-gray-300 bg-white mx-auto text-center","mt-1 md:mt-4","group-hover:bg-gray-50 peer-checked:border-primary-700 peer-checked:bg-primary-50 peer-checked:text-medi-color-purple-600"),children:n.id})]},n.id):""})})]}),e.jsxs("div",{className:"grid grid-rows-2 md:grid-rows-1 md:grid-cols-2",children:[e.jsx("div",{className:"md:order-2 grid grid-cols-4 items-end md:items-start",children:[44,43,42,41].map(a=>{const n=Z.find(I=>I.id===a);return n?e.jsxs("label",{className:"group flex flex-col md:flex-col-reverse cursor",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbers",value:n.id,checked:h.includes(n.id),onChange:I=>{O(I)}}),e.jsx("img",{className:"block mx-auto transform scale-[60%] md:scale-[100%]",src:Q(`klass/${n.img}`),alt:""}),e.jsx("code",{className:E("block w-[30px] h-[30px] leading-[30px] rounded border border-solid border-gray-300 bg-white mx-auto text-center","mt-1 md:mt-0 md:mb-4","group-hover:bg-gray-50 peer-checked:border-primary-700 peer-checked:bg-primary-50 peer-checked:text-medi-color-purple-600"),children:n.id})]},n.id):""})}),e.jsx("div",{className:"md:order-1 grid grid-cols-4 items-end md:items-start",children:[48,47,46,45].map(a=>{const n=Z.find(I=>I.id===a);return n?e.jsxs("label",{className:"group flex flex-col md:flex-col-reverse cursor",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbers",value:n.id,checked:h.includes(n.id),onChange:I=>{O(I)}}),e.jsx("img",{className:"block mx-auto transform scale-[60%] md:scale-[100%]",src:Q(`klass/${n.img}`),alt:""}),e.jsx("code",{className:E("block w-[30px] h-[30px] leading-[30px] rounded border border-solid border-gray-300 bg-white mx-auto text-center","mt-1 md:mt-0 md:mb-4","group-hover:bg-gray-50 peer-checked:border-primary-700 peer-checked:bg-primary-50 peer-checked:text-medi-color-purple-600"),children:n.id})]},n.id):""})})]}),e.jsxs("div",{className:"grid grid-rows-2 md:grid-rows-1 md:grid-cols-2",children:[e.jsx("div",{className:"md:order-1 grid grid-cols-4 items-end md:items-start",children:[31,32,33,34].map(a=>{const n=Z.find(I=>I.id===a);return n?e.jsxs("label",{className:"group flex flex-col md:flex-col-reverse cursor",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbers",value:n.id,checked:h.includes(n.id),onChange:I=>{O(I)}}),e.jsx("img",{className:"block mx-auto transform scale-[60%] md:scale-[100%]",src:Q(`klass/${n.img}`),alt:""}),e.jsx("code",{className:E("block w-[30px] h-[30px] leading-[30px] rounded border border-solid border-gray-300 bg-white mx-auto text-center","mt-1 md:mt-0 md:mb-4","group-hover:bg-gray-50 peer-checked:border-primary-700 peer-checked:bg-primary-50 peer-checked:text-medi-color-purple-600"),children:n.id})]},n.id):""})}),e.jsx("div",{className:"md:order-2 grid grid-cols-4 items-end md:items-start",children:[35,36,37,38].map(a=>{const n=Z.find(I=>I.id===a);return n?e.jsxs("label",{className:"group flex flex-col md:flex-col-reverse cursor",children:[e.jsx("input",{className:"hidden peer",type:"checkbox",name:"toothNumbers",value:n.id,checked:h.includes(n.id),onChange:I=>{O(I)}}),e.jsx("img",{className:"block mx-auto transform scale-[60%] md:scale-[100%]",src:Q(`klass/${n.img}`),alt:""}),e.jsx("code",{className:E("block w-[30px] h-[30px] leading-[30px] rounded border border-solid border-gray-300 bg-white mx-auto text-center","mt-1 md:mt-0 md:mb-4","group-hover:bg-gray-50 peer-checked:border-primary-700 peer-checked:bg-primary-50 peer-checked:text-medi-color-purple-600"),children:n.id})]},n.id):""})})]})]})]}),e.jsxs("div",{className:"flex flex-0 px-[16px] lg:px-[40px] py-[12px] bg-gray-50",children:[e.jsxs("div",{className:"hidden md:block flex-0 pt-[13px] truncate text-[16px]",children:[e.jsxs("p",{className:"inline-block text-gray-400 whitespace-nowrap",children:["가격",e.jsx("span",{className:"ml-1 text-gray-600",children:j})]}),e.jsxs("p",{className:"inline-block text-gray-400 whitespace-nowrap ml-3",children:["레벨",e.jsx("span",{className:"ml-1 text-gray-600",children:m})]}),A.length>0&&e.jsxs("p",{className:"inline-block text-gray-400 whitespace-nowrap ml-3",children:["연자",e.jsx("span",{className:"ml-1 text-gray-600",children:A.join(", ")})]}),h.length>0&&e.jsxs("p",{className:"inline-block text-gray-400 whitespace-nowrap ml-3",children:["치식번호",e.jsx("span",{className:"ml-1 text-gray-600",children:h.join(", ")})]})]}),e.jsxs("div",{className:"flex-1 whitespace-nowrap text-right",children:[e.jsxs("button",{className:"w-[90px] h-[50px] mr-4 rounded-[5px] bg-gray-100 hover:bg-gray-200 text-gray-600 text-[18px] font-semibold align-top",type:"button",onClick:q,children:[e.jsx("i",{className:"ii ii-refresh ii-weight-600 mr-1.5 text-gray-300"}),"초기화"]}),e.jsx("button",{className:"w-[210px] h-[50px] rounded-[5px] bg-medi-color-purple-600 hover:bg-medi-color-purple-700 text-white text-[18px] font-semibold align-top",type:"button",onClick:L,children:o||o===0?`검색결과 총 ${o}건`:"검색 조건 선택"})]})]})]})]})]})},rs="drYoungAcademy",Te=200,ls=()=>{var P;const[t]=Ne(),s=t.get("q"),r=t.get("topics"),o=t.get("free"),u=t.get("level"),d=t.get("lecturers"),y=t.get("toothNumbers"),l=t.get("sort")||"threeMonthlySales:desc",f=We(t.get("topicCategory")),j=We(t.get("topicSubCategory")),v=t.get("categoryGroup")===rs?Lt:void 0,m=pe.find(x=>x.label.replace(/\s+/g,"")===r),C=!!m&&(((P=nt[m.name])==null?void 0:P.length)??0)>0,{data:A}=V(["KlassSearchTopicCourses",{topics:r,channelId:v}],()=>{var x;return(x=z)==null?void 0:x.get("/class/public/courses/search",{params:{topics:r,sort:l,limit:Te,channelId:v}}).then(g=>g.data.results.hits)},{refetchOnWindowFocus:!1,enabled:C,keepPreviousData:!0}),b=Jt(A),{data:h,isLoading:i}=V(["KlassSearch",{q:s,topics:r,free:o,level:u,lecturers:d,toothNumbers:y,sort:l,limit:Te,to
1picCategory:f,topicSubCategory:j,channelId:v}],()=>{var x;return(x=z)==null?void 0:x.get("/class/public/courses/search",{params:{q:s,topics:r,free:o,level:u,lecturers:d,toothNumbers:y,sort:l,limit:Te,topicCategory:f,topicSubCategory:j,channelId:v}}).then(g=>g.data.results.hits)},{refetchOnWindowFocus:!1,keepPreviousData:!0});if(!h)return e.jsx(me,{small:!0});const c=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"my-4 flex flex-wrap items-center gap-y-3 lg:flex-nowrap lg:gap-y-0 lg:my-5",children:[e.jsx("div",{className:"order-1 w-full lg:order-2 lg:w-auto lg:max-w-[330px] lg:grow border border-medi-border-primary rounded-[5px] h-fit",children:e.jsx(ut,{})}),e.jsx("div",{className:"order-2 grow lg:order-1",children:e.jsxs("h3",{className:"text-secondary-800 text-[16px] lg:text-[18px] font-semibold",children:["검색결과 ",h.length,"건"]})}),e.jsx("div",{className:"order-3 ml-2 lg:ml-3 flex items-center justify-end gap-2",children:e.jsx(ss,{})})]}),!i&&h.length===0&&e.jsx("div",{className:"mt-[54px] flex flex-col items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[e.jsx("img",{src:Q("klass/order/complete_icon.svg"),alt:""}),e.jsx("h3",{className:"text-xl text-gray-900 font-semibold",children:"검색결과가 없습니다."}),e.jsxs("div",{className:"text-medi-text-tertiary text-base font-medium text-center",children:["다른 검색어를 입력해주세요.",e.jsx("br",{}),"더 나은 검색결과를 보여드릴 수 있도록 노력하겠습니다!"]})]})}),!i&&h.length>0&&e.jsx("div",{className:"w-full grid grid-cols-2 gap-x-[12px] gap-y-[24px] lg:grid-cols-4 lg:gap-x-[4px] lg:gap-y-[40px] mb-[100px]",children:h.map(x=>{var g,p,F,T,M,H;return e.jsx(K,{to:`/${R}/course/${x.id}`,children:e.jsx(se,{thumbnail:x.thumbnailImageUrl,lecturers:x.lecturers,title:x.title,regularPrice:(g=x==null?void 0:x.product)==null?void 0:g.regularPrice,salePrice:(p=x==null?void 0:x.product)==null?void 0:p.salePrice,topic:(F=x==null?void 0:x.groupedBadges)==null?void 0:F.topics,topicCategory:(T=x==null?void 0:x.groupedBadges)==null?void 0:T.topicCategory,level:(H=(M=x==null?void 0:x.groupedBadges)==null?void 0:M.level)==null?void 0:H.join(","),isFree:x.isFree})},x.id)})})]});return e.jsxs("div",{className:"max-w-[1200px] mx-auto",children:[e.jsxs("div",{className:"lg:px-4 xl:px-0",children:[e.jsx("div",{className:"mb-1.5 lg:mb-6",children:e.jsx("div",{className:"hidden lg:block",children:e.jsx(oe,{name:"pc_KlassSearch_top",page:"KlassSearch"})})}),e.jsx(Xt,{})]}),b.hasCategoryNav&&e.jsx(Zt,{nav:b}),e.jsx("div",{className:"px-4 xl:px-0",children:c})]})},rt=({studentCourses:t,item:s,isPackage:r})=>{const o=le(),{id:u}=ee();return e.jsxs("div",{className:E(u===s.courseId?"bg-primary-100 border-medi-color-purple-600 text-medi-color-purple-600":"border-transparent bg-none","rounded-md lg:gap-[10px] lg:hover:bg-gray-50 group lg:flex lg:relative lg:items-center lg:justify-between shadow-custom m-[1px] px-3 py-3 text-gray-900 text-[15px] cursor-pointer font-semibold border-[1px] border-solid bg-white"),onClick:()=>o(`/${R}/course/${s.courseId}`),children:[e.jsxs("div",{className:"flex items-center lg:space-x-3 lg:w-4/5",children:[e.jsx("div",{className:"w-[80px] h-[45px] hidden lg:block",children:e.jsx("img",{src:Pe(s.thumbnailImage.baseUrl+"/"+s.thumbnailImage.path,"160"),alt:"",className:"rounded-sm w-full h-full object-cover"})}),!r&&e.jsx("div",{className:"lg:hidden",children:e.jsx("div",{className:"bg-teal-50 text-teal-600 text-sm font-semibold rounded-md w-[25px] h-[22px] flex items-center justify-center mr-[10px]",children:"패"})}),(t==null?void 0:t.join(",").includes(s.courseId))&&e.jsx("div",{className:"lg:absolute lg:right-3",children:e.jsxs("div",{className:"bg-blue-50 rounded-sm flex items-center justify-center space-x-1 lg:w-[128px] lg:h-[38px] w-[75px] h-[22px] mr-2 lg:mr-0",children:[e.jsx("div",{className:"text-blue-500 font-semibold text-sm lg:text-base",children:"수강가능"}),e.jsx("i",{className:"ii-play text-blue-500 text-sm"})]})}),e.jsx("div",{className:E(u===s.courseId?"text-medi-color-purple-600":"text-gray-900","break-all overflow-hidden text-ellipsis line-clamp-2 lg:line-clamp-1 lg:w-1/2"),children:s.title})]}),!(t!=null&&t.join(",").includes(s.courseId))&&s.product&&e.jsxs("div",{className:"lg:flex items-center space-x-2 hidden",children:[de(s.product[0].regularPrice,s.product[0].salePrice)>0&&e.jsxs("div",{className:"text-alert font-semibold text-xl",children:[de(s.product[0].regularPrice,s.product[0].salePrice),"%"]}),e.jsxs("div",{className:"text-gray-900 font-semibold text-lg ml-[9px] mr-[25px]",children:[s.product[0].salePrice.toLocaleStr
1ing(),"원"]})]})]})},Re=({title:t,setPopup:s})=>{const r=le(),o=ae(ie),u=dt(),{id:d}=ee(),y=ct(()=>z.post(`/class/courses/${d}/voucher`),{onSuccess:()=>{X.success("수강신청이 완료되었습니다."),s(""),u.invalidateQueries("classCourses"),window.scrollTo(0,0)}}),l=()=>{if(o)y.mutate();else{r("/login",{state:d});return}};return e.jsxs("div",{children:[e.jsx("div",{className:"fixed left-0 right-0 top-0 bottom-0 z-[92] bg-[rgba(0,0,0,0.4)]",onClick:()=>s("")}),e.jsx("div",{className:"fixed z-[93] top-[50%] left-[50%] -translate-x-1/2 -translate-y-1/2",children:e.jsxs("div",{className:"bg-white pt-[30px] px-7 pb-5 min-w-[320px] lg:w-[514px] shadow-custom rounded-lg relative",children:[e.jsx("div",{className:"mb-3 overflow-hidden break-all text-[25px] leading-8 font-semibold text-gray-900",children:"무료강의 수강신청"}),e.jsxs("div",{className:"text-base font-medium text-gray-900 mb-8 w-3/4 truncate",children:[t,e.jsx("br",{})," 수강신청 하시겠습니까?"]}),e.jsxs("div",{className:"lg:flex items-center space-y-3 lg:space-y-0 lg:space-x-4",children:[e.jsx("button",{className:"w-full h-[53px] flex items-center justify-center bg-medi-color-purple-600 text-[#fff] text-xl font-semibold rounded-md",onClick:()=>l(),children:"확인"}),e.jsx("button",{className:"w-full lg:w-[177px] h-[53px] flex items-center justify-center border-[1px] border-solid border-gray-300 rounded-md text-xl font-semibold text-gray-900",onClick:()=>s(""),children:"취소"})]}),e.jsx("div",{className:"absolute top-4 right-5 cursor-pointer",onClick:()=>s(""),children:e.jsx("i",{className:"ii ii-remove text-2xl text-gray-900"})})]})})]})},De=({courseId:t,chapterId:s,lectureId:r,setPopup:o,bookmark:u,progressPercent:d})=>{const[y,l]=N.useState(""),{data:f,isLoading:j}=V(["classCoursesChaptersLectures"],()=>{var m;return(m=z)==null?void 0:m.get(!u&&d&&d>0?`/class/courses/${t}/chapters/${s}/lectures/${r}/video?useIntroOutro=true`:`/class/courses/${t}/chapters/${s}/lectures/${r}/video`).then(C=>C.data)},{enabled:!!(s&&r),onSuccess:m=>{let C=m.url.replace("http","https");C=[C,"pv=v5",u?`s=${u}`:""].join("&"),l(C)}});N.useEffect(()=>{const m=document.getElementById("lecture_video");if(!(!m||!y))try{const C=new window.VgControllerClient({target_window:m.contentWindow});console.log(C),C.on("play",function(){console.log("play")})}catch(C){alert(C)}},[y]);const v=()=>{y||setTimeout(()=>{v()},1e3);let m="kollus://path?url="+encodeURIComponent(y);return m=m.replace("kollus.com%2Fs","kollus.com%2Fsi"),xt("openKollus",{kollus:m,ios:"itms-apps://itunes.apple.com/app/id760006888",android:"market://details?id=com.kollus.media"})};return!f&&j?e.jsx(me,{}):Nt.createPortal(e.jsx(e.Fragment,{children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"fixed left-0 right-0 top-0 bottom-0 z-[100] bg-[rgba(0,0,0,0.4)]",onClick:()=>o({popup:!1,bookmark:0,lectureId:""})}),ot()&&e.jsx("button",{className:"fixed z-[120] top-[50%] left-[50%] -translate-x-1/2 -translate-y-1/2 w-5/6 h-[230px] rounded-lg",onClick:v}),e.jsxs("div",{className:"fixed z-[110] top-[50%] left-[50%] -translate-x-1/2 -translate-y-1/2 bg-[#fff] lg:w-[585px] lg:h-[424px] w-5/6 h-auto rounded-lg",children:[e.jsx("img",{src:Q("klass/player-frame-mo.png"),alt:"",className:"lg:hidden"}),e.jsx("img",{src:Q("klass/player-frame-pc.png"),alt:"",className:"hidden lg:block"}),e.jsx("div",{className:"absolute top-[40%] lg:top-[25%] left-[10%] lg:left-[18%] w-[80%] h-[40%] lg:w-[64%] lg:h-[60%] overflow-hidden flex items-center justify-center",children:e.jsx("iframe",{src:y,id:"lecture_video",title:"lecture",allowFullScreen:!0,className:"w-full h-full",allow:"encrypted-media;local-network-access"})}),e.jsx("div",{className:"absolute top-3 right-3",onClick:()=>o({popup:!1,bookmark:0,lectureId:""}),children:e.jsx("i",{className:"ii-remove ii-weight-600 text-2xl text-secondary-800 cursor-pointer"})})]})]})}),document.body)},Oe=({simple:t,course:s,progress:r,defaultCourseId:o})=>{var _,q;const u=le(),d=Be(),{id:y}=ee(),l=new URLSearchParams(d.search),f=l.get("chapterId"),j=l.get("lectureId"),v=ae(ie),[m,C]=N.useState(""),[A,b]=N.useState({popup:!1,bookmark:0,lectureId:""}),[h,i]=N.useState(!1),c=$(s==null?void 0:s.sellStartAt)<=$()&&$()<$(s==null?void 0:s.sellEndAt),P=$().isAfter($(s.learnEndAt)),x=r&&$().isAfter($(r==null?void 0:r.expireAt)),g=(_=s==null?void 0:s.products[0])==null?void 0:_.productId,p=(q=s==null?void 0:s.products[0])==null?void 0:q.variantId,{data:F,isLoading:T}
1=Ft(g,{enabled:!!(v!=null&&v.uid)&&!!g}),M=F==null?void 0:F.is_sold_out,H=()=>{var W,J,a,n,I;const L=r!=null&&r.lastLectureId?r.lastLectureId.chapterId:(W=s==null?void 0:s.chapters[0])==null?void 0:W.chapterId,S=r!=null&&r.lastLectureId?r.lastLectureId.lectureId:(a=(J=s==null?void 0:s.chapters[0])==null?void 0:J.lectures[0])==null?void 0:a.lectureId,Y=((I=(n=r==null?void 0:r.chapters.find(({chapterId:B})=>L===B))==null?void 0:n.lectures.find(({lectureId:B})=>B===S))==null?void 0:I.latestTime)??0;return u(`/${R}/course/${y}?chapterId=${L}&lectureId=${S}`,{replace:!0}),b({popup:!0,bookmark:Y,lectureId:S})},U=()=>{if(!(!c||h||T))if(v)if((v==null?void 0:v.user_status)==="pending")X.error("인증 완료(치과의사 및 치과대학생)후 주문가능합니다. 인증완료 후 구매해 주세요");else if(s!=null&&s.isFree){(v==null?void 0:v.user_status)==="pending"?X.error("인증 완료(치과의사 및 치과대학생)후 주문가능합니다. 인증완료 후 구매해 주세요"):C("true");return}else{i(!0),O.mutate(),window.scrollTo(0,0);return}else{u("/login?pathname=/class/course/"+y);return}},O=ct(()=>z.post("/market/orders",{items:[{product_id:g,variant_id:p,quantity:1}]}).then(L=>L.data.data),{onSuccess:L=>{if(!L.id||!L.grand_total){X.error("주문서 생성 실패");return}window.location.replace(kt(`/checkout/${L.id}${o?`?defaultCourseId=${o}`:""}`)),i(!1)},onError:()=>{i(!1),X.error("주문서 생성 실패")}});return M?e.jsx("button",{className:"w-full h-full bg-medi-color-purple-600 flex items-center justify-center rounded-md hover:bg-medi-color-purple-700 text-white disabled:bg-secondary-100 disabled:text-secondary-400",disabled:!0,children:e.jsx("span",{className:"font-medium",children:"수강 모집 완료"})}):P?e.jsx("button",{className:"w-full h-full bg-medi-color-purple-600 flex items-center justify-center rounded-md hover:bg-medi-color-purple-700 text-white disabled:bg-secondary-100 disabled:text-secondary-400",disabled:!0,children:e.jsx("span",{className:"font-medium",children:"종료된 강의입니다"})}):e.jsxs(e.Fragment,{children:[A.popup&&e.jsx(De,{courseId:y,chapterId:f,lectureId:j,setPopup:b,bookmark:A.bookmark,progressPercent:r==null?void 0:r.progressPct}),m&&e.jsx(Re,{title:s.title,setPopup:C}),r&&!x&&e.jsx("button",{className:"w-full h-full bg-medi-color-purple-600 flex items-center justify-center rounded-md hover:bg-medi-color-purple-700 text-white disabled:bg-secondary-100 disabled:text-secondary-400",onClick:H,disabled:$()<$(s==null?void 0:s.learnStartAt)||re(s),children:!t&&$()<$(s==null?void 0:s.learnStartAt)?e.jsxs("div",{className:"flex items-center text-lg font-medium",children:[$(s==null?void 0:s.learnStartAt).format("MM월 DD일"),"부터 수강 가능합니다"]}):e.jsxs(e.Fragment,{children:[!t&&!re(s)&&e.jsxs("div",{className:"flex items-center text-lg font-medium mr-5",children:[e.jsx("i",{className:"ii-calendar-event-outline mr-3 text-white"}),"남은기한: ",wt(s,r)]}),e.jsx("div",{className:"font-semibold",children:re(s)?t?"신청 완료":"수강 신청 완료":"이어서 보기"})]})}),(!r||x)&&e.jsx("button",{className:"w-full h-full bg-medi-color-purple-600 flex items-center justify-center rounded-md hover:bg-medi-color-purple-700 text-white disabled:bg-secondary-100 disabled:text-secondary-400",onClick:U,disabled:!c||T,children:e.jsx("span",{className:"font-medium",children:"수강 신청"})})]})},as=({lectureProductId:t})=>{const s=ae(ie),r=s&&s.user_type,{data:o,isLoading:u}=_e({ids:[t],showAll:!0},{enabled:!!t,select:l=>{var f,j;return((j=(f=l==null?void 0:l.hits)==null?void 0:f[0])==null?void 0:j.related_product_ids)||[]}}),{data:d,isLoading:y}=_e({ids:o||[]},{enabled:!!(o!=null&&o.length),select:l=>{const f=(l==null?void 0:l.hits)||[];return o!=null&&o.length?o.map(j=>f.find(v=>v.id===j)).filter(Boolean):f}});return u||y?e.jsx("div",{className:"flex h-[200px] items-center justify-center",children:e.jsx(Ct,{size:30,color:"#94969d"})}):d!=null&&d.length?e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-secondary-900 font-bold text-[20px] lg:text-[16px] leading-[30px] lg:leading-[24px] tracking-[-0.12px] lg:tracking-[-0.1px]",children:"이 강의ì
1™€ 연관된 상품"}),e.jsxs("div",{className:"mt-[16px] lg:mt-[8px] relative",children:[e.jsx(xe,{options:{breakpoints:{0:{slidesPerView:3.55,spaceBetween:8}}},navigationTop:"top-[55px]",children:d==null?void 0:d.map(l=>{var f,j,v,m;return e.jsx(te,{children:e.jsx("div",{className:"cursor-pointer group",children:e.jsx(Mt,{id:l.id,name:(l==null?void 0:l.meta_title)||((f=l==null?void 0:l.product)==null?void 0:f.meta_title)||(l==null?void 0:l.name)||"",regularPrice:l.regular_price,salePrice:l.sale_price,thumbnail:((v=(j=l==null?void 0:l.images)==null?void 0:j[0])==null?void 0:v.url)||(l==null?void 0:l.image),category_id:l==null?void 0:l.category_id,categoryIds:(l==null?void 0:l.category_ids)||[],productCode:l==null?void 0:l.product_code,brandName:(m=l==null?void 0:l.brand)==null?void 0:m.englishName,isSoldOut:(l==null?void 0:l.is_sold_out)||(l==null?void 0:l.discontinued),isLoadingUnit:!1,product_group_ids:l==null?void 0:l.product_group_ids,cash_discounted_price_info:l==null?void 0:l.cash_discounted_price_info,isShowCashBadge:!0,cardSize:"small"},l.id)})},l.id)})}),!r&&e.jsx("div",{className:"absolute bottom-[-5px] w-full h-[40px] left-0 backdrop-blur-sm z-10 flex items-center justify-center",children:e.jsx(Bt,{})})]})]}):null},bt=({course:t,progress:s,defaultCourseId:r,lectureProductId:o,scrollToCurriculum:u})=>{var c,P,x,g,p,F,T,M,H,U;const{id:d}=ee(),y=ae(ie),l=dt(),[f,j]=N.useState(pt(s==null?void 0:s.expireAt,$())),[v,m]=N.useState(!1),C=t==null?void 0:t.file,A=s&&(t==null?void 0:t.isExtendable)&&!(s!=null&&s.extendedTime)&&$().isBefore($(s.expireAt))&&$(s.expireAt).isBefore($(t==null?void 0:t.learnEndAt))&&$(s.expireAt).subtract(7,"days").isBefore($());N.useEffect(()=>{const O=setInterval(()=>{j(_=>_.subtract(1,"second"))},1e3);return()=>clearInterval(O)},[]);const b=()=>{let O=0;return t.chapters.map(_=>O+=_.lectures.length),O},h=()=>{m(!1),l.invalidateQueries(["classCourses",d,y])},i=()=>!(t!=null&&t.learnStartAt)||!(t!=null&&t.learnEndAt)?"":$(t.learnStartAt).year()===$(t.learnEndAt).year()?e.jsxs(e.Fragment,{children:[$(t.learnStartAt).format("YYYY년 MM월 DD일 (dd) HH:mm"),e.jsx("br",{}),"~ ",$(t.learnEndAt).format("MM월 DD일 (dd) HH:mm")]}):e.jsxs(e.Fragment,{children:[$(t.learnStartAt).format("YYYY년 MM월 DD일 (dd) HH:mm"),e.jsx("br",{}),"~ ",$(t.learnEndAt).format("YYYY년 MM월 DD일 (dd) HH:mm")]});return e.jsxs("div",{className:"lg:w-[450px]",children:[e.jsx(Rt,{isModalOpen:v,setIsModalOpen:m,children:e.jsx(is,{closePopup:h,expireAt:s==null?void 0:s.expireAt,learnEndAt:t==null?void 0:t.learnEndAt})}),e.jsx("div",{className:"lg:border border-medi-border-primary bg-medi-bg-primaryAlt lg:rounded-[6px]",children:e.jsxs("div",{className:"p-[16px]",children:[((c=t.lecturerNames)==null?void 0:c.length)>0&&e.jsxs("div",{className:"flex items-center justify-between py-[6px] mb-[10px]",children:[e.jsx("div",{className:"w-1/3 text-medi-text-tertiary text-[14px] font-semibold leading-normal",children:"연자"}),e.jsx("div",{className:"text-gray-900 text-[14px] font-semibold w-2/3 text-right",children:t.lecturerNames.join(", ")})]}),re(t)?e.jsxs("div",{className:"flex items-center justify-between py-[6px] mb-[10px]",children:[e.jsx("div",{className:"text-medi-text-tertiary w-[70px] shrink-0 text-[14px] font-semibold",children:"강의 날짜"}),e.jsx("div",{className:"text-medi-text-primary text-[14px] font-semibold",children:i()})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between py-[6px] mb-[10px]",children:[e.jsx("div",{className:"w-1/3 text-medi-text-tertiary text-[14px] font-semibold",children:"총 강의 수"}),e.jsxs("div",{className:"max-w-2/3 text-gray-900 text-[15px] font-semibold",children:["총 ",b(),"강"]})]}),e.jsxs("div",{className:"flex items-center justify-between py-[6px] mb-[10px]",children:[e.jsx("div",{className:"w-1/3 text-medi-text-tertiary text-[14px] font-semibold",children:"총 강의시간"}),e.jsx("div",{className:"max-w-2/3 text-gray-900 text-[15px] font-semibold",children:be(t.totalVideoLength)})]}),e.jsxs("div",{className:"flex items-center justify-between py-[6px] mb-[10px]",children:[e.jsx("div",{className:"w-1/3 text-medi-text-tertiary text-[14px] font-semibold",children:"수강기간"}),e.jsxs("div",{className:"max-w-2/3 text-gray-900 text-[15px] font-semibold",children:[t==null?void 0:t.registrationValidDays,"일"]})]})]}),e.jsx("div",{className:"w-full h-[2px] bg-gray-200"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mt-[14px] h-[17px]",children:[e.jsx("div",{className:"text-medi-text-primary text-[14px] font-semibold",children:"정상가"}),((P=t.products[0])==null?void 0:P.regularPrice)&&e.jsxs("div",{className:"text-medi-text-secondary text-[14px] font-semibold",children:["정가 ",(x=t.products[0])==null?void 0:x.regularPrice.toLocaleStr
1ing(),"원"]})]}),e.jsxs("div",{className:"flex items-center justify-between mt-[14px] h-[29px]",children:[e.jsx("div",{className:"text-medi-text-primary text-[14px] font-semibold",children:!t.isFree&&de((g=t.products[0])==null?void 0:g.regularPrice,(p=t.products[0])==null?void 0:p.salePrice)!==0?"할인가":"판매가"}),t.products.length>0&&e.jsxs("div",{className:"text-medi-color-purple-600 text-[24px] font-semibold",children:[de((F=t.products[0])==null?void 0:F.regularPrice,(T=t.products[0])==null?void 0:T.salePrice)!==0&&!t.isFree&&e.jsxs("span",{className:"text-alert mr-2",children:[de((M=t.products[0])==null?void 0:M.regularPrice,(H=t.products[0])==null?void 0:H.salePrice),"%"]}),t.isFree?"무료":((U=t.products[0])==null?void 0:U.salePrice.toLocaleString())+"원"]}),t.products.length<=0&&t.isFree&&e.jsx("div",{className:"text-medi-color-purple-600 text-[26px] font-semibold",children:"무료"})]})]})]})}),C&&e.jsxs("div",{className:"flex justify-between bg-primary-100 p-[10px] lg:py-[8px] rounded-md mt-[20px] mx-4 lg:mx-0 cursor-pointer",onClick:()=>u(),children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("i",{className:"ii ii-book-outline ii-weight-600 text-[20px] text-primary-600 mr-[6px]"}),e.jsx("span",{className:"text-[15px]",children:"강의 자료가 파일로 제공됩니다"})]}),e.jsx("button",{className:"text-[13px] font-bold",children:"보기"})]}),e.jsx("div",{className:E(C?"lg:mt-[20px]":"lg:mt-4","px-4 lg:px-0 h-[64px] text-[25px] mt-5"),children:e.jsx(Oe,{course:t,progress:s,defaultCourseId:r})}),A&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center px-[20px] py-[16px] bg-secondary-100 rounded-none lg:rounded-md mt-[16px]",children:[e.jsxs("div",{className:"text-[14px] font-semibold flex items-center",children:[e.jsx("i",{className:"ii ii-info-circle-outline ii-weight-600 text-[16px] mr-1"}),"수강 만료"," ",e.jsxs("span",{className:"text-primary-700 ml-1",children:[f.days()*24+f.hours()*1+":"+f.format("mm:ss")," ","남음"]})]}),e.jsx("div",{className:"text-[12px] font-bold cursor-pointer underline",onClick:()=>m(!0),children:"수강권 연장하기"})]}),e.jsx("div",{className:"hidden lg:flex text-[13px] font-normal text-secondary-500 mt-[9px] justify-center",children:"*수강권 연장은 강의당 1회 사용 가능합니다. / 수강권 연장은 교육기간 내에서만 적용됩니다."}),e.jsxs("div",{className:"lg:hidden text-[13px] font-normal text-secondary-500 mt-[9px] flex flex-col justify-center px-[12px] mb-6",children:[e.jsx("div",{children:"*수강권 연장은 강의당 1회 사용 가능합니다."}),e.jsx("div",{children:"*수강권 연장은 교육기간 내에서만 적용됩니다."})]})]}),e.jsx("div",{className:"my-[24px] px-4 lg:px-0",children:e.jsx(as,{lectureProductId:o})})]})},is=({closePopup:t,expireAt:s,learnEndAt:r})=>{const{id:o}=ee(),[u,d]=N.useState(!1),y=()=>$(s).add(7,"days").isAfter($(r))?$(r):$(s).add(7,"days"),l=async()=>{var f,j,v;try{await((f=z)==null?void 0:f.put(`/class/students/self/courses/${o}/progress`,{extendedTime:pt(y(),$(s)).as("milliseconds")})),d(!0)}catch(m){alert(((v=(j=m==null?void 0:m.response)==null?void 0:j.data)==null?void 0:v.message)||"수강권 연장에 실패하였습니다."),t()}};return e.jsx("article",{className:"fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-[510] w-5/6 lg:w-[514px] shadow-custom popup-addr rounded-md",children:u?e.jsxs("div",{className:"rounded-lg bg-white px-6 py-8",children:[e.jsx("h1",{className:"text-[22px] lg:text-[25px] font-semibold mb-5",children:"수강권이 연장되었습니다"}),e.jsxs("div",{children:["수강 종료일은 ",y().format("YYYY년 M월 D일 H시 m분"),"입니다."]}),e.jsx("button",{onClick:t,className:"bg-medi-color-purple-600 hover:bg-medi-color-purple-700 w-full text-white rounded-md py-3 lg:py-0 lg:h-12 text-[20px] mt-[41px]",children:"확인"})]}):e.jsxs("div",{className:"rounded-lg bg-white px-6 py-8",children:[e.jsx("h1",{className:"text-[22px] lg:text-[25px] font-semibold mb-5",children:"수강권을 연장하시겠습니까?"}),e.jsxs("div",{children:["수강 연장은 강의당 1회만 가능합니다.",e.jsx("br",{}),"연장 후, 수강 종료일은 ",y().format("YYYY년 M월 D일 H시 m분"),"입니다."]}),e.jsxs("div",{className:"flex w-full mt-[41px] space-x-[7px] h-12 text-[20px]",children:[e.jsx("button",{onClick:t,className:"bg-white hover:bg-gray-50 text-secondary-800 border-[1px] border-solid border-secondary-200 w-1/2 roun
1ded-md py-3 flex self-center justify-center",children:"취소"}),e.jsx("button",{onClick:l,className:"bg-medi-color-purple-600 hover:bg-medi-color-purple-700 text-white w-1/2 rounded-md py-3 flex self-center justify-center",children:"확인"})]})]})})},ns=({lectureList:t,course:s,collection:r,studentCourses:o,defaultCourseId:u,scrollToCurriculum:d})=>{var C,A,b,h,i,c,P,x;const[y,l]=N.useState(!1),f=Be(),v=new URLSearchParams(f.search).get("autoplay"),{id:m}=ee();return e.jsx("div",{children:e.jsx("div",{className:"lg:flex lg:items-start lg:justify-between overflow-y-hidden",children:e.jsxs("div",{className:"w-full",children:[e.jsx("div",{className:"w-full h-auto lg:max-h-[390px] lg:rounded-md overflow-hidden",children:(C=s==null?void 0:s.previews[0])!=null&&C.mediaKey?e.jsx("div",{className:"relative h-0 pb-[56.25%]",children:e.jsx("iframe",{id:"kollus-player-sample",style:{width:"100%",height:"100%",position:"absolute",top:0,left:0},src:"https://v.kr.kollus.com/"+s.previews[0].mediaKey+`?player_version=html5${v?"&autoplay":""}`,title:"lecture",frameBorder:"0",allowFullScreen:!0,allow:"encrypted-media;local-network-access"})}):e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex items-center justify-center w-full h-auto lg:max-h-[390px] lg:rounded-md",children:e.jsx("img",{src:Pe(s.coverImage.link,"800"),alt:"",className:"w-full h-full object-contain lg:rounded-md"})})})}),e.jsx("div",{className:"lg:hidden",children:e.jsx(bt,{course:s,progress:t.progress,defaultCourseId:u,lectureProductId:(b=(A=t.course.products)==null?void 0:A[0])==null?void 0:b.productId,scrollToCurriculum:d})}),!!(s!=null&&s.channel)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-full h-[8px] bg-medi-bg-tertiary lg:hidden"}),e.jsxs("div",{className:"w-full py-[20px] px-4 flex items-start gap-[14px] lg:px-0 lg:my-5 lg:py-[24px] lg:gap-[16px]",children:[e.jsx("img",{src:Pe(s.channel.logoImage.link,64,64),alt:"채널 이미지",className:"lg:h-[64px] lg:w-[64px] h-[48px] w-[48px] rounded-[64px] border border-[rgba(0,0,0,0.1)] object-cover"}),e.jsxs("div",{className:"flex flex-1 flex-col gap-[12px] lg:flex-row lg:justify-between lg:gap-[16px] lg:items-center lg:w-full",children:[e.jsxs("div",{className:"flex flex-col gap-[2px] lg:gap-[4px]",children:[e.jsx("p",{className:"text-secondary-900 text-[15px] lg:text-[18px] leading-[22px] lg:leading-[28px] tracking-[-0.1px] lg:tracking-[-0.12px] font-bold",children:s.channel.title}),e.jsx("div",{className:"text-secondary-700 text-[13px] lg:text-[14px] lg:leading-[20px] tracking-[-0.1px]",children:s.channel.description})]}),e.jsx("div",{children:e.jsx(K,{to:`/${it}/${s.channel.channelId}`,className:"bg-medi-bg-primary hover:bg-medi-bg-primaryHover border border-medi-border-secondary whitespace-nowrap text-secondary-700 text-[14px] leading-[20px] tracking-[-0.4px] font-bold rounded-[6px] px-[10px] py-[8px]",children:"채널로 이동"})})]})]}),e.jsx("div",{className:"w-full h-[8px] bg-medi-bg-tertiary lg:hidden"})]}),!re(s)&&e.jsx("div",{className:"w-full lg:px-0 px-4",children:e.jsxs("div",{className:"mb-12 bg-primary-50 border-[1px] border-solid border-[#C3ACFF] rounded-md mt-[16px] px-[14px] py-[12px] lg:px-[16px] lg:py-[14px] lg:mt-5",children:[e.jsx("h5",{className:"text-gray-900 text-lg font-semibold mb-2",children:"강의 구매 전 필독사항 👀"}),e.jsxs("ul",{className:"mt-1 space-y-1 text-[15px] font-medium",children:[e.jsxs("li",{className:"relative pl-3 text-gray-600 leading-5",children:[e.jsx("span",{className:"absolute top-[0] left-[0]",children:"•"}),"환불 규정은 소비자보호에 관한 법률을 따릅니다."]}),e.jsxs("li",{className:"relative pl-3 text-gray-600 leading-5",children:[e.jsx("span",{className:"absolute top-[0] left-[0]",children:"•"}),"모든 콘텐츠와 강좌는 저작권 보호를 위해 불법다운로드, 캡쳐, 편집, 재배포 등을 금지합니다."]}),e.jsxs("li",{className:"relative pl-3 text-gray-600 leading-5",children:[e.jsx("span",{className:"absolute top-[0] left-[0]",children:"•"}),"하나의 계정당 최대 4개의 기기에서 수강 가능하며, 기기인증 초기화는 고객센터로 문의 바랍니다."]})]})]})}),r&&r.defaultCourseId===m&&e.jsxs("div",{className:"relative px-4 lg:px-0 pb-12",children:[e.jsxs("div",{className:"mb-5 flex items-center space-x-2",children:[e.jsxs("h3",{className:"text-gray-900 text-[22px] font-bold",children:["이 패키지에 포함된 ",e.jsx("span",{className:"text-teal-600",children:"강의"})]}),e.jsx("span",{className:"text-gray-600 text-sm font-medium hidden lg:block",children:"필요한 강의만 수강해보세요😊"})]}),e.jsxs("div",{children:[e.jsx("div",{className:E(y?"":r!=null&&r.courses&&r.courses.length>4?"h-[200px] overflow-hidden":"","space-y-3"),children:(i=(h=r==null?void 0:r.courses)==null?void 0:h.filter(g=>g.courseId!==r.defaultCourseId))==null?void 0:i.map((g,p)=>e.jsx(rt,{studentCourses:o,item:g,isPackage:!0},p))}),(r==null?void 0:r.courses)&&r.courses.length>4&&e.jsxs("button",{className:"border-[1px] mt-5 border-solid border-gray-300 rounded-md w-full h-10 text-sm font-semibold text-gray-900 flex items-center justify-center space-x-2",onClick:()=>l(!y),children:[e.jsxs("span",{className:"text-[#1B8773] mr-2",children:["총 ",((c=r==null?void 0:r.courses)==null?void 0:c.length)-1,"개"]}),"강의 전체보기",e.jsx("i",{className:E(y?"ii-chevron-up":"ii-chevron-down","text-gray-900")})]})]})]}),r&&r.defaultCourseId!==m&&e.jsxs("div",{className:"relative px-4 lg:px-0 pb-12",children:[e.jsx("div",{className:"mb-5 flex items-center space-x-2",children:e.jsxs("h3",{className:"text-gray-900 text-[22px] font-bold",children:["이 강의가 포함된 ",e.jsx("span",{className:"text-teal-600",children:"패키지"})]})}),e.jsx("div",{children:e.jsx("div",{className:"overflow-hidden space-y-3",children:(x=(P=r==null?void 0:r.courses)==null?void 0:P.filter(g=>g.courseId===r.defaultCourseId))==null?void 0:x.map(g=>e.jsx(rt,{studentCourses:o,item:g},g.courseId))})})]})]})})})},ds=({setPopup:t,course:s,defaultCourseId:r})=>{var d;const o=le(),u=(d=s==null?void 0:s.previews[0])==null?void 0:d.mediaKey;return e.jsxs("div",{children:[e.jsx("div",{className:"fixed left-0 right-0 top-0 bottom-0 z-[100] bg-[rgba(0,0,0,0.4)]",onClick:()=>t("")}),e.jsx("div",{className:"fixed z-[110] top-[50%] left-[50%] -translate-x-1/2 -translate-y-1/2",children:e.jsxs("div",{className:"bg-white pt-[30px] px-7 pb-5 min-w-[320px] lg:w-[514px] shadow-custom rounded-lg relative",children:[u?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-3 overflow-hidden break-all text-[25px] leading-8 font-semibold text-gray-900",children:"ìƒ
1˜í”Œ 영상을 확인해보세요."}),e.jsxs("div",{className:"text-base font-medium text-gray-900 mb-8",children:["강의의 일부가 샘플로 제공되어",e.jsx("br",{})," 무료로 시청하실 수 있습니다.",e.jsx("br",{}),"이후 구매하기 버튼으로 수강권을 구입하시면",e.jsx("br",{})," 수강기간 동안 횟수 제한없이 시청하실 수 있습니다."]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-3 overflow-hidden break-all text-[25px] leading-8 font-semibold text-gray-900",children:"샘플 영상이 없는 강의입니다."}),e.jsxs("div",{className:"text-base font-medium text-gray-900 mb-8",children:["구매하기 버튼으로 수강권을 구입하시면",e.jsx("br",{})," 수강 기간 동안 횟수 제한 없이 시청하실 수 있습니다."]})]}),e.jsxs("div",{className:"lg:flex items-center space-y-3 lg:space-y-0 lg:space-x-4",children:[e.jsx("div",{className:"w-full h-[53px] text-xl",children:e.jsx(Oe,{course:s,defaultCourseId:r})}),u&&e.jsxs("button",{className:"w-full lg:w-[177px] h-[53px] flex items-center justify-center border-[1px] border-solid border-gray-300 rounded-md text-xl font-semibold text-gray-900",onClick:()=>{o(`/${R}/course/${s.courseId}?autoplay=autoplay`),window.scrollTo(0,0),t("")},children:["샘플영상 ",e.jsx("i",{className:"ii-play ml-1"})]})]}),e.jsx("div",{className:"absolute top-4 right-5 cursor-pointer",onClick:()=>t(""),children:e.jsx("i",{className:"ii ii-remove text-2xl text-gray-900"})})]})})]})},cs=({progress:t,course:s,defaultCourseId:r})=>{var O;const o=ae(ie),[u,d]=N.useState("0"),[y,l]=N.useState("0"),[f,j]=N.useState(""),[v,m]=N.useState({popup:!1,bookmark:0,lectureId:""}),[C,A]=N.useState(""),{id:b}=ee(),h=o&&o.user_type,i=s==null?void 0:s.file,c=$(s==null?void 0:s.sellStartAt)<=$()&&$()<$(s==null?void 0:s.sellEndAt),P=$().isAfter($(s.learnEndAt)),x=t&&$().isAfter($(t==null?void 0:t.expireAt)),g=(_,q=0)=>{if(P){X.error("종료된 강의입니다");return}if($()<$(s==null?void 0:s.learnStartAt)){X.error(`${$(s==null?void 0:s.learnStartAt).format("MM월 DD일")}부터 수강 가능합니다`);return}if((o==null?void 0:o.user_status)==="pending"){X.error("인증 완료(치과의사 및 치과대학생)후 주문가능합니다. 인증완료 후 구매해 주세요");return}if(t&&!x){m({popup:!0,bookmark:q,lectureId:_.lectureId});return}if(!c){X.error("판매 종료된 강의입니다.");return}if(s!=null&&s.isFree){A(_.lectureId);return}j(_.lectureId)},{data:p,isLoading:F}=V(["classCoursesChapters",b],()=>{var _;
1return(_=z)==null?void 0:_.get(o&&(o.user_type==="doctor"||o.user_type==="student")?`/class/courses/${b}/chapters`:`/class/public/courses/${b}/chapters`).then(q=>q.data)},{onSuccess:_=>{l(()=>_==null?void 0:_.chapters[0].chapterId),d(()=>{var q,L,S,Y,W,J,a;return(L=(q=_==null?void 0:_.chapters[0])==null?void 0:q.lectures[0])!=null&&L.bookmarks&&((W=(Y=(S=_==null?void 0:_.chapters[0])==null?void 0:S.lectures[0])==null?void 0:Y.bookmarks)==null?void 0:W.length)>0?(a=(J=_==null?void 0:_.chapters[0])==null?void 0:J.lectures[0])==null?void 0:a.lectureId:""})}}),{data:T,isLoading:M}=V(["classCoursesFile",b],()=>{var _;return(_=z)==null?void 0:_.get(`/class/courses/${b}/file`).then(q=>q.data.file)},{enabled:!!(i&&h),refetchOnWindowFocus:!1}),H=()=>{if(M){X.error("파일을 가져오는 중입니다.");return}if(!T){X.error("수강하지 않은 강의입니다.");return}if(ot())xt("fileDownload",T.link);else{const _=document.createElement("a");_.href=T.link,_.download=T.name,_.target="_blank",_.click(),_.remove()}},U=()=>{let _=0;return p==null||p.chapters.map(q=>_+=q.lectures.length),_};return F||!p?e.jsx(me,{small:!0}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"mt-[48px]",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-[24px] leading-[24px]",children:[e.jsx("div",{className:"text-gray-900 text-[22px] font-bold",children:"커리큘럼"}),e.jsxs("div",{className:"text-base text-gray-600 font-medium",children:[e.jsxs("span",{className:"text-medi-color-purple-600 font-semibold mr-2",children:["총 ",U(),"강"]}),"총 ",be(p.totalVideoLength)]})]}),i&&e.jsxs("div",{className:"flex justify-between bg-primary-50 p-[16px] rounded-md mb-[20px] items-center",children:[e.jsxs("div",{className:"flex items-start",children:[e.jsx("i",{className:"ii ii-book-outline ii-weight-600 text-[20px] text-primary-600 mr-[6px] flex-shrink-0 leading-[20px]"}),e.jsx("span",{className:"text-[15px] text-primary-600 font-semibold mr-[10px] flex-shrink-0 self-start leading-[20px]",children:"강의 자료"}),e.jsx("span",{className:"block mr-3 break-all leading-[20px] hover:underline cursor-pointer",onClick:H,children:i.name})]}),e.jsxs("button",{className:"flex text-[13px] font-bold text-white bg-secondary-900 hover:bg-secondary-800 rounded-md w-[74px] h-8 flex-shrink-0 justify-center items-center",onClick:H,children:[e.jsx("span",{children:"다운로드"}),e.jsx("i",{className:"ii ii-download-outline text-white ml-1"})]})]}),e.jsx("div",{className:"space-y-5",children:(O=p.chapters)==null?void 0:O.map((_,q)=>e.jsxs(Ee.Fragment,{children:[e.jsx("div",{onClick:()=>l(L=>L===_.chapterId?"0":_.chapterId),children:e.jsxs("div",{className:"bg-secondary-100 cursor-pointer flex items-center rounded-md px-3 py-3 hover:bg-secondary-200",children:[e.jsxs("div",{className:"text-sm font-medium text-gray-900 mr-2.5",children:["Chapter.",q+1>=10?q+1:"0"+(q+1)]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("h4",{className:"text-gray-900 font-semibold text-lg",children:_.title}),e.jsxs("div",{className:"text-gray-600 text-sm mx-2 font-medium shrink-0",children:["총 ",be(_.totalVideoLength)]})]}),e.jsx("i",{className:E(y===_.chapterId?"ii-chevron-up":"ii-chevron-down","mr-0 ml-auto")})]})},_.chapterId),y===_.chapterId&&e.jsx("div",{children:e.jsxs("div",{className:"border-t-2 border-solid border-medi-color-purple-600",children:[e.jsxs("div",{className:"hidden lg:flex bg-secondary-100 text-gray-900 text-base font-medium px-3.5 h-[56px] items-center justify-evenly",children:[e.jsx("div",{className:"w-[366px]",children:"강의 내용"}),e.jsx("div",{className:"w-[128px] flex justify-center",children:"주요부분"}),e.jsx("div",{className:"w-[86px] flex justify-center",children:"강의 시간"}),e.jsx("div",{className:"w-[86px] flex justify-center",children:"수강하기"})]}),_.lectures.map(L=>e.jsxs("div",{className:"pt-4",children:[t&&v.popup&&v.lectureId===L.lectureId&&e.jsx(De,{courseId:b,chapterId:_.chapterId,lectureId:v.lectureId,setPopup:m,bookmark:v.bookmark,progressPercent:t==null?void 0:t.progressPct}),!t&&f===L.lectureId&&e.jsx(ds,{setPopup:j,course:s,defaultCourseId:r}),C===L.lectureId&&e.jsx(Re,{title:s==null?void 0:s.title,setPopup:A}),e.jsxs("div",{className:"lg:flex px-[14px] lg:px-[14px] lg:pr-0",children:[e.jsx("div",{className:"lg:w-[380px]",children:e.jsx("h5",{className:"text-gray-900 font-medium text-base",children:L.title})}),e.jsxs("div",{className:"flex lg:w-[300px] items-center justify-between mt-5 lg:mt-0 pb-4 lg:pb-0",children:[L.bookmarks&&L.bookmarks.length>0?e.jsxs("button",{className:E(u===L.lectureId?"text-medi-color-purple-600 bg-primary-50 border-[#DED2FF] hover:bg-primary-100":"text-gray-900 border-gray-300 hover:bg-secondary-50","mx-4 border-solid lg:w-[128px] border-[1px] rounded-md text-xs font-semibold flex items-center justify-center w-[95px] h-[30px] space-x-1"),onClick:()=>d(S=>S===L.lectureId?"0":L.lectureId),children:[e.jsxs("div",{children:["주요부분 ",L.bookmarks.length,"개"]}),e.jsx("i",{className:E(u===L.lectureId?"ii-chevron-up":"ii-chevron-down")})]}):e.jsx("div",{className:"w-[128px]"}),e.jsxs("div",{className:"flex items-center space-x-4 lg:space-x-0 lg:w-[172px]",children:[e.jsx("div",{className:"text-gray-900 text-sm font-medium lg:w-[86px] lg:flex lg:justify-center",children:be(L.totalVideoLength)}),e.jsx("div",{className:E("cursor-pointer w-[34px] lg:w-[86px] h-[34px] rounded-full flex items-center justify-center border border-gray-300 lg:border-none",t&&$($e(t.expireAt,s.learnEndAt)).diff($(new Date))>0?"border-none":"border-gray-300"),onClick:()=>g(L),children:e.jsxs("div",{className:E(t&&$($e(t.expireAt,s.learnEndAt)).diff($(new Date))>0?"text-medi-color-purple-600 bg-primary-50 font-medium hover:bg-primary-100":"text-gray-300 lg:bg-secondary-100","relative text-[13px] lg:rounded-[4px] rounded-full h-[33px] flex items-center justify-center w-[72px]"),children:[e.jsx("span",{className:"lg:block hidden",children:"수강하기"}),e.jsx("i",{className:E(t&&$($e(t.expireAt,s.learnEndAt)).diff($(new Date))>0?"text-medi-color-purple-600":"text-gray-300","ii-play ml-1 text-xl lg:ml-0 lg:text-[13px]")})]})})]})]})]}),e.jsx("div",{className:"relative mt-6",children:u===L.lectureId&&L.bookmarks?e.jsxs("div",{className:"bg-primary-50 box-border w-full flex pl-10 pr-5 py-4 lg:rounded-md",children:[e.jsx("div",{className:"w-[3px] left-5 h-calc-full-32 flex bg-primary-500 rounded-full absolute"}),e.jsx("div",{className:"flex flex-col mt-4 gap-y-5 w-full items-start",children:L.bookmarks.map((S,Y)=>e.jsxs("div",{className:"relative w-full",children:[e.jsx("div",{className:"w-4 h-4 bg-medi-color-purple-600 rounded-full absolute -left-[26px] top-1 border-4 border-solid border-primary-500"}),e.jsxs("div",{className:"text-sm hover:underline text-gray-900 font-medium cursor-pointer",onClick:()=>g(L,S.time),children:[e.jsxs("div",{className:"truncate",children:[be(S.time),"부터"]}),e.jsx("div",{className:"line-clamp-2",children:S.description})]})]},Y))})]}):e.jsx("div",{className:"w-full h-[2px] bg-gray-200 lg:mt-4"})})]},L.lectureId)),e.jsx("div",{})]})})]},q))})]})})};const lt=({content:t})=>{var s;return typeof t=="string"?null:e.jsx(e.Fragment,{children:e.jsx("article",{className:"editorjs-view",children:(s=t==null?void 0:t.blocks)==null?void 0:s.map(r=>{var o,u,d,y,l,f,j,v,m,C,A,b;return e.jsxs(Ee.Fragment,{children:[r.type==="header"&&r.data.text&&e.jsxs(e.Fragment,{children:[r.data.level===1&&e.jsx("h1",{dangerouslySetInnerHTML:{__html:r.data.text}}),r.data.level===2&&e.jsx("h1",{dangerouslySetInnerHTML:{__html:r.data.text}}),r.data.level===3&&e.jsx("h1",{dangerouslySetInnerHTML:{__html:r.data.text}}),r.data.level===4&&e.jsx("h1",{dangerouslySetInnerHTML:{__html:r.data.text}}),r.data.level===5&&e.jsx("h1",{dangerouslySetInnerHTML:{__html:r.data.text}}),r.data.level===6&&e.jsx("h1",{dangerouslySetInnerHTML:{__html:r.data.text}})]}),r.type==="paragraph"&&r.data.text&&e.jsx("p",{dangerouslySetInnerHTML:{__html:r.data.text},className:r.data.alignment}),r.type==="list"&&e.jsxs(e.Fragment,{children:[((o=r.data)==null?void 0:o.style)==="ordered"&&e.jsx("ol",{children:(d=(u=r.data)==null?void 0:u.items)==null?void 0:d.map((h,i)=>e.jsx("li",{dangerouslySetInnerHTML:{__html:h.content}},i))}),((y=r.data)==null?void 0:y.style)==="unordered"&&e.jsx("ul",{children:(f=(l=r.data)==null?void 0:l.items)==null?void 0:f.map((h,i)=>e.jsx("li",{dangerouslySetInnerHTML:{__html:h.content}},i))})]}),r.type==="image"&&e.jsxs("figure",{children:[e.jsx("img",{src:(j=r.data.file)==null?void 0:j.url,alt:""}),((v=r.data)==null?void 0:v.caption)&&e.jsx("figcaption",{dangerouslySetInnerHTML:{__html:r.data.caption}})]}),r.type==="table"&&e.jsxs("table",{children:[e.jsx("colgroup",{children:(m=r.data.columnWidths)==null?void 0:m.map((h,i)=>e.jsx("col",{width:`${h*100+"%"}`},i))}),e.jsx("tbody",{children:(C=r.data.content)==null?void 0:C.map((h,i)=>e.jsx("tr",{children:h==null?void 0:h.map((c,P)=>{var x,g,p,F;return e.jsx(Ee.Fragment,{children:r.data.headers&&r.data.headers[i][P]?e.jsx("th",{dangerouslySetInnerHTML:{__html:c},rowSpan:`${(x=r.data)==null?void 0:x.rowSpans[i][P]}`,colSpan:`${(g=r.data)==null?void 0:g.colSpans[i][P]}`}):e.jsx("td",{dangerouslySetInnerHTML:{__html:c},rowSpan:`${(p=r.data)==null?void 0:p.rowSpans[i][P]}`,colSpan:`${(F=r.data)==null?void 0:F.colSpans[i][P]}`})},`'th-' + ${P}`)})},`'tr-' + ${i}`))})]}),r.type==="alert"&&((A=r.data)==null?void 0:A.message)&&e.jsx("section",{className:`alert ${r.data.type}`,dangerouslySetInnerHTML:{__html:(b=r.data)==null?void 0:b.message}}),r.type==="quote"&&e.jsx(e.Fragment,{children:r.data.caption&&e.jsxs("blockquote",{children:[e.jsx("div",{dangerouslySetInnerHTML:{__html:r.data.text??""}}),e.jsxs("div",{children:[e.jsx("hr",{}),e.jsx("em",{dangerouslySetInnerHTML:{__html:r.data.caption}})]})]})}),r.type==="raw"&&r.data.html&&e.jsx("div",{dangerouslySetInnerHTML:{__html:r.data.html}})]},r.id)})})})},os=({course:t,progress:s,promotionTxt:r,defaultCourseId:o})=>{var A,b,h,i,c;const{id:u}=ee(),[d,y]=N.useState({popup:!1,bookmark:0,lectureId:""}),[l,f]=N.useState(""),j=Be(),v=new URLSearchParams(j.search),m=v.get("chapterId"),C=v.get("lectureId");return e.jsxs("div",{className:"fixed bottom-0 left-0 right-0 shadow-footer py-[15p
1x] bg-[#fff] z-[91] px-4 lg:mb-6",children:[d.popup&&e.jsx(De,{courseId:u,chapterId:m,lectureId:C,setPopup:y,bookmark:d.bookmark,progressPercent:s==null?void 0:s.progressPct}),l&&e.jsx(Re,{title:t.title,setPopup:f}),e.jsxs("div",{className:"flex items-center justify-between space-x-5",children:[e.jsxs("div",{className:"w-[65%]",children:[e.jsx("div",{className:"break-all overflow-hidden text-ellipsis line-clamp-2 lg:line-clamp-1 text-gray-900 text-[15px] lg:text-[20px] font-semibold",children:t==null?void 0:t.title}),e.jsx("div",{className:"hidden lg:block",children:r})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:t.products.length>0&&e.jsxs("div",{className:"text-medi-color-purple-600 text-[25px] mr-5 font-semibold hidden lg:block w-52 text-right",children:[de((A=t==null?void 0:t.products[0])==null?void 0:A.regularPrice,(b=t==null?void 0:t.products[0])==null?void 0:b.salePrice)!==0&&!t.isFree&&e.jsxs("span",{className:"text-alert mr-2",children:[de((h=t==null?void 0:t.products[0])==null?void 0:h.regularPrice,(i=t==null?void 0:t.products[0])==null?void 0:i.salePrice),"%"]}),t.isFree?"0":(c=t==null?void 0:t.products[0])==null?void 0:c.salePrice.toLocaleString(),"원"]})}),e.jsx("div",{className:"w-[88px] h-10 lg:w-[190px] lg:h-[60px] lg:text-[25px]",children:e.jsx(Oe,{simple:!0,course:t,progress:s,defaultCourseId:o})})]})]})]})},jt={intro:"강의소개",curriculum:"커리큘럼",recommend:"추천",faq:"FAQ 및 공지"},yt=Object.keys(jt),at=yt[0],xs=N.forwardRef(({courseId:t,lectureList:s,defaultCourseId:r,scrollToCurriculum:o},u)=>{var H,U,O,_,q,L,S,Y,W,J,a,n,I,B,D,G,qe,Ke,He;const[d,y]=N.useState(at),[l,f]=N.useState(!1),j=Le(),v=N.useRef(null),m=N.useRef(null),C=N.useRef(null),[A,b]=N.useState(!1),h=N.useMemo(()=>{var k;return(k=s.course.lecturerNames)==null?void 0:k.join(",")},[s.course.lecturerNames]),{data:i=[]}=Gt({lecturers:h}),{data:c}=et({productId:(U=(H=s.course.products)==null?void 0:H[0])==null?void 0:U.productId,contentType:"CLASS"},{enabled:!!((_=(O=s.course.products)==null?void 0:O[0])!=null&&_.productId)}),{data:P=[]}=Wt((c==null?void 0:c.list)||[]),x=N.useMemo(()=>{const k=(i==null?void 0:i.filter(w=>(w==null?void 0:w.courseId)!==t))||[],ce=new Set(k.map(w=>w==null?void 0:w.courseId)),we=(P==null?void 0:P.filter(w=>(w==null?void 0:w.courseId)&&!ce.has(w==null?void 0:w.courseId)))||[],ke=k.map(w=>{var ge,ue;return{courseId:w==null?void 0:w.courseId,thumbnailImage:w==null?void 0:w.thumbnailImageUrl,lecturers:w==null?void 0:w.lecturers,title:w==null?void 0:w.title,groupedBadges:w==null?void 0:w.groupedBadges,regularPrice:(ge=w==null?void 0:w.product)==null?void 0:ge.regularPrice,salePrice:(ue=w==null?void 0:w.product)==null?void 0:ue.salePrice,isFree:w==null?void 0:w.isFree}}),Ce=we.map(w=>{var ge,ue,Ye,Ue,ze,Ge;return{courseId:w==null?void 0:w.courseId,thumbnailImage:(ge=w==null?void 0:w.thumbnailImage)==null?void 0:ge.link,lecturers:((ue=w==null?void 0:w.lecturers)==null?void 0:ue.map(vt=>vt.name))||[],title:w==null?void 0:w.title,groupedBadges:w==null?void 0:w.groupedBadges,regularPrice:(Ue=(Ye=w==null?void 0:w.products)==null?void 0:Ye[0])==null?void 0:Ue.regularPrice,salePrice:(Ge=(ze=w==null?void 0:w.products)==null?void 0:ze[0])==null?void 0:Ge.salePrice,isFree:w==null?void 0:w.isFree}});return[...ke,...Ce]},[P,i,t]),{data:g}=et({productId:(L=(q=s.course.products)==null?void 0:q[0])==null?void 0:L.productId,contentType:"SEMINAR"},{enabled:!!((Y=(S=s.course.products)==null?void 0:S[0])!=null&&Y.productId)}),{data:p=[]}=Ot((g==null?void 0:g.list)||[]),F=x.length>0||p.length>0,T=k=>{switch(y(k),k){case"intro":Se(v,"smooth");break;case"curriculum":o();break;case"recommend":Se(m,"smooth");break;case"faq":Se(C,"smooth");break}},M=()=>{if(u&&"current"in u&&u.current){const k=u.current.getBoundingClientRect();b(k.top<=window.innerHeight)}};return N.useEffect(()=>{window.scrollTo(0,0),y(at)},[t]),N.useEffect(()=>(window.addEventListener("scroll",M),()=>{window.removeEventListener("scroll",M)}),[]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"z-20 mt-[24px] w-full h-[52px] max-w-[1200px] m-auto border-b-[1px] border-secondary-900 flex items-center justify-around text-lg text-[#333] sticky top-[53px] bg-secondary-100",children:yt.filter(k=>k==="intro"||k==="curriculum"&&!re(s.course)||k==="recommend"&&F||k==="faq").map((k,ce)=>e.jsx("div",{className:E(d===k?"text-white bg-secondary-900":"",re(s.course)?"w-[50%]":"w-1/3","cursor-pointer border-solid flex items-center justify-center h-full relative group"),onClick:()=>T(k),children:jt[k]},ce))}),e.jsx("div",{className:"max-w-[1200px] px-4 m-auto lg:px-0",children:e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"mt-[48px]",children:[e.jsx("h3",{className:"text-[#333] font-bold text-[22px] mb-[24px] leading-[24px]",ref:v,children:"강의소개"}),e.jsx("div",{className:E(l?"":"min-h-[100px] max-h-[750px] overflow-hidden","w-full"),children:((J=(W=s.course)==null?void 0:W.page)==null?void 0:J.editorType)==="proseMirror"?e.jsx(Je,{children:e.jsx(Xe,{contentString:(n=(a=s.course)==null?void 0:a.page)==null?void 0:n.contentString})}):e.jsx(Je,{children:e.jsx(lt,{content:(I=s.course)==null?void 0:I.page.content})})}),!l&&e.jsx("div",{className:"mt-[24px]",children:e.jsxs("button",{className:"w-full h-[61px] p-[20px] rounded-[10px] leading-[21px] border border-solid border-[#ccc] text-[#333] text-[18px] font-semibold flex items-center justify-center hover:bg-secondary-50",onClick:()=>f(!0),children:["강의소개 전체보기",e.jsx("i",{className:"ii ii-chevron-down ii-weight-600 text-[20px] text-[#333] ml-3"})]})})]}),e.jsx("div",{ref:u,children:!re(s==null?void 0:s.course)&&e.jsx(cs,{progress:s.progress,course:s.course,defaultCourseId:r})}),e.jsxs("div",{ref:m,children:[x.length>0&&e.jsxs("div",{className:"mt-[48px]",children:[e.jsx("h3",{className:"text-[#333] font-bold text-[22px] mb-[24px] leading-[24px]",children:"강연자의 또 다른 강의"}),e.jsx(xe,{options:{breakpoints:{0:{slidesPerView:j?1.3:2.3,spaceBetween:j?14:8}}},navigationTop:"top-[74px]",children:x.map(k=>{var ce,we,ke,Ce;return e.jsx(te,{children:e.jsx(K,{to:`/${R}/course/${k==null?void 0:k.courseId}`,className:"block pb-[10px]",children:e.jsx(se,{thumbnail:k==null?void 0:k.thumbnailImage,lecturers:k==null?void 0:k.lecturers,title:k==null?void 0:k.title,topic:(ce=k==null?void 0:k.groupedBadges)==null?void 0:ce.topics,topicCategory:(we=k==null?void 0:k.groupedBadges)==null?void 0:we.topicCategory,level:(Ce=(ke=k==null?void 0:k.groupedBadges)==null?void 0:ke.level)==null?void 0:Ce.join(","),regularPrice:k==null?void 0:k.regularPrice,salePrice:k==null?void 0:k.salePrice,isSwiper:!0,isFree:k==null?void 0:k.isFree})})},k==null?void 0:k.courseId)})})]}),p.length>0&&e.jsxs("div",{className:"mt-[48px] pl-[15px] lg:pl-0 relative",children:[e.jsx("h3",{className:"text-[#333] font-bold text-[22px] mb-[24px] leading-[24px]",children:"추천 세미나"}),e.jsx(Me,{className:"pb-[10px]",direction:"horizontal",slidesPerView:2.3,spaceBetween:j?14:24,modules:[mt],watchSlidesProgress:!0,observer:!0,observeParents:!0,navigation:{nextEl:".swiper-button-next1",prevEl:".swiper-button-prev1"},children:p.map(k=>e.jsx(te,{children:e.jsx(Dt,{bid:k.article.bid,thumbnail:k.article.thumbnail,topic:k.article.topic,title:k.article.title,location:k.article.locationCities,startDate:k.article.start_date,endD
1ate:k.article.end_date,point:k.article.point})},k.article.bid))}),e.jsxs("div",{className:"hidden lg:block",children:[e.jsx("button",{className:"swiper-button-next1 absolute w-9 h-9 rounded-full shadow-custom z-10 bg-white -right-5 top-[120px] disabled:hidden",children:e.jsx("i",{className:"ii ii-chevron-right ii-weight-600 text-[20px] flex items-center justify-center"})}),e.jsx("button",{className:"swiper-button-prev1 absolute w-9 h-9 rounded-full shadow-custom z-10 bg-white -left-5 top-[120px] disabled:hidden",children:e.jsx("i",{className:"ii ii-chevron-left ii-weight-600 text-[20px] flex items-center justify-center"})})]})]})]}),e.jsxs("div",{className:"mt-[48px]",children:[e.jsx("h3",{className:"text-[#333] font-bold text-[22px] mb-[24px] leading-[24px]",ref:C,children:"FAQ 및 공지"}),((D=(B=s.course)==null?void 0:B.announcement.page)==null?void 0:D.editorType)==="proseMirror"?e.jsx(Xe,{contentString:(qe=(G=s.course)==null?void 0:G.announcement.page)==null?void 0:qe.contentString}):e.jsx(lt,{content:(He=(Ke=s.course)==null?void 0:Ke.announcement.page)==null?void 0:He.content})]}),j&&A&&e.jsx(os,{course:s.course,progress:s.progress,promotionTxt:s.course.description,defaultCourseId:r})]})})]})}),ps=()=>{var f,j,v,m,C,A;const{id:t}=ee(),s=le(),r=ae(ie),o=N.useRef(null);N.useEffect(()=>{window.scrollTo(0,0)},[t]);const u=()=>{if(!o.current)throw new Error("curriculumRef is not defined");Se(o,"smooth")},{data:d,isLoading:y}=V(["classCourses",t,r],()=>{var b;return(b=z)==null?void 0:b.get(r&&(r.user_type==="doctor"||r.user_type==="student")?`/class/courses/${t}`:`/class/public/courses/${t}`).then(h=>h.data)},{onError:b=>{b.response.status===401?X.error("구매할 수 없는 회원입니다. 관리자에게 문의해주세요."):b.response.status===404&&(X.error("존재하지 않는 강의입니다."),s(-1))}}),l=N.useMemo(()=>{var b,h,i,c;return((h=(b=d==null?void 0:d.collection)==null?void 0:b.courses)==null?void 0:h.some(P=>P.courseId===t))&&((i=d==null?void 0:d.collection)==null?void 0:i.defaultCourseId)!==t&&((c=d==null?void 0:d.collection)==null?void 0:c.defaultCourseId)||void 0},[t,(f=d==null?void 0:d.collection)==null?void 0:f.courses,(j=d==null?void 0:d.collection)==null?void 0:j.defaultCourseId]);return t?!d||y?e.jsx(me,{small:!0}):e.jsxs("div",{className:"relative max-w-[1200px] m-auto pt-[24px]",children:[e.jsxs("div",{className:"mb-[24px] px-4 flex flex-col gap-[14px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"text-medi-text-secondary text-[16px] font-bold",children:[(v=d.course.groupedBadges.level)==null?void 0:v.join("")," |"," ",(m=d.course.groupedBadges.topics)==null?void 0:m.slice(0,4).join(", ")]}),d.course.isFree&&e.jsx("div",{className:"text-secondary-600 bg-secondary-600/10 rounded-[2px] px-[4px] h-[20px] font-semibold text-[10px] leading-[20px] tracking-[-0.36px]",children:"무료 강의"})]}),e.jsx("h3",{className:"text-gray-900 text-lg lg:text-[25px] font-semibold break-all overflow-hidden text-ellipsis line-clamp-2 lg:line-clamp-1",children:d.course.title})]}),e.jsxs("div",{className:"lg:px-4 lg:grid lg:grid-cols-[1fr_450px] lg:gap-[56px] mb-[56px]",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(ns,{lectureList:d,course:d.course,collection:d.collection,studentCourses:d.studentCourses,defaultCourseId:l,scrollToCurriculum:u}),e.jsx(xs,{ref:o,courseId:t,lectureList:d,scrollToCurriculum:u})]}),e.jsx("div",{className:"hidden lg:block min-w-0",children:e.jsx("div",{className:"w-full sticky top-[104px]",children:e.jsx(bt,{course:d.course,progress:d.progress,defaultCourseId:l,lectureProductId:(A=(C=d.course.products)==null?void 0:C[0])==null?void 0:A.productId,scrollToCurriculum:u})})})]})]}):(s(R),e.jsx(e.Fragment,{}))},ms=(t,s)=>V(["classCurationsDetailApi",t,s],()=>Ht({curationId:s}),{enabled:!!s&&t,refetchOnWindowFocus:!1,refetchOnMount:!0,refetchOnReconnect:!0}),gs=t=>V(["classPublicCurationsDetailApi",t],()=>ht({curationId:t}),{enabled:!!t,refetchOnWindowFocus:!1,refetchOnMount:!0,refetchOnReconnect:!0}),us=()=>{var A;const t=le(),{curationId:s}=ee(),r=ae(ie),o=N.useMemo(()=>!!r&&r&&!!r.user_type,[r]),{isFetching:u,data:d}=gs(s),{isFetching:y,data:l}=ms(o,s),f=N.useMemo(()=>o?l==null?void 0:l.curation:d==null?void 0:d.curation,[o,d,l]),j=N.useMemo(()=>f==null?void 0:f.courses,[f]),v=N.useMemo(()=>(j==null?void 0:j.map(b=>{var h;
1return(h=b.products[0])==null?void 0:h.productId}))||[],[j]),{data:m}=_e({ids:v},{select:b=>(b==null?void 0:b.hits)||[],enabled:!!(r!=null&&r.uid)&&((A=v||[])==null?void 0:A.length)>0});N.useEffect(()=>{s||t(R)},[]);const C=b=>{var h;return(h=m==null?void 0:m.find(i=>i.id===b))==null?void 0:h.is_sold_out};return y||u?e.jsx(me,{small:!0}):!f||!j?e.jsx(It,{to:`/${R}`,replace:!0}):e.jsxs(St,{className:"px-0 !pt-0",children:[e.jsx("section",{className:"max-w-[1200px] mx-auto",children:e.jsx("div",{className:"lg:mx-auto lg:mt-6 lg:max-w-[1200px] lg:border-b-2 lg:border-pureblack lg:px-0 lg:py-[10px] lg:text-left border-b-8 border-solid  border-secondary-100 px-4 py-[14px] text-center flex items-end justify-between",children:e.jsx("h2",{className:"break-keep text-[20px] font-bold leading-[27.6px] text-secondary-800 lg:text-[30px] lg:leading-[36px]",children:f.title})})}),e.jsxs("section",{className:"max-w-[1200px] mt-[24px] mx-auto px-5 xl:px-0",children:[e.jsxs("div",{className:"flex items-center gap-[8px] text-[18px] font-semibold mb-[20px]",children:[e.jsx("h3",{className:"text-secondary-900",children:"전체"}),e.jsx("span",{className:"text-primary-700",children:j.length})]}),e.jsx("div",{className:"w-full grid grid-cols-2 gap-x-[12px] gap-y-[24px] lg:grid-cols-4 lg:gap-x-[4px] lg:gap-y-[40px]",children:j.map(b=>{var h,i,c,P;return e.jsx(K,{className:"block",to:`/${R}/course/${b.courseId}`,children:e.jsx(se,{thumbnail:b.thumbnailImage.link,lecturers:b.lecturerNames,title:b.title,regularPrice:(h=b.products[0])==null?void 0:h.regularPrice,salePrice:(i=b.products[0])==null?void 0:i.salePrice,topic:b.groupedBadges.topics,topicCategory:b.groupedBadges.topicCategory,level:(c=b.groupedBadges.level)==null?void 0:c.join(","),isFree:b.isFree,isSoldOut:C(((P=b.products[0])==null?void 0:P.productId)||"")})},b.courseId)})})]})]})},Hs=()=>e.jsxs("article",{children:[e.jsxs(Pt,{children:[e.jsx(Ie,{path:"/curation/:curationId",element:e.jsx(us,{})}),e.jsx(Ie,{path:"/search",element:e.jsx(ls,{})}),e.jsx(Ie,{path:"/course/:id",element:e.jsx(ps,{})}),e.jsx(Ie,{path:"/*",element:e.jsx(Qt,{})})]}),e.jsx(_t,{})]});export{Hs as default};
2//# sourceMappingURL=KlassRoute-75fc0066.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.