"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[6157],{8877:(e,t,i)=>{i.d(t,{$4:()=>L,M_:()=>j,R0:()=>S,dF:()=>m});var s,n=i(96754),a=i(60484),l=i(88920),o=i(97086),r=i(57431),c=i(92032),d=i(22972),u=i(56111),y=i(47479),p=i(84908),g=i(83266),v=i(91210),h=i(93751),f=i(18499),O=i(14374),b=i(71111),P=i(31209);!function(e){e.Initial="initial",e.CreatePlaylist="create_playlist",e.CreatePlaylistReady="create_playlist_ready"}(s||(s={}));const _=(0,O._)((0,b.atom)({uniqueId:void 0,statusCode:void 0,secUid:void 0,profileState:"initial",selectedTab:"user-post"}),{rehydrationKey:"webapp.userPage"});_.debugLabel="userPageAtom";const{useAtomService:m,useServiceDispatchers:j,useServiceState:S,getStaticApi:L}=(0,P.i)(_,((e,t)=>({setUniqueId(e){t(_,(t=>Object.assign(Object.assign({},t),{uniqueId:e})))},setProfileState(e){t(_,(t=>Object.assign(Object.assign({},t),{profileState:e})))},resetUserPage(){(0,f.unstable_batchedUpdates)((()=>{t(_,(e=>Object.assign(Object.assign({},e),{uniqueId:void 0,secUid:void 0,statusCode:0,profileState:"initial"}))),(0,c.Ds)().resetAllLists(),(0,d.UO)().setUniqueId(void 0),(0,u.cF)().resetUserFollowInfo(),(0,y.MA)().resetData(),(0,n.rS)().resetCollectionInfoList()}))},getUserInfo(i){var s,c,u,O,b,P,m,j,S;return P=this,m=void 0,S=function*(){const P=(0,d.UO)(),m=(0,p.Gp)(),j=(0,g.SA)(),{uniqueId:S,locateItemID:L}=i,{user:C}=(0,r.x)(),{uniqueId:I,secUid:U}=(0,a.L$)(C);let A=e(p.p9).users[null!=S?S:""];const D=e(v.in).browserList,E=e(g.fz).uniqueId,{enableSideNavPreloadAndCache:w}=(0,l.oJ)();try{let r;if(w?0!==D.length&&E===S||(this.resetUserPage(),j.resetCachedUser()):this.resetUserPage(),"number"!=typeof(null===(s=null==A?void 0:A.extraInfo)||void 0===s?void 0:s.statusCode)){const t=yield m.getUserDetail(i);A=e(p.p9).users[null!==(O=null===(u=null===(c=t.userInfo)||void 0===c?void 0:c.user)||void 0===u?void 0:u.uniqueId)&&void 0!==O?O:""],r=t.statusCode}(0,f.unstable_batchedUpdates)((()=>{t(_,(e=>Object.assign(Object.assign({},e),{statusCode:null!=r?r:e.statusCode,uniqueId:null==A?void 0:A.uniqueId,secUid:null==A?void 0:A.secUid}))),P.setUniqueId(null==A?void 0:A.uniqueId)}));const d=[];(null==A?void 0:A.id)&&(0===r||10222===r)&&(0,o.fU)()&&d.push((0,h.s5)().getItemList(Object.assign({secUid:null!==(b=A.secUid)&&void 0!==b?b:"",userId:A.id},L&&{locateItemID:L})));const g=Boolean(C)&&(Boolean(I&&I===(null==A?void 0:A.uniqueId))||Boolean(U&&U===(null==A?void 0:A.secUid))),{id:v="",secUid:x=""}=(0,a.L$)(A);!g&&(null==A?void 0:A.privateAccount)||d.push((0,y.MA)().getVideoPlaylistData({uid:v,secUid:x,isReset:!0})),(0,l.Oi)()&&x&&!g&&d.push((0,n.rS)().getCollectionInfoList({secUid:x,isReset:!0})),yield Promise.allSettled(d)}catch(e){console.error(e),t(_,(e=>Object.assign(Object.assign({},e),{statusCode:-1})))}},new((j=void 0)||(j=Promise))((function(e,t){function i(e){try{n(S.next(e))}catch(e){t(e)}}function s(e){try{n(S.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof j?n:new j((function(e){e(n)}))).then(i,s)}n((S=S.apply(P,m||[])).next())}))},setSelectedTab(e){t(_,(t=>Object.assign(Object.assign({},t),{selectedTab:e})))}})))},47479:(e,t,i)=>{i.d(t,{MA:()=>j,kn:()=>P,aD:()=>m,c8:()=>b});var s=i(39952),n=i(60484),a=i(14374),l=i(31209),o=i(43723),r=i(97446),c=i(4474),d=i(68881),u=i(56070),y=i(39785),p=i(46311),g=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function l(e){try{r(s.next(e))}catch(e){a(e)}}function o(e){try{r(s.throw(e))}catch(e){a(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(l,o)}r((s=s.apply(e,t||[])).next())}))};const v=(0,y.M)({csr:function(e){return g(this,void 0,void 0,(function*(){const{uid:t}=e,i=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(e);n(p.P.emit("consume_prefetch_data",performance.now(),"fail","userPlayList"),u.h.get("/api/user/playlist/",{query:i,baseUrlType:2}))))):u.h.get("/api/user/playlist/",{query:i,baseUrlType:2})}))}});var h=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function l(e){try{r(s.next(e))}catch(e){a(e)}}function o(e){try{r(s.throw(e))}catch(e){a(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(l,o)}r((s=s.apply(e,t||[])).next())}))};const f="0",O={loading:!1,changeOrderLoading:!1,hasMore:!0,statusCode:0,playList:[],cursor:f},b=(0,a._)((0,o.p)("videoPlaylistSharedAtom@tiktok/webapp-atoms",O),{rehydrationKey:"webapp.videoPlaylist"}),{useAtomService:P,useServiceDispatchers:_,useServiceState:m,getStaticApi:j}=(0,l.i)(b,((e,t)=>({resetData(){t(b,O)},setPlaylist(e){const{statusCode:i,playList:s=[],hasMore:a,cursor:l,loading:o,changeOrderLoading:r,isMerge:c=!1}=(0,n.L$)(e);t(b,(e=>{var t;return Object.assign(Object.assign({},e),{statusCode:null!=i?i:e.statusCode,hasMore:null!=a?a:e.hasMore,cursor:null!=l?l:e.cursor,playList:c?[...null!==(t=e.playList)&&void 0!==t?t:[],...s]:s,loading:null!=o?o:e.loading,changeOrderLoading:null!=r?r:e.changeOrderLoading})}))},changePlaylistOrder(i){return h(this,void 0,void 0,(function*(){const{playlist:n=[],endIndex:a=-1,successCallback:l}=i,{playList:o=[]}=e(b),r=n.slice(0,a+1);if(!r.length)return 0;let d;t(b,(e=>Object.assign(Object.assign({},e),{changeOrderLoading:!0})));try{({statusCode:d}=yield function(e){var t;return g(this,void 0,void 0,(function*(){return u.h.post("/api/playlist/modify_order/",{baseUrlType:2,body:c.stringify({commitMixIds:null!==(t=e.commitMixIds)&&void 0!==t?t:""})})}))}({commitMixIds:r.join(",")}))}catch(e){d=-1}try{if(s.c.handleSaveChangePlaylistOrder({status:0===d?"1":"0"}),0!==d)return t(b,(e=>Object.assign(Object.assign({},e),{changeOrderLoading:!1}))),d;const e=[...r,...o.slice(a+1)];return null==l||l(),this.setPlaylist({playList:e,changeOrderLoading:!1}),d}catch(e){return console.error(e),t(b,(e=>Object.assign(Object.assign({},e),{changeOrderLoading:!1}))),-1}}))},getVideoPlaylistData(i){return h(this,void 0,void 0,(function*(){const{uid:s,secUid:n,isReset:a}=i,{cursor:l=f,hasMore:o}=e(b);if(!o)return;const c=a?f:l;let d,u;t(b,(e=>Object.assign(Object.assign({},e),{loading:!0})));try{u=v({uid:s,secUid:n,cursor:c,count:20}),t(b,(e=>Object.assign(Object.assign({},e),{prevPromise:u}))),d=yield u}catch(e){d={statusCode:-1,playList:[],hasMore:o}}try{const{playList:t=[]}=d,i=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(e);ne)),n=s.map((({id:e})=>e));if((0,r._J)().multiSetPlaylistDetail(s),u&&e(b).prevPromise!==u)return;this.setPlaylist(Object.assign(Object.assign({},i),{playList:n,isMerge:!a,loading:!1}))}catch(e){console.error(e),t(b,(e=>Object.assign(Object.assign({},e),{loading:!1})))}}))}})))},97446:(e,t,i)=>{i.d(t,{A4:()=>o,Se:()=>c,_J:()=>d});var s=i(14374),n=i(31209),a=i(43723);const l=(0,s._)((0,a.p)("playlistDetailAtom@tiktok/webapp-atoms",{}),{rehydrationKey:"webapp.videoPlaylistDetails"}),{useAtomService:o,useServiceDispatchers:r,useServiceState:c,getStaticApi:d}=(0,n.i)(l,((e,t)=>({multiSetPlaylistDetail(i){const s=e(l),n={};i.forEach((e=>{var t;const{id:i=""}=e,a=null!==(t=s[i])&&void 0!==t?t:{};n[i]=Object.assign(Object.assign({},a),e)})),t(l,Object.assign(Object.assign({},s),n))},setPlaylistDetail(e){const{id:i=""}=e;t(l,(t=>Object.assign(Object.assign({},t),{[i]:Object.assign(Object.assign({},t[i]),e)})))}})))},96737:(e,t,i)=>{i.d(t,{T:()=>c});var s=i(24643),n=i(40099),a=i(25941),l=i(70461),o=i(85844),r=i(45816);const c=(0,n.memo)((({iconSize:e,children:t,lastSharedIconStyle:i,onClick:c})=>{const{isSharedPulsing:d,lastSharedMethod:u}=(0,a.p)(),[y,p]=(0,n.useState)(!0),[g,v]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{if(d)return()=>{p(!0),v(!1)}}),[d]),d&&u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.A,{in:y,timeout:300,onEnter:()=>p(!1),onExited:()=>v(!0),appear:!0,unmountOnExit:!0,children:(0,s.jsxs)(o.K2,{children:[" ",t]})}),(0,s.jsx)(r.V,{isPulsing:g,iconSize:e,lastSharedIconStyle:i,onClick:c})]}):t}))},39952:(e,t,i)=>{i.d(t,{c:()=>n});var s=i(93608);const n={handleCreatePlaylist:()=>{s.f.sendEvent("create_playlist")},handleClickAddPlaylistVideo:e=>{s.f.sendEvent("click_add_playlist_video",e)},handleAddPlaylistVideo:e=>{s.f.sendEvent("add_playlist_video",e)},handlePostCreatingPlaylist:e=>{s.f.sendEvent("post_creating_playlist",e)},handleClickChangePlaylistOrder:()=>{s.f.sendEvent("click_change_playlist_order")},handleSaveChangePlaylistOrder:e=>{s.f.sendEvent("save_change_playlist_order",e)},handleCompleteEditingPlaylist:e=>{s.f.sendEvent("complete_editing_playlist",e)},handleClickPlaylistEntrance:e=>{s.f.sendEvent("click_playlist_entrance",e)},handleClickRenamePlaylist:e=>{s.f.sendEvent("click_rename_playlist",e)},handleClickDeletePlaylist:e=>{s.f.sendEvent("click_delete_playlist",e)},handleDeletePlaylist:e=>{s.f.sendEvent("delete_playlist",e)},handleClickRemovePlaylistVideo:e=>{s.f.sendEvent("click_remove_playlist_video",e)},handleRemovePlaylistVideo:e=>{s.f.sendEvent("remove_playlist_video",e)}}}}]);