1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[726],{30726:function(e,t,l){l.r(t),l.d(t,{MovingCards:function(){return m}});var n=l(57437),r=l(2265),a=l(30401),s=l(10407),o=l(92451),i=l(42586),c=l(47755),u=l(95106),d=l(29216),x=l(43953),h=l(96250);function m(e){var t;let{items:l,options:m,completed:f,contentCompletedOnServer:g,onComplete:v}=e,b=(0,i.useTranslations)(),p=(0,i.useLocale)(),_=(0,h.h)(),[j,y]=(0,r.useState)(0),[N]=(0,u.Z)(),w=(0,d.d)(),k=(null==m?void 0:m.layout)==="vertical",C=(null==m?void 0:m.navigator_type)==="text",z=(null==m?void 0:m.navigator_position)==="top",T=(0,r.useRef)(null),S=(0,r.useRef)(!1),E=(0,r.useRef)(null);(0,r.useEffect)(()=>((null==l?void 0:l.length)!==1||f||S.current||(S.current=!0,E.current=setTimeout(()=>{g||N(!0),null==v||v()},5e3)),()=>{E.current&&clearTimeout(E.current)}),[null==l?void 0:l.length,f,g,N]);let M=(0,r.useCallback)(()=>{y(e=>0===e?l.length-1:e-1)},[null==l?void 0:l.length]),L=(0,r.useCallback)(()=>{if(j>=l.length-1){f||(g||N(!0),null==v||v());return}let e=j+1;y(e),e!==l.length-1||f||(g||N(!0),null==v||v())},[null==l?void 0:l.length,j,f,g,N,v]),R=(0,r.useCallback)(e=>{y(e),e!==l.length-1||f||(g||N(!0),null==v||v())},[null==l?void 0:l.length,f,g,N,v]),Z=(0,r.useRef)(R);Z.current=R;let H=(0,r.useCallback)(e=>{Z.current(e)},[]),I=(0,r.useCallback)(e=>{T.current=e.touches[0].clientX},[]),X=(0,r.useCallback)(e=>{if(null===T.current)return;let t=e.changedTouches[0].clientX-T.current;if(T.current=null,50>Math.abs(t))return;let l="ar"===p;t<0?(l?M:L)():(l?L:M)()},[p,L,M]);if((0,r.useEffect)(()=>{if(null==l?void 0:l.length)return _({type:"rectangle",currentIndex:j,total:l.length,onGoToStep:H}),()=>_(null)},[j,null==l?void 0:l.length,_,H]),!l||0===l.length)return null;
1let G=l[j],q={left:"text-left",center:"text-center",right:"text-right"}[G.options.text_alignment];return(0,n.jsxs)("div",{className:(0,x.cn)("relative flex flex-col items-center gap-6",z&&"flex-col-reverse"),children:[(0,n.jsxs)("div",{className:"relative mt-20 flex w-fit items-center justify-center",children:[(0,n.jsx)(c.z,{variant:"ghost",size:"icon",className:"absolute -start-14 z-10 hidden h-10 w-10 md:flex",onClick:M,"aria-label":b("common.prev"),children:(0,n.jsx)(s.Z,{className:"h-5 w-5 ltr:rotate-180"})}),(0,n.jsx)("div",{className:(0,x.cn)("relative overflow-hidden rounded-2xl transition-all duration-300 touch-pan-y",k?"h-[400px] w-[324px]":"h-[248px] w-[420px] max-w-[480px]"),style:{backgroundColor:G.options.bg_color},onTouchStart:I,onTouchEnd:X,children:(0,n.jsxs)("div",{className:"flex h-full flex-col justify-between p-6",children:[(0,n.jsx)("div",{className:(0,x.cn)("text-base font-medium",q),style:{color:null!==(t=G.options.title_color)&&void 0!==t?t:G.options.text_color},dangerouslySetInnerHTML:{__html:G.title}}),(0,n.jsx)("div",{className:(0,x.cn)("text-xl font-medium leading-relaxed lg:text-2xl",q,C&&"my-auto"),style:{color:G.options.text_color},dangerouslySetInnerHTML:{__html:G.content}}),k&&(0,n.jsx)("div",{className:"h-8"})]})}),(0,n.jsx)(c.z,{variant:"ghost",size:"icon",className:"absolute -end-14 z-10 hidden h-10 w-10 md:flex",onClick:L,"aria-label":b("common.next"),children:(0,n.jsx)(o.Z,{className:"h-5 w-5 ltr:rotate-180"})})]}),!w&&(0,n.jsx)(()=>C?(0,n.jsxs)("div",{className:(0,x.cn)("relative flex w-[324px] items-center justify-between px-4",q),children:[(0,n.jsx)("div",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border"}),l.map((e,t)=>{let l=t<j,r=t===j;return(0,n.jsxs)("button",{onClick:()=>R(t),className:(0,x.cn)("relative z-10 flex items-center justify-center rounded-full border transition-all",l&&"size-6",r&&"border-border bg-card px-4 py-2",!l&&!r&&"size-6 bg-card"),"aria-label":b("course_player.go_to_card",{number:t+1}),"aria-current":r?"true":void 0,style:l?{backgroundColor:e.options.bg_color}:void 0,children:[l&&(0,n.jsx)(a.Z,{className:"size-4 text-white"}),r&&(0,n.jsx)("span",{className:(0,x.cn)("whitespace-nowrap text-sm font-medium text-slate-500",q),dangerouslySetInnerHTML:{__html:e.title}})]},t)})]}):(0,n.jsx)("div",{className:"flex items-center gap-2",children:l.map((e,t)=>(0,n.jsx)("button",{onClick:()=>R(t),className:(0,x.cn)("h-2 w-2 rounded-full transition-all duration-200",t===j?"w-4 bg-foreground":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),"aria-label":b("course_player.go_to_card",{number:t+1}),"aria-current":t===j?"true":void 0},t))}),{})]})}}}]);
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.