"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[4062],{11878:(e,t,o)=>{o.d(t,{B:()=>y});var n=o(2787),i=o(40099),l=o(11060),s=o(18047),a=(0,o(52837).r)((function(e){return i.createElement("svg",(0,s._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),i.createElement("path",{d:"M23 35a1 1 0 0 1-1-1v-8h-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h8v-8a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v8h8a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-8v8a1 1 0 0 1-1 1h-2Z"}),i.createElement("path",{d:"M8.44 8.44a22 22 0 1 1 31.12 31.12A22 22 0 0 1 8.44 8.44Zm28.29 2.83a18 18 0 1 0-25.46 25.46 18 18 0 0 0 25.46-25.46Z"}))})),c=o(58542),r=o(50299),d=o(70911),u=o(96754),m=o(58180),v=o(25616),h=o(57431),f=o(16891),g=o(28086),p=o(55988),_=o(23303),b=o(73174),I=o(17446),C=o(90570);const x="three_column",y=(0,i.memo)((function({isOnTabBar:e}){const t=(0,v.s)(),o=(0,l.W6)(),s=(0,r.Z)(),[{isFetching:y},w]=(0,g.I)(d.e,{resetStateBeforeDispatch:!0}),[P,k]=(0,I.B6)(),[Y,T]=(0,p._K)((e=>e.list.length>0)),L=(0,u.x6)((e=>{var t;return BigInt(null!==(t=e.total)&&void 0!==t?t:0)>0})),E=e?"small":"medium",S=e?"secondary":"primary",B=(0,i.useMemo)((()=>{var e,t;return null!==(t=null===(e=(0,h.x)().user)||void 0===e?void 0:e.uniqueId)&&void 0!==t?t:""}),[]),[U,O]=(0,i.useState)(!1),[D,Z]=(0,i.useState)(!1),[N,M]=(0,i.useState)(""),[q,K]=(0,i.useState)(!1),j=(0,i.useCallback)((e=>{const t=(0,C.w)(B,N,e);o.push(t)}),[o,B,N]),z=(0,i.useCallback)((e=>{O(!1),Z(!1),f.f.sendEvent("collection_create_success",{video_selection:"added_videos",play_mode:x}),j(e)}),[j]),[F,$]=(0,b.l)({onSuccess:z,enterMethod:"collection_creation",playModeForTea:x}),A=y||F,V=(0,i.useCallback)((({statusCode:e,collectionIdString:o})=>{if(0===e&&o)if(O(!1),Z(!1),0===P.size){const e=Y?"did_not_select":"no_candidate";f.f.sendEvent("collection_create_success",{video_selection:e,play_mode:x}),s({success:!0,message:t("collectionsProfilePage_collectionsPage_topSection_collectionToast")}),j(o)}else $(o,P);else s({success:!1,message:t("Sorry, something wrong with the server, please try again.")})}),[P,Y,s,t,j,$]),H=(0,i.useCallback)((()=>{return e=this,t=void 0,n=function*(){yield w({collectionName:N.trim(),collectionStatus:q?3:1},V)},new((o=void 0)||(o=Promise))((function(i,l){function s(e){try{c(n.next(e))}catch(e){l(e)}}function a(e){try{c(n.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}));var e,t,o,n}),[N,q,w,V]),R=(0,i.useCallback)((()=>{O(!1),Z(!0),f.f.sendEvent("name_collection",{make_public:q?1:0,enter_method:e?"top_right_button":"middle_button",play_mode:x})}),[e,q]),W=(0,i.useCallback)((()=>{Z(!1),O(!0)}),[]),G=(0,i.useCallback)((()=>{M(""),K(!1),k.clear(),T.resetCandidates(),Z(!1),O(!0),f.f.sendEvent("create_collection",{enter_method:e?"top_right_button":"middle_button",has_collections:L?1:0,play_mode:x})}),[k,T,e,L]),X=(0,i.useCallback)((e=>{f.f.sendEvent("close_create_collection",{stage:e,play_mode:x})}),[]),J=(0,i.useCallback)((e=>{O(e),e||D||X("naming stage")}),[D,X]),Q=(0,i.useCallback)((e=>{Z(e),e||U||X(Y?"select videos stage":"no videos to select")}),[U,X,Y]);return(0,n.FD)("div",{children:[(0,n.Y)(c.I05,{leadingIcon:(0,n.Y)(a,{}),label:t("create_new_collection_btn"),size:E,variant:S,onClick:G,"data-e2e":"collection-action-create","aria-label":t("create_new_collection_btn")}),(0,n.Y)(m.k,{open:U,onOpenChange:J,name:N,onNameChange:M,isPublic:q,onIsPublicChange:K,onNext:R}),(0,n.Y)(_.l,{isFromCreateCollection:!0,open:D,onOpenChange:Q,onPrev:W,onCommit:H,loading:A})]})}))},90570:(e,t,o)=>{o.d(t,{w:()=>l});var n=o(11060),i=o(82715);function l(e,t,o){return(0,n.tW)(i.OZ.collection,{uniqueId:e,title:encodeURIComponent(t),id:o})}},57379:(e,t,o)=>{o.r(t),o.d(t,{default:()=>Q});var n=o(2787),i=o(40099),l=o(11060),s=o(96754),a=o(25616),c=o(29546),r=o(57431),d=o(16891),u=o(57717),m=o(32125),v=o(58542),h=o(62186);const f=h.default.div` width: 100%; display: flex; flex-direction: column; gap: 24px; `,g=h.default.div` display: flex; gap: 8px; `,p=(0,h.default)(v.I05)` &.TUXButton--small { font-size: 14px; line-height: 24px; min-width: 96px; padding-left: 12px; padding-right: 12px; } &.TUXButton--secondary.TUXButton--borderless { color: ${e=>e.theme.colors.TextTertiary2}; &:hover { color: ${e=>e.theme.colors.TextPrimary}; background-color: ${e=>e.theme.colors.UIShapeNeutral4}; } &:active { color: ${e=>e.theme.colors.TextPrimary}; background-color: ${e=>e.theme.colors.UIShapeNeutral3}; } } `,_=(0,i.memo)((function({tabs:e,defaultTab:t,activeTab:o,onChange:l}){var s;const[a,c]=function({defaultTab:e="",controlledTab:t,onControlledTabChange:o}){const[n,l]=(0,i.useState)(e),s=null!=t?t:n,a=(0,i.useCallback)((e=>{l(e),null==o||o(e)}),[o]);return[s,a]}({defaultTab:t,controlledTab:o,onControlledTabChange:l});return(0,n.FD)(f,{children:[(0,n.Y)(g,{children:e.map((e=>(0,n.Y)(p,{id:e.id,label:e.title,shape:a===e.id?"default":"borderless",disabled:e.disabled,onFocus:()=>{var t;t=e.id,c(t)},variant:"secondary",size:"small",tabIndex:0},e.id)))}),(0,n.Y)("div",{children:null===(s=e.filter((e=>e.id===a))[0])||void 0===s?void 0:s.content})]})}));var b=o(60193),I=o(14371),C=o(60484),x=o(48615),y=o(92866),w=o(24834),P=o(86415),k=o(8877),Y=o(88920),T=o(67963),L=o(32545),E=o(37543);const S=(0,h.default)("div",{target:"e19kvpiz0"})({width:"100%",height:"100%"},"label:DivCover;"),B=h.default.div` display: flex; align-items: center; justify-content: center; background: ${e=>e.theme.colors.UIShapeNeutral3}; border: 1px solid ${e=>e.theme.colors.BGPrimary}; border-radius: 4px; width: 100%; height: 100%; & > svg { transition: ${e=>e.hoverToZoom?"transform 150ms linear":""}; } &:hover > svg { transform: ${e=>e.hoverToZoom?"scale(1.1)":""}; } `;function U({hoverToZoom:e}){return(0,n.Y)(B,{"data-e2e":"collection-empty-cover",hoverToZoom:e,children:(0,n.Y)(E.x,{color:"UIText3",size:66})})}const O=(0,i.memo)((function({cover:e,name:t,hoverToZoom:o}){var l;const s=Boolean(null===(l=null==e?void 0:e.urlList)||void 0===l?void 0:l.length),a=(0,i.useMemo)((()=>{var t;return{cover:null===(t=null==e?void 0:e.urlList)||void 0===t?void 0:t[0]}}),[e]),c=(0,i.useMemo)((()=>o?{transition:"transform 150ms linear",":hover":{transform:"scale(1.1)"}}:{}),[o]);return(0,n.Y)(S,{children:s?(0,n.Y)(L.x,{style:c,video:a,alt:t}):(0,n.Y)(U,{})})}));var D=o(90570),Z=o(80635),N=o(63185),M=o(92060);const q=(0,h.default)(M.xk)` display: flex; align-items: center; justify-content: space-between; height: unset; color: ${e=>e.theme.colors.ConstTextInverse}; pointer-events: none; & > svg { flex-shrink: 0; } `,K=h.default.div` display: flex; flex-direction: column; gap: 2px; overflow: hidden; & > span:first-of-type { font-size: 16px; line-height: 16px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } & > span:last-of-type { font-size: 12px; line-height: 12px; } `,j=(0,i.memo)((function({name:e,total:t,status:o}){const i=(0,a.s)(),l=1===o,s=BigInt(null!=t?t:0)===BigInt(1)?i("collectionsProfilePage_favoritesPage_collectionSection_videoLabelSingular"):i("collectionsProfilePage_favoritesPage_collectionSection_videoLabelPlural",{d_numOfVideos:null!=t?t:0});return(0,n.FD)(q,{"data-e2e":"collection-card-footer",children:[(0,n.FD)(K,{children:[(0,n.Y)("span",{children:e}),(0,n.Y)("span",{children:s})]}),l&&(0,n.Y)(M.Gj,{className:"private",width:20,height:20,fill:"#fff"})]})})),z=212.2/282,F=(0,i.memo)((function(e){const{uniqueId:t}=(0,l.g)(),{collectionId:o="",name:s="",total:a="0",status:c=1,cover:r}=e,{isInProductHoldout:u}=(0,Y.Vv)(),m=!u,v=(0,i.useRef)(null),h=(0,i.useCallback)((e=>{var t;13!==e.keyCode&&32!==e.keyCode||null===(t=v.current)||void 0===t||t.click()}),[]),f=(0,i.useCallback)((()=>{d.f.sendEvent("enter_collection",{is_public:3===c?1:0,has_videos:BigInt(a)>0?1:0})}),[c,a]),g=(0,D.w)(t,s,o);return(0,n.Y)(N.iP,{maxWidth:m?"320px":void 0,"data-e2e":"collection-list-item",children:(0,n.Y)(Z.w,{e2eTag:"collection-item",ratio:z,borderRadius:"4px",onKeyDown:h,children:(0,n.FD)(T.N_,{to:g,onClick:f,tabIndex:-1,ref:v,children:[(0,n.Y)(N.Od,{width:100*z,height:100}),(0,n.FD)(N.w3,{children:[(0,n.Y)(O,{cover:r,name:s}),(0,n.Y)(j,Object.assign({},e))]})]})})})}));var $=o(3797),A=o(11878),V=o(21765);const H=(0,n.Y)($.C,{size:72}),R=(0,i.memo)((function({listInfo:{statusCode:e}}){const t=(0,s.sK)(),{secUid:o,uniqueId:l}=(0,k.R0)((e=>({uniqueId:e.uniqueId,secUid:e.secUid})),m.bN),a=(0,i.useCallback)((()=>{l&&o&&(t.resetCollectionInfoList(),t.getCollectionInfoList({uniqueId:l,secUid:o}))}),[t,o,l]);return(0,n.Y)(V.QW,{statusCode:e,iconElement:H,onRefresh:a})})),W=(0,i.memo)((function(){const e=(0,a.s)(),t=(0,u.iK)((e=>e.list.length>0)),o=(0,i.useMemo)((()=>({title:e("collectionsProfilePage_favoritesPage_emptyState_collectionHeader"),desc:e(t?"collectionsProfilePage_favoritesPage_emptyState_collectionDesc2":"collectionsProfilePage_favoritesPage_emptyState_collectionDesc")})),[e,t]);return(0,n.Y)(V.LL,Object.assign({iconElement:H,emptyTip:o},t?{emptyActionButton:(0,n.Y)(A.B,{})}:void 0))})),G=(0,i.memo)((function({detailInfo:e,listInfo:t,listKey:o}){const{loading:l,hasMore:a}=t,{collectionList:c=[],statusCode:r}=e,d=(0,s.sK)(),{isGoogleBot:u}=(0,C.L$)((0,x.U)((()=>["isGoogleBot"]),[])),{secUid:v,uniqueId:h}=(0,k.R0)((e=>({uniqueId:e.uniqueId,secUid:e.secUid})),m.bN),f=(0,i.useCallback)((()=>{h&&v&&!l&&a&&0!==c.length&&0===r&&d.getCollectionInfoList({uniqueId:h,secUid:v})}),[a,d,l,c.length,r,h,v]);return(0,n.Y)(P.Z,{pageType:1,itemList:[],itemListKey:o,loading:l,onHitBottom:f,ssrLimit:16,ssrLimitDisable:u,children:null==c?void 0:c.map((e=>(0,n.Y)(F,Object.assign({},e),e.collectionId)))})}));function X(){return(0,n.Y)(y.C,{cardWidth:"212.2px",cardHeight:"282px",radius:"4px",gap:"16px",isUser:!0})}const J=(0,i.memo)((function({detailInfo:e}){const t=(0,i.useMemo)((()=>{var t,o,n;return Object.assign(Object.assign({},e),{list:null!==(o=null===(t=e.collectionList)||void 0===t?void 0:t.map((e=>{var t;return null!==(t=e.collectionId)&&void 0!==t?t:""})))&&void 0!==o?o:[],browserList:[],hasMore:null!==(n=e.hasMore)&&void 0!==n&&n})}),[e]);return(0,n.Y)(w.s6,{Error:R,Empty:W,List:G,Skeleton:X,detailInfo:e,listInfo:t,listKey:"collection"})})),Q=(0,i.memo)((function({detailInfo:e}){var t;const o=(0,a.s)(),{state:{isJumpToCollection:v=!1}={},state:h,pathname:f,search:g}=(0,l.zy)(),p=(0,l.W6)(),{user:C}=(0,r.x)(),x=void 0!==C&&(null===(t=e.user)||void 0===t?void 0:t.secUid)===C.secUid,[y,w]=(0,i.useState)(x?"posts":"collections"),{total:P,loading:k}=(0,u.iK)((e=>{var t;return{total:null!==(t=e.total)&&void 0!==t?t:0,loading:e.loading}}),m.bN),[Y,T]=(0,s.HQ)((e=>e),m.bN),{statusCode:L,hasMore:E,collectionList:S=[]}=Y,B=(0,i.useMemo)((()=>{var t;return[{id:"posts",title:o("collectionsProfilePage_favoritesPage_section_postLabel",{d_numOfVideos:P}),content:(0,n.Y)(I.z,{detailInfo:e,listKey:"favorites"})},{id:"collections",title:o("collectionsProfilePage_favoritesPage_section_collectionLabel",{d_numOfVideos:null!==(t=Y.total)&&void 0!==t?t:0}),content:(0,n.Y)(J,{detailInfo:Y})}]}),[o,e,P,Y]);(0,i.useEffect)((()=>{var t;E&&0===S.length&&0===L&&(null===(t=e.user)||void 0===t?void 0:t.secUid)&&T.getCollectionInfoList({uniqueId:e.user.uniqueId,secUid:e.user.secUid})}),[E,S.length,e.user,L,T]),(0,i.useEffect)((()=>{if(v){w("collections");const e=Object.assign(Object.assign({},window.history.state),{state:Object.assign(Object.assign({},window.history.state.state),{isJumpToCollection:!1})});window.history.replaceState(e,document.title)}}),[v,h,p,f,g]),(0,i.useEffect)((()=>{"posts"!==y||k||d.f.sendEvent("enter_posts_tab",{enter_method:"click_posts_tab",has_posts:BigInt(P)>BigInt(0)?1:0})}),[y,k]),(0,i.useEffect)((()=>{var e;"collections"!==y||Y.loading||d.f.sendEvent("enter_collections_tab",{enter_method:"click_collections_tab",has_collections:BigInt(null!==(e=Y.total)&&void 0!==e?e:0)>BigInt(0)?1:0})}),[y,Y.loading]);const U=(0,b.V)({user:e.user,listKey:"favorites"});if(U){const{title:e,desc:t,icon:o,isLikePrivate:i}=U;let l="",s="";return i&&(l="like-title",s="like-desc"),(0,n.Y)(c.W,{isFullScreen:!0,title:e,desc:t,iconElem:o,e2eTitle:l,e2eDesc:s,ignoreErrorReport:!0})}return x?(0,n.Y)(_,{activeTab:y,onChange:w,tabs:B}):(0,n.Y)(J,{detailInfo:Y})}))},37543:(e,t,o)=>{o.d(t,{x:()=>s});var n=o(18047),i=o(52837),l=o(40099),s=(0,i.r)((function(e){return l.createElement("svg",(0,n._)({fill:"currentColor"},e,{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),l.createElement("path",{d:"M21 7.5h34.5v.02c.65.01 1.2.03 1.68.07 1.07.09 1.55.24 1.86.4a4.5 4.5 0 0 1 1.97 1.97c.16.3.31.8.4 1.86.09 1.1.09 2.53.09 4.68v38.75l-.97-.77-5.03-4.02v3.84l3.15 2.52c1.87 1.5 2.81 2.25 3.6 2.25.68 0 1.33-.31 1.76-.85.49-.61.49-1.81.49-4.21V16.5c0-4.2 0-6.3-.82-7.9a7.5 7.5 0 0 0-3.28-3.28c-1.6-.82-3.7-.82-7.9-.82h-21c-4.2 0-6.3 0-7.9.82A7.5 7.5 0 0 0 21 7.5Zm40.4 49.32.01-.01v.01Zm1.38-.66Z"}),l.createElement("path",{d:"M7.5 24c0-4.2 0-6.3.82-7.9a7.5 7.5 0 0 1 3.28-3.28c1.6-.82 3.7-.82 7.9-.82h21c4.2 0 6.3 0 7.9.82a7.5 7.5 0 0 1 3.28 3.28c.82 1.6.82 3.7.82 7.9v37.51c0 2.4 0 3.6-.5 4.21-.42.54-1.07.85-1.75.85-.79 0-1.73-.75-3.6-2.25L31.5 52.2c-.54-.43-.8-.64-1.1-.72a1.5 1.5 0 0 0-.8 0c-.3.08-.56.3-1.1.72L13.35 64.32c-1.87 1.5-2.81 2.25-3.6 2.25-.68 0-1.33-.31-1.76-.85-.49-.61-.49-1.81-.49-4.21V24Zm12-9c-2.15 0-3.58 0-4.68.1a4.93 4.93 0 0 0-1.86.4 4.5 4.5 0 0 0-1.97 1.96c-.16.3-.31.8-.4 1.86-.09 1.1-.09 2.53-.09 4.68v38.75l.97-.77 15.2-12.16c.23-.18.5-.4.77-.59a4.5 4.5 0 0 1 3.76-.65c.6.17 1.04.44 1.36.65.26.19.54.4.77.59l15.2 12.16.97.77V24c0-2.15 0-3.58-.1-4.68a4.93 4.93 0 0 0-.39-1.86 4.5 4.5 0 0 0-1.97-1.97c-.3-.16-.8-.31-1.86-.4-1.1-.09-2.53-.09-4.68-.09h-21Zm29.91 49.3Zm1.36-.64Zm-41.54 0Z"}))}))},70911:(e,t,o)=>{o.d(t,{e:()=>n});const n=(0,o(51264).l)("/api/collection/create/",{collectionId:0,collectionIdString:"",statusCode:0})}}]);