@funhub/platform 0.2.29 → 0.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/biz.d.mts +6 -4
  2. package/dist/biz.mjs +1 -1
  3. package/dist/cli/init/create-client.mjs +1 -1
  4. package/dist/cli/init/shared/constants.mjs +1 -1
  5. package/dist/cli/init/shared/create-project.mjs +1 -1
  6. package/dist/cli/init/shared/prompts.mjs +1 -1
  7. package/dist/cli/init/shared/template.mjs +1 -1
  8. package/dist/cli.mjs +2 -2
  9. package/dist/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
  10. package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
  11. package/dist/components/biz/business/advertisement/ad-match.d.mts +0 -7
  12. package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
  13. package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
  14. package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +0 -3
  15. package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +0 -6
  16. package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
  17. package/dist/components/biz/business/channel-list/client.mjs +1 -1
  18. package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
  19. package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
  20. package/dist/components/biz/business/detail/shared/use-video-detail-webview-bridge.mjs +1 -1
  21. package/dist/components/biz/business/detail/shared/video-hero.mjs +1 -1
  22. package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
  23. package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
  24. package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
  25. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
  26. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  27. package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
  28. package/dist/components/biz/business/image-text-recommend/client.mjs +1 -1
  29. package/dist/components/biz/business/index.d.mts +5 -3
  30. package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
  31. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  32. package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
  33. package/dist/components/biz/business/marquee/client.mjs +1 -1
  34. package/dist/components/biz/business/profile/index.d.mts +5 -3
  35. package/dist/components/biz/business/profile/profile-header/client.d.mts +4 -2
  36. package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
  37. package/dist/components/biz/business/profile/profile-header/index.d.mts +4 -2
  38. package/dist/components/biz/business/profile/profile-header/material.d.mts +48 -6
  39. package/dist/components/biz/business/profile/profile-header/material.mjs +1 -1
  40. package/dist/components/biz/business/profile/profile-header/my-client.d.mts +12 -0
  41. package/dist/components/biz/business/profile/profile-header/my-client.mjs +2 -0
  42. package/dist/components/biz/business/profile/profile-header/my-profile-actions.mjs +2 -0
  43. package/dist/components/biz/business/profile/profile-header/my-profile-header.mjs +2 -0
  44. package/dist/components/biz/business/profile/profile-header/schema.d.mts +15 -5
  45. package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
  46. package/dist/components/biz/business/profile/profile-header/shared.mjs +2 -0
  47. package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
  48. package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
  49. package/dist/components/biz/business/profile/profile-header/visitor-client.d.mts +12 -0
  50. package/dist/components/biz/business/profile/profile-header/visitor-client.mjs +2 -0
  51. package/dist/components/biz/business/profile/profile-header/visitor-profile-actions.mjs +2 -0
  52. package/dist/components/biz/business/profile/profile-header/visitor-profile-header.mjs +2 -0
  53. package/dist/components/biz/business/profile/profile-main/client.d.mts +2 -0
  54. package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
  55. package/dist/components/biz/business/profile/profile-main/index.d.mts +2 -2
  56. package/dist/components/biz/business/profile/profile-main/material.d.mts +3 -0
  57. package/dist/components/biz/business/profile/profile-main/schema.d.mts +9 -3
  58. package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
  59. package/dist/components/biz/business/profile/profile-main/shell.d.mts +7 -0
  60. package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
  61. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.d.mts +5 -1
  62. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
  63. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +1 -1
  64. package/dist/components/biz/business/profile/profile-main/tabs/editor-preview-waterfall.mjs +2 -0
  65. package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.d.mts +5 -1
  66. package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
  67. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +5 -1
  68. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
  69. package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.d.mts +3 -0
  70. package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.mjs +1 -1
  71. package/dist/components/biz/business/profile/profile-main/variants.d.mts +28 -3
  72. package/dist/components/biz/business/profile/profile-main/variants.mjs +1 -1
  73. package/dist/components/biz/business/search-history/client.mjs +1 -1
  74. package/dist/components/biz/business/search-input/client.mjs +1 -1
  75. package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
  76. package/dist/components/biz/business/tab-bar/client.mjs +1 -1
  77. package/dist/components/biz/business/text-recommend/client.mjs +1 -1
  78. package/dist/components/common/analytics-init/page-lifecycle-tracker.mjs +1 -1
  79. package/dist/components/common/background-preview-modal/background-preview-modal.mjs +1 -1
  80. package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +1 -1
  81. package/dist/components/common/popup-video/index.mjs +1 -1
  82. package/dist/components/common/series-episodes/index.mjs +1 -1
  83. package/dist/components/common/tab-bar/index.mjs +1 -1
  84. package/dist/components/common/top-nav-bar/client.mjs +1 -1
  85. package/dist/components/common/video-player/style.module.mjs +0 -4
  86. package/dist/components/common/video-player/video-blind-ad-overlay.mjs +1 -1
  87. package/dist/components/common/video-player/video-preroll-ad-overlay.mjs +1 -1
  88. package/dist/components/pages/collection-add/page.mjs +1 -1
  89. package/dist/components/pages/edit/page.mjs +1 -1
  90. package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
  91. package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
  92. package/dist/components/pages/profile/layout.d.mts +2 -0
  93. package/dist/components/pages/profile/page.mjs +1 -1
  94. package/dist/components/pages/search/hot-recommend.mjs +1 -1
  95. package/dist/components/pages/search/hot-search.mjs +1 -1
  96. package/dist/components/pages/search/page-client.mjs +1 -1
  97. package/dist/components/pages/search/search-result/search-all.mjs +1 -1
  98. package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
  99. package/dist/components/pages/search/top-header.mjs +1 -1
  100. package/dist/components/pages/search-result/page-client.mjs +1 -1
  101. package/dist/components/pages/search-result/search-all.mjs +1 -1
  102. package/dist/components/pages/search-result/search-tab.mjs +1 -1
  103. package/dist/components/pages/search-result/search-user.mjs +1 -1
  104. package/dist/components/pages/search-result/top-header.mjs +1 -1
  105. package/dist/components/pages/settings/_components/settings.mjs +1 -1
  106. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  107. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  108. package/dist/components/pages/video-list/video-list-recommend-item.mjs +1 -1
  109. package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
  110. package/dist/components/ui/badge.d.mts +1 -1
  111. package/dist/components/ui/button.d.mts +2 -2
  112. package/dist/components/ui/empty.d.mts +1 -1
  113. package/dist/components/ui/item.d.mts +1 -1
  114. package/dist/hooks/use-content-operate.mjs +1 -1
  115. package/dist/i18n/locales/en.mjs +1 -1
  116. package/dist/i18n/locales/zh-CN.mjs +1 -1
  117. package/dist/materials.d.mts +2 -2
  118. package/dist/materials.mjs +1 -1
  119. package/dist/service/advertisement.d.mts +0 -4
  120. package/dist/service/advertisement.mjs +1 -1
  121. package/dist/utils/common.mjs +1 -1
  122. package/dist/utils/http.mjs +1 -1
  123. package/dist/utils/tracking.d.mts +11 -3
  124. package/dist/utils/tracking.mjs +1 -1
  125. package/dist/utils/use-compatible-router.mjs +1 -1
  126. package/dist/utils.d.mts +2 -2
  127. package/dist/utils.mjs +1 -1
  128. package/package.json +1 -1
  129. package/theme.css +0 -47
@@ -1,6 +1,7 @@
1
1
 
2
2
  import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
3
3
  import "../../../../../../../utils.mjs";
4
+ import { ProfileMainContentType } from "../../variants.mjs";
4
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
5
6
 
6
7
  //#region components/biz/business/profile/profile-main/tabs/history-tab/client.d.ts
@@ -11,6 +12,8 @@ interface HistoryTabProps {
11
12
  targetUserId?: string;
12
13
  /** Query Key 前缀 */
13
14
  queryKeyPrefix?: Array<string | number | undefined>;
15
+ /** 二级标签配置。 */
16
+ contentTypes?: ProfileMainContentType[];
14
17
  }
15
18
  /**
16
19
  * 浏览历史 Tab
@@ -18,7 +21,8 @@ interface HistoryTabProps {
18
21
  declare function HistoryTab({
19
22
  mode,
20
23
  targetUserId,
21
- queryKeyPrefix
24
+ queryKeyPrefix,
25
+ contentTypes
22
26
  }: HistoryTabProps): react_jsx_runtime0.JSX.Element;
23
27
  //#endregion
24
28
  export { HistoryTab, HistoryTabProps };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionBatchClearBrowse as t}from"../../../../../../../service/generated/client.mjs";import{Button as n}from"../../../../../../ui/button.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Text as a}from"../../../../../../ui/text.mjs";import{useMutation as o,usePaginated as s,useUpdateRequest as c}from"../../../../../../../hooks/query/use-query.mjs";import{PostList as l}from"../../../../../../common/list/post-list/post-list.mjs";import{trackProfilePageClick as u}from"../../../tracking.mjs";import{ProfileMainEmptyState as d}from"../../empty-state.mjs";import{CollectVideoWaterfall as f}from"../collect-tab/video-waterfall.mjs";import{getHistoryData as ee,likeContentType as p}from"../../utils.mjs";import{toast as m}from"sonner";import{useEffect as h,useMemo as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{parseAsString as x,useQueryState as S}from"nuqs";function C(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n.title||n.text||``,coverImage:n.cover_image_thumbnail||n.cover_image||n.cover_horizontal_image_thumbnail||void 0,publishTime:r}}function te(e){let{detail:t,content_play_progress:n}=e,{user_info:r,info:i,statics_cnt:a,publish_time:o,parent_content_info:s}=t,c=String(i?.img_type||``).trim().toLowerCase(),l=c===`long`||!c&&!!i?.cover_horizontal_image_thumbnail,u=l?i?.cover_horizontal_image_thumbnail||i?.img_x||i?.cover_image_thumbnail||i?.img_y||i?.cover_image||``:i?.cover_image_thumbnail||i?.img_y||i?.cover_horizontal_image_thumbnail||i?.img_x||i?.cover_image||``,d=String(i?.description||``).trim();return{is_more_link:i.is_more_link,id:e.id,title:i.title||i.text||i.name||``,coverImage:u,duration:Number(i.video_duration??0),progress:n?.percent??0,seriesNum:n?.series_num,authorName:r.name,viewCount:i?.play_count??a?.browse_cnt??0,publishTime:o,type:s?.type,imgType:c||(l?`long`:`short`),score:i?.score,description:d}}function w(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}const T=[`video`,`post`];function E({mode:E=`renderer`,targetUserId:D,queryKeyPrefix:O}){let k=b(`components.pages.profile.components.tabs`),A=E===`renderer`,j=O??[],[M,N]=S(`historyTab`,x.withDefault(`video`)),P=g(()=>T.includes(M)?M:`video`,[M]),[F,I]=_(!1),[L,R]=_(()=>new Set),z=e(e=>e.userId),B=c(),V=[...j,`user-history-video`],H=[...j,`user-history-post`],U=s({key:V,initialPageParam:1,async queryFn(e){return ee({targetUserId:D,page:e,contentType:p.video})},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=s({key:H,initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=P===`video`?U:W,K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(te))??[],q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(C))??[],J=P===`video`?K:q,Y=P===`video`?K.length===0&&!G.isFetching:q.length===0&&!G.isFetching,X=new Set(J.map(e=>e.id)),Z=P===`video`,{mutateAsync:ne,isPending:Q}=o(async e=>await t({app_id:0,user_id:z,content_type:e.contentType,content_ids:e.contentIds}));h(()=>{R(new Set)},[P]),h(()=>{M!==P&&N(P)},[P,M,N]);let re=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ie=()=>{L.size===X.size&&X.size>0?R(new Set):R(new Set(X))},ae=async()=>{if(!(L.size===0||Q)){if(!z){m.error(k(`historyTab.pleaseLogin`));return}try{let e=Array.from(L),t=await ne({contentIds:e,contentType:Z?1:2});if(t.code===0){m.success(k(`historyTab.historyDeletedSuccess`));let t=new Set(e);B(Z?V:H,e=>w(e,t,e=>e.id)),R(new Set),I(!1)}else m.error(t.message||k(`historyTab.deleteFailed`))}catch(e){console.error(`删除浏览记录失败`,e),m.error(k(`historyTab.operationFailed`))}}},$=async()=>{A&&await G.fetchNextPage()};return y(r,{children:[v(r,{className:``,onClick:e=>{u(e,`content_item`)},children:P===`video`?Y?v(d,{text:k(`historyTab.emptyContent`)}):v(f,{list:K,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`historyTab.emptyContent`)}):Y?v(d,{text:k(`historyTab.emptyContent`)}):v(l,{list:q,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`historyTab.emptyContent`),isEditMode:F,selectedIds:L,onToggleSelection:re})}),F&&y(r,{className:`fixed left-0 z-10 flex w-full items-center justify-between bg-bg1 px-3 py-2 bottom-[var(--tab-bar-occupied-height)]`,children:[y(r,{className:`flex items-center gap-2`,children:[v(i,{checked:L.size===X.size&&X.size>0,onCheckedChange:ie}),v(a,{className:`text-sm text-text1`,children:k(`historyTab.selectAll`)})]}),v(n,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Q,onClick:ae,children:k(Q?`historyTab.processing`:`historyTab.delete`)})]})]})}export{E as HistoryTab};
2
+ "use client";import{cn as e}from"../../../../../../../utils/cn.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionBatchClearBrowse as n}from"../../../../../../../service/generated/client.mjs";import{Button as r}from"../../../../../../ui/button.mjs";import{Box as i}from"../../../../../../ui/box.mjs";import{Checkbox as a}from"../../../../../../ui/checkbox.mjs";import{Text as o}from"../../../../../../ui/text.mjs";import{Tabs as s,TabsList as c,TabsTrigger as l}from"../../../../../../ui/tabs.mjs";import{useMutation as u,usePaginated as d,useUpdateRequest as f}from"../../../../../../../hooks/query/use-query.mjs";import{PostList as p}from"../../../../../../common/list/post-list/post-list.mjs";import{trackProfilePageClick as m}from"../../../tracking.mjs";import{ProfileMainEmptyState as h}from"../../empty-state.mjs";import{getProfileMainSecondaryTabOptions as ee}from"../../variants.mjs";import{EditorPreviewWaterfall as te}from"../editor-preview-waterfall.mjs";import{CollectVideoWaterfall as ne}from"../collect-tab/video-waterfall.mjs";import{getHistoryData as re,likeContentType as ie}from"../../utils.mjs";import{toast as g}from"sonner";import{useEffect as _,useMemo as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{useTranslations as ae}from"next-intl";import{parseAsString as oe,useQueryState as S}from"nuqs";function C(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n.title||n.text||``,coverImage:n.cover_image_thumbnail||n.cover_image||n.cover_horizontal_image_thumbnail||void 0,publishTime:r}}function w(e){let{detail:t,content_play_progress:n}=e,{user_info:r,info:i,statics_cnt:a,publish_time:o,parent_content_info:s}=t,c=(Array.isArray(i?.tags)?i.tags:[]).map(e=>typeof e==`string`?e.trim():e&&typeof e==`object`&&`name`in e?String(e.name||``).trim():``).find(Boolean)||``,l=String(i?.img_type||``).trim().toLowerCase(),u=l===`long`||!l&&!!i?.cover_horizontal_image_thumbnail,d=u?i?.cover_horizontal_image_thumbnail||i?.img_x||i?.cover_image_thumbnail||i?.img_y||i?.cover_image||``:i?.cover_image_thumbnail||i?.img_y||i?.cover_horizontal_image_thumbnail||i?.img_x||i?.cover_image||``,f=String(i?.description||``).trim()||c;return{is_more_link:i.is_more_link,id:e.id,title:i.title||i.text||i.name||``,coverImage:d,duration:Number(i.video_duration??0),progress:n?.percent??0,seriesNum:n?.series_num,authorName:r.name,viewCount:i?.play_count??a?.browse_cnt??0,publishTime:o,type:s?.type,imgType:l||(u?`long`:`short`),score:i?.score,description:f}}function T(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function E(){return e(`!flex !items-center !flex-none !h-auto !w-auto !rounded-[4px] !px-2 !py-[5px] !bg-[var(--color-surface-chip-gray20)] !text-[12px] !font-normal !leading-[14px] !text-text1 hover:!text-text1`,`data-[active]:!text-text1 data-[state=active]:!text-text1`,`data-[active]:!bg-[image:var(--gradient-action-button)]`,`data-[state=active]:!bg-[image:var(--gradient-action-button)]`)}function D({mode:e=`renderer`,targetUserId:D,queryKeyPrefix:O,contentTypes:k}){let A=ae(`components.pages.profile.components.tabs`),j=e===`renderer`,M=O??[],N=v(()=>ee(k),[k]),[P,F]=S(`historyTab`,oe.withDefault(`video`)),I=v(()=>{let e=N[0]??`video`;return N.includes(P??``)?P:e},[N,P]),[L,se]=y(!1),[R,z]=y(()=>new Set),B=t(e=>e.userId),V=f(),H=[...M,`user-history-video`],U=[...M,`user-history-post`],W=d({key:H,initialPageParam:1,async queryFn(e){return re({targetUserId:D,page:e,contentType:ie.video})},options:{staleTime:0,enabled:j},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=d({key:U,initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},options:{staleTime:0,enabled:j},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),K=I===`video`?W:G,q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(w))??[],J=G.data?.pages.flatMap(e=>(e.data?.list??[]).map(C))??[],ce=I===`video`?q:J,Y=I===`video`?q.length===0&&!K.isFetching:J.length===0&&!K.isFetching,X=new Set(ce.map(e=>e.id)),Z=I===`video`,{mutateAsync:le,isPending:Q}=u(async e=>await n({app_id:0,user_id:B,content_type:e.contentType,content_ids:e.contentIds}));_(()=>{z(new Set)},[I]),_(()=>{P!==I&&F(I)},[I,P,F]);let ue=e=>{z(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},de=()=>{R.size===X.size&&X.size>0?z(new Set):z(new Set(X))},fe=async()=>{if(!(R.size===0||Q)){if(!B){g.error(A(`historyTab.pleaseLogin`));return}try{let e=Array.from(R),t=await le({contentIds:e,contentType:Z?1:2});if(t.code===0){g.success(A(`historyTab.historyDeletedSuccess`));let t=new Set(e);V(Z?H:U,e=>T(e,t,e=>e.id)),z(new Set),se(!1)}else g.error(t.message||A(`historyTab.deleteFailed`))}catch(e){console.error(`删除浏览记录失败`,e),g.error(A(`historyTab.operationFailed`))}}},$=async()=>{j&&await K.fetchNextPage()};return x(i,{children:[b(i,{className:`flex items-center justify-between`,children:N.length>0&&b(s,{value:I,onValueChange:e=>{F(e)},children:x(c,{variant:`tag`,className:`!h-auto !gap-4 !p-0`,children:[N.includes(`video`)&&b(l,{value:`video`,className:E(),children:A(`historyTab.video`)}),N.includes(`novel`)&&b(l,{value:`novel`,className:E(),children:A(`historyTab.novel`)}),N.includes(`comic`)&&b(l,{value:`comic`,className:E(),children:A(`historyTab.comic`)}),N.includes(`post`)&&b(l,{value:`post`,className:E(),children:A(`historyTab.posts`)})]})})}),b(i,{className:``,onClick:e=>{m(e,`content_item`)},children:!j&&(I===`video`||I===`post`||I===`novel`||I===`comic`)?b(te,{contentType:I}):I===`video`?Y?b(h,{text:A(`historyTab.emptyContent`)}):b(ne,{list:q,loading:K.isFetching,hasMore:K.hasNextPage??!1,loadMore:$,emptyText:A(`historyTab.emptyContent`)}):I===`post`?Y?b(h,{text:A(`historyTab.emptyContent`)}):b(p,{list:J,loading:K.isFetching,hasMore:K.hasNextPage??!1,loadMore:$,emptyText:A(`historyTab.emptyContent`),isEditMode:L,selectedIds:R,onToggleSelection:ue}):b(h,{text:A(`historyTab.emptyContent`)})}),L&&x(i,{className:`fixed left-0 z-10 flex w-full items-center justify-between bg-bg1 px-3 py-2 bottom-[var(--tab-bar-occupied-height)]`,children:[x(i,{className:`flex items-center gap-2`,children:[b(a,{checked:R.size===X.size&&X.size>0,onCheckedChange:de}),b(o,{className:`text-sm text-text1`,children:A(`historyTab.selectAll`)})]}),b(r,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:R.size>0?`default`:`outline`,disabled:R.size===0||Q,onClick:fe,children:A(Q?`historyTab.processing`:`historyTab.delete`)})]})]})}export{D as HistoryTab};
@@ -2,6 +2,7 @@
2
2
  import { CommunityContentInfo } from "../../../../../../../types/community-types.mjs";
3
3
  import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
4
4
  import "../../../../../../../utils.mjs";
5
+ import { ProfileMainContentType } from "../../variants.mjs";
5
6
  import * as react_jsx_runtime0 from "react/jsx-runtime";
6
7
 
7
8
  //#region components/biz/business/profile/profile-main/tabs/like-tab/client.d.ts
@@ -76,12 +77,15 @@ interface LikeTabProps {
76
77
  queryKeyPrefix?: Array<string | number | undefined>;
77
78
  /** 是否为本人视角。 */
