@funhub/platform 0.1.138 → 0.1.139

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 (69) hide show
  1. package/dist/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
  2. package/dist/components/biz/business/comment/reply-detail.mjs +1 -1
  3. package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
  4. package/dist/components/biz/business/detail/shared/registry.d.mts +12 -4
  5. package/dist/components/biz/business/detail/shared/registry.mjs +1 -1
  6. package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
  7. package/dist/components/biz/business/detail/shared/use-video-detail-webview-bridge.mjs +1 -1
  8. package/dist/components/biz/business/detail/video-detail-actions/material.d.mts +1 -1
  9. package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
  10. package/dist/components/biz/business/detail/video-detail-info/material.d.mts +2 -2
  11. package/dist/components/biz/business/detail/video-detail-info/schema.mjs +1 -1
  12. package/dist/components/biz/business/detail/video-detail-info/server.mjs +1 -1
  13. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.d.mts +2 -2
  14. package/dist/components/biz/business/detail/video-detail-player/client.mjs +1 -1
  15. package/dist/components/biz/business/detail/video-detail-player-bridge-only/client.d.mts +12 -0
  16. package/dist/components/biz/business/detail/video-detail-player-bridge-only/client.mjs +2 -0
  17. package/dist/components/biz/business/detail/video-detail-player-bridge-only/index.d.mts +5 -0
  18. package/dist/components/biz/business/detail/video-detail-player-bridge-only/material.d.mts +17 -0
  19. package/dist/components/biz/business/detail/video-detail-player-bridge-only/material.mjs +2 -0
  20. package/dist/components/biz/business/detail/video-detail-player-bridge-only/schema.d.mts +23 -0
  21. package/dist/components/biz/business/detail/video-detail-player-bridge-only/schema.mjs +2 -0
  22. package/dist/components/biz/business/detail/video-detail-player-bridge-only/server.d.mts +11 -0
  23. package/dist/components/biz/business/detail/video-detail-player-bridge-only/server.mjs +2 -0
  24. package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +2 -2
  25. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  26. package/dist/components/biz/business/marquee/client.mjs +1 -1
  27. package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
  28. package/dist/components/biz/business/search-bar/variants/detail-search-bar/runtime/client.mjs +1 -1
  29. package/dist/components/biz/business/search-history/client.mjs +1 -1
  30. package/dist/components/biz/business/search-input/client.mjs +1 -1
  31. package/dist/components/biz/business/tab-bar/client.mjs +1 -1
  32. package/dist/components/biz/business/text-recommend/client.mjs +1 -1
  33. package/dist/components/common/at-element/index.mjs +1 -1
  34. package/dist/components/common/blocked-dialog/blocked-dialog.mjs +1 -1
  35. package/dist/components/common/funhub-provider/funhub-provider.mjs +1 -1
  36. package/dist/components/common/header-nav/client.mjs +1 -1
  37. package/dist/components/common/info-card/card-header.mjs +1 -1
  38. package/dist/components/common/list/user-activity-list/user-activity-list-item.mjs +1 -1
  39. package/dist/components/common/tab-bar/index.mjs +1 -1
  40. package/dist/components/pages/(follow)/_components/interaction-tabs/index.mjs +1 -1
  41. package/dist/components/pages/(follow)/_components/user-list/index.mjs +1 -1
  42. package/dist/components/pages/collection-create/form.mjs +1 -1
  43. package/dist/components/pages/collection-detail/detail.mjs +1 -1
  44. package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
  45. package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
  46. package/dist/components/pages/home/client.mjs +1 -1
  47. package/dist/components/pages/login/auth-guard.mjs +1 -1
  48. package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
  49. package/dist/components/pages/publish/components/collection.mjs +1 -1
  50. package/dist/components/pages/publish/components/header.mjs +1 -1
  51. package/dist/components/pages/publish/page-client.mjs +1 -1
  52. package/dist/components/pages/search/page-client.mjs +1 -1
  53. package/dist/components/pages/search/top-header.mjs +1 -1
  54. package/dist/components/pages/search-result/page-client.mjs +1 -1
  55. package/dist/components/pages/settings/_components/settings.mjs +1 -1
  56. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  57. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  58. package/dist/components/ui/button.d.mts +1 -1
  59. package/dist/components/ui/link.mjs +1 -1
  60. package/dist/hooks/use-card-decoration.mjs +1 -1
  61. package/dist/hooks/use-content-operate.mjs +1 -1
  62. package/dist/materials.d.mts +3 -1
  63. package/dist/materials.mjs +1 -1
  64. package/dist/utils/login-modal-bridge.mjs +1 -1
  65. package/dist/utils/use-compatible-router.d.mts +26 -0
  66. package/dist/utils/use-compatible-router.mjs +2 -0
  67. package/dist/utils.d.mts +6 -5
  68. package/dist/utils.mjs +1 -1
  69. package/package.json +28 -28
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import{Box as n}from"../../../../../../ui/box.mjs";import{defaultProps as r}from"../defaults/default-props.mjs";import i from"../../../../../../../assets/icons/left_arrow.mjs";import a from"../../../../../basics/search/variants/simple-search/index.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useRouter as c}from"next/navigation";const l={},u={list:[]};function d({props:d=l,styles:f,events:p,data:m=u}){let h={...r,...d},g=c(),{logo:_,search:v,gap:y=r.gap}=h,{list:b}=m,x=()=>{p?.onSearchClick?.()},S=f?e(f,{}):void 0;return s(n,{as:`header`,className:`w-full bg-black flex justify-between items-center px-[16px] py-[8px] h-11`,style:{...y>0?{gap:t(y)}:void 0,...S},children:[o(`div`,{className:`flex items-center`,children:o(i,{className:`mr-4 cursor-pointer`,onClick:()=>{g.back()}})}),o(a,{props:v,events:{onClick:x}})]})}export{d as default};
2
+ "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import{useRouter as n}from"../../../../../../../utils/use-compatible-router.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{defaultProps as i}from"../defaults/default-props.mjs";import a from"../../../../../../../assets/icons/left_arrow.mjs";import o from"../../../../../basics/search/variants/simple-search/index.mjs";import{jsx as s,jsxs as c}from"react/jsx-runtime";const l={},u={list:[]};function d({props:d=l,styles:f,events:p,data:m=u}){let h={...i,...d},g=n(),{logo:_,search:v,gap:y=i.gap}=h,{list:b}=m,x=()=>{p?.onSearchClick?.()},S=f?e(f,{}):void 0;return c(r,{as:`header`,className:`w-full bg-black flex justify-between items-center px-[16px] py-[8px] h-11`,style:{...y>0?{gap:t(y)}:void 0,...S},children:[s(`div`,{className:`flex items-center`,children:s(a,{className:`mr-4 cursor-pointer`,onClick:()=>{g.back()}})}),s(o,{props:v,events:{onClick:x}})]})}export{d as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Button as e}from"../../../ui/button.mjs";import t from"../../../../utils/event-bus.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{eventKey as i}from"../../../../constants/event-key.mjs";import{DeleteConfirmDialog as a}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useCallback as o,useEffect as s,useMemo as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{usePathname as f,useRouter as p,useSearchParams as m}from"next/navigation";function h(e,t){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function g(g){let{title:_,rows:v=1,clearText:y,confirmDescription:b,storageKey:x=`guest`,onHistoryClick:S,mode:C=`renderer`}=g,w=_??`搜索历史`,T=y??`清空`,E=b??`确定要清除所有搜索历史吗?`,D=c(()=>[`搜索历史1`,`搜索历史2`,`搜索历史3`],[]),[O,k]=l([]),[A,j]=l(!1),M=p(),N=f(),P=m(),F=`search_history_${x}`,I=o(()=>{let e=[];try{let t=localStorage.getItem(F);if(t)try{let n=JSON.parse(t);e=Array.isArray(n)?n:[]}catch{e=[]}k(e)}catch(e){console.error(`Failed to parse search history`,e),k([])}},[F]);s(()=>(I(),t.on(i.SEARCH_HISTORY_UPDATE,I),()=>t.off(i.SEARCH_HISTORY_UPDATE,I)),[I]);let L=()=>{k([]),localStorage.removeItem(F),j(!1),t.emit(i.SEARCH_HISTORY_UPDATE)},R=c(()=>(O.length?O:C===`editor`?D:[]).slice(0,v*10),[O,C,D,v]);if(R.length===0)return null;let z=e=>{if(S){S(e);return}let t=new URLSearchParams(P.toString());t.set(`q`,e);let n=N.includes(`/search-result`)?N:`/search-result`;M.push(`${n}?${t.toString()}`)};return d(n,{className:`px-4 py-2`,children:[d(n,{className:`flex justify-between items-center mb-2`,children:[u(r,{className:`text-[16px] font-bold text-text1`,children:w}),u(e,{variant:`ghost`,size:`sm`,className:`text-text3 text-[12px] p-0 h-auto`,onClick:()=>j(!0),children:T})]}),u(n,{className:`flex flex-wrap gap-2 overflow-hidden`,style:{maxHeight:`${v*30}px`},children:R.map((e,t)=>u(n,{className:`px-3 py-1 bg-bg2 rounded-full cursor-pointer`,onClick:()=>z(e),children:u(r,{className:`text-[14px] text-text2`,children:h(e,8)})},t))}),u(a,{open:A,onOpenChange:j,onConfirm:L,title:``,description:E})]})}export{g as SearchHistoryClient};
2
+ "use client";import{Button as e}from"../../../ui/button.mjs";import t from"../../../../utils/event-bus.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{eventKey as a}from"../../../../constants/event-key.mjs";import{DeleteConfirmDialog as o}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useCallback as s,useEffect as c,useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{usePathname as p,useSearchParams as m}from"next/navigation";function h(e,t){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function g(g){let{title:_,rows:v=1,clearText:y,confirmDescription:b,storageKey:x=`guest`,onHistoryClick:S,mode:C=`renderer`}=g,w=_??`搜索历史`,T=y??`清空`,E=b??`确定要清除所有搜索历史吗?`,D=l(()=>[`搜索历史1`,`搜索历史2`,`搜索历史3`],[]),[O,k]=u([]),[A,j]=u(!1),M=n(),N=p(),P=m(),F=`search_history_${x}`,I=s(()=>{let e=[];try{let t=localStorage.getItem(F);if(t)try{let n=JSON.parse(t);e=Array.isArray(n)?n:[]}catch{e=[]}k(e)}catch(e){console.error(`Failed to parse search history`,e),k([])}},[F]);c(()=>(I(),t.on(a.SEARCH_HISTORY_UPDATE,I),()=>t.off(a.SEARCH_HISTORY_UPDATE,I)),[I]);let L=()=>{k([]),localStorage.removeItem(F),j(!1),t.emit(a.SEARCH_HISTORY_UPDATE)},R=l(()=>(O.length?O:C===`editor`?D:[]).slice(0,v*10),[O,C,D,v]);if(R.length===0)return null;let z=e=>{if(S){S(e);return}let t=new URLSearchParams(P.toString());t.set(`q`,e);let n=N.includes(`/search-result`)?N:`/search-result`;M.push(`${n}?${t.toString()}`)};return f(r,{className:`px-4 py-2`,children:[f(r,{className:`flex justify-between items-center mb-2`,children:[d(i,{className:`text-[16px] font-bold text-text1`,children:w}),d(e,{variant:`ghost`,size:`sm`,className:`text-text3 text-[12px] p-0 h-auto`,onClick:()=>j(!0),children:T})]}),d(r,{className:`flex flex-wrap gap-2 overflow-hidden`,style:{maxHeight:`${v*30}px`},children:R.map((e,t)=>d(r,{className:`px-3 py-1 bg-bg2 rounded-full cursor-pointer`,onClick:()=>z(e),children:d(i,{className:`text-[14px] text-text2`,children:h(e,8)})},t))}),d(o,{open:A,onOpenChange:j,onConfirm:L,title:``,description:E})]})}export{g as SearchHistoryClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../../ui/box.mjs";import{Input as t}from"../../../ui/input.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../../assets/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{jsx as c,jsxs as l}from"react/jsx-runtime";import{usePathname as u,useRouter as d,useSearchParams as f}from"next/navigation";function p(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 m(m){let{placeholder:h,defaultPlaceholder:g,searchLabel:_,storageKey:v=`guest`,onSearch:y,mode:b=`renderer`}=m,x=h||(g??`请输入搜索内容`),S=_??`搜索`,C=b===`editor`,[w,T]=s(``),E=d(),D=u(),O=f(),k=`search_history_${v}`,A=o(e=>{if(C)return;let t=e.trim();if(t){try{let e=[t,...p(localStorage.getItem(k)).filter(e=>e!==t)].slice(0,20);localStorage.setItem(k,JSON.stringify(e))}catch(e){console.error(`Failed to save search history`,e)}if(y)y(t);else{let e=new URLSearchParams(O.toString());e.set(`q`,t);let n=D.includes(`/search-result`)?D:`/search-result`;E.push(`${n}?${e.toString()}`)}}},[k,C,y,D,E,O]);return l(e,{className:`px-3 py-2 bg-bg1 flex items-center gap-3 w-full${C?` pointer-events-none`:``}`,children:[c(e,{className:`shrink-0 cursor-pointer active:opacity-70`,onClick:()=>{C||E.back()},children:c(r,{className:`w-4 h-4 text-text1`})}),l(e,{className:`flex-1 flex items-center gap-1 bg-bg2 border border-theme5 rounded-[20px] px-2 py-1.5 overflow-hidden`,children:[c(e,{className:`p-1 shrink-0`,children:c(i,{className:`w-[14px] h-[14px] text-text3`})}),c(t,{className:`flex-1 border-none bg-transparent p-0 h-auto text-[14px] leading-[22px] focus-visible:ring-0 text-text1 placeholder:text-text3`,placeholder:x,value:w,maxLength:128,onChange:e=>T(e.target.value),onKeyDown:e=>e.key===`Enter`&&A(w)}),w&&c(a,{className:`w-[15px] h-[15px] text-text3 shrink-0 cursor-pointer active:opacity-70`,onClick:()=>T(``)})]}),c(e,{className:`shrink-0 cursor-pointer active:opacity-70`,onClick:()=>A(w),children:c(n,{className:`text-[16px] text-text1 leading-[24px] font-normal`,children:S})})]})}export{m 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{Text as r}from"../../../ui/text.mjs";import i from"../../../../assets/icons/left_arrow.mjs";import a from"../../../../assets/icons/search.mjs";import o from"../../../../assets/icons/clear.mjs";import{useCallback as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{usePathname as d,useSearchParams as f}from"next/navigation";function p(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 m(m){let{placeholder:h,defaultPlaceholder:g,searchLabel:_,storageKey:v=`guest`,onSearch:y,mode:b=`renderer`}=m,x=h||(g??`请输入搜索内容`),S=_??`搜索`,C=b===`editor`,[w,T]=c(``),E=e(),D=d(),O=f(),k=`search_history_${v}`,A=s(e=>{if(C)return;let t=e.trim();if(t){try{let e=[t,...p(localStorage.getItem(k)).filter(e=>e!==t)].slice(0,20);localStorage.setItem(k,JSON.stringify(e))}catch(e){console.error(`Failed to save search history`,e)}if(y)y(t);else{let e=new URLSearchParams(O.toString());e.set(`q`,t);let n=D.includes(`/search-result`)?D:`/search-result`;E.push(`${n}?${e.toString()}`)}}},[k,C,y,D,E,O]);return u(t,{className:`px-3 py-2 bg-bg1 flex items-center gap-3 w-full${C?` pointer-events-none`:``}`,children:[l(t,{className:`shrink-0 cursor-pointer active:opacity-70`,onClick:()=>{C||E.back()},children:l(i,{className:`w-4 h-4 text-text1`})}),u(t,{className:`flex-1 flex items-center gap-1 bg-bg2 border border-theme5 rounded-[20px] px-2 py-1.5 overflow-hidden`,children:[l(t,{className:`p-1 shrink-0`,children:l(a,{className:`w-[14px] h-[14px] text-text3`})}),l(n,{className:`flex-1 border-none bg-transparent p-0 h-auto text-[14px] leading-[22px] focus-visible:ring-0 text-text1 placeholder:text-text3`,placeholder:x,value:w,maxLength:128,onChange:e=>T(e.target.value),onKeyDown:e=>e.key===`Enter`&&A(w)}),w&&l(o,{className:`w-[15px] h-[15px] text-text3 shrink-0 cursor-pointer active:opacity-70`,onClick:()=>T(``)})]}),l(t,{className:`shrink-0 cursor-pointer active:opacity-70`,onClick:()=>A(w),children:l(r,{className:`text-[16px] text-text1 leading-[24px] font-normal`,children:S})})]})}export{m 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{useMemo as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import o from"next/link";import{usePathname as s}from"next/navigation";const c=[];function l(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function u(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 d(e,t){let n=l(t);if(e.configType===1){let t=l(u(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 f(e,t){return e.findIndex(e=>d(e,t))}function p(l){let{items:d=c,mode:p=`renderer`}=l,m=s(),h=r(()=>{if(p===`editor`)return 0;let e=f(d??[],m);return e>=0?e:0},[d,m,p]),g=r(()=>(d??[]).some(e=>e.label.trim()!==``),[d]);if(!d?.length)return null;function _(e){p===`editor`&&e.preventDefault()}let v=`flex min-w-0 flex-1 cursor-pointer flex-col items-center justify-center ${g?`gap-1`:``}`;return i(t,{className:`fixed bottom-0 left-0 right-0 z-50 h-[var(--tab-bar-height)] border-t border-line1 bg-bg1 py-3 backdrop-blur-[2px] shadow-[0px_-4px_10px_0px_rgba(0,0,0,0.02)]`,children:i(t,{className:`flex w-full items-center`,children:d.map((r,s)=>{let c=h===s,l=c?r.activeIcon:r.icon,d=r.label;return a(o,{href:u(r),className:v,"data-index":s,"data-webview-nav":`spa`,onClick:_,children:[i(t,{className:`relative size-[22px] shrink-0`,children:l?i(e,{src:l,alt:d,fill:!0,className:`object-contain`}):i(t,{"data-active":c,className:`size-full rounded-sm bg-text3 data-[active=true]:bg-theme5`})}),g&&i(n,{"data-active":c,className:`truncate text-center text-[10px] leading-[10px] font-medium min-w-0 max-w-full px-0.5 text-text2 data-[active=true]:text-theme5`,children:d})]},s)})})})}export{p as TabBarClient};
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{useMemo as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{usePathname as o}from"next/navigation";import s from"next/link";const c=[];function l(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function u(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 d(e,t){let n=l(t);if(e.configType===1){let t=l(u(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 f(e,t){return e.findIndex(e=>d(e,t))}function p(l){let{items:d=c,mode:p=`renderer`}=l,m=o(),h=r(()=>{if(p===`editor`)return 0;let e=f(d??[],m);return e>=0?e:0},[d,m,p]),g=r(()=>(d??[]).some(e=>e.label.trim()!==``),[d]);if(!d?.length)return null;function _(e){p===`editor`&&e.preventDefault()}let v=`flex min-w-0 flex-1 cursor-pointer flex-col items-center justify-center ${g?`gap-1`:``}`;return i(t,{className:`fixed bottom-0 left-0 right-0 z-50 h-[var(--tab-bar-height)] border-t border-line1 bg-bg1 py-3 backdrop-blur-[2px] shadow-[0px_-4px_10px_0px_rgba(0,0,0,0.02)]`,children:i(t,{className:`flex w-full items-center`,children:d.map((r,o)=>{let c=h===o,l=c?r.activeIcon:r.icon,d=r.label;return a(s,{href:u(r),className:v,"data-index":o,"data-webview-nav":`spa`,onClick:_,children:[i(t,{className:`relative size-[22px] shrink-0`,children:l?i(e,{src:l,alt:d,fill:!0,className:`object-contain`}):i(t,{"data-active":c,className:`size-full rounded-sm bg-text3 data-[active=true]:bg-theme5`})}),g&&i(n,{"data-active":c,className:`truncate text-center text-[10px] leading-[10px] font-medium min-w-0 max-w-full px-0.5 text-text2 data-[active=true]:text-theme5`,children:d})]},o)})})})}export{p as TabBarClient};
@@ -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{useMemo as n,useState as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{usePathname as o,useRouter as s,useSearchParams as c}from"next/navigation";const l=[];function u(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 d(d){let{title:f,items:p=l,onItemClick:m,mode:h=`renderer`}=d,g=h===`editor`,_=s(),v=o(),y=c(),[b,x]=r(0),S=n(()=>u(p,6),[p,b]);if(p.length===0)return null;let C=e=>{if(m){m(e);return}let t=new URLSearchParams(y.toString());t.set(`q`,e);let n=v.includes(`/search-result`)?v:`/search-result`;_.push(`${n}?${t.toString()}`)};return a(e,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full${g?` pointer-events-none`:``}`,children:[i(e,{className:`flex items-center justify-between w-full`,children:i(t,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:f})}),i(e,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:S.map((n,r)=>i(e,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>C(n.label),children:i(t,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:n.label})},`${b}-${r}`))})]})}export{d as TextRecommendClient};
2
+ "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useMemo as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{usePathname as s,useSearchParams as c}from"next/navigation";const l=[];function u(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 d(d){let{title:f,items:p=l,onItemClick:m,mode:h=`renderer`}=d,g=h===`editor`,_=e(),v=s(),y=c(),[b,x]=i(0),S=r(()=>u(p,6),[p,b]);if(p.length===0)return null;let C=e=>{if(m){m(e);return}let t=new URLSearchParams(y.toString());t.set(`q`,e);let n=v.includes(`/search-result`)?v:`/search-result`;_.push(`${n}?${t.toString()}`)};return o(t,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full${g?` pointer-events-none`:``}`,children:[a(t,{className:`flex items-center justify-between w-full`,children:a(n,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:f})}),a(t,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:S.map((e,r)=>a(t,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>C(e.label),children:a(n,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:e.label})},`${b}-${r}`))})]})}export{d as TextRecommendClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{replaceAtUserElementHtmlStr as e}from"../../../utils/tools.mjs";import{Fragment as t,jsx as n}from"react/jsx-runtime";import{useRouter as r}from"next/navigation";import i from"html-react-parser";const a=[];function o(o){let{text:s=``,atUsers:c=a,enableNavigation:l=!0}=o,u=e({text:s,atUsers:c}),d=r();return n(t,{children:i(u,{replace:e=>{if(e.type===`tag`&&e.attribs&&e.attribs.class===`mention`){let t=e.attribs[`data-id`];if(!t)return e;let r=e.children&&e.children[0]?e.children[0].data:``;return n(`span`,{className:`mention text-theme1 transition-colors ${l?`hover:text-theme1/80 cursor-pointer`:``}`,"data-id":t,style:{pointerEvents:l?`auto`:`none`},onClick:l?e=>{e.preventDefault(),e.stopPropagation();let n=`/profile/${t}`;d.push(n)}:void 0,children:r})}return e}})})}export{o as default};
2
+ "use client";import{useRouter as e}from"../../../utils/use-compatible-router.mjs";import{replaceAtUserElementHtmlStr as t}from"../../../utils/tools.mjs";import{Fragment as n,jsx as r}from"react/jsx-runtime";import i from"html-react-parser";const a=[];function o(o){let{text:s=``,atUsers:c=a,enableNavigation:l=!0}=o,u=t({text:s,atUsers:c}),d=e();return r(n,{children:i(u,{replace:e=>{if(e.type===`tag`&&e.attribs&&e.attribs.class===`mention`){let t=e.attribs[`data-id`];if(!t)return e;let n=e.children&&e.children[0]?e.children[0].data:``;return r(`span`,{className:`mention text-theme1 transition-colors ${l?`hover:text-theme1/80 cursor-pointer`:``}`,"data-id":t,style:{pointerEvents:l?`auto`:`none`},onClick:l?e=>{e.preventDefault(),e.stopPropagation();let n=`/profile/${t}`;d.push(n)}:void 0,children:n})}return e}})})}export{o as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{secondToTime as s}from"../../../utils/common.mjs";import{useBlockedModalStore as c}from"../../../store/modules/blocked-modal-store.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{useRouter as p}from"next/navigation";function m(){let m=p(),h=f(`components.common.blockedDialog`),{isOpen:g,blockedRemark:_,blockedEndTime:v,close:y,setOpen:b}=c(),x=v>0?s(v):h(`unblockTimePermanent`),S=_||h(`remarkDefault`);return u(e,{open:g,onOpenChange:e=>{b(e)},children:d(n,{size:`sm`,children:[d(a,{children:[u(o,{className:`text-[16px]`,children:h(`title`)}),u(r,{className:`text-center text-[14px] leading-6 whitespace-pre-line`,children:h(`description`,{remark:S,unblockTime:x})})]}),d(i,{children:[u(t,{onClick:()=>{l.getState().isOpen&&l.getState().setOpen(!1),y(),m.push(`/feedback`)},children:h(`contactSupport`)}),u(t,{onClick:y,children:h(`gotIt`)})]})]})})}export{m as BlockedDialog};
2
+ "use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{secondToTime as s}from"../../../utils/common.mjs";import{useBlockedModalStore as c}from"../../../store/modules/blocked-modal-store.mjs";import{useRouter as l}from"../../../utils/use-compatible-router.mjs";import{useLoginModalStore as u}from"../../../store/modules/login-modal-store.mjs";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m(){let m=l(),h=p(`components.common.blockedDialog`),{isOpen:g,blockedRemark:_,blockedEndTime:v,close:y,setOpen:b}=c(),x=v>0?s(v):h(`unblockTimePermanent`),S=_||h(`remarkDefault`);return d(e,{open:g,onOpenChange:e=>{b(e)},children:f(n,{size:`sm`,children:[f(a,{children:[d(o,{className:`text-[16px]`,children:h(`title`)}),d(r,{className:`text-center text-[14px] leading-6 whitespace-pre-line`,children:h(`description`,{remark:S,unblockTime:x})})]}),f(i,{children:[d(t,{onClick:()=>{u.getState().isOpen&&u.getState().setOpen(!1),y(),m.push(`/feedback`)},children:h(`contactSupport`)}),d(t,{onClick:y,children:h(`gotIt`)})]})]})})}export{m as BlockedDialog};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserInfo as t}from"../../../service/generated/client.mjs";import{Toaster as n}from"../../ui/sonner.mjs";import{useRequest as r}from"../../../hooks/query/use-query.mjs";import{MediaPreview as i}from"../media-preview/index.mjs";import{CollectionPopupHost as a}from"../collection-popup/index.mjs";import{IntlProvider as o}from"../intl-provider/intl-provider.mjs";import{BlockedDialog as s}from"../blocked-dialog/blocked-dialog.mjs";import{LoginDialog as c}from"../login-dialog/login-dialog.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{useRouter as h}from"next/navigation";import{QueryClient as g,QueryClientProvider as _}from"@tanstack/react-query";import{NuqsAdapter as v}from"nuqs/adapters/next/app";function y(){let{userId:n,setUserInfo:i}=e(),a={code:0,message:``,data:{}},{data:o}=r([`user-init`,n],()=>n?t({user_id:n}):Promise.resolve(a),{enabled:!!n});return l(()=>{if(!n)return;let e=o?.data;e&&i(e)},[i,n,o]),null}function b(t){let{queryClient:r,intl:b,children:x}=t,[S]=d(()=>new g),C=r??S,w=h(),T=e(e=>e.isLogin&&!!e.token&&!!e.userId),E=u(T);l(()=>{E.current&&!T&&(C.clear(),w.refresh()),E.current=T},[T,C,w]);let D=m(f,{children:[p(y,{}),x,p(s,{}),p(c,{}),p(a,{}),p(n,{position:`top-center`}),p(i,{})]});return p(_,{client:C,children:p(v,{children:p(o,{...b,children:D})})})}export{b as FunhubProvider};
2
+ "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserInfo as t}from"../../../service/generated/client.mjs";import{useRouter as n}from"../../../utils/use-compatible-router.mjs";import{Toaster as r}from"../../ui/sonner.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{MediaPreview as a}from"../media-preview/index.mjs";import{CollectionPopupHost as o}from"../collection-popup/index.mjs";import{IntlProvider as s}from"../intl-provider/intl-provider.mjs";import{BlockedDialog as c}from"../blocked-dialog/blocked-dialog.mjs";import{LoginDialog as l}from"../login-dialog/login-dialog.mjs";import{useEffect as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{QueryClient as g,QueryClientProvider as _}from"@tanstack/react-query";import{NuqsAdapter as v}from"nuqs/adapters/next/app";function y(){let{userId:n,setUserInfo:r}=e(),a={code:0,message:``,data:{}},{data:o}=i([`user-init`,n],()=>n?t({user_id:n}):Promise.resolve(a),{enabled:!!n});return u(()=>{if(!n)return;let e=o?.data;e&&r(e)},[r,n,o]),null}function b(t){let{queryClient:i,intl:b,children:x}=t,[S]=f(()=>new g),C=i??S,w=n(),T=e(e=>e.isLogin&&!!e.token&&!!e.userId),E=d(T);u(()=>{E.current&&!T&&(C.clear(),w.refresh()),E.current=T},[T,C,w]);let D=h(p,{children:[m(y,{}),x,m(c,{}),m(l,{}),m(o,{}),m(r,{position:`top-center`}),m(a,{})]});return m(_,{client:C,children:m(v,{children:m(s,{...b,children:D})})})}export{b as FunhubProvider};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{toast as e}from"../../../ui.mjs";import{LeftArrowIcon as t}from"../icons/left-arrow.mjs";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{useRouter as i}from"next/navigation";function a({title:a,leftChild:o,centerChild:s,className:c,rightChild:l,leftIconCss:u,onBack:d}){let f=i();function p(){if(e.dismiss(),d){d?.();return}window.location.search.split(`from_code=`)[1]?f.push(`/`):f.back()}return n(`nav`,{className:`app-top-nav w-full relative ${c?.includes(`h-`)?(c.match(/h-\[?\d\w+\]?/)||[`h-12`])[0]:`h-12`}`,children:r(`div`,{className:`w-full bg-bg1 flex items-center justify-center fixed h-12 top-0 left-0 right-0 z-50 border-b border-text1/5 ${c}`,style:{willChange:`transform`,transform:`translateZ(0)`},children:[n(`div`,{className:`absolute z-[1] h-full left-0 top-0`,children:o||n(`div`,{onClick:p,className:`cursor-pointer h-full w-12 flex items-center justify-center`,children:n(t,{className:`w-4 h-4 text-text1 ${u}`})})}),s||n(`p`,{className:`text-text1 line-clamp-1 px-12 text-ellipsis text-lg`,children:a}),l&&n(`div`,{className:`absolute h-full right-2 top-0 flex items-center justify-center`,children:l})]})})}export{a as HeaderNav};
2
+ "use client";import{useRouter as e}from"../../../utils/use-compatible-router.mjs";import{toast as t}from"../../../ui.mjs";import{LeftArrowIcon as n}from"../icons/left-arrow.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a({title:a,leftChild:o,centerChild:s,className:c,rightChild:l,leftIconCss:u,onBack:d}){let f=e();function p(){if(t.dismiss(),d){d?.();return}window.location.search.split(`from_code=`)[1]?f.push(`/`):f.back()}return r(`nav`,{className:`app-top-nav w-full relative ${c?.includes(`h-`)?(c.match(/h-\[?\d\w+\]?/)||[`h-12`])[0]:`h-12`}`,children:i(`div`,{className:`w-full bg-bg1 flex items-center justify-center fixed h-12 top-0 left-0 right-0 z-50 border-b border-text1/5 ${c}`,style:{willChange:`transform`,transform:`translateZ(0)`},children:[r(`div`,{className:`absolute z-[1] h-full left-0 top-0`,children:o||r(`div`,{onClick:p,className:`cursor-pointer h-full w-12 flex items-center justify-center`,children:r(n,{className:`w-4 h-4 text-text1 ${u}`})})}),s||r(`p`,{className:`text-text1 line-clamp-1 px-12 text-ellipsis text-lg`,children:a}),l&&r(`div`,{className:`absolute h-full right-2 top-0 flex items-center justify-center`,children:l})]})})}export{a as HeaderNav};
@@ -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{Time as r}from"../../ui/time.mjs";import{FollowButton as i}from"../../pages/(follow)/_components/follow-button/index.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{usePathname as s,useRouter as c}from"next/navigation";function l({className:l,infoData:u,onChangeFollow:d,rightChild:f}){let p=s(),m=c(),h=u?.author?.user_id||``,g=u?.author?.nickname||``,_=u?.show_at||u?.create_time;return a(t,{className:`w-full mb-[8px] pt-[16px] px-[12px] ${l}`,children:o(t,{className:`w-full flex items-center justify-between`,children:[o(t,{className:`flex items-center cursor-pointer`,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=`/profile/${h}`;p!==t&&m.push(t)},children:[a(t,{className:`w-[36px] h-[36px] mr-[8px] rounded-full bg-bg2 overflow-hidden`,children:u?.author?.avatar&&a(e,{width:36,height:36,src:u?.author?.avatar,className:`w-full h-full object-cover`,alt:`avatar`})}),o(t,{className:`flex flex-col`,children:[a(n,{className:`block text-text1 text-[14px] leading-[18px] max-w-[220px] overflow-hidden whitespace-nowrap text-ellipsis`,children:g}),a(t,{className:`mt-[4px] h-[14px] leading-[14px]`,children:a(r,{mode:`relative`,value:_,className:`text-text3 text-[12px]`})})]})]}),a(t,{onClick:e=>{e.stopPropagation(),e.preventDefault()},children:f||(h?a(i,{userId:h,hasFollow:!1,onChange:d}):null)})]})})}export{l as default};
2
+ "use client";import{useRouter as e}from"../../../utils/use-compatible-router.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{Time as i}from"../../ui/time.mjs";import{FollowButton as a}from"../../pages/(follow)/_components/follow-button/index.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{usePathname as c}from"next/navigation";function l({className:l,infoData:u,onChangeFollow:d,rightChild:f}){let p=c(),m=e(),h=u?.author?.user_id||``,g=u?.author?.nickname||``,_=u?.show_at||u?.create_time;return o(n,{className:`w-full mb-[8px] pt-[16px] px-[12px] ${l}`,children:s(n,{className:`w-full flex items-center justify-between`,children:[s(n,{className:`flex items-center cursor-pointer`,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=`/profile/${h}`;p!==t&&m.push(t)},children:[o(n,{className:`w-[36px] h-[36px] mr-[8px] rounded-full bg-bg2 overflow-hidden`,children:u?.author?.avatar&&o(t,{width:36,height:36,src:u?.author?.avatar,className:`w-full h-full object-cover`,alt:`avatar`})}),s(n,{className:`flex flex-col`,children:[o(r,{className:`block text-text1 text-[14px] leading-[18px] max-w-[220px] overflow-hidden whitespace-nowrap text-ellipsis`,children:g}),o(n,{className:`mt-[4px] h-[14px] leading-[14px]`,children:o(i,{mode:`relative`,value:_,className:`text-text3 text-[12px]`})})]})]}),o(n,{onClick:e=>{e.stopPropagation(),e.preventDefault()},children:f||(h?o(a,{userId:h,hasFollow:!1,onChange:d}):null)})]})})}export{l as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Image as e}from"../../../ui/image.mjs";import{Avatar as t,AvatarFallback as n,AvatarImage as r}from"../../../ui/avatar.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{Time as s}from"../../../ui/time.mjs";import{useMediaPreview as c}from"../../media-preview/index.mjs";import{useContentOperate as l}from"../../../../hooks/use-content-operate.mjs";import u from"../../../../assets/icons/detail/video_play.mjs";import{ActivityCommentButton as d,ActivityDeleteButton as f,ActivityDislikeButton as p,ActivityLikeButton as ee,ActivityShareButton as m}from"./user-activity-list-actions.mjs";import{useEffect as h,useRef as te,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";import{useRouter as x}from"next/navigation";const S=[],C={post:2};function w({medias:t=S,className:n=``,onItemClick:r}){let a=b(`components.ui.list.userActivityList`),o=(t||[]).filter(Boolean).slice(0,9);if(!o.length)return null;function s(e){r?.(e)}function c(t,n,o){let{is_video:c,media_url:l,cover_image:d}=t||{},f=!!c,p=f?d||l||``:l||``;return p?v(i,{className:o||`relative w-full h-full`,onClick:e=>{r&&(e.stopPropagation(),e.preventDefault(),s(n))},children:[_(e,{src:p,alt:a(`userActivityListItem.mediaAlt`),fill:!0,className:`object-cover`}),f&&_(i,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-[rgba(0,0,0,0.5)] rounded-full`,children:_(u,{width:36,height:36})})]},n):null}if(o.length===1){let{is_video:e,media_url:t,cover_image:r}=o[0]||{};return _(i,{className:n,children:_(i,{className:`w-full rounded-xl overflow-hidden`,children:c({is_video:e,media_url:t,cover_image:r,__src:e?r||t||``:t||``},0,`relative w-full aspect-square`)})})}return o.length===2?_(i,{className:n,children:_(i,{className:`w-full flex gap-0.5 rounded-xl overflow-hidden`,children:o.map((e,t)=>_(i,{className:`flex-1 aspect-square relative`,children:c(e,t)},t))})}):o.length===3?_(i,{className:n,children:v(i,{className:`w-full h-89.25 flex gap-0.5 rounded-xl overflow-hidden`,children:[_(i,{className:`w-[56.65%] h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 flex flex-col gap-0.5`,children:o.slice(1).map((e,t)=>_(i,{className:`w-full flex-1 relative`,children:c(e,t+1)},t))})]})}):o.length===4?_(i,{className:n,children:_(i,{className:`w-full h-89.25 rounded-xl overflow-hidden grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})}):o.length===5?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-49.5 flex gap-0.5`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-33.5 flex gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t+2)},t))})]})}):o.length===6?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[v(i,{className:`w-full h-67.5 flex gap-0.5`,children:[_(i,{className:`w-67.5 h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-2 gap-0.5`,children:o.slice(1,3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+1)},t))})]}),_(i,{className:`w-full h-33.5 grid grid-cols-3 grid-rows-1 gap-0.5`,children:o.slice(3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+3)},t))})]})}):o.length===7?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex gap-0.5`,children:[_(i,{className:`w-76 h-67.5 grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.slice(0,4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-3 gap-0.5`,children:o.slice(4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+4)},t))})]})}):o.length===8?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-33.5 flex gap-0.5 items-center`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-67.5 grid grid-cols-3 grid-rows-2 gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+2)},t))})]})}):_(i,{className:n,children:_(i,{className:`w-full h-101.5 rounded-xl overflow-hidden grid grid-cols-3 grid-rows-3 gap-0.5`,children:o.slice(0,9).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})})}function T(e){let u=b(`components.ui.list.userActivityList`),{content_id:S,author:T,rightSlot:E,create_time:ne,content:D,medias:O,canEdit:re=!1,isDeleting:ie=!1,isEditMode:ae=!1,isSelected:oe=!1,onToggle:k,interaction:A,like_count:j=0,is_liked:M=!1,onLikeSuccess:se,dislike_count:N=0,is_dislike:P=!1,is_collected:ce,onDislikeSuccess:F,comment_count:I=0,onDelete:L,onShare:R,onShareSuccess:z,onActionSuccess:B,onCollectChange:V}=e,H=A?.is_collected??ce??!1,[U,W]=g({isLiked:M,likeCount:j,isDisliked:P,dislikeCount:N,isCollected:H}),[G,K]=g(!1),[le,q]=g(!1),J=te(null),Y=O?.filter(Boolean)??[],X=T?.nickname||T?.nick_name||``,ue=T?.avatar||T?.avatar_url||``;h(()=>{W({isLiked:M,likeCount:j,isDisliked:P,dislikeCount:N,isCollected:H})},[N,P,M,j,H]),h(()=>{K(!1)},[D]),h(()=>()=>{J.current&&=(clearTimeout(J.current),null)},[]);function de(e){W(t=>({...t,isLiked:e.isLiked,likeCount:e.count,isDisliked:e.isDisliked??t.isDisliked,dislikeCount:e.dislikeCount??t.dislikeCount})),se?.(e)}function fe(e){W(t=>({...t,isDisliked:e.isDisliked,dislikeCount:e.count,isLiked:e.isLiked??t.isLiked,likeCount:e.likeCount??t.likeCount})),F?.(e)}let{handleToCollectionOperate:pe}=l({id:S||``,isLike:U.isLiked,isDislike:U.isDisliked,isCollect:U.isCollected,likeCnt:U.likeCount,dislikeCnt:U.dislikeCount,contentType:C.post});function Z(){J.current&&=(clearTimeout(J.current),null)}function me(e){W(t=>({...t,isCollected:e})),B?.(),S&&V?.(S,e)}function Q(e){if(!S){y.error(u(`userActivityListItem.collectFailed`));return}if(!le){if(q(!0),Z(),!pe({currentCollect:e,onUpdate:({isCollect:e})=>{Z(),me(e),q(!1)}})){y.error(u(`userActivityListItem.collectFailed`)),q(!1);return}J.current=setTimeout(()=>{q(!1),J.current=null},300)}}function he(e){return!!(e&&e.length>180)}function ge(){K(e=>!e)}let $=x(),_e=()=>{$.push(`/post/${S}`)},ve=e=>{e.stopPropagation(),e.preventDefault(),$.push(`/profile/${T?.user_id}`)},ye=()=>{$.push(`/post/${S}?tab=comment`)},be=c();function xe(e){let t=Y.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image}));t.length&&be.open(t,e)}return _(i,{className:`flex items-start gap-2 p-3`,children:v(i,{className:`flex-1 min-w-0`,children:[v(i,{className:`flex items-center gap-2 mb-3`,children:[v(i,{className:`flex items-center gap-2 shrink-0`,children:[ae&&_(a,{checked:oe,onCheckedChange:k}),v(t,{className:`w-10 h-10`,onClick:ve,children:[_(r,{src:ue,alt:X}),_(n,{})]})]}),v(i,{className:`flex-1 min-w-0`,children:[_(o,{as:`p`,className:`text-sm text-text1 line-clamp-1 font-medium`,children:X}),_(i,{className:`h-[1em]`,children:_(s,{value:ne,className:`text-xs text-text3`,format:`YYYY-MM-DD HH:mm`})})]}),E&&_(i,{className:`shrink-0`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:E}),re&&_(f,{onClick:L,disabled:ie})]}),v(i,{onClick:_e,children:[v(i,{className:`mb-3`,children:[D&&v(i,{children:[_(o,{className:`text-sm text-text1 leading-5 whitespace-pre-wrap text-ellipsis ${G?`break-all`:`line-clamp-3`}`,dangerouslySetInnerHTML:{__html:D}}),he(D)&&_(i,{className:`mt-1 text-xs text-text3`,onClick:e=>{e.stopPropagation(),e.preventDefault(),ge()},children:u(G?`userActivityListItem.collapse`:`userActivityListItem.expand`)})]}),Y.length>0&&_(w,{className:`mt-2`,medias:Y,onItemClick:xe})]}),v(i,{className:`flex items-center justify-around text-text3 *:min-w-20`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:[_(ee,{contentId:S||``,count:U.likeCount,isLiked:U.isLiked,isDisliked:U.isDisliked,dislikeCount:U.dislikeCount,onLikeSuccess:de,onSuccess:B}),_(p,{contentId:S||``,count:U.dislikeCount,isDisliked:U.isDisliked,isLiked:U.isLiked,likeCount:U.likeCount,onDislikeSuccess:fe,onSuccess:B}),_(d,{count:I,onClick:ye}),_(m,{isCollected:U.isCollected,contentId:S||``,userId:T?.user_id??``,onShareSuccess:z,onClick:R,onCollect:()=>Q(!1),onUncollect:()=>Q(!0)})]})]})]})})}export{T as UserActivityListItem,w as UserActivityMediaGrid};
2
+ "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Image as t}from"../../../ui/image.mjs";import{Avatar as n,AvatarFallback as r,AvatarImage as i}from"../../../ui/avatar.mjs";import{Box as a}from"../../../ui/box.mjs";import{Checkbox as o}from"../../../ui/checkbox.mjs";import{Text as s}from"../../../ui/text.mjs";import{Time as c}from"../../../ui/time.mjs";import{useMediaPreview as l}from"../../media-preview/index.mjs";import{useContentOperate as u}from"../../../../hooks/use-content-operate.mjs";import d from"../../../../assets/icons/detail/video_play.mjs";import{ActivityCommentButton as f,ActivityDeleteButton as p,ActivityDislikeButton as ee,ActivityLikeButton as te,ActivityShareButton as m}from"./user-activity-list-actions.mjs";import{useEffect as h,useRef as ne,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";const x=[],S={post:2};function C({medias:e=x,className:n=``,onItemClick:r}){let i=b(`components.ui.list.userActivityList`),o=(e||[]).filter(Boolean).slice(0,9);if(!o.length)return null;function s(e){r?.(e)}function c(e,n,o){let{is_video:c,media_url:l,cover_image:u}=e||{},f=!!c,p=f?u||l||``:l||``;return p?v(a,{className:o||`relative w-full h-full`,onClick:e=>{r&&(e.stopPropagation(),e.preventDefault(),s(n))},children:[_(t,{src:p,alt:i(`userActivityListItem.mediaAlt`),fill:!0,className:`object-cover`}),f&&_(a,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-[rgba(0,0,0,0.5)] rounded-full`,children:_(d,{width:36,height:36})})]},n):null}if(o.length===1){let{is_video:e,media_url:t,cover_image:r}=o[0]||{};return _(a,{className:n,children:_(a,{className:`w-full rounded-xl overflow-hidden`,children:c({is_video:e,media_url:t,cover_image:r,__src:e?r||t||``:t||``},0,`relative w-full aspect-square`)})})}return o.length===2?_(a,{className:n,children:_(a,{className:`w-full flex gap-0.5 rounded-xl overflow-hidden`,children:o.map((e,t)=>_(a,{className:`flex-1 aspect-square relative`,children:c(e,t)},t))})}):o.length===3?_(a,{className:n,children:v(a,{className:`w-full h-89.25 flex gap-0.5 rounded-xl overflow-hidden`,children:[_(a,{className:`w-[56.65%] h-full relative`,children:c(o[0],0)}),_(a,{className:`flex-1 flex flex-col gap-0.5`,children:o.slice(1).map((e,t)=>_(a,{className:`w-full flex-1 relative`,children:c(e,t+1)},t))})]})}):o.length===4?_(a,{className:n,children:_(a,{className:`w-full h-89.25 rounded-xl overflow-hidden grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.map((e,t)=>_(a,{className:`w-full h-full relative`,children:c(e,t)},t))})}):o.length===5?_(a,{className:n,children:v(a,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(a,{className:`w-full h-49.5 flex gap-0.5`,children:o.slice(0,2).map((e,t)=>_(a,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(a,{className:`w-full h-33.5 flex gap-0.5`,children:o.slice(2).map((e,t)=>_(a,{className:`flex-1 h-full relative`,children:c(e,t+2)},t))})]})}):o.length===6?_(a,{className:n,children:v(a,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[v(a,{className:`w-full h-67.5 flex gap-0.5`,children:[_(a,{className:`w-67.5 h-full relative`,children:c(o[0],0)}),_(a,{className:`flex-1 grid grid-cols-1 grid-rows-2 gap-0.5`,children:o.slice(1,3).map((e,t)=>_(a,{className:`w-full h-full relative`,children:c(e,t+1)},t))})]}),_(a,{className:`w-full h-33.5 grid grid-cols-3 grid-rows-1 gap-0.5`,children:o.slice(3).map((e,t)=>_(a,{className:`w-full h-full relative`,children:c(e,t+3)},t))})]})}):o.length===7?_(a,{className:n,children:v(a,{className:`w-full rounded-xl overflow-hidden flex gap-0.5`,children:[_(a,{className:`w-76 h-67.5 grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.slice(0,4).map((e,t)=>_(a,{className:`w-full h-full relative`,children:c(e,t)},t))}),_(a,{className:`flex-1 grid grid-cols-1 grid-rows-3 gap-0.5`,children:o.slice(4).map((e,t)=>_(a,{className:`w-full h-full relative`,children:c(e,t+4)},t))})]})}):o.length===8?_(a,{className:n,children:v(a,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(a,{className:`w-full h-33.5 flex gap-0.5 items-center`,children:o.slice(0,2).map((e,t)=>_(a,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(a,{className:`w-full h-67.5 grid grid-cols-3 grid-rows-2 gap-0.5`,children:o.slice(2).map((e,t)=>_(a,{className:`w-full h-full relative`,children:c(e,t+2)},t))})]})}):_(a,{className:n,children:_(a,{className:`w-full h-101.5 rounded-xl overflow-hidden grid grid-cols-3 grid-rows-3 gap-0.5`,children:o.slice(0,9).map((e,t)=>_(a,{className:`w-full h-full relative`,children:c(e,t)},t))})})}function w(t){let d=b(`components.ui.list.userActivityList`),{content_id:x,author:w,rightSlot:T,create_time:re,content:E,medias:ie,canEdit:D=!1,isDeleting:ae=!1,isEditMode:O=!1,isSelected:oe=!1,onToggle:k,interaction:A,like_count:j=0,is_liked:M=!1,onLikeSuccess:se,dislike_count:N=0,is_dislike:P=!1,is_collected:ce,onDislikeSuccess:F,comment_count:I=0,onDelete:L,onShare:R,onShareSuccess:z,onActionSuccess:B,onCollectChange:V}=t,H=A?.is_collected??ce??!1,[U,W]=g({isLiked:M,likeCount:j,isDisliked:P,dislikeCount:N,isCollected:H}),[G,K]=g(!1),[le,q]=g(!1),J=ne(null),Y=ie?.filter(Boolean)??[],X=w?.nickname||w?.nick_name||``,ue=w?.avatar||w?.avatar_url||``;h(()=>{W({isLiked:M,likeCount:j,isDisliked:P,dislikeCount:N,isCollected:H})},[N,P,M,j,H]),h(()=>{K(!1)},[E]),h(()=>()=>{J.current&&=(clearTimeout(J.current),null)},[]);function de(e){W(t=>({...t,isLiked:e.isLiked,likeCount:e.count,isDisliked:e.isDisliked??t.isDisliked,dislikeCount:e.dislikeCount??t.dislikeCount})),se?.(e)}function fe(e){W(t=>({...t,isDisliked:e.isDisliked,dislikeCount:e.count,isLiked:e.isLiked??t.isLiked,likeCount:e.likeCount??t.likeCount})),F?.(e)}let{handleToCollectionOperate:pe}=u({id:x||``,isLike:U.isLiked,isDislike:U.isDisliked,isCollect:U.isCollected,likeCnt:U.likeCount,dislikeCnt:U.dislikeCount,contentType:S.post});function Z(){J.current&&=(clearTimeout(J.current),null)}function me(e){W(t=>({...t,isCollected:e})),B?.(),x&&V?.(x,e)}function Q(e){if(!x){y.error(d(`userActivityListItem.collectFailed`));return}if(!le){if(q(!0),Z(),!pe({currentCollect:e,onUpdate:({isCollect:e})=>{Z(),me(e),q(!1)}})){y.error(d(`userActivityListItem.collectFailed`)),q(!1);return}J.current=setTimeout(()=>{q(!1),J.current=null},300)}}function he(e){return!!(e&&e.length>180)}function ge(){K(e=>!e)}let $=e(),_e=()=>{$.push(`/post/${x}`)},ve=e=>{e.stopPropagation(),e.preventDefault(),$.push(`/profile/${w?.user_id}`)},ye=()=>{$.push(`/post/${x}?tab=comment`)},be=l();function xe(e){let t=Y.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image}));t.length&&be.open(t,e)}return _(a,{className:`flex items-start gap-2 p-3`,children:v(a,{className:`flex-1 min-w-0`,children:[v(a,{className:`flex items-center gap-2 mb-3`,children:[v(a,{className:`flex items-center gap-2 shrink-0`,children:[O&&_(o,{checked:oe,onCheckedChange:k}),v(n,{className:`w-10 h-10`,onClick:ve,children:[_(i,{src:ue,alt:X}),_(r,{})]})]}),v(a,{className:`flex-1 min-w-0`,children:[_(s,{as:`p`,className:`text-sm text-text1 line-clamp-1 font-medium`,children:X}),_(a,{className:`h-[1em]`,children:_(c,{value:re,className:`text-xs text-text3`,format:`YYYY-MM-DD HH:mm`})})]}),T&&_(a,{className:`shrink-0`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:T}),D&&_(p,{onClick:L,disabled:ae})]}),v(a,{onClick:_e,children:[v(a,{className:`mb-3`,children:[E&&v(a,{children:[_(s,{className:`text-sm text-text1 leading-5 whitespace-pre-wrap text-ellipsis ${G?`break-all`:`line-clamp-3`}`,dangerouslySetInnerHTML:{__html:E}}),he(E)&&_(a,{className:`mt-1 text-xs text-text3`,onClick:e=>{e.stopPropagation(),e.preventDefault(),ge()},children:d(G?`userActivityListItem.collapse`:`userActivityListItem.expand`)})]}),Y.length>0&&_(C,{className:`mt-2`,medias:Y,onItemClick:xe})]}),v(a,{className:`flex items-center justify-around text-text3 *:min-w-20`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:[_(te,{contentId:x||``,count:U.likeCount,isLiked:U.isLiked,isDisliked:U.isDisliked,dislikeCount:U.dislikeCount,onLikeSuccess:de,onSuccess:B}),_(ee,{contentId:x||``,count:U.dislikeCount,isDisliked:U.isDisliked,isLiked:U.isLiked,likeCount:U.likeCount,onDislikeSuccess:fe,onSuccess:B}),_(f,{count:I,onClick:ye}),_(m,{isCollected:U.isCollected,contentId:x||``,userId:w?.user_id??``,onShareSuccess:z,onClick:R,onCollect:()=>Q(!1),onUncollect:()=>Q(!0)})]})]})]})})}export{w as UserActivityListItem,C as UserActivityMediaGrid};
@@ -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{useEffect as u,useState as d,useTransition as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";import{usePathname as _}from"next/navigation";function v(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 y=[`/nav-page`];function b(b){let{className:x}=b,S=_(),C=g(`tabBar`),[w,T]=d(null),[,E]=f(),[D]=d(0),[O,k]=d(!1),A=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:22,height:22},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:22,height:22},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:22,height:22}],j=(e,t,n)=>{t!==S&&T(t)};return u(()=>{w&&v(S,w)&&E(()=>{T(null)})},[S,w]),u(()=>{let e=setTimeout(()=>{k(!0)},0);return()=>clearTimeout(e)},[]),S&&y.some(e=>S.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex h-[var(--tab-bar-height)] items-center justify-around border-t border-line1 bg-bg1 ${x||``}`,children:A.map(r=>{let i=O&&S?v(w||S||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(p,{children:[r.badge&&D>0?m(l,{dot:!0,children:m(a,{width:r.width,height:r.height})}):m(a,{width:r.width,height:r.height}),m(t,{className:`text-[10px] mt-[4px] ${i?`text-theme5`:`text-text2`}`,children:C(r.labelKey)})]});return i?m(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:e=>{j(e,r.path,r.labelKey)},children:o},r.id)})})}export{b 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{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{usePathname as g}from"next/navigation";import{useTranslations as _}from"next-intl";function v(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 y=[`/nav-page`];function b(b){let{className:x}=b,S=g(),C=_(`tabBar`),[w,T]=d(null),[,E]=f(),[D]=d(0),[O,k]=d(!1),A=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:22,height:22},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:22,height:22},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:22,height:22}],j=(e,t,n)=>{t!==S&&T(t)};return u(()=>{w&&v(S,w)&&E(()=>{T(null)})},[S,w]),u(()=>{let e=setTimeout(()=>{k(!0)},0);return()=>clearTimeout(e)},[]),S&&y.some(e=>S.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex h-[var(--tab-bar-height)] items-center justify-around border-t border-line1 bg-bg1 ${x||``}`,children:A.map(r=>{let i=O&&S?v(w||S||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(p,{children:[r.badge&&D>0?m(l,{dot:!0,children:m(a,{width:r.width,height:r.height})}):m(a,{width:r.width,height:r.height}),m(t,{className:`text-[10px] mt-[4px] ${i?`text-theme5`:`text-text2`}`,children:C(r.labelKey)})]});return i?m(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:e=>{j(e,r.path,r.labelKey)},children:o},r.id)})})}export{b as TabBar};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Tabs as e,TabsList as t,TabsTrigger as n}from"../../../../ui/tabs.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useTranslations as a}from"next-intl";import{usePathname as o,useRouter as s,useSearchParams as c}from"next/navigation";function l({type:l}){let u=a(`components.pages.follow.components.interactionTabs`),d=s(),f=c(),p=o();return r(e,{value:l,onValueChange:e=>{let t=e===`fans`?`fans`:`followed`,n=p;n=p.replace(/\/(fans|followed)/,`/${t}`);let r=f.get(`user_id`),i=r?`?user_id=${r}`:``;d.replace(`${n}${i}`)},className:`h-full`,children:i(t,{variant:`default`,className:`h-full`,children:[r(n,{value:`followed`,className:`h-full px-3`,children:u(`follow`)}),r(n,{value:`fans`,className:`h-full px-3`,children:u(`fans`)})]})})}export{l as InteractionTabs};
2
+ "use client";import{useRouter as e}from"../../../../../utils/use-compatible-router.mjs";import{Tabs as t,TabsList as n,TabsTrigger as r}from"../../../../ui/tabs.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{usePathname as o,useSearchParams as s}from"next/navigation";import{useTranslations as c}from"next-intl";function l({type:l}){let u=c(`components.pages.follow.components.interactionTabs`),d=e(),f=s(),p=o();return i(t,{value:l,onValueChange:e=>{let t=e===`fans`?`fans`:`followed`,n=p;n=p.replace(/\/(fans|followed)/,`/${t}`);let r=f.get(`user_id`),i=r?`?user_id=${r}`:``;d.replace(`${n}${i}`)},className:`h-full`,children:a(n,{variant:`default`,className:`h-full`,children:[i(r,{value:`followed`,className:`h-full px-3`,children:u(`follow`)}),i(r,{value:`fans`,className:`h-full px-3`,children:u(`fans`)})]})})}export{l as InteractionTabs};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gInteractionGetFollowerList as t,gInteractionGetFollowingList as n}from"../../../../../service/generated/client.mjs";import{Box as r}from"../../../../ui/box.mjs";import{List as i}from"../../../../ui/list.mjs";import{Text as a}from"../../../../ui/text.mjs";import{usePaginated as o,useUpdateRequest as s}from"../../../../../hooks/query/use-query.mjs";import{UserListItem as c}from"./user-list-item.mjs";import{useState as l}from"react";import{jsx as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";import{useRouter as f}from"next/navigation";function p(e,t){return e.map(e=>({user_id:e.user_brief?.user_id??e.user_id??``,name:e.user_brief?.nickname??e.user_brief?.username??``,avatar:e.user_brief?.avatar_url??``,is_mutual:e.is_mutual,signature:e?.user_brief?.signature||``,is_friend:`0`,browse_flag:`0`,self_flag:`0`,follow_flag:t,background:``}))}function m(e,t,n,r){return{code:0,msg:`OK`,data:{page:String(t),page_size:String(n),list:p(e,r)},trace:``}}function h(p){let h=d(`components.pages.follow.components.userList`),{userId:g,type:_,page:v,showAction:y,followText:b}=p,[x,S]=l(!1),C=f(),w=e(e=>e.userId||e.userInfo?.userId||``),T=g||w,E=[`user-list`,_,T,v],D=b||h(_===`fans`?`followBack`:`follow`),{data:O,isFetching:k,fetchNextPage:A}=o({key:E,options:{staleTime:0},initialPageParam:v,async queryFn(e){if(!T)return m([],e,20,_===`followed`?`1`:`0`);let r=(_===`followed`?await n({page:e,page_size:20,user_id:T}):await t({page:e,page_size:20,user_id:T})).data,i=[];_===`followed`&&`following`in r&&(i=r.following??[]),_===`fans`&&`followers`in r&&(i=r.followers??[]);let a=m(i,e,20,_===`followed`?`1`:`0`);return a.data?.list&&a.data.list.length===0&&S(!1),a},getNextPageParam(e,t){if((e?.data?.list??[]).length!==0)return t.length+v}}),j=s();function M(e,t){j(E,n=>{for(let r of n?.pages||[])for(let n of r.data?.list||[])if(n.user_id===e){n.follow_flag=t?`1`:`0`;break}return n&&{...n}})}return u(i,{loading:k,hasMore:x,loadMore:async()=>{await A()},empty:`adduser`,emptyText:h(_===`followed`?`noFollowedUsers`:`noFans`),emptySlot:_===`followed`&&!g?u(r,{className:`w-20.5 mt-6 h-7.5 rounded-[30px] bg-theme5 flex items-center justify-center`,onClick:()=>{C.push(`/`)},children:u(a,{className:`text-[14px] text-white leading-7.5`,children:h(`followNow`)})}):null,children:O?.pages.map(e=>e.data.list.map(e=>u(i.Item,{children:u(c,{showAction:y,data:e,onUpdateFollowStatus:M,followText:e.follow_flag===`1`?h(`follow`):D})},e.user_id)))})}export{h as UserList};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gInteractionGetFollowerList as t,gInteractionGetFollowingList as n}from"../../../../../service/generated/client.mjs";import{useRouter as r}from"../../../../../utils/use-compatible-router.mjs";import{Box as i}from"../../../../ui/box.mjs";import{List as a}from"../../../../ui/list.mjs";import{Text as o}from"../../../../ui/text.mjs";import{usePaginated as s,useUpdateRequest as c}from"../../../../../hooks/query/use-query.mjs";import{UserListItem as l}from"./user-list-item.mjs";import{useState as u}from"react";import{jsx as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";function p(e,t){return e.map(e=>({user_id:e.user_brief?.user_id??e.user_id??``,name:e.user_brief?.nickname??e.user_brief?.username??``,avatar:e.user_brief?.avatar_url??``,is_mutual:e.is_mutual,signature:e?.user_brief?.signature||``,is_friend:`0`,browse_flag:`0`,self_flag:`0`,follow_flag:t,background:``}))}function m(e,t,n,r){return{code:0,msg:`OK`,data:{page:String(t),page_size:String(n),list:p(e,r)},trace:``}}function h(p){let h=f(`components.pages.follow.components.userList`),{userId:g,type:_,page:v,showAction:y,followText:b}=p,[x,S]=u(!1),C=r(),w=e(e=>e.userId||e.userInfo?.userId||``),T=g||w,E=[`user-list`,_,T,v],D=b||h(_===`fans`?`followBack`:`follow`),{data:O,isFetching:k,fetchNextPage:A}=s({key:E,options:{staleTime:0},initialPageParam:v,async queryFn(e){if(!T)return m([],e,20,_===`followed`?`1`:`0`);let r=(_===`followed`?await n({page:e,page_size:20,user_id:T}):await t({page:e,page_size:20,user_id:T})).data,i=[];_===`followed`&&`following`in r&&(i=r.following??[]),_===`fans`&&`followers`in r&&(i=r.followers??[]);let a=m(i,e,20,_===`followed`?`1`:`0`);return a.data?.list&&a.data.list.length===0&&S(!1),a},getNextPageParam(e,t){if((e?.data?.list??[]).length!==0)return t.length+v}}),j=c();function M(e,t){j(E,n=>{for(let r of n?.pages||[])for(let n of r.data?.list||[])if(n.user_id===e){n.follow_flag=t?`1`:`0`;break}return n&&{...n}})}return d(a,{loading:k,hasMore:x,loadMore:async()=>{await A()},empty:`adduser`,emptyText:h(_===`followed`?`noFollowedUsers`:`noFans`),emptySlot:_===`followed`&&!g?d(i,{className:`w-20.5 mt-6 h-7.5 rounded-[30px] bg-theme5 flex items-center justify-center`,onClick:()=>{C.push(`/`)},children:d(o,{className:`text-[14px] text-white leading-7.5`,children:h(`followNow`)})}):null,children:O?.pages.map(e=>e.data.list.map(e=>d(a.Item,{children:d(l,{showAction:y,data:e,onUpdateFollowStatus:M,followText:e.follow_flag===`1`?h(`follow`):D})},e.user_id)))})}export{h as UserList};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,pCommunityCreateCollection as r,pCommunityUpdateCollection as i}from"../../../service/generated/client.mjs";import{Box as a}from"../../ui/box.mjs";import{InputGroup as o,InputGroupAddon as s,InputGroupTextarea as c}from"../../ui/input-group.mjs";import{Field as l,FieldLabel as u}from"../../ui/field.mjs";import{useDeleteRequest as d,useRequest as f}from"../../../hooks/query/use-query.mjs";import{HeaderNav as p}from"../../common/header-nav/client.mjs";import{useEffect as m,useRef as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";import{useRouter as x}from"next/navigation";function S({mode:S=`create`,collectionId:C}){let w=b(`components.pages.collectionCreate`),T=x(),{userId:E}=t(),D=d();h(null);let O=S===`edit`&&!!C,k=h(!1),[A,j]=g(!1),[M,N]=g(!1),[P,F]=g(``),[I,L]=g({title:``,description:``}),R=f([`collection-detail`,C],()=>n({collection_id:C}),{enabled:!!(O&&C)}).data?.data?.data?.collection;m(()=>{!O||k.current||!R||(L({title:R.title??``,description:R.description??``}),F(R.cover_image??``),k.current=!0)},[R,O]);function z(e,t){L(n=>({...n,[e]:t}))}async function B(){if(A)return;let e=I.title.trim(),t=I.description.trim();if(!e){y.error(w(`form.titleRequired`));return}if(O&&!C){y.error(w(`form.collectionNotFound`));return}try{j(!0);let n=y.loading(w(O?`form.saving`:`form.creating`)),a=O?await i({collection_id:C,title:e,description:t,cover_image:P}):await r({title:e,description:t,cover_image:P});if(a.code===0){y.success(w(O?`form.saveSuccess`:`form.createSuccess`),{id:n}),E&&D([`user-profile`,`mine`,E,`user-collection-created`,E]),O&&C&&D([`collection-detail`,C]),T.back();return}y.error(a.message||w(O?`form.saveFailed`:`form.createFailed`),{id:n})}catch(e){console.error(O?`编辑合集失败`:`创建合集失败`,e),y.error(w(O?`form.saveFailed`:`form.createFailed`))}finally{j(!1)}}return v(a,{className:`min-h-screen !bg-bg2`,children:[_(p,{title:w(O?`form.editTitle`:`form.createTitle`),className:`!bg-bg2`,rightChild:_(e,{onClick:B,disabled:A||M,children:w(A?O?`form.saving`:`form.creating`:O?`form.save`:`form.create`)})}),v(a,{className:`pb-3`,children:[v(l,{className:`!bg-bg2 px-3 border-none`,children:[_(u,{required:!0,children:w(`form.label`)}),v(o,{children:[_(c,{className:`!bg-bg1 p-2.5`,maxLength:50,placeholder:w(`form.titlePlaceholder`),value:I.title,onChange:e=>z(`title`,e.target.value)}),_(s,{className:`!bg-bg1`,align:`block-end`,children:_(`div`,{className:`text-right w-full`,children:v(`span`,{className:`text-xs`,children:[I.title.length,`/50`]})})})]})]}),v(l,{className:`border-none px-3 bg-bg2! `,children:[_(u,{children:w(`form.descriptionLabel`)}),v(o,{children:[_(c,{className:`!bg-bg1 p-2.5`,maxLength:100,placeholder:w(`form.descriptionPlaceholder`),value:I.description,onChange:e=>z(`description`,e.target.value)}),_(s,{className:`!bg-bg1`,align:`block-end`,children:_(`div`,{className:`text-right w-full`,children:v(`span`,{className:`text-xs`,children:[I.description.length,`/100`]})})})]})]})]})]})}export{S as CollectionCreateForm};
2
+ "use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,pCommunityCreateCollection as r,pCommunityUpdateCollection as i}from"../../../service/generated/client.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{Box as o}from"../../ui/box.mjs";import{InputGroup as s,InputGroupAddon as c,InputGroupTextarea as l}from"../../ui/input-group.mjs";import{Field as u,FieldLabel as d}from"../../ui/field.mjs";import{useDeleteRequest as f,useRequest as p}from"../../../hooks/query/use-query.mjs";import{HeaderNav as m}from"../../common/header-nav/client.mjs";import{useEffect as h,useRef as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{toast as b}from"sonner";import{useTranslations as x}from"next-intl";function S({mode:S=`create`,collectionId:C}){let w=x(`components.pages.collectionCreate`),T=a(),{userId:E}=t(),D=f();g(null);let O=S===`edit`&&!!C,k=g(!1),[A,j]=_(!1),[M,N]=_(!1),[P,F]=_(``),[I,L]=_({title:``,description:``}),R=p([`collection-detail`,C],()=>n({collection_id:C}),{enabled:!!(O&&C)}).data?.data?.data?.collection;h(()=>{!O||k.current||!R||(L({title:R.title??``,description:R.description??``}),F(R.cover_image??``),k.current=!0)},[R,O]);function z(e,t){L(n=>({...n,[e]:t}))}async function B(){if(A)return;let e=I.title.trim(),t=I.description.trim();if(!e){b.error(w(`form.titleRequired`));return}if(O&&!C){b.error(w(`form.collectionNotFound`));return}try{j(!0);let n=b.loading(w(O?`form.saving`:`form.creating`)),a=O?await i({collection_id:C,title:e,description:t,cover_image:P}):await r({title:e,description:t,cover_image:P});if(a.code===0){b.success(w(O?`form.saveSuccess`:`form.createSuccess`),{id:n}),E&&D([`user-profile`,`mine`,E,`user-collection-created`,E]),O&&C&&D([`collection-detail`,C]),T.back();return}b.error(a.message||w(O?`form.saveFailed`:`form.createFailed`),{id:n})}catch(e){console.error(O?`编辑合集失败`:`创建合集失败`,e),b.error(w(O?`form.saveFailed`:`form.createFailed`))}finally{j(!1)}}return y(o,{className:`min-h-screen !bg-bg2`,children:[v(m,{title:w(O?`form.editTitle`:`form.createTitle`),className:`!bg-bg2`,rightChild:v(e,{onClick:B,disabled:A||M,children:w(A?O?`form.saving`:`form.creating`:O?`form.save`:`form.create`)})}),y(o,{className:`pb-3`,children:[y(u,{className:`!bg-bg2 px-3 border-none`,children:[v(d,{required:!0,children:w(`form.label`)}),y(s,{children:[v(l,{className:`!bg-bg1 p-2.5`,maxLength:50,placeholder:w(`form.titlePlaceholder`),value:I.title,onChange:e=>z(`title`,e.target.value)}),v(c,{className:`!bg-bg1`,align:`block-end`,children:v(`div`,{className:`text-right w-full`,children:y(`span`,{className:`text-xs`,children:[I.title.length,`/50`]})})})]})]}),y(u,{className:`border-none px-3 bg-bg2! `,children:[v(d,{children:w(`form.descriptionLabel`)}),y(s,{children:[v(l,{className:`!bg-bg1 p-2.5`,maxLength:100,placeholder:w(`form.descriptionPlaceholder`),value:I.description,onChange:e=>z(`description`,e.target.value)}),v(c,{className:`!bg-bg1`,align:`block-end`,children:v(`div`,{className:`text-right w-full`,children:y(`span`,{className:`text-xs`,children:[I.description.length,`/100`]})})})]})]})]})]})}export{S as CollectionCreateForm};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,gUserViewUserInfo as r,pCommunityDeleteCollection as i,pCommunityRemoveContentFromCollection as a,pCommunitySubscribeCollection as o,pInteractionBatchDeleteCollects as s}from"../../../service/generated/client.mjs";import{Box as c}from"../../ui/box.mjs";import{Checkbox as ee}from"../../ui/checkbox.mjs";import{Drawer as te,DrawerContent as ne,DrawerDescription as re,DrawerTitle as ie}from"../../ui/drawer.mjs";import{List as ae}from"../../ui/list.mjs";import{Text as l}from"../../ui/text.mjs";import{useLoginModalStore as oe}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as se,useMutation as u,useRequest as d,useUpdateRequest as ce}from"../../../hooks/query/use-query.mjs";import{ShareDrawer as le}from"../../common/share-popup/share-drawer.mjs";import{SharePlatformEnum as f}from"../../../types/share.mjs";import p from"../../../utils/share-manager.mjs";import{DeleteConfirmDialog as m}from"../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as ue}from"../../common/header-nav/client.mjs";import{MoreIcon as de}from"../../common/icons/more.mjs";import{CollectionDetailCard as fe}from"./_components/collection-detail-card.mjs";import{useEffect as pe,useMemo as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as me}from"next-intl";import{useRouter as b,useSearchParams as he}from"next/navigation";function x(e){if(e.cover_image)return e.cover_image;let t=``;return e.medias?.find(e=>e?(!e.is_video&&!t&&e.media_url&&(t=e.media_url),!!e.cover_image):!1)?.cover_image||t}function S(e){let t=e.detail.info?.video_duration;if(typeof t==`number`&&Number.isFinite(t)&&t>0)return Math.floor(t);let n=e.medias?.find(e=>{let t=e?.video_duration;return typeof t==`number`&&Number.isFinite(t)&&t>0})?.video_duration;return typeof n==`number`&&Number.isFinite(n)&&n>0?Math.floor(n):0}function C(e){let t=e.detail.info?.play_count;if(typeof t==`number`&&Number.isFinite(t))return Math.max(0,Math.floor(t));let n=e.detail.view_count||e.viewCount;return typeof n==`number`&&Number.isFinite(n)?Math.max(0,Math.floor(n)):0}function ge(e){let t=e.detail,n=t.info,r=String(n?.cover_image||t.cover_image||x(e)||``),i=String(n?.text||n?.title||t.title||t.content||``),a=t.author_score??0,o=Array.isArray(t.tags)?t.tags:[];return{id:e.content_id?String(e.content_id):String(e.id),title:i,type:typeof e.type==`number`?e.type:0,coverImage:r,score:a,collectedAt:t.create_time==null?void 0:String(t.create_time),tags:o,duration:S(e),viewCount:C(e),publishTime:String(t.create_time??t.update_time??``),is_more_link:e.is_more_link??n?.is_more_link??!1,authorName:``}}function w({id:x}){let S=me(`components.pages.collectionDetail`),C=b(),w=he(),{userId:T,isLogin:E}=t(),{open:D}=oe(),O=se();ce();let k=d([`collection-detail`,x],()=>n({collection_id:x})),A=k.data?.data?.data?.collection?.user_id,j=!!(A&&T&&String(A)===String(T)),_e=d([`user-info`,A],()=>r({target_user_id:A,user_id:A})),[ve,M]=g(!1),[N,P]=g(!1),[F,I]=g(!1),[L,R]=g(!1),[z,B]=g(!1),[V,H]=g(()=>new Set),[U,W]=g(null);pe(()=>{!N&&L&&(I(!0),R(!1))},[N,L]);let G=k.data?.data?.data?.collection,K=G?.contents,q=h(()=>K?K.map(e=>({content_id:e.content_id,is_more_link:e.is_more_link,id:Number(e.content_id),detail:e,type:Number(e.source_type??0),medias:e.medias,cover_image:e.cover_image,viewCount:e.view_count})):[],[K]).map(ge),J=h(()=>new Set(q.map(e=>e.id)),[q]),Y=J.size>0&&V.size===J.size;G?.cover_image,G?.content_count,G?.is_subscribe;let{mutateAsync:ye,isPending:be}=u(async e=>await o({collection_id:x,subscribe:e})),{mutateAsync:xe,isPending:Se}=u(async e=>await a({collection_id:x,content_id:e})),{mutateAsync:Ce,isPending:X}=u(async e=>await i({collection_id:e})),{mutateAsync:we,isPending:Z}=u(async e=>await s({app_id:0,user_id:T,folder_id:x,content_type:1,content_ids:e})),Q=_e.data?.data;Q?.avatar,Q?.nick_name;let Te=j&&G?.is_default===!1;function Ee(e){W({kind:`content`,id:e.id,type:e.type,title:e.title,isCollected:!0}),M(!0)}function De(){if(j){P(!0);return}W({kind:`collection`,id:x}),M(!0)}function Oe(){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!j){y.error(S(`detail.operationFailed`));return}P(!1),H(new Set),B(!0)}function ke(){H(new Set),B(!1)}function Ae(e){H(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function je(){if(Y){H(new Set);return}H(new Set(J))}async function Me(){if(!(V.size===0||Z)){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}try{let e=await we(Array.from(V));if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),H(new Set),B(!1);return}y.error(e.message||S(`detail.uncollectFailed`))}catch(e){console.error(`批量取消收藏失败`,e),y.error(S(`detail.operationFailed`))}}}function Ne(e){if(typeof window>`u`)return``;if(e.kind===`collection`)return`${window.location.origin}/collection/${e.id}`;let t=e.title?encodeURIComponent(e.title):`detail`,n=e.type===1?`/video/${e.id}/${t}`:`/post/${e.id}`;return`${window.location.origin}${n}`}function $(e){if(!U)return;let t=Ne(U);t&&p.showSharePopup({type:e,data:{id:U.id},copyUrl:t})}function Pe(){$(f.WECHAT)}function Fe(){$(f.QQ)}function Ie(){$(f.WECHAT_MOMENTS)}function Le(){if(!Se){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}!U||U.kind!==`content`||xe(U.id).then(e=>{if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),W(e=>e&&{...e,isCollected:!1});return}y.error(e.message||S(`detail.uncollectFailed`))}).catch(e=>{console.error(`取消收藏失败`,e),y.error(S(`detail.operationFailed`))})}}function Re(){let e=new URLSearchParams(w.toString());e.set(`id`,x),e.set(`type`,`edit`),C.push(`/collection/create?${e.toString()}`),P(!1),M(!1)}function ze(){if(!X){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!Te){y.error(S(`detail.defaultCollectionDeleteNotSupported`));return}R(!0),P(!1)}}async function Be(){if(!X)try{let e=await Ce(x);if(e.code===0){y.success(S(`detail.deleteSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),I(!1),P(!1),M(!1),C.back();return}y.error(e.message||S(`detail.deleteFailed`))}catch(e){console.error(`删除合集失败`,e),y.error(S(`detail.operationFailed`))}}return v(c,{className:`flex flex-col bg-bg1 min-h-screen ${z?`pb-28`:`pb-6`}`,children:[_(ue,{title:G?.title??``,rightChild:j?z?_(`button`,{type:`button`,onClick:ke,className:`px-2 py-1 text-sm text-text1`,children:S(`detail.done`)}):_(`button`,{type:`button`,onClick:De,className:`p-2`,children:_(de,{})}):void 0}),_(c,{className:`px-4 flex items-start gap-4`,children:v(c,{className:`flex-1 flex flex-col gap-2`,children:[_(c,{className:`flex items-center justify-between`}),_(c,{className:`text-text2 text-sm break-all text-ellipsis line-clamp-1`,children:G?.description})]})}),_(c,{className:`px-4 ${z?`pb-20`:``}`,children:_(ae,{loading:k.isLoading,hasMore:!1,emptyText:S(`detail.emptyContent`),className:`divide-y divide-text1/5`,children:q.map(e=>_(fe,{...e,onOpenShare:Ee,isEditMode:z,isSelected:V.has(e.id),onToggleSelection:Ae},e.id))})}),z&&v(c,{className:`fixed bottom-0 left-0 right-0 z-10 flex items-center justify-between border-t border-text1/10 bg-bg1 px-4 py-3`,children:[v(c,{className:`flex items-center gap-2`,children:[_(ee,{checked:Y,onCheckedChange:je}),_(l,{className:`text-sm text-text1`,children:S(`detail.selectAll`)})]}),_(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:V.size>0?`default`:`outline`,disabled:V.size===0||Z,onClick:Me,children:S(Z?`detail.deleting`:`detail.delete`)})]}),v(te,{open:N,onOpenChange:P,children:[_(ie,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),_(re,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),v(ne,{className:`z-[2000]`,children:[v(c,{className:`px-4 py-5`,children:[_(l,{className:`text-base font-bold text-text1 text-center `,children:S(`detail.collectionManageTitle`)}),v(c,{className:`mt-4 border-t border-text1/10`,children:[_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Re,children:_(l,{className:`text-text1`,children:S(`detail.editCollection`)})}),_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Oe,children:_(l,{className:`text-text1`,children:S(`detail.manageCollection`)})}),_(`button`,{className:`w-full text-left py-4 ${X?`opacity-60 cursor-not-allowed`:``}`,onClick:ze,disabled:X,children:_(l,{className:`text-destructive`,children:S(X?`detail.deleting`:`detail.deleteCollection`)})})]})]}),_(e,{className:`w-full h-auto py-4 text-lg text-text1`,size:`lg`,onClick:()=>P(!1),variant:`secondary`,children:S(`detail.cancel`)})]})]}),_(le,{isShowCollect:U?.kind===`content`&&j&&E,isCollected:U?.isCollected,open:ve,onOpenChange:M,onShareWeChat:Pe,onShareQQ:Fe,onShareMoments:Ie,onUncollect:Le}),_(m,{open:F,onOpenChange:I,onConfirm:Be,title:S(`detail.deleteCollection`),isConfirming:X})]})}export{w as CollectionDetail};
2
+ "use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,gUserViewUserInfo as r,pCommunityDeleteCollection as i,pCommunityRemoveContentFromCollection as a,pCommunitySubscribeCollection as o,pInteractionBatchDeleteCollects as s}from"../../../service/generated/client.mjs";import{useRouter as ee}from"../../../utils/use-compatible-router.mjs";import{Box as c}from"../../ui/box.mjs";import{Checkbox as te}from"../../ui/checkbox.mjs";import{Drawer as ne,DrawerContent as re,DrawerDescription as ie,DrawerTitle as ae}from"../../ui/drawer.mjs";import{List as oe}from"../../ui/list.mjs";import{Text as l}from"../../ui/text.mjs";import{useLoginModalStore as se}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as ce,useMutation as u,useRequest as d,useUpdateRequest as le}from"../../../hooks/query/use-query.mjs";import{ShareDrawer as f}from"../../common/share-popup/share-drawer.mjs";import{SharePlatformEnum as p}from"../../../types/share.mjs";import m from"../../../utils/share-manager.mjs";import{DeleteConfirmDialog as ue}from"../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as de}from"../../common/header-nav/client.mjs";import{MoreIcon as fe}from"../../common/icons/more.mjs";import{CollectionDetailCard as pe}from"./_components/collection-detail-card.mjs";import{useEffect as me,useMemo as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useSearchParams as b}from"next/navigation";import{useTranslations as he}from"next-intl";function x(e){if(e.cover_image)return e.cover_image;let t=``;return e.medias?.find(e=>e?(!e.is_video&&!t&&e.media_url&&(t=e.media_url),!!e.cover_image):!1)?.cover_image||t}function S(e){let t=e.detail.info?.video_duration;if(typeof t==`number`&&Number.isFinite(t)&&t>0)return Math.floor(t);let n=e.medias?.find(e=>{let t=e?.video_duration;return typeof t==`number`&&Number.isFinite(t)&&t>0})?.video_duration;return typeof n==`number`&&Number.isFinite(n)&&n>0?Math.floor(n):0}function C(e){let t=e.detail.info?.play_count;if(typeof t==`number`&&Number.isFinite(t))return Math.max(0,Math.floor(t));let n=e.detail.view_count||e.viewCount;return typeof n==`number`&&Number.isFinite(n)?Math.max(0,Math.floor(n)):0}function ge(e){let t=e.detail,n=t.info,r=String(n?.cover_image||t.cover_image||x(e)||``),i=String(n?.text||n?.title||t.title||t.content||``),a=t.author_score??0,o=Array.isArray(t.tags)?t.tags:[];return{id:e.content_id?String(e.content_id):String(e.id),title:i,type:typeof e.type==`number`?e.type:0,coverImage:r,score:a,collectedAt:t.create_time==null?void 0:String(t.create_time),tags:o,duration:S(e),viewCount:C(e),publishTime:String(t.create_time??t.update_time??``),is_more_link:e.is_more_link??n?.is_more_link??!1,authorName:``}}function w({id:x}){let S=he(`components.pages.collectionDetail`),C=ee(),w=b(),{userId:T,isLogin:E}=t(),{open:D}=se(),O=ce();le();let k=d([`collection-detail`,x],()=>n({collection_id:x})),A=k.data?.data?.data?.collection?.user_id,j=!!(A&&T&&String(A)===String(T)),_e=d([`user-info`,A],()=>r({target_user_id:A,user_id:A})),[ve,M]=g(!1),[N,P]=g(!1),[F,I]=g(!1),[L,R]=g(!1),[z,B]=g(!1),[V,H]=g(()=>new Set),[U,W]=g(null);me(()=>{!N&&L&&(I(!0),R(!1))},[N,L]);let G=k.data?.data?.data?.collection,K=G?.contents,q=h(()=>K?K.map(e=>({content_id:e.content_id,is_more_link:e.is_more_link,id:Number(e.content_id),detail:e,type:Number(e.source_type??0),medias:e.medias,cover_image:e.cover_image,viewCount:e.view_count})):[],[K]).map(ge),J=h(()=>new Set(q.map(e=>e.id)),[q]),Y=J.size>0&&V.size===J.size;G?.cover_image,G?.content_count,G?.is_subscribe;let{mutateAsync:ye,isPending:be}=u(async e=>await o({collection_id:x,subscribe:e})),{mutateAsync:xe,isPending:Se}=u(async e=>await a({collection_id:x,content_id:e})),{mutateAsync:Ce,isPending:X}=u(async e=>await i({collection_id:e})),{mutateAsync:we,isPending:Z}=u(async e=>await s({app_id:0,user_id:T,folder_id:x,content_type:1,content_ids:e})),Q=_e.data?.data;Q?.avatar,Q?.nick_name;let Te=j&&G?.is_default===!1;function Ee(e){W({kind:`content`,id:e.id,type:e.type,title:e.title,isCollected:!0}),M(!0)}function De(){if(j){P(!0);return}W({kind:`collection`,id:x}),M(!0)}function Oe(){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!j){y.error(S(`detail.operationFailed`));return}P(!1),H(new Set),B(!0)}function ke(){H(new Set),B(!1)}function Ae(e){H(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function je(){if(Y){H(new Set);return}H(new Set(J))}async function Me(){if(!(V.size===0||Z)){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}try{let e=await we(Array.from(V));if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),H(new Set),B(!1);return}y.error(e.message||S(`detail.uncollectFailed`))}catch(e){console.error(`批量取消收藏失败`,e),y.error(S(`detail.operationFailed`))}}}function Ne(e){if(typeof window>`u`)return``;if(e.kind===`collection`)return`${window.location.origin}/collection/${e.id}`;let t=e.title?encodeURIComponent(e.title):`detail`,n=e.type===1?`/video/${e.id}/${t}`:`/post/${e.id}`;return`${window.location.origin}${n}`}function $(e){if(!U)return;let t=Ne(U);t&&m.showSharePopup({type:e,data:{id:U.id},copyUrl:t})}function Pe(){$(p.WECHAT)}function Fe(){$(p.QQ)}function Ie(){$(p.WECHAT_MOMENTS)}function Le(){if(!Se){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}!U||U.kind!==`content`||xe(U.id).then(e=>{if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),W(e=>e&&{...e,isCollected:!1});return}y.error(e.message||S(`detail.uncollectFailed`))}).catch(e=>{console.error(`取消收藏失败`,e),y.error(S(`detail.operationFailed`))})}}function Re(){let e=new URLSearchParams(w.toString());e.set(`id`,x),e.set(`type`,`edit`),C.push(`/collection/create?${e.toString()}`),P(!1),M(!1)}function ze(){if(!X){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!Te){y.error(S(`detail.defaultCollectionDeleteNotSupported`));return}R(!0),P(!1)}}async function Be(){if(!X)try{let e=await Ce(x);if(e.code===0){y.success(S(`detail.deleteSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),I(!1),P(!1),M(!1),C.back();return}y.error(e.message||S(`detail.deleteFailed`))}catch(e){console.error(`删除合集失败`,e),y.error(S(`detail.operationFailed`))}}return v(c,{className:`flex flex-col bg-bg1 min-h-screen ${z?`pb-28`:`pb-6`}`,children:[_(de,{title:G?.title??``,rightChild:j?z?_(`button`,{type:`button`,onClick:ke,className:`px-2 py-1 text-sm text-text1`,children:S(`detail.done`)}):_(`button`,{type:`button`,onClick:De,className:`p-2`,children:_(fe,{})}):void 0}),_(c,{className:`px-4 flex items-start gap-4`,children:v(c,{className:`flex-1 flex flex-col gap-2`,children:[_(c,{className:`flex items-center justify-between`}),_(c,{className:`text-text2 text-sm break-all text-ellipsis line-clamp-1`,children:G?.description})]})}),_(c,{className:`px-4 ${z?`pb-20`:``}`,children:_(oe,{loading:k.isLoading,hasMore:!1,emptyText:S(`detail.emptyContent`),className:`divide-y divide-text1/5`,children:q.map(e=>_(pe,{...e,onOpenShare:Ee,isEditMode:z,isSelected:V.has(e.id),onToggleSelection:Ae},e.id))})}),z&&v(c,{className:`fixed bottom-0 left-0 right-0 z-10 flex items-center justify-between border-t border-text1/10 bg-bg1 px-4 py-3`,children:[v(c,{className:`flex items-center gap-2`,children:[_(te,{checked:Y,onCheckedChange:je}),_(l,{className:`text-sm text-text1`,children:S(`detail.selectAll`)})]}),_(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:V.size>0?`default`:`outline`,disabled:V.size===0||Z,onClick:Me,children:S(Z?`detail.deleting`:`detail.delete`)})]}),v(ne,{open:N,onOpenChange:P,children:[_(ae,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),_(ie,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),v(re,{className:`z-[2000]`,children:[v(c,{className:`px-4 py-5`,children:[_(l,{className:`text-base font-bold text-text1 text-center `,children:S(`detail.collectionManageTitle`)}),v(c,{className:`mt-4 border-t border-text1/10`,children:[_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Re,children:_(l,{className:`text-text1`,children:S(`detail.editCollection`)})}),_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Oe,children:_(l,{className:`text-text1`,children:S(`detail.manageCollection`)})}),_(`button`,{className:`w-full text-left py-4 ${X?`opacity-60 cursor-not-allowed`:``}`,onClick:ze,disabled:X,children:_(l,{className:`text-destructive`,children:S(X?`detail.deleting`:`detail.deleteCollection`)})})]})]}),_(e,{className:`w-full h-auto py-4 text-lg text-text1`,size:`lg`,onClick:()=>P(!1),variant:`secondary`,children:S(`detail.cancel`)})]})]}),_(f,{isShowCollect:U?.kind===`content`&&j&&E,isCollected:U?.isCollected,open:ve,onOpenChange:M,onShareWeChat:Pe,onShareQQ:Fe,onShareMoments:Ie,onUncollect:Le}),_(ue,{open:F,onOpenChange:I,onConfirm:Be,title:S(`detail.deleteCollection`),isConfirming:X})]})}export{w as CollectionDetail};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{pUserUserFeedback as r}from"../../../../service/generated/client.mjs";import{compressImage as i}from"../../../../utils/image-compression.mjs";import{uploadFile as a}from"../../../../utils/upload-file.mjs";import{Image as o}from"../../../ui/image.mjs";import{Box as s}from"../../../ui/box.mjs";import{InputGroup as c,InputGroupAddon as l,InputGroupInput as u,InputGroupTextarea as d}from"../../../ui/input-group.mjs";import{Field as f,FieldLabel as p}from"../../../ui/field.mjs";import{Text as m}from"../../../ui/text.mjs";import{HeaderNav as h}from"../../../common/header-nav/client.mjs";import{AddIcon as g}from"../../../common/icons/add.mjs";import{useRef as _,useState as v}from"react";import{XIcon as y}from"lucide-react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{toast as S}from"sonner";import{useTranslations as C}from"next-intl";import{useRouter as w}from"next/navigation";const T=new Set([`image/jpeg`,`image/jpg`,`image/png`]),E=new Set([`jpg`,`jpeg`,`png`]);function D(e){let t=e.type.toLowerCase(),n=e.name.split(`.`).pop()?.toLowerCase()||``;return t?T.has(t):E.has(n)}function O({className:T}={}){let E=C(`components.pages.feedback.components`),O=w(),{userId:k}=n(),A=_(null),[j,M]=v({content:``,contact:``}),[N,P]=v([]),[F,I]=v(!1),[L,R]=v(!1),z=!j.content.trim();function B(e,t){M(n=>({...n,[e]:t}))}function V(){L||F||N.length>=3||A.current?.click()}async function H(e){let t=Array.from(e.target.files??[]);if(!t.length)return;let n=3-N.length;if(n<=0){e.target&&(e.target.value=``);return}let r=t.slice(0,n),o=r.filter(D);if(!o.length){S.error(E(`feedbackForm.imageTypeInvalid`)),e.target&&(e.target.value=``);return}o.length!==r.length&&S.error(E(`feedbackForm.imageTypeInvalid`));try{R(!0);let e=[],t=!1;for(let n of o)try{let t=await a(await i(n),1);e.push(t.objectKey)}catch(e){console.error(`上传截图失败`,e),t=!0}e.length&&P(t=>[...t,...e].slice(0,3)),t&&S.error(E(`feedbackForm.screenshotUploadFailed`))}catch(e){console.error(`上传截图失败`,e),S.error(E(`feedbackForm.screenshotUploadFailed`))}finally{R(!1),e.target&&(e.target.value=``)}}function U(e){L||F||P(t=>t.filter((t,n)=>n!==e))}async function W(){let e=j.content.trim(),t=j.contact.trim();if(!e){S.error(E(`feedbackForm.missingFeedback`));return}if(e.length<4){S.error(E(`feedbackForm.contentMinLength`));return}if(F)return;let n=S.loading(E(`feedbackForm.loading`));try{I(!0);let i=await r({user_id:k,feedback_content:e,feedback_screenshots:N.length?N:void 0,contact_info:t||void 0});if(i.code===0){M({content:``,contact:``}),P([]),O.push(`/settings`),S.success(E(`feedbackForm.submitsuccess`),{id:n});return}S.error(i.message||E(`feedbackForm.message`),{id:n})}catch(e){console.error(`提交反馈失败`,e),S.error(e.message||E(`feedbackForm.message`),{id:n})}finally{I(!1)}}return x(s,{className:e(`min-h-screen bg-bg2`,T),children:[b(h,{title:E(`feedbackForm.title`),className:`!bg-bg2`,rightChild:b(t,{onClick:W,disabled:F||L||z,children:E(F?`feedbackForm.loading`:`feedbackForm.submit`)})}),x(s,{className:`pb-3`,children:[x(f,{className:`bg-bg2 px-3 border-none`,children:[b(p,{required:!0,children:E(`feedbackForm.label`)}),x(c,{children:[b(d,{className:`!bg-bg1 p-2.5 rounded-md`,maxLength:500,placeholder:E(`feedbackForm.placeholder`),value:j.content,onChange:e=>B(`content`,e.target.value)}),b(l,{className:`!bg-bg1`,align:`block-end`,children:b(`div`,{className:`text-right w-full`,children:x(`span`,{className:`text-xs`,children:[j.content.length,`/500`]})})})]})]}),x(f,{className:`bg-bg2 px-3 border-none`,children:[b(p,{children:E(`feedbackForm.screenshotLabel`)}),b(`input`,{ref:A,type:`file`,multiple:!0,accept:`image/jpeg,image/jpg,image/png,.jpg,.jpeg,.png`,className:`hidden`,onChange:H}),x(s,{className:`mt-2 grid grid-cols-3 gap-2`,children:[N.map((e,n)=>x(s,{className:`relative overflow-hidden rounded-lg border border-line1 !bg-bg1 aspect-square`,children:[b(o,{src:e,alt:E(`feedbackForm.alt`),fill:!0,className:`object-cover`}),b(t,{size:`icon-xs`,variant:`secondary`,className:`absolute right-1 top-1 rounded-full bg-bg1/85`,onClick:()=>U(n),"aria-label":E(`feedbackForm.delete`),children:b(y,{})})]},`${e}-${n}`)),N.length<3&&x(s,{className:`flex flex-col aspect-square items-center justify-center gap-2 rounded-lg border border-dashed border-text1/10 !bg-bg1 py-3 text-center`,onClick:V,children:[b(g,{}),b(m,{className:`text-xs text-text3`,children:E(L?`feedbackForm.uploading`:`feedbackForm.addScreenshot`)})]})]})]}),x(f,{className:`bg-bg2 px-3 border-none `,children:[b(p,{children:E(`feedbackForm.contactLabel`)}),b(c,{children:b(u,{className:`!bg-bg1 p-2.5 h-auto rounded-md`,placeholder:E(`feedbackForm.placeholder1_6d0242`),value:j.contact,onChange:e=>B(`contact`,e.target.value)})})]})]})]})}export{O as FeedbackForm};
2
+ "use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{pUserUserFeedback as r}from"../../../../service/generated/client.mjs";import{compressImage as i}from"../../../../utils/image-compression.mjs";import{uploadFile as a}from"../../../../utils/upload-file.mjs";import{useRouter as o}from"../../../../utils/use-compatible-router.mjs";import{Image as s}from"../../../ui/image.mjs";import{Box as c}from"../../../ui/box.mjs";import{InputGroup as l,InputGroupAddon as u,InputGroupInput as d,InputGroupTextarea as f}from"../../../ui/input-group.mjs";import{Field as p,FieldLabel as m}from"../../../ui/field.mjs";import{Text as h}from"../../../ui/text.mjs";import{HeaderNav as g}from"../../../common/header-nav/client.mjs";import{AddIcon as _}from"../../../common/icons/add.mjs";import{useRef as v,useState as y}from"react";import{XIcon as b}from"lucide-react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{toast as C}from"sonner";import{useTranslations as w}from"next-intl";const T=new Set([`image/jpeg`,`image/jpg`,`image/png`]),E=new Set([`jpg`,`jpeg`,`png`]);function D(e){let t=e.type.toLowerCase(),n=e.name.split(`.`).pop()?.toLowerCase()||``;return t?T.has(t):E.has(n)}function O({className:T}={}){let E=w(`components.pages.feedback.components`),O=o(),{userId:k}=n(),A=v(null),[j,M]=y({content:``,contact:``}),[N,P]=y([]),[F,I]=y(!1),[L,R]=y(!1),z=!j.content.trim();function B(e,t){M(n=>({...n,[e]:t}))}function V(){L||F||N.length>=3||A.current?.click()}async function H(e){let t=Array.from(e.target.files??[]);if(!t.length)return;let n=3-N.length;if(n<=0){e.target&&(e.target.value=``);return}let r=t.slice(0,n),o=r.filter(D);if(!o.length){C.error(E(`feedbackForm.imageTypeInvalid`)),e.target&&(e.target.value=``);return}o.length!==r.length&&C.error(E(`feedbackForm.imageTypeInvalid`));try{R(!0);let e=[],t=!1;for(let n of o)try{let t=await a(await i(n),1);e.push(t.objectKey)}catch(e){console.error(`上传截图失败`,e),t=!0}e.length&&P(t=>[...t,...e].slice(0,3)),t&&C.error(E(`feedbackForm.screenshotUploadFailed`))}catch(e){console.error(`上传截图失败`,e),C.error(E(`feedbackForm.screenshotUploadFailed`))}finally{R(!1),e.target&&(e.target.value=``)}}function U(e){L||F||P(t=>t.filter((t,n)=>n!==e))}async function W(){let e=j.content.trim(),t=j.contact.trim();if(!e){C.error(E(`feedbackForm.missingFeedback`));return}if(e.length<4){C.error(E(`feedbackForm.contentMinLength`));return}if(F)return;let n=C.loading(E(`feedbackForm.loading`));try{I(!0);let i=await r({user_id:k,feedback_content:e,feedback_screenshots:N.length?N:void 0,contact_info:t||void 0});if(i.code===0){M({content:``,contact:``}),P([]),O.push(`/settings`),C.success(E(`feedbackForm.submitsuccess`),{id:n});return}C.error(i.message||E(`feedbackForm.message`),{id:n})}catch(e){console.error(`提交反馈失败`,e),C.error(e.message||E(`feedbackForm.message`),{id:n})}finally{I(!1)}}return S(c,{className:e(`min-h-screen bg-bg2`,T),children:[x(g,{title:E(`feedbackForm.title`),className:`!bg-bg2`,rightChild:x(t,{onClick:W,disabled:F||L||z,children:E(F?`feedbackForm.loading`:`feedbackForm.submit`)})}),S(c,{className:`pb-3`,children:[S(p,{className:`bg-bg2 px-3 border-none`,children:[x(m,{required:!0,children:E(`feedbackForm.label`)}),S(l,{children:[x(f,{className:`!bg-bg1 p-2.5 rounded-md`,maxLength:500,placeholder:E(`feedbackForm.placeholder`),value:j.content,onChange:e=>B(`content`,e.target.value)}),x(u,{className:`!bg-bg1`,align:`block-end`,children:x(`div`,{className:`text-right w-full`,children:S(`span`,{className:`text-xs`,children:[j.content.length,`/500`]})})})]})]}),S(p,{className:`bg-bg2 px-3 border-none`,children:[x(m,{children:E(`feedbackForm.screenshotLabel`)}),x(`input`,{ref:A,type:`file`,multiple:!0,accept:`image/jpeg,image/jpg,image/png,.jpg,.jpeg,.png`,className:`hidden`,onChange:H}),S(c,{className:`mt-2 grid grid-cols-3 gap-2`,children:[N.map((e,n)=>S(c,{className:`relative overflow-hidden rounded-lg border border-line1 !bg-bg1 aspect-square`,children:[x(s,{src:e,alt:E(`feedbackForm.alt`),fill:!0,className:`object-cover`}),x(t,{size:`icon-xs`,variant:`secondary`,className:`absolute right-1 top-1 rounded-full bg-bg1/85`,onClick:()=>U(n),"aria-label":E(`feedbackForm.delete`),children:x(b,{})})]},`${e}-${n}`)),N.length<3&&S(c,{className:`flex flex-col aspect-square items-center justify-center gap-2 rounded-lg border border-dashed border-text1/10 !bg-bg1 py-3 text-center`,onClick:V,children:[x(_,{}),x(h,{className:`text-xs text-text3`,children:E(L?`feedbackForm.uploading`:`feedbackForm.addScreenshot`)})]})]})]}),S(p,{className:`bg-bg2 px-3 border-none `,children:[x(m,{children:E(`feedbackForm.contactLabel`)}),x(l,{children:x(d,{className:`!bg-bg1 p-2.5 h-auto rounded-md`,placeholder:E(`feedbackForm.placeholder1_6d0242`),value:j.contact,onChange:e=>B(`contact`,e.target.value)})})]})]})]})}export{O as FeedbackForm};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import e from"../../biz/basics/fullscreen-feed/runtime/client.mjs";import{useMixedFeedController as t}from"../../biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs";import{useSeriesFeedController as n}from"../../biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs";import{SeriesEpisodes as r}from"../../common/series-episodes/index.mjs";import{useCallback as i,useEffect as a,useMemo as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";import{usePathname as d}from"next/navigation";function f({blockId:f,seriesId:p,initialContents:m,videoConfig:h,hasBottom:g,pageSize:_=6,initialActiveIndex:v=0,items:y,onSwipeTo:b,onEpisodeNavigate:x,onGoToEpisode:S,currentUserId:C,followIds:w,onFollowIdsChange:T,onRequireLogin:E}){let D=u(`components.pages.fullscreenFeed`),O=d(),k=o(()=>{let e=p?`series:${p}`:`block:${f||``}`;return`${O||`unknown`}:fullscreen-feed:${e}:pageSize:${_}`},[f,_,O,p]),A=`${k}:series-controller`,j=`${k}:mixed-controller`,M=n({seriesId:p||``,initialContents:m,initialActiveIndex:v,onEpisodeNavigate:x,keepAliveKey:A}),N=t({blockId:f||``,initialContents:m,initialActiveIndex:v,pageSize:_,keepAliveKey:j}),P=p?M:N,F=y||P.items,I=P.activeIndex,L=P.userInteracted,R=i((e,t)=>{P.setActiveIndex(e,t),p||N.maybeLoadMore(e),b?.({activeIndex:e,items:F,direction:t})},[P,F,b,p,N]),z=i((e,t)=>{P.updateItemData(e,t)},[P]),B=i(e=>P.getNavigationInfo(e),[P]);return a(()=>{S&&S(e=>{R(e,`jump`)})},[S,R]),!f&&!p?c(`div`,{className:`flex h-screen w-full items-center justify-center bg-black text-white/70`,children:D(`page.missingParams`)}):l(s,{children:[c(e,{items:F,activeIndex:I,bottom:g?56:void 0,videoConfig:h,userInteracted:L,onUserInteracted:P.setUserInteracted,onActiveIndexChange:R,onDataUpdate:z,getNavigationInfo:B,currentUserId:C,followIds:w,onFollowIdsChange:T,onRequireLogin:E}),p&&M.isSeriesSelectorOpen&&c(r,{title:D(`page.episodeSelectorTitle`),mode:`selector`,variant:`sheet`,open:M.isSeriesSelectorOpen,seriesList:M.seriesMeta.seriesList,activeEpisodeId:M.activeEpisodeId,onClose:M.closeSeriesSelector,onSelectEpisode:M.onSelectEpisode})]})}export{f as default};
2
+ "use client";import e from"../../biz/basics/fullscreen-feed/runtime/client.mjs";import{useMixedFeedController as t}from"../../biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs";import{useSeriesFeedController as n}from"../../biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs";import{SeriesEpisodes as r}from"../../common/series-episodes/index.mjs";import{useCallback as i,useEffect as a,useMemo as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{usePathname as u}from"next/navigation";import{useTranslations as d}from"next-intl";function f({blockId:f,seriesId:p,initialContents:m,videoConfig:h,hasBottom:g,pageSize:_=6,initialActiveIndex:v=0,items:y,onSwipeTo:b,onEpisodeNavigate:x,onGoToEpisode:S,currentUserId:C,followIds:w,onFollowIdsChange:T,onRequireLogin:E}){let D=d(`components.pages.fullscreenFeed`),O=u(),k=o(()=>{let e=p?`series:${p}`:`block:${f||``}`;return`${O||`unknown`}:fullscreen-feed:${e}:pageSize:${_}`},[f,_,O,p]),A=`${k}:series-controller`,j=`${k}:mixed-controller`,M=n({seriesId:p||``,initialContents:m,initialActiveIndex:v,onEpisodeNavigate:x,keepAliveKey:A}),N=t({blockId:f||``,initialContents:m,initialActiveIndex:v,pageSize:_,keepAliveKey:j}),P=p?M:N,F=y||P.items,I=P.activeIndex,L=P.userInteracted,R=i((e,t)=>{P.setActiveIndex(e,t),p||N.maybeLoadMore(e),b?.({activeIndex:e,items:F,direction:t})},[P,F,b,p,N]),z=i((e,t)=>{P.updateItemData(e,t)},[P]),B=i(e=>P.getNavigationInfo(e),[P]);return a(()=>{S&&S(e=>{R(e,`jump`)})},[S,R]),!f&&!p?c(`div`,{className:`flex h-screen w-full items-center justify-center bg-black text-white/70`,children:D(`page.missingParams`)}):l(s,{children:[c(e,{items:F,activeIndex:I,bottom:g?56:void 0,videoConfig:h,userInteracted:L,onUserInteracted:P.setUserInteracted,onActiveIndexChange:R,onDataUpdate:z,getNavigationInfo:B,currentUserId:C,followIds:w,onFollowIdsChange:T,onRequireLogin:E}),p&&M.isSeriesSelectorOpen&&c(r,{title:D(`page.episodeSelectorTitle`),mode:`selector`,variant:`sheet`,open:M.isSeriesSelectorOpen,seriesList:M.seriesMeta.seriesList,activeEpisodeId:M.activeEpisodeId,onClose:M.closeSeriesSelector,onSelectEpisode:M.onSelectEpisode})]})}export{f as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{gContentGetAppChannelBlock as e,gContentGetAppChannelBlockData as t,gContentListVisibleFloatingBall as n}from"../../../service/generated/client.mjs";import{Image as r}from"../../ui/image.mjs";import{Box as i}from"../../ui/box.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as o}from"../../../hooks/use-auth.mjs";import{queryKey as s}from"../../../constants/query-key.mjs";import{useKeepAliveState as c}from"../../common/keep-scroll-position/index.mjs";import{extractDataByComponentType as l}from"../../biz/utils/transformers/data.mjs";import{useEffect as u,useLayoutEffect as d,useMemo as f,useRef as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{useRouter as _}from"next/navigation";function v(){if(typeof document>`u`)return 0;let e=document.querySelector(`[data-top-nav-root="true"]`);return e&&e.getBoundingClientRect().height||0}function y({currentChannelId:y,isPGC:b}){let x=_(),S=o(),{data:C}=a(s.GET_CONTENT_LIST(y),()=>e({channel_id:y})),{data:w}=a([s.FLOATING_BALL],()=>n()),T=f(()=>C?.data?.blocks||[],[C?.data?.blocks]),E=f(()=>{let e=T.findIndex(e=>e.type===4),t=e>=0?T[e]:null;return{index:e,block:t,blockId:t?.id||``}},[T]),{data:D}=a([s.GUESS_YOU_LIKE_USER_DATA,E.blockId],()=>t({block_id:E.blockId}),{enabled:!!E.blockId}),O=f(()=>{if(E.index<0)return T;let e=D?.data.block?.data?.users||[];return T.map((t,n)=>n===E.index?{...t,data:{...t.data||{},users:e}}:t)},[T,D,E.index]),[k,A]=c(`home-scroll-top-${y}`,0),j=p({restored:!1,lastScrollTop:k,key:y,rafId:null}),M=p(A),N=p(k);u(()=>{M.current=A},[A]),u(()=>{N.current=k},[k]),u(()=>{j.current.key!==y&&(j.current.restored=!1,j.current.lastScrollTop=k,N.current=k,j.current.key=y)},[y,k]);let P=O.length>0;d(()=>{if(!P||j.current.restored||k<=0)return;let e=v(),t=Math.max(0,k+e);window.requestAnimationFrame(()=>{window.scrollTo({top:t}),j.current.restored=!0,j.current.lastScrollTop=t})},[P,y,k]),u(()=>{let e=j.current;function t(){e.restored=!0,e.rafId!==null&&window.cancelAnimationFrame(e.rafId),e.rafId=window.requestAnimationFrame(()=>{e.rafId=null;let t=window.scrollY??document.documentElement.scrollTop??0,n=v(),r=Math.max(0,t-n);Math.abs(t-e.lastScrollTop)>1&&(e.lastScrollTop=t,M.current(r))})}return window.addEventListener(`scroll`,t,{passive:!0}),()=>{e.rafId!==null&&(window.cancelAnimationFrame(e.rafId),e.rafId=null),window.removeEventListener(`scroll`,t)}},[y]);let F=f(()=>l(O,b),[O,b]),I=f(()=>w?.data?.ball_infos?.find(e=>e.channel_id===y),[w?.data?.ball_infos,y]);return g(m,{children:[I&&h(i,{className:`fixed right-[20px] bottom-[80px] w-[52px] h-[52px] z-30 rounded-[16px] cursor-move select-none bg-[#FD4C5E33] overflow-hidden`,onClick:()=>{S(()=>{I?.jump_url&&x.push(I.jump_url)})},children:h(r,{src:I.material_url||``,alt:I.name||``,fill:!0,priority:!0,fetchPriority:`high`,sizes:`52px`,unoptimized:!0})}),F.map(e=>{let t=e.component,n=e.data.block_id||`block-${e.data.title||``}`;return h(t,{data:e.data},n)})]})}export{y as default};
2
+ "use client";import{gContentGetAppChannelBlock as e,gContentGetAppChannelBlockData as t,gContentListVisibleFloatingBall as n}from"../../../service/generated/client.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{Image as i}from"../../ui/image.mjs";import{Box as a}from"../../ui/box.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as s}from"../../../hooks/use-auth.mjs";import{queryKey as c}from"../../../constants/query-key.mjs";import{useKeepAliveState as l}from"../../common/keep-scroll-position/index.mjs";import{extractDataByComponentType as u}from"../../biz/utils/transformers/data.mjs";import{useEffect as d,useLayoutEffect as f,useMemo as p,useRef as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";function v(){if(typeof document>`u`)return 0;let e=document.querySelector(`[data-top-nav-root="true"]`);return e&&e.getBoundingClientRect().height||0}function y({currentChannelId:y,isPGC:b}){let x=r(),S=s(),{data:C}=o(c.GET_CONTENT_LIST(y),()=>e({channel_id:y})),{data:w}=o([c.FLOATING_BALL],()=>n()),T=p(()=>C?.data?.blocks||[],[C?.data?.blocks]),E=p(()=>{let e=T.findIndex(e=>e.type===4),t=e>=0?T[e]:null;return{index:e,block:t,blockId:t?.id||``}},[T]),{data:D}=o([c.GUESS_YOU_LIKE_USER_DATA,E.blockId],()=>t({block_id:E.blockId}),{enabled:!!E.blockId}),O=p(()=>{if(E.index<0)return T;let e=D?.data.block?.data?.users||[];return T.map((t,n)=>n===E.index?{...t,data:{...t.data||{},users:e}}:t)},[T,D,E.index]),[k,A]=l(`home-scroll-top-${y}`,0),j=m({restored:!1,lastScrollTop:k,key:y,rafId:null}),M=m(A),N=m(k);d(()=>{M.current=A},[A]),d(()=>{N.current=k},[k]),d(()=>{j.current.key!==y&&(j.current.restored=!1,j.current.lastScrollTop=k,N.current=k,j.current.key=y)},[y,k]);let P=O.length>0;f(()=>{if(!P||j.current.restored||k<=0)return;let e=v(),t=Math.max(0,k+e);window.requestAnimationFrame(()=>{window.scrollTo({top:t}),j.current.restored=!0,j.current.lastScrollTop=t})},[P,y,k]),d(()=>{let e=j.current;function t(){e.restored=!0,e.rafId!==null&&window.cancelAnimationFrame(e.rafId),e.rafId=window.requestAnimationFrame(()=>{e.rafId=null;let t=window.scrollY??document.documentElement.scrollTop??0,n=v(),r=Math.max(0,t-n);Math.abs(t-e.lastScrollTop)>1&&(e.lastScrollTop=t,M.current(r))})}return window.addEventListener(`scroll`,t,{passive:!0}),()=>{e.rafId!==null&&(window.cancelAnimationFrame(e.rafId),e.rafId=null),window.removeEventListener(`scroll`,t)}},[y]);let F=p(()=>u(O,b),[O,b]),I=p(()=>w?.data?.ball_infos?.find(e=>e.channel_id===y),[w?.data?.ball_infos,y]);return _(h,{children:[I&&g(a,{className:`fixed right-[20px] bottom-[80px] w-[52px] h-[52px] z-30 rounded-[16px] cursor-move select-none bg-[#FD4C5E33] overflow-hidden`,onClick:()=>{S(()=>{I?.jump_url&&x.push(I.jump_url)})},children:g(i,{src:I.material_url||``,alt:I.name||``,fill:!0,priority:!0,fetchPriority:`high`,sizes:`52px`,unoptimized:!0})}),F.map(e=>{let t=e.component,n=e.data.block_id||`block-${e.data.title||``}`;return g(t,{data:e.data},n)})]})}export{y as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{useIsLoggedIn as t,useLoginModalOpen as n,useOpenLogin as r}from"../../../hooks/use-auth.mjs";import{useEffect as i,useRef as a}from"react";import{Fragment as o,jsx as s}from"react/jsx-runtime";import{useRouter as c}from"next/navigation";function l({children:l}){let u=t(),d=n(),f=r(),p=c(),m=a(null);return i(()=>{u||f()},[u,f]),i(()=>{let t=m.current;if(m.current=d,t===!0&&d===!1){let t=setTimeout(()=>{e.getState().isLogin||p.back()},0);return()=>clearTimeout(t)}},[d,p]),u?s(o,{children:l}):null}export{l as AuthGuard};
2
+ "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{useRouter as t}from"../../../utils/use-compatible-router.mjs";import{useIsLoggedIn as n,useLoginModalOpen as r,useOpenLogin as i}from"../../../hooks/use-auth.mjs";import{useEffect as a,useRef as o}from"react";import{Fragment as s,jsx as c}from"react/jsx-runtime";function l({children:l}){let u=n(),d=r(),f=i(),p=t(),m=o(null);return a(()=>{u||f()},[u,f]),a(()=>{let t=m.current;if(m.current=d,t===!0&&d===!1){let t=setTimeout(()=>{e.getState().isLogin||p.back()},0);return()=>clearTimeout(t)}},[d,p]),u?c(s,{children:l}):null}export{l as AuthGuard};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetComments as n,gCommunityGetContentInfo as r,gCommunityGetContentList as i,gContentGetAppChannels as a}from"../../../service/generated/client.mjs";import{checkFollowStatus as o}from"../../../utils/follow-service.mjs";import{EmptyState as s}from"../../ui/empty.mjs";import{useRequest as c}from"../../../hooks/query/use-query.mjs";import{useBrowseReport as l}from"../../../hooks/use-browse-report.mjs";import{queryKey as u}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as ee,useKeepAliveState as d}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as f}from"../../../utils/api-collect.mjs";import{batchQueryContentInteractions as p}from"../../../hooks/use-content-operate.mjs";import m from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{DetailFollowAction as te}from"../../biz/business/detail/shared/detail-follow-action.mjs";import{DetailOperate as ne}from"../../biz/business/detail/shared/detail-operate.mjs";import{PostRecommendList as re}from"../../biz/business/detail/shared/post-recommend-list.mjs";import{DetailHero as h}from"../../biz/business/detail/shared/video-hero.mjs";import g from"../../biz/business/comment/comment-list.mjs";import ie from"../../common/info-card/card-header.mjs";import ae from"../../common/info-card/card-text.mjs";import{useCallback as oe,useEffect as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";import{useSearchParams as S}from"next/navigation";function C(e){if(!e||typeof e!=`object`||!e.content_id)return null;let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1),r=t.filter(e=>e&&e.is_video===!0),i=n.map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),a=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),o=i.length?i:a,s=r.map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),c=o[0]||``,l=e.cover_image||s||c||``,u=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name));return{...t.length?{medias:t}:{},id:e.content_id,mid:e.content_id,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:l,img_y:l,img_width:``,img_height:``,preview_images:o,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:u,source_tags:u.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,static:{like_cnt:e.like_count||0,comment_cnt:e.comment_count||0,share_cnt:e.share_count||0,browse_cnt:e.view_count||0},info:{text:e.content||``,images:o}}}function ce(e){let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1).map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),r=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),i=n.length?n:r,a=t.filter(e=>e&&e.is_video===!0).map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),o=e.cover_image||a||i[0]||``,s=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name)),c=t.length?t:i.filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}));return{...c.length?{medias:c}:{},id:e.content_id||``,mid:e.content_id||``,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:o,img_y:o,img_width:``,img_height:``,preview_images:i,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:s,source_tags:s.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,statics_cnt:{like_cnt:String(e.like_count||0),dislike_cnt:String(e.dislike_count||0),comment_cnt:String(e.comment_count||0),share_cnt:String(e.share_count||0),browse_cnt:String(e.view_count||0),collect_cnt:String(e.collect_count||0)}}}function w({detailId:f,initialInformation:w,initialRecommendList:le,initialCommentList:T,initialCommentTotal:E,initialCommentHasMore:D}){let O=se(`components.pages.postDetail`),k=S(),{isLogin:ue,userInfo:A,userId:de}=t(),j=de||A?.userId||``;l({contentId:f,contentType:2,enabled:!!f,enableIntervalReport:!1,enableExitReport:!1});let{data:M}=c(v(()=>[`post-detail`,f],[f]),async()=>f?await r({content_id:f}):null,{enabled:!!f}),N=v(()=>{let e=M?.data?.data;return C(e)},[M?.data?.data]),fe=w??N??null,{data:P}=c(v(()=>[`post-detail-recommend`,f],[f]),async()=>f?await i({page:1,page_size:6,sort_by:`recommend`}):null,{enabled:!!f}),F=v(()=>(P?.data?.data?.contents??[]).filter(e=>e.content_id!==f).slice(0,4).map(e=>ce(e)),[f,P?.data?.data?.contents]),I=le??F??[],[L,R]=d(`detail-information-${f}`,fe),[z,B]=d(`detail-recommend-${f}`,I),[V,H]=d(`info-detail-comment-add-count-${f}`,0),U=v(()=>L?.content_type===0,[L?.content_type]),W=v(()=>[`post-detail-comments`,f,1,5],[5,f]),{data:G}=c(W,async()=>f?await n({content_id:f,page:1,page_size:5,sort_by:`latest`}):null,{enabled:!!f}),pe=v(()=>{if(T?.length)return T;let e=G?.data?.data?.comments??[];if(e.length>0)return e},[G?.data?.data?.comments,T]),K=v(()=>{if(typeof E==`number`)return E;if(G?.data?.data)return typeof G?.data?.data?.total==`number`?G.data.data.total:void 0},[G?.data?.data,E]),me=v(()=>{if(typeof D==`boolean`)return D;if(G?.data?.data)return G?.data?.data?.has_more??!1},[G?.data?.data,D]),[q,J]=d(`post-detail-comment-total-${f}`,typeof E==`number`?E:void 0);_(()=>{typeof K==`number`&&J(e=>typeof e==`number`?Math.max(e,K):K)},[K,J]);let he=v(()=>[`detail-interaction`,L?.id,L?.content_type],[L?.content_type,L?.id]),Y=L?.up_user||``,ge=!!(j&&Y&&j===Y),_e=v(()=>[`detail-follow-status`,j,Y],[j,Y]),{data:X}=c(he,async()=>!L?.id||typeof L.content_type!=`number`?null:await p([L.id],2),{enabled:!!L?.id}),{data:Z}=c(_e,async()=>!j||!Y?null:await o({app_id:0,follower_id:j,followee_ids:[Y]}),{enabled:!!ue&&!!j&&!!Y&&!ge});_(()=>{!L&&N&&R(N)},[L,N,R]),_(()=>{z.length===0&&F.length>0&&B(F)},[z.length,F,B]),_(()=>{if(!X?.interaction_list?.[0])return;let e=X.interaction_list[0];R(t=>{if(!t)return t;let n=t.static?.like_cnt,r=typeof n==`number`?n:Number(n||0),i=!!e.is_liked&&r===0;return{...t,like:e.is_liked||!1,dislike:e.is_disliked||!1,collect:e.is_collected||!1,static:i?{...t.static||{},like_cnt:1}:t.static}})},[X,R]),_(()=>{if(!Z?.data||!Y)return;let e=!!Z.data?.is_following_map?.[Y];R(t=>!t||t.is_followed===e?t:{...t,is_followed:e})},[Z?.data,Y,R]);let Q=oe(e=>{R(t=>t&&{...t,...e})},[R]);ee(()=>{L?.id&&L.id},[L?.id],`detail-page-report-${f}`),_(()=>{!L||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:L.id||f,author_id:L.up_user,object_type:L.content_type,object_category:L.content_type,object_tags:L.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[f,L]),_(()=>{H(0)},[L?.id,H]);let ve=v(()=>(typeof q==`number`?q:typeof K==`number`?K:0)+V,[V,q,K]);_(()=>{k?.get(`tab`)===`comment`&&(typeof window>`u`||window.requestAnimationFrame(()=>{document.getElementById(`detail-comments`)?.scrollIntoView({behavior:`smooth`,block:`start`})}))},[L?.id,k]);let $=L?.status===`2`,{data:ye}=c([u.CHANNEL],()=>a());return x(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 pt-11`,children:[b(`div`,{className:`fixed top-0 left-0 right-0 z-40`,children:b(m,{data:{list:e(ye?.data)}})}),b(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:x(y,{children:[L&&!$&&b(s,{type:`no-content`,text:O(`postDetailClient.postOffline`)}),L&&$&&x(y,{children:[U&&b(h,{information:L,isVideo:!0}),x(`article`,{className:`w-full`,children:[b(ie,{infoData:L,rightChild:b(te,{information:L,onUpdate:Q})}),b(ae,{infoData:L,isEllipsis:!1}),!U&&b(`div`,{className:`mt-[12px]`,children:b(h,{information:L,isVideo:!1})})]}),b(ne,{information:L,onUpdate:Q}),x(`div`,{id:`detail-comments`,className:`w-full border-t-[8px] border-bg2 mt-[12px]`,children:[x(`div`,{className:`w-full px-[16px] h-[40px] flex items-center justify-between border-b-[1px] border-line1`,children:[b(`p`,{className:`text-[16px] text-text1 font-bold`,children:O(`postDetailClient.comment`)}),x(`p`,{className:`text-[12px] text-text3`,children:[ve,O(`postDetailClient.reactions`)]})]}),b(g,{listQueryKey:W,contentId:L.id,information:L,isShow:!1,isClickLoad:!0,initialComments:pe,initialTotal:K,initialHasMore:me,addCommentCount:()=>{H(e=>e+1)},onTotalChange:e=>{J(t=>typeof t==`number`?Math.max(t,e):e)}})]}),z.length>0&&b(re,{information:L,initRecommendList:z})]}),!L&&b(s,{type:`no-content`,text:O(`postDetailClient.postDeleted`)})]})})]})}export{w as default};
2
+ "use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetComments as n,gCommunityGetContentInfo as r,gCommunityGetContentList as i,gContentGetAppChannels as a}from"../../../service/generated/client.mjs";import{checkFollowStatus as o}from"../../../utils/follow-service.mjs";import{EmptyState as s}from"../../ui/empty.mjs";import{useRequest as c}from"../../../hooks/query/use-query.mjs";import{useBrowseReport as l}from"../../../hooks/use-browse-report.mjs";import{queryKey as u}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as ee,useKeepAliveState as d}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as f}from"../../../utils/api-collect.mjs";import{batchQueryContentInteractions as p}from"../../../hooks/use-content-operate.mjs";import m from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{DetailFollowAction as te}from"../../biz/business/detail/shared/detail-follow-action.mjs";import{DetailOperate as ne}from"../../biz/business/detail/shared/detail-operate.mjs";import{PostRecommendList as re}from"../../biz/business/detail/shared/post-recommend-list.mjs";import{DetailHero as h}from"../../biz/business/detail/shared/video-hero.mjs";import g from"../../biz/business/comment/comment-list.mjs";import ie from"../../common/info-card/card-header.mjs";import ae from"../../common/info-card/card-text.mjs";import{useCallback as oe,useEffect as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{useSearchParams as se}from"next/navigation";import{useTranslations as S}from"next-intl";function C(e){if(!e||typeof e!=`object`||!e.content_id)return null;let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1),r=t.filter(e=>e&&e.is_video===!0),i=n.map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),a=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),o=i.length?i:a,s=r.map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),c=o[0]||``,l=e.cover_image||s||c||``,u=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name));return{...t.length?{medias:t}:{},id:e.content_id,mid:e.content_id,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:l,img_y:l,img_width:``,img_height:``,preview_images:o,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:u,source_tags:u.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,static:{like_cnt:e.like_count||0,comment_cnt:e.comment_count||0,share_cnt:e.share_count||0,browse_cnt:e.view_count||0},info:{text:e.content||``,images:o}}}function ce(e){let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1).map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),r=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),i=n.length?n:r,a=t.filter(e=>e&&e.is_video===!0).map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),o=e.cover_image||a||i[0]||``,s=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name)),c=t.length?t:i.filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}));return{...c.length?{medias:c}:{},id:e.content_id||``,mid:e.content_id||``,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:o,img_y:o,img_width:``,img_height:``,preview_images:i,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:s,source_tags:s.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,statics_cnt:{like_cnt:String(e.like_count||0),dislike_cnt:String(e.dislike_count||0),comment_cnt:String(e.comment_count||0),share_cnt:String(e.share_count||0),browse_cnt:String(e.view_count||0),collect_cnt:String(e.collect_count||0)}}}function w({detailId:f,initialInformation:w,initialRecommendList:le,initialCommentList:T,initialCommentTotal:E,initialCommentHasMore:D}){let O=S(`components.pages.postDetail`),k=se(),{isLogin:ue,userInfo:A,userId:de}=t(),j=de||A?.userId||``;l({contentId:f,contentType:2,enabled:!!f,enableIntervalReport:!1,enableExitReport:!1});let{data:M}=c(v(()=>[`post-detail`,f],[f]),async()=>f?await r({content_id:f}):null,{enabled:!!f}),N=v(()=>{let e=M?.data?.data;return C(e)},[M?.data?.data]),fe=w??N??null,{data:P}=c(v(()=>[`post-detail-recommend`,f],[f]),async()=>f?await i({page:1,page_size:6,sort_by:`recommend`}):null,{enabled:!!f}),F=v(()=>(P?.data?.data?.contents??[]).filter(e=>e.content_id!==f).slice(0,4).map(e=>ce(e)),[f,P?.data?.data?.contents]),I=le??F??[],[L,R]=d(`detail-information-${f}`,fe),[z,B]=d(`detail-recommend-${f}`,I),[V,H]=d(`info-detail-comment-add-count-${f}`,0),U=v(()=>L?.content_type===0,[L?.content_type]),W=v(()=>[`post-detail-comments`,f,1,5],[5,f]),{data:G}=c(W,async()=>f?await n({content_id:f,page:1,page_size:5,sort_by:`latest`}):null,{enabled:!!f}),pe=v(()=>{if(T?.length)return T;let e=G?.data?.data?.comments??[];if(e.length>0)return e},[G?.data?.data?.comments,T]),K=v(()=>{if(typeof E==`number`)return E;if(G?.data?.data)return typeof G?.data?.data?.total==`number`?G.data.data.total:void 0},[G?.data?.data,E]),me=v(()=>{if(typeof D==`boolean`)return D;if(G?.data?.data)return G?.data?.data?.has_more??!1},[G?.data?.data,D]),[q,J]=d(`post-detail-comment-total-${f}`,typeof E==`number`?E:void 0);_(()=>{typeof K==`number`&&J(e=>typeof e==`number`?Math.max(e,K):K)},[K,J]);let he=v(()=>[`detail-interaction`,L?.id,L?.content_type],[L?.content_type,L?.id]),Y=L?.up_user||``,ge=!!(j&&Y&&j===Y),_e=v(()=>[`detail-follow-status`,j,Y],[j,Y]),{data:X}=c(he,async()=>!L?.id||typeof L.content_type!=`number`?null:await p([L.id],2),{enabled:!!L?.id}),{data:Z}=c(_e,async()=>!j||!Y?null:await o({app_id:0,follower_id:j,followee_ids:[Y]}),{enabled:!!ue&&!!j&&!!Y&&!ge});_(()=>{!L&&N&&R(N)},[L,N,R]),_(()=>{z.length===0&&F.length>0&&B(F)},[z.length,F,B]),_(()=>{if(!X?.interaction_list?.[0])return;let e=X.interaction_list[0];R(t=>{if(!t)return t;let n=t.static?.like_cnt,r=typeof n==`number`?n:Number(n||0),i=!!e.is_liked&&r===0;return{...t,like:e.is_liked||!1,dislike:e.is_disliked||!1,collect:e.is_collected||!1,static:i?{...t.static||{},like_cnt:1}:t.static}})},[X,R]),_(()=>{if(!Z?.data||!Y)return;let e=!!Z.data?.is_following_map?.[Y];R(t=>!t||t.is_followed===e?t:{...t,is_followed:e})},[Z?.data,Y,R]);let Q=oe(e=>{R(t=>t&&{...t,...e})},[R]);ee(()=>{L?.id&&L.id},[L?.id],`detail-page-report-${f}`),_(()=>{!L||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:L.id||f,author_id:L.up_user,object_type:L.content_type,object_category:L.content_type,object_tags:L.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[f,L]),_(()=>{H(0)},[L?.id,H]);let ve=v(()=>(typeof q==`number`?q:typeof K==`number`?K:0)+V,[V,q,K]);_(()=>{k?.get(`tab`)===`comment`&&(typeof window>`u`||window.requestAnimationFrame(()=>{document.getElementById(`detail-comments`)?.scrollIntoView({behavior:`smooth`,block:`start`})}))},[L?.id,k]);let $=L?.status===`2`,{data:ye}=c([u.CHANNEL],()=>a());return x(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 pt-11`,children:[b(`div`,{className:`fixed top-0 left-0 right-0 z-40`,children:b(m,{data:{list:e(ye?.data)}})}),b(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:x(y,{children:[L&&!$&&b(s,{type:`no-content`,text:O(`postDetailClient.postOffline`)}),L&&$&&x(y,{children:[U&&b(h,{information:L,isVideo:!0}),x(`article`,{className:`w-full`,children:[b(ie,{infoData:L,rightChild:b(te,{information:L,onUpdate:Q})}),b(ae,{infoData:L,isEllipsis:!1}),!U&&b(`div`,{className:`mt-[12px]`,children:b(h,{information:L,isVideo:!1})})]}),b(ne,{information:L,onUpdate:Q}),x(`div`,{id:`detail-comments`,className:`w-full border-t-[8px] border-bg2 mt-[12px]`,children:[x(`div`,{className:`w-full px-[16px] h-[40px] flex items-center justify-between border-b-[1px] border-line1`,children:[b(`p`,{className:`text-[16px] text-text1 font-bold`,children:O(`postDetailClient.comment`)}),x(`p`,{className:`text-[12px] text-text3`,children:[ve,O(`postDetailClient.reactions`)]})]}),b(g,{listQueryKey:W,contentId:L.id,information:L,isShow:!1,isClickLoad:!0,initialComments:pe,initialTotal:K,initialHasMore:me,addCommentCount:()=>{H(e=>e+1)},onTotalChange:e=>{J(t=>typeof t==`number`?Math.max(t,e):e)}})]}),z.length>0&&b(re,{information:L,initRecommendList:z})]}),!L&&b(s,{type:`no-content`,text:O(`postDetailClient.postDeleted`)})]})})]})}export{w as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{gCommunityGetUserCollections as e}from"../../../../service/generated/client.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/legacy/button.mjs";import{useRequest as i}from"../../../../hooks/query/use-query.mjs";import a from"../../../../assets/icons/publish/publish_collection.mjs";import{CollectionCard as o}from"./collection-card.mjs";import{CollectionPopup as s}from"./collection-popup.mjs";import{useMemo as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{useRouter as p}from"next/navigation";function m({active:m,setActive:h}){let g=f(`components.pages.publish.components`),[_,v]=l([]),[y,b]=l(!1),x=p(),{data:S=[]}=i([`publish`,`collection-list`,`preview`,3],async()=>(await e({page:1,page_size:3})).data?.data?.collections??[]);function C(e){v(t=>t.some(t=>t.collection_id===e.collection_id)?t:[e,...t]),h(e.collection_id??``)}let w=c(()=>{let e=new Set,t=[];for(let n of[..._,...S]){let r=n.collection_id??``;if(!(!r||e.has(r))&&(e.add(r),t.push(n),t.length>=3))break}return t},[_,S]);return d(t,{children:[d(t,{className:`flex justify-between items-center px-[16px] py-[12px]`,children:[u(n,{className:`text-[14px] text-text1`,children:g(`collection.syncToCollection`)}),u(r,{type:`button`,className:`!text-[12px] text-theme5 bg-[rgba(253,76,94,.1)] rounded-[20px] w-[64px] h-[24px] px-[8px] py-[4px]`,onClick:()=>b(!0),children:g(`collection.moreCollections`)})]}),d(t,{className:`flex gap-[8px] px-[16px] pb-[12px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:[w.map(e=>u(o,{item:e,active:e.collection_id===m,onClick:()=>h(e.collection_id===m?``:e.collection_id??``)},e.collection_id)),d(r,{className:`flex w-[226px] h-[70px] shrink-0 items-center gap-[12px] rounded-[8px] px-[12px] py-[10px] bg-bg1`,onClick:()=>x.push(`/collection/create?type=publish`),children:[u(a,{width:52,height:52}),u(t,{className:`flex flex-1 flex-col overflow-hidden gap-[4px]`,children:u(n,{className:`text-[14px] text-text2 text-left`,children:g(`collection.createCollection`)})})]})]}),u(s,{open:y,onOpenChange:b,onSelect:C})]})}export{m as Collection};
2
+ "use client";import{gCommunityGetUserCollections as e}from"../../../../service/generated/client.mjs";import{useRouter as t}from"../../../../utils/use-compatible-router.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/legacy/button.mjs";import{useRequest as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/publish/publish_collection.mjs";import{CollectionCard as s}from"./collection-card.mjs";import{CollectionPopup as c}from"./collection-popup.mjs";import{useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m({active:m,setActive:h}){let g=p(`components.pages.publish.components`),[_,v]=u([]),[y,b]=u(!1),x=t(),{data:S=[]}=a([`publish`,`collection-list`,`preview`,3],async()=>(await e({page:1,page_size:3})).data?.data?.collections??[]);function C(e){v(t=>t.some(t=>t.collection_id===e.collection_id)?t:[e,...t]),h(e.collection_id??``)}let w=l(()=>{let e=new Set,t=[];for(let n of[..._,...S]){let r=n.collection_id??``;if(!(!r||e.has(r))&&(e.add(r),t.push(n),t.length>=3))break}return t},[_,S]);return f(n,{children:[f(n,{className:`flex justify-between items-center px-[16px] py-[12px]`,children:[d(r,{className:`text-[14px] text-text1`,children:g(`collection.syncToCollection`)}),d(i,{type:`button`,className:`!text-[12px] text-theme5 bg-[rgba(253,76,94,.1)] rounded-[20px] w-[64px] h-[24px] px-[8px] py-[4px]`,onClick:()=>b(!0),children:g(`collection.moreCollections`)})]}),f(n,{className:`flex gap-[8px] px-[16px] pb-[12px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:[w.map(e=>d(s,{item:e,active:e.collection_id===m,onClick:()=>h(e.collection_id===m?``:e.collection_id??``)},e.collection_id)),f(i,{className:`flex w-[226px] h-[70px] shrink-0 items-center gap-[12px] rounded-[8px] px-[12px] py-[10px] bg-bg1`,onClick:()=>x.push(`/collection/create?type=publish`),children:[d(o,{width:52,height:52}),d(n,{className:`flex flex-1 flex-col overflow-hidden gap-[4px]`,children:d(r,{className:`text-[14px] text-text2 text-left`,children:g(`collection.createCollection`)})})]})]}),d(c,{open:y,onOpenChange:b,onSelect:C})]})}export{m as Collection};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Button as e}from"../../../ui/button.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../../assets/icons/close.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useTranslations as a}from"next-intl";import{useRouter as o}from"next/navigation";function s({onPublish:s,isEmpty:c}){let l=a(`components.pages.publish.components`),u=o();return i(t,{className:`flex h-[60px] w-full items-center justify-between px-[16px]`,children:[r(e,{type:`button`,className:`p-3 text-text1 bg-transparent`,onClick:()=>u.back(),children:r(n,{className:`h-[16px] w-[16px]`})}),r(e,{className:`h-[32px] rounded-[8px] bg-linear-to-r from-[#FD4C5E] to-[#F05D19] px-[12px] text-[16px] text-white font-normal`,disabled:c,onClick:s,children:l(`header.publish`)})]})}export{s as PublishHeader};
2
+ "use client";import{Button as e}from"../../../ui/button.mjs";import{useRouter as t}from"../../../../utils/use-compatible-router.mjs";import{Box as n}from"../../../ui/box.mjs";import r from"../../../../assets/icons/close.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{useTranslations as o}from"next-intl";function s({onPublish:s,isEmpty:c}){let l=o(`components.pages.publish.components`),u=t();return a(n,{className:`flex h-[60px] w-full items-center justify-between px-[16px]`,children:[i(e,{type:`button`,className:`p-3 text-text1 bg-transparent`,onClick:()=>u.back(),children:i(r,{className:`h-[16px] w-[16px]`})}),i(e,{className:`h-[32px] rounded-[8px] bg-linear-to-r from-[#FD4C5E] to-[#F05D19] px-[12px] text-[16px] text-white font-normal`,disabled:c,onClick:s,children:l(`header.publish`)})]})}export{s as PublishHeader};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../utils/cn.mjs";import{AlertDialog as t,AlertDialogAction as n,AlertDialogCancel as r,AlertDialogContent as ee,AlertDialogDescription as te,AlertDialogFooter as ne,AlertDialogHeader as re,AlertDialogTitle as ie}from"../../ui/alert-dialog.mjs";import{getAtUserElement as i}from"../../../utils/common.mjs";import ae from"../../../utils/event-bus.mjs";import{pCommunityPublishContent as oe}from"../../../service/generated/client.mjs";import{Box as se}from"../../ui/box.mjs";import{useKeyboardOpen as ce}from"../../../hooks/use-keyboard-open.mjs";import{eventKey as a}from"../../../constants/event-key.mjs";import{useMediaPreview as o}from"../../common/media-preview/index.mjs";import s from"../../ui/popup.mjs";import{UploadProgress as c}from"./components/upload-progress.mjs";import{ContactList as l}from"../../biz/business/contact/contact-list.mjs";import{Collection as u}from"./components/collection.mjs";import{MAX_MATERIAL_COUNT as d}from"./constants.mjs";import{filterAtUserNames as le}from"./utils/publish-utils.mjs";import{PublishEditor as ue}from"./components/editor.mjs";import{PublishHeader as de}from"./components/header.mjs";import{MaterialGrid as fe}from"./components/material-grid.mjs";import{Toolbar as pe}from"./components/toolbar.mjs";import{useFileUpload as me}from"./hooks/use-file-upload.mjs";import{useCallback as f,useEffect as he,useMemo as ge,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{toast as _}from"sonner";import{useTranslations as _e}from"next-intl";import{useRouter as v}from"next/navigation";function y({className:y}={}){let b=_e(`components.pages.publish`),ve=v(),x=p(null),[ye,S]=m(!1),[C,w]=m(`0`),{isOpen:T}=ce(),[E,D]=m(null),[O,k]=m([]),[A,j]=m(``),[M,N]=m(``),[P,F]=m(``),[I,L]=m(0),[be,R]=m(``),[z,B]=m(``),[xe,V]=m(0),[H,U]=m(``),[W,G]=m([]),[Se,K]=m(!1),[Ce,q]=m(!1),[we,Te]=m(``),J=p(null);he(()=>()=>{ae.emit(a.WAIT_LOADING_SHOW,{show:!1})},[]);let Y=f(e=>(Te(e),q(!0),new Promise(e=>{J.current=e})),[]),{selectFile:X}=me({onProgressUpdate:(e,t,n,r)=>{D(r>0?{currentFiles:e,totalFiles:t,currentTasks:n,totalTasks:r}:null)}}),Z=f(async()=>{if(A){if(!await Y(b(`pageClient.switchToPostConfirm`)))return;j(``),N(``),F(``),L(0),V(0),R(``),B(``)}if(O.length>=d){_.error(b(`pageClient.maxMaterialCount`));return}let e=await X(`material`,{maxMaterialCount:d-O.length});!e||e.type!==`material`||(e.errors.length>0&&_.error(e.errors.length===1?e.errors[0]:b(`pageClient.uploadFailedCount`,{count:e.errors.length})),e.items.length>0&&k(t=>[...t,...e.items].slice(0,d)))},[Y,O.length,X,B,N,F,k,R,L,V,j,b,A]),Ee=f(async()=>{if(O.length>0){if(!await Y(b(`pageClient.switchToVideoConfirm`)))return;k([])}let e=await X(`video`);!e||e.type!==`video`||(j(e.videoUrl),N(e.coverUrl),F(e.coverUrl),R(e.resolution),B(e.coverImageResolution),L(e.videoDuration),V(e.videoSize))},[Y,O.length,X,B,N,F,k,R,L,V,j,b]);function De(e){S(e)}function Oe(){S(!1)}let Q=ge(()=>(H.trim()===``||H.trim()===`<br>`)&&O.length===0&&!A,[H,O.length,A]),$=o(),ke=f(()=>{$.open(O.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image})))},[O,$]),Ae=f(e=>{k(t=>t.filter((t,n)=>n!==e))},[k]),je=f(()=>{j(``),N(``),F(``),L(0),V(0),R(``),B(``)},[N,F,B,R,L,V,j]),Me=f(async()=>{let e=await X(`cover`);!e||e.type!==`cover`||(N(e.coverUrl),B(e.coverImageResolution))},[X,B,N]),Ne=f(e=>{S(!1),G(t=>[...t,e]),x.current?.restoreSelection();let t=`${i(e)}&nbsp;`;x.current?.insertHtml(t)},[G]),Pe=f(()=>{x.current?.saveSelection(),S(!0)},[]);return g(se,{className:e(`relative min-h-screen max-w-full bg-bg2 overflow-hidden flex flex-col`,y),children:[h(de,{onPublish:async()=>{if(!Se){K(!0);try{if(Q){_.error(b(`pageClient.editContentFirst`));return}let e=H;if(e=e.replace(/<br>/g,``),!e&&O.length===0&&!A){_.error(b(`pageClient.editContentFirst`));return}let t=le(e,W),n={content:e,mentioned_users:t,collection_ids:C===`0`?[]:[C]};O.length>0?(n.medias=O.map(e=>(delete e.index,e)),n.type=1):A?(n.medias=[{media_url:A,is_video:!0,cover_image:M,video_resolution:be,cover_image_resolution:z,video_duration:I,video_size:xe}],n.type=2):n.type=3,await oe(n),_.success(b(`pageClient.publishSuccess`)),k([]),j(``),N(``),F(``),L(0),V(0),R(``),B(``),U(``),G([]),w(`0`),ve.back()}catch(e){console.error(e),_.error(b(`pageClient.publishFailed`))}finally{K(!1)}}},isEmpty:Q}),h(ue,{ref:x,content:H,onContentChange:U,atUsers:W,onAtUsersChange:G}),E&&h(c,{currentFiles:E.currentFiles,totalFiles:E.totalFiles,currentTasks:E.currentTasks,totalTasks:E.totalTasks}),(O.length>0||A)&&h(fe,{materialList:O,videoUrl:A,videoDuration:I,coverUrl:M,originCoverUrl:P,isKeyboardOpen:T,onMaterialDelete:Ae,onVideoDelete:je,onMaterialAdd:Z,onCoverClick:Me,onPreview:ke}),h(pe,{isKeyboardOpen:T,onMaterialClick:()=>void Z(),onVideoClick:()=>void Ee(),onAtUserClick:Pe}),h(u,{active:C,setActive:w}),h(t,{open:Ce,onOpenChange:e=>{q(e),e||(J.current?.(!1),J.current=null)},children:g(ee,{children:[g(re,{children:[h(ie,{children:b(`pageClient.title`)}),h(te,{children:we})]}),g(ne,{children:[h(r,{onClick:()=>{q(!1),J.current?.(!1),J.current=null},children:b(`pageClient.cancel`)}),h(n,{onClick:()=>{q(!1),J.current?.(!0),J.current=null},children:b(`pageClient.resume`)})]})]})}),h(s,{open:ye,onOpenChange:De,showCloseButton:!1,className:`w-full rounded-[8px] bg-bg2`,children:h(l,{onSelect:Ne,onClose:Oe})})]})}export{y as PublishPageClient};
2
+ "use client";import{cn as e}from"../../../utils/cn.mjs";import{AlertDialog as t,AlertDialogAction as n,AlertDialogCancel as r,AlertDialogContent as ee,AlertDialogDescription as te,AlertDialogFooter as ne,AlertDialogHeader as re,AlertDialogTitle as i}from"../../ui/alert-dialog.mjs";import{getAtUserElement as ie}from"../../../utils/common.mjs";import ae from"../../../utils/event-bus.mjs";import{pCommunityPublishContent as oe}from"../../../service/generated/client.mjs";import{useRouter as se}from"../../../utils/use-compatible-router.mjs";import{Box as ce}from"../../ui/box.mjs";import{useKeyboardOpen as a}from"../../../hooks/use-keyboard-open.mjs";import{eventKey as o}from"../../../constants/event-key.mjs";import{useMediaPreview as s}from"../../common/media-preview/index.mjs";import c from"../../ui/popup.mjs";import{UploadProgress as l}from"./components/upload-progress.mjs";import{ContactList as u}from"../../biz/business/contact/contact-list.mjs";import{Collection as le}from"./components/collection.mjs";import{MAX_MATERIAL_COUNT as d}from"./constants.mjs";import{filterAtUserNames as ue}from"./utils/publish-utils.mjs";import{PublishEditor as de}from"./components/editor.mjs";import{PublishHeader as fe}from"./components/header.mjs";import{MaterialGrid as pe}from"./components/material-grid.mjs";import{Toolbar as me}from"./components/toolbar.mjs";import{useFileUpload as he}from"./hooks/use-file-upload.mjs";import{useCallback as f,useEffect as ge,useMemo as _e,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{toast as _}from"sonner";import{useTranslations as v}from"next-intl";function y({className:y}={}){let b=v(`components.pages.publish`),ve=se(),x=p(null),[ye,S]=m(!1),[C,w]=m(`0`),{isOpen:T}=a(),[E,D]=m(null),[O,k]=m([]),[A,j]=m(``),[M,N]=m(``),[P,F]=m(``),[I,L]=m(0),[be,R]=m(``),[z,B]=m(``),[xe,V]=m(0),[H,U]=m(``),[W,G]=m([]),[Se,K]=m(!1),[Ce,q]=m(!1),[we,Te]=m(``),J=p(null);ge(()=>()=>{ae.emit(o.WAIT_LOADING_SHOW,{show:!1})},[]);let Y=f(e=>(Te(e),q(!0),new Promise(e=>{J.current=e})),[]),{selectFile:X}=he({onProgressUpdate:(e,t,n,r)=>{D(r>0?{currentFiles:e,totalFiles:t,currentTasks:n,totalTasks:r}:null)}}),Z=f(async()=>{if(A){if(!await Y(b(`pageClient.switchToPostConfirm`)))return;j(``),N(``),F(``),L(0),V(0),R(``),B(``)}if(O.length>=d){_.error(b(`pageClient.maxMaterialCount`));return}let e=await X(`material`,{maxMaterialCount:d-O.length});!e||e.type!==`material`||(e.errors.length>0&&_.error(e.errors.length===1?e.errors[0]:b(`pageClient.uploadFailedCount`,{count:e.errors.length})),e.items.length>0&&k(t=>[...t,...e.items].slice(0,d)))},[Y,O.length,X,B,N,F,k,R,L,V,j,b,A]),Ee=f(async()=>{if(O.length>0){if(!await Y(b(`pageClient.switchToVideoConfirm`)))return;k([])}let e=await X(`video`);!e||e.type!==`video`||(j(e.videoUrl),N(e.coverUrl),F(e.coverUrl),R(e.resolution),B(e.coverImageResolution),L(e.videoDuration),V(e.videoSize))},[Y,O.length,X,B,N,F,k,R,L,V,j,b]);function De(e){S(e)}function Oe(){S(!1)}let Q=_e(()=>(H.trim()===``||H.trim()===`<br>`)&&O.length===0&&!A,[H,O.length,A]),$=s(),ke=f(()=>{$.open(O.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image})))},[O,$]),Ae=f(e=>{k(t=>t.filter((t,n)=>n!==e))},[k]),je=f(()=>{j(``),N(``),F(``),L(0),V(0),R(``),B(``)},[N,F,B,R,L,V,j]),Me=f(async()=>{let e=await X(`cover`);!e||e.type!==`cover`||(N(e.coverUrl),B(e.coverImageResolution))},[X,B,N]),Ne=f(e=>{S(!1),G(t=>[...t,e]),x.current?.restoreSelection();let t=`${ie(e)}&nbsp;`;x.current?.insertHtml(t)},[G]),Pe=f(()=>{x.current?.saveSelection(),S(!0)},[]);return g(ce,{className:e(`relative min-h-screen max-w-full bg-bg2 overflow-hidden flex flex-col`,y),children:[h(fe,{onPublish:async()=>{if(!Se){K(!0);try{if(Q){_.error(b(`pageClient.editContentFirst`));return}let e=H;if(e=e.replace(/<br>/g,``),!e&&O.length===0&&!A){_.error(b(`pageClient.editContentFirst`));return}let t=ue(e,W),n={content:e,mentioned_users:t,collection_ids:C===`0`?[]:[C]};O.length>0?(n.medias=O.map(e=>(delete e.index,e)),n.type=1):A?(n.medias=[{media_url:A,is_video:!0,cover_image:M,video_resolution:be,cover_image_resolution:z,video_duration:I,video_size:xe}],n.type=2):n.type=3,await oe(n),_.success(b(`pageClient.publishSuccess`)),k([]),j(``),N(``),F(``),L(0),V(0),R(``),B(``),U(``),G([]),w(`0`),ve.back()}catch(e){console.error(e),_.error(b(`pageClient.publishFailed`))}finally{K(!1)}}},isEmpty:Q}),h(de,{ref:x,content:H,onContentChange:U,atUsers:W,onAtUsersChange:G}),E&&h(l,{currentFiles:E.currentFiles,totalFiles:E.totalFiles,currentTasks:E.currentTasks,totalTasks:E.totalTasks}),(O.length>0||A)&&h(pe,{materialList:O,videoUrl:A,videoDuration:I,coverUrl:M,originCoverUrl:P,isKeyboardOpen:T,onMaterialDelete:Ae,onVideoDelete:je,onMaterialAdd:Z,onCoverClick:Me,onPreview:ke}),h(me,{isKeyboardOpen:T,onMaterialClick:()=>void Z(),onVideoClick:()=>void Ee(),onAtUserClick:Pe}),h(le,{active:C,setActive:w}),h(t,{open:Ce,onOpenChange:e=>{q(e),e||(J.current?.(!1),J.current=null)},children:g(ee,{children:[g(re,{children:[h(i,{children:b(`pageClient.title`)}),h(te,{children:we})]}),g(ne,{children:[h(r,{onClick:()=>{q(!1),J.current?.(!1),J.current=null},children:b(`pageClient.cancel`)}),h(n,{onClick:()=>{q(!1),J.current?.(!0),J.current=null},children:b(`pageClient.resume`)})]})]})}),h(c,{open:ye,onOpenChange:De,showCloseButton:!1,className:`w-full rounded-[8px] bg-bg2`,children:h(u,{onSelect:Ne,onClose:Oe})})]})}export{y as PublishPageClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as r}from"../../../service/generated/client.mjs";import{Text as i}from"../../ui/text.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{eventKey as o}from"../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../hooks/use-search-history.mjs";import{SearchHistoryClient as c}from"../../biz/business/search-history/client.mjs";import l from"./hot-recommend.mjs";import u from"./hot-search.mjs";import d from"./search-result/index.mjs";import f from"./top-header.mjs";import{memo as p,useEffect as m,useMemo as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{usePathname as x,useRouter as S,useSearchParams as C}from"next/navigation";const w=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.post`,value:`info`},{labelKey:`tabs.user`,value:`user`}],T=p(({searchType:e,onChange:t,tabList:n})=>v(`nav`,{className:`w-full h-[42px] bg-bg1 flex items-center px-[3px] sticky top-[53px] left-0 z-50`,children:n.map(n=>v(i,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${e===n.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{e!==n.value&&t(n.value)},children:n.label},n.value))}));function E(){let i=b(`components.pages.search.pageClient`),{userInfo:p}=n(),E=p?.user_id||`guest`,D=C(),O=x(),k=S(),A=D.get(`q`)?.toString()||``,{data:j,refetch:M}=a([`hotSearchKey`],()=>r({user_id:E})),N=h(()=>j?.data?.recommend_list??[],[j]),[P,F]=g(A),I=h(()=>w.map(e=>({value:e.value,label:i(e.labelKey)})),[i]),[L,R]=g(A),[z,B]=g(0),[V,H]=g(w[0].value),[,U]=g([]),{history:W,addHistory:G}=s({storageKey:E}),K=h(()=>P.trim()===``?N.length>0||W.length>0||P.trim()===``:!1,[N,P,W]),q=h(()=>P.trim()!==``&&!K,[P,K]);return m(()=>(t.on(o.EXCHANGE_SEARCH_TYPE,H),()=>{t.off(o.EXCHANGE_SEARCH_TYPE,H)}),[H]),y(`div`,{className:`w-full min-h-screen bg-bg1 pb-[12px]`,children:[v(f,{setSearchInputVal:t=>{t!==P&&(U([]),F(t),e({q:t}))},initInputVal:L,initInputVersion:z,addSearchHistory:G}),K&&y(`div`,{className:`w-full pt-[8px]`,children:[W.length>0&&v(c,{title:i(`searchHistory`),rows:2,storageKey:E,onHistoryClick:e=>{R(e),B(e=>e+1);let t=new URLSearchParams(D.toString());t.set(`q`,e),k.push(`${O}?${t.toString()}`)}}),v(u,{initHotSearchKeywordList:N,onRefreshHotKey:async()=>(await M()).data??{code:0,message:``,data:{recommend_list:[]}},onClick:e=>{R(e.title||``),B(e=>e+1),G(e.title)}})]}),v(l,{isShow:P.trim()===``}),q&&y(_,{children:[v(T,{searchType:V,tabList:I,onChange:e=>{H(e),U([])}}),v(d,{inputVal:P,searchType:V},`${V}-${P}`)]})]})}export{E as default};
2
+ "use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as r}from"../../../service/generated/client.mjs";import{useRouter as i}from"../../../utils/use-compatible-router.mjs";import{Text as a}from"../../ui/text.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{eventKey as s}from"../../../constants/event-key.mjs";import{useSearchHistory as c}from"../../../hooks/use-search-history.mjs";import{SearchHistoryClient as l}from"../../biz/business/search-history/client.mjs";import u from"./hot-recommend.mjs";import d from"./hot-search.mjs";import f from"./search-result/index.mjs";import p from"./top-header.mjs";import{memo as m,useEffect as h,useMemo as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{usePathname as x,useSearchParams as S}from"next/navigation";import{useTranslations as C}from"next-intl";const w=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.post`,value:`info`},{labelKey:`tabs.user`,value:`user`}],T=m(({searchType:e,onChange:t,tabList:n})=>y(`nav`,{className:`w-full h-[42px] bg-bg1 flex items-center px-[3px] sticky top-[53px] left-0 z-50`,children:n.map(n=>y(a,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${e===n.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{e!==n.value&&t(n.value)},children:n.label},n.value))}));function E(){let a=C(`components.pages.search.pageClient`),{userInfo:m}=n(),E=m?.user_id||`guest`,D=S(),O=x(),k=i(),A=D.get(`q`)?.toString()||``,{data:j,refetch:M}=o([`hotSearchKey`],()=>r({user_id:E})),N=g(()=>j?.data?.recommend_list??[],[j]),[P,F]=_(A),I=g(()=>w.map(e=>({value:e.value,label:a(e.labelKey)})),[a]),[L,R]=_(A),[z,B]=_(0),[V,H]=_(w[0].value),[,U]=_([]),{history:W,addHistory:G}=c({storageKey:E}),K=g(()=>P.trim()===``?N.length>0||W.length>0||P.trim()===``:!1,[N,P,W]),q=g(()=>P.trim()!==``&&!K,[P,K]);return h(()=>(t.on(s.EXCHANGE_SEARCH_TYPE,H),()=>{t.off(s.EXCHANGE_SEARCH_TYPE,H)}),[H]),b(`div`,{className:`w-full min-h-screen bg-bg1 pb-[12px]`,children:[y(p,{setSearchInputVal:t=>{t!==P&&(U([]),F(t),e({q:t}))},initInputVal:L,initInputVersion:z,addSearchHistory:G}),K&&b(`div`,{className:`w-full pt-[8px]`,children:[W.length>0&&y(l,{title:a(`searchHistory`),rows:2,storageKey:E,onHistoryClick:e=>{R(e),B(e=>e+1);let t=new URLSearchParams(D.toString());t.set(`q`,e),k.push(`${O}?${t.toString()}`)}}),y(d,{initHotSearchKeywordList:N,onRefreshHotKey:async()=>(await M()).data??{code:0,message:``,data:{recommend_list:[]}},onClick:e=>{R(e.title||``),B(e=>e+1),G(e.title)}})]}),y(u,{isShow:P.trim()===``}),q&&b(v,{children:[y(T,{searchType:V,tabList:I,onChange:e=>{H(e),U([])}}),y(f,{inputVal:P,searchType:V},`${V}-${P}`)]})]})}export{E as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Input as e}from"../../ui/input.mjs";import{useKeepAliveEffect as t,useKeepAliveState as n}from"../../common/keep-scroll-position/index.mjs";import{isPCEnv as r}from"../../../utils/tools.mjs";import{HeaderNav as i}from"../../common/header-nav/client.mjs";import a from"../../../assets/icons/search.mjs";import o from"../../../assets/icons/clear.mjs";import s from"./style.module.mjs";import{memo as c,useCallback as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{useSearchParams as p}from"next/navigation";function m(){}const h=c(({setSearchInputVal:c,initInputVal:h,initInputVersion:g,addSearchHistory:_,clearCallback:v=m})=>{let y=f(`components.pages.search`),[b,x]=n(`search-input-val`,``),S=p().get(`q`),C=e=>{let t=e.target.value;x(t)},w=l(e=>{c(e),_(e)},[_,c]);return t(()=>{h&&(x(h),w(h))},[h,g],`search-init-input-effect`),t(()=>{S&&(x(S),w(S))},[S],`search-url-params-effect`),u(i,{className:`h-[55px]`,rightChild:u(`div`,{className:`cursor-pointer w-[52px] flex items-center justify-center`,onClick:()=>{b&&w(b)},children:u(`span`,{className:`text-[16px] text-text1`,children:y(`topHeader.search`)})}),centerChild:d(`header`,{className:`w-[calc(100%-52px-48px)] ml-[-15px] h-[35px] rounded-[20px] flex items-center justify-center relative overflow-hidden border-line1 border-[1px]`,children:[u(`div`,{className:`absolute left-0 top-0 w-full h-full bg-bg2 opacity-50`}),u(a,{className:`w-[16px] h-[16px] text-text3 absolute left-[12px] top-[9px] z-[1]`}),u(e,{placeholder:y(`topHeader.placeholder`),maxLength:20,value:b,className:s.searchInput,onChange:C,onKeyDown:e=>{if(e.key===`Enter`){if(e.preventDefault(),!b)return;w(b)}}}),b&&u(o,{className:`w-[15px] h-[15px] text-text3 z-10 absolute right-[12px]`,onClick:()=>{r()||(x(``),c(``),v())}})]})})});export{h as default};
2
+ "use client";import{Input as e}from"../../ui/input.mjs";import{useKeepAliveEffect as t,useKeepAliveState as n}from"../../common/keep-scroll-position/index.mjs";import{isPCEnv as r}from"../../../utils/tools.mjs";import{HeaderNav as i}from"../../common/header-nav/client.mjs";import a from"../../../assets/icons/search.mjs";import o from"../../../assets/icons/clear.mjs";import s from"./style.module.mjs";import{memo as c,useCallback as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useSearchParams as f}from"next/navigation";import{useTranslations as p}from"next-intl";function m(){}const h=c(({setSearchInputVal:c,initInputVal:h,initInputVersion:g,addSearchHistory:_,clearCallback:v=m})=>{let y=p(`components.pages.search`),[b,x]=n(`search-input-val`,``),S=f().get(`q`),C=e=>{let t=e.target.value;x(t)},w=l(e=>{c(e),_(e)},[_,c]);return t(()=>{h&&(x(h),w(h))},[h,g],`search-init-input-effect`),t(()=>{S&&(x(S),w(S))},[S],`search-url-params-effect`),u(i,{className:`h-[55px]`,rightChild:u(`div`,{className:`cursor-pointer w-[52px] flex items-center justify-center`,onClick:()=>{b&&w(b)},children:u(`span`,{className:`text-[16px] text-text1`,children:y(`topHeader.search`)})}),centerChild:d(`header`,{className:`w-[calc(100%-52px-48px)] ml-[-15px] h-[35px] rounded-[20px] flex items-center justify-center relative overflow-hidden border-line1 border-[1px]`,children:[u(`div`,{className:`absolute left-0 top-0 w-full h-full bg-bg2 opacity-50`}),u(a,{className:`w-[16px] h-[16px] text-text3 absolute left-[12px] top-[9px] z-[1]`}),u(e,{placeholder:y(`topHeader.placeholder`),maxLength:20,value:b,className:s.searchInput,onChange:C,onKeyDown:e=>{if(e.key===`Enter`){if(e.preventDefault(),!b)return;w(b)}}}),b&&u(o,{className:`w-[15px] h-[15px] text-text3 z-10 absolute right-[12px]`,onClick:()=>{r()||(x(``),c(``),v())}})]})})});export{h as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{Box as r}from"../../ui/box.mjs";import{eventKey as i}from"../../../constants/event-key.mjs";import{useSearchHistory as a}from"../../../hooks/use-search-history.mjs";import o from"../search/top-header.mjs";import s from"./search-user.mjs";import c from"./search-video.mjs";import l from"./search-all.mjs";import{SORT_OPTIONS as u,SearchTab as d}from"./search-tab.mjs";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useRouter as v,useSearchParams as y}from"next/navigation";const b=[{label:`综合`,value:`all`},{label:`视频`,value:`video`},{label:`用户`,value:`user`}];function x(){let x=v(),{userInfo:S}=n(),C=S?.user_id||`guest`,w=y().get(`q`)?.toString()||``,[T,E]=m(w),[D,O]=m(0);f(()=>{E(w),O(e=>e+1)},[w]);let[k,A]=m(b[0].value),[j,M]=m(u[0].value),[N,P]=m(0),[,F]=m([]),{addHistory:I}=a({storageKey:C}),L=p(()=>T.trim()!==``,[T]);f(()=>(t.on(i.EXCHANGE_SEARCH_TYPE,A),()=>{t.off(i.EXCHANGE_SEARCH_TYPE,A)}),[A]);function R(){x.back()}return _(r,{className:`w-full min-h-screen bg-bg1 pb-[12px] overscroll-y-none`,children:[g(o,{setSearchInputVal:t=>{t!==T&&(F([]),E(t),e({q:t}))},initInputVal:w,initInputVersion:D,addSearchHistory:I,clearCallback:R}),g(d,{searchType:k,tabList:b,onChange:e=>{A(e),F([])},sort:j,onSortChange:e=>{M(e),P(e=>e+1)}}),L&&_(h,{children:[k===`user`&&g(s,{mode:`user`,inputVal:T,sort:j,refreshVersion:N}),k===`all`&&g(l,{searchInputVal:T,sort:j,refreshVersion:N}),k===`video`&&g(c,{mode:`video`,inputVal:T,sort:j,refreshVersion:N})]}),!L&&g(r,{className:`w-full pt-[12px]`})]})}export{x as default};
2
+ "use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{Box as i}from"../../ui/box.mjs";import{eventKey as a}from"../../../constants/event-key.mjs";import{useSearchHistory as o}from"../../../hooks/use-search-history.mjs";import s from"../search/top-header.mjs";import c from"./search-user.mjs";import l from"./search-video.mjs";import u from"./search-all.mjs";import{SORT_OPTIONS as d,SearchTab as f}from"./search-tab.mjs";import{useEffect as p,useMemo as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{useSearchParams as y}from"next/navigation";const b=[{label:`综合`,value:`all`},{label:`视频`,value:`video`},{label:`用户`,value:`user`}];function x(){let x=r(),{userInfo:S}=n(),C=S?.user_id||`guest`,w=y().get(`q`)?.toString()||``,[T,E]=h(w),[D,O]=h(0);p(()=>{E(w),O(e=>e+1)},[w]);let[k,A]=h(b[0].value),[j,M]=h(d[0].value),[N,P]=h(0),[,F]=h([]),{addHistory:I}=o({storageKey:C}),L=m(()=>T.trim()!==``,[T]);p(()=>(t.on(a.EXCHANGE_SEARCH_TYPE,A),()=>{t.off(a.EXCHANGE_SEARCH_TYPE,A)}),[A]);function R(){x.back()}return v(i,{className:`w-full min-h-screen bg-bg1 pb-[12px] overscroll-y-none`,children:[_(s,{setSearchInputVal:t=>{t!==T&&(F([]),E(t),e({q:t}))},initInputVal:w,initInputVersion:D,addSearchHistory:I,clearCallback:R}),_(f,{searchType:k,tabList:b,onChange:e=>{A(e),F([])},sort:j,onSortChange:e=>{M(e),P(e=>e+1)}}),L&&v(g,{children:[k===`user`&&_(c,{mode:`user`,inputVal:T,sort:j,refreshVersion:N}),k===`all`&&_(u,{searchInputVal:T,sort:j,refreshVersion:N}),k===`video`&&_(l,{mode:`video`,inputVal:T,sort:j,refreshVersion:N})]}),!L&&_(i,{className:`w-full pt-[12px]`})]})}export{x as default};