PageSourceSearch

https://tubelab.kr/_next/static/chunks/18jr8bmz3ktbi.js

js tubelab.kr collected 2026-10-02 02:00:25 UTC 28,353 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,317449,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(438847),a=e.i(109927),n=e.i(723465),l=e.i(132893),i=e.i(827625),o=e.i(514430),d=e.i(689664),c=e.i(716327),u=e.i(456539),h=e.i(975157),m=e.i(337822);function x({options:e,value:s,onChange:a,allLabel:n,"aria-label":l,className:i}){let[o,c]=(0,r.useState)(!1),u=e.filter(e=>s.includes(e.value)),p=0===u.length?n:1===u.length?u[0].label:`${u[0].label} +${u.length-1}`;return(0,t.jsxs)(m.Popover,{open:o,onOpenChange:c,children:[(0,t.jsx)(m.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button","aria-label":l,className:(0,h.cn)("flex h-7 shrink-0 items-center gap-1 text-2xs transition-colors",i,u.length>0?"font-semibold text-primary-600 dark:text-primary-400":"font-medium text-secondary-700 hover:text-foreground dark:text-secondary-300"),children:[p,(0,t.jsx)("svg",{"aria-hidden":!0,width:8,height:6,viewBox:"0 0 8 6",fill:"currentColor",children:(0,t.jsx)("path",{d:"M0 0h8L4 6z"})})]})}),(0,t.jsx)(m.PopoverContent,{align:"start",className:"w-36 rounded-none p-1",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[e.map(r=>{let n=s.includes(r.value);return(0,t.jsxs)("button",{type:"button",onClick:()=>{var t;let n;return t=r.value,void a((n=s.includes(t)?s.filter(e=>e!==t):[...s,t]).length===e.length?[]:n)},"aria-pressed":n,className:(0,h.cn)("flex items-center justify-between gap-2 px-2 py-1.5 text-left text-xs hover:bg-secondary-100 dark:hover:bg-secondary-800",n&&"font-semibold text-primary-600 dark:text-primary-400"),children:[r.label,n&&(0,t.jsx)(d.Check,{size:12,strokeWidth:3})]},r.value)}),u.length>0&&(0,t.jsx)("button",{type:"button",onClick:()=>a([]),className:"mt-1 border-t border-secondary-200 px-2 py-1.5 text-left text-xs text-secondary-500 hover:bg-secondary-100 dark:border-secondary-700 dark:hover:bg-secondary-800",children:"모두 해제"})]})})]})}var p=e.i(341336),y=e.i(536589);let b=["방송/예능","영화드라마","정치/시사","국뽕","스포츠","동물","아이돌"],g=[...b.filter(e=>y.PRIMARY_CATEGORIES_V2.includes(e)),...y.PRIMARY_CATEGORIES_V2.filter(e=>!b.includes(e))],f=["bg-danger-400","bg-warning-400","bg-success-400","bg-info-400","bg-accent-400","bg-primary-400"];function v({label:e,active:r,onClick:s,dotClass:a,className:n}){return(0,t.jsxs)("button",{type:"button","aria-pressed":r,onClick:s,className:(0,h.cn)("flex h-7 shrink-0 items-center gap-1 rounded-full border px-2.5 text-2xs transition-colors",r?"border-primary-500 bg-primary-500 font-semibold text-white":"border-secondary-200 font-medium text-secondary-500 hover:bg-secondary-100 dark:border-secondary-700 dark:hover:bg-secondary-800",n),children:[a&&!r&&(0,t.jsx)("span",{"aria-hidden":!0,className:(0,h.cn)("size-1.5 rounded-full",a)}),e,r&&(0,t.jsx)(d.Check,{size:12,strokeWidth:3})]})}function j({className:e}){let[r,a]=(0,s.useQueryState)("ptype",(0,s.parseAsArrayOf)(s.parseAsString).withDefault([]));return(0,t.jsx)(x,{options:p.PRODUCTION_TYPE_PUBLIC_OPTIONS,value:r,onChange:e=>void a(e.length>0?e:null),allLabel:"제작유형","aria-label":"제작유형 필터",className:e})}let k={always:void 0,mdUp:"hidden md:flex",collapsed:"hidden"};function w(){let[e,a]=(0,s.useQueryState)("cat",s.parseAsString.withDefault("")),[n,l]=(0,r.useState)(!1),i=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>{let e=i.current;null!==e&&(i.current=null,window.scrollTo(0,e),requestAnimationFrame(()=>window.scrollTo(0,e)))},[n]);let o=g.map((t,r)=>t===e||r<4?{value:t,tier:"always"}:r<b.length?{value:t,tier:"mdUp"}:{value:t,tier:"collapsed"}).map((e,t)=>({...e,dotClass:f[t%f.length]}));return(0,t.jsxs)("div",{className:"scrollbar-hide flex min-w-0 flex-1 flex-nowrap items-center gap-1.5 overflow-x-auto py-1 sm:flex-wrap sm:overflow-x-visible",children:[(0,t.jsx)(j,{className:"mr-1"}),(0,t.jsx)(v,{label:"전체",active:""===e,onClick:()=>void a(null)}),o.map(r=>(0,t.jsx)(v,{label:r.value,active:e===r.value,onClick:()=>void a(r.value),dotClass:r.dotClass,className:n?void 0:k[r.tier]},r.value)),(0,t.jsx)("button",{type:"button",onMouseDown:e=>{i.current=window.scrollY,e.preventDefault()},onClick:e=>{0===e.detail&&(i.current=window.scrollY),l(e=>!e)},className:"flex h-7 shrink-0 items-center gap-0.5 px-1 text-2xs font-medium text-secondary-500 hover:text-foreground",children:n?(0,t.jsxs)(t.Fragment,{children:["접기 ",(0,t.jsx)(u.ChevronUp,{size:12})]}):(0,t.jsxs)(t.Fragment,{children:["더보기 ",(0,t.jsx)(c.ChevronDown,{size:12})]})})]})}let N=[];function C({hideSearchOnXl:e=!0,trailingFilter:r}={}){let[{q:a},n]=(0,s.useQueryStates)({q:s.parseAsString.withDefault("")}),d=(0,o.useSearchCommit)({setQ:n,key:"q",applied:a,narrowing:N});return(0,t.jsx)(i.PageToolbar,{children:(0,t.jsxs)(l.PageFilterBar,{className:"rounded-lg border border-secondary-200 p-2 dark:border-secondary-700 sm:items-start sm:justify-start sm:rounded-none sm:border-0 sm:p-0",search:{value:a,onChange:d,placeholder:"영상 제목 검색",className:e?"xl:hidden":void 0},children:[(0,t.jsx)(w,{}),r]})})}var S=e.i(806537),I=e.i(263676),A=e.i(515288),T=e.i(317670),P=e.i(110703),D=e.i(826811),O=e.i(266027),L=e.i(142771);let $={all:["home-tag-cloud"],list:e=>[...$.all,e]},z=["#16a34a","#9333ea","#ea580c","#2563eb","#dc2626","#0d9488","#c026d3","#4f46e5","#ca8a04","#0ea5e9"];function R({items:e,onWordClick:s}){let[a,n]=(0,r.useState)([]),[l,i]=(0,r.useState)({x:0,y:0});return(0,r.useEffect)(()=>
1{if(0===e.length)return;let t=e.map(e=>e.count),r=Math.max(...t),s=Math.min(...t),a=e.map((e,t)=>{let a;return{text:e.word,size:(a=e.count,r===s?24:14+Math.round((a-s)/(r-s)*28)),color:z[t%z.length]}}),l=!1,o=(0,D.default)().size([320,280]).words(a).padding(3).rotate((e,t)=>90*(t%7==3)).font("Pretendard, sans-serif").fontSize(e=>e.size??14).spiral("archimedean").on("end",e=>{if(l)return;let t=e.map(e=>({text:e.text??"",size:e.size??11,x:e.x??0,y:e.y??0,rotate:e.rotate??0,color:e.color}));if(t.length>0){let e=1/0,r=-1/0,s=1/0,a=-1/0;for(let n of t){let t=90===n.rotate?.6*n.size:n.text.length*n.size*.3,l=90===n.rotate?n.text.length*n.size*.3:.6*n.size;e=Math.min(e,n.x-t),r=Math.max(r,n.x+t),s=Math.min(s,n.y-l),a=Math.max(a,n.y+l)}i({x:(e+r)/2,y:(s+a)/2})}n(t)});return o.start(),()=>{l=!0,o.stop()}},[e]),(0,t.jsx)("svg",{viewBox:"0 0 320 280",width:"100%",className:"block",role:"img","aria-label":"바이럴 쇼츠 제목 태그 클라우드",children:(0,t.jsx)("g",{transform:`translate(${160-l.x}, ${140-l.y})`,children:a.map((e,r)=>(0,t.jsxs)("text",{textAnchor:"middle",transform:`translate(${e.x}, ${e.y}) rotate(${e.rotate})`,fontSize:e.size,fontWeight:700,fill:e.color,style:{fontFamily:"Pretendard, sans-serif"},className:"cursor-pointer transition-opacity hover:opacity-60",role:"link","aria-label":`'${e.text}' 제목 검색`,onClick:()=>s(e.text),children:[(0,t.jsx)("title",{children:`'${e.text}' 쇼츠 검색`}),e.text]},`${e.text}-${r}`))})})}function _(){let[e,a]=(0,r.useState)(7),[,n]=(0,s.useQueryState)("q",s.parseAsString.withDefault("")),{data:l,isLoading:i,isError:o}=(0,O.useQuery)({queryKey:$.list(e),queryFn:()=>(0,L.fetchJson)(`/api/viral-shorts/tag-cloud?days=${e}`),staleTime:6e5,retry:!1}),d=l?.items??[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mb-2 flex items-center justify-end gap-2",children:(0,t.jsx)("div",{className:"flex items-center gap-1",children:[{value:1,label:"1일"},{value:7,label:"7일"},{value:30,label:"30일"}].map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>a(r.value),"aria-pressed":e===r.value,className:`inline-flex h-6 items-center rounded-full px-2.5 text-xs font-semibold transition ${e===r.value?"bg-primary-600 text-white":"bg-secondary-100 text-secondary-500 hover:bg-secondary-200 dark:bg-secondary-800 dark:text-secondary-400 dark:hover:bg-secondary-700"}`,children:r.label},r.value))})}),i?(0,t.jsx)("div",{className:"aspect-[8/7] animate-pulse rounded-lg bg-secondary-100 dark:bg-secondary-800"}):o?(0,t.jsx)("p",{className:"py-10 text-center text-xs text-secondary-500",children:"키워드를 불러오지 못했어요."}):0===d.length?(0,t.jsx)("p",{className:"py-10 text-center text-xs text-secondary-500",children:"표시할 키워드가 없어요."}):(0,t.jsx)(R,{items:d,onWordClick:e=>void n(e)})]})}var E=e.i(487486),U=e.i(839885);let M=["home-trend-keywords"];function F(){let{data:e,isLoading:r,isError:a}=(0,O.useQuery)({queryKey:M,queryFn:()=>(0,L.fetchJson)("/api/viral-shorts/trend-keywords"),staleTime:24e4,refetchInterval:3e5,retry:!1}),[,n]=(0,s.useQueryState)("q",s.parseAsString.withDefault("")),l=e?.items??[];return r?(0,t.jsx)("ul",{className:"space-y-2","aria-hidden":!0,children:Array.from({length:10},(e,r)=>(0,t.jsx)("li",{className:"h-6 animate-pulse rounded-md bg-secondary-100 dark:bg-secondary-800"},r))}):a?(0,t.jsx)("p",{className:"py-10 text-center text-xs text-secondary-500",children:"키워드를 불러오지 못했어요."}):0===l.length?(0,t.jsx)("p",{className:"py-10 text-center text-xs text-secondary-500",children:"표시할 키워드가 없어요."}):(0,t.jsx)("ol",{className:"-mr-2 max-h-80 space-y-1 overflow-y-auto overscroll-contain pr-2",children:l.map((e,r)=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>void n(e.word),"aria-label":`'${e.word}' 제목 검색`,title:`'${e.word}' 제목 검색 \xb7 최근 완료 3일 ${e.count}개 채널에서 등장`,className:"-mx-1 flex h-7 w-full items-center gap-2.5 rounded-md px-1 text-left transition-colors hover:bg-secondary-100 dark:hover:bg-secondary-800",children:[(0,t.jsx)("span",{className:`w-5 shrink-0 text-center text-sm font-bold tabular-nums ${r<3?"text-primary-600 dark:text-primary-400":"text-secondary-400 dark:text-secondary-500"}`,children:r+1}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-secondary-900 dark:text-secondary-100",children:e.word}),null===e.change_pct?(0,t.jsx)(E.Badge,{variant:"danger",size:"sm",children:"NEW"}):(0,t.jsx)(U.TrendDelta,{value:e.change_pct,sign:"plusminus",className:"shrink-0"})]})},e.word))})}function Q({onClose:e}){let{entitlements:s,loading:a}=(0,T.useEntitlements)(),{promptLogin:n}=(0,P.useLoginPrompt)(),[l,i]=(0,r.useState)("trend"),o=a||!s.tagCloud,d=o?"trend":l;return(0,t.jsxs)(A.Card,{padding:"md",className:"gap-0",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(q,{label:"실시간 키워드",active:"trend"===d,onClick:()=>i("trend")}),(0,t.jsx)(q,{label:"태그 클라우드",active:"cloud"===d,locked:o,onClick:()=>o?n("insight"):i("cloud")})]}),e&&(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"인사이트 레일 닫기",className:"-mr-1 shrink-0 rounded-md p-1 text-secondary-400 transition-colors hover:bg-secondary-100 hover:text-foreground dark:hover:bg-secondary-800",children:(0,t.jsx)(I.X,{size:16})})]}),"trend"===d?(0,t.jsx)(F,{}):(0,t.jsx)(_,{})]})}function q({label:e,active:r,locked:s=!1,onClick:a}){return(0,t.jsxs)("button",{type:"button",onClick:a,"aria-pressed":r,"aria-label":s?`${e} — 로그인하면 볼 수 있어요`:void 0,className:`inline-flex h-6 items-center gap-1 rounded-full px-2.5 text-xs font-semibold transition ${r?"bg-primary-600 text-white":"bg-secondary-100 text-secondary-500 hover:bg-secondary-200 dark:bg-secondary-800 dark:text-secondary-400 dark:hover:bg-secondary-700"}`,children:[s&&(0,t.jsx)(S.Lock,{size:11}),e]})}var B=e.i(522016),K=e.i(618566),V=e.i(70155);function G({startRank:e,backdrops:s,count:a,className:n}){let{isLoggedIn:l}=(0,T.useEntitlements)(),{promptLogin:i}=(0,P.useLoginPrompt)(),o=function(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=window.matchMedia("(min-width: 640px)"),r=()=>t(e.matches);return r(),e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e?100:12}(),d=a??o,c=(0,K.useRouter)();return l?(0,t.jsx)(V.LockedCards,{title:"전체 순위는 Pro에서",description:"지금은 상위 15개까지만 보여드려요.",action:(0,t.jsx)(B.default,{href:"/pricing",className:V.LOCKED_CTA_CLASS,
1children:"Pro로 전체 보기"}),onLockedClick:()=>c.push("/pricing"),teaser:"Pro로 업그레이드하면\n바로 볼 수 있어요",count:d,startRank:e,backdrops:s,className:n}):(0,t.jsx)(V.LockedCards,{title:"숨겨진 영상을 열어보세요",action:(0,t.jsx)("button",{type:"button",onClick:()=>i("home"),className:V.LOCKED_CTA_CLASS,children:"전체 보기"}),onLockedClick:()=>i("home"),teaser:"더 많은 아이디어를\n확인해보세요",count:d,startRank:e,backdrops:s,className:n})}var J=e.i(581029),W=e.i(74176);let Y={all:["home-rising"],list:e=>[...Y.all,e]};var H=e.i(736146),X=e.i(2674),Z=e.i(301149),ee=e.i(798919);let et=["compilation"],er=new Map(p.PRODUCTION_TYPE_PUBLIC_OPTIONS.map(e=>[e.value,e.label]));var es=e.i(268047);let ea="w-40 shrink-0 snap-start md:w-auto",en="flex snap-x snap-mandatory gap-3 overflow-x-auto pb-2 md:grid md:overflow-visible md:pb-0";function el(){var e;let a,n,[l]=(0,s.useQueryState)("cat",s.parseAsString.withDefault("")),[i]=(0,s.useQueryState)("ptype",(0,s.parseAsArrayOf)(s.parseAsString).withDefault([])),[o]=(0,s.useQueryState)("q",s.parseAsString.withDefault("")),d=o.trim().length>0,[c,u]=function(){let[e,t]=(0,r.useState)(0),s=(0,r.useRef)(null);return[(0,r.useCallback)(e=>{if(s.current?.disconnect(),s.current=null,!e||"u"<typeof ResizeObserver)return;let r=()=>{let r=getComputedStyle(e).gridTemplateColumns;t(!r||"none"===r||r.includes("(")?0:r.split(" ").filter(Boolean).length)};r();let a=new ResizeObserver(r);a.observe(e),s.current=a},[]),e]}(),[m,x]=(0,r.useState)(null),p=i.join(","),y=(0,r.useMemo)(()=>({category:l,ptype:p?p.split(","):[]}),[l,p]),{data:b,isLoading:g,isError:f,refetch:v,isFetching:j}=function(e,t=!0){let{category:r,ptype:s}=e;return(0,O.useQuery)({queryKey:Y.list(e),queryFn:()=>{let e=new URLSearchParams({limit:String(48)});return r&&e.set("category",r),s.length>0&&e.set("ptype",s.join(",")),(0,L.fetchJson)(`/api/viral-shorts/rising?${e.toString()}`)},staleTime:6e5,retry:!1,enabled:t})}(y,!d),k=(0,H.useOpenShorts)(),w=(0,r.useMemo)(()=>b?.items??[],[b]),N=(0,r.useMemo)(()=>w.map(e=>({videoId:e.videoId,title:e.title,channelId:e.channelId,channelTitle:e.channelTitle,channelThumbn
1ailUrl:null,subscriberCount:null,viewCount:e.viewCount,likeCount:null,commentCount:null,publishedAt:e.publishedAt})),[w]),C=(0,r.useCallback)(e=>k(e,N,"home_rising"),[k,N]),S=`${l}|${p}`,I=m===S;if(d)return null;let A=b?.asOf??null,T=function(e,t=new Date){if(!e)return!1;let r=new Date(e).getTime();return!Number.isNaN(r)&&t.getTime()-r>12e5}(A),P=(a=function(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:(0,ee.formatKSTTime)(t)}(A))?`${a} 갱신`:null,D=(n=((e=y.ptype).length>0?e:et).map(e=>er.get(e)).filter(e=>void 0!==e)).length>0?n.join(" · "):null,$=u>0?2*u:12,z=!I&&w.length>$,R=z?w.slice(0,$):w;return(0,t.jsxs)("section",{"aria-labelledby":"home-rising-heading",className:"mb-4",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,t.jsx)("h2",{id:"home-rising-heading",className:"text-base font-bold break-keep text-secondary-900 dark:text-secondary-50",children:"지금 급상승 중인 쇼츠"}),D&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-secondary-100 px-1.5 py-0.5 text-2xs font-medium break-keep text-secondary-600 dark:bg-secondary-800 dark:text-secondary-300",children:D})]}),P&&(0,t.jsxs)("span",{className:(0,h.cn)("text-2xs break-keep tabular-nums",T?"font-semibold text-warning-600 dark:text-warning-400":"text-secondary-500 dark:text-secondary-400"),children:[P,T?" · 갱신이 늦어지고 있어요":null]})]}),g?(0,t.jsx)("div",{ref:c,className:en,style:es.VIDEO_GRID_AUTOFILL,children:Array.from({length:6}).map((e,r)=>(0,t.jsx)("div",{className:(0,h.cn)(ea,"aspect-[9/16] animate-pulse rounded-lg bg-secondary-100 dark:bg-secondary-800")},r))}):f?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 rounded-lg bg-secondary-50 px-3 py-4 text-sm break-keep text-secondary-500 dark:bg-secondary-900 dark:text-secondary-400",children:[(0,t.jsx)("span",{children:"지금 급상승 중인 쇼츠를 불러오지 못했어요."}),(0,t.jsx)("button",{type:"button",onClick:()=>void v(),disabled:j,className:"rounded-md border border-secondary-300 px-2 py-1 text-2xs font-semibold text-secondary-700 transition-colors hover:bg-secondary-100 disabled:opacity-60 dark:border-secondary-700 dark:text-secondary-200 dark:hover:bg-secondary-800",children:j?"다시 부르는 중…":"재시도"})]}):0===w.length?(0,t.jsxs)("p",{className:"rounded-lg bg-secondary-50 px-3 py-4 text-sm break-keep text-secondary-500 dark:bg-secondary-900 dark:text-secondary-400",children:["준비 중",P?` \xb7 ${P}`:""]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{ref:c,className:en,style:es.VIDEO_GRID_AUTOFILL,children:[R.map(e=>(0,t.jsx)(ei,{video:e,onPlay:()=>C(e.videoId)},e.videoId)),b?.capped?(0,t.jsx)(G,{count:4,className:ea,backdrops:R.map(e=>(0,W.shortsThumbUrl)(e.videoId))}):null]}),z?(0,t.jsx)("div",{className:"mt-2 flex justify-center",children:(0,t.jsx)("button",{type:"button",onClick:()=>x(S),className:"rounded-full border border-secondary-300 px-3 py-1 text-2xs font-semibold text-secondary-600 transition-colors hover:bg-secondary-100 dark:border-secondary-700 dark:text-secondary-300 dark:hover:bg-secondary-800",children:"더 보기"})}):null]})]})}function ei({video:e,onPlay:r}){var s,a;let n,l=(0,Z.formatUploadAgo)(e.publishedAt);return(0,t.jsx)(J.ShortsCard,{className:ea,videoId:e.videoId,title:e.title,thumbnailUrl:e.thumbnailUrl,href:`https://www.youtube.com/watch?v=${e.videoId}`,onOpen:r,channelName:e.channelTitle,channelId:e.channelId,viewCount:e.viewCount,publishedAt:e.publishedAt,overlayInfo:!0,overlayActions:!0,statsSlot:(0,t.jsxs)("div",{className:"flex items-baseline gap-1 px-0.5 pt-1.5 text-2xs text-secondary-500 dark:text-secondary-400",children:[(0,t.jsx)("span",{className:"shrink-0",children:"조회"}),(0,t.jsx)("span",{className:"shrink-0 text-sm font-bold whitespace-nowrap tabular-nums text-secondary-900 dark:text-secondary-100",children:(0,X.formatCompactKo)(e.viewCount,{nullText:"-",zeroAsNull:!0})}),l&&(0,t.jsx)("span",{className:"ml-auto shrink-0",children:l})]}),footerExtra:(0,t.jsxs)("div",{className:"flex items-center gap-1 px-0.5 pt-0.5 text-2xs",children:[(0,t.jsx)("span",{title:e.lowConfidence?"시간당 늘어난 조회수 (예상)":"시간당 늘어난 조회수",className:"shrink-0 font-bold whitespace-nowrap tabular-nums text-primary-600 dark:text-primary-400",children:(s=e.delta4h,a=e.lowConfidence,n=Math.round(s/4),`${a?"≈":""}${n<0?"-":"+"}${(0,X.formatCompactKo)(Math.abs(n))}/h`)}),e.lowConfidence&&(0,t.jsx)("span",{className:"shrink-0 text-secondary-400",children:"예상"})]})})}var eo=e.i(699375);let ed="지금 급상승 중인 쇼츠 보기",ec="home-rising-toggle",eu="flex h-7 shrink-0 items-center gap-1.5 text-2xs";function eh({allowed:e,checked:r,onCheckedChange:s,className:a}){let{isLoggedIn:n}=(0,T.useEntitlements)(),{promptLogin:l}=(0,P.useLoginPrompt)(),i=(0,K.useRouter)();return e?(0,t.jsxs)("div",{className:(0,h.cn)(eu,a),children:[(0,t.jsx)("label",{htmlFor:ec,className:"cursor-pointer break-keep text-secondary-600 dark:text-secondary-300",children:ed}),(0,t.jsx)(eo.Switch,{id:ec,checked:r,onCheckedChange:s})]}):(0,t.jsxs)("button",{type:"button",onClick:()=>{n?i.push("/pricing"):l("home")},title:`${ed} — Pro 플랜부터 이용할 수 있어요`,"aria-label":`${ed} \xb7 Pro 전용 — 업그레이드 안내로 이동`,className:(0,h.cn)(eu,"rounded-full text-secondary-500 transition-colors hover:text-secondary-700","focus-visible:ring-2 focus-visible:ring-primary-500/40 focu
1s-visible:outline-none","dark:text-secondary-400 dark:hover:text-secondary-200",a),children:[(0,t.jsx)(S.Lock,{"aria-hidden":!0,size:12,className:"shrink-0"}),(0,t.jsx)("span",{className:"break-keep",children:ed}),(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-primary-50 px-1.5 py-0.5 font-semibold text-primary-600 dark:bg-primary-950 dark:text-primary-400",children:"Pro 전용"}),(0,t.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent bg-secondary-200 opacity-50 dark:bg-secondary-700",children:(0,t.jsx)("span",{className:"block size-4 translate-x-0.5 rounded-full bg-white shadow-sm"})})]})}var em=e.i(621482);let ex={all:["home-viral-shorts"],list:e=>[...ex.all,e]};function ep(e){if(!e)return null;if(e.startsWith("http"))return e;try{let t=JSON.parse(e);return t?.default?.url??t?.medium?.url??t?.high?.url??null}catch{return null}}function ey({video:e,onPlay:r,highlight:s=!1}){return(0,t.jsx)(J.ShortsCard,{videoId:e.videoId,title:e.title,href:`https://www.youtube.com/watch?v=${e.videoId}`,onOpen:r,channelName:e.channelTitle,channelLogoUrl:ep(e.channelThumbn
1ails),channelId:e.channelId,viewCount:e.viewCount,publishedAt:e.publishedAt,overlayInfo:!0,overlayActions:!0,highlight:s})}var eb=e.i(224003),eg=e.i(110050);function ef(){let[e]=(0,s.useQueryState)("cat",s.parseAsString.withDefault("")),[a]=(0,s.useQueryState)("ptype",(0,s.parseAsArrayOf)(s.parseAsString).withDefault([])),[n]=(0,s.useQueryState)("q",s.parseAsString.withDefault("")),{data:l,isLoading:i,isError:o,fetchNextPage:d,hasNextPage:c,isFetchingNextPage:u}=function(e){let{category:t,ptype:r,q:s}=e;return(0,em.useInfiniteQuery)({queryKey:ex.list(e),queryFn:({pageParam:e})=>{let a=new URLSearchParams({limit:String(24)});return t&&a.set("category",t),r.length>0&&a.set("ptype",r.join(",")),s&&a.set("q",s),e&&(a.set("after_pub",e.afterPub),a.set("after_id",e.afterId)),(0,L.fetchJson)(`/api/viral-shorts/home?${a.toString()}`)},initialPageParam:null,getNextPageParam:e=>e.nextCursor,staleTime:3e5,retry:!1})}({category:e,ptype:a,q:n}),h=(0,r.useMemo)(()=>l?.pages.flatMap(e=>e.items)??[],[l]),m=l?.pages[0]?.capped??!1,{sentinelRef:x}=(0,eb.useInfiniteScroll)({hasNextPage:c,isFetchingNextPage:u,fetchNextPage:d}),{restoreScroll:p}=(0,eg.useScrollRestore)("viral-shorts-home"),y=(0,H.useOpenShorts)(),b=(0,r.useMemo)(()=>h.map(e=>({videoId:e.videoId,title:e.title,channelId:e.channelId,channelTitle:e.channelTitle,channelThumbn
1ailUrl:ep(e.channelThumbnails),subscriberCount:e.subscriberCount,viewCount:e.viewCount,likeCount:e.likeCount,commentCount:e.commentCount,publishedAt:e.publishedAt})),[h]);(0,r.useEffect)(()=>{h.length>0&&p()},[h.length,p]);let g=(0,r.useMemo)(()=>new Set([...h].sort((e,t)=>(t.viewCount??0)-(e.viewCount??0)).slice(0,3).map(e=>e.videoId)),[h]);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(ev,{items:h,isLoading:i,isError:o,highlightedIds:g,capped:m,onPlay:e=>y(e,b,"viral_shorts_home",{capped:m})}),c&&(0,t.jsx)("div",{ref:x,className:"flex h-10 items-center justify-center pt-2 text-sm text-secondary-400",children:u?"불러오는 중…":""})]})}function ev({items:e,isLoading:r,isError:s,highlightedIds:a,capped:n,onPlay:l}){return r?(0,t.jsx)("div",{className:"grid gap-3",style:es.VIDEO_GRID_AUTOFILL,children:Array.from({length:12}).map((e,r)=>(0,t.jsx)("div",{className:"aspect-[9/16] animate-pulse rounded-lg bg-secondary-100 dark:bg-secondary-800"},r))}):s?(0,t.jsx)("p",{className:"py-16 text-center text-sm text-secondary-500",children:"영상을 불러오지 못했어요. 잠시 후 다시 시도해주세요."}):0===e.length?(0,t.jsx)("p",{className:"py-16 text-center text-sm text-secondary-500",children:"조건에 맞는 영상이 없어요. 필터를 바꿔보세요."}):(0,t.jsxs)("div",{className:"grid gap-3",style:es.VIDEO_GRID_AUTOFILL,children:[e.map(e=>(0,t.jsx)(ey,{video:e,highlight:a.has(e.videoId),onPlay:()=>l(e.videoId)},e.videoId)),n?(0,t.jsx)(G,{startRank:e.length+1,backdrops:e.map(e=>(0,W.shortsThumbUrl)(e.videoId))}):null]})}var ej=e.i(526732),ek=e.i(226091),ew=e.i(519455),eN=e.i(129768),eC=e.i(908935),eS=e.i(106501),eI=e.i(776639),eA=e.i(251911);let eT=[{value:"daily",label:"일간 보고서",desc:"최근 1일 발행된 100만+ 쇼츠",icon:(0,t.jsx)(eN.CalendarDays,{className:"size-5"})},{value:"weekly",label:"주간 보고서",desc:"최근 7일 발행된 100만+ 쇼츠",icon:(0,t.jsx)(eC.CalendarRange,{className:"size-5"})},{value:"monthly",label:"월간 보고서",desc:"최근 30일 발행된 100만+ 쇼츠",icon:(0,t.jsx)(eS.CalendarClock,{className:"size-5"})}];function eP({open:e,onOpenChange:r,category:s="",ptype:a=""}){let{promptUpgrade:n}=(0,eA.useUpgradePrompt)(),{data:l}=(0,O.useQuery)({queryKey:["lab-access"],queryFn:()=>(0,L.fetchJson)("/api/lab/access"),enabled:e,staleTime:0});return(0,t.jsx)(eI.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(eI.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsxs)(eI.DialogHeader,{children:[(0,t.jsx)(eI.DialogTitle,{children:"Lab 트렌드 보고서"}),(0,t.jsx)(eI.DialogDescription,{children:"어떤 기간의 보고서를 생성할까요? 선택한 기간에 발행된 한국 조회수 100만+ 쇼츠를 분석합니다."})]}),(0,t.jsx)("div",{className:"mt-2 grid gap-2",children:eT.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>(function(e){if(l&&!l.canView){n("labReport"),r(!1);return}let t=new URLSearchParams({period:e});s&&t.set("cat",s),a&&t.set("ptype",a),window.open(`/lab/report?${t.toString()}`,"_blank","noopener,noreferrer"),r(!1)})(e.value),className:"flex items-center gap-3 rounded-lg border border-secondary-200 p-3 text-left transition hover:border-primary-400 hover:bg-primary-50 dark:border-secondary-700 dark:hover:border-primary-500 dark:hover:bg-primary-500/10",children:[(0,t.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-primary-50 text-primary-600 dark:bg-primary-500/10 dark:text-primary-300",children:e.icon}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block text-sm font-semibold text-secondary-900 dark:text-secondary-100",children:e.label}),(0,t.jsx)("span",{className:"block text-xs text-secondary-500",children:e.desc})]})]},e.value))})]})})}function eD(){let[e]=(0,s.useQueryState)("cat",s.parseAsString.withDefault("")),[a]=(0,s.useQueryState)("ptype",(0,s.parseAsArrayOf)(s.parseAsString).withDefault([])),[n,l]=(0,r.useState)(!1),{entitlements:i}=(0,T.useEntitlements)(),{promptLogin:o}=(0,P.useLoginPrompt)(),d=0===i.labReportPerMonth,{data:c}=(0,ej.useSession)();return c?.user?.role!=="super_admin"?(0,t.jsx)(t.Fragment,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ew.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>{d?o("lab"):l(!0)},className:"hidden border-transparent bg-secondary-900 font-semibold text-white hover:bg-secondary-800 hover:text-white sm:inline-flex dar
1k:bg-secondary-100 dark:text-secondary-900 dark:hover:bg-secondary-200 dark:hover:text-secondary-900",children:[(0,t.jsx)(ek.FileText,{}),"Lab실 보고서"]}),(0,t.jsx)(eP,{open:n,onOpenChange:l,category:e,ptype:a.join(",")})]})}let eO=["off","on"];e.s(["HomeBody",0,function({headerCopy:e,risingAllowed:l=!1}){let[i,o]=(0,r.useState)(!1),[d,c]=(0,s.useQueryState)("q",s.parseAsString.withDefault("")),u=!i,[h,m,x]=(0,n.useRememberedChoice)("tubelab.saas.home.rising-strip.v1",eO,"off"),p=l&&x&&"on"===h;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("header",{className:"mb-2 flex flex-wrap items-start justify-between gap-3",children:[e,(0,t.jsx)(eD,{})]}),(0,t.jsxs)("div",{className:"flex items-start gap-6",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(C,{hideSearchOnXl:u,trailingFilter:(0,t.jsx)(eh,{allowed:l,checked:p,onCheckedChange:e=>m(e?"on":"off"),className:"w-full md:w-auto"})}),p&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(el,{})}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)(ef,{})})]}),u&&(0,t.jsx)("aside",{className:"hidden w-80 shrink-0 self-stretch xl:block",children:(0,t.jsxs)("div",{className:"sticky top-[calc(var(--header-h)+4rem)] mt-2 space-y-4",children:[(0,t.jsx)(a.PageSearchBox,{variant:"outline",value:d,onChange:e=>void c(e.trim()||null),placeholder:"영상 제목 검색"}),(0,t.jsx)(Q,{onClose:()=>o(!0)})]})})]})]})}],317449)}]);

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.