78
79
  isMine?: boolean;
80
+ /** 二级标签配置。 */
81
+ contentTypes?: ProfileMainContentType[];
79
82
  }
80
83
  declare function LikeTab({
81
84
  mode,
82
85
  targetUserId,
83
86
  queryKeyPrefix,
84
- isMine: _isMine
87
+ isMine: _isMine,
88
+ contentTypes
85
89
  }: LikeTabProps): react_jsx_runtime0.JSX.Element;
86
90
  //#endregion
87
91
  export { LikeDetailItem, LikeTab, LikeTabProps };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionUnifiedBatchLikeDislike as t}from"../../../../../../../service/generated/client.mjs";import{Button as n}from"../../../../../../ui/button.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Text as a}from"../../../../../../ui/text.mjs";import{useMutation as o,usePaginated as s,useUpdateRequest as c}from"../../../../../../../hooks/query/use-query.mjs";import{PostList as l}from"../../../../../../common/list/post-list/post-list.mjs";import{trackProfilePageClick as u}from"../../../tracking.mjs";import{ProfileMainEmptyState as d}from"../../empty-state.mjs";import{CollectVideoWaterfall as f}from"../collect-tab/video-waterfall.mjs";import{getLikeData as ee,likeContentType as p}from"../../utils.mjs";import{toast as m}from"sonner";import{useEffect as h,useMemo as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{parseAsString as x,useQueryState as te}from"nuqs";function S(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function C(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n?.name||n?.text||n?.content||``,coverImage:n?.cover_image_thumbnail||n?.cover_image||n?.cover_horizontal_image_thumbnail||``,publishTime:r??0}}function w(e){let{detail:t}=e,{user_info:n,info:r,statics_cnt:i,publish_time:a,parent_content_info:o}=t,s=String(r?.img_type||``).trim().toLowerCase(),c=s===`long`||!s&&!!r?.cover_horizontal_image_thumbnail,l=c?r?.cover_horizontal_image_thumbnail||r?.img_x||r?.cover_image_thumbnail||r?.img_y||r?.cover_image||``:r?.cover_image_thumbnail||r?.img_y||r?.cover_horizontal_image_thumbnail||r?.img_x||r?.cover_image||``,u=String(r?.description||``).trim();return{id:e.id,is_more_link:r?.is_more_link||!1,title:r?.name||r?.text||r?.content||``,coverImage:l,duration:Number(r?.video_duration??0),progress:e.content_play_progress?.percent??0,seriesNum:e.content_play_progress?.series_num,authorName:n?.name||``,viewCount:r?.play_count??i?.browse_cnt??0,publishTime:a??0,type:o?.type,imgType:s||(c?`long`:`short`),score:r?.score,description:u}}const T=[`video`,`post`];function E({mode:E=`renderer`,targetUserId:D,queryKeyPrefix:O,isMine:ne=!1}){let k=b(`components.pages.profile.components.tabs`),A=E===`renderer`,j=O??[],[M,N]=te(`likeTab`,x.withDefault(`video`)),P=g(()=>T.includes(M)?M:`video`,[M]),[F,I]=_(!1),[L,R]=_(()=>new Set),z=e(e=>e.userId),B=c(),V=[...j,`user-like-video`],H=[...j,`user-like-post`],U=s({key:V,initialPageParam:1,async queryFn(e){return ee({targetUserId:D,page:e,contentType:p.video})},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=s({key:H,options:{staleTime:0,enabled:A},initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=P===`video`?U:W,K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(w))??[],q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(C))??[],J=P===`video`?K:q,Y=P===`video`?K.length===0&&!G.isFetching:q.length===0&&!G.isFetching,X=new Set(J.map(e=>e.id)),Z=P===`video`,{mutateAsync:re,isPending:Q}=o(async e=>await t({app_id:0,user_id:z,action:`cancel_like`,content_ids:e,content_type:Z?1:2}));h(()=>{R(new Set)},[P]),h(()=>{M!==P&&N(P)},[P,M,N]);let ie=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ae=()=>{L.size===X.size&&X.size>0?R(new Set):R(new Set(X))},oe=async()=>{if(!(L.size===0||Q)){if(!z){m.error(k(`likeTab.pleaseLogin`));return}try{let e=Array.from(L),t=await re(e);if(t.code===0){m.success(k(`likeTab.unlikedSuccess`));let t=new Set(e);B(Z?V:H,e=>S(e,t,e=>e.id)),R(new Set),I(!1)}else m.error(t.message||k(`likeTab.unlikeFailed`))}catch(e){console.error(`取消点赞失败`,e),m.error(k(`likeTab.operationFailed`))}}},$=async()=>{A&&await G.fetchNextPage()};return y(r,{children:[v(r,{className:``,onClick:e=>{u(e,`content_item`)},children:P===`video`?Y?v(d,{text:k(`likeTab.emptyContent`)}):v(f,{list:K,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`likeTab.emptyContent`)}):Y?v(d,{text:k(`likeTab.emptyContent`)}):v(l,{list:q,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`likeTab.emptyContent`),isEditMode:F,selectedIds:L,onToggleSelection:ie})}),F&&y(r,{className:`fixed left-0 z-10 flex w-full items-center justify-between bg-bg1 px-3 py-2 bottom-[var(--tab-bar-occupied-height)]`,children:[y(r,{className:`flex items-center gap-2`,children:[v(i,{checked:L.size===X.size&&X.size>0,onCheckedChange:ae}),v(a,{className:`text-sm text-text1`,children:k(`likeTab.selectAll`)})]}),v(n,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Q,onClick:oe,children:k(Q?`likeTab.processing`:`likeTab.delete`)})]})]})}export{E as LikeTab};
2
+ "use client";import{cn as e}from"../../../../../../../utils/cn.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionUnifiedBatchLikeDislike as n}from"../../../../../../../service/generated/client.mjs";import{Button as r}from"../../../../../../ui/button.mjs";import{Box as i}from"../../../../../../ui/box.mjs";import{Checkbox as a}from"../../../../../../ui/checkbox.mjs";import{Text as o}from"../../../../../../ui/text.mjs";import{Tabs as s,TabsList as c,TabsTrigger as l}from"../../../../../../ui/tabs.mjs";import{useMutation as u,usePaginated as d,useUpdateRequest as f}from"../../../../../../../hooks/query/use-query.mjs";import{PostList as p}from"../../../../../../common/list/post-list/post-list.mjs";import{trackProfilePageClick as ee}from"../../../tracking.mjs";import{ProfileMainEmptyState as m}from"../../empty-state.mjs";import{getProfileMainSecondaryTabOptions as te}from"../../variants.mjs";import{EditorPreviewWaterfall as h}from"../editor-preview-waterfall.mjs";import{CollectVideoWaterfall as g}from"../collect-tab/video-waterfall.mjs";import{getLikeData as ne,likeContentType as re}from"../../utils.mjs";import{toast as _}from"sonner";import{useEffect as v,useMemo as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{useTranslations as ie}from"next-intl";import{parseAsString as C,useQueryState as ae}from"nuqs";function oe(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function w(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n?.name||n?.text||n?.content||``,coverImage:n?.cover_image_thumbnail||n?.cover_image||n?.cover_horizontal_image_thumbnail||``,publishTime:r??0}}function T(e){let{detail:t}=e,{user_info:n,info:r,statics_cnt:i,publish_time:a,parent_content_info:o}=t,s=String(r?.img_type||``).trim().toLowerCase(),c=s===`long`||!s&&!!r?.cover_horizontal_image_thumbnail,l=c?r?.cover_horizontal_image_thumbnail||r?.img_x||r?.cover_image_thumbnail||r?.img_y||r?.cover_image||``:r?.cover_image_thumbnail||r?.img_y||r?.cover_horizontal_image_thumbnail||r?.img_x||r?.cover_image||``;console.log(r,222222);let u=String(r?.description||``).trim();return{id:e.id,is_more_link:r?.is_more_link||!1,title:r?.name||r?.text||r?.content||``,coverImage:l,duration:Number(r?.video_duration??0),progress:e.content_play_progress?.percent??0,seriesNum:e.content_play_progress?.series_num,authorName:n?.name||``,viewCount:r?.play_count??i?.browse_cnt??0,publishTime:a??0,type:o?.type,imgType:s||(c?`long`:`short`),score:r?.score,description:u}}function E(){return e(`!flex !items-center !flex-none !h-auto !w-auto !rounded-[4px] !px-2 !py-[5px] !bg-[var(--color-surface-chip-gray20)] !text-[12px] !font-normal !leading-[14px] !text-text1 hover:!text-text1`,`data-[active]:!text-text1 data-[state=active]:!text-text1`,`data-[active]:!bg-[image:var(--gradient-action-button)]`,`data-[state=active]:!bg-[image:var(--gradient-action-button)]`)}function D({mode:e=`renderer`,targetUserId:D,queryKeyPrefix:se,isMine:ce=!1,contentTypes:O}){let k=ie(`components.pages.profile.components.tabs`),A=e===`renderer`,j=se??[],M=y(()=>te(O),[O]),[N,P]=ae(`likeTab`,C.withDefault(`video`)),F=y(()=>{let e=M[0]??`video`;return M.includes(N??``)?N:e},[M,N]),[I,le]=b(!1),[L,R]=b(()=>new Set),z=t(e=>e.userId),B=f(),V=[...j,`user-like-video`],H=[...j,`user-like-post`],U=d({key:V,initialPageParam:1,async queryFn(e){return ne({targetUserId:D,page:e,contentType:re.video})},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=d({key:H,options:{staleTime:0,enabled:A},initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=F===`video`?U:W,K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(T))??[],q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(w))??[],ue=F===`video`?K:q,J=F===`video`?K.length===0&&!G.isFetching:q.length===0&&!G.isFetching,Y=new Set(ue.map(e=>e.id)),X=F===`video`,{mutateAsync:Z,isPending:Q}=u(async e=>await n({app_id:0,user_id:z,action:`cancel_like`,content_ids:e,content_type:X?1:2}));v(()=>{R(new Set)},[F]),v(()=>{N!==F&&P(F)},[F,N,P]);let de=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},fe=()=>{L.size===Y.size&&Y.size>0?R(new Set):R(new Set(Y))},pe=async()=>{if(!(L.size===0||Q)){if(!z){_.error(k(`likeTab.pleaseLogin`));return}try{let e=Array.from(L),t=await Z(e);if(t.code===0){_.success(k(`likeTab.unlikedSuccess`));let t=new Set(e);B(X?V:H,e=>oe(e,t,e=>e.id)),R(new Set),le(!1)}else _.error(t.message||k(`likeTab.unlikeFailed`))}catch(e){console.error(`取消点赞失败`,e),_.error(k(`likeTab.operationFailed`))}}},$=async()=>{A&&await G.fetchNextPage()};return S(i,{children:[x(i,{className:`flex items-center justify-between`,children:M.length>0&&x(s,{value:F,onValueChange:e=>{P(e)},children:S(c,{variant:`tag`,className:`!h-auto !gap-4 !p-0`,children:[M.includes(`video`)&&x(l,{value:`video`,className:E(),children:k(`likeTab.video`)}),M.includes(`novel`)&&x(l,{value:`novel`,className:E(),children:k(`likeTab.novel`)}),M.includes(`comic`)&&x(l,{value:`comic`,className:E(),children:k(`likeTab.comic`)}),M.includes(`post`)&&x(l,{value:`post`,className:E(),children:k(`likeTab.posts`)})]})})}),x(i,{className:``,onClick:e=>{ee(e,`content_item`)},children:!A&&(F===`video`||F===`post`||F===`novel`||F===`comic`)?x(h,{contentType:F}):F===`video`?J?x(m,{text:k(`likeTab.emptyContent`)}):x(g,{list:K,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`likeTab.emptyContent`)}):F===`post`?J?x(m,{text:k(`likeTab.emptyContent`)}):x(p,{list:q,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`likeTab.emptyContent`),isEditMode:I,selectedIds:L,onToggleSelection:de}):x(m,{text:k(`likeTab.emptyContent`)})}),I&&S(i,{className:`fixed left-0 z-10 flex w-full items-center justify-between bg-bg1 px-3 py-2 bottom-[var(--tab-bar-occupied-height)]`,children:[S(i,{className:`flex items-center gap-2`,children:[x(a,{checked:L.size===Y.size&&Y.size>0,onCheckedChange:fe}),x(o,{className:`text-sm text-text1`,children:k(`likeTab.selectAll`)})]}),x(r,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Q,onClick:pe,children:k(Q?`likeTab.processing`:`likeTab.delete`)})]})]})}export{D as LikeTab};
@@ -1,6 +1,7 @@
1
1
 
2
2
  import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
3
3
  import "../../../../../../../utils.mjs";
4
+ import { ProfileMainContentType } from "../../variants.mjs";
4
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
5
6
 
6
7
  //#region components/biz/business/profile/profile-main/tabs/publish-tab/client.d.ts
@@ -21,6 +22,8 @@ interface PublishTabProps {
21
22
  fallbackUserInfo?: PublishTabUserInfo;
22
23
  /** 是否为本人视角。 */
23
24
  isMine?: boolean;
25
+ /** 二级标签配置。 */
26
+ contentTypes?: ProfileMainContentType[];
24
27
  }
25
28
  /**
26
29
  * 发布内容 Tab 页。
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{pCommunityDeleteContent as e}from"../../../../../../../service/generated/client.mjs";import{useDeleteRequest as t,useMutation as n,usePaginated as r,useUpdateRequest as i}from"../../../../../../../hooks/query/use-query.mjs";import{DeleteConfirmDialog as a}from"../../../../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{UserActivityList as o}from"../../../../../../common/list/user-activity-list/user-activity-list.mjs";import{toast as s}from"sonner";import{useState as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";function p(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function m({mode:m=`renderer`,targetUserId:h,queryKeyPrefix:g,isMine:_=!1}){let v=f(`components.pages.profile.components.tabs`),y=m===`renderer`,b=g??[],x=t(),S=i(),[C,w]=c(null),{mutateAsync:T,isPending:E}=n(async t=>await e({content_id:t})),{data:D,isFetching:O,fetchNextPage:k,hasNextPage:A}=r({key:[...b,`user-publish`],initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},options:{staleTime:0,enabled:y},getNextPageParam(e,t){let n=e?.data||{},r=n.list||[];if(typeof n.has_more==`boolean`)return n.has_more?t.length+1:void 0;if(!(r.length===0||n.total===0))return t.length+1}}),j=D?.pages.flatMap(e=>(e?.data||{}).list||[])??[];function M(e){w(e)}function N(){w(null)}async function P(){if(!(!C||E))try{await T(C);let e=new Set([C]);S([...b,`user-publish`],t=>p(t,e,e=>e.content_id)),s.success(v(`publishTab.deleteSuccess`)),w(null)}catch(e){console.error(`删除内容失败`,e),s.error(v(`publishTab.deleteFailed`))}}let F=j.map(e=>({...e,isDeleting:E&&C===e.content_id,onDelete:()=>M(e.content_id??``)})),I=async()=>{y&&await k()};function L(){x([...b,`user-publish`]),x(b)}function R(e){console.log(`分享到微信:`,e)}function z(e){console.log(`分享到QQ:`,e)}function B(e){console.log(`分享到朋友圈:`,e)}return d(l,{children:[u(o,{list:F,loading:O,hasMore:A,loadMore:I,canEdit:_,showGroupHeaders:!1,emptyText:v(`publishTab.emptyText`),onActionSuccess:L,onShareWeChat:R,onShareQQ:z,onShareMoments:B}),u(a,{open:!!C,onOpenChange:e=>!e&&N(),onCancel:N,onConfirm:P,isConfirming:E})]})}export{m as PublishTab};
2
+ "use client";import{pCommunityDeleteContent as e}from"../../../../../../../service/generated/client.mjs";import{Box as t}from"../../../../../../ui/box.mjs";import{useDeleteRequest as n,useMutation as r,usePaginated as i,useUpdateRequest as a}from"../../../../../../../hooks/query/use-query.mjs";import{DeleteConfirmDialog as o}from"../../../../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{UserActivityList as s}from"../../../../../../common/list/user-activity-list/user-activity-list.mjs";import{toast as c}from"sonner";import{useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function h({mode:h=`renderer`,targetUserId:g,queryKeyPrefix:_,isMine:v=!1}){let y=p(`components.pages.profile.components.tabs`),b=h===`renderer`,x=_??[],S=n(),C=a(),[w,T]=l(null),{mutateAsync:E,isPending:D}=r(async t=>await e({content_id:t})),{data:O,isFetching:k,fetchNextPage:A,hasNextPage:j}=i({key:[...x,`user-publish`],initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},options:{staleTime:0,enabled:b},getNextPageParam(e,t){let n=e?.data||{},r=n.list||[];if(typeof n.has_more==`boolean`)return n.has_more?t.length+1:void 0;if(!(r.length===0||n.total===0))return t.length+1}}),M=O?.pages.flatMap(e=>(e?.data||{}).list||[])??[];function N(e){T(e)}function P(){T(null)}async function F(){if(!(!w||D))try{await E(w);let e=new Set([w]);C([...x,`user-publish`],t=>m(t,e,e=>e.content_id)),c.success(y(`publishTab.deleteSuccess`)),T(null)}catch(e){console.error(`删除内容失败`,e),c.error(y(`publishTab.deleteFailed`))}}let I=M.map(e=>({...e,isDeleting:D&&w===e.content_id,onDelete:()=>N(e.content_id??``)})),L=async()=>{b&&await A()};function R(){S([...x,`user-publish`]),S(x)}function z(e){console.log(`分享到微信:`,e)}function B(e){console.log(`分享到QQ:`,e)}function V(e){console.log(`分享到朋友圈:`,e)}return f(u,{children:[d(t,{children:d(t,{className:`pt-4`,children:d(s,{list:I,loading:k,hasMore:j,loadMore:L,canEdit:v,showGroupHeaders:!1,emptyText:y(`publishTab.emptyText`),onActionSuccess:R,onShareWeChat:z,onShareQQ:B,onShareMoments:V})})}),d(o,{open:!!w,onOpenChange:e=>!e&&P(),onCancel:P,onConfirm:F,isConfirming:D})]})}export{h as PublishTab};
@@ -1,9 +1,34 @@
1
1
 
2
2
  //#region components/biz/business/profile/profile-main/variants.d.ts
3
+ /**
4
+ * 内容类型配置项。
5
+ */
6
+ declare const profileMainContentTypeOptions: readonly ["video", "novel", "comic", "post"];
7
+ declare const profileMainSecondaryTabDisplayOrder: readonly ["video", "novel", "comic", "post"];
8
+ /**
9
+ * 主内容 Tab 基础项。
10
+ */
11
+ declare const profileMainBaseTabOptions: readonly ["collect", "like", "history"];
12
+ /**
13
+ * 主内容 Tab 中的帖子发布项。
14
+ */
15
+ declare const profileMainPublishTabOption: "publish";
16
+ type ProfileMainContentType = typeof profileMainContentTypeOptions[number];
17
+ type ProfileMainSecondaryTabKey = typeof profileMainSecondaryTabDisplayOrder[number];
18
+ type ProfileMainBaseTabKey = typeof profileMainBaseTabOptions[number];
19
+ type ProfileMainTabKey = ProfileMainBaseTabKey | typeof profileMainPublishTabOption;
20
+ /**
21
+ * 根据内容类型配置解析主 Tab。
22
+ */
23
+ declare function getProfileMainTabOptions(contentTypes?: ProfileMainContentType[]): ProfileMainTabKey[];
24
+ /**
25
+ * 根据内容类型配置解析二级标签。
26
+ */
27
+ declare function getProfileMainSecondaryTabOptions(contentTypes?: ProfileMainContentType[]): ProfileMainSecondaryTabKey[];
3
28
  /**
4
29
  * 个人主页主 Tab(本人视角)。
5
30
  */
