"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[2287],{13759:(e,t,i)=>{i.d(t,{Nj:()=>s});var n=i(31209),r=i(93608),o=i(15662);const{useAtomService:s,useServiceState:a,useServiceDispatchers:l}=(0,n.i)(o.f,((e,t)=>({toggleUserSelection(i){const{activeMenu:n,teaParams:s}=e(o.b);t(o.f,(e=>{const t=e.selectedUsers,o=new Set(t);t.has(i)?o.delete(i):o.add(i);let a=e.hasReportedUserSelection;return!a&&s&&(r.f.sendEvent("select_users_to_share",Object.assign(Object.assign({},s),{enter_method:"message"===n?"search_dm":"quick:dm"})),a=!0),Object.assign(Object.assign({},e),{hasReportedUserSelection:!0,selectedUsers:o})}))},clearUserSelection(){t(o.f,(e=>Object.assign(Object.assign({},e),{selectedUsers:new Set})))}})))},50299:(e,t,i)=>{i.d(t,{Z:()=>g});var n=i(24643),r=i(40099),o=i(67518),s=i(78448),a=i(59131),l=i(58542),d=i(25616),c=i(23237),u=i(26290);const h=i(62186).default.div` &.dark > .TUXBottomToast, &.dark > .TUXTopToast, & > .TUXBottomToast[data-tux-color-scheme='dark'], & > .TUXTopToast[data-tux-color-scheme='dark'] { background-color: rgba(56, 56, 56, 0.95) !important; } `;function g(e="top",t){var i,g;const p=(0,d.s)(),{showToast:m,dismissToast:f,toastList:x}=(0,c.n)(e),{isDark:v}=(0,o.u)(),b=(0,r.useRef)(-1),w=null!==(i=null==t?void 0:t.theme)&&void 0!==i?i:"default",_=null!==(g=null==t?void 0:t.durationMs)&&void 0!==g?g:3e3,S=(0,r.useCallback)((({success:t,message:i,trailing:o})=>{const d=t||i?i:p("Sorry, something wrong with the server, please try again."),c=(0,r.isValidElement)(d)?d:(0,n.jsx)(u.F.P1,{weight:"medium",children:d}),g=t?(0,n.jsx)(s.R,{color:"UIText1"}):(0,n.jsx)(a.O,{color:"UIText1"}),f="dark"===w||"top"===e?{"data-tux-color-scheme":"dark"}:void 0;return x.forEach((e=>e.dismiss())),b.current=m((0,n.jsx)(h,{className:"dark"===w||v?"dark":"",children:o?(0,n.jsx)(l.qaZ,Object.assign({leading:g,content:c,trailing:o},f)):(0,n.jsx)(l.Mzi,Object.assign({leading:g,content:c},f))}),{durationMs:_,hasToastComponent:!1}),b.current}),[_,v,e,m,p,x]),y=(0,r.useCallback)((()=>{b.current>-1&&(f(b.current),b.current=-1)}),[f]),C=S;return C.showToast=S,C.dismissToast=y,C}},62732:(e,t,i)=>{i.d(t,{C:()=>w,v:()=>b});var n=i(58632),r=i(41271),o=i(40099),s=i(67518),a=i(50299),l=i(56546),d=i(25754),c=i(11983),u=i(25616),h=i(88920),g=i(53764),p=i(53438),m=i(50970),f=i(52333),x=i(53737),v=i(32125);function b({selectedUserList:e,messageText:t,videoId:i}){const[{conversationMap:s},a]=(0,x.D1)((e=>({conversationMap:e.conversationMap}))),c=(0,r.P)(m.L,{dependencies:[],selector:e=>{var t;return null===(t=e.appContext)||void 0===t?void 0:t.user}}),u=(0,r.P)(f.k,{selector:e=>e[i],dependencies:[i]});return(0,o.useCallback)((()=>{var r,o;const{authorId:h="",nickname:g,authorSecId:m,avatarThumb:f,video:x,subVideoMeta:v}=null!=u?u:{},b=[];let w=!1;const _=l.A.getInstance(),S=(0,p.MA)(u);e.forEach((e=>{(null==e?void 0:e.id)===(null==c?void 0:c.uid)&&(w=!0),b.push(null==e?void 0:e.id)})),_.handleShare(Object.assign({platform:"chat_head",group_id:null==x?void 0:x.id,author_id:h,poi_id:null===(r=null==u?void 0:u.poi)||void 0===r?void 0:r.id,is_self:w?"1":"0",is_with_text:t.trim()?"1":"0",chat_cnt:e.length,is_sub_only_video:v?1:0},S)),d.w.handleShareVideoToChat({platform:"chat_head",is_self:w?1:0,group_id:null!==(o=null==x?void 0:x.id)&&void 0!==o?o:"",author_id:h,is_with_text:t.trim()?1:0,chat_cnt:e.length,to_user_id:String(b)}),a.setSendMessageStatus({isLoading:!0,isFailed:!1}),e.forEach((e=>(0,n.__awaiter)(this,void 0,void 0,(function*(){var n;const{id:r,relation:o}=e,l=Boolean(null==s?void 0:s[r]),d=null===(n=null==s?void 0:s[r])||void 0===n?void 0:n.id;yield a.sendMessage({convId:d,uid:r,relation:o,type:8,content:{aweType:800,itemId:i,uid:h,secUID:m,content_thumb:{url_list:[f],uri:f},content_name:g,cover_url:{url_list:[null==x?void 0:x.cover],uri:null==x?void 0:x.cover},cover_width:null==x?void 0:x.width,cover_height:null==x?void 0:x.height},hasConversation:l}),t.trim()&&(yield a.sendMessage({convId:d,uid:r,relation:o,type:7,content:{aweType:0,text:t},hasConversation:l}))}))))}),[u,e,t,a,null==c?void 0:c.uid,s,i])}function w({selectedUserList:e,messageText:t,handleSuccess:i,isRTL:n}){const r=(0,u.s)(),l=function(){const{isInAppStyleShareExperiment:e}=(0,h.Pk)(),t=(0,a.Z)(),{direction:i}=(0,s.u)();return(0,o.useCallback)((n=>{e?t(n):c.F.open({content:n.message,type:n.success?"success":void 0,duration:3,widthType:"half",getContainer:g.M,getContainerPosition:"fixed",isRTL:"rtl"===i})}),[e,t,i])}(),[{isSendMessageFailed:d,successSentMessageCount:p},m]=(0,x.D1)((e=>({isSendMessageFailed:e.isSendMessageFailed,successSentMessageCount:e.successSentMessageCount})),v.bN),f=e.length;(0,o.useEffect)((()=>{var n,o,s,a;if(d&&(l({success:!1,message:r("support_webapp_sharing_error_message")}),m.setSendMessageStatus({isLoading:!1,isFailed:!1,successCount:0})),0!==p&&p===f*(t.trim()?2:1)){const t=null!==(o=null===(n=e[f-1])||void 0===n?void 0:n.nickname)&&void 0!==o?o:"",d=null!==(a=null===(s=e[f-2])||void 0===s?void 0:s.nickname)&&void 0!==a?a:"";switch(f){case 1:l({success:!0,message:r("support_webapp_sharing_sent_toast_1",{username:t})});break;case 2:l({success:!0,message:r("support_webapp_sharing_sent_toast_2",{username:t,username2:d})});break;default:l({success:!0,message:r("support_webapp_sharing_sent_toast_3",{username:t,number:f-1})})}m.setSendMessageStatus({isLoading:!1,successCount:0}),i()}}),[d,p,e,t,f,r,m,i,n,l])}},60026:(e,t,i)=>{i.d(t,{I:()=>h,d:()=>u});var n=i(58632),r=i(40099),o=i(53737),s=i(84908),a=i(49057),l=i(32125);const d=90,c=30;function u(){const[{hasMoreFollowing:e,isFollowingLoading:t,isRecentChatsLoading:i},s]=(0,o.D1)((e=>({hasMoreFollowing:e.followingUser.hasMore,isFollowingLoading:e.isFollowingLoading,isRecentChatsLoading:e.isListLoading})),l.bN),a=(0,r.useCallback)(((i=c)=>(0,n.__awaiter)(this,void 0,void 0,(function*(){e&&!t&&(yield s.getFollowingUserListWithCanShare({count:i}))}))),[e,t,s]);return{hasMoreFollowing:e,isFollowingLoading:t,isRecentChatsLoading:i,loadMoreFollowing:a}}function h(){var e;const{user:t}=null!==(e=(0,a.W)((()=>["user"]),[]))&&void 0!==e?e:{},i=(0,s.nW)((e=>new Set(Object.keys(e.users))),l.bN),{recentUsers:c,followingUsers:h}=(0,o.VB)((e=>{const n=e.recentUidList.map(((t,i)=>({uid:t,uniqueId:e.recentUserList[i],nickname:e.recentUserNameList[i]}))).filter((e=>i.has(e.uniqueId)));return t&&!n.some((e=>e.uid===t.uid))&&n.unshift({uid:t.uid,uniqueId:t.uniqueId,nickname:t.nickName}),{recentUsers:n,followingUsers:e.followingUser.uidList.map(((t,i)=>({uid:t,uniqueId:e.followingUser.list[i],nickname:e.followingUser.nicknameList[i]})))}}),l.bN),g=(0,s.eI)(),{hasMoreFollowing:p,loadMoreFollowing:m}=u(),f=(0,r.useCallback)(((e=d)=>{if(!t||h.length||!p)return;const{uid:i,avatarUri:r,nickName:o}=t,s=(0,n.__rest)(t,["uid","avatarUri","nickName"]),a=Object.assign({id:i,nickname:o,verified:!1,relation:0,avatarThumb:r[0],avatarMedium:r[0],avatarLarger:r[0]},s);g.setUser(a,!1),m(e)}),[t,h.length,p,m,g]);return{recentUsers:c,followingUsers:h,initShareUsers:f}}},86325:(e,t,i)=>{i.d(t,{x:()=>p});var n=i(24643),r=i(40099),o=i(67518);var s=i(62512),a=i(84908),l=i(53737),d=i(25616),c=i(88920),u=i(22884),h=i(62732),g=i(55175);const p=(0,r.memo)((function({videoId:e,selectedUsers:t,onShareSuccess:i,isOverlay:p}){const{isInExperiment:m}=(0,c.NV)(),[f,x]=(0,s.wO)((e=>e.hasReportedMessageInput)),v=(0,a.nW)((e=>[...t].map((t=>e.users[t])).filter((e=>void 0!==e)))),b=(0,l.VB)((e=>e.isSendMessageLoading)),w=(0,u.f7)(),{direction:_}=(0,o.u)(),[S,y]=(0,r.useState)(""),C=(0,d.s)(),k=t.size,j=k>0,I="rtl"===_,T=(0,r.useCallback)((e=>{y(e),f||x.reportMessageInput()}),[f,x]),L=(0,h.v)({selectedUserList:v,messageText:S,videoId:e}),U=(0,r.useCallback)((()=>{if(m&&v.length>0){const e=v[v.length-1];w.updateLastSharedInfo({platformId:"message",user:e})}i()}),[m,w,i,v]);return(0,h.C)({selectedUserList:v,messageText:S,handleSuccess:U,isRTL:I}),(0,n.jsxs)(g.r9,{$isOverlay:p,children:[(0,n.jsx)(g.aQ,{label:"",hideLabel:!0,value:S,onChange:T,placeholder:C("support_webapp_sharing_write_a_message"),maxLength:6e3}),(0,n.jsx)(g.sb,{label:`${C("support_webapp_sharing_send_button")}${k>1?` (${k})`:""}`,disabled:!j,onClick:L,loading:b})]})}))},55175:(e,t,i)=>{i.d(t,{MW:()=>c,Q$:()=>d,SS:()=>u,VK:()=>x,VN:()=>l,YP:()=>g,aQ:()=>w,bi:()=>p,gg:()=>f,ph:()=>h,r9:()=>b,rG:()=>m,sb:()=>_,uU:()=>v});var n=i(58542),r=i(72898),o=i(26290),s=i(893),a=i(72153);const l=(0,r.I)("div",{target:"e1pzdpcj0"})({boxSizing:"border-box",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:".375rem",gap:".5rem",cursor:"pointer",":hover":{backgroundColor:n.Tj4.UIShapeNeutral4,borderRadius:".5rem"}},"label:DivUserItemContainer;"),d=(0,r.I)("div",{target:"e1pzdpcj1"})({display:"flex",flex:1,gap:"1rem",alignItems:"center",height:"100%"},(({$isSelected:e})=>({opacity:e?.5:1})),"label:DivUserItem;"),c=(0,r.I)(o.F.Longform,{target:"e1pzdpcj2"})(a.PR,"label:TextNickname;"),u=(0,r.I)(o.F.P3,{target:"e1pzdpcj3"})(a.PR,"label:TextUniqueId;"),h=(0,r.I)(n.h$y,{target:"e1pzdpcj4"})({pointerEvents:"none",".TUXCheckbox-labelContainer":{display:"none"}},"label:StyledCheckbox;"),g=(0,r.I)("div",{target:"e1pzdpcj5"})({position:"relative",width:"100%",display:"flex",flexDirection:"column",flexGrow:1,gap:"1rem",paddingInline:"1.5rem"},"label:DivSendMessagePanelContainer;"),p=(0,r.I)("div",{target:"e1pzdpcj6"})({display:"flex",alignItems:"center",gap:"1rem","& > *:first-of-type":{flexGrow:1}},"label:DivSearchContainer;"),m=(0,r.I)(n.ZPA,{target:"e1pzdpcj7"})({"& > .TUXInputBox":{borderRadius:"100px !important"}},"label:StyledTextInput;"),f=(0,r.I)("div",{target:"e1pzdpcj8"})({display:"flex",flexDirection:"column",gap:".75rem",flexGrow:1,flexBasis:"12.5rem",overflowY:"auto","& > div:last-of-type":{paddingBottom:"1rem"},"-ms-overflow-style":"none",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},(({$isInputShowing:e})=>e&&{paddingBottom:"9rem","& > div:last-of-type":{paddingBottom:"0"}}),"label:DivUserListContainer;"),x=(0,r.I)(o.F.P1,{target:"e1pzdpcj9"})({marginTop:74,textAlign:"center",color:n.Tj4.UITextPlaceholder},"label:PNoResult;"),v=(0,r.I)("div",{target:"e1pzdpcj10"})({display:"flex",alignItems:"center",width:"100%",padding:".5rem",borderRadius:".5rem",backgroundColor:n.Tj4.UIShapeInfo4,insetInlineStart:"1rem",insetInlineEnd:".25rem",gap:".5rem"},"label:DivTipContainer;"),b=(0,r.I)("div",{target:"e1pzdpcj11"})({display:"flex",flexDirection:"column",alignItems:"end",gap:".25rem",padding:".25rem 1rem 1rem",minHeight:"8rem"},(({$isOverlay:e})=>e&&{padding:"1rem",boxShadow:"0px -1px 114px 0px rgba(0, 0, 0, 0.07)",backgroundColor:n.Tj4.UISheetFlat1,borderRadius:"0 0 .75rem .75rem",position:"absolute",bottom:0,insetInline:0,borderTop:`.5px solid ${n.Tj4.UIShapeNeutral3}`,paddingTop:"1rem"}),"label:DivSendContainer;"),w=(0,r.I)(n.U5X,{target:"e1pzdpcj12"})({flexGrow:1,width:"100% !important",".TUXTextAreaBox":{backgroundColor:"transparent"},".TUXTextAreaCore":{fontSize:".875rem",minHeight:"3.75rem"},textarea:{padding:0},".TUXFormField-footer":{display:"none"}},"label:StyledTextArea;"),_=(0,r.I)(n.I05,{target:"e1pzdpcj13"})({minWidth:"unset !important",width:"fit-content",paddingInline:".75rem !important",height:"2rem !important"},(0,s.K)("H4"),"label:StyledSendButton;")},42287:(e,t,i)=>{i.d(t,{k:()=>Me});var n=i(58632),r=i(24643),o=i(67518),s=i(41271),a=i(73580),l=i(40099),d=i(56546),c=i(25754),u=i(96110),h=i(73635),g=i(75778),p=i(60072),m=i(84908),f=i(53737),x=i(32125),v=i(90159),b=i(25616),w=i(88920),_=i(53764),S=i(95481),y=i(85349),C=i(89311),k=i(50970),j=i(62732),I=i(62186),T=i(81825),L=i(29098),U=i(7751),z=i(7713),F=i(72153),M=i(84827),P=i(97397);const D=(0,I.default)("div",{target:"e140z3d00"})({position:"relative",width:400},"label:DivSendMessagePanelContainer;"),O=(0,I.default)("div",{target:"e140z3d01"})((({theme:{direction:e}})=>[{position:"absolute",top:36,cursor:"pointer"},(0,F.mp)({direction:e,end:32})]),"label:DivCloseButtonWrapper;"),E=(0,I.default)("h2",{target:"e140z3d02"})((({theme:e,theme:{direction:t}})=>[(0,F.zy)({theme:e,fontFamily:"TikTokFont",typography:"P0",fontWeight:"bold"}),{padding:"32px 0 0"},(0,F.mp)({direction:t,paddingStart:32,paddingEnd:62})]),"label:H2ModalTitle;"),R=(0,I.default)("div",{target:"e140z3d03"})((({theme:e})=>({display:"flex",alignItems:"center",width:336,height:36,margin:"24px 32px 0",borderRadius:"4px",backgroundColor:e.colors.BGPlaceholderDefault})),"label:DivSearchContainer;"),N=(0,I.default)(T.A,{target:"e140z3d04"})((({theme:{direction:e}})=>[(0,F.mp)({direction:e,marginStart:16,marginEnd:12})]),"label:StyledMagnifyingGlass;"),q=(0,I.default)("input",{target:"e140z3d05"})((({theme:e,theme:{colors:t}})=>[(0,F.zy)({theme:e,fontFamily:"TikTokFont",typography:"P2"}),{width:240,height:22,border:"none",outline:"none",background:"transparent",color:t.TextPrimary,caretColor:t.Primary,"::placeholder":{color:t.TextTertiary}}]),"label:InputUser;"),B=(0,I.default)("div",{target:"e140z3d06"})((({theme:{direction:e}})=>[{width:16,height:16,cursor:"pointer"},(0,F.mp)({direction:e,marginStart:8})]),"label:DivClearButton;"),A=(0,I.default)("div",{target:"e140z3d07"})({minHeight:200,marginTop:24},"label:DivUserListContainer;"),H=(0,I.default)("p",{target:"e140z3d08"})((({theme:e})=>[(0,F.zy)({theme:e,fontFamily:"TikTokFont",typography:"P1",color:"TextQuaternary"}),{marginTop:74,textAlign:"center"}]),"label:PNoResult;"),W=(0,I.default)(M.R,{target:"e140z3d09"})({width:36,height:36,margin:"6px auto 12px"},"label:StyledLoading;"),V=(0,I.default)("p",{target:"e140z3d010"})((({theme:e,theme:{direction:t}})=>[(0,F.zy)({theme:e,fontFamily:"TikTokFont",typography:"P4",color:"TextTertiary"}),{marginBottom:4,fontSize:"13px"},(0,F.mp)({direction:t,marginStart:32})]),"label:PUserTitle;"),$=(0,I.default)("div",{target:"e140z3d011"})((({long:e,isSearching:t})=>({position:"relative",boxSizing:"border-box",overflowY:"auto",width:"100%",minHeight:t?e?578:472:200,maxHeight:e?578:472,paddingBottom:e?210:102,"::-webkit-scrollbar":{display:"none"}})),"label:DivUserListInnerContainer;"),G=(0,I.default)("div",{target:"e140z3d012"})((({theme:e})=>({boxSizing:"border-box",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:"8px 32px",cursor:"pointer",":hover":{backgroundColor:e.colors.BGView}})),"label:DivUserItemContainer;"),K=(0,I.default)("div",{target:"e140z3d013"})({display:"flex",flex:1,alignItems:"center",height:48},"label:DivUserItem;"),X=(0,I.default)("div",{target:"e140z3d014"})((({theme:{direction:e}})=>(0,F.mp)({direction:e,marginStart:12})),"label:DivRightPart;"),Y=(0,I.default)("div",{target:"e140z3d015"})([{display:"flex",alignItems:"center"}],"label:DivNicknameContainer;"),Q=(0,I.default)("span",{target:"e140z3d016"})((({theme:e})=>[(0,F.zy)({theme:e,fontFamily:"TikTokFont",typography:"P1",fontWeight:"bold"}),{maxWidth:220},F.PR]),"label:SpanNickname;"),Z=(0,I.default)(L.A,{target:"e140z3d017"})((({theme:{direction:e}})=>[{flexShrink:0},(0,F.mp)({direction:e,marginStart:4})]),"label:StyledVerifiedBadgeColor;"),J=(0,I.default)("p",{target:"e140z3d018"})((({theme:e})=>[(0,F.zy)({theme:e,fontFamily:"TikTokFont",typography:"P3",color:"TextTertiary"}),{maxWidth:240,marginTop:2},F.PR]),"label:PUniqueId;"),ee=(0,I.default)("div",{target:"e140z3d019"})((({theme:{direction:e}})=>[{flexShrink:0,width:22,height:22},(0,F.mp)({direction:e,marginStart:12})]),"label:DivCheckboxContainer;"),te=(0,I.default)("div",{target:"e140z3d020"})((({theme:{colors:e}})=>({position:"absolute",bottom:0,left:0,right:0,padding:"12px 32px 32px 32px",backgroundColor:e.BGPrimary,borderRadius:"0 0 8px 8px",":before":{position:"absolute",top:0,left:0,right:0,content:'""',transform:"scaleY(.5)",width:"100%",height:1,backgroundColor:e.LineReverse2}})),"label:DivSendContainer;"),ie=(0,I.default)(P.y,{target:"e140z3d021"})({width:336,height:46,marginTop:12},"label:StyledSendButton;"),ne=(0,I.default)("div",{target:"e140z3d022"})({display:"flex",marginTop:12},"label:DivMessageContainer;"),re=(0,I.default)("textarea",{target:"e140z3d023"})((({theme:e,theme:{direction:t,colors:i}})=>[(0,F.zy)({theme:e,fontFamily:"TikTokFont",typography:"P2"}),{display:"block",width:268,height:98,border:"none",resize:"none",outline:"none",wordBreak:"break-word",overflowWrap:"break-word",backgroundColor:i.BGPrimary,color:i.TextPrimary,caretColor:i.Primary,"::placeholder":{color:i.TextTertiary}},(0,F.mp)({direction:t,marginEnd:12})]),"label:Textarea;"),oe=(0,I.default)("img",{target:"e140z3d024"})({width:56,height:74},"label:ImgCover;"),se=(0,I.default)("div",{target:"e140z3d025"})((({theme:e,theme:{direction:t}})=>[{display:"flex",alignItems:"center",width:336,padding:"12px 0 12px",margin:"16px 32px 0",borderRadius:"4px",backgroundColor:e.colors.BGView},(0,F.mp)({direction:t,paddingStart:16,paddingEnd:4})]),"label:DivTipContainer;"),ae=(0,I.default)(U.A,{target:"e140z3d026"})({width:24,height:24,flexShrink:0},"label:StyledPersonArrowLeftRight;"),le=(0,I.default)(z.A,{target:"e140z3d027"})({width:24,height:24,flexShrink:0},"label:StyledTwoPerson;"),de=(0,I.default)("div",{target:"e140z3d028"})((({theme:{colors:e}})=>({width:24,height:24,flexShrink:0,fontSize:"24px",color:e.TextSecondary})),"label:DivSubOnlyTagContainer;"),ce=(0,I.default)("p",{target:"e140z3d029"})((({theme:e,theme:{direction:t}})=>[(0,F.zy)({theme:e,fontFamily:"TikTokFont",typography:"P4",color:"TextSecondary"}),{fontSize:"13px"},(0,F.mp)({direction:t,marginStart:12})]),"label:PTip;");var ue=i(92846),he=i(40070),ge=i(60484);const pe=(0,l.forwardRef)((function({uniqueId:e,isSelected:t=!1,searchValue:i="",selectedCount:n,onUserSelected:o},s){const a=(0,m.nW)((t=>t.users[e]),x.bN),d=(0,l.useRef)(null);(0,l.useImperativeHandle)(s,(()=>({get offsetTop(){var e,t;return null!==(t=null===(e=d.current)||void 0===e?void 0:e.offsetTop)&&void 0!==t?t:0}})),[]);const c=(0,l.useCallback)((()=>{n>=15&&!t||o(a,!t)}),[t,a,n,o]),{avatarThumb:u,nickname:h="",verified:g}=(0,ge.L$)(a),p=h.toLocaleLowerCase().indexOf(i.toLocaleLowerCase()),f=-1===p?0:i.length;if(!e||!a)return null;const v=h.slice(0,p),b=h.slice(p,p+f),w=h.slice(p+f);return(0,r.jsxs)(G,{ref:d,onClick:c,children:[(0,r.jsxs)(K,{children:[(0,r.jsx)(ue.e,{size:48,src:u}),(0,r.jsxs)(X,{children:[(0,r.jsxs)(Y,{children:[(0,r.jsx)(Q,{children:(0,r.jsxs)("span",{children:[v,(0,r.jsx)("span",{style:{color:"#fe2c55"},children:b}),w]})}),g&&(0,r.jsx)(Z,{width:14,height:14,style:{verticalAlign:"middle",marginLeft:4}})]}),(0,r.jsx)(J,{children:e})]})]}),(0,r.jsx)(ee,{children:(0,r.jsx)(he.S,{size:22,isCircle:!1,value:t})})]})}));var me=i(22884),fe=i(42257),xe=i(58542),ve=i(26290),be=i(13759),we=i(62512),_e=i(49057),Se=i(79395),ye=i(60026),Ce=i(86325),ke=i(55175);const je=(0,l.forwardRef)((function({uniqueId:e,isSelected:t=!1,searchValue:i="",selectedCount:n,onUserClick:o},s){const a=(0,m.nW)((t=>t.users[e]),x.bN),d=(0,l.useRef)(null);(0,l.useImperativeHandle)(s,(()=>({get offsetTop(){var e,t;return null!==(t=null===(e=d.current)||void 0===e?void 0:e.offsetTop)&&void 0!==t?t:0}})),[]);const c=(0,l.useCallback)((()=>{n>=15&&!t||o(e)}),[n,e,t,o]),{avatarThumb:u,nickname:h="",verified:g}=(0,ge.L$)(a);return e&&a?(0,r.jsxs)(ke.VN,{ref:d,onClick:c,children:[(0,r.jsxs)(ke.Q$,{$isSelected:t,children:[(0,r.jsx)(xe.pfZ,{src:u,size:48,alt:e}),(0,r.jsxs)(xe.rxD,{direction:"column",style:{overflow:"hidden"},children:[(0,r.jsxs)(xe.rxD,{alignItems:"center",gap:".25rem",style:{overflow:"hidden"},children:[(0,r.jsx)(ke.MW,{weight:"medium",children:Ie(h,i)}),g&&(0,r.jsx)(xe.jgG,{size:".875rem"})]}),(0,r.jsx)(ke.SS,{color:"UIText3",children:Ie(e,i)})]})]}),(0,r.jsx)(ke.ph,{checked:t,label:""})]}):null}));function Ie(e,t,i){const n=e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase()),o=-1===n?0:t.length,s=e.slice(0,n),a=e.slice(n,n+o),l=e.slice(n+o);return(0,r.jsxs)(r.Fragment,{children:[s,(0,r.jsx)("span",{style:null!=i?i:{color:xe.Tj4.UIShapePrimary},children:a}),l]})}const Te=(0,l.memo)((function({author:e,isFriendsOnly:t,isSubOnly:i,showIcon:n}){const o=(0,b.s)();if(!((0,m.nW)((t=>{var i;return null===(i=t.users[e])||void 0===i?void 0:i.privateAccount}))||t||i))return null;let s=xe.sCe,a="support_webapp_sharing_toast_2";t?(s=xe.K64,a="support_webapp_sharing_toast_1"):i&&(s=xe.PB_,a="subVideo_share_note");const l=`@${e}`;return(0,r.jsxs)(ke.uU,{children:[n&&(0,r.jsx)(s,{autoMirror:!0,size:"1rem",color:"UIText1"}),(0,r.jsx)(ve.F.P4,{children:Ie(o(a,{username:l}),l,{fontWeight:500})})]})}));var Le;!function(e){e.RECENT="recent",e.FOLLOWING="following"}(Le||(Le={}));const Ue=(0,l.memo)((function({visible:e,videoId:t,onClose:i,onKeyDown:n,isFromShare:s=!1}){var a;const{zIndex:d}=(0,o.u)(),{user:u}=null!==(a=(0,_e.W)((()=>["user"]),[]))&&void 0!==a?a:{},[h,{toggleUserSelection:g,clearUserSelection:p}]=(0,be.Nj)((e=>e.selectedUsers),x.bN),m=(0,Se.k)(t),{forFriend:w,author:S="",subVideoMeta:C}=null!=m?m:{},k=(0,f._q)(),j=(0,we.Vv)(),[I,T]=(0,l.useState)(""),[L,U]=(0,l.useState)([]),[z,F]=(0,l.useState)([]),M=(0,l.useRef)({recent:!1,following:!1}),P=(0,l.useRef)({recent:{list:[],hasShown:[]},following:{list:[],hasShown:[]}}),D=(0,l.useCallback)(((e,t)=>i=>{P.current[t].list[e]=i}),[]),O=(0,_.M)(),E=(0,b.s)(),{hasMoreFollowing:R,isFollowingLoading:N,isRecentChatsLoading:q,loadMoreFollowing:B}=(0,ye.d)(),{recentUsers:A,followingUsers:H,initShareUsers:W}=(0,ye.I)(),V=h.size,$=A.length,G=H.length,K=V>0,X=""!==I;(0,l.useEffect)((()=>{e&&W()}),[e,W]),(0,l.useEffect)((()=>{e||(T(""),p(),k.setSendMessageStatus({isFailed:!1,isLoading:!1}))}),[e,k,p]),(0,l.useEffect)((()=>{Promise.resolve().then((()=>{const e=P.current.recent,t=P.current.following;if($&&!M.current.recent&&(M.current.recent=!0,A.slice(0,5).forEach(((t,i)=>{var n,r;(null!==(r=null===(n=e.list[i])||void 0===n?void 0:n.offsetTop)&&void 0!==r?r:1/0)<354&&(c.w.handleShareHeadShow({user_type:"recent",rank_index:i,is_self:t.uniqueId===(null==u?void 0:u.uniqueId)?1:0,to_user_id:t.uid}),e.hasShown[i]=!0)}))),G&&!M.current.following){if(1===G&&R)return;M.current.following=!0,H.slice(0,5).forEach(((e,i)=>{var n,r;(null!==(r=null===(n=t.list[i])||void 0===n?void 0:n.offsetTop)&&void 0!==r?r:1/0)<354&&(c.w.handleShareHeadShow({user_type:"following",rank_index:i,is_self:e.uniqueId===(null==u?void 0:u.uniqueId)?1:0,to_user_id:e.uid}),t.hasShown[i]=!0)}))}})).catch((()=>{}))}),[null==u?void 0:u.uniqueId,G,$,A,R,H]),(0,l.useEffect)((()=>{O.addEventListener("keydown",(e=>{null==n||n(e)}))}),[n,O]);const Y=(0,l.useCallback)((e=>{if(T(e),!e)return;const t=[],i=[],n=e.toLocaleLowerCase();A.forEach((e=>{(e.nickname.toLocaleLowerCase().indexOf(n)>-1||e.uniqueId.toLocaleLowerCase().indexOf(n)>-1)&&t.push(e.uniqueId)})),H.forEach((e=>{t.indexOf(e.uniqueId)<0&&(e.nickname.toLocaleLowerCase().indexOf(n)>-1||e.uniqueId.toLocaleLowerCase().indexOf(n)>-1)&&i.push(e.uniqueId)})),U(t),F(i)}),[A,H]),Q=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation()}),[]),Z=(0,v._g)((e=>{if(X)return;const t=e.currentTarget,{scrollHeight:i,scrollTop:n,clientHeight:r}=t;i-n===r&&B();const o=P.current.recent,s=P.current.following;o.list.forEach(((e,t)=>{var i;if(!o.hasShown[t]&&(null!==(i=null==e?void 0:e.offsetTop)&&void 0!==i?i:1/0){var i;if(!s.hasShown[t]&&(null!==(i=null==e?void 0:e.offsetTop)&&void 0!==i?i:1/0)(0,r.jsx)(je,{uniqueId:e,isSelected:h.has(e),searchValue:I,selectedCount:V,onUserClick:g,ref:D(t,i)},e)),[h,I,V,g,D]);return(0,r.jsxs)(xe.nOL,{open:e,onOpenChange:i,outsidePressDismiss:!1,width:"large",style:{zIndex:d.modal,width:"30rem",height:"32.375rem",display:"flex",flexDirection:"column"},children:[(0,r.jsx)(xe.DBO,{title:E("support_webapp_sharing_option_button"),style:{height:"4.25rem"},leading:s?(0,r.jsx)(xe.PH3,{icon:(0,r.jsx)(xe.pdK,{autoMirror:!0}),onClick:j.openShare}):void 0}),(0,r.jsx)(y.t,{isMobile:!1,children:(0,r.jsxs)(ke.YP,{onClick:Q,children:[(0,r.jsx)(Te,{author:S,isFriendsOnly:w,isSubOnly:Boolean(C),showIcon:!0}),(0,r.jsx)(ke.bi,{children:(0,r.jsx)(ke.rG,{value:I,onChange:Y,onFocus:c.w.handleSearchContact,leadingIcon:(0,r.jsx)(xe.Kbf,{}),placeholder:E("support_webapp_sharing_searchbar_ghosttext"),clearable:X,label:"",hideLabel:!0})}),(0,r.jsx)(ke.gg,{onScroll:Z,$isInputShowing:K,children:(()=>{if(X){const e=L.length>0||z.length>0;return(0,r.jsxs)(xe.rxD,{direction:"column",children:[L.map(((e,t)=>J(e,t,"recent"))),z.map(((e,t)=>J(e,t,"following"))),!e&&(0,r.jsx)(ke.VK,{children:E("support_webapp_sharing_search_results")})]})}return(0,r.jsxs)(xe.rxD,{direction:"column",children:[0!==$&&(0,r.jsx)(ve.F.H4,{color:"UIText3",weight:"medium",style:{marginBottom:"1rem"},children:E("support_webapp_sharing_recent")}),A.map(((e,t)=>J(e.uniqueId,t,"recent"))),q&&(0,r.jsx)(xe.rxD,{justifyContent:"center",children:(0,r.jsx)(xe.sgs,{size:"medium"})}),(0!==G||R)&&(0,r.jsx)(ve.F.H4,{color:"UIText3",weight:"medium",style:{marginBlock:"1rem"},children:E("support_webapp_sharing_following")}),H.map(((e,t)=>J(e.uniqueId,t,"following"))),N&&(0,r.jsx)(xe.rxD,{justifyContent:"center",children:(0,r.jsx)(xe.sgs,{size:"medium"})})]})})()}),K&&(0,r.jsx)(Ce.x,{videoId:t,selectedUsers:h,onShareSuccess:i,isOverlay:!0})]})})]})}));var ze;!function(e){e.RECENT="recent",e.FOLLOWING="following"}(ze||(ze={}));const Fe=(0,l.memo)((function({visible:e,videoId:t,onClose:i,onKeyDown:I}){const T=(0,b.s)(),L=(0,s.P)(k.L,{dependencies:[],selector:e=>{var t;return null===(t=e.appContext)||void 0===t?void 0:t.user}}),U=(0,p.F3)((e=>e[t]),x.bN),{video:z,forFriend:F,author:M="",authorId:P="",subVideoMeta:G}=(0,l.useMemo)((()=>null!=U?U:{}),[U]),[K,X]=(0,m.JY)((e=>e.users[M]),x.bN),{privateAccount:Y,nickname:Q}=(0,l.useMemo)((()=>null!=K?K:{}),[K]),[{recentUserList:Z,recentUserNameList:J,recentUidList:ee,followingUser:ue,isFollowingLoading:he,isSendMessageLoading:ge},xe]=(0,f.D1)((e=>({recentUserList:e.recentUserList,recentUserNameList:e.recentUserNameList,recentUidList:e.recentUidList,followingUser:e.followingUser,isFollowingLoading:e.isFollowingLoading,isSendMessageLoading:e.isSendMessageLoading})),x.bN),ve=(0,a.Nj)(d.A),be=(0,l.useRef)({recent:!1,following:!1}),we=(0,l.useRef)({recent:{list:[],hasShown:[]},following:{list:[],hasShown:[]}}),_e=(0,l.useCallback)(((e,t)=>i=>{we.current[t].list[e]=i}),[]),{isRTL:Se}=(0,C.m)(),{colors:ye}=(0,o.u)(),[Ce,ke]=(0,l.useState)(""),[je,Ie]=(0,l.useState)(""),[Te,Le]=(0,l.useState)([]),[Ue,ze]=(0,l.useState)([]),[Fe,Me]=(0,l.useState)([]),Pe=Te.length,De=Z.length,{list:Oe,nicknameList:Ee,uidList:Re,hasMore:Ne}=ue,qe=Oe.length,Be=Pe>0,Ae=""!==Ce,He=Y||F||Boolean(G),We=(0,me.f7)();(0,l.useEffect)((()=>{e||(ke(""),Ie(""),Le([]),xe.setSendMessageStatus({isFailed:!1,isLoading:!1}))}),[e,xe]),(0,l.useEffect)((()=>{if(!qe&&Ne){if(L){const{uid:e,avatarUri:t,nickName:i}=L,r=(0,n.__rest)(L,["uid","avatarUri","nickName"]),o=Object.assign({id:e,nickname:i,verified:!1,relation:0,avatarThumb:t[0],avatarMedium:t[0],avatarLarger:t[0]},r);X.setUser(o),xe.updateFollowingUserList({list:[L.uniqueId],nicknameList:[i],uidList:[e],hasMore:!0,maxCursor:0,minCursor:0})}xe.getFollowingUserListWithCanShare({count:90})}}),[]),(0,l.useEffect)((()=>{Promise.resolve().then((()=>{const e=we.current.recent,t=we.current.following;if(De&&!be.current.recent&&(be.current.recent=!0,Z.slice(0,5).forEach(((t,i)=>{var n,r;(null!==(r=null===(n=e.list[i])||void 0===n?void 0:n.offsetTop)&&void 0!==r?r:1/0)<354&&(c.w.handleShareHeadShow({user_type:"recent",rank_index:i,is_self:t===(null==L?void 0:L.uniqueId)?1:0,to_user_id:ee[i]}),e.hasShown[i]=!0)}))),qe&&!be.current.following){if(1===qe&&Ne)return;be.current.following=!0,Oe.slice(0,5).forEach(((e,i)=>{var n,r;(null!==(r=null===(n=t.list[i])||void 0===n?void 0:n.offsetTop)&&void 0!==r?r:1/0)<354&&(c.w.handleShareHeadShow({user_type:"following",rank_index:i,is_self:e===(null==L?void 0:L.uniqueId)?1:0,to_user_id:Re[i]}),t.hasShown[i]=!0)}))}})).catch((()=>{}))}),[null==L?void 0:L.uniqueId,Oe,qe,Z,De,ee,Re,Ne]),(0,l.useEffect)((()=>{if(!Ce)return;const e=[],t=[],i=Ce.toLocaleLowerCase();J.forEach(((t,n)=>{(t.toLocaleLowerCase().indexOf(i)>-1||Z[n].toLocaleLowerCase().indexOf(i)>-1)&&e.push(Z[n])})),Ee.forEach(((n,r)=>{e.indexOf(Oe[r])<0&&(n.toLocaleLowerCase().indexOf(i)>-1||Oe[r].toLocaleLowerCase().indexOf(i)>-1)&&t.push(Oe[r])})),ze(e),Me(t)}),[Ce,J,Z,Oe,Ee]);const Ve=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation()}),[]),$e=(0,l.useCallback)((()=>{i()}),[i]),Ge=(0,l.useCallback)(((e,t)=>{if(t)e&&Le([...Te,e]);else{let t=-1;Te.some(((i,n)=>i.uniqueId===(null==e?void 0:e.uniqueId)&&(t=n,!0))),t>-1&&(Te.splice(t,1),Le([...Te]))}}),[Te,ve,null==z?void 0:z.id,P,U]),Ke=(0,l.useCallback)((e=>{const{value:t}=e.target;ke(t)}),[]),Xe=(0,l.useCallback)((()=>{c.w.handleSearchContact()}),[]),Ye=(0,l.useCallback)((()=>{ke("")}),[]),Qe=(0,l.useCallback)((e=>{const{value:t}=e.target;Ie(t)}),[]),Ze=(0,j.v)({selectedUserList:Te,messageText:je,videoId:t}),{isInExperiment:Je}=(0,w.NV)();(0,j.C)({selectedUserList:Te,messageText:je,handleSuccess:()=>{if(Je&&Te.length>0){const e=Te[Te.length-1];We.updateLastSharedInfo({platformId:fe.Ag.message,user:e})}i()},isRTL:Se});const et=(0,v._g)((e=>{if(Ae)return;const t=e.target,{scrollHeight:i,scrollTop:n,clientHeight:r}=t;i-n===r&&!he&&Ne&&xe.getFollowingUserListWithCanShare({count:30});const o=we.current.recent,s=we.current.following;o.list.forEach(((e,t)=>{var i;o.hasShown[t]||(null!==(i=null==e?void 0:e.offsetTop)&&void 0!==i?i:1/0){var i;s.hasShown[t]||(null!==(i=null==e?void 0:e.offsetTop)&&void 0!==i?i:1/0){const n=Te.some((t=>t.uniqueId===e));return(0,r.jsx)(pe,{uniqueId:e,isSelected:n,searchValue:Ce,selectedCount:Pe,onUserSelected:Ge,ref:_e(t,i)},t)}),[Ce,Pe,Te,_e,Ge]),it=(0,_.M)();return(0,l.useEffect)((()=>{it.addEventListener("keydown",(e=>{null==I||I(e)}))}),[I,it]),(0,r.jsx)(S.aF,{parentRef:it,visible:e,maskCloseable:!1,children:(0,r.jsx)(D,{onClick:Ve,children:(0,r.jsxs)(y.t,{isMobile:!1,children:[(0,r.jsx)(O,{onClick:$e,children:(0,r.jsx)(h.A,{width:24,height:24})}),(0,r.jsx)(E,{children:T("support_webapp_sharing_option_button")}),(()=>{if(!He)return null;let e=(0,r.jsx)(le,{fill:ye.TextSecondary}),t="support_webapp_sharing_toast_2";return F?(e=(0,r.jsx)(ae,{fill:ye.TextSecondary}),t="support_webapp_sharing_toast_1"):G&&(e=(0,r.jsx)(de,{children:(0,r.jsx)(u.P,{})}),t="subVideo_share_note"),(0,r.jsxs)(se,{children:[e,(0,r.jsx)(ce,{children:T(t,{username:Q})})]})})(),(0,r.jsxs)(R,{children:[(0,r.jsx)(N,{width:24,height:24,fill:Ae?ye.TextPrimary:ye.TextReverse4}),(0,r.jsx)(q,{value:Ce,placeholder:T("support_webapp_sharing_searchbar_ghosttext"),onChange:Ke,onClick:Xe}),Ae&&(0,r.jsx)(B,{onClick:Ye,children:(0,r.jsx)(g.A,{width:16,height:16,fill:ye.TextReverse4})})]}),(0,r.jsx)(A,{children:(0,r.jsx)($,{long:Be,isSearching:Ae,onScroll:et,children:(()=>{if(Ae){const e=Ue.length>0||Fe.length>0;return(0,r.jsxs)(r.Fragment,{children:[Ue.map(((e,t)=>tt(e,t,"recent"))),Fe.map(((e,t)=>tt(e,t,"following"))),!e&&(0,r.jsx)(H,{children:T("support_webapp_sharing_search_results")})]})}return(0,r.jsxs)(r.Fragment,{children:[0!==De&&(0,r.jsx)(V,{children:T("support_webapp_sharing_recent")}),Z.map(((e,t)=>tt(e,t,"recent"))),(0,r.jsx)(V,{style:{marginTop:De?12:0},children:T("support_webapp_sharing_following")}),Oe.map(((e,t)=>tt(e,t,"following"))),he&&(0,r.jsx)(W,{})]})})()})}),(0,r.jsxs)(te,{children:[Be&&(0,r.jsxs)(ne,{children:[(0,r.jsx)(re,{value:je,placeholder:T("support_webapp_sharing_write_a_message"),maxLength:6e3,onChange:Qe}),(0,r.jsx)(oe,{src:null==z?void 0:z.cover})]}),(0,r.jsxs)(ie,{buttonTheme:"primary",disabled:!Be,onClick:Ze,loading:ge,children:[T("support_webapp_sharing_send_button"),Pe>1?`(${Pe})`:""]})]})]})})})})),Me=(0,l.memo)((function(e){const{isInAppStyleShareExperiment:t}=(0,w.Pk)();return t?(0,r.jsx)(Ue,Object.assign({},e)):(0,r.jsx)(Fe,Object.assign({},e))}))},40070:(e,t,i)=>{i.d(t,{S:()=>h});var n=i(24643),r=i(40099),o=i(54502),s=i(62186),a=i(72153);const l=(0,s.default)("label",{target:"e8efyri0"})((({theme:e})=>({display:"flex",fontFamily:e.fontFamilies.TikTokFont,fontWeight:e.fontWeights.normal,fontSize:"14px",color:e.colors.TextPrimary,cursor:"pointer"})),"label:LabelCheckbox;"),d=(0,s.default)("div",{target:"e8efyri1"})({color:"#fff",position:"relative"},"label:DivCheckboxSymbol;"),c=(0,s.default)("input",{target:"e8efyri2"})((({selected:e,theme:t,theme:{direction:i}})=>[Object.assign({appearance:"none",border:`1.5px solid ${t.colors.LineSecondary}`,margin:"0 0 -2.5px 0",cursor:"pointer","&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${t.colors.Negative}`}},e?{border:"none",backgroundColor:t.colors.Primary}:{}),(0,a.mp)({direction:i,marginEnd:4})]),"label:InputCheckbox;"),u=(0,s.default)("div",{target:"e8efyri3"})((({theme:{direction:e}})=>[{pointerEvents:"none",position:"absolute",top:"3px"},(0,a.mp)({direction:e,start:3})]),"label:DivCheckboxIcon;"),h=(0,r.memo)((function({id:e,value:t,label:i,size:s=16,isCircle:a=!0,disabled:h,style:g,e2eTag:p,onChange:m}){const f=s,x=s-6,v=(0,r.useCallback)((e=>{null==m||m(e.target.checked)}),[m]);return(0,n.jsxs)(l,Object.assign({htmlFor:e,style:g,"data-e2e":p},{children:[(0,n.jsxs)(d,Object.assign({className:"checkbox-symbol"+(t?" selected":"")},{children:[(0,n.jsx)(c,{style:{width:f,height:f,borderRadius:a?f/2:0},selected:t,id:e,checked:t,type:"checkbox",disabled:h,onChange:v}),t&&(0,n.jsx)(u,Object.assign({style:{width:x,height:x}},{children:(0,n.jsx)(o.A,{width:x,height:x})}))]})),i]}))}))}}]);