"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[3328],{33328:(e,t,s)=>{s.d(t,{JI:()=>g,IN:()=>R,ZY:()=>C,jG:()=>S});var i,a,o=s(43723),n=s(14374),r=s(31209),c=s(56070),u=s(39785);!function(e){class t{constructor(e){this.Open=!1,this.Env="",e&&(void 0!==e.Open&&(this.Open=e.Open),void 0!==e.Env&&(this.Env=e.Env))}}e.TrafficEnv=t,e.Base=class{constructor(e){this.LogID="",this.Caller="",this.Addr="",this.Client="",e&&(void 0!==e.LogID&&(this.LogID=e.LogID),void 0!==e.Caller&&(this.Caller=e.Caller),void 0!==e.Addr&&(this.Addr=e.Addr),void 0!==e.Client&&(this.Client=e.Client),void 0!==e.TrafficEnv&&(this.TrafficEnv=new t(e.TrafficEnv)),void 0!==e.Extra&&(this.Extra=e.Extra))}},e.BaseResp=class{constructor(e){this.StatusMessage="",this.StatusCode=0,e&&(void 0!==e.StatusMessage&&(this.StatusMessage=e.StatusMessage),void 0!==e.StatusCode&&(this.StatusCode=e.StatusCode),void 0!==e.Extra&&(this.Extra=e.Extra))}}}(i||(i={})),i.TrafficEnv,i.Base,i.BaseResp,function(e){let t,s,a,o,n,r,c;!function(e){e[e.Video=0]="Video",e[e.User=1]="User",e[e.Challenge=3]="Challenge",e[e.Music=4]="Music"}(t=e.ContentEnum||(e.ContentEnum={})),function(e){e[e.UniqId=1]="UniqId",e[e.ItemId=2]="ItemId",e[e.SongName=3]="SongName",e[e.ChallengeName=4]="ChallengeName",e[e.QuestionId=5]="QuestionId",e[e.Keyword=6]="Keyword",e[e.LiveEventId=7]="LiveEventId"}(s=e.ContentType||(e.ContentType={})),function(e){e[e.Created=1]="Created",e[e.Reviewing=2]="Reviewing",e[e.ReviewFailed=3]="ReviewFailed",e[e.Upcoming=4]="Upcoming",e[e.Started=5]="Started",e[e.Deleted=6]="Deleted",e[e.Finished=7]="Finished"}(a=e.LiveEventStatus||(e.LiveEventStatus={})),function(e){e[e.USER=0]="USER",e[e.GOOGLE_BOT=1]="GOOGLE_BOT",e[e.BING_BOT=2]="BING_BOT",e[e.NAVER_BOT=3]="NAVER_BOT",e[e.YAHOOJP_BOT=4]="YAHOOJP_BOT"}(o=e.TrafficType||(e.TrafficType={})),function(e){e[e.Sidebar=0]="Sidebar",e[e.ItemDescription=1]="ItemDescription",e[e.UserPageItem=2]="UserPageItem",e[e.KEPDisplayUrl=3]="KEPDisplayUrl",e[e.Breadcrumb=4]="Breadcrumb",e[e.Footer=5]="Footer",e[e.BottomNavigation=6]="BottomNavigation",e[e.VideoInfoCard=7]="VideoInfoCard",e[e.KAPVideo=8]="KAPVideo",e[e.PRODUCT_LIST=9]="PRODUCT_LIST",e[e.PRODUCT_RELATED_WORD=10]="PRODUCT_RELATED_WORD",e[e.KAP_RELATED_WORD=11]="KAP_RELATED_WORD",e[e.GENERAL_EXPOSURE=12]="GENERAL_EXPOSURE"}(n=e.Module||(e.Module={})),function(e){e[e.Google=1]="Google",e[e.Bing=2]="Bing"}(r=e.SearchEngine||(e.SearchEngine={})),function(e){e[e.Update=1]="Update",e[e.Delete=2]="Delete"}(c=e.IndexAction||(e.IndexAction={})),e.StatusCodeEmptyParams=1001,e.StatusCodeWordNotExist=1002,e.StatusCodeExceedMaxBatchSize=1003,e.StatusCodeInvalidParams=1004,e.StatusCodeInternalError=2001,e.GetChallengeSplitByIdRequest=class{constructor(e){e&&(this.ChallengeIds=e.ChallengeIds,this.VisitorLanguage=e.VisitorLanguage,this.Region=e.Region,this.appId=e.appId,void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}},e.GetChallengeSplitByIdResponse=class{constructor(e){e&&(this.challengeSplitMap=e.challengeSplitMap,void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}},e.GetPredictedLanguageResponse=class{constructor(e){e&&(this.predictedLanguage=e.predictedLanguage,void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}},e.GetPredictedLanguageRequest=class{constructor(e){e&&(this.Content=e.Content,this.ContentType=e.ContentType,void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}};class u{constructor(e){e&&(this.Uri=e.Uri,this.UrlList=e.UrlList)}}e.UrlStruct=u;class d{constructor(e){e&&(this.Id=e.Id,this.UniqueId=e.UniqueId,this.Nickname=e.Nickname,this.AvatarThumb=new u(e.AvatarThumb),this.AvatarMedium=new u(e.AvatarMedium),this.AvatarLarger=new u(e.AvatarLarger),this.CreateTime=e.CreateTime,void 0!==e.SecUid&&(this.SecUid=e.SecUid),this.PrivateAccount=e.PrivateAccount,this.Ftc=e.Ftc)}}e.UserStruct=d;class m{constructor(e){e&&(this.Id=e.Id,this.Text=e.Text,this.CreateTime=e.CreateTime,this.DiggCount=e.DiggCount,void 0!==e.User&&(this.User=new d(e.User)))}}e.CommentStruct=m;class l{constructor(e){e&&(this.ItemId=e.ItemId,this.Comments=Array.isArray(e.Comments)?e.Comments.map((e=>new m(e))):e.Comments)}}e.ItemCommentStruct=l,e.MultiGetItemCommentRequest=class{constructor(e){e&&(this.ItemIds=e.ItemIds,void 0!==e.ClientABVersionNames&&(this.ClientABVersionNames=e.ClientABVersionNames),void 0!==e.Biz&&(this.Biz=e.Biz),void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}},e.MultiGetItemCommentResponse=class{constructor(e){e&&(void 0!==e.ItemComments&&(this.ItemComments=Array.isArray(e.ItemComments)?e.ItemComments.map((e=>new l(e))):e.ItemComments),void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}};class h{constructor(e){e&&(this.ID=e.ID,this.OwnerUserID=e.OwnerUserID,this.StartTime=e.StartTime,this.Duration=e.Duration,this.Title=e.Title,this.Description=e.Description,this.Status=e.Status)}}e.LiveEvent=h,e.GetUpcomingLiveEventByUserRequest=class{constructor(e){e&&(this.UserID=e.UserID,void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}},e.GetUpcomingLiveEventByUserResponse=class{constructor(e){e&&(void 0!==e.Event&&(this.Event=new h(e.Event)),void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}},e.SubmitClientUrlImpressionRequest=class{constructor(e){e&&(this.Timestamp=e.Timestamp,this.VisitPageUrl=e.VisitPageUrl,this.Urls=e.Urls,this.Module=e.Module,this.TrafficType=e.TrafficType,void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}},e.SubmitClientUrlImpressionResponse=class{constructor(e){e&&void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp))}},e.GetSitemapListRequest=class{constructor(e){e&&(this.TrafficType=e.TrafficType,void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}},e.GetSitemapListResponse=class{constructor(e){e&&(void 0!==e.IndexLists&&(this.IndexLists=e.IndexLists),void 0!==e.DeIndexLists&&(this.DeIndexLists=e.DeIndexLists),void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}};class p{constructor(e){e&&(this.Engine=e.Engine,this.Action=e.Action,this.Url=e.Url)}}e.IndexSubmission=p,e.GetIndexSubmissionStatusRequest=class{constructor(e){e&&(void 0!==e.Submission&&(this.Submission=Array.isArray(e.Submission)?e.Submission.map((e=>new p(e))):e.Submission),void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}};class I{constructor(e){e&&(this.Success=e.Success)}}e.SubmissionStatus=I,e.GetIndexSubmissionStatusResponse=class{constructor(e){e&&(this.Status=Array.isArray(e.Status)?e.Status.map((e=>new I(e))):e.Status,void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}};class B{constructor(e){e&&(this.Title=e.Title,this.Desc=e.Desc,this.Keywords=e.Keywords,void 0!==e.Article&&(this.Article=e.Article))}}e.ItemCustomTDKStruct=B,e.GetCustomTDKByItemIDRequest=class{constructor(e){e&&(this.ItemID=e.ItemID,void 0!==e.BizConfigID&&(this.BizConfigID=e.BizConfigID),void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}},e.GetCustomTDKByItemIDResponse=class{constructor(e){e&&(void 0!==e.ItemCustomTDK&&(this.ItemCustomTDK=new B(e.ItemCustomTDK)),void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}},e.GetCustomTDKBatchItemIDsRequest=class{constructor(e){e&&(this.ItemIDList=e.ItemIDList,void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}},e.GetCustomTDKBatchItemIDsResponse=class{constructor(e){e&&(this.ItemMapCustomTDK=e.ItemMapCustomTDK?Object.fromEntries(Object.entries(e.ItemMapCustomTDK).map((([e,t])=>[e,new B(t)]))):e.ItemMapCustomTDK,void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}};class v{constructor(e){e&&(void 0!==e.Title&&(this.Title=e.Title),void 0!==e.Description&&(this.Description=e.Description),void 0!==e.Keywords&&(this.Keywords=e.Keywords),void 0!==e.Article&&(this.Article=e.Article))}}e.CustomTDK=v,e.GetCustomTDKRequest=class{constructor(e){e&&(this.PageID=e.PageID,this.PageType=e.PageType,void 0!==e.Base&&(this.Base=new i.Base(e.Base)))}},e.GetCustomTDKResponse=class{constructor(e){e&&(void 0!==e.CustomTDK&&(this.CustomTDK=new v(e.CustomTDK)),void 0!==e.BaseResp&&(this.BaseResp=new i.BaseResp(e.BaseResp)))}}}(a||(a={})),a.ContentEnum,a.ContentType,a.LiveEventStatus;const d=a.TrafficType;a.Module,a.SearchEngine,a.IndexAction,a.StatusCodeEmptyParams,a.StatusCodeWordNotExist,a.StatusCodeExceedMaxBatchSize,a.StatusCodeInvalidParams,a.StatusCodeInternalError,a.GetChallengeSplitByIdRequest,a.GetChallengeSplitByIdResponse,a.GetPredictedLanguageResponse,a.GetPredictedLanguageRequest,a.UrlStruct,a.UserStruct,a.CommentStruct,a.ItemCommentStruct,a.MultiGetItemCommentRequest,a.MultiGetItemCommentResponse,a.LiveEvent,a.GetUpcomingLiveEventByUserRequest,a.GetUpcomingLiveEventByUserResponse,a.SubmitClientUrlImpressionRequest,a.SubmitClientUrlImpressionResponse,a.GetSitemapListRequest,a.GetSitemapListResponse,a.IndexSubmission,a.GetIndexSubmissionStatusRequest,a.SubmissionStatus,a.GetIndexSubmissionStatusResponse,a.ItemCustomTDKStruct,a.GetCustomTDKByItemIDRequest,a.GetCustomTDKByItemIDResponse,a.GetCustomTDKBatchItemIDsRequest,a.GetCustomTDKBatchItemIDsResponse,a.CustomTDK,a.GetCustomTDKRequest,a.GetCustomTDKResponse,a.AwemeSeoDiscoveryService;var m=s(57432),l=s.n(m),h=(s(22113),s(7971)),p=function(e,t,s,i){return new(s||(s=Promise))((function(a,o){function n(e){try{c(i.next(e))}catch(e){o(e)}}function r(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(n,r)}c((i=i.apply(e,t||[])).next())}))};const I=(0,u.M)({csr:(e,t)=>p(void 0,void 0,void 0,(function*(){let s={statusCode:-1,channelsByItemId:{}};try{const i={trafficType:d.USER,itemIds:e,clientABVersions:t};s=yield c.h.get("/api/seo/keyword/item_tags/",{query:i}),s.keywordsByItemId&&Object.keys(s.keywordsByItemId).forEach((e=>{var t,i;const a=null===(t=s.keywordsByItemId)||void 0===t?void 0:t[e];null===(i=null==a?void 0:a.keywordTags)||void 0===i||i.forEach((e=>{switch(e.seoPageType){case 7:default:e.pageType=0;break;case 11:e.pageType=1;break;case 12:e.pageType=2}}))}))}catch(e){console.log("tag item api fetch error",e)}return s}))}),B=(0,u.M)({csr:l()}),v=(0,n._)((0,o.p)("seoItemTagsAtom@tiktok/webapp-atoms",{}),{rehydrationKey:"seo.linker.item_tag"}),{useAtomService:C,useServiceDispatchers:R,useServiceState:S,getStaticApi:g}=(0,r.i)(v,((e,t)=>({setItemTagList(s,i={},a){var o;return p(this,void 0,void 0,(function*(){const n=e(v),{tagKeywordPathList:r}=n;t(v,{loading:!0,tagKeywordPathList:r});const c=yield I(s,a),{keywordsByItemId:u}=c;if(!u)return;const d={},m=[];for(const[e,t]of Object.entries(u))d[e]=(0,h.Kk)(null!==(o=t.keywordTags)&&void 0!==o?o:[]),d[e].length>0&&m.push(...d[e].map((e=>e.linkPath)));return m.length>0&&i.pathname&&B(m,i.pathname),t(v,{tagKeywordPathList:Object.assign(Object.assign({},d),r),loading:!1})}))}})))}}]);