1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6862],{19457:e=>{e.exports={indicatorContainer:"IndicatorV2_indicatorContainer__9LrJt",locked:"IndicatorV2_locked__mnYMy",btnIcon:"IndicatorV2_btnIcon__AGew3",indicator:"IndicatorV2_indicator__89bbx",light:"IndicatorV2_light__VZV_X",point:"IndicatorV2_point__3ZDJW",navBtn:"IndicatorV2_navBtn__mqaX7",fill:"IndicatorV2_fill__FuNpG",active:"IndicatorV2_active__WN3r2",dark:"IndicatorV2_dark__N_cWy"}},28979:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var o=n(95155),s=n(74473),i=n(97307),l=n(12115),d=n(69730),a=n.n(d),r=n(19457),c=n.n(r),_=n(73321);let u=e=>{var t,n;let d=l.useRef(null),r=(0,_.usePathname)().includes("/dl"),u=e.images.length-1,p=0===e.index,w=e.index===u,h=e.locked,{start:f,count:g}=(t=e.images.length,n=e.index,t<=6?{start:0,count:t}:{start:Math.min(Math.max(n-2,0),t-6),count:6}),m=Array.from({length:g},(e,t)=>f+t);return l.useEffect(()=>{let e=e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),e.stopPropagation())},t=d.current;return t&&t.addEventListener("keydown",e),()=>{t&&t.removeEventListener("keydown",e)}},[]),(0,o.jsxs)("div",{className:a()(c().indicatorContainer,{[c().light]:!e.isDark,[c().locked]:e.locked}),style:{opacity:+!r},children:[(0,o.jsx)("button",{type:"button",onClick:()=>{h||p||e.navigateHandler(0,"smooth")},disabled:h||p,className:a()(c().navBtn,{[c().light]:!e.isDark}),"aria-label":"Go to first",children:(0,o.jsx)(i.FTT,{className:c().btnIcon})}),(0,o.jsx)("button",{type:"button",onClick:()=>{h||p||e.navigateHandler(e.index-1,"smooth")},disabled:h||p,className:a()(c().navBtn,{[c().light]:!e.isDark}),"aria-label":"Previous",children:(0,o.jsx)(s.E_E,{className:c().btnIcon})}),(0,o.jsx)("ul",{onClick:()=>{let e=d.current;e&&e.blur()},ref:d,className:a()(c().indicator,{[c().light]:!e.isDark}),children:m.map(t=>(0,o.jsx)("li",{className:a()(c().point,{[c().light]:!e.isDark}),onClick:()=>{if(h)return;e.navigateHandler(t);let n=d.current;n&&n.blur()},children:(0,o.jsx)("div",{className:a()(c().fill,{[c().active]:e.index===t,[c().dark]:e.isDark})})},`indicator-${t}`))}),(0,o.jsx)("button",{type:"button",onClick:()=>{h||w||e.navigateHandler(e.index+1,"smooth")},disabled:h||w,className:a()(c().navBtn,{[c().light]:!e.isDark}),"aria-label":"Next",children:(0,o.jsx)(s.xVu,{className:c().btnIcon})}),(0,o.jsx)("button",{type:"button",onClick:()=>{h||w||e.navigateHandler(u,"smooth")},disabled:h||w,className:a()(c().navBtn,{[c().light]:!e.isDark}),"aria-label":"Go to last",children:(0,o.jsx)(i.Cw0,{className:c().btnIcon})})]})}},31460:(e,t,n)=>{"use strict";n.d(t,{Eb:()=>i});var o=n(15455);let s=(0,o.eU)({});(0,o.eU)(e=>{let t=Object.entries(e(s));return t.length>0&&t.every(([,e])=>e)});let i=(0,o.eU)(0)},35876:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>f});var o=n(95155),s=n(12115),i=n(55259),l=n.n(i),d=n(69730),a=n.n(d),r=n(74473),c=n(247),_=n(48409),u=n(93930),p=n(37229),w=n(28105),h=n(29988);let f=e=>{let{onDownloadIdCtx:t}=s.useContext(c.Ay);return(0,o.jsxs)("div",{className:l().screen,children:[(0,o.jsx)("div",{className:a()(l().btn_ctn,{[l().ondownload]:t}),children:(0,o.jsx)(b,{...e})}),(0,o.jsx)("div",{className:l().ctrl_ctn,children:(0,o.jsx)("button",{className:l().btn_cancel,children:(0,o.jsx)(r.Tfw,{className:l().icon})})})]})},g=e=>{let{onClick:t,featureLabel:n}=e;return(0,o.jsxs)("button",{className:a()(l().button,{[l().btn_1]:1===e.level,[l().btn_2]:2===e.level,[l().btn_3]:3===e.level,[l().dark]:e.isDark,[l().btn_downloaded]:e.isDownloaded}),type:"button",style:e.style,onClick:e=>{(0,h.Xz)(n),t?.(e)},disabled:e.isDownloaded||e.disabled,children:[(0,o.jsx)(x,{isDark:e.isDark,icon:e.isDownloaded&&e.downloadedIcon||e.icon,level:e.level}),(0,o.jsx)("div",{className:a()(l().button_separator,{[l().dark]:e.isDark})}),(0,o.jsx)("span",{className:l().text,children:e.isDownloaded?e.texts.downloaded:e.texts.download})]})},m=e=>{let[t,n]=s.useState(null),[i,d]=s.useState(null),[c,u]=s.useState(null),p=s.useRef(null);return(s.useEffect(()=>{let e=()=>{d({height:window.innerHeight,width:window.innerWidth})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),s.useEffect(()=>{let e=()=>{p.current&&u(p.current.getBoundingClientRect())};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),s.useEffect(()=>{let e=()=>{n(null)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}
1,[]),e.options)?(0,o.jsxs)("div",{ref:p,className:a()(l().split_btn_ctn),children:[(0,o.jsx)("button",{onClick:e.onClick,style:{...e.style},className:a()(l().split_btn_main,{[l().btn_1]:1===e.level,[l().btn_2]:2===e.level,[l().btn_3]:3===e.level,[l().dark]:e.isDark}),children:e.texts.download}),(0,o.jsx)("button",{onClick:o=>{let s=o.currentTarget.getBoundingClientRect(),l=s.height,d=s.width,a=l*(e.options?.length||0),r=a+80-(i?i.height-s.y:0)>0?-(a+10):l+10;s&&!t?n({x:s.left+d,y:s.top+r,itemHeight:l}):n(null)},className:a()(l().split_btn_opt,{[l().btn_1]:1===e.level,[l().btn_2]:2===e.level,[l().btn_3]:3===e.level,[l().dark]:e.isDark}),children:(0,o.jsx)(r.j1Q,{style:{transition:"transform 0.2s ease-in-out",transform:t?"rotate(180deg)":"rotate(0deg)"},size:24,className:l().btn_opt_icon})}),t&&c&&(0,o.jsx)(_.default,{portalElementId:"modal-portal",children:(0,o.jsx)("div",{style:{top:t.y,left:t.x,width:c.width},className:a()(l().opt_window,{[l().window_1]:1===e.level,[l().window_2]:2===e.level,[l().window_3]:3===e.level,[l().dark]:e.isDark}),children:(0,o.jsx)("ul",{className:a()(l().opt_ls),children:e.options.map(s=>(0,o.jsx)("li",{className:a()(l().opt_item,{[l().dark]:e.isDark}),children:(0,o.jsx)(g,{_id:s._id,icon:s.icon,level:e.level,isDark:e.isDark,style:{height:t.itemHeight,...e.style},onClick:()=>{s.onClickHandler(),n(null)},texts:{...e.texts,download:s.opt_texts},disabled:e.disabled})},s._id))})})})]}):(0,o.jsx)(g,{...e})},x=e=>(0,o.jsx)("div",{className:a()(l().icon_ctn,{[l().dark]:e.isDark}),children:e.icon}),b=e=>{let{onDownloadIdCtx:t,downloadIdQueueCtx:n,downloadedListCtx:i}=s.useContext(c.Ay);s.useEffect(()=>{(0,w.gg)("slideshow download button props id: ",e._id),(0,w.gg)("slideshow download button downloadIdQueueCtx: ",n)},[e._id,n]);let l=e.options?.map(e=>e._id);return i.includes(e._id)||e.options&&e.options.some(e=>i.includes(e._id))?(0,o.jsx)(g,{...e,isDownloaded:!0}):(n[0]===e._id||l?.includes(n[0]))&&e._id.includes("-live")?((0,w.gg)("render video progress bar"),(0,o.jsx)(p.A,{...e,_id:n[0],offline_id:n[0],filename:e.options?.find(e=>e._id===n[0])?.filename||e.filename})):(n[0]===e._id||l?.includes(n[0]))&&!e._id.includes("-live")?(0,o.jsx)(u.A,{...e,_id:n[0],filename:e.options?.find(e=>e._id===n[0])?.filename||e.filename}):e.options?(0,o.jsx)(m,{...e}):(0,o.jsx)(g,{...e})}},49132:e=>{e.exports={progress_bar:"SlideshowProgressBar_progress_bar__AcM3T",dark:"SlideshowProgressBar_dark__96fe_",progress_bar_fill:"SlideshowProgressBar_progress_bar_fill__PjimH",progress_bar_info:"SlideshowProgressBar_progress_bar_info__0_2G1",centered:"SlideshowProgressBar_centered__h1Cky",progress_bar_info_slideshow_to_video_v2:"SlideshowProgressBar_progress_bar_info_slideshow_to_video_v2__j5r6T",progress_bar_info_slideshow_to_video_v2_text_ctn:"SlideshowProgressBar_progress_bar_info_slideshow_to_video_v2_text_ctn__zWYLk",progress_bar_info_slideshow_to_video_v2_percentage:"SlideshowProgressBar_progress_bar_info_slideshow_to_video_v2_percentage__3HwRM",progress_bar_info_slideshow_to_video_v2_queue_stats:"SlideshowProgressBar_progress_bar_info_slideshow_to_video_v2_queue_stats__tdJAG"}},55259:e=>{e.exports={screen:"DownloadButton_screen___q44R",btn_ctn:"DownloadButton_btn_ctn__2dRdw",ondownload:"DownloadButton_ondownload__NhuYD",ctrl_ctn:"DownloadButton_ctrl_ctn__HonAs",btn_cancel:"DownloadButton_btn_cancel__1izY1",button_ctn_v3:"DownloadButton_button_ctn_v3__L2vP9",button_v3:"DownloadButton_button_v3__8XP1O",button_main:"DownloadButton_button_main__nwyZu",text:"DownloadButton_text__vg1iN",divider:"DownloadButton_divider__LmFLF",button_ctrl:"DownloadButton_button_ctrl__yeQya",button_dropdown:"DownloadButton_button_dropdown__vR_Wc",button:"DownloadButton_button__UDuMt",button_separator:"DownloadButton_button_separator__WO2It",dark:"DownloadButton_dark__e0zwf",icon_ctn:"DownloadButton_icon_ctn__g_xTp",no_bg:"DownloadButton_no_bg__ZeMTd",btn_1:"DownloadButton_btn_1__mZT_S",split_btn_main:"DownloadButton_split_btn_main__CBuAd",
1split_btn_opt:"DownloadButton_split_btn_opt__qqtFp",opt_window:"DownloadButton_opt_window__UuvJQ",window_1:"DownloadButton_window_1__d_TO2",btn_2:"DownloadButton_btn_2__v_nig",window_2:"DownloadButton_window_2__Es1tY",btn_3:"DownloadButton_btn_3__a_h0S",window_3:"DownloadButton_window_3__dFGnJ",split_btn_ctn:"DownloadButton_split_btn_ctn__tmzL4",opt_ls:"DownloadButton_opt_ls__r45Uw",opt_item:"DownloadButton_opt_item__24ZUs",btn_downloaded:"DownloadButton_btn_downloaded__1f51k"}},59133:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>L});var o=n(95155),s=n(12115),i=n(92159),l=n.n(i),d=n(247),a=n(95555),r=n(31460),c=n(69730),_=n.n(c),u=n(74473),p=n(93930),w=n(48409),h=n(98314),f=n(42021),g=n(29356),m=n(12505),x=n(98500),b=n.n(x),v=n(73321),D=n(14185),k=n(9683),j=n(47226);function I({enabled:e,durationMs:t=5e3,placement:n="top-end",offsetX:o=0,offsetY:i=0}){let[l,d]=s.useState(e);s.useEffect(()=>{d(e)},[e]),s.useEffect(()=>{if(!l||0===t)return;let e=setTimeout(()=>d(!1),t);return()=>clearTimeout(e)},[l,t]);let{refs:a,floatingStyles:r}=(0,k.we)({strategy:"fixed",placement:n,middleware:[(0,k.cY)({mainAxis:10+i,crossAxis:o}),(0,k.UU)(),(0,k.BN)({padding:8})],whileElementsMounted:j.ll});return{referenceRef:a.setReference,floatingRef:a.setFloating,floatingStyles:r,show:e&&l}}n(63784);var y=n(28105),N=n(24867),S=n(37229),B=n(92843),E=n(29988);let O=e=>{let t=(0,v.usePathname)()||"/",n=(0,a.md)(D.Ec),i=(0,D.lL)(t),r=(0,D.o5)(n??i);(0,a.md)(B.B);let{downloadedListCtx:c,downloadedListHandlerCtx:p,downloadIdQueueHandlerCtx:x,downloadStatusHandlerCtx:k,downloadIdQueueCtx:j,isOnRetryHDCtx:S,progressBarUIOnlyHandlerCtx:O,addDownloadIdHandlerCtx:C,systemLocaleCtx:A,videoDataCtx:L}=s.useContext(d.Ay),[V,R]=s.useState(null),[F,$]=s.useState(null),[z,P]=s.useState(null),U=s.useRef(null),q=t.includes("/download-hd")||t.includes("/dl-hd"),M="en"===A?"":`/${A}`,{adStatus:W,showAd:H}=(0,N.e)("/23321251588/VG-hd-rewarded",()=>{J()}),Z="no-fill"===W,X="ready"===W;s.useEffect(()=>{let e=()=>{$({height:window.innerHeight,width:window.innerWidth})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),s.useEffect(()=>{let e=()=>{R(null)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]);let Y=()=>{R(null)},J=()=>{let t=e.options[e.selectedOptIndex];if((0,E.Xz)(t?.featureLabel),!q&&S){p(e.options[e.selectedOptIndex]._id),k("DOWNLOADED");return}if(console.log("check if main button link trigger handle download function"),console.log("handleDownloadObj: ",{_id:e.options[e.selectedOptIndex]._id,selectedOptIndex:e.selectedOptIndex}),sessionStorage.setItem("hdSlideshowIndex",e.selectedImageIndex.toString()),e.options[e.selectedOptIndex]._id?.includes("hd")){q||O(!0),x(),console.log("_id map from oprtions: ",e.options.map(e=>e._id)),console.log("selectedOptIndex: ",e.selectedOptIndex),C(e.options[e.selectedOptIndex]._id),k("DOWNLOADING");return}e.options[e.selectedOptIndex]&&(e.options[e.selectedOptIndex].downloadClickHandler(),Y())},G=c.includes(e.options[e.selectedOptIndex]._id),Q=e.options[e.selectedOptIndex].texts.sub_download&&"-"!==e.options[e.selectedOptIndex].texts.sub_download?e.options[e.selectedOptIndex].texts.sub_download:"",K=j.length>0,ee=I({enabled:e.options.some(e=>e._id.includes("-live")),durationMs:5e3,offsetY:-10});s.useEffect(()=>{console.log("isDownloading: ",K),console.log("isDownloaded: ",G),console.log("isAdsRewardedReady: ",X),console.log("isAdsRewardedEmpty: ",Z)},[]);let et=s.useMemo(()=>L?.data_type==="profile"?`${r}/dl-hd-pfp${M}`:`${r}/dl-hd${M}`,[L?.data_type]);return(0,o.jsxs)("div",{className:l().button_ctn_v3,children:[(0,o.jsxs)("div",{ref:U,className:_()(l().button_v3,{[l().btn_1]:1===e.level,[l().btn_2]:2===e.level,[l().btn_3]:3===e.level,[l().dark]:e.isDark,[l().btn_downloaded]:c.includes(e.options[e.selectedOptIndex]._id)}),style:e.style,children:[K||G||X&&!Z?(0,o.jsxs)("button",{disabled:K||G,className:_()(l().button_main,l().faded,{[l().align_left]:"left"===e.options[e.selectedOptIndex].align,[l().align_center]:"center"===e.options[e.selectedOptIndex].align,[l().align_right]:"right"===e.options[e.selectedOptIndex].align}),onClick:()=>{X&&!Z&&H()},children:[(0,o.jsx)(m.$TP,{className:l().icon_arrow}),(0,o.jsx)("div",{className:_()(l().divider,{[l().dark]:e.isDark})}),(0,o.jsx)(T,{isDark:e.isDark,icon:e.options[e.selectedOptIndex].icon,level:e.level}),(0,o.jsxs)("div",{className:l().text_ctn,children:[(0,o.jsx)("span",{className:_()(l().text,{[l().sm]:Q}
1),children:G?e.options[e.selectedOptIndex].texts.downloaded:e.options[e.selectedOptIndex].texts.download}),Q&&(0,o.jsx)("span",{className:l().sub_text,children:Q})]})]}):(0,o.jsxs)(b(),{href:q?e.options[e.selectedOptIndex].url:et,prefetch:!1,className:_()(l().button_main,{[l().align_left]:"left"===e.options[e.selectedOptIndex].align,[l().align_center]:"center"===e.options[e.selectedOptIndex].align,[l().align_right]:"right"===e.options[e.selectedOptIndex].align}),onClick:J,children:[(0,o.jsx)(m.$TP,{className:l().icon_arrow}),(0,o.jsx)("div",{className:_()(l().divider,{[l().dark]:e.isDark})}),(0,o.jsx)(T,{isDark:e.isDark,icon:e.options[e.selectedOptIndex].icon,level:e.level}),(0,o.jsxs)("div",{className:l().text_ctn,children:[(0,o.jsx)("span",{className:_()(l().text,{[l().sm]:Q}),children:G?e.options[e.selectedOptIndex].texts.downloaded:e.options[e.selectedOptIndex].texts.download}),Q&&(0,o.jsx)("span",{className:l().sub_text,children:Q})]})]}),e.options[e.selectedOptIndex]&&e.options[e.selectedOptIndex].settingClickHandler&&(0,o.jsx)("div",{className:l().button_ctrl,children:(0,o.jsx)("div",{className:l().button_ctrl_item,onClick:()=>e.options[e.selectedOptIndex].settingClickHandler?.(),children:(0,o.jsx)(u.hgV,{className:_()(l().setting_icon,{[l().dark]:e.isDark})})})})]}),e.options.length>1&&!e.hideOptions&&!q&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("button",{ref:ee.referenceRef,type:"button",onClick:()=>{let t=U.current?.getBoundingClientRect();if(!t)return;P(t);let n=t.height,o=t.width,s=n*(e.options?.length||0),i=s+80-(F?F.height-t.y:0)>0?-(s+10):n+10;t&&!V?R({x:t.x+o,y:t.y+i,itemHeight:n}):R(null)},className:_()(l().button_dropdown,{[l().dark]:e.isDark}),children:V?(0,o.jsx)(g.PXF,{className:_()(l().dropdown_icon,{[l().dark]:e.isDark})}):(0,o.jsx)(f.v5n,{className:_()(l().dropdown_icon,{[l().dark]:e.isDark})})})}),!!V&&z&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w.default,{portalElementId:"modal-portal",children:(0,o.jsx)("div",{style:{top:V.y,left:V.x,width:z.width},className:_()(l().opt_window,{[l().window_1]:1===e.level,[l().window_2]:2===e.level,[l().window_3]:3===e.level,[l().dark]:e.isDark}),children:(0,o.jsx)("ul",{className:_()(l().opt_ls),children:e.options.map((t,n)=>(0,o.jsx)("li",{className:_()(l().opt_item,{[l().dark]:e.isDark}),children:(0,o.jsxs)("button",{className:l().button_main,type:"button",onClick:()=>{let t;(0,y.gg)("handleOptItemClick",n),e.setSelectedOpt(n),Y(),t=`slideshow-${e.selectedImageIndex}-${e.level}-pref-opt`,(0,y.gg)(t,n.toString()),e.skipSessionMemory||sessionStorage.setItem(t,n.toString())},children:[(0,o.jsx)(T,{isDark:e.isDark,icon:t.icon,level:e.level}),(0,o.jsx)("div",{className:_()(l().divider,{[l().dark]:e.isDark})}),(0,o.jsxs)("div",{className:l().text_ctn,children:[(0,o.jsx)("span",{className:_()(l().text,{[l().sm]:!!t.texts.sub_download}),children:t.texts.download}),!!t.texts.sub_download&&(0,o.jsx)("span",{className:l().sub_text,children:t.texts.sub_download})]})]})},t._id+n))})})}),(0,o.jsx)(h.A,{show:!!V,close:Y,opacity:.001})]})]})},C=e=>{let t=(0,v.usePathname)()||"/",n=(0,a.md)(D.Ec),i=(0,D.lL)(t),r=(0,D.o5)(n??i),{downloadedListCtx:c,downloadIdQueueCtx:p,systemLocaleCtx:x,progressBarUIOnlyHandlerCtx:k,addDownloadIdHandlerCtx:j,downloadStatusHandlerCtx:N}=s.useContext(d.Ay),S=p.length>0,B=e.options[e.selectedOptIndex]._id.includes("-zip"),O=t.includes("/dl-slideshow-zip"),C="en"===x?"":`/${x}`,[A,L]=s.useState(null),[V,R]=s.useState(null),[F,$]=s.useState(null),z=s.useRef(null);s.useEffect(()=>{let e=()=>{R({height:window.innerHeight,width:window.innerWidth})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),s.useEffect(()=>{let e=()=>{L(null)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]);let P=()=>{L(null)},U=()=>{if(!e.options[e.selectedOptIndex])return;let t=e.options[e.selectedOptIndex];if((0,E.Xz)(t.featureLabel),B&&!O){k(!0),j(e.options[e.selectedOptIndex]._id),N("DOWNLOADING");return}e.options[e.selectedOptIndex].downloadClickHandler(),P()},q=c.includes(e.options[e.selectedOptIndex]._id),M=e.options[e.selectedOptIndex].texts.sub_download&&"-"!==e.options[e.selectedOptIndex].texts.sub_download?e.options[e.selectedOptIndex].texts.sub_download:"",W=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(m.$TP,{className:l().icon_arrow}),(0,o.jsx)("div",{className:_()(l().divider,{[l().dark]:e.isDark})}),(0,o.jsx)(T,{isDark:e.isDark,icon:e.options[e.selectedOptIndex].icon,level:e.level}),(0,o.jsxs)("div",{className:l().text_ctn,children:[(0,o.jsx)("span",{className:_()(l().text,{[l().sm]:M}),children:q?e.options[e.selectedOptIndex].texts.downloaded:e.options[e.selectedOptIndex].texts.download}),M&&(0,o.jsx)("span",{className:l().sub_text,children:M})]})]}),H=I({enabled:e.options.some(e=>e._id.includes("-live")),durationMs:5e3});return(0,o.jsxs)("div",{className:l().button_ctn_v3,children:[(0,o.jsxs)("div",{ref:z,className:_()(l().button_v3,{[l().btn_1]:1===e.level,[l().btn_2]:2===e.level,[l().btn_3]:3===e.level,[l().dark]:e.isDark,[l().btn_downloaded]:c.includes(e.options[e.selectedOptIndex]._id)}),style:e.style,children:[B&&!O?(0,o.jsx)(b(),{href:`${r}/dl-slideshow-zip${C}`,prefetch:!1,className:_()(l().button_main,{[l().align_left]:"left"===e.options[e.selectedOptIndex].align,[l().align_center]:"center"===e.options[e.selectedOptIndex].align,[l().align_right]:"right"===e.options[e.selectedOptIndex].align}),onClick:U,children:W}):(0,o.jsx)("button",{className:_()(l().button_main,{[l().align_left]:"left"===e.options[e.selectedOptIndex].align,[l().align_center]:"center"===e.options[e.selectedOptIndex].align,[l().align_right]:"right"===e.options[e.selectedOptIndex].align}),disabled:q||S,type:"button",onClick:U,children:W}),e.options[e.selectedOptIndex]&&e.options[e.selectedOptIndex].settingClickHandler&&(0,o.jsx)("div",{className:l().button_ctrl,children:(0,o.jsx)("div",{className:l().button_ctrl_item,onClick:()=>e.options[e.selectedOptIndex].settingClickHandler?.(),children:(0,o.jsx)(u.hgV,{className:_()(l().setting_icon,{[l().dark]:e.isDark})})})})]}),e.options.length>1&&!e.hideOptions&&!O&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("button",{ref:H.referenceRef,type:"button",onClick:()=>{let t=z.current?.getBoundingClientRect();if(!t)return;$(t);let n=t.height,o=t.width,s=n*(e.options?.length||0),i=s+80-(V?V.height-t.y:0)>0?-(s+10):n+10;t&&!A?L({x:t.x+o,y:t.y+i,itemHeight:n}):L(null)},className:_()(l().button_dropdown,{[l().dark]:e.isDark}),children:A?(0,o.jsx)(g.PXF,{className:_()(l().dropdown_icon,{[l().dark]:e.isDark})}):(0,o.jsx)(f.v5n,{className:_()(l().dropdown_icon,{[l().dark]:e.isDark})})})}),!!A&&F&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w.default,{portalElementId:"modal-portal",children:(0,o.jsx)("div",{style:{to
1p:A.y,left:A.x,width:F.width},className:_()(l().opt_window,{[l().window_1]:1===e.level,[l().window_2]:2===e.level,[l().window_3]:3===e.level,[l().dark]:e.isDark}),children:(0,o.jsx)("ul",{className:_()(l().opt_ls),children:e.options.map((t,n)=>(0,o.jsx)("li",{className:_()(l().opt_item,{[l().dark]:e.isDark}),children:(0,o.jsxs)("button",{className:l().button_main,type:"button",onClick:()=>{let t;(0,y.gg)("handleOptItemClick",n),e.setSelectedOpt(n),P(),t=`slideshow-${e.selectedImageIndex}-${e.level}-pref-opt`,(0,y.gg)(t,n.toString()),e.skipSessionMemory||sessionStorage.setItem(t,n.toString())},children:[(0,o.jsx)(T,{isDark:e.isDark,icon:t.icon,level:e.level}),(0,o.jsx)("div",{className:_()(l().divider,{[l().dark]:e.isDark})}),(0,o.jsxs)("div",{className:l().text_ctn,children:[(0,o.jsx)("span",{className:_()(l().text,{[l().sm]:!!t.texts.sub_download}),children:t.texts.download}),!!t.texts.sub_download&&(0,o.jsx)("span",{className:l().sub_text,children:t.texts.sub_download})]})]})},t._id+n))})})}),(0,o.jsx)(h.A,{show:!!A,close:P,opacity:.001})]})]})},T=e=>(0,o.jsx)("div",{className:_()(l().icon_ctn,{[l().dark]:e.isDark},l().no_bg),children:(0,o.jsx)(e.icon,{className:l().icon})}),A=e=>{let{onDownloadIdCtx:t,downloadIdQueueCtx:n,downloadedListCtx:i}=s.useContext(d.Ay),[l,c]=(0,a.fp)(r.Eb);s.useEffect(()=>{void 0!=sessionStorage.getItem(`slideshow-${e.selectedImageIndex}-${e.level}-pref-opt`)||e.skipSessionMemory||sessionStorage.setItem(`slideshow-${e.selectedImageIndex}-${e.level}-pref-opt`,l.toString())},[]),s.useEffect(()=>{let t=sessionStorage.getItem(`slideshow-${e.selectedImageIndex}-${e.level}-pref-opt`);void 0!=t||e.skipSessionMemory||c(t?parseInt(t):0)},[e.selectedImageIndex,c]);let _=s.useMemo(()=>e.options[l||0],[e.options,l]);return(s.useEffect(()=>{console.log("props.options: ",e.options),console.log("selectedOpt: ",_)},[_]),s.useEffect(()=>{_._id},[_,n,l]),_&&n[0]===_._id&&!_._id.includes("live"))?(0,o.jsx)(p.A,{...e,url:_.url,_id:_._id,filename:_.filename,withSpeed:!1,sessionId:e.sessionId,featureLabel:_.featureLabel}):_&&n[0]===_._id&&_._id.includes("live")?(0,o.jsx)(S.A,{...e,url:_.url,_id:_._id,filename:_.filename,withSpeed:!0,downloadText:_.texts.download,downloadingText:_.texts.downloading,downloadedText:_.texts.downloaded,waitingText:_.texts.waiting,featureLabel:_.featureLabel}):_&&_._id?.includes("hd")?(0,o.jsx)(O,{...e,selectedOptIndex:l,setSelectedOpt:c,_id:_._id}):_?(0,o.jsx)(C,{...e,selectedOptIndex:l,setSelectedOpt:c,_id:_._id}):null},L=e=>{let{onDownloadIdCtx:t}=s.useContext(d.Ay);return(0,o.jsxs)("div",{className:l().screen,children:[(0,o.jsx)("div",{className:_()(l().btn_ctn,{[l().ondownload]:t}),children:(0,o.jsx)(A,{...e})}),(0,o.jsx)("div",{className:l().ctrl_ctn,children:(0,o.jsx)("button",{className:l().btn_cancel,children:(0,o.jsx)(u.Tfw,{className:l().icon})})})]})}},63784:e=>{e.exports={root:"FloatingNoticeBubble_root__aF_PH",panel:"FloatingNoticeBubble_panel__JlN3e",panelDark:"FloatingNoticeBubble_panelDark__A9eaM",caret:"FloatingNoticeBubble_caret__7VmND",caretDark:"FloatingNoticeBubble_caretDark__daniN"}},88404:(e,t,n)=>{"use strict";n.d(t,{z:()=>s});var o=n(9339);let s=(0,o.createServerReference)("402cf4f796b6c3c7e80175e38c2d7bd7cf1bcc2f3c",o.callServer,void 0,o.findSourceMapURL,"addSlideshowToVideoQueue")},92159:e=>{e.exports={screen:"SlideshowDownloadButtonV3_screen__FKrOY",btn_ctn:"SlideshowDownloadButtonV3_btn_ctn__6S8rS",ondownload:"SlideshowDownloadButtonV3_ondownload__tJBoy",ctrl_ctn:"SlideshowDownloadButtonV3_ctrl_ctn__cKv9Z",btn_cancel:"SlideshowDownloadButtonV3_btn_cancel__gHDRy",button_ctn_v3:"SlideshowDownloadButtonV3_button_ctn_v3__xigrP",button_v3:"SlideshowDownloadButtonV3_button_v3__89u9y",button_main:"SlideshowDownloadButtonV3_button_main__C47_f",align_left:"SlideshowDownloadButtonV3_align_left__pQhnY",align_center:"SlideshowDownloadButtonV3_align_center__UWFeL",align_right:"SlideshowDownloadButtonV3_align_right__VR0uD",text_ctn:"SlideshowDownloadButtonV3_text_ctn__xAsj1",text:"SlideshowDownloadButtonV3_text__Px0eu",sm:"SlideshowDownloadButtonV3_sm__TPFuY",sub_text:"SlideshowDownloadButtonV3_sub_text__kyJtZ",divider:"SlideshowDownloadButtonV3_divider__PXZ4f",dark:"SlideshowDownloadButtonV3_dark___dhum",button_ctrl:"SlideshowDownloadButtonV3_button_ctrl__8IBuJ",button_ctrl_item:"SlideshowDownloadButtonV3_button_ctrl_item__MM0ec",button_dropdown:"SlideshowDownloadButtonV3_button_dropdown__Yxsq5",icon:"SlideshowDownloadButtonV3_icon__8kuvj",dropdown_icon:"SlideshowDownloadButtonV3_dropdown_icon__Zmaz3",open:"SlideshowDownloadButtonV3_open__Z_PrK",button:"SlideshowDownloadButtonV3_button__N8W1b",icon_ctn:"SlideshowDownloadButtonV3_icon_ctn__Ou5bS",no_bg:"SlideshowDownloadButtonV3_no_bg__SUBKE",btn_1:"SlideshowDownloadButtonV3_btn_1__CwpE4",opt_window:"SlideshowDownloadButtonV3_opt_window__v1DU5",window_1:"SlideshowDownloadButtonV3_window_1__MEqxk",btn_2:"SlideshowDownloadButtonV3_btn_2__85Yrw",window_2:"SlideshowDownloadButtonV3_window_2__iy0jS",btn_3:"SlideshowDownloadButtonV3_btn_3__jtw_3",window_3:"SlideshowDownloadButtonV3_window_3__aAwHq",split_btn_ctn:"SlideshowDownloadButtonV3_split_btn_ctn__eM378",split_btn_main:"SlideshowDownloadButtonV3_split_btn_main__pmT8y",split_btn_opt:"SlideshowDownloadButtonV3_split_btn_opt__c1YQq",opt_ls:"SlideshowDownloadButtonV3_opt_ls__JY_Ww",opt_item:"SlideshowDownloadButtonV3_opt_item___pNcQ",btn_downloaded:"SlideshowDownloadButtonV3_btn_downloaded__kn2D0",setting_icon:"SlideshowDownloadButtonV3_setting_icon__6NTJH"}},93930:(e,t,n)=>{"use strict";n.d(t,{A:()=>F});var o=n(95155),s=n(49132),i=n.n(s),l=n(12115),d=n(247),a=n(72575),r=n(33856),c=n(3701),_=n(21338),u=n(69730),p=n.n(u),w=n(73321),h=n(27898),f=n(6442),g=n(9339);let m=(0,g.createServerReference)("40eb963b62ffa6791a4265e1227a6edad03ca3275f",g.callServer,void 0,g.findSourceMapURL,"addSlideshowZipQueue");var x=n(88404),b=n(95555),v=n(92843),D=n(28105),k=n(30832);let j=/image\/(p?jpeg|jpg|jfif)/i,I=/\.(zip|mp4|mp3|webm|txt)$/i,y=/(\.(png|jfif|jpe?g|webp|heic|heif|gif|avif))+$/i,N="image/jpeg,image/png,image/*;q=0.8,*/*;q=0.5",S={jpeg:".jpg",png:".png",gif:".gif",webp:".webp",avif:".avif",heic:".heic",unknown:null};function B(e){let t=e.replace(y,"");return`${t}.jpg`}function E(e,t){let n=S[t];return n?`${e.replace(y,"")}${n}`:e}function O(e,t,n){return String.fromCharCode(...e.subarray(t,n))}async function C(e){var t;let n=new Uint8Array(await e.slice(0,16).arrayBuffer());if(n.length>=3&&255===n[0]&&216===n[1])return"jpeg";if(n.length>=8&&137===n[0]&&80===n[1]&&78===n[2]&&71===n[3])return"png";if(n.length>=6&&71===n[0]&&73===n[1])return"gif";if(n.length>=12&&"RIFF"===O(n,0,4)&&"WEBP"===O(n,8,12))return"webp";if(n.length>=12&&"ftyp"===O(n,4,8)){let e=O(n,8,12);return e.startsWith("avif")||e.startsWith("avis")?"avif":e.startsWith("heic")||e.startsWith("heif")||e.startsWith("heix")||e.startsWith("mif1")||e.startsWith("msf1")?"heic":"avif"}return t=e.type,j.test(t)?"jpeg":"image/webp"===t?"webp":"image/png"===t?"png":"image/gif"===t?"gif":"image/avif"===t?"avif":"image/heic"===t||"image/heif"===t?"heic":"unknown"}async function T(e,t=.92){let n=await createImageBitmap(e);try{let e=document.createElement("canvas");e.width=n.width,e.height=n.height;let o=e.getContext("2d");if(!o)throw Error("Could not get canvas context");
1return o.drawImage(n,0,0),await new Promise((n,o)=>{e.toBlob(e=>e?n(e):o(Error("canvas.toBlob failed")),"image/jpeg",t)})}finally{n.close()}}async function A(e){let t=(await Promise.resolve().then(n.t.bind(n,15079,23))).default;return await t({blob:e,toType:"image/jpeg",quality:1})}async function L(e,t,n){if(I.test(t))return{blob:e,filename:t};let o=await C(e),s="unknown"===o?function(e){if(!e)return null;let t=e.toLowerCase();return t.includes(".heic")||t.includes(".heif")?"heic":t.includes(".webp")?"webp":t.includes(".png")?"png":t.includes(".avif")?"avif":t.includes(".gif")?"gif":null}(n)??o:o;if("jpeg"===s)return{blob:e,filename:B(t)};try{if("heic"===s)return{blob:await A(e),filename:B(t)};if("webp"===s||"png"===s||"avif"===s)return{blob:await T(e),filename:B(t)}}catch{return{blob:e,filename:E(t,s)}}return"unknown"!==s?{blob:e,filename:E(t,s)}:{blob:e,filename:t}}function V(e,t){let n=function(e,t){return!I.test(t)&&!(!j.test(e.type)&&(e.type||/\.[a-z0-9]+$/i.test(t)))}(e,t),o=n?B(t):t,s=n?e.slice(0,e.size,"application/octet-stream"):e,i=URL.createObjectURL(s),l=document.createElement("a");l.href=i,l.download=o,l.style.display="none",document.body.appendChild(l),l.click(),setTimeout(()=>{document.body.contains(l)&&document.body.removeChild(l),URL.revokeObjectURL(i)},100)}let R=e=>e?`${e.active}/${e.maxConcurrency} active \xb7 ${e.waiting}/${e.maxWaiting} waiting`:"",F=e=>{let t=(0,w.useRouter)(),n=(0,w.usePathname)()||"/",{socket:s,isConnected:u}=((0,w.useSearchParams)(),(0,f.FO)({url:"https://cnvt.vidgap.com",autoConnect:!1})),g=e._id+"-offline";(0,b.md)(v.B);let{sizeCtx:j,loadedCtx:I,initTimeCtx:y,currentTimeCtx:S,setSizeHandlerCtx:B,setLoadedHandlerCtx:E,setInitHandlerCtx:O,setCurrentHandlerCtx:C,progressResetCtx:T,downloadStatusHandlerCtx:A,onDownloadIdHandlerCtx:F,downloadIdQueueCtx:$,downloadIdQueueHandlerCtx:z,downloadedListHandlerCtx:P,showInstallCardHandlerCtx:U,downloadedListCtx:q,videoDataCtx:M,userHighlightDataCtx:W,activeHighlightIdCtx:H,highlightContentDataCtx:Z,userPlaylistDataCtx:X,activePlaylistIdCtx:Y,playlistContentDataCtx:J,sessionIdCtx:G,slideshowProgressDetailsCtx:Q,slideshowProgressDetailsHandlerCtx:K,slideshowProgressDetailsTextDictCtx:ee,resetSlideshowProgressDetailsCtx:et,toastHandlerCtx:en,progressBarUIOnlyCtx:eo,progressBarUIOnlyHandlerCtx:es,isOnRetrySlideshowCtx:ei,isOnRetrySlideshowHandlerCtx:el}=l.useContext(d.Ay),[ed,ea]=l.useState(null),[er,ec]=l.useState(!0),[e_,eu]=l.useState(0),[ep,ew]=l.useState(null),[eh,ef]=l.useState(null),[eg,em]=l.useState(null),[ex,eb]=l.useState(null),ev=l.useRef(null),eD=l.useRef(!1),ek=l.useRef(!1),ej=l.useRef(null),eI=l.useRef(null),ey=l.useRef(0),eN=l.useRef(!1),eS=l.useRef(!1),eB=l.useRef(!1),eE=new AbortController,eO=e=>{e.displayedText&&e.displayedText==Q.displayedText||K(t=>({...t,texts:[...t.texts,e.displayedText??""],...e}))},eC=()=>{et()},eT=l.useCallback(()=>{ej.current&&(clearTimeout(ej.current),ej.current=null),eI.current&&(clearInterval(eI.current),eI.current=null)},[]),eA=l.useCallback(e=>{eT();let t=Math.max(1,e);eb(t),eI.current=setInterval(()=>{eb(e=>null!==e&&e>0?e-1:e)},1e3),ej.current=setTimeout(()=>{eT(),eb(null),ew(null),eS.current=!0,el(!0)},1e3*t)},[eT,el]),eL=l.useCallback(t=>{let n=e.sessionId||ep;if(t.sessionId&&n&&t.sessionId!==n)return;eN.current=!0,t.queueStats&&em(t.queueStats);let o="WAITING_TRIMMED"===t.reason;eO({eta:0,displayedText:o?ee.failed:ee.on_waiting_queue}),eP(!1),e$(0),o&&(A("FAILED"),en("FAILED"),ew(null),s?.connected&&s.disconnect()),eA(t.retryAfter??30)},[e.sessionId,ep,eA,A,en,s,ee.failed,ee.on_waiting_queue]),eV=l.useCallback(async()=>{if(!eN.current)return;ey.current+=1;let e=Math.min(30*Math.pow(2,ey.current-1),300);eO({eta:0,displayedText:ee.on_waiting_queue}),eP(!1),eb(e),await new Promise(t=>{eT(),eI.current=setInterval(()=>{eb(e=>null!==e&&e>0?e-1:e)},1e3),ej.current=setTimeout(t,1e3*e)}),eT(),eb(null)},[eT,ee.on_waiting_queue]);l.useEffect(()=>()=>{eT()},[eT]),l.useEffect(()=>{if(!(e._id.includes("hd")&&e.url?.includes("profile-hd"))||eo||!e.url)return;let t=!0,n=_.A.CancelToken.source();return ea(n),O(new Date().getTime()),E(0),B(1),_.A.get(e.url,{onDownloadProgress(e){t&&(eP(!1),C(new Date().getTime()),E(e.loaded),e.total&&e.total>0&&B(e.total))},headers:{Accept:N},responseType:"blob",cancelToken:n.token}).then(async n=>{if(!t)return;let{blob:o,filename:s}=await L(n.data,e.filename||"profile-hd.jpg",e.url);t&&(V(o,s),setTimeout(()=>{t&&(A("DOWNLOADED"),P(e._id),z())},1e3))}).catch(e=>{!_.A.isCancel(e)&&t&&((0,D.SZ)("Profile HD download error:",e),A("FAILED"),z())}),()=>{t=!1,n.cancel()}},[e._id,e.url,e.filename,eo]),l.useEffect(()=>
1{if(!(e._id.includes(c.X)||e._id.includes("-zip"))&&!e._id.includes("hd")&&!eo&&e._id!==c.hu&&!e._id.includes(c.X)){let t=_.A.CancelToken.source();return ea(t),O(new Date().getTime()),(async e=>await (0,a.HC)(e))(g).then(async n=>{if(n){let{blob:t,filename:o}=await L(n.blob,e.filename);V(t,o),P(e._id),z()}else{let n=e.url.includes("/api/video/redirect"),o=M?.contentId,s=async i=>{if(n&&o){let e=await (0,k.a)(o);e.success||(0,D.KE)("Failed to ensure video access cookie:",e.error)}try{return await _.A.get(e.url,{onDownloadProgress:function(e){let t=new Date().getTime();C(t),E(e.loaded),e.total&&e.total>0&&e.total!==j&&B(e.total)},method:"GET",headers:{Accept:N},responseType:"blob",cancelToken:t.token})}catch(t){if(_.A.isCancel(t))throw t;let e=t.response?.status;if(i>0&&(425===e||n&&o&&(403===e||429===e))){if(e$(0),eP(!0),E(0),B(1),C(1),O(new Date().getTime()),429===e){let e=t.response?.headers?.["retry-after"],n=e?parseInt(String(e),10):2,o=(Number.isFinite(n)?n:2)*1e3;await new Promise(e=>setTimeout(e,o))}else 425===e&&await new Promise(e=>setTimeout(e,500));return n&&o&&await (0,k.a)(o),s(i-1)}throw t}};s(1).then(async t=>{setTimeout(()=>{A("DOWNLOADED")},1e3);let{blob:n,filename:o}=await L(t.data,e.filename,e.url);if(e._id.includes("-offline")){let t=e.offline_id??e._id,{title:o,username:s}=(0,r.nK)(t,{videoDataCtx:M,userHighlightDataCtx:W,activeHighlightIdCtx:H,highlightContentDataCtx:Z,userPlaylistDataCtx:X,activePlaylistIdCtx:Y,playlistContentDataCtx:J});await (0,a.e_)({blob:n,id:t,title:o,username:s,date:new Date,expiry:new Date(Date.now()+12096e5),type:e.dataType,inputUrl:e.inputUrl,duration:M?.duration}),fetch("https://vidgap.com/api/download/offline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input_url:e.inputUrl,content_type:e.dataType})}),e.offline_id?P(e.offline_id):P(e._id),z()}e._id.includes("-offline")||(V(n,o),P(e._id),z())}).catch(e=>{_.A.isCancel(e)?(A("CANCEL"),(0,D.SZ)("message: "+e.message)):(425===e?.response?.status?(0,D.KE)("DOWNLOAD-TOO-EARLY (425): ",e):(0,D.SZ)("DOWNLOAD-ERROR: ",e),A("FAILED"))})}}),function(){eE.abort(),T()}}},[]),l.useEffect(()=>{let t=n.includes("/dl-slideshow-zip");e._id.includes("-zip")&&t&&(eo?es(!1):(ei&&(eD.current=!1,ev.current=null,eB.current=!1,ef(null),el(!1)),eD.current||(eD.current=!0,(async()=>{O(new Date().getTime());let t=M?.contentId??e._id,n=e.urls?.filter(Boolean)??[],o=await m({contentId:t,images:n});o.success&&o.sessionId?ef(o.sessionId):((0,D.SZ)("ZIP pool registration failed:",o.error),A("FAILED"))})())))},[n,eo,e._id,ei]),l.useEffect(()=>{let t=n.includes("/dl-slideshow-zip"),o=n.includes("/dl-slideshow")&&!t,s=e._id.includes(c.X)&&!e._id.includes("-offline");if(o&&s){if(eo)return void es(!1);if(e.sessionId||(ei&&(ek.current=!1,ew(null)),ek.current))return;ek.current=!0,(async()=>{ei&&((0,D.gg)("Retry detected, resetting conversionSessionId"),el(!1),eS.current?eS.current=!1:await eV());let t={medium:{resolution:"medium",fps:30,imageDuration:e.imageDuration||"match-audio"},high:{resolution:"high",fps:60,imageDuration:e.imageDuration||"match-audio"}},n=e.liveImageUrls&&e.liveImageUrls.some(e=>""!==e),o=!e._id.includes("no-transitions")&&(e.withTransitions??!1),s=M?.title||"Untitled",i={username:M?.username||"Unknown",contentId:M?.contentId||"Unknown",imageUrls:e.urls||[],sessionId:"-",audioUrl:e.audioUrl,transitions:o,langId:"en",headers:"-",message:encodeURIComponent(s),url:encodeURIComponent(e.inputUrl),renderOptions:t[e.renderQuality||"medium"],liveImageUrls:n?e.liveImageUrls:void 0};(0,D.gg)("slideshow to video data",i);let l=await (0,x.z)(i);l?.success&&l.sessionId?(eN.current=!1,ey.current=0,eT(),eb(null),l.queueStats&&em(l.queueStats),ew(l.sessionId),(0,D.gg)("Conversion queue added with sessionId:",l.sessionId)):l&&!l.success&&"QUEUE_LIMIT_EXCEEDED"===l.error?(ek.current=!1,eL(l)):((0,D.SZ)("Failed to add slideshow to video queue:",l),A("FAILED"),en("FAILED"))})()}},[n,eo,e._id,e.sessionId,ei,eV,eT,eL]),l.useEffect(()=>{let o=e.sessionId||ep;if((0,D.gg)("sessionid slideshow-to-video-progress-bar",o),s&&!u&&s.connect(),e._id.includes(c.X)&&!e._id.includes("-offline")&&o&&s&&u){eB.current=!1;let i=e=>"preparing_download"===e?ee.preparing_download??"Preparing download":ee[e]??e,l=e=>{},d=e=>{eP(!1),eT(),eb(null),eN.current=!1;let o="string"==typeof e.error&&e.error.toLowerCase().includes("timed out");eO({eta:0,displayedText:o?"Conversion timed out after 20 minutes. Please try again.":ee.failed}),en("FAILED"),A("FAILED"),T(),ew(null),o||t.push(n.replace(/(\?.*)/g,""))},a=e=>{(0,D.KE)("slideshow-to-video job stalled:",e),d({error:e.message||"Job stalled and was terminated"})},r=e=>{(0,D.KE)("queue-limit-exceeded:",e),eL(e)},c=e=>{e.queueStats&&em(e.queueStats),eO({eta:e.eta??0,displayedText:ee.on_waiting_queue}),eP(!1)},_=e=>{e$(0),e.text&&eO({eta:0,displayedText:i(e.text)}),eP(!1)},u=e=>{eU(e.progress??0,!1,"slideshow-to-video-progress-update"),e.text&&eO({eta:e.eta??0,displayedText:i(e.text)}),eP(!1)},p=t=>{if(!t.downloadUrl){(0,D.SZ)("slideshow-to-video-ready missing downloadUrl:",t),eO({eta:0,displayedText:ee.failed}),en("FAILED"),A("FAILED"),T(),ew(null);return}((t,n)=>{if(eB.current)return;eB.current=!0,eU(100,!1,"slideshow-to-video-ready"),eP(!1),eC();let o=document.createElement("a");o.href=t,o.download=n||e.filename,document.body.appendChild(o),o.click(),document.body.removeChild(o),setTimeout(()=>{A("DOWNLOADED")},1e3),P(e._id),z(),s&&s.connected&&s.disconnect()})(t.downloadUrl,t.filename??e.filename)},w=e=>{try{let t="string"==typeof e?JSON.parse(e):e,n=t?.data??t;n&&"object"==typeof n&&"downloadUrl"in n&&"string"==typeof n.downloadUrl&&p(n)}catch(e){(0,D.SZ)("slideshow-to-video fallback parse error:",e)}};return s.emit("authenticate",o),s.on("authenticate",l),s.on("job-failed",d),s.on("job-stalled",a),s.on("queue-limit-exceeded",r),s.on("on-waiting",c),s.on("slideshow-to-video-progress-start",_),s.on("slideshow-to-video-progress-update",u),s.on("slideshow-to-video-ready",p),s.on("slideshow-to-video",w),()=>{s.off("authenticate",l),s.off("job-failed",d),s.off("job-stalled",a),s.off("queue-limit-exceeded",r),s.off("on-waiting",c),s.off("slideshow-to-video-progress-start",_),s.off("slideshow-to-video-progress-update",u),s.off("slideshow-to-video-ready",p),s.off("slideshow-to-video",w),s&&s.connected&&s.disconnect()}}},[s,e.sessionId,ep,u,eL]),l.useEffect(()=>{if(!e._id.includes("-zip")||!eh||!s)return;if(!(u||s.connected))return void s.connect();if(ev.current===eh)return;ev.current=eh;let t=()=>{eO({displayedText:ee.on_waiting_queue})},n=e=>{eU(e.percent,!1,"slideshow-zip-progress"),eO({displayedText:{starting:`${c.xL}...`,preparing_image:`${c.Zf} ${e.current}/${e.total}`,downloading_zip:`${c.r1}...`}[e.stage]??e.stage}),eP(!1)},o=t=>{if(!t.downloadUrl){(0,D.SZ)("slideshow-zip-ready missing downloadUrl:",t),A("FAILED"),s&&s.connected&&s.disconnect();return}((t,n)=>{if(eB.current)return;eB.current=!0,eU(100,!1,"slideshow-zip-ready"),eP(!1),eC();let o=document.createElement("a");o.href=t,o.download=n||e.filename,document.body.appendChild(o),o.click(),document.body.removeChild(o),setTimeout(()=>{A("DOWNLOADED")},1e3),P(e._id),z(),s&&s.connected&&s.disconnect()})(t.downloadUrl,t.filename??e.filename)},i=e=>{(0,D.SZ)("ZIP socket error:",e.error),A("FAILED"),s&&s.connected&&s.disconnect()},l=e=>{(0,D.SZ)("ZIP socket connect_error:",e.message),A("FAILED"),s&&s.connected&&s.disconnect()};return s.emit("authenticate",eh),s.on("slideshow-zip-waiting",t),s.on("slideshow-zip-progress",n),s.on("slideshow-zip-ready",o),s.on("slideshow-zip-error",i),s.on("connect_error",l),()=>{s.off("slideshow-zip-waiting",t),s.off("slideshow-zip-progress",n),s.off("slideshow-zip-ready",o),s.off("slideshow-zip-error",i),s.off("connect_error",l)}},[s,eh,u]),l.useEffect(()=>{},[n,e_,s,u]);let eR=()=>{eu(e=>e+1)};l.useEffect(()=>(window.addEventListener("focus",eR),()=>{window.removeEventListener("focus",eR)}),[]),l.useEffect(()=>
1{e._id===c.hu&&1==$.length&&(z(),A("DOWNLOADED"),P(e._id))},[$]),l.useEffect(()=>{if(!(e._id.includes(c.X)||e._id.includes("-zip")||e._id.includes("hd")&&!e.url?.includes("profile-hd"))&&!eo)if(e._ids){let t=Math.floor((e._ids.length-$.length)/e._ids.length*100);t>0&&e$(t)}else{let e=j>0?Math.floor(I/j*100):0;e$(e>0?e:0)}},[e._ids,$,I,j,c.X,eo,e.url]);let[eF,e$]=l.useState(0),[ez,eP]=l.useState(!0),eU=(e,t=!1,n="no-context")=>{e$(n=>e>100?99.99:e<n?n:t?n+e:e)},eq=l.useRef(null),eM=eF>0&&!ez?`${eF.toFixed(2)}% ${e.withSpeed?` | ${Math.floor(I/(S-y))} KB/s`:""}`:"Downloading...",eW=e=>0==e||null==e?"":e<60?`â Time left: ${e.toFixed(0)} s`:e<3600?`â Time left: ${Math.floor(e/60)} m ${e%60>0?` ${(e%60).toFixed(0)} s`:""}`:`â Time left: ${Math.floor(e/3600)} h ${e%3600>0?` ${(e%3600).toFixed(0)} m`:""}`,eH=eF>0&&!ez?(0,o.jsxs)("div",{className:i().progress_bar_info_slideshow_to_video_v2,children:[(0,o.jsxs)("span",{className:i().progress_bar_info_slideshow_to_video_v2_percentage,children:[eF.toFixed(2),"%"]}),(0,o.jsxs)("div",{className:i().progress_bar_info_slideshow_to_video_v2_text_ctn,children:[(0,o.jsx)("span",{className:i().progress_bar_info_slideshow_to_video_v2_text,children:Q.displayedText}),(0,o.jsx)("span",{className:i().progress_bar_info_slideshow_to_video_v2_eta,children:eW(Q.eta)})]}),eg?(0,o.jsx)("span",{className:i().progress_bar_info_slideshow_to_video_v2_queue_stats,children:R(eg)}):null]}):null!==ex?(0,o.jsxs)("div",{className:i().progress_bar_info_slideshow_to_video_v2,children:[(0,o.jsx)("span",{className:i().progress_bar_info_slideshow_to_video_v2_text,children:Q.displayedText||ee.on_waiting_queue}),(0,o.jsxs)("span",{className:i().progress_bar_info_slideshow_to_video_v2_eta,children:["Retrying in ",ex,"s..."]}),eg?(0,o.jsx)("span",{className:i().progress_bar_info_slideshow_to_video_v2_queue_stats,children:R(eg)}):null]}):Q.displayedText&&!ez?(0,o.jsxs)("div",{className:i().progress_bar_info_slideshow_to_video_v2,children:[(0,o.jsx)("span",{className:i().progress_bar_info_slideshow_to_video_v2_text,children:Q.displayedText}),(0,o.jsx)("span",{className:i().progress_bar_info_slideshow_to_video_v2_eta,children:eW(Q.eta)}),eg?(0,o.jsx)("span",{className:i().progress_bar_info_slideshow_to_video_v2_queue_stats,children:R(eg)}):null]}):"Loading...";return(0,o.jsxs)("div",{ref:eq,className:p()(i().progress_bar,{[i().dark]:e.isDark}),children:[eF>0&&!ez?(0,o.jsx)("div",{className:p()(i().progress_bar_fill,{[i().dark]:e.isDark}),style:{width:`${eF}%`}}):(0,o.jsx)(h.A,{isDark:e.isDark}),(0,o.jsx)("span",{className:p()(i().progress_bar_info,{[i().dark]:e.isDark,[i().centered]:!e.withSpeed&&!e._id.includes(c.X)&&!e._id.includes("-zip")}),children:e._id.includes(c.X)&&!e._id.includes("-offline")||e._id.includes("-zip")?eH:eM})]})}}}]);
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.