6
- declare const profileMainMineTabOptions: readonly ["collect", "like", "history"];
31
+ declare const profileMainMineTabOptions: ProfileMainTabKey[];
7
32
  /**
8
33
  * 个人主页主 Tab(他人视角)。
9
34
  */
@@ -11,7 +36,7 @@ declare const profileMainProfileTabOptions: readonly ["collect", "like"];
11
36
  /**
12
37
  * 物料主 Tab 可选项。
13
38
  */
14
- declare const profileMainTabOptions: readonly ["collect", "like", "history"];
39
+ declare const profileMainTabOptions: ProfileMainTabKey[];
15
40
  /**
16
41
  * 点赞子 Tab 可选项。
17
42
  */
@@ -29,4 +54,4 @@ declare const profileMainCollectTabOptions: readonly ["video", "post", "collecti
29
54
  */
30
55
  declare const profileMainCollectCollectionTabOptions: readonly ["created", "subscribed"];
31
56
  //#endregion
32
- export { profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainTabOptions };
57
+ export { ProfileMainBaseTabKey, ProfileMainContentType, ProfileMainSecondaryTabKey, ProfileMainTabKey, getProfileMainSecondaryTabOptions, getProfileMainTabOptions, profileMainBaseTabOptions, profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainContentTypeOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainPublishTabOption, profileMainSecondaryTabDisplayOrder, profileMainTabOptions };
@@ -1,2 +1,2 @@
1
1
 
2
- const e=[`collect`,`like`,`history`],t=[`collect`,`like`],n=e,r=[`video`,`post`],i=[`video`,`post`],a=[`video`,`post`,`collection`],o=[`created`,`subscribed`];export{o as profileMainCollectCollectionTabOptions,a as profileMainCollectTabOptions,i as profileMainHistoryTabOptions,r as profileMainLikeTabOptions,e as profileMainMineTabOptions,t as profileMainProfileTabOptions,n as profileMainTabOptions};
2
+ const e=[`video`,`novel`,`comic`,`post`],t=[`video`,`novel`,`comic`,`post`],n=[`collect`,`like`,`history`],r=`publish`;function i(e){return e?.includes(`post`)??!1?[`publish`,`collect`,`like`,`history`]:[...n]}function a(e){if(!e?.length)return[];let n=new Set(e);return t.filter(e=>n.has(e))}const o=i(),s=[`collect`,`like`],c=o,l=[`video`,`post`],u=[`video`,`post`],d=[`video`,`post`,`collection`],f=[`created`,`subscribed`];export{a as getProfileMainSecondaryTabOptions,i as getProfileMainTabOptions,n as profileMainBaseTabOptions,f as profileMainCollectCollectionTabOptions,d as profileMainCollectTabOptions,e as profileMainContentTypeOptions,u as profileMainHistoryTabOptions,l as profileMainLikeTabOptions,o as profileMainMineTabOptions,s as profileMainProfileTabOptions,r as profileMainPublishTabOption,t as profileMainSecondaryTabDisplayOrder,c as profileMainTabOptions};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import e from"../../../../utils/event-bus.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{trackKeywordClick as n}from"../../../../utils/tracking.mjs";import{useRouter as r}from"../../../../utils/use-compatible-router.mjs";import{Box as i}from"../../../ui/box.mjs";import{Text as a}from"../../../ui/text.mjs";import{eventKey as o}from"../../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{DeleteIcon as l}from"../../../common/icons/delete.mjs";import{usePathname as u,useSearchParams as d}from"next/navigation";import{useLayoutEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";function v(e,t){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function y(y){let{title:b,rows:x=2,clearText:S,confirmDescription:C,onHistoryClick:w,mode:T=`renderer`}=y,E=T===`editor`,D=b??`搜索历史`,O=S??`清空`,k=C??`确定要清除所有搜索历史吗?`,A=p(()=>[`海市蜃楼`,`迷雾追凶`,`夜行者`,`狂飙`,`三大队`,`破冰行动`],[]),[j,M]=h(!1),[N,P]=h(null),F=m(null),I=m([]),L=m(null),R=r(),z=u(),B=d(),{userInfo:V}=t(),{history:H,addHistory:U,clearHistory:W}=s({storageKey:V?.user_id||`guest`}),G=()=>{W(),M(!1),e.emit(o.SEARCH_HISTORY_UPDATE)},K=p(()=>(H.length?H:T===`editor`?A:[]).slice(0,x*10),[H,T,A,x]);if(f(()=>{if(K.length===0){P(null);return}let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=[];I.current.slice(0,K.length).forEach(e=>{if(!e)return;let r=e.getBoundingClientRect(),i=Math.round(r.top-t.top),a=Math.round(r.bottom-t.top),o=n.find(e=>Math.abs(e.top-i)<=1);if(o){o.bottom=Math.max(o.bottom,a);return}n.push({top:i,bottom:a})}),n.sort((e,t)=>e.top-t.top);let r=n.slice(0,x).reduce((e,t)=>Math.max(e,t.bottom),0);P(e=>e===r?e:r)},n=()=>{L.current!=null&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame(()=>{L.current=null,t()})};if(n(),typeof ResizeObserver>`u`)return()=>{L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)};let r=new ResizeObserver(()=>{n()});return r.observe(e),I.current.slice(0,K.length).forEach(e=>{e&&r.observe(e)}),()=>{r.disconnect(),L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)}},[K,x]),K.length===0)return null;let q=(e,t)=>{if(n({keyword:e,click_item_id:``,click_item_type_key:``,click_item_type_name:``,click_position:t,search_trace_id:``}),U(e),w){w(e);return}let r=new URLSearchParams(B.toString());r.set(`q`,e);let i=z.includes(`/search-result`)?z:`/search-result`;R.push(`${i}?${r.toString()}`)};return _(i,{className:E?`mt-[24px] no-vw-x-16 py-[16px]`:`mt-[24px] no-vw-x-16 py-0`,children:[_(i,{className:`mb-[15px] flex items-center justify-between`,children:[g(a,{className:`font-['PingFang_SC'] text-[16px] font-medium not-italic leading-normal text-white`,children:D}),g(`button`,{type:`button`,"aria-label":O,className:`flex h-[24px] w-[24px] shrink-0 items-center justify-center text-white/50`,onClick:()=>M(!0),children:g(l,{className:`h-[24px] w-[24px]`})})]}),g(i,{ref:F,className:`flex flex-wrap content-start items-center gap-[6px] overflow-hidden`,style:N?{maxHeight:`${N}px`}:void 0,children:K.map((e,t)=>g(i,{ref:e=>{I.current[t]=e},className:`flex min-w-[56px] cursor-pointer items-center justify-center rounded-full px-[8px] py-[4px] ${E?`bg-[#1F1F1F]/10`:`bg-white/20`}`,onClick:()=>q(e,t),children:g(a,{className:`max-w-full whitespace-nowrap font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px] text-white`,children:v(e,8)})},t))}),g(c,{open:j,onOpenChange:M,onConfirm:G,title:``,description:k})]})}export{y as SearchHistoryClient};
2
+ "use client";import e from"../../../../utils/event-bus.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{trackKeywordClick as n}from"../../../../utils/tracking.mjs";import{useRouter as r}from"../../../../utils/use-compatible-router.mjs";import{Box as i}from"../../../ui/box.mjs";import{Text as a}from"../../../ui/text.mjs";import{eventKey as o}from"../../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{DeleteIcon as l}from"../../../common/icons/delete.mjs";import{useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{usePathname as m,useSearchParams as h}from"next/navigation";import{jsx as g,jsxs as _}from"react/jsx-runtime";function v(e,t){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function y(y){let{title:b,rows:x=2,clearText:S,confirmDescription:C,onHistoryClick:w,mode:T=`renderer`}=y,E=T===`editor`,D=b??`搜索历史`,O=S??`清空`,k=C??`确定要清除所有搜索历史吗?`,A=d(()=>[`海市蜃楼`,`迷雾追凶`,`夜行者`,`狂飙`,`三大队`,`破冰行动`],[]),[j,M]=p(!1),[N,P]=p(null),F=f(null),I=f([]),L=f(null),R=r(),z=m(),B=h(),{userInfo:V}=t(),{history:H,addHistory:U,clearHistory:W}=s({storageKey:V?.user_id||`guest`}),G=()=>{W(),M(!1),e.emit(o.SEARCH_HISTORY_UPDATE)},K=d(()=>(H.length?H:T===`editor`?A:[]).slice(0,x*10),[H,T,A,x]);if(u(()=>{if(K.length===0){P(null);return}let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=[];I.current.slice(0,K.length).forEach(e=>{if(!e)return;let r=e.getBoundingClientRect(),i=Math.round(r.top-t.top),a=Math.round(r.bottom-t.top),o=n.find(e=>Math.abs(e.top-i)<=1);if(o){o.bottom=Math.max(o.bottom,a);return}n.push({top:i,bottom:a})}),n.sort((e,t)=>e.top-t.top);let r=n.slice(0,x).reduce((e,t)=>Math.max(e,t.bottom),0);P(e=>e===r?e:r)},n=()=>{L.current!=null&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame(()=>{L.current=null,t()})};if(n(),typeof ResizeObserver>`u`)return()=>{L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)};let r=new ResizeObserver(()=>{n()});return r.observe(e),I.current.slice(0,K.length).forEach(e=>{e&&r.observe(e)}),()=>{r.disconnect(),L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)}},[K,x]),K.length===0)return null;let q=(e,t)=>{if(n({keyword:e,click_item_id:``,click_item_type_key:``,click_item_type_name:``,click_position:t,search_trace_id:``}),U(e),w){w(e);return}let r=new URLSearchParams(B.toString());r.set(`q`,e);let i=z.includes(`/search-result`)?z:`/search-result`;R.push(`${i}?${r.toString()}`)};return _(i,{className:E?`mt-[24px] px-[16px] py-[16px]`:`mt-[24px] px-[16px] py-0`,children:[_(i,{className:`mb-[15px] flex items-center justify-between`,children:[g(a,{className:`font-['PingFang_SC'] text-[16px] font-medium not-italic leading-normal text-white`,children:D}),g(`button`,{type:`button`,"aria-label":O,className:`flex h-[24px] w-[24px] shrink-0 items-center justify-center text-white/50`,onClick:()=>M(!0),children:g(l,{className:`h-[24px] w-[24px]`})})]}),g(i,{ref:F,className:`flex flex-wrap content-start items-center gap-[6px] overflow-hidden`,style:N?{maxHeight:`${N}px`}:void 0,children:K.map((e,t)=>g(i,{ref:e=>{I.current[t]=e},className:`flex min-w-[56px] cursor-pointer items-center justify-center rounded-full px-[8px] py-[4px] ${E?`bg-[#1F1F1F]/10`:`bg-white/20`}`,onClick:()=>q(e,t),children:g(a,{className:`max-w-full whitespace-nowrap font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px] text-white`,children:v(e,8)})},t))}),g(c,{open:j,onOpenChange:M,onConfirm:G,title:``,description:k})]})}export{y as SearchHistoryClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Input as n}from"../../../ui/input.mjs";import{LeftArrowIcon as r}from"../../../common/icons/left-arrow.mjs";import i from"../../../../assets/icons/search.mjs";import a from"../../../../assets/icons/clear.mjs";import{usePathname as o,useSearchParams as s}from"next/navigation";import{useCallback as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e){if(!e||typeof e!=`string`)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>e==null?``:String(e).trim()).filter(Boolean):[]}catch{return[]}}function p(p){let{placeholder:m,defaultPlaceholder:h,searchLabel:g,storageKey:_=`guest`,onSearch:v,mode:y=`renderer`}=p,b=m||(h??`请输入搜索内容`),x=g??`搜索`,S=y===`editor`,[C,w]=l(``),T=e(),E=o(),D=s(),O=`search_history_${_}`,k=c(e=>{if(S)return;let t=e.trim();if(t){try{let e=[t,...f(localStorage.getItem(O)).filter(e=>e!==t)].slice(0,20);localStorage.setItem(O,JSON.stringify(e))}catch(e){console.error(`Failed to save search history`,e)}if(v)v(t);else{let e=new URLSearchParams(D.toString());e.set(`q`,t);let n=E.includes(`/search-result`)?E:`/search-result`;T.push(`${n}?${e.toString()}`)}}},[O,S,v,E,T,D]),A=()=>{S||T.back()};return d(t,{className:`flex h-[66px] w-full items-center gap-[8px] no-vw-x-16 py-[16px]${S?` pointer-events-none`:``}`,children:[u(`button`,{type:`button`,"aria-label":`返回`,className:`flex size-[24px] shrink-0 items-center justify-center text-white active:opacity-70`,onClick:A,children:u(r,{className:`h-[16px] w-[16px]`})}),d(t,{className:`flex h-[34px] min-w-0 flex-1 items-center overflow-hidden rounded-[100px] border border-[#E62AFF]/90 bg-black/40 backdrop-blur-[2px]`,children:[d(t,{className:`relative flex h-full min-w-0 flex-1 items-center pl-[12px] pr-[10px]`,children:[u(`span`,{className:`pointer-events-none absolute inset-y-0 left-[12px] flex items-center justify-center`,children:u(i,{className:`h-[14px] w-[14px] text-white/60`})}),u(n,{className:`!h-[20px] !w-full !rounded-none !border-0 !bg-transparent !px-0 !pl-[22px] !pr-[18px] !py-0 !text-[14px] !leading-[20px] !text-white !caret-white placeholder:!text-white/90 focus-visible:!ring-0`,placeholder:b,value:C,maxLength:128,onChange:e=>w(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k(C))}}),C&&u(`span`,{className:`absolute inset-y-0 right-0 flex items-center justify-center`,children:u(a,{className:`h-[15px] w-[15px] shrink-0 cursor-pointer text-white/50 active:opacity-70`,onClick:()=>w(``)})})]}),u(`button`,{type:`button`,className:`mx-[2px] flex h-[30px] w-[56px] shrink-0 items-center justify-center rounded-[100px] bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-[14px] leading-[20px] text-white active:opacity-90`,onClick:()=>k(C),children:x})]})]})}export{p as SearchInputClient};
2
+ "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Input as n}from"../../../ui/input.mjs";import{LeftArrowIcon as r}from"../../../common/icons/left-arrow.mjs";import i from"../../../../assets/icons/search.mjs";import a from"../../../../assets/icons/clear.mjs";import{useCallback as o,useState as s}from"react";import{usePathname as c,useSearchParams as l}from"next/navigation";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e){if(!e||typeof e!=`string`)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>e==null?``:String(e).trim()).filter(Boolean):[]}catch{return[]}}function p(p){let{placeholder:m,defaultPlaceholder:h,searchLabel:g,storageKey:_=`guest`,onSearch:v,mode:y=`renderer`}=p,b=m||(h??`请输入搜索内容`),x=g??`搜索`,S=y===`editor`,[C,w]=s(``),T=e(),E=c(),D=l(),O=`search_history_${_}`,k=o(e=>{if(S)return;let t=e.trim();if(t){try{let e=[t,...f(localStorage.getItem(O)).filter(e=>e!==t)].slice(0,20);localStorage.setItem(O,JSON.stringify(e))}catch(e){console.error(`Failed to save search history`,e)}if(v)v(t);else{let e=new URLSearchParams(D.toString());e.set(`q`,t);let n=E.includes(`/search-result`)?E:`/search-result`;T.push(`${n}?${e.toString()}`)}}},[O,S,v,E,T,D]),A=()=>{S||T.back()};return d(t,{className:`flex h-[66px] w-full items-center gap-[8px] px-[16px] py-[16px]${S?` pointer-events-none`:``}`,children:[u(`button`,{type:`button`,"aria-label":`返回`,className:`flex size-[24px] shrink-0 items-center justify-center text-white active:opacity-70`,onClick:A,children:u(r,{className:`h-[16px] w-[16px]`})}),d(t,{className:`flex h-[34px] min-w-0 flex-1 items-center overflow-hidden rounded-[100px] border border-[#E62AFF]/90 bg-black/40 backdrop-blur-[2px]`,children:[d(t,{className:`relative flex h-full min-w-0 flex-1 items-center pl-[12px] pr-[10px]`,children:[u(`span`,{className:`pointer-events-none absolute inset-y-0 left-[12px] flex items-center justify-center`,children:u(i,{className:`h-[14px] w-[14px] text-white/60`})}),u(n,{className:`!h-[20px] !w-full !rounded-none !border-0 !bg-transparent !px-0 !pl-[22px] !pr-[18px] !py-0 !text-[14px] !leading-[20px] !text-white !caret-white placeholder:!text-white/90 focus-visible:!ring-0`,placeholder:b,value:C,maxLength:128,onChange:e=>w(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k(C))}}),C&&u(`span`,{className:`absolute inset-y-0 right-0 flex items-center justify-center`,children:u(a,{className:`h-[15px] w-[15px] shrink-0 cursor-pointer text-white/50 active:opacity-70`,onClick:()=>w(``)})})]}),u(`button`,{type:`button`,className:`mx-[2px] flex h-[30px] w-[56px] shrink-0 items-center justify-center rounded-[100px] bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-[14px] leading-[20px] text-white active:opacity-90`,onClick:()=>k(C),children:x})]})]})}export{p as SearchInputClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs";import{shortcutGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(c){let{mode:l=`renderer`,title:u,shortcutCount:d,isShortcutTitle:f,shortcuts:p}={...a,...c},m=l===`editor`,h=(()=>{let e=d??p.length??0;return Math.min(Math.max(e,3),5)})(),g=(p??[]).slice(0,h);return o(t,{as:`section`,className:`py-3 no-vw-x-16`,"aria-label":`金刚区`,children:s(t,{className:`w-full`,children:[m&&u?.trim()?o(n,{as:`h2`,className:`mb-3 text-[12px] leading-[16px] text-white/45`,children:u}):null,o(t,{className:`grid w-full items-start gap-4`,style:{gridTemplateColumns:`repeat(${h}, minmax(0, 1fr))`},children:g.map((a,c)=>{let l=o(t,{className:`relative h-[79px] w-full min-w-0 overflow-visible`,children:s(t,{className:`absolute inset-x-0 bottom-0 h-[63px] w-full overflow-visible`,children:[o(i,{"aria-hidden":!0,className:`absolute inset-0 h-full w-full`}),o(t,{className:`pointer-events-none absolute left-1/2 top-[32px] z-20 -translate-x-1/2`,children:f?o(n,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] text-white/80`,title:a.label||void 0,children:a.label}):null}),o(t,{className:`pointer-events-none absolute right-0 top-[-14px] z-30`,children:o(t,{className:`relative h-[43px] w-[42px] overflow-visible`,"aria-hidden":!a.label,children:a.icon?o(e,{src:a.icon,alt:a.label||`入口图标`,fill:!0,className:`object-contain drop-shadow-[0_10px_18px_rgba(0,0,0,0.3)]`}):o(t,{className:`h-full w-full rounded-full bg-white/12`})})})]})});return o(r,{href:a.href,className:`block w-full min-w-0 transition-transform duration-200 active:scale-[0.98]`,children:l},a.href||a.label||c)})})]})})}export{c as ShortcutGridClient};
2
+ "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs";import{shortcutGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(c){let{mode:l=`renderer`,title:u,shortcutCount:d,isShortcutTitle:f,shortcuts:p}={...a,...c},m=l===`editor`,h=(()=>{let e=d??p.length??0;return Math.min(Math.max(e,3),5)})(),g=(p??[]).slice(0,h);return o(t,{as:`section`,className:m?`pointer-events-none px-4 py-3`:`px-4 py-3`,"aria-label":`金刚区`,children:s(t,{className:`w-full`,children:[m&&u?.trim()?o(n,{as:`h2`,className:`mb-3 text-[12px] leading-[16px] text-white/45`,children:u}):null,o(t,{className:`grid w-full items-start gap-4`,style:{gridTemplateColumns:`repeat(${h}, minmax(0, 1fr))`},children:g.map((a,c)=>{let l=o(t,{className:`relative h-[79px] w-full min-w-0 overflow-visible`,children:s(t,{className:`absolute inset-x-0 bottom-0 h-[63px] w-full overflow-visible`,children:[o(i,{"aria-hidden":!0,className:`absolute inset-0 h-full w-full`}),o(t,{className:`pointer-events-none absolute left-1/2 top-[32px] z-20 -translate-x-1/2`,children:f?o(n,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] text-white/80`,title:a.label||void 0,children:a.label}):null}),o(t,{className:`pointer-events-none absolute right-0 top-[-14px] z-30`,children:o(t,{className:`relative h-[43px] w-[42px] overflow-visible`,"aria-hidden":!a.label,children:a.icon?o(e,{src:a.icon,alt:a.label||`入口图标`,fill:!0,className:`object-contain drop-shadow-[0_10px_18px_rgba(0,0,0,0.3)]`}):o(t,{className:`h-full w-full rounded-full bg-white/12`})})})]})});return o(r,{href:a.href,className:`block w-full min-w-0 transition-transform duration-200 active:scale-[0.98]`,children:l},a.href||a.label||c)})})]})})}export{c as ShortcutGridClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{trackNavigation as e}from"../../../../utils/tracking.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{usePathname as i}from"next/navigation";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import c from"next/link";const l=[],u={backgroundColor:`rgba(5, 1, 15, 0.1)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`},d={background:`linear-gradient(0deg, rgba(6, 3, 21, 0.03) 0%, rgba(6, 3, 21, 0.03) 100%), rgba(255, 255, 255, 0.10)`},f={background:`linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%)`,padding:`1px`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,mask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,maskComposite:`exclude`};function p(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function m(e){if(e.configType===1)switch(e.functionPageType){case`搜索`:return`/search`;case`个人中心`:return`/user/mine`;case`内容列表`:return`/video-list?tags=${e.tags}&title=${e.title}`;default:return`/`}let t=(e.domainId??``).toString().trim();return t?`/domain/${t}`:`/`}function h(e,t){let n=p(t);if(e.configType===1){let t=p(m(e).split(`?`)[0]);return n===t||n.startsWith(`${t}/`)}let r=e.domainId.trim();if(!r)return n===`/`||n.startsWith(`/category/`);let i=`/domain/${r}`;return n===i||n.startsWith(`${i}/`)}function g(e,t){return e.findIndex(e=>h(e,t))}function _(e){return typeof e.show_nav_name==`boolean`?e.show_nav_name:typeof e.showNavName==`boolean`?e.showNavName:!0}function v(p){let{items:h=l,mode:v=`renderer`}=p,y=i(),b=a(()=>{if(v===`editor`)return 0;let e=g(h??[],y);return e>=0?e:0},[h,y,v]),x=a(()=>(h??[]).some(e=>_(e)&&e.label.trim()!==``),[h]);if(!h?.length)return null;function S(t,n){v===`editor`?t.preventDefault():e({navigation_key:`navigation_${n.label}`,navigation_name:n.label})}let C=`size-full rounded-[6px] bg-white/20`;return o(n,{as:`nav`,"aria-label":`Bottom navigation`,className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center`,style:u,children:s(n,{className:`relative my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,children:[o(n,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:d,"aria-hidden":`true`}),o(n,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:f,"aria-hidden":`true`}),h.map((e,i)=>{let a=b===i,l=a?e.activeIcon:e.icon,u=e.label,d=_(e)&&u.trim()!==``,f=m(e),p=x?a?`gap-[5px]`:`gap-[4px]`:``,h=a?`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[#C043E8]`:`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-white/50`;return s(c,{href:f,className:`flex flex-col items-center justify-center ${p}`,"aria-current":a?`page`:void 0,"data-index":i,"data-webview-nav":`spa`,onClick:t=>S(t,e),children:[o(n,{className:`relative size-5 shrink-0`,children:l?o(t,{src:l,alt:u,fill:!0,className:`object-contain`}):o(n,{className:a?`${C} bg-[#C043E8]`:C})}),x&&d?o(r,{"data-active":a,className:h,children:u}):null]},i)})]})})}export{v as TabBarClient};
2
+ "use client";import{trackNavigation as e}from"../../../../utils/tracking.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{useMemo as i}from"react";import{usePathname as a}from"next/navigation";import{jsx as o,jsxs as s}from"react/jsx-runtime";import c from"next/link";const l=[],u={backgroundColor:`rgba(5, 1, 15, 0.9)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,paddingBottom:`env(safe-area-inset-bottom, 0px)`},d={background:`rgba(1, 0, 2, 0.80)`,boxShadow:`0 12px 100px rgba(255, 255, 255, 0.20)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`};function f(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function p(e){if(e.configType===1)switch(e.functionPageType){case`搜索`:return`/search`;case`个人中心`:return`/user/mine`;case`内容列表`:return`/video-list?tags=${e.tags}&title=${e.title}`;default:return`/`}let t=(e.domainId??``).toString().trim();return t?`/domain/${t}`:`/`}function m(e,t){let n=f(t);if(e.configType===1){let t=f(p(e).split(`?`)[0]);return n===t||n.startsWith(`${t}/`)}let r=e.domainId.trim();if(!r)return n===`/`||n.startsWith(`/category/`);let i=`/domain/${r}`;return n===i||n.startsWith(`${i}/`)}function h(e,t){return e.findIndex(e=>m(e,t))}function g(e){return typeof e.show_nav_name==`boolean`?e.show_nav_name:typeof e.showNavName==`boolean`?e.showNavName:!0}function _(f){let{items:m=l,mode:_=`renderer`}=f,v=a(),y=i(()=>{if(_===`editor`)return 0;let e=h(m??[],v);return e>=0?e:0},[m,v,_]),b=i(()=>(m??[]).some(e=>g(e)&&e.label.trim()!==``),[m]);if(!m?.length)return null;function x(t,n){_===`editor`?t.preventDefault():e({navigation_key:`navigation_${n.label}`,navigation_name:n.label})}let S=`size-full rounded-[6px] bg-white/20`;return o(n,{as:`nav`,"aria-label":`Bottom navigation`,className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center`,style:u,children:o(n,{className:`my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,style:d,children:m.map((e,i)=>{let a=y===i,l=a?e.activeIcon:e.icon,u=e.label,d=g(e)&&u.trim()!==``,f=p(e),m=b?a?`gap-[5px]`:`gap-[4px]`:``,h=a?`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[#C043E8]`:`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[#BFBFBF]`;return s(c,{href:f,className:`flex flex-col items-center justify-center ${m}`,"aria-current":a?`page`:void 0,"data-index":i,"data-webview-nav":`spa`,onClick:t=>x(t,e),children:[o(n,{className:`relative size-5 shrink-0`,children:l?o(t,{src:l,alt:u,fill:!0,className:`object-contain`}):o(n,{className:a?`${S} bg-[#C043E8]`:S})}),b&&d?o(r,{"data-active":a,className:h,children:u}):null]},i)})})})}export{_ as TabBarClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as t}from"../../../../service/generated/client.mjs";import{useRouter as n}from"../../../../utils/use-compatible-router.mjs";import{Box as r}from"../../../ui/box.mjs";import{Text as i}from"../../../ui/text.mjs";import{useRequest as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/refresh.mjs";import{usePathname as s,useSearchParams as c}from"next/navigation";import{useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useShallow as p}from"zustand/react/shallow";function m(e,t){if(e.length<=t)return[...e];let n=[...e];for(let e=0;e<t;e++){let t=e+Math.floor(Math.random()*(n.length-e));[n[e],n[t]]=[n[t],n[e]]}return n.slice(0,t)}function h(h){let{title:g,displayCount:_=6,showRefresh:v=!1,onItemClick:y,mode:b=`renderer`}=h,x=b===`editor`,S=n(),C=s(),w=c(),[T,E]=u(0),{userInfo:D}=e(p(e=>({userInfo:e.userInfo}))),O=D?.user_id||`guest`,{data:k}=a([`text-recommend-keyword-list`,O],()=>t({user_id:O}),{enabled:!x}),A=l(()=>(k?.data?.recommend_list??[]).map(e=>({label:e.title??``})).filter(e=>e.label),[k]),j=_*2,M=l(()=>x?Array.from({length:j},(e,t)=>({label:`推荐搜索${t+1}`})):A,[x,A,j]),N=l(()=>m(M,j),[M,T,j]);if(!x&&A.length<2)return null;let P=e=>{e.stopPropagation(),E(e=>e+1)},F=e=>{if(y){y(e);return}let t=new URLSearchParams(w.toString());t.set(`q`,e);let n=C.includes(`/search-result`)?C:`/search-result`;S.push(`${n}?${t.toString()}`)};return f(r,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full${x?` pointer-events-none`:``}`,children:[f(r,{className:`flex items-center justify-between w-full`,children:[d(i,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:g}),v&&f(r,{className:`flex items-center gap-1 cursor-pointer active:opacity-70 transition-opacity`,onClick:P,children:[d(i,{className:`text-[14px] text-text3 leading-[22px]`,children:`换一批`}),d(o,{className:`w-3 h-3 text-text3`})]})]}),d(r,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:N.map((e,t)=>d(r,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>F(e.label),children:d(i,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:e.label})},`${T}-${t}`))})]})}export{h as TextRecommendClient};
2
+ "use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as t}from"../../../../service/generated/client.mjs";import{useRouter as n}from"../../../../utils/use-compatible-router.mjs";import{Box as r}from"../../../ui/box.mjs";import{Text as i}from"../../../ui/text.mjs";import{useRequest as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/refresh.mjs";import{useMemo as s,useState as c}from"react";import{usePathname as l,useSearchParams as u}from"next/navigation";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useShallow as p}from"zustand/react/shallow";function m(e,t){if(e.length<=t)return[...e];let n=[...e];for(let e=0;e<t;e++){let t=e+Math.floor(Math.random()*(n.length-e));[n[e],n[t]]=[n[t],n[e]]}return n.slice(0,t)}function h(h){let{title:g,displayCount:_=6,showRefresh:v=!1,onItemClick:y,mode:b=`renderer`}=h,x=b===`editor`,S=n(),C=l(),w=u(),[T,E]=c(0),{userInfo:D}=e(p(e=>({userInfo:e.userInfo}))),O=D?.user_id||`guest`,{data:k}=a([`text-recommend-keyword-list`,O],()=>t({user_id:O}),{enabled:!x}),A=s(()=>(k?.data?.recommend_list??[]).map(e=>({label:e.title??``})).filter(e=>e.label),[k]),j=_*2,M=s(()=>x?Array.from({length:j},(e,t)=>({label:`推荐搜索${t+1}`})):A,[x,A,j]),N=s(()=>m(M,j),[M,T,j]);if(!x&&A.length<2)return null;let P=e=>{e.stopPropagation(),E(e=>e+1)},F=e=>{if(y){y(e);return}let t=new URLSearchParams(w.toString());t.set(`q`,e);let n=C.includes(`/search-result`)?C:`/search-result`;S.push(`${n}?${t.toString()}`)};return f(r,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full${x?` pointer-events-none`:``}`,children:[f(r,{className:`flex items-center justify-between w-full`,children:[d(i,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:g}),v&&f(r,{className:`flex items-center gap-1 cursor-pointer active:opacity-70 transition-opacity`,onClick:P,children:[d(i,{className:`text-[14px] text-text3 leading-[22px]`,children:`换一批`}),d(o,{className:`w-3 h-3 text-text3`})]})]}),d(r,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:N.map((e,t)=>d(r,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>F(e.label),children:d(i,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:e.label})},`${T}-${t}`))})]})}export{h as TextRecommendClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{trackPageLifecycle as e}from"../../../utils/tracking.mjs";import{usePathname as t}from"next/navigation";import{useEffect as n,useRef as r}from"react";const i=[`zh-CN`,`en`];function a(e){for(let t of i){if(e===`/${t}`)return`/`;if(e.startsWith(`/${t}/`))return e.slice(t.length+1)}return e}function o(e){if(e===`/`||e.startsWith(`/category/`)||e.startsWith(`/domain/`))return{key:`page_home`,name:`首页`,path:e};if(e.startsWith(`/video/`))return{key:`page_video_detail`,name:`详情页`,path:e};if(e.startsWith(`/post/`))return{key:`page_post_detail`,name:`详情页`,path:e};if(e.startsWith(`/search-result`))return{key:`page_search_result`,name:`搜索结果`,path:e};if(e.startsWith(`/search`))return{key:`page_search`,name:`搜索`,path:e};if(e.startsWith(`/profile/`))return{key:`page_user`,name:`个人中心`,path:e};if(e===`/settings`)return{key:`page_settings`,name:`设置`,path:e};if(e===`/edit`)return{key:`page_edit_profile`,name:`编辑资料`,path:e};if(e===`/publish`)return{key:`page_publish`,name:`发布`,path:e};if(e.startsWith(`/feed-series/`))return{key:`page_feed_series`,name:`短剧`,path:e};if(e===`/feedback`)return{key:`page_feedback`,name:`意见反馈`,path:e};if(e===`/collection/add`)return{key:`page_collection_add`,name:`添加到合集`,path:e};if(e===`/collection/create`)return{key:`page_collection_create`,name:`创建合集`,path:e};if(e.startsWith(`/collection/`))return{key:`page_collection_detail`,name:`合集详情`,path:e};if(e===`/fans`)return{key:`page_fans`,name:`粉丝`,path:e};if(e===`/followed`)return{key:`page_followed`,name:`关注`,path:e};if(e===`/user/follow`)return{key:`page_user_follow`,name:`关注`,path:e};if(e===`/user/mine`)return{key:`page_mine`,name:`我的`,path:e};if(e===`/user/message`)return{key:`page_message`,name:`消息`,path:e};if(e.startsWith(`/video-list`))return{key:`page_video_list`,name:`视频列表`,path:e};if(e.startsWith(`/feed-series`))return{key:`page_feed_series`,name:`短剧`,path:e};if(e===`/hot`)return{key:`page_hot`,name:`热门`,path:e};if(e===`/ranking`)return{key:`page_ranking`,name:`排行榜`,path:e};if(e.startsWith(`/tag/`))return{key:`page_tag`,name:`标签`,path:e};let t=e.split(`/`)[1]||`unknown`;return{key:`page_${t}`,name:t,path:e}}function s(){let i=a(t()??`/`),s=r(Date.now()),c=r(null),l=r(!0);return n(()=>{let t=Date.now(),n=c.current,r=o(i);if(n&&n.key!==r.key){let r=Math.floor((t-s.current)/1e3);e({lifecycle_status:`hide`,page_key:n.key,page_name:n.name,page_path:n.path,duration:r})}c.current=r,s.current=t,l.current=typeof document<`u`?document.visibilityState!==`hidden`:!0,e({lifecycle_status:`show`,page_key:r.key,page_name:r.name,page_path:r.path,duration:0});let a=setInterval(()=>{if(!l.current)return;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,page_path:t.path,duration:n})},600*1e3);return()=>clearInterval(a)},[i]),n(()=>{function t(){if(!l.current)return;l.current=!1;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`hide`,page_key:t.key,page_name:t.name,page_path:t.path,duration:n})}function n(){if(l.current)return;l.current=!0,s.current=Date.now();let t=c.current;t&&e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,page_path:t.path,duration:0})}function r(){document.visibilityState===`hidden`?t():n()}return document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,t),()=>{document.removeEventListener(`visibilitychange`,r),window.removeEventListener(`pagehide`,t)}},[]),null}export{s as default};
2
+ "use client";import{trackPageLifecycle as e}from"../../../utils/tracking.mjs";import{useEffect as t,useRef as n}from"react";import{usePathname as r}from"next/navigation";const i=[`zh-CN`,`en`];function a(e){for(let t of i){if(e===`/${t}`)return`/`;if(e.startsWith(`/${t}/`))return e.slice(t.length+1)}return e}function o(e){if(e===`/`||e.startsWith(`/category/`)||e.startsWith(`/domain/`))return{key:`page_home`,name:`首页`};if(e.startsWith(`/video/`))return{key:`page_video_detail`,name:`详情页`};if(e.startsWith(`/post/`))return{key:`page_post_detail`,name:`详情页`};if(e.startsWith(`/search-result`))return{key:`page_search_result`,name:`搜索结果`};if(e.startsWith(`/search`))return{key:`page_search`,name:`搜索`};if(e.startsWith(`/profile/`))return{key:`page_user`,name:`个人中心`};if(e===`/settings`)return{key:`page_settings`,name:`设置`};if(e===`/edit`)return{key:`page_edit_profile`,name:`编辑资料`};if(e===`/publish`)return{key:`page_publish`,name:`发布`};if(e.startsWith(`/feed-series/`))return{key:`page_feed_series`,name:`短剧`};if(e===`/feedback`)return{key:`page_feedback`,name:`意见反馈`};if(e===`/collection/add`)return{key:`page_collection_add`,name:`添加到合集`};if(e===`/collection/create`)return{key:`page_collection_create`,name:`创建合集`};if(e.startsWith(`/collection/`))return{key:`page_collection_detail`,name:`合集详情`};if(e===`/fans`)return{key:`page_fans`,name:`粉丝`};if(e===`/followed`)return{key:`page_followed`,name:`关注`};if(e===`/user/follow`)return{key:`page_user_follow`,name:`关注`};if(e===`/user/mine`)return{key:`page_mine`,name:`我的`};if(e===`/user/message`)return{key:`page_message`,name:`消息`};if(e.startsWith(`/video-list`))return{key:`page_video_list`,name:`视频列表`};if(e.startsWith(`/feed-series`))return{key:`page_feed_series`,name:`短剧`};if(e===`/hot`)return{key:`page_hot`,name:`热门`};if(e===`/ranking`)return{key:`page_ranking`,name:`排行榜`};if(e.startsWith(`/tag/`))return{key:`page_tag`,name:`标签`};let t=e.split(`/`)[1]||`unknown`;return{key:`page_${t}`,name:t}}function s(){let i=a(r()??`/`),s=n(Date.now()),c=n(null),l=n(!0);return t(()=>{let t=Date.now(),n=c.current,r=o(i);if(n&&n.key!==r.key){let r=Math.floor((t-s.current)/1e3);e({lifecycle_status:`hide`,page_key:n.key,page_name:n.name,duration:r})}c.current=r,s.current=t,l.current=typeof document<`u`?document.visibilityState!==`hidden`:!0,e({lifecycle_status:`show`,page_key:r.key,page_name:r.name,duration:0});let a=setInterval(()=>{if(!l.current)return;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,duration:n})},6*1e3);return()=>clearInterval(a)},[i]),t(()=>{function t(){if(!l.current)return;l.current=!1;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`hide`,page_key:t.key,page_name:t.name,duration:n})}function n(){if(l.current)return;l.current=!0,s.current=Date.now();let t=c.current;t&&e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,duration:0})}function r(){document.visibilityState===`hidden`?t():n()}return document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,t),()=>{document.removeEventListener(`visibilitychange`,r),window.removeEventListener(`pagehide`,t)}},[]),null}export{s as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../utils/cn.mjs";import{Image as t}from"../../ui/image.mjs";import{Dialog as n,DialogContent as r}from"../../ui/dialog.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({open:o,onClose:s,bgUrl:c,onUpload:l}){return i(n,{open:o,onOpenChange:s,children:i(r,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:a(`div`,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[i(`button`,{type:`button`,className:`absolute left-0 focus-within:outline-none top-0 flex h-14 w-14 items-center justify-center text-white transition-colors hover:text-white/80`,onClick:s,children:i(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:i(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),i(`div`,{className:`relative h-[256px] w-full overflow-hidden bg-white/10`,children:i(t,{src:c||`/images/mine/img_mine_head_bg.png`,alt:`背景图预览`,fill:!0,className:`object-cover`,style:{pointerEvents:`none`}})}),a(`button`,{type:`button`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-[12px] bg-white/10 p-[12px] transition-colors hover:bg-white/20`,`active:scale-95`),onClick:l,children:[i(`span`,{className:`text-base font-medium text-white`,children:`更换背景图`}),a(`svg`,{className:`w-6 h-6 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[i(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),i(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})})}export{o as BackgroundPreviewModal};
2
+ "use client";import{cn as e}from"../../../utils/cn.mjs";import{Image as t}from"../../ui/image.mjs";import{Dialog as n,DialogContent as r}from"../../ui/dialog.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({open:o,onClose:s,bgUrl:c,onUpload:l}){return i(n,{open:o,onOpenChange:s,children:i(r,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:a(`div`,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[i(`button`,{type:`button`,className:`absolute left-0 focus-within:outline-none top-0 flex h-14 w-14 items-center justify-center text-white transition-colors hover:text-white/80`,onClick:s,children:i(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:i(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),i(`div`,{className:`relative h-[256px] w-full overflow-hidden bg-white/10`,children:i(t,{src:c||`/images/mine/img_mine_head_bg.png`,alt:`背景图预览`,fill:!0,className:`object-cover`,style:{pointerEvents:`none`}})}),a(`button`,{type:`button`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-3xl bg-white/10 px-3 py-3 transition-colors hover:bg-white/20`,`active:scale-95`),onClick:l,children:[i(`span`,{className:`text-base font-medium text-white`,children:`更换背景图`}),a(`svg`,{className:`w-6 h-6 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[i(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),i(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})})}export{o as BackgroundPreviewModal};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/detail/video_flag.mjs";import{CollectionSelectIcon as a,CollectionSelectedIcon as o}from"../collection-list/collection-select-icon.mjs";import{RECOMMEND_BADGE_IMAGE_CLASS_NAME as s,RECOMMEND_TOP_LEFT_BADGE_WRAPPER_CLASS_NAME as c,normalizeRecommendBadgeUrl as l}from"./recommend-badge-style.mjs";import{WATERFALL_SHORT_CARD_ASPECT_RATIO as u,WATERFALL_TALL_CARD_ASPECT_RATIO as d,buildWaterfallRecommendLegacyDisplay as f}from"./waterfall-recommend-display.mjs";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g={backgroundImage:`var(--gradient-card-mask-strong)`};function _({title:e,moreHref:i,onMoreClick:a,moreIcon:o,columns:s,sectionClassName:c=`w-full`,headerClassName:l=`mb-[16px] flex items-center justify-between no-vw-x-16`,titleClassName:u=`flex-1 min-w-0 text-[18px] leading-[24px] font-medium line-clamp-1 text-text2`,moreLinkClassName:d=`ml-[8px] flex size-[24px] shrink-0 items-center justify-center opacity-50`,containerClassName:f=`relative flex w-full gap-[8px] no-vw-x-16`,overlay:p,footer:g,getItemRef:_,selectionMode:y=!1,selectedIds:b,onToggleSelection:x,onItemClick:S}){return h(t,{className:c,children:[h(t,{className:l,children:[m(n,{className:u,children:e}),o&&i&&m(r,{href:i,"aria-label":`更多`,className:d,onClick:a,children:o}),o&&!i&&a&&m(`button`,{type:`button`,"aria-label":`更多`,className:d,onClick:a,children:o})]}),h(t,{className:f,children:[m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.left.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`left`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.right.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`right`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),p]}),g]})}function v({item:_,selectionMode:v=!1,selectedIds:y,onToggleSelection:b,onItemClick:x}){let S=_.cardKind===`short`?u:d,C=_.selectionId??``,w=!!(C&&y?.has(C)),T=f(_),E=l(T.topLeftBadgeImageUrl);function D(){!v||!C||b?.(C)}let O=h(p,{children:[h(t,{className:`relative w-full overflow-hidden rounded-[8px] bg-[#18111f]`,style:{aspectRatio:S},children:[_.coverUrl&&m(e,{src:_.coverUrl,alt:_.title||`推荐封面`,fill:!0,objectFit:`cover`,className:`object-cover`}),m(t,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:g,"aria-hidden":!0}),v&&m(t,{className:`pointer-events-none absolute left-[8px] top-[8px] z-[2]`,children:m(w?o:a,{})}),!v&&h(p,{children:[E&&m(t,{className:c,children:m(e,{src:E,alt:`角标`,width:96,height:18,className:s})}),T.topRightScoreText&&m(n,{as:`span`,className:`absolute right-[8px] top-[8px] z-[1] shrink-0 text-[14px] leading-[22px] font-semibold text-[#FFC24B]`,children:T.topRightScoreText}),h(t,{className:`absolute left-[8px] right-[8px] bottom-[10px] z-[1] flex items-end justify-between gap-[8px]`,children:[m(t,{className:`flex min-w-0 items-center gap-[4px]`,children:T.bottomLeftHeatText&&h(p,{children:[m(i,{className:`h-[16px] w-[16px] shrink-0 text-white`}),m(n,{as:`span`,className:`min-w-0 truncate text-[14px] leading-[20px] text-white`,children:T.bottomLeftHeatText})]})}),T.bottomRightEpisodeText&&m(n,{as:`span`,className:`shrink-0 text-[14px] leading-[20px] text-white`,children:T.bottomRightEpisodeText})]})]})]}),!v&&m(t,{className:`mt-[8px] overflow-hidden`,children:m(n,{as:`h3`,className:`line-clamp-2 text-[16px] leading-[22px] text-[--color-text-white80]`,children:T.title})})]});return v?m(`button`,{type:`button`,className:`mb-[16px] block w-full cursor-pointer border-0 bg-transparent p-0 text-left`,onClick:D,"aria-pressed":w,disabled:!C,children:O}):m(r,{href:_.href,className:`mb-[16px] block w-full`,onClick:()=>x?.(_),children:O})}export{_ as WaterfallRecommend};
2
+ "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/detail/video_flag.mjs";import{CollectionSelectIcon as a,CollectionSelectedIcon as o}from"../collection-list/collection-select-icon.mjs";import{RECOMMEND_BADGE_IMAGE_CLASS_NAME as s,RECOMMEND_TOP_LEFT_BADGE_WRAPPER_CLASS_NAME as c,normalizeRecommendBadgeUrl as l}from"./recommend-badge-style.mjs";import{WATERFALL_SHORT_CARD_ASPECT_RATIO as u,WATERFALL_TALL_CARD_ASPECT_RATIO as d,buildWaterfallRecommendLegacyDisplay as f}from"./waterfall-recommend-display.mjs";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g={backgroundImage:`var(--gradient-card-mask-strong)`};function _({title:e,moreHref:i,onMoreClick:a,moreIcon:o,columns:s,sectionClassName:c=`w-full`,headerClassName:l=`mb-[16px] flex items-center justify-between px-[16px]`,titleClassName:u=`flex-1 min-w-0 text-[18px] leading-[24px] font-medium line-clamp-1 text-text2`,moreLinkClassName:d=`ml-[8px] flex size-[24px] shrink-0 items-center justify-center opacity-50`,containerClassName:f=`relative flex w-full gap-[15px] px-[16px]`,overlay:p,footer:g,getItemRef:_,selectionMode:y=!1,selectedIds:b,onToggleSelection:x,onItemClick:S}){return h(t,{className:c,children:[h(t,{className:l,children:[m(n,{className:u,children:e}),o&&i&&m(r,{href:i,"aria-label":`更多`,className:d,onClick:a,children:o}),o&&!i&&a&&m(`button`,{type:`button`,"aria-label":`更多`,className:d,onClick:a,children:o})]}),h(t,{className:f,children:[m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.left.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`left`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.right.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`right`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),p]}),g]})}function v({item:_,selectionMode:v=!1,selectedIds:y,onToggleSelection:b,onItemClick:x}){let S=_.cardKind===`short`?u:d,C=_.selectionId??``,w=!!(C&&y?.has(C)),T=f(_),E=l(T.topLeftBadgeImageUrl);function D(){!v||!C||b?.(C)}let O=h(p,{children:[h(t,{className:`relative w-full overflow-hidden rounded-[8px] bg-[#18111f]`,style:{aspectRatio:S},children:[_.coverUrl&&m(e,{src:_.coverUrl,alt:_.title||`推荐封面`,fill:!0,objectFit:`cover`,className:`object-cover`}),m(t,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:g,"aria-hidden":!0}),v&&m(t,{className:`pointer-events-none absolute left-[8px] top-[8px] z-[2]`,children:m(w?o:a,{})}),!v&&h(p,{children:[E&&m(t,{className:c,children:m(e,{src:E,alt:`角标`,width:96,height:18,className:s})}),T.topRightScoreText&&m(n,{as:`span`,className:`absolute right-[8px] top-[8px] z-[1] shrink-0 text-[14px] leading-[22px] font-semibold text-[#FFC24B]`,children:T.topRightScoreText}),h(t,{className:`absolute left-[8px] right-[8px] bottom-[10px] z-[1] flex items-end justify-between gap-[8px]`,children:[m(t,{className:`flex min-w-0 items-center gap-[4px]`,children:T.bottomLeftHeatText&&h(p,{children:[m(i,{className:`h-[16px] w-[16px] shrink-0 text-white`}),m(n,{as:`span`,className:`min-w-0 truncate text-[14px] leading-[20px] text-white`,children:T.bottomLeftHeatText})]})}),T.bottomRightEpisodeText&&m(n,{as:`span`,className:`shrink-0 text-[14px] leading-[20px] text-white`,children:T.bottomRightEpisodeText})]})]})]}),!v&&m(t,{className:`mt-[8px] overflow-hidden`,children:m(n,{as:`h3`,className:`line-clamp-2 text-[16px] leading-[22px] text-[--color-text-white80]`,children:T.title})})]});return v?m(`button`,{type:`button`,className:`mb-[16px] block w-full cursor-pointer border-0 bg-transparent p-0 text-left`,onClick:D,"aria-pressed":w,disabled:!C,children:O}):m(r,{href:_.href,className:`mb-[16px] block w-full`,onClick:()=>x?.(_),children:O})}export{_ as WaterfallRecommend};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{parseResolution as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{Button as n}from"../../ui/button.mjs";import{eventKey as r}from"../../../constants/event-key.mjs";import i from"../video-player/index.mjs";import a from"./popup-video.module.mjs";import{usePathname as o}from"next/navigation";import{useCallback as s,useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(){let f=o(),[p,m]=l(!1),[h,g]=l(null),[_,v]=l(0),y=s(t=>{if(typeof window>`u`)return 0;let{width:n,height:r}=e(t.resolution);return n<=0?0:Math.max(0,r*(window.innerWidth/n))},[]),b=s(({info:e,show:t})=>{if(!e||!t){m(!1),g(null);return}g(e),v(y(e)),m(!0)},[y]);return c(()=>(t.on(r.SHOW_POPUP_VIDEO,b),()=>{t.off(r.SHOW_POPUP_VIDEO,b)}),[b]),c(()=>{m(!1),g(null)},[f]),!p||!h?null:d(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/95`,children:[u(n,{variant:`ghost`,className:`absolute left-4 top-4 h-10 w-10 rounded-full border border-white/20 text-white`,onClick:()=>{m(!1),g(null)},children:`←`}),u(`div`,{className:a.popupVideo,style:{width:`100%`,maxHeight:`100%`,height:_>0?`${_}px`:`auto`},children:u(i,{plyerId:h.plyerId,resolution:h.resolution,poster:h.poster||``,videoUrl:h.videoUrl||``,hlsList:h.hlsList,mergeConfig:_>0?{}:{fitVideoSize:`fixWidth`}})})]})}export{f as default};
2
+ "use client";import{parseResolution as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{Button as n}from"../../ui/button.mjs";import{eventKey as r}from"../../../constants/event-key.mjs";import i from"../video-player/index.mjs";import a from"./popup-video.module.mjs";import{useCallback as o,useEffect as s,useState as c}from"react";import{usePathname as l}from"next/navigation";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(){let f=l(),[p,m]=c(!1),[h,g]=c(null),[_,v]=c(0),y=o(t=>{if(typeof window>`u`)return 0;let{width:n,height:r}=e(t.resolution);return n<=0?0:Math.max(0,r*(window.innerWidth/n))},[]),b=o(({info:e,show:t})=>{if(!e||!t){m(!1),g(null);return}g(e),v(y(e)),m(!0)},[y]);return s(()=>(t.on(r.SHOW_POPUP_VIDEO,b),()=>{t.off(r.SHOW_POPUP_VIDEO,b)}),[b]),s(()=>{m(!1),g(null)},[f]),!p||!h?null:d(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/95`,children:[u(n,{variant:`ghost`,className:`absolute left-4 top-4 h-10 w-10 rounded-full border border-white/20 text-white`,onClick:()=>{m(!1),g(null)},children:`←`}),u(`div`,{className:a.popupVideo,style:{width:`100%`,maxHeight:`100%`,height:_>0?`${_}px`:`auto`},children:u(i,{plyerId:h.plyerId,resolution:h.resolution,poster:h.poster||``,videoUrl:h.videoUrl||``,hlsList:h.hlsList,mergeConfig:_>0?{}:{fitVideoSize:`fixWidth`}})})]})}export{f as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{trackPageClick as e}from"../../../utils/tracking.mjs";import{Box as t}from"../../ui/box.mjs";import{Text as n}from"../../ui/text.mjs";import{Sheet as r,SheetContent as i,SheetHeader as a,SheetTitle as o}from"../../ui/sheet.mjs";import{Switch as s}from"../../ui/switch.mjs";import{useKeepAliveState as c}from"../keep-scroll-position/index.mjs";import l from"../../../assets/icons/common/right_arrow.mjs";import u from"../../ui/popup.mjs";import{toast as d}from"sonner";import{useCallback as f,useEffect as p,useMemo as m,useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as ee}from"next-intl";const b=`funhub:detail-series-popup-query`,x=`funhub:detail-series-popup-close`;function S(e){return e.type===b&&e instanceof CustomEvent}function C({active:e}){return e?y(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0`,"aria-hidden":!0,children:[v(`circle`,{cx:`16`,cy:`12`,r:`3`,fill:`white`}),v(`path`,{d:`M8 5H16C19.866 5 23 8.13401 23 12C23 15.866 19.866 19 16 19H8C4.13401 19 1 15.866 1 12C1 8.13401 4.13401 5 8 5ZM16 15C17.6569 15 19 13.6569 19 12C19 10.3431 17.6569 9 16 9C14.3431 9 13 10.3431 13 12C13 13.6569 14.3431 15 16 15Z`,fill:`#9054E5`})]}):y(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0`,"aria-hidden":!0,children:[v(`path`,{d:`M1.5 12C1.5 8.68629 4.18629 6 7.5 6H16.5C19.8137 6 22.5 8.68629 22.5 12C22.5 15.3137 19.8137 18 16.5 18H7.5C4.18629 18 1.5 15.3137 1.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,strokeOpacity:`0.6`}),v(`circle`,{cx:`9`,cy:`12`,r:`3`,fill:`rgba(255,255,255,0.6)`})]})}function te(){return v(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`block h-[20px] w-[20px]`,"aria-hidden":!0,children:v(`path`,{d:`M10 8.61116L14.8611 3.75L16.25 5.13889L11.3889 10L16.25 14.8611L14.8611 16.25L10 11.3889L5.13889 16.25L3.75 14.8611L8.61111 10L3.75 5.13889L5.13889 3.75L10 8.61116Z`,fill:`currentColor`})})}function w(e,t){let n=String(t||``).trim();if(!n)return e;let r=e.replace(/\s+/g,``);return n.replace(/\s+/g,``)===r?e:`${e} ${n}`}function T(e,t,n){return(e||[]).map((e,r)=>{let i=Number.parseInt(e?.id||``,10),a=Number.isNaN(i)?r+1:i,o=e?.name||``,s=w(n(a),o);return{id:e?.id||`${t}-${a}`,series_num:a,title:s}})}function E(e,t,n){return(e||[]).map((e,r)=>{let i=Number(e?.id),a=Number.isNaN(i)?r+1:i,o=n(a);return{id:e?.id||`${t}-${a}`,series_num:a,title:o}})}function D(e,t,n){return e<=0?n(`singleContent`):n(t===`1`?`completedSeriesTotal`:`ongoingSeriesTotal`,{total:e})}function O(){return v(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-[8px] p-[0.5px]`,style:{backgroundImage:`linear-gradient(90deg, rgba(255,30,172,0.7) 0%, rgba(108,67,238,0) 100%), linear-gradient(180deg, #9756E3 0%, #6C43EE 100%)`},children:v(`span`,{className:`block h-full w-full`,style:{borderRadius:`7.5px`,backgroundColor:`#000000`,backgroundImage:`linear-gradient(90deg, rgba(246,206,255,0.1) 0%, rgba(246,206,255,0.1) 100%), linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.1) 100%)`}})})}function k(e){return e.mode===`detail`?v(j,{information:e.information,series_num:e.series_num,onEpisodeChange:e.onEpisodeChange}):v(A,{open:e.open,variant:e.variant,title:e.title,videoTitle:e.videoTitle,updateStatus:e.updateStatus,summaryText:e.summaryText,seriesList:e.seriesList,activeEpisodeId:e.activeEpisodeId,showEpisodeTitle:e.showEpisodeTitle,onToggleTitle:e.onToggleTitle,onClose:e.onClose,onSelectEpisode:e.onSelectEpisode,popupBodyStyle:e.popupBodyStyle,popupStylePreset:e.popupStylePreset})}function A({open:e,variant:c,title:l,videoTitle:d,updateStatus:_,summaryText:b,seriesList:x,activeEpisodeId:S,showEpisodeTitle:E=!1,onToggleTitle:k,onClose:A,onSelectEpisode:j,popupBodyStyle:M,popupStylePreset:N=`default`}){let P=ee(`components.common.seriesEpisodes`),F=!!k,I=F&&E,L=c===`popup`&&N===`detail-style-one`,R=h(null),z=h(null),B=m(()=>T(x,`episode`,e=>P(`episodeLabel`,{episode:e})),[x,P]),V=m(()=>{if(B.length===0)return[];let e=[];return B.forEach((t,n)=>{let r=Math.floor(n/50);e[r]||(e[r]=[]),e[r].push(t)}),e},[B,50]),H=m(()=>{if(!S)return 0;let e=B.findIndex(e=>e.id===S);return e<0?0:Math.floor(e/50)},[S,B,50]),[U,W]=g(H);p(()=>{W(H)},[H]);let G=m(()=>typeof b==`string`&&b.trim()?b:D(B.length,_,P),[B.length,b,P,_]),K=l||P(`selectorTitle`),q=String(d||``).trim(),J=f(e=>w(P(`episodeLabel`,{episode:e.series_num}),q),[q,P]);function Y(){let e=R.current;if(e){z.current&&=(window.cancelAnimationFrame(z.current),null),e.scrollTop=0;try{e.scrollTo({top:0,left:0,behavior:`auto`})}catch{}z.current=window.requestAnimationFrame(()=>{z.current=null;let e=R.current;e&&(e.scrollTop=0)})}}p(()=>{e&&Y()},[e,E,U]);function X(e){k&&(k(e),Y())}function Z(e){j?.(e.id,e.series_num),A()}let Q=I?2:5,$=V.length>1?v(`div`,{className:`shrink-0 w-full flex gap-[8px] overflow-x-auto`,children:V.map((e,t)=>{if(e.length===0)return null;let n=t===U,r=t*50+1,i=Math.min((t+1)*50,B.length);return y(`div`,{className:`shrink-0 px-[16px] py-[6px] rounded-[16px] text-[14px] transition-colors cursor-pointer relative overflow-hidden ${n?`text-theme5 bg-bg2`:`text-text2 bg-bg2`}`,onClick:()=>{W(t),Y()},children:[r,`-`,i,n&&v(`div`,{className:`absolute w-full h-full top-0 left-0 opacity-20 bg-theme5`})]},`series-group-${t}`)})}):null,ne=y(`div`,{className:`pb-[8px] flex justify-between`,children:[v(`span`,{className:`text-[16px] text-text1`,children:G}),F&&y(`div`,{className:`flex items-center gap-[4px]`,children:[v(s,{size:`sm`,className:`data-checked:bg-theme5 h-[20px] w-[33px]`,checked:E,onCheckedChange:e=>{X(!!e)}}),v(`button`,{type:`button`,className:`text-[16px] text-text1`,onClick:()=>{X(!E)},children:P(`episodeTitle`)})]})]}),re=v(`div`,{className:`grid w-full gap-2 ${Q===2?`grid-cols-2`:`grid-cols-5`}`,children:(V[U]||[]).map((e,t)=>{let n=!!(S&&e.id===S);return v(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`flex items-center justify-center w-full h-[56px] rounded-[8px] transition-colors ${n?``:`bg-white/10`} cursor-pointer select-none transition-colors relative overflow-hidden ${I?`h-[72px] px-[10px] text-[14px]`:``} ${t%Q===0?``:`border-l-0`}`,children:I?v(`span`,{className:`block w-full truncate leading-[22px]`,children:J(e)}):e.series_num},e.id)})}),ie=V.length>1?v(`div`,{className:`flex gap-[8px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:V.map((e,t)=>{if(e.length===0)return null;let n=t===U,r=t*50+1,i=Math.min((t+1)*50,B.length);return v(`button`,{type:`button`,className:`flex h-[28px] w-[72px] shrink-0 items-center justify-center rounded-[100px] px-[4px] transition-colors ${n?`bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-white`:`bg-white/20 text-white`}`,onClick:()=>{W(t),Y()},children:y(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px]`,children:[r,`-`,i]})},`series-popup-group-${t}`)})}):null,ae=y(`div`,{className:`flex items-center justify-between`,children:[v(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/60`,children:G}),F&&y(`button`,{type:`button`,className:`flex items-center gap-[3px] text-white/60`,onClick:()=>{X(!E)},children:[v(C,{active:E}),v(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/60`,children:P(`episodeTitle`)})]})]}),oe=I?v(`div`,{className:`flex w-full flex-col gap-[12px]`,children:(V[U]||[]).map(e=>{let t=!!(S&&e.id===S);return y(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`relative flex w-full items-start overflow-hidden rounded-[8px] px-[16px] py-[18px] text-left transition-colors ${t?L?``:`border border-[#FF1EFF] bg-[linear-gradient(90deg,rgba(246,206,255,0.1)_0%,rgba(246,206,255,0.1)_100%),linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)]`:`bg-white/10`}`,children:[t&&L&&v(O,{}),v(`span`,{className:`relative z-[1] block w-full truncate font-['PingFang_SC'] text-[14px] ${t?`font-medium leading-[16px] text-[#CA3FE9]`:`font-normal leading-[16px] text-white/80`}`,children:J(e)})]},`popup-${e.id}`)})}):v(`div`,{className:`grid w-full grid-cols-[repeat(6,52px)] justify-between gap-y-[8px]`,children:(V[U]||[]).map(e=>{let t=!!(S&&e.id===S);return y(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`relative flex h-[52px] w-[52px] items-center justify-center overflow-hidden rounded-[8px] transition-colors ${t?L?`text-[#9756E3]`:`border border-[#E62AFF]/90 bg-[linear-gradient(90deg,rgba(246,206,255,0.1)_0%,rgba(246,206,255,0.1)_100%),linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)] text-[#9756E3]`:`bg-white/10 text-white/80`}`,children:[t&&L&&v(O,{}),v(`span`,{className:`relative z-[1] font-['PingFang_SC'] text-[16px] font-medium not-italic leading-[16px]`,children:e.series_num})]},`popup-${e.id}`)})});return c===`sheet`?v(r,{open:e,onOpenChange:e=>!e&&A(),children:y(i,{side:`bottom`,showCloseButton:!0,className:`min-h-[50vh] bg-bg1 text-text1 rounded-t-2xl border-t border-white/10`,children:[v(a,{className:`pt-3 pb-0`,children:v(o,{className:`flex items-center justify-between text-lg text-text1`,children:K})}),y(`div`,{className:`px-4 pb-2 flex flex-col gap-3`,children:[$,ne]}),v(`div`,{ref:R,className:`flex-1 h-0 pt-[4px] pb-[12px] overflow-y-auto px-4`,children:re})]})}):v(u,{open:e,onOpenChange:e=>{e||A()},showCloseButton:!1,className:`!gap-0 !border-0 !bg-transparent !p-0 !shadow-none`,overlayClassName:`bg-black/50 backdrop-blur-0`,children:y(t,{className:`flex h-full w-full flex-col overflow-hidden rounded-t-[16px] bg-black text-text1`,style:{height:`70vh`,...M},children:[y(t,{className:`shrink-0 flex items-center justify-between px-[16px] pt-[32px]`,children:[v(n,{className:`font-['PingFang_SC'] text-[18px] font-medium not-italic leading-[24px] text-white`,children:K}),v(`button`,{type:`button`,"aria-label":`关闭`,className:`flex h-[24px] w-[24px] items-center justify-center text-white opacity-60`,onClick:A,children:v(`span`,{className:`flex h-[24px] w-[24px] items-center overflow-hidden p-[2px]`,children:v(te,{})})})]}),v(t,{className:`flex-1 h-0 w-full px-[16px] pb-[24px]`,children:y(t,{className:`flex h-full flex-col`,children:[ie&&v(t,{className:`mt-[16px] shrink-0`,children:ie}),v(t,{className:`mt-[16px] shrink-0`,children:ae}),v(t,{ref:R,className:`flex-1 overflow-y-auto pb-[17px] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden ${I?`mt-[12px]`:`mt-[8px]`}`,children:oe})]})})]})})}function j({information:r,series_num:i,onEpisodeChange:a}){let o=ee(`components.common`),[s,u]=c(`detail-series-popup-${r.id}`,!1),[C,te]=c(`detail-series-title-toggle-${r.id}`,!1),[w,T]=c(`detail-series-scroll-left-${r.id}`,null),[D,k]=g(i);p(()=>{k(i)},[r.id,i]),p(()=>{if(typeof window>`u`)return;let e=()=>{u(!1)};return window.addEventListener(x,e),()=>{window.removeEventListener(x,e)}},[u]),p(()=>{if(typeof window>`u`)return;let e=e=>{if(!S(e))return;let t=e.detail||{};t.open=!!t.open||!!s};return window.addEventListener(b,e),()=>{window.removeEventListener(b,e)}},[s]),p(()=>{s&&e(`page_video_detail`,`详情页`,null,`detail_select_episode_popup`)},[s]);let j=m(()=>E((r.links||[]).map(e=>({id:e.id,name:e.name})),r.id||`episode`,e=>o(`seriesEpisodes.episodeLabel`,{episode:e})),[r.id,r.links,o]),M=r.update_status===`1`?o(`seriesEpisodes.completedSeriesTotal`,{total:r.links.length}):o(`seriesEpisodes.ongoingSeriesUpdatedTo`,{total:r.links.length}),N=m(()=>r.links[D-1]?.id||r.links[0]?.id||``,[r.links,D]),P=h(null),F=h(null),I=h(null),L=h(!1),R=h(null),z=h(null),B=h(null),[V,H]=g(!1),U=f((e,t=`smooth`)=>{let n=P.current?.querySelector(`[data-content-id="${e}"]`);if(n&&P.current){let e=P.current,r=Math.max(0,n.offsetLeft-10);e.scrollTo({left:r,behavior:t})}},[]),W=f(()=>{z.current!==null&&(window.clearTimeout(z.current),z.current=null)},[]),G=f(()=>{B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),K=f(()=>{R.current!==null&&(d.dismiss(R.current),R.current=null),W(),G()},[G,W]),q=f(()=>{F.current=null,I.current=null,K(),H(!1)},[K]),J=f((e,t)=>{G(),B.current=window.setTimeout(()=>{B.current=null,F.current===e&&q()},Math.max(0,t))},[G,q]);p(()=>{L.current=!1},[r.id]),p(()=>{if(L.current||!N)return;let e=window.requestAnimationFrame(()=>{let e=P.current;e&&(typeof w==`number`?e.scrollTo({left:Math.max(0,w),behavior:`auto`}):(U(N,`auto`),T(Math.max(0,Math.round(e.scrollLeft)))),L.current=!0)});return()=>{window.cancelAnimationFrame(e)}},[N,w,U,T]),p(()=>{let e=F.current;!e||e!==i||J(e,1e3)},[J,i]),p(()=>()=>{q()},[q]);let Y=f((e,t,n)=>{let r=P.current;if(!r||!e)return t;let i=r.querySelector(`[data-content-id="${e}"]`);if(!i)return t;let a=r.getBoundingClientRect();if(a.width<=0||typeof n!=`number`||(n-a.left)/a.width<.5)return t;let o=i.offsetLeft+i.offsetWidth/2,s=r.clientWidth/2,c=Math.max(0,r.scrollWidth-r.clientWidth),l=Math.min(c,Math.max(0,o-s));return r.scrollTo({left:l,behavior:`smooth`}),Math.round(l)},[]),X=f((e,t=`inline`,n,s)=>{if(e!==D){if(!r.links[e-1]){d.error(o(`seriesEpisodes.episodeNotFound`));return}if(typeof window<`u`&&window.isWebView===!0){try{k(e);let c=n||r.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),T(Math.max(0,Math.round(P.current?.scrollLeft||0)))):T(Y(c,l,s)),H(!0),K(),R.current=d.loading(o(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(k(i),q(),d.error(o(`seriesEpisodes.episodeSwitchFailed`)))},3e3),a(e)}catch(e){k(i),q(),console.error(`切换剧集失败`,e),d.error(o(`seriesEpisodes.episodeSwitchFailed`))}return}try{k(e);let c=n||r.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),T(Math.max(0,Math.round(P.current?.scrollLeft||0)))):T(Y(c,l,s)),H(!0),K(),R.current=d.loading(o(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(k(i),q(),d.error(o(`seriesEpisodes.episodeSwitchFailed`)))},8e3),a(e)}catch(e){k(i),q(),console.error(`切换剧集失败`,e),d.error(o(`seriesEpisodes.episodeSwitchFailed`))}}},[q,K,r.links,a,D,i,Y,U,T,o]),[Z,Q]=g(`70vh`),$=f(()=>{if(typeof window>`u`)return;if(window.isWebView===!0){Q(`100vh`);return}let e=document.getElementById(`selectPopupPosition`),t=window.visualViewport?.height||window.innerHeight;if(!e){Q(`70vh`);return}let n=Math.max(0,t-e.offsetTop);if(n<=0){Q(`70vh`);return}Q(`${n}px`)},[]);return p(()=>{if(!s)return;$();let e=()=>{$()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[$,s]),j.length<=1?null:y(_,{children:[y(t,{className:`w-full mt-[16px] flex flex-col items-end mb-[4px]`,children:[y(t,{className:`w-fit flex items-center px-[12px] h-[28px]`,onClick:()=>{e(`page_video_detail`,`详情页`,null,`detail_select_episode_btn`),u(!0)},children:[v(n,{className:`text-[14px] text-text2 leading-[20px]`,children:M}),v(l,{className:`w-[11px] h-[18px] ml-[4px] text-text2`})]}),v(`div`,{ref:P,className:`w-full mt-[12px] overflow-x-auto px-[12px] flex gap-x-[8px] h-[56px] ${V?`touch-none`:``}`,children:j.map((t,r)=>y(`div`,{"data-content-id":t.id,className:`relative shrink-0 h-[full] overflow-hidden px-[18px] rounded-[8px] flex items-center justify-center ${C?`min-w-[88px] h-[40px]`:`w-[56px] !px-[0] justify-center`} ${t.id===N?`bg-transparent`:`bg-white/10`}`,onClick:n=>{e(`page_video_detail`,`详情页`,n,`detail_episode_click`,{episode_num:r+1,episode_id:t.id}),X(r+1,`inline`,t.id,n.clientX)},children:[t.id===N&&v(O,{}),v(n,{className:`relative z-[1] text-[14px] text-text1 leading-[22px] line-clamp-2 ${t.id===N?`!text-[#CA3FE9]`:``}`,children:C?t.title:t.series_num})]},t.id))})]}),v(A,{title:o(`seriesEpisodes.selectorTitle`),videoTitle:r.name,variant:`popup`,open:s,updateStatus:r.update_status,summaryText:M,seriesList:(r.links||[]).map(e=>({id:e.id,name:e.name})),activeEpisodeId:N,showEpisodeTitle:C,onToggleTitle:e=>{te(e)},onClose:()=>u(!1),onSelectEpisode:(e,t)=>{u(!1),X(t,`popup`,e)},popupBodyStyle:{height:Z},popupStylePreset:`default`})]})}export{O as DetailStyleOneActiveBorderLayer,k as SeriesEpisodes};
2
+ "use client";import{trackPageClick as e}from"../../../utils/tracking.mjs";import{Box as t}from"../../ui/box.mjs";import{Text as n}from"../../ui/text.mjs";import{Sheet as r,SheetContent as i,SheetHeader as a,SheetTitle as o}from"../../ui/sheet.mjs";import{Switch as s}from"../../ui/switch.mjs";import{useKeepAliveState as c}from"../keep-scroll-position/index.mjs";import l from"../../../assets/icons/common/right_arrow.mjs";import u from"../../ui/popup.mjs";import{toast as d}from"sonner";import{useCallback as f,useEffect as p,useMemo as m,useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as ee}from"next-intl";const b=`funhub:detail-series-popup-query`,x=`funhub:detail-series-popup-close`;function S(e){return e.type===b&&e instanceof CustomEvent}function C({active:e}){return e?y(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0`,"aria-hidden":!0,children:[v(`circle`,{cx:`16`,cy:`12`,r:`3`,fill:`white`}),v(`path`,{d:`M8 5H16C19.866 5 23 8.13401 23 12C23 15.866 19.866 19 16 19H8C4.13401 19 1 15.866 1 12C1 8.13401 4.13401 5 8 5ZM16 15C17.6569 15 19 13.6569 19 12C19 10.3431 17.6569 9 16 9C14.3431 9 13 10.3431 13 12C13 13.6569 14.3431 15 16 15Z`,fill:`#9054E5`})]}):y(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0`,"aria-hidden":!0,children:[v(`path`,{d:`M1.5 12C1.5 8.68629 4.18629 6 7.5 6H16.5C19.8137 6 22.5 8.68629 22.5 12C22.5 15.3137 19.8137 18 16.5 18H7.5C4.18629 18 1.5 15.3137 1.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,strokeOpacity:`0.6`}),v(`circle`,{cx:`9`,cy:`12`,r:`3`,fill:`rgba(255,255,255,0.6)`})]})}function te(){return v(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`block h-[20px] w-[20px]`,"aria-hidden":!0,children:v(`path`,{d:`M10 8.61116L14.8611 3.75L16.25 5.13889L11.3889 10L16.25 14.8611L14.8611 16.25L10 11.3889L5.13889 16.25L3.75 14.8611L8.61111 10L3.75 5.13889L5.13889 3.75L10 8.61116Z`,fill:`currentColor`})})}function w(e,t){let n=String(t||``).trim();if(!n)return e;let r=e.replace(/\s+/g,``);return n.replace(/\s+/g,``)===r?e:`${e} ${n}`}function T(e,t,n){return(e||[]).map((e,r)=>{let i=Number.parseInt(e?.id||``,10),a=Number.isNaN(i)?r+1:i,o=e?.name||``,s=w(n(a),o);return{id:e?.id||`${t}-${a}`,series_num:a,title:s}})}function E(e,t,n){return(e||[]).map((e,r)=>{let i=Number(e?.id),a=Number.isNaN(i)?r+1:i,o=n(a);return{id:e?.id||`${t}-${a}`,series_num:a,title:o}})}function D(e,t,n){return e<=0?n(`singleContent`):n(t===`1`?`completedSeriesTotal`:`ongoingSeriesTotal`,{total:e})}function O(){return v(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-[8px] p-[0.5px]`,style:{backgroundImage:`linear-gradient(90deg, rgba(255,30,172,0.7) 0%, rgba(108,67,238,0) 100%), linear-gradient(180deg, #9756E3 0%, #6C43EE 100%)`},children:v(`span`,{className:`block h-full w-full`,style:{borderRadius:`7.5px`,backgroundColor:`#000000`,backgroundImage:`linear-gradient(90deg, rgba(246,206,255,0.1) 0%, rgba(246,206,255,0.1) 100%), linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.1) 100%)`}})})}function k(e){return e.mode===`detail`?v(j,{information:e.information,series_num:e.series_num,onEpisodeChange:e.onEpisodeChange}):v(A,{open:e.open,variant:e.variant,title:e.title,videoTitle:e.videoTitle,updateStatus:e.updateStatus,summaryText:e.summaryText,seriesList:e.seriesList,activeEpisodeId:e.activeEpisodeId,showEpisodeTitle:e.showEpisodeTitle,onToggleTitle:e.onToggleTitle,onClose:e.onClose,onSelectEpisode:e.onSelectEpisode,popupBodyStyle:e.popupBodyStyle,popupStylePreset:e.popupStylePreset})}function A({open:e,variant:c,title:l,videoTitle:d,updateStatus:_,summaryText:b,seriesList:x,activeEpisodeId:S,showEpisodeTitle:E=!1,onToggleTitle:k,onClose:A,onSelectEpisode:j,popupBodyStyle:M,popupStylePreset:N=`default`}){let P=ee(`components.common.seriesEpisodes`),F=!!k,I=F&&E,L=c===`popup`&&N===`detail-style-one`,R=h(null),z=h(null),B=m(()=>T(x,`episode`,e=>P(`episodeLabel`,{episode:e})),[x,P]),V=m(()=>{if(B.length===0)return[];let e=[];return B.forEach((t,n)=>{let r=Math.floor(n/50);e[r]||(e[r]=[]),e[r].push(t)}),e},[B,50]),H=m(()=>{if(!S)return 0;let e=B.findIndex(e=>e.id===S);return e<0?0:Math.floor(e/50)},[S,B,50]),[U,W]=g(H);p(()=>{W(H)},[H]);let G=m(()=>typeof b==`string`&&b.trim()?b:D(B.length,_,P),[B.length,b,P,_]),K=l||P(`selectorTitle`),q=String(d||``).trim(),J=f(e=>w(P(`episodeLabel`,{episode:e.series_num}),q),[q,P]);function Y(){let e=R.current;if(e){z.current&&=(window.cancelAnimationFrame(z.current),null),e.scrollTop=0;try{e.scrollTo({top:0,left:0,behavior:`auto`})}catch{}z.current=window.requestAnimationFrame(()=>{z.current=null;let e=R.current;e&&(e.scrollTop=0)})}}p(()=>{e&&Y()},[e,E,U]);function X(e){k&&(k(e),Y())}function Z(e){j?.(e.id,e.series_num),A()}let Q=I?2:5,$=V.length>1?v(`div`,{className:`shrink-0 w-full flex gap-[8px] overflow-x-auto`,children:V.map((e,t)=>{if(e.length===0)return null;let n=t===U,r=t*50+1,i=Math.min((t+1)*50,B.length);return y(`div`,{className:`shrink-0 px-[16px] py-[6px] rounded-[16px] text-[14px] transition-colors cursor-pointer relative overflow-hidden ${n?`text-theme5 bg-bg2`:`text-text2 bg-bg2`}`,onClick:()=>{W(t),Y()},children:[r,`-`,i,n&&v(`div`,{className:`absolute w-full h-full top-0 left-0 opacity-20 bg-theme5`})]},`series-group-${t}`)})}):null,ne=y(`div`,{className:`pb-[8px] flex justify-between`,children:[v(`span`,{className:`text-[16px] text-text1`,children:G}),F&&y(`div`,{className:`flex items-center gap-[4px]`,children:[v(s,{size:`sm`,className:`data-checked:bg-theme5 h-[20px] w-[33px]`,checked:E,onCheckedChange:e=>{X(!!e)}}),v(`button`,{type:`button`,className:`text-[16px] text-text1`,onClick:()=>{X(!E)},children:P(`episodeTitle`)})]})]}),re=v(`div`,{className:`grid w-full gap-2 ${Q===2?`grid-cols-2`:`grid-cols-5`}`,children:(V[U]||[]).map((e,t)=>{let n=!!(S&&e.id===S);return v(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`flex items-center justify-center w-full h-[60px] rounded-[8px] border border-line1 border-solid text-[16px] cursor-pointer select-none transition-colors relative overflow-hidden ${n?`font-bold text-theme5 bg-line1`:`text-text1`} ${I?`h-[72px] px-[10px] text-[14px]`:``} ${t%Q===0?``:`border-l-0`}`,children:I?v(`span`,{className:`block w-full truncate leading-[22px]`,children:J(e)}):e.series_num},e.id)})}),ie=V.length>1?v(`div`,{className:`flex gap-[8px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:V.map((e,t)=>{if(e.length===0)return null;let n=t===U,r=t*50+1,i=Math.min((t+1)*50,B.length);return v(`button`,{type:`button`,className:`flex h-[28px] w-[72px] shrink-0 items-center justify-center rounded-[100px] px-[4px] transition-colors ${n?`bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-white`:`bg-white/20 text-white`}`,onClick:()=>{W(t),Y()},children:y(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px]`,children:[r,`-`,i]})},`series-popup-group-${t}`)})}):null,ae=y(`div`,{className:`flex items-center justify-between`,children:[v(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/60`,children:G}),F&&y(`button`,{type:`button`,className:`flex items-center gap-[3px] text-white/60`,onClick:()=>{X(!E)},children:[v(C,{active:E}),v(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/60`,children:P(`episodeTitle`)})]})]}),oe=I?v(`div`,{className:`flex w-full flex-col gap-[12px]`,children:(V[U]||[]).map(e=>{let t=!!(S&&e.id===S);return y(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`relative flex w-full items-start overflow-hidden rounded-[8px] px-[16px] py-[18px] text-left transition-colors ${t?L?``:`border border-[#FF1EFF] bg-[linear-gradient(90deg,rgba(246,206,255,0.1)_0%,rgba(246,206,255,0.1)_100%),linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)]`:`bg-white/10`}`,children:[t&&L&&v(O,{}),v(`span`,{className:`relative z-[1] block w-full truncate font-['PingFang_SC'] text-[14px] ${t?`font-medium leading-[16px] text-[#CA3FE9]`:`font-normal leading-[16px] text-white/80`}`,children:J(e)})]},`popup-${e.id}`)})}):v(`div`,{className:`grid w-full grid-cols-[repeat(6,52px)] justify-between gap-y-[8px]`,children:(V[U]||[]).map(e=>{let t=!!(S&&e.id===S);return y(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`relative flex h-[52px] w-[52px] items-center justify-center overflow-hidden rounded-[8px] transition-colors ${t?L?`text-[#9756E3]`:`border border-[#E62AFF]/90 bg-[linear-gradient(90deg,rgba(246,206,255,0.1)_0%,rgba(246,206,255,0.1)_100%),linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)] text-[#9756E3]`:`bg-white/10 text-white/80`}`,children:[t&&L&&v(O,{}),v(`span`,{className:`relative z-[1] font-['PingFang_SC'] text-[16px] font-medium not-italic leading-[16px]`,children:e.series_num})]},`popup-${e.id}`)})});return c===`sheet`?v(r,{open:e,onOpenChange:e=>!e&&A(),children:y(i,{side:`bottom`,showCloseButton:!0,className:`min-h-[50vh] bg-bg1 text-text1 rounded-t-2xl border-t border-white/10`,children:[v(a,{className:`pt-3 pb-0`,children:v(o,{className:`flex items-center justify-between text-lg text-text1`,children:K})}),y(`div`,{className:`px-4 pb-2 flex flex-col gap-3`,children:[$,ne]}),v(`div`,{ref:R,className:`flex-1 h-0 pt-[4px] pb-[12px] overflow-y-auto px-4`,children:re})]})}):v(u,{open:e,onOpenChange:e=>{e||A()},showCloseButton:!1,className:`!gap-0 !border-0 !bg-transparent !p-0 !shadow-none`,overlayClassName:`bg-black/50 backdrop-blur-0`,children:y(t,{className:`flex h-full w-full flex-col overflow-hidden rounded-t-[16px] bg-black text-text1`,style:{height:`70vh`,...M},children:[y(t,{className:`shrink-0 flex items-center justify-between px-[16px] pt-[32px]`,children:[v(n,{className:`font-['PingFang_SC'] text-[18px] font-medium not-italic leading-[24px] text-white`,children:K}),v(`button`,{type:`button`,"aria-label":`关闭`,className:`flex h-[24px] w-[24px] items-center justify-center text-white opacity-60`,onClick:A,children:v(`span`,{className:`flex h-[24px] w-[24px] items-center overflow-hidden p-[2px]`,children:v(te,{})})})]}),v(t,{className:`flex-1 h-0 w-full px-[16px] pb-[24px]`,children:y(t,{className:`flex h-full flex-col`,children:[ie&&v(t,{className:`mt-[16px] shrink-0`,children:ie}),v(t,{className:`mt-[16px] shrink-0`,children:ae}),v(t,{ref:R,className:`flex-1 overflow-y-auto pb-[17px] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden ${I?`mt-[12px]`:`mt-[8px]`}`,children:oe})]})})]})})}function j({information:r,series_num:i,onEpisodeChange:a}){let o=ee(`components.common`),[s,u]=c(`detail-series-popup-${r.id}`,!1),[C,te]=c(`detail-series-title-toggle-${r.id}`,!1),[w,T]=c(`detail-series-scroll-left-${r.id}`,null),[D,k]=g(i);p(()=>{k(i)},[r.id,i]),p(()=>{if(typeof window>`u`)return;let e=()=>{u(!1)};return window.addEventListener(x,e),()=>{window.removeEventListener(x,e)}},[u]),p(()=>{if(typeof window>`u`)return;let e=e=>{if(!S(e))return;let t=e.detail||{};t.open=!!t.open||!!s};return window.addEventListener(b,e),()=>{window.removeEventListener(b,e)}},[s]),p(()=>{s&&e(`page_video_detail`,`详情页`,null,`detail_select_episode_popup`)},[s]);let j=m(()=>E((r.links||[]).map(e=>({id:e.id,name:e.name})),r.id||`episode`,e=>o(`seriesEpisodes.episodeLabel`,{episode:e})),[r.id,r.links,o]),M=r.update_status===`1`?o(`seriesEpisodes.completedSeriesTotal`,{total:r.links.length}):o(`seriesEpisodes.ongoingSeriesUpdatedTo`,{total:r.links.length}),N=m(()=>r.links[D-1]?.id||r.links[0]?.id||``,[r.links,D]),P=h(null),F=h(null),I=h(null),L=h(!1),R=h(null),z=h(null),B=h(null),[V,H]=g(!1),U=f((e,t=`smooth`)=>{let n=P.current?.querySelector(`[data-content-id="${e}"]`);if(n&&P.current){let e=P.current,r=Math.max(0,n.offsetLeft-10);e.scrollTo({left:r,behavior:t})}},[]),W=f(()=>{z.current!==null&&(window.clearTimeout(z.current),z.current=null)},[]),G=f(()=>{B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),K=f(()=>{R.current!==null&&(d.dismiss(R.current),R.current=null),W(),G()},[G,W]),q=f(()=>{F.current=null,I.current=null,K(),H(!1)},[K]),J=f((e,t)=>{G(),B.current=window.setTimeout(()=>{B.current=null,F.current===e&&q()},Math.max(0,t))},[G,q]);p(()=>{L.current=!1},[r.id]),p(()=>{if(L.current||!N)return;let e=window.requestAnimationFrame(()=>{let e=P.current;e&&(typeof w==`number`?e.scrollTo({left:Math.max(0,w),behavior:`auto`}):(U(N,`auto`),T(Math.max(0,Math.round(e.scrollLeft)))),L.current=!0)});return()=>{window.cancelAnimationFrame(e)}},[N,w,U,T]),p(()=>{let e=F.current;!e||e!==i||J(e,1e3)},[J,i]),p(()=>()=>{q()},[q]);let Y=f((e,t,n)=>{let r=P.current;if(!r||!e)return t;let i=r.querySelector(`[data-content-id="${e}"]`);if(!i)return t;let a=r.getBoundingClientRect();if(a.width<=0||typeof n!=`number`||(n-a.left)/a.width<.5)return t;let o=i.offsetLeft+i.offsetWidth/2,s=r.clientWidth/2,c=Math.max(0,r.scrollWidth-r.clientWidth),l=Math.min(c,Math.max(0,o-s));return r.scrollTo({left:l,behavior:`smooth`}),Math.round(l)},[]),X=f((e,t=`inline`,n,s)=>{if(e!==D){if(!r.links[e-1]){d.error(o(`seriesEpisodes.episodeNotFound`));return}if(typeof window<`u`&&window.isWebView===!0){try{k(e);let c=n||r.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),T(Math.max(0,Math.round(P.current?.scrollLeft||0)))):T(Y(c,l,s)),H(!0),K(),R.current=d.loading(o(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(k(i),q(),d.error(o(`seriesEpisodes.episodeSwitchFailed`)))},3e3),a(e)}catch(e){k(i),q(),console.error(`切换剧集失败`,e),d.error(o(`seriesEpisodes.episodeSwitchFailed`))}return}try{k(e);let c=n||r.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),T(Math.max(0,Math.round(P.current?.scrollLeft||0)))):T(Y(c,l,s)),H(!0),K(),R.current=d.loading(o(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(k(i),q(),d.error(o(`seriesEpisodes.episodeSwitchFailed`)))},8e3),a(e)}catch(e){k(i),q(),console.error(`切换剧集失败`,e),d.error(o(`seriesEpisodes.episodeSwitchFailed`))}}},[q,K,r.links,a,D,i,Y,U,T,o]),[Z,Q]=g(`70vh`),$=f(()=>{if(typeof window>`u`)return;if(window.isWebView===!0){Q(`100vh`);return}let e=document.getElementById(`selectPopupPosition`),t=window.visualViewport?.height||window.innerHeight;if(!e){Q(`70vh`);return}let n=Math.max(0,t-e.offsetTop);if(n<=0){Q(`70vh`);return}Q(`${n}px`)},[]);return p(()=>{if(!s)return;$();let e=()=>{$()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[$,s]),j.length<=1?null:y(_,{children:[y(t,{className:`w-full mt-[16px] flex flex-col items-end mb-[4px]`,children:[y(t,{className:`w-fit flex items-center px-[12px] h-[28px]`,onClick:()=>{e(`page_video_detail`,`详情页`,null,`detail_select_episode_btn`),u(!0)},children:[v(n,{className:`text-[14px] text-text2 leading-[20px]`,children:M}),v(l,{className:`w-[11px] h-[18px] ml-[4px] text-text2`})]}),v(`div`,{ref:P,className:`w-full mt-[12px] overflow-x-auto px-[12px] flex gap-x-[8px] ${C?`h-[76px]`:`h-[60px]`} ${V?`touch-none`:``}`,children:j.map((t,r)=>y(`div`,{"data-content-id":t.id,className:`relative shrink-0 h-[full] overflow-hidden px-[18px] rounded-[8px] border border-line1 flex items-center ${C?`w-[162px]`:`w-[60px] !px-[0] justify-center`} ${t.id===N?`border-transparent bg-transparent`:``}`,onClick:n=>{e(`page_video_detail`,`详情页`,n,`detail_episode_click`,{episode_num:r+1,episode_id:t.id}),X(r+1,`inline`,t.id,n.clientX)},children:[t.id===N&&v(O,{}),v(n,{className:`relative z-[1] text-[16px] text-text1 leading-[22px] line-clamp-2 ${t.id===N?`font-bold !text-[#CA3FE9]`:``}`,children:C?t.title:t.series_num})]},t.id))})]}),v(A,{title:o(`seriesEpisodes.selectorTitle`),videoTitle:r.name,variant:`popup`,open:s,updateStatus:r.update_status,summaryText:M,seriesList:(r.links||[]).map(e=>({id:e.id,name:e.name})),activeEpisodeId:N,showEpisodeTitle:C,onToggleTitle:e=>{te(e)},onClose:()=>u(!1),onSelectEpisode:(e,t)=>{u(!1),X(t,`popup`,e)},popupBodyStyle:{height:Z},popupStylePreset:`default`})]})}export{O as DetailStyleOneActiveBorderLayer,k as SeriesEpisodes};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import n from"../../ui/link.mjs";import r from"../../../assets/icons/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{usePathname as u}from"next/navigation";import{useEffect as d,useState as f,useTransition as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v=[`/nav-page`];function y(y){let{className:b}=y,x=u(),S=g(`tabBar`),[C,w]=f(null),[,T]=p(),[E]=f(0),[D,O]=f(!1),k=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:20,height:20},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:20,height:20},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:20,height:20}],A=(e,t,n)=>{t!==x&&w(t)};return d(()=>{C&&_(x,C)&&T(()=>{w(null)})},[x,C]),d(()=>{let e=setTimeout(()=>{O(!0)},0);return()=>clearTimeout(e)},[]),x&&v.some(e=>x.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center ${b||``}`,style:{background:`rgba(5, 1, 15, 0.1)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`},children:h(e,{className:`relative my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,children:[m(e,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:{background:`linear-gradient(0deg, rgba(6, 3, 21, 0.03) 0%, rgba(6, 3, 21, 0.03) 100%), rgba(255, 255, 255, 0.10)`},"aria-hidden":`true`}),m(e,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:{background:`linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%)`,padding:`1px`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,mask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,maskComposite:`exclude`},"aria-hidden":`true`}),k.map(r=>{let i=D&&x?_(C||x||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(e,{className:`flex flex-col items-center ${i?`gap-[5px]`:`gap-[4px]`}`,children:[r.badge&&E>0?m(l,{dot:!0,children:m(a,{width:20,height:20})}):m(a,{width:20,height:20}),m(t,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] ${i?`text-[#C043E8]`:`text-white/50`}`,children:S(r.labelKey)})]});return i?m(e,{className:`flex items-center justify-center`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex items-center justify-center`,onClick:e=>{A(e,r.path,r.labelKey)},children:o},r.id)})]})})}export{y as TabBar};
2
+ "use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import n from"../../ui/link.mjs";import r from"../../../assets/icons/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{useEffect as u,useState as d,useTransition as f}from"react";import{usePathname as p}from"next/navigation";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v=[`/nav-page`];function y(y){let{className:b}=y,x=p(),S=g(`tabBar`),[C,w]=d(null),[,T]=f(),[E]=d(0),[D,O]=d(!1),k=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:20,height:20},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:20,height:20},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:20,height:20}],A=(e,t,n)=>{t!==x&&w(t)};return u(()=>{C&&_(x,C)&&T(()=>{w(null)})},[x,C]),u(()=>{let e=setTimeout(()=>{O(!0)},0);return()=>clearTimeout(e)},[]),x&&v.some(e=>x.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center ${b||``}`,style:{background:`rgba(5, 1, 15, 0.90)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,paddingBottom:`env(safe-area-inset-bottom, 0px)`},children:m(e,{className:`my-[4px] flex h-[56px] w-[358px] items-center justify-between px-[40px]`,style:{background:`rgba(1, 0, 2, 0.80)`,borderRadius:`100px`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`,boxShadow:`0 12px 100px rgba(255, 255, 255, 0.20)`},children:k.map(r=>{let i=D&&x?_(C||x||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(e,{className:`flex flex-col items-center ${i?`gap-[5px]`:`gap-[4px]`}`,children:[r.badge&&E>0?m(l,{dot:!0,children:m(a,{width:20,height:20})}):m(a,{width:20,height:20}),m(t,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] ${i?`text-[#C043E8]`:`text-[#BFBFBF]`}`,children:S(r.labelKey)})]});return i?m(e,{className:`flex items-center justify-center`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex items-center justify-center`,onClick:e=>{A(e,r.path,r.labelKey)},children:o},r.id)})})})}export{y as TabBar};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{gContentGetAppChannelBlock as t,gContentGetAppChannels as n}from"../../../service/generated/client.mjs";import{trackAppPageView as r}from"../../../utils/tracking.mjs";import{Box as i}from"../../ui/box.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{queryKey as o}from"../../../constants/query-key.mjs";import{matchChannelByPath as s}from"../../pages/home/channel-matcher.mjs";import{TopNavBarFullscreen as c}from"./fullscreen.mjs";import{TopNavBarNormal as l}from"./normal.mjs";import{usePathname as u}from"next/navigation";import{useEffect as d,useMemo as f}from"react";import{jsx as p}from"react/jsx-runtime";function m(e){return e===`/`?[]:e.startsWith(`/category/`)?e.replace(`/category/`,``).split(`/`).map(e=>decodeURIComponent(e)):[]}function h({categoryPath:h,currentChannelId:g}){let _=u()||`/`,{data:v}=a([o.CHANNEL],()=>n()),y=f(()=>e(v?.data),[v?.data]),b=f(()=>typeof window>`u`?h||[]:m(_),[h,_]),x=f(()=>y.length===0?null:s(b,y),[b,y])?.id??g??``;d(()=>{r({page_key:`page_home_top_nav`,page_name:`首页顶部导航栏`})},[]);let{data:S}=a(o.GET_CONTENT_LIST(x),()=>t({channel_id:x}),{enabled:!!x}),C=f(()=>S?.data?.blocks||[],[S?.data?.blocks]),w=f(()=>C.length>0&&C[0].show_style===6,[C]);return p(i,{className:`w-full`,"data-top-nav-root":`true`,children:p(w?c:l,{channelDataList:y,currentChannelId:x})})}export{h as TopNavBar};
2
+ "use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{gContentGetAppChannelBlock as t,gContentGetAppChannels as n}from"../../../service/generated/client.mjs";import{trackAppPageView as r}from"../../../utils/tracking.mjs";import{Box as i}from"../../ui/box.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{queryKey as o}from"../../../constants/query-key.mjs";import{matchChannelByPath as s}from"../../pages/home/channel-matcher.mjs";import{TopNavBarFullscreen as c}from"./fullscreen.mjs";import{TopNavBarNormal as l}from"./normal.mjs";import{useEffect as u,useMemo as d}from"react";import{usePathname as f}from"next/navigation";import{jsx as p}from"react/jsx-runtime";function m(e){return e===`/`?[]:e.startsWith(`/category/`)?e.replace(`/category/`,``).split(`/`).map(e=>decodeURIComponent(e)):[]}function h({categoryPath:h,currentChannelId:g}){let _=f()||`/`,{data:v}=a([o.CHANNEL],()=>n()),y=d(()=>e(v?.data),[v?.data]),b=d(()=>typeof window>`u`?h||[]:m(_),[h,_]),x=d(()=>y.length===0?null:s(b,y),[b,y])?.id??g??``;u(()=>{r({page_key:`page_home_top_nav`,page_name:`首页顶部导航栏`})},[]);let{data:S}=a(o.GET_CONTENT_LIST(x),()=>t({channel_id:x}),{enabled:!!x}),C=d(()=>S?.data?.blocks||[],[S?.data?.blocks]),w=d(()=>C.length>0&&C[0].show_style===6,[C]);return p(i,{className:`w-full`,"data-top-nav-root":`true`,children:p(w?c:l,{channelDataList:y,currentChannelId:x})})}export{h as TopNavBar};
@@ -136,10 +136,6 @@ import e from"../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-
136
136
  display: none !important;
137
137
  }
138
138
 
139
- .style-module_videoBox__4Gmdw .xgplayer-volume.slide-show .xgplayer-slider {
140
- display: none !important;
141
- }
142
-
143
139
  .style-module_videoBox__4Gmdw .xgplayer.xgplayer-mobile.xgplayer-is-fullscreen .xg-inner-controls,
144
140
  .style-module_videoBox__4Gmdw .xgplayer.xgplayer-mobile.xgplayer-is-fullscreen .xgplayer-replay,
145
141
  .style-module_videoBox__4Gmdw .xgplayer.xgplayer-mobile.xgplayer-is-fullscreen .xgplayer-loading,
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pContentMatchAds as t}from"../../../service/generated/client.mjs";import{pContentMatchAdsKey as n}from"../../../service/generated/tanstack.mjs";import{trackAdClick as r,trackAdImpression as i}from"../../../utils/tracking.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{useVideoPlayerRef as o}from"./video-player-ref-context.mjs";import{create as s}from"zustand";import{createJSONStorage as c,persist as l}from"zustand/middleware";import{useEffect as u,useRef as d,useState as f}from"react";import{useIsClient as p}from"foxact/use-is-client";import{jsx as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";const g=s()(l((e,t)=>({shownVideoIds:new Set,hasShown:e=>t().shownVideoIds.has(e),markAsShown:n=>{let r=t().shownVideoIds;if(!r.has(n)){let t=new Set(r);t.add(n),e({shownVideoIds:t})}}}),{name:`video-blind-ad-storage`,storage:typeof window<`u`?c(()=>sessionStorage):void 0,partialize:e=>({shownVideoIds:Array.from(e.shownVideoIds)}),merge:(e,t)=>({...t,shownVideoIds:new Set(e.shownVideoIds||[])})})),_=`video_blind`;function v(e,t){return`${e}:${Math.max(1,Math.floor(Number(t)||1))}`}function y({videoId:s,episode:c}){let l=o(),y=p(),b=e(e=>e.userId),{hasShown:x,markAsShown:S}=g(),[C,w]=f(!1),T=d(!1),E={user_id:b,ad_type:`blind`},{data:D,isLoading:O}=a(n(E),()=>t(E)),k=v(s,c),A=x(k),j=D?.data?.materials?.[0]?.advertise_code||``,M=!A&&C;u(()=>{!M||!j||i({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`盲点广告`,ad_id:j,ad_type:`blind`})},[M,j]),u(()=>{if(!D||A)return;let e=(D.data?.settings?.trigger_video_progress_min??0)*60,t=null,n=null;function r(n){if(T.current){t?.off(`timeupdate`,r);return}Number(n?.currentTime||t?.currentTime||0)>=e&&(T.current=!0,w(!0))}function i(){let n=l?.current?.getPlayer?.();return n?(t=n,Number(n.currentTime||0)>=e?(T.current=!0,w(!0),!0):(n.on(`timeupdate`,r),!0)):!1}return i()||(n=window.setInterval(()=>{i()&&n!==null&&(window.clearInterval(n),n=null)},200)),()=>{n!==null&&window.clearInterval(n),t?.off(`timeupdate`,r)}},[l,D,A]),u(()=>{if(M)return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=``}},[M]);function N(){A||(j&&r({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`盲点广告`,ad_id:j,ad_type:`blind`}),S(k),window.open(D?.data.materials?.[0].advertise_url))}return!y||typeof document>`u`||O||D?.data?.hit===!1||A||!C?null:h(m(`div`,{className:`blind-ad-overlay fixed inset-0 h-screen w-screen z-[99999]`,onClick:N}),document.body)}export{y as VideoBlindAdOverlay};
2
+ "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pContentMatchAds as t}from"../../../service/generated/client.mjs";import{pContentMatchAdsKey as n}from"../../../service/generated/tanstack.mjs";import{trackAdClick as r,trackAdImpression as i}from"../../../utils/tracking.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{useVideoPlayerRef as o}from"./video-player-ref-context.mjs";import{create as s}from"zustand";import{createJSONStorage as c,persist as l}from"zustand/middleware";import{useEffect as u,useRef as d,useState as f}from"react";import{useIsClient as p}from"foxact/use-is-client";import{jsx as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";const g=s()(l((e,t)=>({shownVideoIds:new Set,hasShown:e=>t().shownVideoIds.has(e),markAsShown:n=>{let r=t().shownVideoIds;if(!r.has(n)){let t=new Set(r);t.add(n),e({shownVideoIds:t})}}}),{name:`video-blind-ad-storage`,storage:typeof window<`u`?c(()=>sessionStorage):void 0,partialize:e=>({shownVideoIds:Array.from(e.shownVideoIds)}),merge:(e,t)=>({...t,shownVideoIds:new Set(e.shownVideoIds||[])})})),_=`video_blind`;function v({videoId:s}){let c=o(),l=p(),v=e(e=>e.userId),{hasShown:y,markAsShown:b}=g(),x=d(0),S=d(null),[C,w]=f(!1),T=d(!1),E={user_id:v,ad_type:`blind`},{data:D,isLoading:O}=a(n(E),()=>t(E)),k=y(s),A=D?.data?.materials?.[0]?.advertise_code||``,j=!k&&C;u(()=>{!j||!A||i({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`盲点广告`,ad_id:A,ad_type:`blind`})},[j,A]),u(()=>{let e=c?.current?.getPlayer();if(!e||!D||k)return;let t=D.data?.settings?.trigger_video_progress_min??0;function n(r){if(T.current){e?.off(`timeupdate`,n);return}let i=r?.currentTime;if(S.current!==null){let e=i-S.current;e>0&&e<2&&(x.current+=e,!T.current&&x.current/60>=t&&(T.current=!0,w(!0)))}S.current=i}return e.on(`timeupdate`,n),()=>{e.off(`timeupdate`,n)}},[c,D,k]),u(()=>{if(j)return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=``}},[j]);function M(){k||(A&&r({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`盲点广告`,ad_id:A,ad_type:`blind`}),b(s),window.open(D?.data.materials?.[0].advertise_url))}return!l||typeof document>`u`||O||D?.data?.hit===!1||k||!C?null:h(m(`div`,{className:`blind-ad-overlay fixed inset-0 h-screen w-screen z-[99999]`,onClick:M}),document.body)}export{v as VideoBlindAdOverlay};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pContentMatchAds as t}from"../../../service/generated/client.mjs";import{pContentMatchAdsKey as n}from"../../../service/generated/tanstack.mjs";import{trackAdClick as r,trackAdImpression as i,trackAdvertising as a}from"../../../utils/tracking.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{useVideoPlayerRef as s}from"./video-player-ref-context.mjs";import{PrerollSkipButtonContent as c}from"./preroll-skip-button-content.mjs";import{useCallback as l,useEffect as u,useRef as d,useState as f}from"react";import{useIsClient as p}from"foxact/use-is-client";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{createPortal as g}from"react-dom";const _=`video_preroll`;function v(e,t){return`${e}:${Math.max(1,Math.floor(Number(t)||1))}`}const y=new Set;function b({videoId:b,episode:x}){let S=s(),C=p(),w=e(e=>e.userId),[T,E]=f(!1),[D,O]=f(0),k=d(null),A=d(!1),j={user_id:w,ad_type:`preroll`},{data:M,isLoading:N}=o(n(j),()=>t(j)),P=M?.data?.materials?.[0],F=M?.data?.settings?.skip_seconds??5,I=P?.advertise_code||``,L=v(b,x),R=y.has(L);u(()=>{if(M?.data?.hit!==!0||!P||A.current||R)return;function e(){if(!A.current){A.current=!0,E(!0),O(F);try{S?.current?.getPlayer()?.pause?.()}catch{}}}let t=S?.current?.getPlayer();if(t)if(S?.current?.isPlayerReady())e();else return t.once?.(`ready`,e),()=>{t.off?.(`ready`,e)}},[M,R,P,S,F]),u(()=>{if(!(!T||F<=0))return k.current=setInterval(()=>{O(e=>e<=1?(k.current&&=(clearInterval(k.current),null),0):e-1)},1e3),()=>{k.current&&=(clearInterval(k.current),null)}},[T,F]),u(()=>{!T||!I||i({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`视频贴片广告`,ad_id:I,ad_type:`preroll`})},[T,I]);let z=l(()=>{k.current&&=(clearInterval(k.current),null),E(!1),y.add(L);try{S?.current?.getPlayer()?.play?.().catch?.(()=>{})}catch{}I&&a({event_type:`close`,advertising_key:_,advertising_name:`视频贴片广告`,advertising_id:I})},[I,S,L]);function B(){I&&r({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`视频贴片广告`,ad_id:I,ad_type:`preroll`}),P?.advertise_url&&window.open(P.advertise_url)}return!C||typeof document>`u`||N||!T?null:g(h(`div`,{className:`fixed inset-0 z-[99998] bg-black`,children:[P?.advertise_icon&&m(`img`,{src:P.advertise_icon,alt:P.advertise_name||`视频贴片广告`,className:`h-full w-full cursor-pointer object-cover`,onClick:B}),m(`div`,{className:`absolute right-4 top-4 z-10`,children:D<=0?m(`button`,{type:`button`,className:`cursor-pointer rounded-lg bg-black/60 px-3 py-1 text-sm text-white`,onClick:z,children:m(c,{label:`跳过广告`})}):h(`div`,{className:`rounded-lg bg-black/60 px-3 py-1 text-sm text-white`,children:[D,`秒后可跳过`]})})]}),document.body)}export{b as VideoPrerollAdOverlay};
2
+ "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pContentMatchAds as t}from"../../../service/generated/client.mjs";import{pContentMatchAdsKey as n}from"../../../service/generated/tanstack.mjs";import{trackAdClick as r,trackAdImpression as i,trackAdvertising as a}from"../../../utils/tracking.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{useVideoPlayerRef as s}from"./video-player-ref-context.mjs";import{PrerollSkipButtonContent as c}from"./preroll-skip-button-content.mjs";import{useCallback as l,useEffect as u,useRef as d,useState as f}from"react";import{useIsClient as p}from"foxact/use-is-client";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{createPortal as g}from"react-dom";const _=`video_preroll`,v=new Set;function y({videoId:y}){let b=s(),x=p(),S=e(e=>e.userId),[C,w]=f(!1),[T,E]=f(0),D=d(null),O=d(!1),k={user_id:S,ad_type:`preroll`},{data:A,isLoading:j}=o(n(k),()=>t(k)),M=A?.data?.materials?.[0],N=A?.data?.settings?.skip_seconds??5,P=M?.advertise_code||``,F=v.has(y);u(()=>{if(A?.data?.hit!==!0||!M||O.current||F)return;function e(){if(!O.current){O.current=!0,w(!0),E(N);try{b?.current?.getPlayer()?.pause?.()}catch{}}}let t=b?.current?.getPlayer();if(t)if(b?.current?.isPlayerReady())e();else return t.once?.(`ready`,e),()=>{t.off?.(`ready`,e)}},[A,F,M,b,N]),u(()=>{if(!(!C||N<=0))return D.current=setInterval(()=>{E(e=>e<=1?(D.current&&=(clearInterval(D.current),null),0):e-1)},1e3),()=>{D.current&&=(clearInterval(D.current),null)}},[C,N]),u(()=>{!C||!P||i({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`视频贴片广告`,ad_id:P,ad_type:`preroll`})},[C,P]);let I=l(()=>{D.current&&=(clearInterval(D.current),null),w(!1),v.add(y);try{b?.current?.getPlayer()?.play?.().catch?.(()=>{})}catch{}P&&a({event_type:`close`,advertising_key:_,advertising_name:`视频贴片广告`,advertising_id:P})},[P,b,y]);function L(){P&&r({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`视频贴片广告`,ad_id:P,ad_type:`preroll`}),M?.advertise_url&&window.open(M.advertise_url)}return!x||typeof document>`u`||j||!C?null:g(h(`div`,{className:`fixed inset-0 z-[99998] bg-black`,children:[M?.advertise_icon&&m(`img`,{src:M.advertise_icon,alt:M.advertise_name||`视频贴片广告`,className:`h-full w-full cursor-pointer object-cover`,onClick:L}),m(`div`,{className:`absolute right-4 top-4 z-10`,children:T<=0?m(`button`,{type:`button`,className:`cursor-pointer rounded-lg bg-black/60 px-3 py-1 text-sm text-white`,onClick:I,children:m(c,{label:`跳过广告`})}):h(`div`,{className:`rounded-lg bg-black/60 px-3 py-1 text-sm text-white`,children:[T,`秒后可跳过`]})})]}),document.body)}export{y as VideoPrerollAdOverlay};