PageSourceSearch

https://tubelab.kr/_next/static/chunks/2slyysmrlu8dm.js

js tubelab.kr collected 2026-09-24 15:05:44 UTC 92,654 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,516015,(e,t,a)=>{},898547,(e,t,a)=>{var n=e.i(247167);e.r(516015);var s=e.r(271645),r=s&&"object"==typeof s&&"default"in s?s:{default:s},i=void 0!==n.default&&n.default.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,a=t.name,n=void 0===a?"stylesheet":a,s=t.optimizeForSpeed,r=void 0===s?i:s;c(l(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof r,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=r,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,a=e.prototype;return a.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},a.isOptimizeForSpeed=function(){return this._optimizeForSpeed},a.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,a){return"number"==typeof a?e._serverSheet.cssRules[a]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),a},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},a.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},a.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},a.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var a=this.getSheet();"number"!=typeof t&&(t=a.cssRules.length);try{a.insertRule(e,t)}catch(t){return i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var n=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,n))}return this._rulesCount++},a.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var a="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!a.cssRules[e])return e;a.deleteRule(e);try{a.insertRule(t,e)}catch(n){i||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),a.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];c(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},a.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},a.flush=function(){this._injected=!1,this._rulesCount=0,"u">
1typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},a.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,a){return a?t=t.concat(Array.prototype.map.call(e.getSheetForTag(a).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},a.makeStyleTag=function(e,t,a){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var n=document.createElement("style");this._nonce&&n.setAttribute("nonce",this._nonce),n.type="text/css",n.setAttribute("data-"+e,""),t&&n.appendChild(document.createTextNode(t));var s=document.head||document.getElementsByTagName("head")[0];return a?s.insertBefore(n,a):s.appendChild(n),n},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,a=e.length;a;)t=33*t^e.charCodeAt(--a);return t>>>0},u={};function h(e,t){if(!t)return"jsx-"+e;var a=String(t),n=e+a;return u[n]||(u[n]="jsx-"+d(e+"-"+a)),u[n]}function p(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var a=e+t;return u[a]||(u[a]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[a]}var m=function(){function e(e){var t=void 0===e?{}:e,a=t.styleSheet,n=void 0===a?null:a,s=t.optimizeForSpeed,r=void 0!==s&&s;this._sheet=n||new o({name:"styled-jsx",optimizeForSpeed:r}),this._sheet.inject(),n&&"boolean"==typeof r&&(this._sheet.setOptimizeForSpeed(r),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var a=this.getIdAndRules(e),n=a.styleId,s=a.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var r=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=r,this._instancesCounts[n]=1},t.remove=function(e){var t=this,a=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(a in this._instancesCounts,"styleId: `"+a+"` not found"),this._instancesCounts[a]-=1,this._instancesCounts[a]<1){var n=this._fromServer&&this._fromServer[a];n?(n.parentNode.removeChild(n),delete this._fromServer[a]):(this._indices[a].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[a]),delete this._instancesCounts[a]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],a=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return a[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,a;return t=this.cssRules(),void 0===(a=e)&&(a={}),t.map(function(e){var t=e[0],n=e[1];return r.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:a.nonce?a.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,a=e.dynamic,n=e.id;if(a){var s=h(n,a);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return p(s,e)}):[p(s,t)]}}return{styleId:h(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),x=s.createContext(null);function g(){return new m}function y(){return s.useContext(x)}x.displayName="StyleSheetContext";var v=r.default.useInsertionEffect||r.default.useLayoutEffect,b="u">typeof window?g():void 0;function f(e){var t=b||y();return t&&("u"<typeof window?t.add(e):v(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}f.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},a.StyleRegistry=function(e){var t=e.registry,a=e.children,n=s.useContext(x),i=s.useState(function(){return n||t||g()})[0];return r.default.createElement(x.Provider,{value:i},a)},a.createStyleRegistry=g,a.style=f,a.useStyleRegistry=y},437902,(e,t,a)=>{t.exports=e.r(898547).style},21427,e=>{"use strict";var t=e.i(843476),a=e.i(271645),n=e.i(526732),s=e.i(621482),r=e.i(266027),i=e.i(912598),l=e.i(110050),o=e.i(240679),c=e.i(224003),d=e.i(514430),u=e.i(129768),h=e.i(806537),p=e.i(741120),m=e.i(142771),x=e.i(438847),g=e.i(846696),y=e.i(132893),v=e.i(827625),b=e.i(112092),f=e.i(519455);function j({active:e,onClick:a}){return(0,t.jsxs)(f.Button,{type:"button",variant:"outline",size:"xs",onClick:a,"aria-pressed":e,children:[(0,t.jsx)(b.SlidersHorizontal,{}),"필터"]})}var C=e.i(967489),w=e.i(699375),N=e.i(522016),k=e.i(259502),S=e.i(786563),M=e.i(799676),D=e.i(487486),R=e.i(839885),F=e.i(53282),_=e.i(716327),I=e.i(476421),T=e.i(437902),A=e.i(591292),$=e.i(736146);
1function P({v:e,rank:a,width:n,channelTitle:s,channelThumbnail:r,enablePreview:i=!0,onPlay:l}){return(0,t.jsx)(A.VideoCard,{videoId:e.videoId,title:e.title,channelTitle:s,channelThumbnail:r,viewCount:e.viewCount,publishedAt:e.publishedAt,durationSeconds:e.durationSeconds,aspect:"shorts",enablePreview:i,href:`https://www.youtube.com/watch?v=${e.videoId}`,external:!0,onClick:l?e=>{e.metaKey||e.ctrlKey||1===e.button||(e.preventDefault(),l())}:void 0,channelHref:`https://www.youtube.com/watch?v=${e.videoId}`,channelExternal:!0,style:{width:n},className:"dashboard-video-card shrink-0 rounded-md border-0 bg-secondary-100 dark:bg-secondary-800",thumbWrapClassName:"rounded-md",topLeft:(0,t.jsx)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-black/70 text-white text-3xs font-bold tabular-nums",children:a})})}function O({videos:e,channelTitle:a,channelThumbnail:n,channel:s}){let r=(0,$.useOpenShorts)(),i=e.length>=3,l=i?[...e.map((e,t)=>({v:e,rank:t+1})),...e.map((e,t)=>({v:e,rank:t+1}))]:e.map((e,t)=>({v:e,rank:t+1})),o=i?.8*e.length:0;return(0,t.jsxs)("div",{style:{width:340,maxWidth:"100%"},className:"jsx-7908966de95ffecd overflow-hidden mx-auto",children:[(0,t.jsx)("div",{style:{gap:8,animationDuration:`${o}s`},className:"jsx-7908966de95ffecd flex dashboard-mobile-video-strip",children:l.map((i,l)=>(0,t.jsx)(P,{v:i.v,rank:i.rank,width:108,channelTitle:a,channelThumbn
1ail:n,enablePreview:!1,onPlay:s?()=>{var t;return t=i.v.videoId,void(!s||r(t,e.map(e=>({videoId:e.videoId,title:e.title,channelId:s.channelId,channelTitle:s.channelTitle,channelThumbnailUrl:s.thumbnailUrl,channelGrade:s.grade,subscriberCount:s.subscriberCount,viewCount:e.viewCount,publishedAt:e.publishedAt})),"today_channel"))}:void 0},`${i.v.videoId}-${l}`))}),(0,t.jsx)(T.default,{id:"7908966de95ffecd",children:".dashboard-mobile-video-strip.jsx-7908966de95ffecd{will-change:transform;animation-name:dashboard-mobile-strip-scroll;animation-timing-function:linear;animation-iteration-count:infinite;animation-play-state:running}.dashboard-mobile-video-strip:has(.dashboard-video-card:hover){animation-play-state:paused}@keyframes dashboard-mobile-strip-scroll{0%{transform:translate(0)}to{transform:translate(-50%)}}@media (prefers-reduced-motion:reduce){.dashboard-mobile-video-strip.jsx-7908966de95ffecd{animation:none}}"})]})}var z=e.i(448982);function L({data:e,width:a=76,height:n=28,strokeWidth:s=1.75,className:r,endDot:i=!1}){if(!e||e.length<2)return null;let l=Math.min(...e),o=Math.max(...e)-l||1,c=s+1.5,d=n-2*c,u=(a-2*c)/(e.length-1),h=e.map((e,t)=>[c+t*u,c+d-(e-l)/o*d]);return(0,t.jsxs)("svg",{width:a,height:n,viewBox:`0 0 ${a} ${n}`,fill:"none",className:r,"aria-hidden":!0,preserveAspectRatio:"none",children:[(0,t.jsx)("path",{d:function(e){if(e.length<2)return"";let t=`M ${e[0][0]} ${e[0][1]}`;for(let a=0;a<e.length-1;a++){let n=e[a-1]??e[a],s=e[a],r=e[a+1],i=e[a+2]??r,l=s[0]+(r[0]-n[0])/6,o=s[1]+(r[1]-n[1])/6,c=r[0]-(i[0]-s[0])/6,d=r[1]-(i[1]-s[1])/6;t+=` C ${l} ${o}, ${c} ${d}, ${r[0]} ${r[1]}`}return t}(h),stroke:"currentColor",strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),i&&(0,t.jsx)("circle",{cx:h[h.length-1][0],cy:h[h.length-1][1],r:s+1,fill:"currentColor"})]})}var U=e.i(885422);function E({channel:e,periodLabel:n,isAdmin:s=0,onUpdateProductionType:r,onSelectChannel:i,showFavoriteAction:l=!0}){let o=U.PRODUCTION_TYPE_EDIT_ENABLED&&s>=2&&!!r,c=n?`/${n}`:"",d=(0,z.getShoppingBadge)(e.shopping),[u,h]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"relative bg-background rounded-lg border border-secondary-200 dark:border-secondary-700 hover:bg-primary-50/50 dark:hover:bg-primary-500/5 hover:shadow-sm transition-all",children:[(0,t.jsxs)(N.default,{href:`/channel/${e.channelId}`,onClick:t=>{!i||t.metaKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),i(e.channelId))},className:"flex items-start gap-3 p-3 pr-12",children:[(0,t.jsx)(M.Avatar,{src:e.thumbnailUrl??void 0,name:e.channelTitle,size:"md"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 flex-wrap",children:[(0,t.jsx)("span",{className:"font-semibold text-secondary-900 dark:text-secondary-100 truncate text-sm",children:e.channelTitle}),e.grade&&(0,t.jsx)(I.GradeBadge,{grade:e.grade,size:"sm"}),e.primaryCategory&&(0,t.jsx)("span",{className:`px-2 py-0.5 text-3xs font-medium rounded-full whitespace-nowrap ${(0,z.getCategoryColorClasses)(e.primaryCategory)}`,children:e.primaryCategory}),d&&(0,t.jsx)("span",{title:d.title,className:`px-2 py-0.5 text-3xs font-medium rounded-full whitespace-nowrap ${d.className}`,children:d.label}),o&&r&&(0,t.jsx)(U.ProductionTypeEditBadge,{channelId:e.channelId,current:e.productionType??null,onSelect:r})]}),(0,t.jsxs)("div",{className:"flex items-center flex-wrap gap-x-1.5 gap-y-0.5 text-xs tabular-nums",children:[(0,t.jsxs)("span",{className:`font-medium ${(0,R.getTrendClass)(e.dailyViewsIncrement)}`,children:["조회수 ",(0,z.formatIncrement)(e.dailyViewsIncrement)]}),"주간"!==n&&"월간"!==n&&e.viewCorrectionPending&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-secondary-300 dark:text-secondary-600",children:"·"}),(0,t.jsx)(D.Badge,{variant:"info",size:"sm",title:"여러 날의 조회수가 한꺼번에 반영됐을 수 있어 하루 실적으로 비교하지 마세요. 보정 여부를 확인하고 있습니다.",children:"지연 반영 확인 중"})]}),(0,t.jsx)("span",{className:"text-secondary-300 dark:text-secondary-600",children:"·"}),(0,t.jsxs)("span",{className:(0,R.getTrendClass)(e.dailySubsIncrement),children:["구독자 ",(0,z.formatIncrement)(e.dailySubsIncrement)]}),e.estimatedRevenue?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-secondary-300 dark:text-secondary-600",children:"·"}),(0,t.jsxs)("span",{className:"text-secondary-600 dark:text-secondary-300",children:[(0,z.formatRevenue)(e.estimatedRevenue),c]})]}):null,e.viewHistory&&e.viewHistory.length>=2&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-secondary-300 dark:text-secondary-600",children:"·"}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-secondary-500 dark:text-secondary-400",children:["일일",(0,t.jsx)(L,{data:e.viewHistory,width:40,height:14,strokeWidth:1.5,className:z.TREND_COLOR_CLASS[(0,z.getTrendDirection)(e.viewHistory)]})]})]})]})]})]}),l&&(0,t.jsx)("div",{className:"absolute right-1 top-1 z-10",children:(0,t.jsx)(F.ChannelSaveMenu,{channelId:e.channelId,isFavorite:!!e.isFavorite,source:"board",children:(0,t.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation()},className:`rounded-full p-2 transition-colors hover:bg-accent-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500 dark:hover:bg-accent-500/10 ${e.isFavorite?"text-accent-400 hover:text-accent-500":"text-secondary-400 hover:text-accent-400"}`,"aria-label":`${e.channelTitle} ${e.isFavorite?"저장 해제":"채널 저장"}`,children:(0,t.jsx)(S.Star,{size:18,fill:e.isFavorite?"currentColor":"none"})})})}),e.topVideos&&e.topVideos.length>0&&(0,t.jsxs)("div",{className:"border-t border-secondary-100 dark:border-secondary-800 px-3 pb-2.5 pt-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>h(e=>!e),"aria-expanded":u,className:"w-full flex items-center justify-between gap-2 py-1 text-xs font-semibold text-secondary-600 dark:text-secondary-400 hover:text-primary-500 transition-colors",children:[(0,t.jsxs)("span",{children:["인기 영상 (30일) · ",e.topVideos.length,"개"]}),(0,t.jsx)(_.ChevronDown,{size:14,className:`transition-transform duration-200 ${u?"rotate-180":""}`})]}),u&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(O,{videos:e.topVideos,channelTitle:e.channelTitle,channelThumbn
1ail:e.thumbnailUrl??null,channel:{channelId:e.channelId,channelTitle:e.channelTitle,thumbnailUrl:e.thumbnailUrl,grade:e.grade,subscriberCount:e.subscriberCount}})})]})]})}var V=e.i(24071),B=e.i(867927),H=e.i(745817);let G=1120/9;function K({videos:e,visibleCount:n=5,channel:s}){let r=Math.max(1,n),i=(0,$.useOpenShorts)(),l=(0,a.useCallback)(t=>{s&&i(t,e.map(e=>({videoId:e.videoId,title:e.title,channelId:s.channelId,channelTitle:s.channelTitle,channelThumbnailUrl:s.thumbnailUrl,channelGrade:s.grade,subscriberCount:s.subscriberCount,viewCount:e.viewCount,publishedAt:e.publishedAt})),"today_channel")},[s,e,i]),o=(0,a.useRef)(null),c=(0,a.useRef)(!1),d=(0,a.useRef)(!1),u=e.length>r,[h,p]=(0,a.useState)(!1),m=h?u?[...e,...e]:e:e.slice(0,r),x=82*e.length;(0,a.useEffect)(()=>{let e=o.current;if(!e||!u)return;let t=e.closest(".channel-table-row")??e,a=()=>{c.current=!0,p(!0)},n=()=>{c.current=!1};return t.addEventListener("mouseenter",a),t.addEventListener("mouseleave",n),()=>{t.removeEventListener("mouseenter",a),t.removeEventListener("mouseleave",n)}},[u]),(0,a.useEffect)(()=>{if(!u)return;let e=0,t=0,a=n=>{if(t){let e=o.current;if(e&&c.current&&!d.current){let a=(n-t)/1e3,s=e.scrollLeft+26*a;s>=x&&(s-=x),e.scrollLeft=s}}t=n,e=requestAnimationFrame(a)};return e=requestAnimationFrame(a),()=>cancelAnimationFrame(e)},[u,x]);let g=(0,a.useCallback)(e=>{let t=o.current;if(!t)return;-1===e&&t.scrollLeft<82&&(t.scrollLeft+=x);let a=(Math.round(t.scrollLeft/82)+e)*82;t.scrollTo({left:a,behavior:"smooth"})},[x]);return 0===e.length?(0,t.jsx)("div",{className:"flex items-center justify-center",style:{minHeight:G},children:(0,t.jsx)("div",{className:"flex items-center justify-center text-xs text-secondary-300 dark:text-secondary-600",style:{width:70,height:G},children:"-"})}):(0,t.jsx)("div",{className:"flex items-center justify-center",style:{minHeight:G},children:(0,t.jsxs)("div",{className:"group/pop relative mx-auto",style:{width:70*r+(r-1)*12,maxWidth:"100%"},children:[u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),g(-1)},onMouseEnter:()=>{d.current=!0},onMouseLeave:()=>{d.current=!1},"aria-label":"이전 영상",className:"absolute left-0 top-1/2 z-20 grid h-7 w-7 -translate-y-1/2 place-items-center rounded-full bg-white text-secondary-700 opacity-0 shadow-md ring-1 ring-black/10 transition hover:bg-secondary-50 group-hover/pop:opacity-100 dark:bg-secondary-800 dark:text-secondary-200 dark:ring-white/10 dark:hover:bg-secondary-700",children:(0,t.jsx)(V.ChevronLeft,{size:16})}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),g(1)},onMouseEnter:()=>{d.current=!0},onMouseLeave:()=>{d.current=!1},"aria-label":"다음 영상",className:"absolute right-0 top-1/2 z-20 grid h-7 w-7 -translate-y-1/2 place-items-center rounded-full bg-white text-secondary-700 opacity-0 shadow-md ring-1 ring-black/10 transition hover:bg-secondary-50 group-hover/pop:opacity-100 dark:bg-secondary-800 dark:text-secondary-200 dark:ring-white/10 dark:hover:bg-secondary-700",children:(0,t.jsx)(B.ChevronRight,{size:16})})]}),(0,t.jsx)("div",{ref:o,className:"flex overflow-x-auto scrollbar-hide",style:{gap:12},children:m.map((a,n)=>{let r=n%e.length;return(0,t.jsx)("div",{className:"shrink-0",style:{width:70},onMouseEnter:()=>{d.current=!0},onMouseLeave:()=>{d.current=!1},children:(0,t.jsx)(H.ChannelVideoCard,{video:a,rank:r+1,width:70,onPlay:s?()=>l(a.videoId):void 0})},`${a.videoId}-${n}`)})})]})})}var J=e.i(944310),Q=e.i(635416),q=e.i(96892),W=e.i(563707);function Y({label:e,titleText:a,keyName:n,currentSort:s,currentOrder:r,onSortChange:i,align:l="left"}){let o=s===n,c="right"===l?"justify-end":"center"===l?"justify-center":"justify-start",d=a??("string"==typeof e?e:"");return i?(0,t.jsxs)("button",{type:"button",onClick:()=>i(n),className:`group inline-flex items-center gap-1 hover:text-secondary-800 dark:hover:text-secondary-200 transition-colors ${c} ${o?"text-secondary-800 dark:text-secondary-200":""}`,title:`${d} 정렬`,children:[(0,t.jsx)("span",{children:e}),o?"asc"===r?(0,t.jsx)(q.ArrowUp,{size:14,className:"shrink-0 text-primary-500"}):(0,t.jsx)(Q.ArrowDown,{size:14,className:"shrink-0 text-primary-500"}):(0,t.jsx)(W.ChevronsUpDown,{size:14,className:"shrink-0 text-secondary-300 dark:text-secondary-600 opacity-60 group-hover:opacity-100 transition-opacity"})]}):(0,t.jsx)("span",{className:`flex items-center gap-1 ${c}`,children:e})}var X=e.i(776639),Z=e.i(456616);let ee=[{value:"S",label:"S"},{value:"A",label:"A"},{value:"B",label:"B"}],et=[{value:"same",label:"동일 타겟"},{value:"all",label:"확장 타겟"}];function ea({channelId:e,channelTitle:n,open:s,onOpenChange:r}){let[i,l]=(0,a.useState)("S"),[o,c]=(0,a.useState)("same"),{data:d,isLoading:u,isError:h,hasNextPage:p,isFetchingNextPage:m,fetchNextPage:x}=(0,Z.useSimilarChannels)(e??"",i,o,s&&null!==e),g=(0,Z.flattenSimilarChannels)(d?.pages),y=(0,a.useRef)(null),v=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=v.current;if(!e||!p)return;let t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&!m&&x()},{root:y.current??null,rootMargin:"80px"});return t.observe(e),()=>t.disconnect()},[p,m,x,g.length]),(0,t.jsx)(X.Dialog,{open:s,onOpenChange:r,children:(0,t.jsxs)(X.DialogContent,{size:"md",className:"flex max-h-[80dvh] flex-col gap-0 p-0",children:[(0,t.jsx)(X.DialogHeader,{className:"border-b border-secondary-200 px-5 py-4 dark:border-secondary-700",children:(0,t.jsxs)(X.DialogTitle,{className:"text-base",children:["유사 채널",n&&
1(0,t.jsxs)("span",{className:"ml-1.5 text-sm font-normal text-secondary-500 dark:text-secondary-400",children:["· ",n]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 px-5 py-3",children:[(0,t.jsx)(C.Select,{options:ee,value:i,onChange:l,size:"sm",className:"w-16"}),(0,t.jsx)(C.Select,{options:et,value:o,onChange:e=>c("all"===e?"all":"same"),size:"sm",className:"w-28"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary-200 px-5 py-2 text-2xs text-secondary-400 dark:border-secondary-700",children:[(0,t.jsx)("span",{children:"채널"}),(0,t.jsxs)("div",{className:"flex gap-6",children:[(0,t.jsx)("span",{className:"w-14 text-right",children:"구독자 수"}),(0,t.jsx)("span",{className:"w-14 text-right",children:"평균 조회수"})]})]}),u&&(0,t.jsx)("ul",{"aria-hidden":"true",className:"px-3",children:Array.from({length:6}).map((e,a)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 border-b border-secondary-100 px-2 py-2.5 last:border-0 dark:border-secondary-800",children:[(0,t.jsx)("span",{className:"h-8 w-8 shrink-0 animate-pulse rounded-full bg-secondary-100 dark:bg-secondary-800"}),(0,t.jsx)("span",{className:"h-3 flex-1 animate-pulse rounded bg-secondary-100 dark:bg-secondary-800"})]},a))}),!u&&0===g.length&&(0,t.jsxs)("div",{className:"py-10 text-center",children:[(0,t.jsx)("p",{className:"text-sm text-secondary-500 dark:text-secondary-400",children:h?"유사 채널을 불러올 수 없어요.":`${i}등급 유사 채널이 없어요.`}),!h&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-secondary-400",children:"다른 등급을 선택해보세요."})]}),!u&&g.length>0&&(0,t.jsxs)("div",{ref:y,className:"scrollbar-thin min-h-0 flex-1 overflow-y-auto px-3 pb-2",children:[(0,t.jsx)("ul",{children:g.map(e=>(0,t.jsx)("li",{className:"border-b border-secondary-100 last:border-0 dark:border-secondary-800",children:(0,t.jsxs)(N.default,{href:`/channel/${e.channelId}`,prefetch:!1,onClick:()=>r(!1),className:"flex w-full items-center justify-between gap-2 rounded-lg px-2 py-2.5 text-left transition-colors hover:bg-secondary-50 dark:hover:bg-secondary-800/40",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(M.Avatar,{src:e.thumbnailUrl??void 0,name:e.channelTitle??"",size:"sm"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-secondary-900 dark:text-secondary-100",children:e.channelTitle}),e.grade&&(0,t.jsx)(I.GradeBadge,{grade:e.grade,size:"sm"})]}),e.primaryCategory&&(0,t.jsx)("p",{className:"truncate text-3xs text-secondary-400",children:e.primaryCategory})]})]}),(0,t.jsxs)("div",{className:"num flex gap-6 text-xs text-secondary-600 dark:text-secondary-300",children:[(0,t.jsx)("span",{className:"w-14 text-right",children:null!==e.subscriberCount?(0,z.formatNumberRound)(e.subscriberCount):"-"}),(0,t.jsx)("span",{className:"w-14 text-right",children:null!==e.avgViews?(0,z.formatNumberRound)(e.avgViews):"-"})]})]})},e.channelId))}),(0,t.jsx)("div",{ref:v,"aria-hidden":"true"}),m&&(0,t.jsx)("div",{className:"py-3 text-center text-xs text-secondary-400",children:"불러오는 중…"})]})]})})}var en=e.i(217363),es=e.i(285852);function er(e,t,a){!a||e.metaKey||e.ctrlKey||e.shiftKey||1===e.button||(e.preventDefault(),a(t))}function ei({channels:e,showFavoriteAction:n=!0,periodLabel:s,sortKey:r,sortOrder:i,onSortChange:l,isAdmin:o=0,onUpdateProductionType:c,visibleColumns:d,onSelectChannel:u}){let h=U.PRODUCTION_TYPE_EDIT_ENABLED&&o>=2&&!!c,[p,m]=(0,a.useState)(null),x=p?e.find(e=>e.channelId===p):null,g=e=>r!==e?"none":"asc"===i?"ascending":"descending";if(0===e.length)return(0,t.jsx)("div",{className:"text-center py-12",children:(0,t.jsx)("p",{className:"text-secondary-500",children:"채널이 없습니다."})});let y=e.some(e=>void 0!==e.trendingVideoCount),v=[];n&&v.push({id:"favorite",header:"담기",headerClassName:"py-2.5 w-12 text-center",cellClassName:"py-2 text-center",cell:(e,a)=>(0,t.jsxs)("div",{className:"group/fav relative inline-flex",children:[(0,t.jsx)(F.ChannelSaveMenu,{channelId:e.channelId,isFavorite:!!e.isFavorite,channelName:e.channelTitle,source:"board",children:(0,t.jsx)("button",{type:"button",onClick:e=>e.stopPropagation(),style:{"--star-delay":`${a%7*.4}s`},className:`rounded-full p-1.5 transition-colors hover:bg-accent-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500 dark:hover:bg-accent-500/10 ${e.isFavorite?"text-accent-400 hover:text-accent-500":"star-shimmer text-secondary-400 hover:text-accent-400"}`,"aria-label":`${e.channelTitle} ${e.isFavorite?"저장 해제":"내 소재함에 저장"}`,children:(0,t.jsx)(S.Star,{size:18,fill:e.isFavorite?"currentColor":"none"})})}),(0,t.jsx)("span",{className:"pointer-events-none absolute left-0 top-full z-20 mt-1 whitespace-nowrap rounded bg-secondary-900 px-1.5 py-0.5 text-3xs font-medium text-white opacity-0 transition-opacity duration-150 group-hover/fav:opacity-100 dark:bg-secondary-700",children:e.isFavorite?"저장 해제":"내 소재함에 저장"})]})}),v.push({id:"rank",ariaSort:l?g("dailyViews"):void 0,header:"순위",headerClassName:"py-2.5 pl-2 w-16 text-center",cellClassName:"py-2 text-center tabular-nums font-medium",cell:(e,a)=>(0,t.jsx)(es.RankCell,{rank:e.rank??a+1})}),v.push({id:"info",header:"채널 정보",headerClassName:"py-2.5 text-center w-60",cellClassName:"py-2 w-60",cell:e=>(0,t.jsxs)("div",{className:"flex items-center justify-start gap-2.5 min-w-0",children:[(0,t.jsx)(M.Avatar,{src:e.thumbnailUrl??void 0,name:e.channelTitle,size:"md"}),(0,t.jsxs)("div",{className:"min-w-0 flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 min-w-0 flex-nowrap",children:[(0,t.jsx)(J.ChannelGradeMark,{grade:e.grade,size:"sm"}),(0,t.jsx)(N.default,{href:`/channel/${e.channelId}`,prefetch:!1,onClick:t=>er(t,e.channelId,u),className:"min-w-0 text-sm font-bold text-secondary-900 dark:text-secondary-100 truncate",children:e.channelTitle})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsxs)("span",{className:"shrink-0 text-xs text-secondary-500 dark:text-secondary-400 tabular-nums whitespace-nowrap",children:["구독자 ",(0,z.formatNumber)(e.subscriberCount)]}),(0,t.jsx)(J.ChannelTypeChips,{primaryCategory:e.primaryCategory,productionType:h?null:e.productionType??null,shopping:e.shopping??null,size:"sm",onProductionTypeClick:()=>m(e.channelId)}),h&&c&&(0,t.jsx)(U.ProductionTypeEditBadge,{channelId:e.channelId,current:e.productionType??null,onSelect:c}
1)]})]})]})}),v.push({id:"dailyViews",toggleable:!0,header:"주간"===s?"주간 조회수":"월간"===s?"월간 조회수":"오늘 조회수",headerClassName:"py-2.5 text-center w-44",cellClassName:"relative py-2 px-2 text-center tabular-nums",cell:e=>{let a="주간"!==s&&"월간"!==s,n=a?(0,z.getDayOverDayPct)(e.viewHistory):(0,z.getPeriodOverPeriodPct)(e.dailyViewsIncrement,e.viewsIncrementPrev);return(0,t.jsxs)("div",{className:"inline-flex flex-col items-stretch gap-3.5 px-4 py-4",children:[(0,t.jsxs)("div",{className:"whitespace-nowrap text-center text-xl font-extrabold leading-none text-secondary-900 dark:text-secondary-100",children:[e.dailyViewsIncrement<0&&"-",(0,z.formatNumberRound)(Math.abs(e.dailyViewsIncrement))]}),a&&e.viewCorrectionPending&&(0,t.jsx)(D.Badge,{variant:"info",size:"sm",title:"여러 날의 조회수가 한꺼번에 반영됐을 수 있어 하루 실적으로 비교하지 마세요. 보정 여부를 확인하고 있습니다.",className:"self-center whitespace-nowrap",children:"지연 반영 확인 중"}),null!==n&&(0,t.jsx)("div",{className:"flex items-center justify-center gap-1 whitespace-nowrap",children:(0,t.jsx)(R.TrendDelta,{value:n,label:`${Math.abs(n).toFixed(1)}%`,sign:"plusminus",className:"font-extrabold"})})]})}}),v.push({id:"avgDailyUploads",toggleable:!0,ariaSort:g("avgDailyUploads"),header:(0,t.jsx)(Y,{label:"업로드 빈도",keyName:"avgDailyUploads",currentSort:r,currentOrder:i,align:"center"}),headerClassName:"py-2.5 text-center w-32",cellClassName:"relative py-2 px-2 text-center",cell:e=>(0,t.jsx)("div",{className:"flex items-center justify-center gap-1.5",children:null!==e.avgDailyUploads?(0,t.jsxs)("span",{className:"tabular-nums",children:[(0,t.jsxs)("span",{className:"text-lg font-bold leading-tight text-secondary-900 dark:text-secondary-100",children:[e.avgDailyUploads.toFixed(1),"개"]}),(0,t.jsx)("span",{className:"ml-0.5 text-3xs font-normal text-secondary-400 dark:text-secondary-500",children:"/일"})]}):(0,t.jsx)("span",{className:"text-sm text-secondary-300 dark:text-secondary-600",children:"-"})})}),v.push({id:"estimatedRevenue",toggleable:!0,ariaSort:g("estimatedRevenue"),header:(0,t.jsx)(Y,{label:"예상 수익",keyName:"estimatedRevenue",currentSort:r,currentOrder:i,align:"center"}),headerClassName:"py-2.5 text-center w-36",cellClassName:"relative py-2 px-2 text-center tabular-nums",cell:e=>null!==e.estimatedRevenue&&e.estimatedRevenue>0?(0,t.jsx)("div",{className:"flex flex-col items-center gap-0.5",children:(0,t.jsx)("div",{className:"text-lg font-bold leading-tight text-secondary-900 dark:text-secondary-100",children:(0,z.formatRevenueShort)(e.estimatedRevenue)})}):(0,t.jsx)("span",{className:"text-sm text-secondary-300 dark:text-secondary-600",children:"-"})}),v.push({id:"avgDailyViews",toggleable:!0,header:(0,t.jsx)("span",{title:"최근 30일 일별 조회수 추이",children:"30일 조회수"}),headerClassName:"py-2.5 text-center w-36",cellClassName:"relative py-2 px-2 text-center",cell:e=>{let a=e.viewHistory,n=z.TREND_COLOR_CLASS[(0,z.getTrendDirection)(a)];return a&&a.length>=2?(0,t.jsxs)("div",{className:`flex flex-col items-center gap-0.5 ${n}`,children:[(0,t.jsx)(L,{data:a,endDot:!0}),(0,t.jsx)("span",{className:"text-xs tabular-nums leading-tight text-secondary-400 dark:text-secondary-500",children:(0,z.formatNumber)(a[a.length-1])})]}):(0,t.jsx)("span",{className:"text-sm text-secondary-300 dark:text-secondary-600",children:"-"})}}),y&&v.push({id:"trendingVideoCount",toggleable:!0,header:(0,t.jsx)("span",{title:"그날 급상승(뜨는) 영상 수",children:"뜨는영상"}),headerClassName:"py-2.5 text-center w-24",cellClassName:"relative py-2 text-center tabular-nums",cell:e=>e.trendingVideoCount?(0,t.jsxs)("span",{className:"inline-flex items-center justify-center gap-1 text-lg font-bold leading-tight text-danger-500",children:[(0,t.jsx)(k.Flame,{size:16}),e.trendingVideoCount,"개"]}):(0,t.jsx)("span",{className:"text-sm text-secondary-300 dark:text-secondary-600",children:"-"})}),v.push({id:"topVideos",toggleable:!0,stopRowClick:!0,header:"인기 영상",headerClassName:"py-2.5 px-3 text-center",cellClassName:"relative py-2 px-3",cell:e=>(0,t.jsx)(K,{videos:e.topVideos??[],visibleCount:y?5:6,channel:{channelId:e.channelId,channelTitle:e.channelTitle,thumbnailUrl:e.thumbnailUrl,grade:e.grade,subscriberCount:e.subscriberCount}})});let b=e=>!d||d.has(e),f=48*!!n+64+240+176*!!b("dailyViews")+128*!!b("avgDailyUploads")+144*!!b("estimatedRevenue")+144*!!b("avgDailyViews")+(y&&b("trendingVideoCount")?96:0)+(b("topVideos")?y?410:500:0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ea,{channelId:p,channelTitle:x?.channelTitle,open:null!==p,onOpenChange:e=>{e||m(null)}}),(0,t.jsx)("div",{className:"hidden md:block",children:(0,t.jsx)(en.ChannelDataTable,{rows:e,columns:v,getRowKey:e=>e.channelId,visibleColumns:d,tableClassName:"w-full text-sm table-fixed",minWidth:f,wrapperClassName:"bg-white dark:bg-secondary-900/40 border border-secondary-200 dark:border-secondary-800 rounded-none overflow-hidden",headRowClassName:"text-left text-xs font-semibold text-secondary-500 dark:text-secondary-400 border-b border-secondary-200 dark:border-secondary-800 bg-secondary-50/60 dark:bg-secondary-900/30",onRowClick:u?(e,t)=>er(t,e.channelId,u):void 0,rowClassName:()=>`channel-table-row border-b border-secondary-100 dark:border-secondary-800 last:border-0 hover:bg-[#f7f8fc] dark:hover:bg-primary-500/10 transition-colors duration-150 ${u?"curs
1or-pointer":""}`})}),(0,t.jsx)("div",{className:"md:hidden space-y-3",children:e.map(e=>(0,t.jsx)(E,{channel:e,periodLabel:s,isAdmin:o,onUpdateProductionType:c,onSelectChannel:u,showFavoriteAction:n},e.channelId))})]})}var el=e.i(618566);function eo({channel:e,rank:a}){return(0,t.jsxs)("div",{className:"flex items-center border-b border-secondary-100 py-3 last:border-0 dark:border-secondary-800",children:[(0,t.jsx)("div",{className:"hidden w-12 shrink-0 text-center md:block",children:(0,t.jsx)(S.Star,{size:18,className:"mx-auto text-secondary-300 dark:text-secondary-600"})}),(0,t.jsx)("div",{className:"hidden w-16 shrink-0 text-center text-sm font-medium tabular-nums text-secondary-500 md:block",children:a}),(0,t.jsxs)("div",{className:"flex w-60 shrink-0 items-center gap-2.5",children:[(0,t.jsx)(M.Avatar,{src:e.thumbnailUrl??void 0,name:e.channelTitle,size:"md"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)("span",{className:"truncate text-sm font-bold text-secondary-900 dark:text-secondary-100",children:e.channelTitle}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-secondary-500 dark:text-secondary-400",children:["구독자 ",(0,z.formatNumber)(e.subscriberCount)]})]})]}),(0,t.jsx)("div",{className:"w-44 shrink-0 text-center text-xl font-extrabold tabular-nums text-secondary-900 dark:text-secondary-100",children:(0,z.formatNumberRound)(Math.abs(e.dailyViewsIncrement))}),(0,t.jsx)("div",{className:"w-32 shrink-0 text-center text-lg font-bold tabular-nums text-secondary-900 dark:text-secondary-100",children:null!==e.avgDailyUploads?`${e.avgDailyUploads.toFixed(1)}개`:"-"}),(0,t.jsx)("div",{className:"w-36 shrink-0 text-center text-lg font-bold tabular-nums text-secondary-900 dark:text-secondary-100",children:e.estimatedRevenue?(0,z.formatRevenueShort)(e.estimatedRevenue):"-"}),(0,t.jsxs)("div",{className:"flex w-36 shrink-0 flex-col items-center gap-0.5 px-2 text-secondary-400",children:[(0,t.jsx)(L,{data:e.viewHistory??[],endDot:!0}),(0,t.jsx)("span",{className:"text-xs tabular-nums leading-tight text-secondary-400 dark:text-secondary-500",children:(0,z.formatNumber)(e.viewHistory?.[e.viewHistory.length-1]??0)})]}),void 0!==e.trendingVideoCount&&(0,t.jsx)("div",{className:"w-24 shrink-0 text-center text-lg font-bold tabular-nums text-danger-500",children:e.trendingVideoCount||"-"}),(0,t.jsx)("div",{className:"flex shrink-0 gap-1 px-3",children:(e.topVideos??[]).slice(0,5).map(e=>(0,t.jsx)("img",{src:`https://i.ytimg.com/vi/${e.videoId}/hqdefault.jpg`,alt:"",loading:"lazy",decoding:"async",className:"aspect-[9/16] w-16 shrink-0 rounded object-cover"},e.videoId))})]})}function ec({isLoggedIn:e,sampleChannels:a,startRank:n}){let s=(0,el.useRouter)();return(0,t.jsxs)("div",{onClick:()=>s.push("/pricing"),className:"relative mt-2 cursor-pointer overflow-hidden rounded-xl border border-secondary-200 bg-white md:-mt-px md:rounded-none md:border-t-0 dark:border-secondary-800 dark:bg-secondary-900/40",children:[(0,t.jsx)("div",{className:"pointer-events-none select-none blur-sm","aria-hidden":!0,children:Array.from({length:3}).map((e,s)=>{let r=a.length>0?a[a.length-1-2*s%a.length]:null;return r?(0,t.jsx)(eo,{channel:r,rank:n+s},s):null})}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-gradient-to-b from-transparent via-background/80 to-background/95 px-4 text-center",children:[(0,t.jsx)("span",{className:"flex size-11 items-center justify-center rounded-full bg-primary-50 text-primary-500 dark:bg-primary-500/10 dark:text-primary-400",children:(0,t.jsx)(h.Lock,{size:20})}),e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-secondary-900 dark:text-secondary-100",children:"전체 순위는 Pro 플랜에서 ë³¼ 수 있어요"}),(0,t.jsx)("p",{className:"max-w-md text-xs text-secondary-500 dark:text-secondary-400",children:"지금은 상위 40개까지 보여드려요. Pro로 업그레이드하면 전체 순위와 과거 날짜·주간/월간까지 ë³¼ 수 있어요."}),(0,t.jsx)(N.default,{href:"/pricing",onClick:e=>e.stopPropagation(),className:"mt-1 inline-flex items-center rounded-lg bg-primary-500 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-primary-600",children:"Pro로 전체 순위 보기"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-secondary-900 dark:text-secondary-100",children:"놓치면 아쉬운 채널이 계속 이어집니다."}),(0,t.jsx)("p",{className:"max-w-md text-xs text-secondary-500 dark:text-secondary-400",children:"오늘 가장 빠르게 성장한 채ë„
1ì„ 확인해보세요."}),(0,t.jsx)(N.default,{href:"/pricing",onClick:e=>e.stopPropagation(),className:"mt-1 inline-flex items-center rounded-lg bg-primary-500 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-primary-600",children:"전체 순위 보기"})]})]})]})}var ed=e.i(882303),eu=e.i(772382),eh=e.i(438583),ep=e.i(149882),em=e.i(980376),ex=e.i(515740),eg=e.i(271822),ey=e.i(112626);function ev({channel:e,periodLabel:a,open:n,onOpenChange:s}){var r;let i=e?.channelId??null,l=e?{channelId:e.channelId,channelTitle:e.channelTitle??"",thumbnailUrl:e.thumbnailUrl,grade:e.grade,primaryCategory:e.primaryCategory,subscriberCount:e.subscriberCount,viewCount:e.viewCount,videoCount:null,avgViews:null,channelType:e.channelType}:null;return(0,t.jsx)(em.Sheet,{open:n,onOpenChange:s,children:(0,t.jsxs)(em.SheetContent,{side:"right",className:"overflow-hidden",children:[(0,t.jsx)(em.SheetTitle,{className:"sr-only",children:"채널 정보"}),(0,t.jsx)(em.SheetDescription,{className:"sr-only",children:"선택한 채널의 요약 정보와 유사 채널."}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[e&&(0,t.jsxs)("div",{className:"px-6 pt-4 pb-4 border-b",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,t.jsx)(ey.FavoriteChannelButton,{channelId:i,channelName:e.channelTitle}),e.thumbnailUrl?(0,t.jsx)("img",{src:e.thumbnailUrl,alt:e.channelTitle,className:"w-14 h-14 rounded-full object-cover shrink-0 ring-1 ring-secondary-200 dark:ring-secondary-700"}):(0,t.jsx)("span",{className:"w-14 h-14 rounded-full bg-secondary-200 dark:bg-secondary-700 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(J.ChannelGradeMark,{grade:e.grade}),(0,t.jsx)("span",{className:"text-lg font-bold text-secondary-900 dark:text-secondary-100 truncate",children:e.channelTitle})]}),(0,t.jsx)("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:(0,t.jsx)(J.ChannelTypeChips,{channelType:e.channelType,primaryCategory:e.primaryCategory,productionType:e.productionType??null})}),i&&(0,t.jsxs)("a",{href:`/channel/${i}`,className:"inline-flex items-center gap-0.5 mt-1 text-xs font-medium text-secondary-900 dark:text-secondary-100 hover:underline",children:["상세채널보기",(0,t.jsx)(B.ChevronRight,{size:13})]})]})]}),(0,t.jsxs)("div",{className:"mt-4 grid grid-cols-2 sm:grid-cols-5 gap-2",children:[(0,t.jsx)(eb,{icon:ed.Users,label:"구독자",value:(0,z.formatNumberRound)(e.subscriberCount)}),(0,t.jsx)(eb,{icon:eu.Eye,label:"총 조회수",value:(0,z.formatNumberRound)(e.viewCount)}),(0,t.jsx)(eb,{icon:eh.Video,label:"업로드 빈도",value:null===(r=e.avgDailyUploads)||r<=0?"-":`${r.toFixed(1)}개`}),(0,t.jsx)(eb,{icon:ep.Calendar,label:"채널 개설일",value:function(e){if(!e)return"-";let t=new Date(e);return Number.isNaN(t.getTime())?"-":`${t.getFullYear()}년 ${t.getMonth()+1}월`}(e.channelPublishedAt)}),(0,t.jsx)(eb,{iconText:"₩",label:"주간"===a?"주간 예상 수익":"월간"===a?"월간 예상 수익":"금일 예상 수익",value:null!==e.estimatedRevenue?(0,z.formatRevenueShort)(e.estimatedRevenue):"-"})]})]}),i&&(0,t.jsx)("div",{className:"px-6 pt-4",children:(0,t.jsx)(ex.ChannelGrowthSection,{channelId:i})}),i&&l&&(0,t.jsx)("div",{className:"px-6 py-6",children:(0,t.jsx)(eg.SimilarChannels,{channelId:i,currentChannel:l,compact:!0,previewCount:5,moreHref:`/channel/${i}`})})]})]})})}function eb({icon:e,iconText:a,label:n,value:s}){return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 rounded-lg bg-secondary-50 dark:bg-secondary-800/50 px-2 py-2.5 text-center",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-2xs text-secondary-500 dark:text-secondary-400",children:[e?(0,t.jsx)(e,{size:12}):a?(0,t.jsx)("span",{className:"font-bold leading-none",children:a}):null,n]}),(0,t.jsx)("span",{className:"text-sm font-bold text-secondary-900 dark:text-secondary-100 num whitespace-nowrap",children:s})]})}var ef=e.i(536589);let ej="today-channel:presets",eC=[{id:"dailyViews",label:"오늘 조회수",defaultOn:!0},{id:"avgDailyUploads",label:"업로드 빈도",defaultOn:!0},{id:"estimatedRevenue",label:"예상 수익",defaultOn:!0},{id:"avgDailyViews",label:"일일 조회수",defaultOn:!0},{id:"trendingVideoCount",label:"뜨는 영상 (일간)",defaultOn:!0},{id:"topVideos",label:"인기 영상 (30일)",defaultOn:!0}].filter(e=>e.defaultOn).map(e=>e.id),ew={daily:"일간",weekly:"주간",monthly:"월간"},eN=ef.PRIMARY_CATEGORIES_V2.map(e=>({value:e,label:e})),ek="__unclassified",eS={value:ek,label:"미분류 (관리자)"},eM=[{value:"influencer",label:"인플루언서"},{value:"compilation",label:"짜집기"},{value:"official",label:"공식"}],eD=["S"],eR=["shorts"],eF=["0-10000","10000-100000","100000-500000"],e_=["KR"],eI=["compilation"],eT={period:"daily",page:1,sort:"dailyViews",order:"desc",gradeFilters:[...eD],typeFilters:[...eR],subscriberRanges:[...eF],subscriberMin:"",subscriberMax:"",selectedCountries:[...e_],categoryFilters:[],productionTypeFilters:[...eI],shoppingOnly:!1,selectedDate:null,search:"",viewsIncrementMin:"",viewsIncrementMax:"",estimatedRevenueMin:"",estimatedRevenueMax:"",avgDailyUploadsMin:"",avgDailyUploadsMax:"",avgShortsDurationMin:"",avgShortsDurationMax:"",avgLongDurationMin:"",avgLongDurationMax:""};var eA=e.i(341336);function e$(e){return e.replace(/\D+/g,"")}function eP(e){return String(Number(e)/1e4)}function eO(e,t){let a=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(!a)return t;let n=Number(a[1]),s=Number(a[2]),r=Number(a[3]);if("weekly"===e){let e=Math.ceil(r/7);return`${n}년 ${s}월 ${e}주차`}return"monthly"===e?`${n}년 ${s}월`:t}let ez=(0,x.createParser)({parse(e){if(!e)return"";let t=Number(e);return Number.isFinite(t)?String(Math.round(t/1e4)):""},serialize:e=>e?String(1e4*Number(e)):""}),eL=(0,x.createParser)({parse:e=>"1"===e,serialize:e=>e?"1":""});var eU=e.i(144184);let eE=["KR","US","JP","TW","MX","BR","IN","ID","TH","VN","PH","DE","GB","FR"];var eV=e.i(263676),eB=e.i(975157);function eH({chips:e,onClearAll:a,clearAllLabel:n="전체 해제",className:s}){return 0===e.length?null:(0,t.jsxs)("div",{className:(0,eB.cn)("flex flex-wrap items-center gap-x-1.5 gap-y-2",s),role:"group","aria-label":"적용된 필터",children:[e.map(e=>(0,t.jsxs)(D.Badge,{variant:"default",size:"sm",className:"gap-1 pr-1",children:[e.label,(0,t.jsx)("button",{type:"button",onClick:e.onDelete,"aria-label":`${e.label} 필터 해제`,className:"-mx-1 -my-1 flex size-6 items-center justify-center rounded-full text-secondary-400 transition-colors hover:text-secondary-700 dark:hover:text-secondary-200",children:(0,t.jsx)(eV.X,{size:11})})]},e.key)),a&&e.length>1&&(0,t.jsx)("button",{type:"button",onClick:a,className:"ml-0.5 text-xs font-medium text-secondary-500 underline-offset-2 transition-colors hover:text-secondary-800 hover:underline dark:hover:text-secondary-200",children:n})]})}function eG({open:e,onOpenChange:a,title:n="필터",description:s="필터를 조정합니다.",chips:r,onClearChips:i,footer:l,children:o}){return(0,t.jsx)(em.Sheet,{open:e,onOpenChange:a,children:(0,t.jsxs)(em.SheetContent,{side:"right",children:[(0,t.jsxs)(em.SheetHeader,{className:"border-b border-secondary-200 dark:border-secondary-700",children:[(0,t.jsx)(em.SheetTitle,{children:n}),(0,t.jsx)(em.SheetDescription,{className:"sr-only",children:s})]}),r&&r.length>0&&(0,t.jsxs)("div",{className:"shrink-0 border-b border-secondary-200 px-6 py-3 dark:border-secondary-700",children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-semibold text-secondary-500 dark:text-secondary-400",children:"적용된 필터"}),(0,t.jsx)(eH,{chips:r,onClearAll:i})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:o}),l&&(0,t.jsx)("div",{className:"shrink-0 border-t border-secondary-200 px-6 py-3 dark:border-secondary-700",children:l})]})})}var eK=e.i(395925);let eJ=(0,e.i(456420).default)("zap",[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]);var eQ=e.i(749803),eq=e.i(456539);let eW="inline-flex h-7 items-center justify-center rounded-md border px-2.5 text-xs font-medium transition-colors",eY=`${eW} border-primary-500 bg-background text-primary-600 dark:text-primary-400`,eX=`${eW} border-secondary-300 bg-background text-secondary-600 hover:bg-secondary-50 dark:border-secondary-600 dark:text-secondary-300 dark:hover:bg-secondary-800`;function eZ({label:e,active:a,onClick:n}){return(0,t.jsx)("button",{type:"button",onClick:n,"aria-pressed":a,className:a?eY:eX,children:e})}function e0({children:e}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e})}function e1({label:e,children:a}){return(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("span",{className:"w-20 shrink-0 pt-1 text-xs font-semibold text-secondary-700 dark:text-secondary-200",children:e}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:a})]})}let e2="space-y-3 rounded-xl border border-secondary-200 dark:border-secondary-700 bg-secondary-50/50 dark:bg-secondary-900/30 p-3.5";function e5({icon:e,title:a,onReset:n,className:s,children:r}){return(0,t.jsxs)("section",{className:(0,eB.cn)(e2,s),children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[e,(0,t.jsx)("h3",{className:"text-sm font-bold text-secondary-900 dark:text-secondary-100",children:a}),n&&(0,t.jsxs)(f.Button,{type:"button",variant:"outline",size:"sm",onClick:n,className:"ml-auto",children:[(0,t.jsx)(eK.RotateCcw,{}),"초기화"]})]}),r]})}let e4="flex-1 min-w-0 border border-secondary-300 dark:border-secondary-600 rounded-lg px-3 py-1.5 text-sm focus:ring-2 focus:ring-secondary-400 focus:border-secondary-400 outline-none bg-background",e6=[{value:"dailyViews",label:"조회수순"},{value:"estimatedRevenue",label:"예상수익순"},{value:"grade",label:"등급순"}].flatMap(e=>[{value:`${e.value}|desc`,label:`${e.label.replace(/순$/,"")} 높은 순`},{value:`${e.value}|asc`,label:`${e.label.replace(/순$/,"")} 낮은 순`}]);function e3({label:e,min:a,max:n,onMinChange:s,onMaxChange:r,unit:i,inputMode:l="numeric"}){let o=e=>"decimal"===l?e.replace(/[^0-9.]/g,""):e$(e);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-20 shrink-0 text-xs font-semibold text-secondary-700 dark:text-secondary-200",children:e}),(0,t.jsx)("input",{"aria-label":"최소값",type:"text",inputMode:l,placeholder:"최소",value:a,onChange:e=>s(o(e.target.value)),className:e4}),(0,t.jsx)("span",{className:"shrink-0 text-sm text-secondary-400",children:"~"}),(0,t.jsx)("input",{"aria-label":"최대값",type:"text",inputMode:l,placeholder:"최대",value:n,onChange:e=>r(o(e.target.value)),className:e4}),(0,t.jsx)("span",{className:"w-8 shrink-0 text-sm text-secondary-400",children:i??""})]})}function e7({isAdmin:e,gradeOptions:n,gradeFilters:s,onToggleGrade:r,onClearGrades:i,typeFilters:l,onToggleType:
1o,onClearTypes:c,subscriberRanges:d,onToggleSubscriberRange:u,subscriberMin:h,subscriberMax:p,viewsIncrementMin:m,viewsIncrementMax:x,onViewsIncrementMinChange:g,onViewsIncrementMaxChange:y,estimatedRevenueMin:v,estimatedRevenueMax:b,onEstimatedRevenueMinChange:j,onEstimatedRevenueMaxChange:C,avgDailyUploadsMin:w,avgDailyUploadsMax:N,onAvgDailyUploadsMinChange:k,onAvgDailyUploadsMaxChange:S,avgShortsDurationMin:M,avgShortsDurationMax:D,onAvgShortsDurationMinChange:R,onAvgShortsDurationMaxChange:F,avgLongDurationMin:I,avgLongDurationMax:T,onAvgLongDurationMinChange:A,onAvgLongDurationMaxChange:$,categoryFilters:P,onCategoryFiltersChange:O,countryOptions:z,countryFilters:L,onCountryFiltersChange:U,productionTypeFilters:E,onProductionTypeFiltersChange:V,shoppingOnly:B,onShoppingOnlyChange:H,sort:G,onSortChange:K,order:J,onOrderChange:Q,onResetQuickFilters:q,onResetDetailFilters:W}){let[Y,X]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)(e5,{icon:(0,t.jsx)(eJ,{size:15,className:"text-secondary-900 dark:text-secondary-100"}),title:"빠른 필터",onReset:q,children:[(0,t.jsx)(e1,{label:"등급",children:(0,t.jsxs)(e0,{children:[(0,t.jsx)(eZ,{label:"전체",active:0===s.length,onClick:i}),n.map(e=>(0,t.jsx)(eZ,{label:e,active:s.includes(e),onClick:()=>r(e)},e))]})}),(0,t.jsx)(e1,{label:"채널 유형",children:(0,t.jsxs)(e0,{children:[(0,t.jsx)(eZ,{label:"전체",active:0===l.length,onClick:c}),eA.CHANNEL_TYPES.map(e=>(0,t.jsx)(eZ,{label:e.label,active:l.includes(e.value),onClick:()=>o(e.value)},e.value))]})}),(0,t.jsx)(e1,{label:"구독자 규모",children:(0,t.jsx)(e0,{children:eA.SUBSCRIBER_RANGES.map(e=>(0,t.jsx)(eZ,{label:e.label,active:d.includes(e.value)&&!h&&!p,onClick:()=>u(e.value)},e.value))})}),(0,t.jsx)(e1,{label:"국가",children:(0,t.jsxs)(e0,{children:[(0,t.jsx)(eZ,{label:"전체",active:0===L.length,onClick:()=>U([])}),z.map(e=>(0,t.jsx)(eZ,{label:e.label,active:L.includes(e.value),onClick:()=>U(L.includes(e.value)?L.filter(t=>t!==e.value):[...L,e.value])},e.value))]})}),(0,t.jsx)(e1,{label:"카테고리",children:(0,t.jsxs)(e0,{children:[(0,t.jsx)(eZ,{label:"전체",active:0===P.length,onClick:()=>O([])}),[...eN,...e>=1?[eS]:[]].map(e=>(0,t.jsx)(eZ,{label:e.label,active:P.includes(e.value),onClick:()=>O(P.includes(e.value)?P.filter(t=>t!==e.value):[...P,e.value])},e.value))]})}),(0,t.jsx)(e1,{label:"제작유형",children:(0,t.jsxs)(e0,{children:[(0,t.jsx)(eZ,{label:"전체",active:0===E.length,onClick:()=>V([])}),eM.map(e=>(0,t.jsx)(eZ,{label:e.label,active:E.includes(e.value),onClick:()=>V(E.includes(e.value)?E.filter(t=>t!==e.value):[...E,e.value])},e.value))]})}),(0,t.jsx)(e1,{label:"쇼핑",children:(0,t.jsx)(e0,{children:(0,t.jsx)(eZ,{label:"쇼핑 채널만",active:B,onClick:()=>H(!B)})})}),(0,t.jsx)(e1,{label:"정렬",children:(0,t.jsx)(e0,{children:e6.map(e=>(0,t.jsx)(eZ,{label:e.label,active:`${G}|${J}`===e.value,onClick:()=>{let[t,a]=e.value.split("|");t&&K(t),a&&Q(a)}},e.value))})})]}),(0,t.jsxs)("section",{className:e2,children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>X(e=>!e),className:"flex min-w-0 flex-1 items-center gap-1.5",children:[(0,t.jsx)(eQ.BarChart3,{size:15,className:"text-secondary-900 dark:text-secondary-100"}),(0,t.jsx)("h3",{className:"text-sm font-bold text-secondary-900 dark:text-secondary-100",children:"고급 설정"}),(0,t.jsx)("span",{className:"text-2xs font-normal text-secondary-400",children:"(선택사항)"})]}),(0,t.jsxs)(f.Button,{type:"button",variant:"outline",size:"sm",onClick:W,children:[(0,t.jsx)(eK.RotateCcw,{}),"초기화"]}),(0,t.jsx)("button",{type:"button",onClick:()=>X(e=>!e),"aria-label":Y?"접기":"펼치기",className:"text-secondary-400",children:Y?(0,t.jsx)(eq.ChevronUp,{size:16}):(0,t.jsx)(_.ChevronDown,{size:16})})]}),Y&&(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsx)(e3,{label:"조회수 증가",min:m,max:x,onMinChange:g,onMaxChange:y}),(0,t.jsx)(e3,{label:"예상 수익",min:v,max:b,onMinChange:j,onMaxChange:C,unit:"만원"}),(0,t.jsx)(e3,{label:"업로드 빈도",min:w,max:N,onMinChange:k,onMaxChange:S,unit:"개",inputMode:"decimal"}),(0,t.jsx)(e3,{label:"숏폼 평균",min:M,max:D,onMinChange:R,onMaxChange:F,unit:"초"}),(0,t.jsx)(e3,{label:"롱폼 평균",min:I,max:T,onMinChange:A,onMaxChange:$,unit:"분"})]})]})]})}function e8({f:e}){return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(eG,{open:e.showFilters,onOpenChange:e.setShowFilters,title:"필터",description:"채널 등급·유형·구독자·카테고리·정렬 등 필터를 조정합니다.",chips:e.filterChips,onClearChips:()=>{e.clearSearch(),e.resetQuickFilters(),e.resetDetailFilters()},footer:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("p",{className:"text-xs text-secondary-500 dark:text-secondary-400",children:"선택한 조건은 바로 반영됩니다"}),(0,t.jsx)(f.Button,{type:"button",variant:"primary",size:"sm",onClick:()=>{e.applySearch(),e.setShowFilters(!1)},children:"결과 보기"})]}),children:(0,t.jsx)(e7,{isAdmin:e.isAdmin,gradeOptions:e.gradeOptions,gradeFilters:e.gradeFilters,onToggleGrade:e.toggleGrade,onClearGrades:()=>{e.setPage(1),e.setGradeFilters([])},typeFilters:e.typeFilters,onToggleType:e.toggleType,onClearTypes:()=>{e.setPage(1),e.setTypeFilters([])},subscriberRanges:e.subscriberRanges,onToggleSubscriberRange:e.toggleSubscriberRange,subscriberMin:e.subscriberMin,subscriberMax:e.subscriberMax,viewsIncrementMin:e.viewsIncrementMin,viewsIncrementMax:e.viewsIncrementMax,onViewsIncrementMinCh
1ange:t=>{e.setPage(1),e.setViewsIncrementMin(t)},onViewsIncrementMaxChange:t=>{e.setPage(1),e.setViewsIncrementMax(t)},estimatedRevenueMin:e.estimatedRevenueMin,estimatedRevenueMax:e.estimatedRevenueMax,onEstimatedRevenueMinChange:t=>{e.setPage(1),e.setEstimatedRevenueMin(t)},onEstimatedRevenueMaxChange:t=>{e.setPage(1),e.setEstimatedRevenueMax(t)},avgDailyUploadsMin:e.avgDailyUploadsMin,avgDailyUploadsMax:e.avgDailyUploadsMax,onAvgDailyUploadsMinChange:t=>{e.setPage(1),e.setAvgDailyUploadsMin(t)},onAvgDailyUploadsMaxChange:t=>{e.setPage(1),e.setAvgDailyUploadsMax(t)},avgShortsDurationMin:e.avgShortsDurationMin,avgShortsDurationMax:e.avgShortsDurationMax,onAvgShortsDurationMinChange:t=>{e.setPage(1),e.setAvgShortsDurationMin(t)},onAvgShortsDurationMaxChange:t=>{e.setPage(1),e.setAvgShortsDurationMax(t)},avgLongDurationMin:e.avgLongDurationMin,avgLongDurationMax:e.avgLongDurationMax,onAvgLongDurationMinChange:t=>{e.setPage(1),e.setAvgLongDurationMin(t)},onAvgLongDurationMaxChange:t=>{e.setPage(1),e.setAvgLongDurationMax(t)},categoryFilters:e.categoryFilters,onCategoryFiltersChange:t=>{e.setCategoryFilters(t),e.setPage(1)},countryOptions:e.countryOptions,countryFilters:e.selectedCountries,onCountryFiltersChange:t=>{e.setSelectedCountries(t),e.setPage(1)},productionTypeFilters:e.productionTypeFilters,onProductionTypeFiltersChange:t=>{e.setProductionTypeFilters(t),e.setPage(1)},shoppingOnly:e.shoppingOnly,onShoppingOnlyChange:()=>e.toggleShoppingOnly(),sort:e.sort,onSortChange:t=>{e.setPage(1),e.setSort(t)},order:e.order,onOrderChange:t=>{e.setPage(1),e.setOrder(t)},onResetQuickFilters:e.resetQuickFilters,onResetDetailFilters:e.resetDetailFilters})})})}function e9(){return(0,t.jsxs)("div",{className:"space-y-0",children:[(0,t.jsxs)("div",{className:"hidden md:block",children:[(0,t.jsx)("div",{className:"h-10 border-b border-secondary-200 dark:border-secondary-700"}),Array.from({length:8}).map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-4 py-3 border-b border-secondary-100 dark:border-secondary-800 animate-pulse",children:[(0,t.jsx)("div",{className:"w-8 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"}),(0,t.jsx)("div",{className:"w-6 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,t.jsx)("div",{className:"w-8 h-8 bg-secondary-200 dark:bg-secondary-700 rounded-full"}),(0,t.jsx)("div",{className:"w-32 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"})]}),(0,t.jsx)("div",{className:"w-8 h-5 bg-secondary-200 dark:bg-secondary-700 rounded-full"}),(0,t.jsx)("div",{className:"w-16 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"}),(0,t.jsx)("div",{className:"w-12 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"}),(0,t.jsx)("div",{className:"w-16 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"}),(0,t.jsx)("div",{className:"w-12 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"})]},a))]}),(0,t.jsx)("div",{className:"md:hidden space-y-2",children:Array.from({length:6}).map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-secondary-200 dark:border-secondary-700 animate-pulse",children:[(0,t.jsx)("div",{className:"w-6 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"}),(0,t.jsx)("div",{className:"w-8 h-8 bg-secondary-200 dark:bg-secondary-700 rounded-full"}),(0,t.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,t.jsx)("div",{className:"w-28 h-4 bg-secondary-200 dark:bg-secondary-700 rounded"}),(0,t.jsx)("div",{className:"w-40 h-3 bg-secondary-200 dark:bg-secondary-700 rounded"})]})]},a))})]})}let te=["ch"];function tt({initialDailyDates:e=null,initialFirstPage:b=null,initialFirstPageParams:N=null}={}){let k=function({initialDailyDates:e=null}={}){let{data:t,status:s}=(0,n.useSession)(),r=t?.user?.role,i="super_admin"===r?2:+("admin"===r),l=i>=1?eA.GRADE_OPTIONS_ADMIN:eA.GRADE_OPTIONS,[o,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)([]),{page:h,sort:p,order:g,selectedDate:y,gradeFilters:v,typeFilters:b,subscriberRanges:f,subscriberMin:j,subscriberMax:C,selectedCountries:w,categoryFilters:N,productionTypeFilters:k,shoppingOnly:S,search:M,viewsIncrementMin:D,viewsIncrementMax:R,estimatedRevenueMin:F,estimatedRevenueMax:_,avgDailyUploadsMin:I,avgDailyUploadsMax:T,avgShortsDurationMin:A,avgShortsDurationMax:$,avgLongDurationMin:P,avgLongDurationMax:O,setPeriod:z,setPage:L,setSort:U,setOrder:E,setSelectedDate:V,setGradeFilters:B,setTypeFilters:H,setSubscriberRanges:G,setSubscriberMin:K,setSubscriberMax:J,setSelectedCountries:Q,setCategoryFilters:q,setProductionTypeFilters:W,setShoppingOnly:Y,setSearch:X,setViewsIncrementMin:Z,setVie
1wsIncrementMax:ee,setEstimatedRevenueMin:et,setEstimatedRevenueMax:ea,setAvgDailyUploadsMin:en,setAvgDailyUploadsMax:es,setAvgShortsDurationMin:er,setAvgShortsDurationMax:ei,setAvgLongDurationMin:el,setAvgLongDurationMax:eo}=function(){let[e,t]=(0,x.useQueryStates)({period:x.parseAsString.withDefault(eT.period),page:x.parseAsInteger.withDefault(eT.page),sort:x.parseAsString.withDefault(eT.sort),order:x.parseAsString.withDefault(eT.order),grades:(0,x.parseAsArrayOf)(x.parseAsString).withDefault(eT.gradeFilters),types:(0,x.parseAsArrayOf)(x.parseAsString).withDefault(eT.typeFilters),subsRanges:(0,x.parseAsArrayOf)(x.parseAsString).withDefault(eT.subscriberRanges),subsMin:x.parseAsString.withDefault(""),subsMax:x.parseAsString.withDefault(""),country:(0,x.parseAsArrayOf)(x.parseAsString).withDefault(eT.selectedCountries),categories:(0,x.parseAsArrayOf)(x.parseAsString).withDefault(eT.categoryFilters),ptypes:(0,x.parseAsArrayOf)(x.parseAsString).withDefault(eT.productionTypeFilters),shop:eL.withDefault(eT.shoppingOnly),date:x.parseAsString,search:x.parseAsString.withDefault(eT.search),viewsIncrementMin:x.parseAsString.withDefault(""),viewsIncrementMax:x.parseAsString.withDefault(""),estimatedRevenueMin:ez.withDefault(""),estimatedRevenueMax:ez.withDefault(""),avgDailyUploadsMin:x.parseAsString.withDefault(""),avgDailyUploadsMax:x.parseAsString.withDefault(""),avgShortsDurationMin:x.parseAsString.withDefault(""),avgShortsDurationMax:x.parseAsString.withDefault(""),avgLongDurationMin:x.parseAsString.withDefault(""),avgLongDurationMax:x.parseAsString.withDefault("")},{history:"replace",scroll:!1,shallow:!0}),n=(0,a.useCallback)(e=>void t(t=>({period:"function"==typeof e?e(t.period):e})),[t]),s=(0,a.useCallback)(e=>void t(t=>({page:"function"==typeof e?e(t.page):e})),[t]),r=(0,a.useCallback)(e=>void t(t=>({sort:"function"==typeof e?e(t.sort):e})),[t]),i=(0,a.useCallback)(e=>void t(t=>({order:"function"==typeof e?e(t.order):e})),[t]),l=(0,a.useCallback)(e=>void t(t=>({date:"function"==typeof e?e(t.date):e})),[t]),o=(0,a.useCallback)(e=>void t(t=>({grades:"function"==typeof e?e(t.grades):e})),[t]),c=(0,a.useCallback)(e=>void t(t=>({types:"function"==typeof e?e(t.types):e})),[t]),d=(0,a.useCallback)(e=>void t(t=>({subsRanges:"function"==typeof e?e(t.subsRanges):e})),[t]),u=(0,a.useCallback)(e=>void t(t=>({subsMin:"function"==typeof e?e(t.subsMin):e})),[t]),h=(0,a.useCallback)(e=>void t(t=>({subsMax:"function"==typeof e?e(t.subsMax):e})),[t]),p=(0,a.useCallback)(e=>void t(t=>({country:"function"==typeof e?e(t.country):e})),[t]),m=(0,a.useCallback)(e=>void t(t=>({categories:"function"==typeof e?e(t.categories):e})),[t]),g=(0,a.useCallback)(e=>void t(t=>({ptypes:"function"==typeof e?e(t.ptypes):e})),[t]),y=(0,a.useCallback)(e=>void t(t=>({shop:"function"==typeof e?e(t.shop):e})),[t]),v=(0,a.useCallback)(e=>void t(t=>({search:"function"==typeof e?e(t.search):e})),[t]),b=(0,a.useCallback)(e=>void t(t=>({viewsIncrementMin:"function"==typeof e?e(t.viewsIncrementMin):e})),[t]),f=(0,a.useCallback)(e=>void t(t=>({viewsIncrementMax:"function"==typeof e?e(t.viewsIncrementMax):e})),[t]),j=(0,a.useCallback)(e=>void t(t=>({estimatedRevenueMin:"function"==typeof e?e(t.estimatedRevenueMin):e})),[t]),C=(0,a.useCallback)(e=>void t(t=>({estimatedRevenueMax:"function"==typeof e?e(t.estimatedRevenueMax):e})),[t]),w=(0,a.useCallback)(e=>void t(t=>({avgDailyUploadsMin:"function"==typeof e?e(t.avgDailyUploadsMin):e})),[t]),N=(0,a.useCallback)(e=>void t(t=>({avgDailyUploadsMax:"function"==typeof e?e(t.avgDailyUploadsMax):e})),[t]),k=(0,a.useCallback)(e=>void t(t=>({avgShortsDurationMin:"function"==typeof e?e(t.avgShortsDurationMin):e})),[t]),S=(0,a.useCallback)(e=>void t(t=>({avgShortsDurationMax:"function"==typeof e?e(t.avgShortsDurationMax):e})),[t]),M=(0,a.useCallback)(e=>void t(t=>({avgLongDurationMin:"function"==typeof e?e(t.avgLongDurationMin):e})),[t]),D=(0,a.useCallback)(e=>void t(t=>({avgLongDurationMax:"function"==typeof e?e(t.avgLongDurationMax):e})),[t]);return{period:e.period,page:e.page,sort:e.sort,order:e.order,selectedDate:e.date,gradeFilters:e.grades,typeFilters:e.types,subscriberRanges:e.subsRanges,subscriberMin:e.subsMin,subscriberMax:e.subsMax,selectedCountries:e.country,categoryFilters:e.categories,productionTypeFilters:e.ptypes,shoppingOnly:e.shop,search:e.search,viewsIncrementMin:e.viewsIncrementMin,viewsIncrementMax:e.viewsIncrementMax,estimatedRevenueMin:e.estimatedRevenueMin,estimatedRevenueMax:e.estimatedRevenueMax,avgDailyUploadsMin:e.avgDailyUploadsMin,avgDailyUploadsMax:e.avgDailyUploadsMax,avgShortsDurationMin:e.avgShortsDurationMin,avgShortsDurationMax:e.avgShortsDurationMax,avgLongDurationMin:e.avgLongDurationMin,avgLongDurationMax:e.avgLongDurationMax,setPeriod:n,setPage:s,setSort:r,setOrder:i,setSelectedDate:l,setGradeFilters:o,setTypeFilters:c,setSubscriberRanges:d,setSubscriberMin:u,setSubscriberMax:h,setSelectedCountries:p,setCategoryFilters:m,setProductionTypeFilters:g,setShoppingOnly:y,setSearch:v,setViewsIncrementMin:b,setViewsIncrementMax:f,setEstimatedRevenueMin:j,setEstimatedRevenueMax:C,setAvgDailyUploadsMin:w,setAvgDailyUploadsMax:N,setAvgShortsDurationMin:k,setAvgShortsDurationMax:S,setAvgLongDurationMin:M,setAvgLongDurationMax:D}}(),ec="daily",{initialized:ed,datesLoaded:eu,setDatesLoaded:eh,availableDates:ep,allPeriodDatesRef:em}=function({period:e,selectedDate:t,setSelectedDate:n,initialDailyDates:s=null}){let[r,i]=(0,a.useState)(!1),l=!!(s&&"daily"===e),[o,c]=(0,a.useState)(l),[d,u]=(0,a.useState)(()=>l?s.dates.map(e=>({value:e,label:eO("daily",e)})):[]),h=(0,a.useRef)(!!t),p=(0,a.useRef)(new Map(s?[["daily",s]]:[]));return(0,a.useEffect)(()=>{i(!0)},[]),(0,a.useEffect)(()=>
1{if(!r)return;let t=["daily","weekly","monthly"].filter(t=>t!==e),a=window.setTimeout(()=>{Promise.allSettled(t.map(e=>(0,m.fetchJson)(`/api/today-channel/available-dates?period=${e}`))).then(e=>{e.forEach((e,a)=>{let n=t[a];n&&"fulfilled"===e.status&&e.value.dates.length>0&&p.current.set(n,e.value)})})},1e3);return()=>window.clearTimeout(a)},[r,e]),(0,a.useEffect)(()=>{if(!r)return;function t(t){u(t.dates.map(t=>({value:t,label:eO(e,t)}))),n(e=>h.current&&e&&t.dates.includes(e)?(h.current=!1,e):t.latestDate??t.dates[0]??null),c(!0)}c(!1);let a=p.current.get(e);a?t(a):(0,m.fetchJson)(`/api/today-channel/available-dates?period=${e}`).then(a=>{if(0===a.dates.length){u([]),n(null),c(!0);return}p.current.set(e,a),t(a)}).catch(()=>{u([]),n(null),c(!0)})},[r,e,n]),(0,a.useEffect)(()=>{if(!o||t||0===d.length)return;let a=p.current.get(e)?.latestDate??d[0]?.value??null;a&&n(a)},[o,t,d,e,n]),{initialized:r,datesLoaded:o,setDatesLoaded:c,availableDates:d,allPeriodDatesRef:p}}({period:ec,selectedDate:y,setSelectedDate:V,initialDailyDates:e}),{searchInput:ex,setSearchInput:eg,preSearchFiltersRef:ey,applySearch:ev,clearSearch:eb}=function({gradeFilters:e,typeFilters:t,subscriberRanges:n,subscriberMin:s,subscriberMax:r,selectedCountries:i,shoppingOnly:l,setPage:o,setSearch:c,setGradeFilters:d,setTypeFilters:u,setSubscriberRanges:h,setSubscriberMin:p,setSubscriberMax:m,setSelectedCountries:x,setShoppingOnly:g}){let[y,v]=(0,a.useState)(eT.search),b=(0,a.useRef)(null),f=(0,a.useCallback)(()=>{let e=b.current;e&&(d(e.gradeFilters),u(e.typeFilters),h(e.subscriberRanges),p(e.subscriberMin),m(e.subscriberMax),x(e.selectedCountries),g(e.shoppingOnly),b.current=null)},[d,u,h,p,m,x,g]),j=(0,a.useCallback)(a=>{let v=(a??y).trim();if(!v){f(),o(1),c("");return}b.current||(b.current={gradeFilters:[...e],typeFilters:[...t],subscriberRanges:[...n],subscriberMin:s,subscriberMax:r,selectedCountries:[...i],shoppingOnly:l}),d([]),u([]),h([]),p(""),m(""),x([]),g(!1),o(1),c(v)},[y,e,t,n,s,r,i,l,f,o,c,d,u,h,p,m,x,g]),C=(0,a.useCallback)(()=>{f(),o(1),c(""),v("")},[f,o,c]);return{searchInput:y,setSearchInput:v,preSearchFiltersRef:b,applySearch:j,clearSearch:C}}({gradeFilters:v,typeFilters:b,subscriberRanges:f,subscriberMin:j,subscriberMax:C,selectedCountries:w,shoppingOnly:S,setPage:L,setSearch:X,setGradeFilters:B,setTypeFilters:H,setSubscriberRanges:G,setSubscriberMin:K,setSubscriberMax:J,setSelectedCountries:Q,setShoppingOnly:Y}),{presets:eC,selectedPresetId:eS,setSelectedPresetId:eV,savePreset:eB,loadPreset:eH,deletePreset:eG}=function({period:e,gradeFilters:t,typeFilters:n,subscriberRanges:s,subscriberMin:r,subscriberMax:i,selectedCountries:l,sort:o,order:c,viewsIncrementMin:d,viewsIncrementMax:u,estimatedRevenueMin:h,estimatedRevenueMax:p,avgDailyUploadsMin:m,avgDailyUploadsMax:x,avgShortsDurationMin:g,avgShortsDurationMax:y,avgLongDurationMin:v,avgLongDurationMax:b,setDatesLoaded:f,setPage:j,setPeriod:C,setSort:w,setOrder:N,setGradeFilters:k,setTypeFilters:S,setSubscriberRanges:M,setSubscriberMin:D,setSubscriberMax:R,setSelectedCountries:F,setViewsIncrementMin:_,setViewsIncrementMax:I,setEstimatedRevenueMin:T,setEstimatedRevenueMax:A,setAvgDailyUploadsMin:$,setAvgDailyUploadsMax:P,setAvgShortsDurationMin:O,setAvgShortsDurationMax:z,setAvgLongDurationMin:L,setAvgLongDurationMax:U}){let[E,V]=(0,a.useState)([]),[B,H]=(0,a.useState)("");(0,a.useEffect)(()=>{try{let e=localStorage.getItem(ej);e&&V(JSON.parse(e))}catch{}},[]);let G=(0,a.useCallback)(()=>{let a=prompt("프리셋 이름을 입력하세요:");if(!a?.trim())return;let f={id:Date.now().toString(),name:a.trim(),filters:{period:e,gradeFilters:t,typeFilters:n,subscriberRanges:s,subscriberMin:r,subscriberMax:i,selectedCountries:l,sort:o,order:c,viewsIncrementMin:d,viewsIncrementMax:u,estimatedRevenueMin:h,estimatedRevenueMax:p,avgDailyUploadsMin:m,avgDailyUploadsMax:x,avgShortsDurationMin:g,avgShortsDurationMax:y,avgLongDurationMin:v,avgLongDurationMax:b}},j=[...E,f];V(j),localStorage.setItem(ej,JSON.stringify(j)),H(f.id)},[e,t,n,s,r,i,l,o,c,E,d,u,h,p,m,x,g,y,v,b]),K=(0,a.useCallback)(t=>{let a=E.find(e=>e.id===t);if(!a)return;let n=a.filters;n.period!==e&&f(!1),C(n.period),k(n.gradeFilters),S(n.typeFilters),M(n.subscriberRanges),D(n.subscriberMin),R(n.subscriberMax),F(n.selectedCountries),w(n.sort),N(n.order),_(n.viewsIncrementMin??""),I(n.viewsIncrementMax??""),T(n.estimatedRevenueMin??""),A(n.estimatedRevenueMax??""),$(n.avgDailyUploadsMin??""),P(n.avgDailyUploadsMax??""),O(n.avgShortsDurationMin??""),z(n.avgShortsDurationMax??""),L(n.avgLongDurationMin??""),U(n.avgLongDurationMax??""),j(1),H(t)},[E,e,f,j,C,w,N,k,S,M,D,R,F,_,I,T,A,$,P,O,z,L,U]),J=(0,a.useCallback)(e=>{let t=E.filter(t=>t.id!==e);V(t),localStorage.setItem(ej,JSON.stringify(t)),B===e&&H("")},[E,B]);return{presets:E,selectedPresetId:B,setSelectedPresetId:H,savePreset:G,loadPreset:K,deletePreset:J}}({period:ec,gradeFilters:v,typeFilters:b,subscriberRanges:f,subscriberMin:j,subscriberMax:C,selectedCountries:w,sort:p,order:g,viewsIncrementMin:D,viewsIncrementMax:R,estimatedRevenueMin:F,estimatedRevenueMax:_,avgDailyUploadsMin:I,avgDailyUploadsMax:T,avgShortsDurationMin:A,avgShortsDurationMax:$,avgLongDurationMin:P,avgLongDurationMax:O,setDatesLoaded:eh,setPage:L,setPeriod:z,setSort:U,setOrder:E,setGradeFilters:B,setTypeFilters:H,setSubscriberRanges:G,setSubscriberMin:K,setSubscriberMax:J,setSelectedCountries:Q,setVie
1wsIncrementMin:Z,setViewsIncrementMax:ee,setEstimatedRevenueMin:et,setEstimatedRevenueMax:ea,setAvgDailyUploadsMin:en,setAvgDailyUploadsMax:es,setAvgShortsDurationMin:er,setAvgShortsDurationMax:ei,setAvgLongDurationMin:el,setAvgLongDurationMax:eo}),{toggleGrade:eK,toggleType:eJ,toggleCategory:eQ,toggleProductionType:eq,toggleShoppingOnly:eW,clearCategories:eY,clearProductionTypes:eX,toggleSubscriberRange:eZ,onManualSubscriberChange:e0,resetFilters:e1,resetQuickFilters:e2,resetDetailFilters:e5,applyRecommendedFilters:e4,clearRecommendedFilters:e6}=function({preSearchFiltersRef:e,setDatesLoaded:t,setSearchInput:n,setSelectedPresetId:s,setPage:r,setPeriod:i,setSort:l,setOrder:o,setSelectedDate:c,setSearch:d,setGradeFilters:u,setTypeFilters:h,setCategoryFilters:p,setProductionTypeFilters:m,setShoppingOnly:x,setSubscriberRanges:g,setSubscriberMin:y,setSubscriberMax:v,setSelectedCountries:b,setViewsIncrementMin:f,setViewsIncrementMax:j,setEstimatedRevenueMin:C,setEstimatedRevenueMax:w,setAvgDailyUploadsMin:N,setAvgDailyUploadsMax:k,setAvgShortsDurationMin:S,setAvgShortsDurationMax:M,setAvgLongDurationMin:D,setAvgLongDurationMax:R}){let F=(0,a.useCallback)(e=>{r(1),u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[r,u]),_=(0,a.useCallback)(e=>{r(1),h(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[r,h]),I=(0,a.useCallback)(e=>{r(1),p(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[r,p]),T=(0,a.useCallback)(e=>{r(1),m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[r,m]),A=(0,a.useCallback)(()=>{r(1),x(e=>!e)},[r,x]),$=(0,a.useCallback)(()=>{r(1),p([])},[r,p]),P=(0,a.useCallback)(()=>{r(1),m([])},[r,m]),O=(0,a.useCallback)(e=>{r(1),y(""),v(""),g(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[r,y,v,g]),z=(0,a.useCallback)((e,t)=>{r(1),g([]),"min"===e?y(e$(t)):v(e$(t))},[r,g,y,v]),L=(0,a.useCallback)(()=>{r(1),t(!1),i(eT.period),l(eT.sort),o(eT.order),u([...eT.gradeFilters]),h([...eT.typeFilters]),g([...eT.subscriberRanges]),y(eT.subscriberMin),v(eT.subscriberMax),b([...eT.selectedCountries]),m([...eT.productionTypeFilters]),x(eT.shoppingOnly),d(eT.search),n(eT.search),c(null),s(""),f(""),j(""),C(""),w(""),N(""),k(""),S(""),M(""),D(""),R("")},[r,t,i,l,o,u,h,g,y,v,b,m,x,d,n,c,s,f,j,C,w,N,k,S,M,D,R]),U=(0,a.useCallback)(()=>{r(1),l(eT.sort),o(eT.order),u([]),h([]),g([]),y(""),v(""),b([]),p([]),m([]),x(!1)},[r,l,o,u,h,g,y,v,b,p,m,x]),E=(0,a.useCallback)(()=>{r(1),f(""),j(""),C(""),w(""),N(""),k(""),S(""),M(""),D(""),R("")},[r,f,j,C,w,N,k,S,M,D,R]);return{toggleGrade:F,toggleType:_,toggleCategory:I,toggleProductionType:T,toggleShoppingOnly:A,clearCategories:$,clearProductionTypes:P,toggleSubscriberRange:O,onManualSubscriberChange:z,resetFilters:L,resetQuickFilters:U,resetDetailFilters:E,applyRecommendedFilters:(0,a.useCallback)(()=>
1{r(1),l(eT.sort),o(eT.order),u([...eD]),h([...eR]),g([...eF]),y(""),v(""),b([...e_]),s(""),p([]),m([...eI]),x(!1),d(""),n(""),e.current=null,f(""),j(""),C(""),w(""),N(""),k(""),S(""),M(""),D(""),R("")},[e,r,l,o,u,h,g,y,v,b,s,p,m,x,d,n,f,j,C,w,N,k,S,M,D,R]),clearRecommendedFilters:(0,a.useCallback)(()=>{r(1),u([]),h([]),g([]),y(""),v(""),b([]),m([]),s("")},[r,u,h,g,y,v,b,m,s])}}({preSearchFiltersRef:ey,setDatesLoaded:eh,setSearchInput:eg,setSelectedPresetId:eV,setPage:L,setPeriod:z,setSort:U,setOrder:E,setSelectedDate:V,setSearch:X,setGradeFilters:B,setTypeFilters:H,setCategoryFilters:q,setProductionTypeFilters:W,setShoppingOnly:Y,setSubscriberRanges:G,setSubscriberMin:K,setSubscriberMax:J,setSelectedCountries:Q,setViewsIncrementMin:Z,setViewsIncrementMax:ee,setEstimatedRevenueMin:et,setEstimatedRevenueMax:ea,setAvgDailyUploadsMin:en,setAvgDailyUploadsMax:es,setAvgShortsDurationMin:er,setAvgShortsDurationMax:ei,setAvgLongDurationMin:el,setAvgLongDurationMax:eo});(0,a.useEffect)(()=>{(0,m.fetchJson)("/api/today-channel/countries").then(e=>{let t=new Map(e.map(e=>[e.code,e]));u(eE.flatMap(e=>{let a=t.get(e);return a?[{value:a.code,label:a.name,count:a.count}]:[]}))}).catch(()=>{})},[]);let e3=(0,a.useMemo)(()=>({selectedDate:y,selectedCountries:w,categoryFilters:N,productionTypeFilters:k,shoppingOnly:S,gradeFilters:v,typeFilters:b,subscriberMin:j,subscriberMax:C,subscriberRanges:f,viewsIncrementMin:D,viewsIncrementMax:R,estimatedRevenueMin:F,estimatedRevenueMax:_,avgDailyUploadsMin:I,avgDailyUploadsMax:T,avgShortsDurationMin:A,avgShortsDurationMax:$,avgLongDurationMin:P,avgLongDurationMax:O}),[y,w,N,k,S,v,b,j,C,f,D,R,F,_,I,T,A,$,P,O]);!function({initialized:e,criteria:t,period:n,page:s,sort:r,order:i,search:l,preSearchFiltersRef:o}){(0,a.useEffect)(()=>{if(!e)return;let a=o.current??{gradeFilters:t.gradeFilters,typeFilters:t.typeFilters,subscriberRanges:t.subscriberRanges,subscriberMin:t.subscriberMin,subscriberMax:t.subscriberMax,selectedCountries:t.selectedCountries},c={period:n,page:l?1:s,sort:r,order:i,gradeFilters:a.gradeFilters,typeFilters:a.typeFilters,subscriberRanges:a.subscriberRanges,subscriberMin:a.subscriberMin,subscriberMax:a.subscriberMax,selectedCountries:a.selectedCountries,categoryFilters:t.categoryFilters,productionTypeFilters:t.productionTypeFilters,selectedDate:null,search:"",viewsIncrementMin:t.viewsIncrementMin,viewsIncrementMax:t.viewsIncrementMax,estimatedRevenueMin:t.estimatedRevenueMin,estimatedRevenueMax:t.estimatedRevenueMax,avgDailyUploadsMin:t.avgDailyUploadsMin,avgDailyUploadsMax:t.avgDailyUploadsMax,avgShortsDurationMin:t.avgShortsDurationMin,avgShortsDurationMax:t.avgShortsDurationMax,avgLongDurationMin:t.avgLongDurationMin,avgLongDurationMax:t.avgLongDurationMax};localStorage.setItem("today-channel:filters:v1",JSON.stringify(c))},[e,t,n,s,r,i,l,o])}({initialized:ed,criteria:e3,period:ec,page:h,sort:p,order:g,search:M,preSearchFiltersRef:ey});let e7=(0,a.useCallback)((e,t)=>{let a=new URLSearchParams({period:e,offset:String((t-1)*20),limit:String(20),sort:p,order:g});M&&a.set("search",M);let n=d.length>0&&w.length>=d.length?{...e3,selectedCountries:[]}:e3;return n.selectedDate&&a.set("date",n.selectedDate),n.selectedCountries.length>0&&a.set("country",n.selectedCountries.join(",")),n.categoryFilters.length>0&&a.set("categories",n.categoryFilters.join(",")),n.productionTypeFilters.length>0&&a.set("ptypes",n.productionTypeFilters.join(",")),n.shoppingOnly&&a.set("shop","1"),n.gradeFilters.length>0&&a.set("grades",n.gradeFilters.join(",")),n.typeFilters.length>0&&a.set("types",n.typeFilters.join(",")),n.subscriberMin||n.subscriberMax?(n.subscriberMin&&a.set("subsMin",n.subscriberMin),n.subscriberMax&&a.set("subsMax",n.subscriberMax)):n.subscriberRanges.length>0&&a.set("subsRanges",n.subscriberRanges.join(",")),n.viewsIncrementMin&&a.set("viewsIncrementMin",n.viewsIncrementMin),n.viewsIncrementMax&&a.set("viewsIncrementMax",n.viewsIncrementMax),n.estimatedRevenueMin&&a.set("estimatedRevenueMin",String(1e4*Number(n.estimatedRevenueMin))),n.estimatedRevenueMax&&a.set("estimatedRevenueMax",String(1e4*Number(n.estimatedRevenueMax))),n.avgDailyUploadsMin&&a.set("avgDailyUploadsMin",n.avgDailyUploadsMin),n.avgDailyUploadsMax&&a.set("avgDailyUploadsMax",n.avgDailyUploadsMax),n.avgShortsDurationMin&&a.set("avgShortsDurationMin",n.avgShortsDurationMin),n.avgShortsDurationMax&&a.set("avgShortsDurationMax",n.avgShortsDurationMax),n.avgLongDurationMin&&a.set("avgLongDurationMin",n.avgLongDurationMin),n.avgLongDurationMax&&a.set("avgLongDurationMax",n.avgLongDurationMax),a},[p,g,M,e3,d,w]),{filterHash:e8,filterHashWithoutDate:e9}=function({sort:e,order:t,selectedDate:a,selectedCountries:n,categoryFilters:s,productionTypeFilters:r,shoppingOnly:i,search:l,gradeFilters:o,typeFilters:c,subscriberRanges:d,subscriberMin:u,subscriberMax:h,viewsIncrementMin:p,viewsIncrementMax:m,estimatedRevenueMin:x,estimatedRevenueMax:g,avgDailyUploadsMin:y,avgDailyUploadsMax:v,avgShortsDurationMin:b,avgShortsDurationMax:f,avgLongDurationMin:j,avgLongDurationMax:C}){let w={sort:e,order:t,selectedCountries:n,categoryFilters:s,productionTypeFilters:r,shoppingOnly:i,search:l,gradeFilters:o,typeFilters:c,subscriberRanges:d,subscriberMin:u,subscriberMax:h,viewsIncrementMin:p,viewsIncrementMax:m,estimatedRevenueMin:x,estimatedRevenueMax:g,avgDailyUploadsMin:y,avgDailyUploadsMax:v,avgShortsDurationMin:b,avgShortsDurationMax:f,avgLongDurationMin:j,avgLongDurationMax:C};return{filterHash:JSON.stringify({selectedDate:a,...w}),filterHashWithoutDate:JSON.stringify(w)}}({sort:p,order:g,selectedDate:y,selectedCountries:w,categoryFilters:N,productionTypeFilters:k,shoppingOnly:S,search:M,gradeFilters:v,typeFilters:b,subscriberRanges:f,subscriberMin:j,subscriberMax:C,viewsIncrementMin:D,viewsIncrementMax:R,estimatedRevenueMin:F,estimatedRevenueMax:_,avgDailyUploadsMin:I,avgDailyUploadsMax:T,avgShortsDurationMin:A,avgShortsDurationMax:$,avgLongDurationMin:P,avgLongDurationMax:O}),te=function({gradeFilters:e,typeFilters:t,subscriberRanges:n,subscriberMin:s,subscriberMax:r,categoryFilters:i,productionTypeFilters:l,shoppingOnly:o,search:c,viewsIncrementMin:d,viewsIncrementMax:u,estimatedRevenueMin:h,estimatedRevenueMax:p,avgDailyUploadsMin:m,avgDailyUploadsMax:x,avgShortsDurationMin:g,avgShortsDurationMax:y,avgLongDurationMin:v,avgLongDurationMax:b,onClearSearch:f,setPage:j,setGradeFilters:C,setTypeFilters:w,setSubscriberRanges:N,setSubscriberMin:k,setSubscriberMax:S,setCategoryFilters:M,setProductionTypeFilters:D,setVie
1wsIncrementMin:R,setViewsIncrementMax:F,setEstimatedRevenueMin:_,setEstimatedRevenueMax:I,setAvgDailyUploadsMin:T,setAvgDailyUploadsMax:A,setAvgShortsDurationMin:$,setAvgShortsDurationMax:P,setAvgLongDurationMin:O,setAvgLongDurationMax:z,toggleGrade:L,toggleType:U,toggleCategory:E,toggleProductionType:V,toggleShoppingOnly:B,toggleSubscriberRange:H}){return(0,a.useMemo)(()=>{let a=[];a.push(...(0,eU.buildMultiSelectChips)({values:e,totalCount:eA.GRADE_OPTIONS.length,groupLabel:"등급",keyPrefix:"grade",itemLabel:e=>`${e}등급`,onRemoveOne:L,onClearAll:()=>{j(1),C([])}})),a.push(...(0,eU.buildMultiSelectChips)({values:t,totalCount:eA.CHANNEL_TYPES.length,groupLabel:"유형",keyPrefix:"type",itemLabel:e=>eA.CHANNEL_TYPES.find(t=>t.value===e)?.label??e,onRemoveOne:U,onClearAll:()=>{j(1),w([])}})),a.push(...(0,eU.buildMultiSelectChips)({values:i,totalCount:eN.length,groupLabel:"카테고리",keyPrefix:"category",itemLabel:e=>{let t=e===ek?"미분류":(0,ef.categoryDisplayLabel)(e)??e;return`카테고리: ${t}`},onRemoveOne:E,onClearAll:()=>{j(1),M([])}})),a.push(...(0,eU.buildMultiSelectChips)({values:l,totalCount:eM.length,groupLabel:"제작유형",keyPrefix:"ptype",itemLabel:e=>{let t=eM.find(t=>t.value===e)?.label??e;return`제작유형: ${t}`},onRemoveOne:V,onClearAll:()=>{j(1),D([])}})),o&&a.push({key:"shopping",label:"쇼핑 채널",onDelete:B}),s||r?a.push({key:"manual-subs",label:`구독자 ${s||"0"} ~ ${r||"∞"}`,onDelete:()=>{j(1),k(""),S(""),N([...eT.subscriberRanges])}}):n.length>=eA.SUBSCRIBER_RANGES.length?a.push({key:"range-all",label:"구독자: 전체",onDelete:()=>{j(1),N([])}}):(function(e){let t=e.map(e=>({value:e,index:eA.SUBSCRIBER_RANGES.findIndex(t=>t.value===e)})).filter(e=>-1!==e.index).sort((e,t)=>e.index-t.index),a=[],n=[],s=()=>{if(0!==n.length){if(1===n.length){var e;let t;a.push({label:(e=n[0].value,t=eA.SUBSCRIBER_RANGES.find(t=>t.value===e),t?.label??e),ranges:[n[0].value]})}else{let e,[t]=n[0].value.split("-"),s=n[n.length-1].value.split("-")[1];e=0===Number(t)?`${eP(s)}만↓`:""===s?`${eP(t)}만~`:`${eP(t)}~${eP(s)}만`,a.push({label:e,ranges:n.map(e=>e.value)})}n=[]}};for(let e of t)0===n.length||e.index===n[n.length-1].index+1||s(),n.push(e);return s(),a})(n).forEach(e=>{a.push({key:`range-${e.ranges.join("_")}`,label:e.label,onDelete:()=>{if(1===e.ranges.length)return void H(e.ranges[0]);j(1),k(""),S("");let t=new Set(e.ranges);N(e=>e.filter(e=>!t.has(e)))}})});let G=(e,t,n,s)=>{a.push({key:e,label:t,onDelete:()=>{j(1),n(""),s("")}})};return(d||u)&&G("viewsIncrement",`조회수: ${d||"0"} ~ ${u||"∞"}`,R,F),(h||p)&&G("estimatedRevenue",`수익: ${h||"0"}만원 ~ ${p||"∞"}만원`,_,I),(m||x)&&G("avgDailyUploads",`업로드: ${m||"0"} ~ ${x||"∞"}개`,T,A),(g||y)&&G("avgShortsDuration",`숏폼: ${g||"0"} ~ ${y||"∞"}초`,$,P),(v||b)&&G("avgLongDuration",`롱폼: ${v||"0"} ~ ${b||"∞"}분`,O,z),c&&a.push({key:"search",label:`검색: ${c}`,onDelete:f}),a},[e,t,s,r,n,i,l,o,c,d,u,h,p,m,x,g,y,v,b,f,j,C,w,N,k,S,M,D,R,F,_,I,T,A,$,P,O,z,L,U,E,V,B,H])}({gradeFilters:v,typeFilters:b,subscriberRanges:f,subscriberMin:j,subscriberMax:C,categoryFilters:N,productionTypeFilters:k,shoppingOnly:S,search:M,viewsIncrementMin:D,viewsIncrementMax:R,estimatedRevenueMin:F,estimatedRevenueMax:_,avgDailyUploadsMin:I,avgDailyUploadsMax:T,avgShortsDurationMin:A,avgShortsDurationMax:$,avgLongDurationMin:P,avgLongDurationMax:O,onClearSearch:eb,setPage:L,setGradeFilters:B,setTypeFilters:H,setSubscriberRanges:G,setSubscriberMin:K,setSubscriberMax:J,setCategoryFilters:q,setProductionTypeFilters:W,setViewsIncrementMin:Z,setViewsIncrementMax:ee,setEstimatedRevenueMin:et,setEstimatedRevenueMax:ea,setAvgDailyUploadsMin:en,setAvgDailyUploadsMax:es,setAvgShortsDurationMin:er,setAvgShortsDurationMax:ei,setAvgLongDurationMin:el,setAvgLongDurationMax:eo,toggleGrade:eK,toggleType:eJ,toggleCategory:eQ,toggleProductionType:eq,toggleShoppingOnly:eW,toggleSubscriberRange:eZ}),tt=ew[ec]??ew.daily;return{initialized:ed,datesLoaded:eu,setDatesLoaded:eh,showFilters:o,setShowFilters:c,period:ec,setPeriod:z,page:h,setPage:L,sort:p,setSort:U,order:g,setOrder:E,selectedDate:y,setSelectedDate:V,availableDates:ep,gradeFilters:v,typeFilters:b,subscriberRanges:f,subscriberMin:j,subscriberMax:C,viewsIncrementMin:D,viewsIncrementMax:R,estimatedRevenueMin:F,estimatedRevenueMax:_,avgDailyUploadsMin:I,avgDailyUploadsMax:T,avgShortsDurationMin:A,avgShortsDurationMax:$,avgLongDurationMin:P,avgLongDurationMax:O,searchInput:ex,setSearchInput:eg,search:M,selectedCountries:w,setSelectedCountries:Q,countryOptions:d,categoryFilters:N,setCategoryFilters:q,productionTypeFilters:k,setProductionTypeFilters:W,shoppingOnly:S,setShoppingOnly:Y,isAdmin:i,sessionStatus:s,gradeOptions:l,presets:eC,selectedPresetId:eS,savePreset:eB,loadPreset:eH,deletePreset:eG,toggleGrade:eK,toggleType:eJ,toggleCategory:eQ,clearCategories:eY,toggleProductionType:eq,clearProductionTypes:eX,toggleShoppingOnly:eW,toggleSubscriberRange:eZ,onManualSubscriberChange:e0,applySearch:ev,clearSearch:eb,resetFilters:e1,resetQuickFilters:e2,resetDetailFilters:e5,applyRecommendedFilters:e4,clearRecommendedFilters:e6,setGradeFilters:B,setTypeFilters:H,setVie
1wsIncrementMin:Z,setViewsIncrementMax:ee,setEstimatedRevenueMin:et,setEstimatedRevenueMax:ea,setAvgDailyUploadsMin:en,setAvgDailyUploadsMax:es,setAvgShortsDurationMin:er,setAvgShortsDurationMax:ei,setAvgLongDurationMin:el,setAvgLongDurationMax:eo,filterChips:te,periodLabel:tt,buildApiParams:e7,filterHash:e8,filterHashWithoutDate:e9,allPeriodDatesRef:em}}({initialDailyDates:e}),{initialized:S,datesLoaded:M,period:D,buildApiParams:R,sort:F,setPage:_,setSort:I,setOrder:T}=k,A=(0,i.useQueryClient)(),{restoreScroll:$}=(0,l.useScrollRestore)("today-channel"),[P,O]=(0,x.useQueryState)("ch"),{data:z}=(0,n.useSession)(),L=!!z?.user?.memberId,U=b&&N?N:null;(0,a.useState)(()=>(U&&b&&(0,o.seedInfiniteFirstPage)(A,["today-channel",D,U],b,1),!0));let E=(0,a.useMemo)(()=>S&&M?R(D,1).toString():U??"",[S,M,D,R,U]),V=(0,a.useMemo)(()=>["today-channel",D,E],[D,E]),{data:B,isFetching:H,isFetchingNextPage:G,fetchNextPage:K,hasNextPage:J,error:Q,refetch:q}=(0,s.useInfiniteQuery)({queryKey:V,queryFn:async({pageParam:e})=>{let t=k.buildApiParams(k.period,e);try{return await (0,m.fetchJson)(`/api/today-channel?${t.toString()}`)}catch(e){throw Error(e instanceof Error?e.message:"데이터를 불러오지 못했습니다")}},enabled:k.initialized&&k.datesLoaded,initialPageParam:1,getNextPageParam:(e,t)=>t.reduce((e,t)=>e+(t.channels?.length??0),0)<(e.totalCount??0)?t.length+1:void 0,placeholderData:e=>e}),W=B?.pages??null,Y=H&&!G,X=Q?Q instanceof Error?Q.message:"네트워크 오류가 발생했습니다.":null,{data:Z}=(0,r.useQuery)({queryKey:["favorites"],queryFn:()=>(0,m.fetchJson)("/api/saved-channels"),enabled:L,staleTime:6e4}),ee=(0,a.useMemo)(()=>new Map((Z??[]).map(e=>[e.channelId,e.id])),[Z]),et=(0,a.useMemo)(()=>{let e=W?.flatMap(e=>e.channels??[])??[];return L?e.map(e=>({...e,isFavorite:ee.has(e.channelId)})):e},[W,L,ee]),{sentinelRef:ea}=(0,c.useInfiniteScroll)({hasNextPage:J,isFetchingNextPage:G,fetchNextPage:K}),en=W?.[0]?.capped??!1,es=W?.[0]?.historyLocked??!1,er=W?.[0]?.targetDate??null,{selectedDate:el,setSelectedDate:eo}=k,ed=!H&&S&&M?er:null;(0,a.useEffect)(()=>{ed&&ed!==el&&eo(ed)},[ed,el,eo]),(0,a.useEffect)(()=>{B&&$()},[B,$]);let eu=(0,a.useMemo)(()=>new Set(eC),[]),eh=(0,a.useCallback)(async(e,t)=>{let a=A.getQueryData(V);A.setQueryData(V,a=>a?{...a,pages:a.pages.map(a=>({...a,channels:(a.channels??[]).map(a=>a.channelId===e?{...a,productionType:t}:a)}))}:a);try{await (0,m.fetchJson)(`/api/today-channel/${e}/production-type`,{method:"PATCH",body:JSON.stringify({productionType:t})}),g.toast.success("제작유형 수정됨")}catch{a&&A.setQueryData(V,a),g.toast.error("제작유형 수정 실패")}},[A,V]),ep=(0,a.useCallback)(e=>{(_(1),F===e)?T(e=>"desc"===e?"asc":"desc"):(I(e),T("desc"))},[F,_,I,T]),em="grade"===k.sort||"subscriberCount"===k.sort||"dailySubs"===k.sort||"dailyViews"===k.sort||"estimatedRevenue"===k.sort||"avgDailyUploads"===k.sort||"avgLongDuration"===k.sort||"avgShortsDuration"===k.sort?k.sort:void 0,ex=k.gradeFilters.length===eD.length&&eD.every(e=>k.gradeFilters.includes(e))&&k.subscriberRanges.length===eF.length&&eF.every(e=>k.subscriberRanges.includes(e))&&k.selectedCountries.length===e_.length&&e_.every(e=>k.selectedCountries.includes(e))&&k.typeFilters.length===eR.length&&eR.every(e=>k.typeFilters.includes(e))&&k.productionTypeFilters.length===eI.length&&eI.every(e=>k.productionTypeFilters.includes(e))&&!k.subscriberMin&&!k.subscriberMax;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.PageToolbar,{children:(0,t.jsxs)(y.PageFilterBar,{search:{value:k.searchInput,onChange:e=>{let{clearedNarrowing:t}=(0,d.resolveSearchCommit)({key:"search",applied:k.search,narrowing:te,next:e});t&&O(null),k.setSearchInput(e),k.applySearch(e)},placeholder:"채널명 검색"},children:[k.availableDates.length>0&&(0,t.jsx)("span",{title:es?"과거 날짜 조회는 Pro 전용":void 0,children:(0,t.jsx)(C.Select,{options:k.availableDates,value:k.selectedDate??"",onChange:k.setSelectedDate,disabled:es,size:"sm",icon:es?(0,t.jsx)(h.Lock,{className:"size-4"}):(0,t.jsx)(u.CalendarDays,{className:"size-4"}),className:"w-40"})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"whitespace-nowrap text-xs font-medium text-secondary-700 dark:text-secondary-200",children:"추천 조건"}),(0,t.jsx)(w.Switch,{checked:ex,onCheckedChange:e=>e?k.applyRecommendedFilters():k.clearRecommendedFilters(),"aria-label":"추천 조건 적용"})]}
1),(0,t.jsx)(j,{active:k.showFilters,onClick:()=>k.setShowFilters(e=>!e)})]})}),(0,t.jsx)(e8,{f:k}),k.datesLoaded&&!Y&&(W||X)?X?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[(0,t.jsx)("p",{className:"text-red-500 text-sm",children:X}),(0,t.jsxs)("button",{onClick:()=>q(),className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-background bg-foreground hover:bg-foreground/90 rounded-lg transition-colors",children:[(0,t.jsx)(p.RefreshCw,{size:14})," 다시 시도"]})]}):0===et.length?(0,t.jsxs)("div",{className:"text-center py-12 text-secondary-500",children:[(0,t.jsx)("p",{children:"조건에 맞는 데이터가 없습니다."}),k.shoppingOnly&&(0,t.jsxs)("div",{className:"mt-3 flex flex-col items-center gap-2",children:[(0,t.jsx)("p",{className:"text-sm",children:"쇼핑 채널만 조건이 적용돼 있습니다."}),(0,t.jsx)(f.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>k.toggleShoppingOnly(),children:"쇼핑 조건 풀기"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(ei,{channels:et,showFavoriteAction:!0,periodLabel:k.periodLabel,sortKey:em,sortOrder:k.order,onSortChange:ep,isAdmin:k.isAdmin,onUpdateProductionType:eh,visibleColumns:eu,onSelectChannel:e=>void O(e)})}),J&&(0,t.jsx)("div",{ref:ea,className:"flex h-10 items-center justify-center text-sm text-secondary-400",children:G?"불러오는 중...":""}),en&&(0,t.jsx)(ec,{isLoggedIn:L,sampleChannels:et.slice(-4),startRank:et.length+1})]}):(0,t.jsx)(e9,{}),(0,t.jsx)(ev,{channel:P?et.find(e=>e.channelId===P)??null:null,periodLabel:k.periodLabel,open:!!P,onOpenChange:e=>{e||O(null)}})]})}e.s(["TodayChannelTabs",0,function({initialDailyDates:e=null,initialFirstPage:a=null,initialFirstPageParams:n=null}={}){return(0,t.jsx)("div",{className:"space-y-6",children:(0,t.jsx)("div",{children:(0,t.jsx)(tt,{initialDailyDates:e,initialFirstPage:a,initialFirstPageParams:n})})})}],21427)}]);

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.