"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[7314],{26263:(e,t,o)=>{o.d(t,{Y:()=>n});const n=e=>({getLocalStorage:t=>{try{const o=localStorage.getItem(e);return o?JSON.parse(o):t}catch(e){return t}},setLocalStorage:t=>{try{localStorage.setItem(e,JSON.stringify(t))}catch(e){}},removeLocalStorage:()=>{try{localStorage.removeItem(e)}catch(e){}}})},6585:(e,t,o)=>{var n;o.d(t,{H:()=>n}),function(e){e.UploadKey="upload-cta",e.GetCoinsKey="get-coins-cta",e.WebappFreshSignup="webapp-fresh-signup",e.InAppNotificationShown="inapp-notification.shown",e.InAppNotificationSettings="inapp-notification.settings"}(n||(n={}))},25919:(e,t,o)=>{o.d(t,{W:()=>n});const n=[{label:"A",lists:[{name:"Afghanistan",shortname:"AF",code:93,key:"afghanistan"},{name:"Åland Islands",shortname:"AX",code:35818,key:"åland_islands"},{name:"Albania",shortname:"AL",code:355,key:"albania"},{name:"Algeria",shortname:"DZ",code:213,key:"algeria"},{name:"American Samoa",shortname:"AS"ode:1684,key:"american_samoa"},{name:"Andorra",shortname:"AD",code:376,key:"andorra"},{name:"Angola",shortname:"AO",code:244,key:"angola"},{name:"Anguilla",shortname:"AI",code:1264,key:"anguilla"},{name:"Antigua & Barbuda",shortname:"AG",code:1268,key:"antigua_and_barbuda"},{name:"Argentina",shortname:"AR",code:54,key:"argentina"},{name:"Armenia",shortname:"AM",code:374,key:"armenia"},{name:"Aruba",shortname:"AW",code:297,key:"aruba"},{name:"Ascension Island",shortname:"SH",code:247,key:"ascension"},{name:"Australia",shortname:"AU",code:61,key:"australia"},{name:"Austria",shortname:"AT",code:43,key:"austria"},{name:"Azerbaijan",shortname:"AZ",code:994,key:"azerbaijan"}]},{label:"B",lists:[{name:"Bahamas",shortname:"BS",code:1242,key:"bahamas"},{name:"Bahrain",shortname:"BH",code:973,key:"bahrain"},{name:"Bangladesh",shortname:"BD",code:880,key:"bangladesh"},{name:"Barbados",shortname:"BB",code:1246,key:"barbados"},{name:"Barbuda",shortname:"AG",code:1268,key:"barbuda"},{name:"Belarus",shortname:"BY",code:375,key:"belarus"},{name:"Belgium",shortname:"BE",code:32,key:"belgium"},{name:"Belize",shortname:"BZ",code:501,key:"belize"},{name:"Benin",shortname:"BJ",code:229,key:"benin"},{name:"Bermuda",shortname:"BM",code:1441,key:"bermuda_island"},{name:"Bhutan",shortname:"BT",code:975,key:"bhutan"},{name:"Bolivia",shortname:"BO",code:591,key:"bolivia"},{name:"Bosnia & Herzegovina",shortname:"BA",code:387,key:"bosnia_and_herzegovina"},{name:"Botswana",shortname:"BW",code:267,key:"botswana"},{name:"Brazil",shortname:"BR",code:55,key:"brazil"},{name:"British Indian Ocean Territory",shortname:"IO",code:246,key:"british_indian_ocean_territory"},{name:"British Virgin Islands",shortname:"VG",code:1284,key:"british_virgin_islands"},{name:"Brunei",shortname:"BN",code:673,key:"brunei"},{name:"Bulgaria",shortname:"BG",code:359,key:"bulgaria"},{name:"Burkina-faso",shortname:"BF",code:226,key:"burkina_faso"},{name:"Burundi",shortname:"BI",code:257,key:"burundi"}]},{label:"C",lists:[{name:"Cameroon",shortname:"CM",code:237,key:"cameroon"},{name:"Canada",shortname:"CA",code:1,key:"canada"},{name:"Cape Verde",shortname:"CV",code:238,key:"cape_verde"},{name:"Caribbean Netherlands",shortname:"BQ",code:5997,key:"caribbean_netherlands"},{name:"Cayman Is.",shortname:"KY",code:1345,key:"cayman_islands"},{name:"Central African Republic",shortname:"CF",code:236,key:"central_african_republic"},{name:"Chad",shortname:"TD",code:235,key:"chad"},{name:"Chile",shortname:"CL",code:56,key:"chile"},{name:"China mainland",shortname:"CN",code:86,key:"china_mainland"},{name:"Christmas Island",shortname:"CX",code:61,key:"christmas_island"},{name:"Cocos (Keeling) Islands",shortname:"CC",code:61,key:"cocos_keeling_islands"},{name:"Colombia",shortname:"CO",code:57,key:"colombia"},{name:"Comoros",shortname:"KM",code:269,key:"comoros"},{name:"Congo - Brazzaville",shortname:"CG",code:242,key:"congo"},{name:"Congo - Kinshasa",shortname:"CD",code:243,key:"congo_kinshasa"},{name:"Cook Is.",shortname:"CK",code:682,key:"cook_islands"},{name:"Costa Rica",shortname:"CR",code:506,key:"costa_rica"},{name:"Croatia",shortname:"HR",code:385,key:"croatia"},{name:"Curaçao",shortname:"CW",code:5999,key:"curaçao"},{name:"Cyprus",shortname:"CY",code:357,key:"cyprus"},{name:"Czechia",shortname:"CZ",code:420,key:"czech_republic"}]},{label:"D",lists:[{name:"Denmark",shortname:"DK",code:45,key:"denmark"},{name:"Diego Garcia",shortname:"DG",code:246,key:"diego_garcia"},{name:"Djibouti",shortname:"DJ",code:253,key:"djibouti"},{name:"Dominica",shortname:"DM",code:1767,key:"dominica"},{name:"Dominican Republic",shortname:"DO",code:1,key:"dominican_republic"}]},{label:"E",lists:[{name:"EI Salvador",shortname:"SV",code:503,key:"el_salvador"},{name:"Ecuador",shortname:"EC",code:593,key:"ecuador"},{name:"Egypt",shortname:"EG",code:20,key:"egypt"},{name:"Equatorial Guinea",shortname:"GQ",code:240,key:"equatorial_guinea"},{name:"Eritrea",shortname:"ER",code:291,key:"eritrea"},{name:"Estonia",shortname:"EE",code:372,key:"estonia"},{name:"Eswatini",shortname:"SZ",code:268,key:"eswatini"},{name:"Ethiopia",shortname:"ET",code:251,key:"ethiopia"}]},{label:"F",lists:[{name:"Falkland Islands",shortname:"FK",code:500,key:"falkland_islands"},{name:"Faroe Islands",shortname:"FO",code:298,key:"faroe_islands"},{name:"Fiji",shortname:"FJ",code:679,key:"fiji"},{name:"Finland",shortname:"FI",code:358,key:"finland"},{name:"France",shortname:"FR",code:33,key:"france"},{name:"French Guiana",shortname:"GF",code:594,key:"french_guiana"},{name:"French Polynesia",shortname:"PF",code:689,key:"french_polynesia"}]},{label:"G",lists:[{name:"Gabon",shortname:"GA",code:241,key:"gabon"},{name:"Gambia",shortname:"GM",code:220,key:"gambia"},{name:"Georgia",shortname:"GE",code:995,key:"georgia"},{name:"Germany",shortname:"DE",code:49,key:"germany"},{name:"Ghana",shortname:"GH",code:233,key:"ghana"},{name:"Gibraltar",shortname:"GI",code:350,key:"gibraltar"},{name:"Greece",shortname:"GR",code:30,key:"greece"},{name:"Greenland",shortname:"GL",code:299,key:"greenland"},{name:"Grenada",shortname:"GD",code:1473,key:"grenada"},{name:"Guadeloupe",shortname:"GP",code:590,key:"guadeloupe"},{name:"Guam",shortname:"GU",code:1671,key:"guam"},{name:"Guatemala",shortname:"GT",code:502,key:"guatemala"},{name:"Guernsey",shortname:"GG",code:44,key:"guernsey"},{name:"Guinea",shortname:"GN",code:224,key:"guinea"},{name:"Guinea-Bissau",shortname:"GW",code:245,key:"guinea_bissau"},{name:"Guyana",shortname:"GY",code:592,key:"guyana"}]},{label:"H",lists:[{name:"Haiti",shortname:"HT",code:509,key:"haiti"},{name:"Honduras",shortname:"HN",code:504,key:"honduras"},{name:"Hongkong",shortname:"HK",code:852,key:"hongkong"},{name:"Hungary",shortname:"HU",code:36,key:"hungary"}]},{label:"I",lists:[{name:"Iceland",shortname:"IS",code:354,key:"iceland"},{name:"India",shortname:"IN",code:91,key:"india"},{name:"Indonesia",shortname:"ID",code:62,key:"indonesia"},{name:"Iraq",shortname:"IQ",code:964,key:"iraq"},{name:"Ireland",shortname:"IE",code:353,key:"ireland"},{name:"Israel",shortname:"IL",code:972,key:"israel"},{name:"Isle of Man",shortname:"IM",code:44,key:"region_isle_of_man"},{name:"Italy",shortname:"IT",code:39,key:"italy"},{name:"Ivory Coast",shortname:"CI",code:225,key:"côte_d_ivoire"}]},{label:"J",lists:[{name:"Jamaica",shortname:"JM",code:1876,key:"jamaica"},{name:"Japan",shortname:"JP",code:81,key:"japan"},{name:"Jersey",shortname:"JE",code:44,key:"jersey"},{name:"Jordan",shortname:"JO",code:962,key:"jordan"}]},{label:"K",lists:[{name:"Kampuchea (Cambodia )",shortname:"KH",code:855,key:"cambodia"},{name:"Kazakhstan",shortname:"KZ",code:76,key:"kazakhstan"},{name:"Kazakhstan",shortname:"KZ",code:77,key:"kazakhstan"},{name:"Kenya",shortname:"KE",code:254,key:"kenya"},{name:"Kiribati",shortname:"KI",code:686,key:"kiribati"},{name:"Korea",shortname:"KR",code:82,key:"south_korea"},{name:"Kosovo",shortname:"XK",code:383,key:"region_kosovo"},{name:"Kuwait",shortname:"KW",code:965,key:"kuwait"},{name:"Kyrgyzstan",shortname:"KG",code:996,key:"kyrgyzstan"}]},{label:"L",lists:[{name:"Laos",shortname:"LA",code:856,key:"laos"},{name:"Latvia",shortname:"LV",code:371,key:"latvia"},{name:"Lebanon",shortname:"LB",code:961,key:"lebanon"},{name:"Lesotho",shortname:"LS",code:266,key:"lesotho"},{name:"Liberia",shortname:"LR",code:231,key:"liberia"},{name:"Libya",shortname:"LY",code:218,key:"libya"},{name:"Liechtenstein",shortname:"LI",code:423,key:"liechtenstein"},{name:"Lithuania",shortname:"LT",code:370,key:"lithuania"},{name:"Luxembourg",shortname:"LU",code:352,key:"luxembourg"}]},{label:"M",lists:[{name:"Macao",shortname:"MO",code:853,key:"macao"},{name:"Madagascar",shortname:"MG",code:261,key:"madagascar"},{name:"Malawi",shortname:"MW",code:265,key:"malawi"},{name:"Malaysia",shortname:"MY",code:60,key:"malaysia"},{name:"Maldives",shortname:"MV",code:960,key:"maldives"},{name:"Mali",shortname:"ML",code:223,key:"mali"},{name:"Malta",shortname:"MT",code:356,key:"malta"},{name:"Marshall Islands",shortname:"MH",code:692,key:"marshall_islands"},{name:"Martinique",shortname:"MQ",code:596,key:"martinique"},{name:"Mauritania",shortname:"MR",code:222,key:"mauritania"},{name:"Mauritius",shortname:"MU",code:230,key:"mauritius"},{name:"Mayotte",shortname:"YT",code:262,key:"mayotte"},{name:"Mexico",shortname:"MX",code:52,key:"mexico"},{name:"Micronesia",shortname:"FM",code:691,key:"micronesia"},{name:"Moldova, Republic of",shortname:"MD",code:373,key:"republic_of_moldova"},{name:"Monaco",shortname:"MC",code:377,key:"monaco"},{name:"Mongolia",shortname:"MN",code:976,key:"mongolia"},{name:"Montenegro",shortname:"ME",code:382,key:"montenegro"},{name:"Montserrat",shortname:"MS",code:1664,key:"montserrat"},{name:"Morocco",shortname:"MA",code:212,key:"morocco"},{name:"Mozambique",shortname:"MZ",code:258,key:"mozambique"},{name:"Myanmar (Burma)",shortname:"MM",code:95,key:"myanmar_burma"}]},{label:"N",lists:[{name:"Namibia",shortname:"NA",code:264,key:"namibia"},{name:"Nauru",shortname:"NR",code:674,key:"nauru"},{name:"Nepal",shortname:"NP",code:977,key:"nepal"},{name:"Netherlands",shortname:"NL",code:31,key:"netherlands"},{name:"New Caledonia",shortname:"NC",code:687,key:"new_caledonia"},{name:"New Zealand",shortname:"NZ",code:64,key:"new_zealand"},{name:"Nicaragua",shortname:"NI",code:505,key:"nicaragua"},{name:"Niger",shortname:"NE",code:227,key:"niger"},{name:"Nigeria",shortname:"NG",code:234,key:"nigeria"},{name:"Niue",shortname:"NU",code:683,key:"niue"},{name:"Norfolk Island",shortname:"NF",code:672,key:"norfolk_island"},{name:"North Macedonia",shortname:"MK",code:389,key:"macedonia"},{name:"Northern Mariana Islands",shortname:"MP",code:1670,key:"northern_mariana_islands"},{name:"Norway",shortname:"NO",code:47,key:"norway"}]},{label:"O",lists:[{name:"Oman",shortname:"OM",code:968,key:"oman"}]},{label:"P",lists:[{name:"Pakistan",shortname:"PK",code:92,key:"pakistan"},{name:"Palau",shortname:"PW",code:680,key:"palau"},{name:"Palestinian Territories",shortname:"PS",code:970,key:"palestinian_territories"},{name:"Panama",shortname:"PA",code:507,key:"panama"},{name:"Papua New Cuinea",shortname:"PG",code:675,key:"papua_new_guinea"},{name:"Paraguay",shortname:"PY",code:595,key:"paraguay"},{name:"Peru",shortname:"PE",code:51,key:"peru"},{name:"Philippines",shortname:"PH",code:63,key:"philippines"},{name:"Pitcairn Islands",shortname:"PN",code:64,key:"pitcairn_islands"},{name:"Poland",shortname:"PL",code:48,key:"poland"},{name:"Portugal",shortname:"PT",code:351,key:"portugal"},{name:"Puerto Rico",shortname:"PR",code:1787,key:"puerto_rico"},{name:"Puerto Rico",shortname:"PR",code:1939,key:"puerto_rico"}]},{label:"Q",lists:[{name:"Qatar",shortname:"QA",code:974,key:"qatar"}]},{label:"R",lists:[{name:"Réunion",shortname:"RE",code:262,key:"reunion"},{name:"Romania",shortname:"RO",code:40,key:"romania"},{name:"Russia",shortname:"RU",code:7,key:"russia"},{name:"Rwanda",shortname:"RW",code:250,key:"rwanda"}]},{label:"S",lists:[{name:"Samoa",shortname:"WS",code:685,key:"samoa"},{name:"San Marino",shortname:"SM",code:378,key:"san_marino"},{name:"Sao Tome and Principe",shortname:"ST",code:239,key:"sao_tome_and_principe"},{name:"Saudi Arabia",shortname:"SA",code:966,key:"saudi_arabia"},{name:"Senegal",shortname:"SN",code:221,key:"senegal"},{name:"Serbia",shortname:"RS",code:381,key:"serbia"},{name:"Seychelles",shortname:"SC",code:248,key:"seychelles"},{name:"Sierra Leone",shortname:"SL",code:232,key:"sierra_leone"},{name:"Singapore",shortname:"SG",code:65,key:"singapore"},{name:"Sint Maarten",shortname:"SX",code:1721,key:"sint_maarten"},{name:"Slovakia",shortname:"SK",code:421,key:"slovakia"},{name:"Slovenia",shortname:"SI",code:386,key:"slovenia"},{name:"Solomon Is",shortname:"SB",code:677,key:"solomon_islands"},{name:"Somali",shortname:"SO",code:252,key:"somalia"},{name:"South Africa",shortname:"ZA",code:27,key:"south_africa"},{name:"So. Georgia & So. Sandwich Isl.",shortname:"GS",code:500,key:"south_georgia_and_south_sandwich_islands"},{name:"South Sudan",shortname:"SS",code:211,key:"south_sudan"},{name:"Spain",shortname:"ES",code:34,key:"spain"},{name:"Sri Lanka",shortname:"LK",code:94,key:"sri_lanka"},{name:"St. Barthélemy",shortname:"BL",code:590,key:"st_barthélemy"},{name:"St. Helena",shortname:"SH",code:290,key:"st_helena"},{name:"St. Kitts & Nevis",shortname:"KN",code:1869,key:"st_kitts_and_nevis"},{name:"St. Martin",shortname:"MF",code:590,key:"st_martin_france"},{name:"St. Pierre & Miquelon",shortname:"PM",code:508,key:"st_pierre_and_miquelon"},{name:"St.Lucia",shortname:"LC",code:1758,key:"saint_lucia"},{name:"St. Vincent & Grenadines",shortname:"VC",code:1784,key:"st.vincent"},{name:"Sudan",shortname:"SD",code:249,key:"sudan"},{name:"Suriname",shortname:"SR",code:597,key:"suriname"},{name:"Svalbard & Jan Mayen",shortname:"SJ",code:4779,key:"svalbard_and_jan_mayen"},{name:"Sweden",shortname:"SE",code:46,key:"sweden"},{name:"Switzerland",shortname:"CH",code:41,key:"switzerland"}]},{label:"T",lists:[{name:"Taiwan",shortname:"TW",code:886,key:"taiwan"},{name:"Tajikstan",shortname:"TJ",code:992,key:"tajikistan"},{name:"Tanzania",shortname:"TZ",code:255,key:"tanzania"},{name:"Thailand",shortname:"TH",code:66,key:"thailand"},{name:"Timor-Leste",shortname:"TL",code:670,key:"east_timor"},{name:"Togo",shortname:"TG",code:228,key:"togo"},{name:"Tokelau",shortname:"TK",code:690,key:"tokelau"},{name:"Tonga",shortname:"TO",code:676,key:"tonga"},{name:"Trinidad & Tobago",shortname:"TT",code:1868,key:"trinidad_and_tobago"},{name:"Tunisia",shortname:"TN",code:216,key:"tunisia"},{name:"Turkey",shortname:"TR",code:90,key:"turkey"},{name:"Turkmenistan",shortname:"TM",code:993,key:"turkmenistan"},{name:"Turks & Caicos Islands",shortname:"TC",code:1649,key:"turks_and_caicos_islands"},{name:"Tuvalu",shortname:"TV",code:688,key:"tuvalu"}]},{label:"U",lists:[{name:"U.S. Virgin Islands",shortname:"VI",code:1340,key:"u_s_virgin_islands"},{name:"Uganda",shortname:"UG",code:256,key:"uganda"},{name:"Ukraine",shortname:"UA",code:380,key:"ukraine"},{name:"United Arab Emirates",shortname:"AE",code:971,key:"united_arab_emirates"},{name:"United Kingdom",shortname:"UK",code:44,key:"united_kingdom"},{name:"United States",shortname:"US",code:1,key:"united_states"},{name:"Uruguay",shortname:"UY",code:598,key:"uruguay"},{name:"Uzbekistan",shortname:"UZ",code:998,key:"uzbekistan"}]},{label:"V",lists:[{name:"Vanuatu",shortname:"VU",code:678,key:"vanuatu"},{name:"Vatican City",shortname:"VA",code:379,key:"vatican_city"},{name:"Vatican City",shortname:"VA",code:3906698,key:"vatican_city"},{name:"Venezuela",shortname:"VE",code:58,key:"venezuela"},{name:"Vietnam",shortname:"VN",code:84,key:"vietnam"}]},{label:"W",lists:[{name:"Wallis & Futuna",shortname:"WF",code:681,key:"wallis_and_futuna"},{name:"Western Sahara",shortname:"EH",code:212,key:"region_western_sahara"}]},{label:"Y",lists:[{name:"Yemen",shortname:"YE",code:967,key:"yemen"}]},{label:"Z",lists:[{name:"Zambia",shortname:"ZM",code:260,key:"zambia"},{name:"Zimbabwe",shortname:"ZW",code:263,key:"zimbabwe"}]}]},95701:(e,t,o)=>{o.d(t,{T:()=>w});var n=o(58632),i=o(64162),a=o(4126),r=o(93995),s=o(340),l=o(8536),d=o(62564),c=o(24451),p=o(23999),u=o(74690),g=o(80339),h=o(26324),m=o(64356),_=o(45102),f=o(7672),y=o(49343),b=o.n(y),x=o(20259),v=o(55099);let k=class{constructor(e){this.fetch=e}getComplianceSettings(){return this.fetch.get("/api/compliance/settings/",{query:{aid:1988,fromWeb:1}}).pipe(this.errorHandler)}validateAge(e,t){return this.fetch.post("https://www.tiktok.com/api/v3/register/verification/age/",Object.assign({body:b().stringify({fromWeb:1,source:"web",session_registered:1,update_birthdate_type:1,birthday:e,tt_csrf_token:this.fetch.csrfToken})},t&&{query:{reg_store_region:t}})).pipe(this.errorHandler)}errorHandler(e){return e.pipe((0,x.W)((e=>(0,p.of)(Object.assign({error_code:e.error_code||-1},e)))))}};var C,S;k=(0,n.__decorate)([(0,f._)(),(0,n.__metadata)("design:paramtypes",[v.p])],k),function(e){e[e.PASS=0]="PASS",e[e.FTC=1]="FTC",e[e.NormalThreshold=2]="NormalThreshold"}(C||(C={})),function(e){e[e.YoungerThan1=3008010]="YoungerThan1",e[e.YoungerThan2=3008012]="YoungerThan2",e[e.YoungerThan3=3008008]="YoungerThan3",e[e.OlderThan123=3008011]="OlderThan123",e[e.Empty=3008009]="Empty"}(S||(S={}));let w=class extends i.E{constructor(e,t,o){super(),this.service=e,this.pnsReport=t,this.t=o,this.defaultState={ageGateAction:2,registerLimited:!1,initial:!1,birthday:"",checkAgeLoading:!1,ageEligible:!1,showFeedbackModal:!1}}setYear(e,t){e.year=t}setMonth(e,t){e.month=t}setDate(e,t){e.date=t}setBirthday(e,t){const{year:o,month:n,date:i}=t,a=`${o}-${n<10?`0${n}`:n}-${i<10?`0${i}`:i}`;a!==e.birthday&&(e.birthday=a,e.ageEligible=!1,e.ageErrorMsg="",e.showAgeConfirm=!1,e.showErrorByToast=!1)}setAgeGateSetting(e,t){e.initial=!0,e.ageGateAction=t.action,e.registerLimited=t.registerLimited}setCheckAgeLoading(e,t){e.checkAgeLoading=t}setAgeCheckResult(e,t){e.ageErrorMsg=t.ageErrorMsg,e.ageEligible=t.ageEligible,e.showErrorByToast=Boolean(t.showErrorByToast),e.errorCode=t.errorCode,t.showFeedbackModal&&(e.showFeedbackModal=t.showFeedbackModal,e.feedbackModal=t.feedbackModal)}setShowAgeConfirm(e,t){e.showAgeConfirm=t}setShowFeedbackModal(e,t){e.showFeedbackModal=t}getComplianceSettings(e){return e.pipe((0,l.Z)((()=>this.service.getComplianceSettings().pipe((0,d.T)((e=>{if(0===(null==e?void 0:e.status_code)){const{age_gate_info:t={},device_limit_register_expired:o=!0}=e,{register_age_gate_action:n=2}=t;return this.getActions().setAgeGateSetting({registerLimited:!o,action:n})}return this.noop()}))))))}validateAge(e){return e.pipe((0,c.E)(this.state$),(0,l.Z)((([{canSkip:e,checkPassCallback:t,region:o},{birthday:n,ageEligible:i,ageGateAction:a}])=>e||i||0===a?(null==t||t(),(0,p.of)(this.getActions().setCheckAgeLoading(!1),this.noop())):n?this.service.validateAge(n,o).pipe((0,d.T)((e=>{const{is_eligible:o,status_code:n,status_msg:i,register_age_gate_post_action:a,feedback:r}=e;this.pnsReport.handleAgeGateResponse(o,n);const s=!!(null==r?void 0:r.dialog),l=s?{modal:null==r?void 0:r.dialog,business:null==r?void 0:r.business}:void 0;if(o)return null==t||t(s),this.getActions().setAgeCheckResult({ageErrorMsg:"",ageEligible:!0,errorCode:n,showFeedbackModal:s,feedbackModal:l});if(o||1!==a){const e=[3008010,3008012,3008008,3008011].includes(n);return this.getActions().setAgeCheckResult({ageErrorMsg:i||"Sorry, something went wrong, please try again later",ageEligible:!1,showErrorByToast:e,errorCode:n})}return null==t||t(),this.getActions().setShowAgeConfirm(!0)})),(0,u.Z)(this.getActions().setCheckAgeLoading(!0)),(0,g.q)(this.getActions().setCheckAgeLoading(!1))):(0,p.of)(this.getActions().setAgeCheckResult({ageErrorMsg:this.t("birthday_error_invaliddate"),ageEligible:!1,showErrorByToast:!0,errorCode:3008009})))))}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",h.c)],w.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setYear",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setMonth",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setDate",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setBirthday",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setAgeGateSetting",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setCheckAgeLoading",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setAgeCheckResult",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setShowAgeConfirm",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"setShowFeedbackModal",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[h.c]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"getComplianceSettings",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[h.c]),(0,n.__metadata)("design:returntype",void 0)],w.prototype,"validateAge",null),w=(0,n.__decorate)([(0,r.n)("AgeGateModule"),(0,n.__param)(2,(0,s.y)(m.hp)),(0,n.__metadata)("design:paramtypes",[k,_.W,Function])],w)},56578:(e,t,o)=>{o.d(t,{S:()=>y});var n=o(58632),i=o(64162),a=o(4126),r=o(93995),s=o(340),l=o(35572),d=o(62564),c=o(20259),p=o(23999),u=o(53708),g=o(26324),h=o(11983),m=o(64356),_=o(55099),f=o(54503);let y=class extends i.E{constructor(e,t,o){super(),this.fetch=e,this.complianceService=t,this.t=o,this.defaultState={isRegisterWithPrivateOn:!1}}setIsRegisterWithPrivateOn(e,t){e.isRegisterWithPrivateOn=t}handlePrivateConfirm(e){return e.pipe((0,l.p)((()=>this.complianceService.postPrivateBannerAck())),(0,d.T)((()=>this.getActions().setIsRegisterWithPrivateOn(!1))),(0,c.W)((e=>(console.error(e),h.F.open({content:this.t("Sorry, something went wrong, please try again later"),duration:2e3}),(0,p.of)(this.noop())))))}getIsRegisterPrivateAccount(){return this.fetch.get("/api/user/detail/self/",{query:{tt_csrf_token:this.fetch.csrfToken}}).pipe((0,d.T)((({statusCode:e,userInfo:t})=>{var o,n;if(0!==e&&10222!==e)throw new Error(`getIsRegisterPrivateAccount error, error_code ${e}`);return null!==(n=null===(o=null==t?void 0:t.user)||void 0===o?void 0:o.showPrivateBanner)&&void 0!==n&&n})),(0,c.W)((e=>(console.error(e),(0,p.of)(!1)))),(0,u.L)(1))}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",g.c)],y.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],y.prototype,"setIsRegisterWithPrivateOn",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[g.c]),(0,n.__metadata)("design:returntype",void 0)],y.prototype,"handlePrivateConfirm",null),y=(0,n.__decorate)([(0,r.n)("RegisterPrivateAccount"),(0,n.__param)(2,(0,s.y)(m.hp)),(0,n.__metadata)("design:paramtypes",[_.p,f.D,Function])],y)},45102:(e,t,o)=>{o.d(t,{W:()=>s});var n=o(58632),i=o(7672),a=o(93608);const r="new_user_registration";let s=class{constructor(){this.handlePolicyConfirmOnFYP=e=>{a.f.event("tns_web_trending_setting",e)},this.handleAgeGateResponse=(e,t)=>{a.f.event("age_gate_response",{enter_type:"click_sign_up",is_success:e?1:0,error_code:t})}}handleUniversalPopShow(e){a.f.event("tns_general_dialog_show",e)}handleUniversalPopClick(e){a.f.event("qa_tns_general_dialog_click",e)}handleKeywordfilteringShow(e){a.f.event("enter_video_filter_kw",{enter_from:e})}hanldeKRConsentShow(){a.f.event("register_terms_show",{enter_from:r})}hanldeKRConsentClick(e,t){a.f.event("register_terms_click",{enter_from:r,content:e,click_type:t?1:0})}hanldeKRConsentClickNext(e){a.f.event("register_terms_click_next",{enter_from:r,trending_on:e?1:0})}hanldeKRConsentClickSeeDetail(e){a.f.event("register_terms_see_details",{enter_method:"click",enter_from:r,page_detail_viewed:e})}};s=(0,n.__decorate)([(0,i._)()],s)},97046:(e,t,o)=>{var n,i;o.d(t,{fe:()=>n,j0:()=>a}),function(e){e.Web="tiktokwebother",e.SEO="tiktokwebseo",e.WebSem="tiktokwebsem",e.SamsungQuickAccess="samsung_quick_access"}(n||(n={})),function(e){e.User="wrapper_user",e.Foryou="wrapper_foryou",e.VideoInsert="wrapper_video_insert",e.Music="wrapper_music",e.Challenge="wrapper_challenge",e.Video="wrapper_video",e.Search="wrapper_search",e.Poi="wrapper_poi",e.Channel="wrapper_channel",e.Find="wrapper_find",e.TrendingDetail="wrapper_trending"}(i||(i={}));const a="webapp_first_open_cta"},44606:(e,t,o)=>{o.d(t,{mE:()=>b});var n=o(47172),i=o(10828),a=o(93608),r=o(4474),s=o(40099),l=o(58305),d=o(49057),c=o(48615),p=o(6523),u=o(45297),g=o(97046),h=o(60484);const m={m:"835599320",t:"1235601864"},_={keyword_expansion_page:"kep",find_web:"find",channel_web:"channel",others_homepage:"user"},f={},y=e=>{let t=g.fe.Web;return"paid"===e?t=g.fe.WebSem:"referral_amp"===e||"organic"===e?t=g.fe.SEO:"samsung_quick_access"===e&&(t=g.fe.SamsungQuickAccess),t},b=({downloadType:e,enterMethod:t="",id:o,search_keyword:g,search_sug_type:b,pre_click_id:x,page_id:v,defaultPid:k,referrer_url:C})=>{const{wid:S,region:w,abTestVersion:j,appType:T}=(0,h.L$)((0,d.W)((()=>["wid","region","abTestVersion","appType"]),[])),{isAndroid:P,isIOS:E}=(0,h.L$)((0,c.U)((()=>["isAndroid","isIOS"]),[])),{previous_page:M,page_name:L}=a.f.commonParams,{search:A}=(0,n.useLocation)(),I=(0,l.Hd)("webapp_launch_mode"),R=(0,p.wW)(),F=`click_wap_${e}`,O=(({page_name:e,page_id:t,id:o})=>t?`${e}_${t}`:`${e}${o?`_${o}`:""}`)({page_name:L,page_id:v,id:o});return{schemeParams:(0,s.useMemo)((()=>(({pageName:e,gdLabel:t,launchMode:o,id:n,wid:i,region:a,search_keyword:r,previous_page:s,enterMethod:l="",search_sug_type:d,pre_click_id:c,abTestVersion:p,seoABTestVersion:g,referrer_url:h})=>{var m,_;const f={page_name:e,gd_label:t,refer:o,referer:o,utm_campaign:y(o)};return n&&(f.id=n),i&&(f.wid=i),a&&u.Nd.includes(a)&&(f.awedp_require_login="normal"),r&&(f.keyword=encodeURIComponent(r),f.search_keyword=encodeURIComponent(r),f.search_type="general",f.enter_from=`${s}_web`,f.enter_method=l,f.search_sug_type=null!=d?d:"",f.pre_click_id=null!=c?c:"",f.vidab=encodeURIComponent(null!==(m=null==p?void 0:p.versionName)&&void 0!==m?m:""),f.seo_vidab=encodeURIComponent((null!==(_=null==g?void 0:g.vidList)&&void 0!==_?_:[]).join(",")),f.release=encodeURIComponent(null!=="1.0.2.6172"?"1.0.2.6172":""),"general_search"===e&&"discover_kw"===s&&(f.enter_from_sub="app_outside")),h&&(f.referrer_url=h),f})({pageName:O,gdLabel:F,launchMode:I,id:o,wid:S,region:w,search_keyword:g,previous_page:M,enterMethod:t,search_sug_type:b,pre_click_id:x,abTestVersion:j,seoABTestVersion:R,referrer_url:C})),[O,F,I,o,S,w,g,M,t,b,x,j,R,C]),onelinkParams:(0,s.useMemo)((()=>(({search:e,url:t,launchMode:o,gdLabel:n,defaultPid:a,appType:s,pageName:d,pageNamePrefix:c,abTestVersion:p,seoABTestVersion:u,wid:g,trafficType:h,isIOS:b,isAndroid:x,previous_page:v})=>{var k,C;let S,w,j;if("undefined"!=typeof window&&e){const t=(0,r.parse)(e);j=t.utm_campaign,S=t.utm_source,w=t.utm_medium}else if(t)try{const e=new URL(t),o=new URLSearchParams(e.search);S=o.get("source"),w=o.get("medium"),j=o.get("url_campaign")}catch(e){}const T=null!=h?h:(0,l.Hd)("webapp_original_traffic_type"),P=(0,l.Hd)("referer_url"),E=(0,l.Hd)("referer_video_id"),M=y(o),L=(({pid:e,pageName:t,previousPage:o})=>{var n,i;return"general_search"===t?`${e}_gs_${o}`:`${e}_${null!==(i=null!==(n=_[null!=t?t:""])&&void 0!==n?n:t)&&void 0!==i?i:"unknown"}`})({pid:M,pageName:c,previousPage:v}),A=b?(({appType:e,campaignName:t})=>{var o;if(!e||!m[e]||!["m","t"].includes(e))return f;const n="https://apps.apple.com/app/apple-store/id{iosAppid}?pt=118874049&ct={ct}&mt=8".replace(/{iosAppid}/g,null!==(o=m[e])&&void 0!==o?o:"").replace(/{ct}/g,t);return n?{af_ios_url:n,af_param_forwarding:"false"}:f})({abTestVersion:p,appType:s,campaignName:L}):{},I=x?{utm_campaign:L}:{},R=`${S?`source:${S};`:""}${w?`medium:${w};`:""}${j?`campaign:${j};`:""}`,F=`${P?`referer_url:${P}};`:""}${E?`referer_video_id:${E};`:""}`,O=Object.assign(Object.assign({af_ad:n,af_siteid:"mobile",pid:null!=a?a:M,c:d,af_adset:o,af_ad_id:T,vidab:encodeURIComponent(null!==(k=null==p?void 0:p.versionName)&&void 0!==k?k:""),seo_vidab:encodeURIComponent((null!==(C=null==u?void 0:u.vidList)&&void 0!==C?C:[]).join(",")),release:encodeURIComponent("1.0.2.6172")},A),I);if("undefined"!=typeof window)O.canonical=`${i.C}${decodeURIComponent(location.pathname)}`;else if(t){const e=new URL(t),o=decodeURIComponent(e.pathname);O.canonical=`${i.C}${o}`}return g&&(O.wid=g),R&&(O.af_adset_id=R),F&&(O.af_channerl=F),e&&"true"===(0,r.parse)(e).is_retargeting&&(O.is_retargeting="true"),Object.keys(O).forEach((e=>{O[e]="string"==typeof O[e]?encodeURIComponent(O[e]):O[e]})),O})({search:A,launchMode:I,gdLabel:F,defaultPid:k,pageName:O,pageNamePrefix:L,abTestVersion:j,seoABTestVersion:R,wid:S,isAndroid:P,isIOS:E,appType:T,previous_page:M})),[A,I,F,k,O,L,j,R,S,P,E,T,M])}}},55462:(e,t,o)=>{o.d(t,{ZP:()=>d,rF:()=>l,sZ:()=>c,yf:()=>s});var n=o(73580),i=o(40099),a=o(11654),r=o(23721);function s(){const{enable:e=!0,enableHeadComponent:t,enableInlineScript:o,enableUseSlardarPageViewHook:n}=(0,i.useContext)(r.ug);return{enable:e,enableHeadComponent:null!=t?t:e,enableInlineScript:null!=o?o:e,enableUseSlardarPageViewHook:null!=n?n:e}}function l({pid:e}){const t=(0,n.Nj)(a.V$),{enableUseSlardarPageViewHook:o}=s();(0,i.useEffect)((()=>{o&&(t.config({pid:e}),t.start(e))}),[e,t,o])}function d(){return(0,n.Nj)(a.V$)}function c(){const{enable:e}=s();return e}},70142:(e,t,o)=>{o.d(t,{ke:()=>i,t3:()=>n});const n=(e,t,o=!0,n=!1)=>{const{keyCode:i,altKey:a,ctrlKey:r,metaKey:s,key:l}=e;if(!t&&[13,32,38,40].includes(i))return 2;if(!t&&n&&27===i)return 13;if(8===i||144===i||1===l.length&&32!==i&&!a&&!r&&!s)return t?10:2;if(t)switch(i){case 38:return a?4:1;case 40:return a?12:0;case 27:return 3;case 13:case 32:return 4;case 33:return 8;case 34:return 7;case 36:return 5;case 35:return 6;case 9:return o?11:4;default:return 12}return 12},i=e=>{try{const t=e.querySelectorAll('a[href], button, input, textarea, details, [tabindex]:not([tabindex="-1"])');return Array.from(t).filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")&&e.clientWidth>0))}catch(e){return console.warn("[A11y] no focusable element found: ",e),[]}}},40661:(e,t,o)=>{o.d(t,{p:()=>k});var n=o(24643),i=o(67518),a=o(46682),r=o(40099),s=o(28591),l=o(75974),d=o(60484),c=o(55462),p=o(49057);const u=function({iconSrc:e="https://www.tiktok.com/favicon.ico"}){return(0,n.jsxs)(s.mg,{children:[(0,n.jsx)("meta",{name:"google",content:"notranslate"},"google"),",",(0,n.jsx)("meta",{name:"format-detection",content:"telephone=no"},"format-detection"),",",(0,n.jsx)("link",{rel:"shortcut icon",href:e,type:"image/x-icon"},"shortcut")]})};var g=o(73580),h=o(91498),m=o(97086),_=o(72277),f=o(11654),y=o(23721),b=o(45297);const x=function({appContext:e,bizContext:t,slardarBid:o,initialPid:i,async:a=!1,reportImage:l}){var d,p;const{abTestVersion:u,env:x,botType:v,user:k,wid:C,region:S}=null!=e?e:{},{isMobile:w,domains:j,isTTP:T,idc:P,config:E}=null!=t?t:{},M=(0,g.Nj)(f.V$),L=(0,r.useMemo)((()=>null==E?void 0:E.featureFlags),[]),A=(0,r.useMemo)((()=>{var e;return Object.assign(Object.assign({region:null!=S?S:"",botType:null!=v?v:"",isMobile:Boolean(w).toString(),isDowngrade:(0,m.qk)().toString(),isLogin:Boolean(k).toString(),isPPE:"ppe"===(null==x?void 0:x.type),isLandingPage:1,launchMode:(0,m.fU)()?"":(0,h.o7)()},((e={parameters:{},versionName:""})=>{const t={};try{const o=e.parameters||{};Object.entries(o).forEach((([e,o])=>{_.s.includes(e)&&(t[e]=o.vid)}))}catch(e){console.error("Abtest config parse error",e)}return t})(u)),{uid:null!==(e=null==k?void 0:k.uid)&&void 0!==e?e:"",idc:null!=P?P:"unknown"})}),[S,v,w,k,null==x?void 0:x.type,u]),{enableInlineScript:I}=(0,c.yf)(),R=!!l||"v2"===(null===(p=null===(d=null==u?void 0:u.parameters)||void 0===d?void 0:d.enable_slardar_image)||void 0===p?void 0:p.vid),F=(0,r.useMemo)((()=>Object.assign(Object.assign(Object.assign({},y.dg),{bid:o,env:"boe"===(null==x?void 0:x.type)||"ppe"===(null==x?void 0:x.type)?"test":"production",domain:(null==L?void 0:L.slardar_sg_domain)&&"SG"===S?"mon-sg.tiktokv.com":null==j?void 0:j.slardar,disableInit:!0,useLocalConfig:"ppe"===(null==x?void 0:x.type)||"boe"===(null==x?void 0:x.type),integrations:[...M.registerImageXPlugin(R,l&&"boolean"!=typeof l?l.sample:void 0)]}),T?{sdkUrl:"https://lf16-cdn-tos.tiktokcdn-us.com/obj/static-tx/slardar/fe/sdk-web/browser.oci.js",pluginPathPrefix:"https://lf16-cdn-tos.tiktokcdn-us.com/obj/static-tx/slardar/fe/sdk-web/plugins"}:{})),[null==j?void 0:j.slardar,null==x?void 0:x.type,T,o,L,S]),O=(0,r.useMemo)((()=>JSON.stringify(F)),[F]);return(0,r.useEffect)((()=>{let e;const t=()=>{window.SlardarClient?M.hasStarted()||(M.mountBeforeSendEvent(),M.init(Object.assign(Object.assign({},F),{pid:i})),M.config({userId:C}),M.start()):e=window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,1)};return M.context(A),"delay_start_until_manually_called"===i?(M.preserveConfig(F),M.preserveExtraInfo({userId:C})):(M.mountBeforeSendEvent(),M.init(Object.assign(Object.assign({},F),{pid:i})),M.config({userId:C}),M.start(),e=window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,1)),()=>{window.cancelIdleCallback?window.cancelIdleCallback(e):window.clearTimeout(e)}}),[]),!I||(0,m._8)(a)?null:(0,n.jsxs)(s.mg,{children:[(0,n.jsx)("script",{id:"slardar-config",type:"application/json",children:O}),a?(0,n.jsx)("script",{src:b.se[T?"TTP":"ROW"].slardarWeb,async:"DO_NOT_DELETE_FOR_REHYDRATE_ERROR"}):(0,n.jsx)("script",{src:b.se[T?"TTP":"ROW"].slardarWeb})]})},v=function({isLogin:e,isFtc:t}){return(0,n.jsx)(s.mg,{children:(0,n.jsx)("meta",{name:"pumbaa-ctx",content:`login=${e?1:0},ftc=${t?1:0}`})})},k=function({appContext:e,bizContext:t,slardarBid:o,iconSrc:g,initialPid:h,asyncSlardar:m=!1,usePumbaaMeta:_=!1,slardarReportImage:f}){var y;const{language:b}=(0,d.L$)(e),{isDark:k}=(0,i.u)(),{user:C}=null!==(y=(0,p.W)((()=>["user"]),[]))&&void 0!==y?y:{},{enableHeadComponent:S}=(0,c.yf)(),w=Boolean(C),j=Boolean(null==C?void 0:C.ftcUser),T=(0,a.w)(l.P);return(0,r.useEffect)((()=>{w&&T.getComplianceSettings()}),[w,T]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.mg,{htmlAttributes:{lang:b,"data-theme":k?"dark":"light"}}),(0,n.jsx)(u,{iconSrc:g}),_&&(0,n.jsx)(v,{isLogin:w,isFtc:j}),S&&(0,n.jsx)(x,{appContext:e,bizContext:t,slardarBid:o,initialPid:h,async:m,reportImage:f})]})}},54503:(e,t,o)=>{o.d(t,{D:()=>r});var n=o(58632),i=o(7672),a=o(55099);let r=class{constructor(e){this.fetch=e,this.postPrivateBannerAck=()=>this.fetch.post("/api/private_banner/ack/")}getVideoPrivateSetting(){return this.fetch.get("/api/compliance/settings/",{baseUrlType:2})}};r=(0,n.__decorate)([(0,i._)(),(0,n.__metadata)("design:paramtypes",[a.p])],r)},30615:(e,t,o)=>{o.d(t,{iM:()=>s});var n=o(16469),i=o(52401),a=o(58305),r=o(67805);const s=(e,t,o)=>{var s;if(n.LU.removeAll(),o){o.logoutSubmit(null!=t?t:{});const e=null===(s=o.getCommonTrackingInfo)||void 0===s?void 0:s.call(o);e&&((0,a.J2)(r.MM.TRACKING_INFO,JSON.stringify(e)),(0,a.J2)(r.MM.CLICK_TIMESTAMP,Date.now().toString()))}else i.z.logoutSubmit(null!=t?t:{});let l="https://www.tiktok.com/logout";e&&(l+=`?redirect_url=${encodeURIComponent(e)}`),window.location.href=l}},37278:(e,t,o)=>{o.r(t),o.d(t,{default:()=>nm});var n=o(24643),i=(o(14713),o(88091)),a=o(73635),r=o(67518),s=o(13392),l=o(73580),d=o(37434),c=o(48615),p=o(48211),u=o(58632),g=o(64162),h=o(4126),m=o(93995);let _=class extends g.E{constructor(){super(...arguments),this.defaultState={loginModalSwitchPath:!1,loginModalFirstOpen:!0}}setLoginModalFirstOpen(e,t){e.loginModalFirstOpen=t}setLoginModalSwitchPath(e,t){e.loginModalSwitchPath=t}setLoginModalInitialState(e){e.loginModalFirstOpen=!0,e.loginModalSwitchPath=!1}};(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Boolean]),(0,u.__metadata)("design:returntype",void 0)],_.prototype,"setLoginModalFirstOpen",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Boolean]),(0,u.__metadata)("design:returntype",void 0)],_.prototype,"setLoginModalSwitchPath",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object]),(0,u.__metadata)("design:returntype",void 0)],_.prototype,"setLoginModalInitialState",null),_=(0,u.__decorate)([(0,m.n)("FocusControlModule")],_);var f=o(25616),y=o(88920),b=o(26956),x=o(92264),v=o(97086),k=o(67805),C=o(58305),S=o(95481),w=o(85349),j=o(75792),T=o(31974),P=o(16680),E=o(26475),M=o(57432),L=o.n(M),A=o(40099),I=o.t(A,2),R=o(95719),F=o(32125),O=o(75431),D=o(93411),H=o(51880);const U="pushState",N="replaceState",B=["popstate",U,N,"hashchange"],$=e=>{for(const t of B)addEventListener(t,e);return()=>{for(const t of B)removeEventListener(t,e)}},z=(e,t)=>(0,H.useSyncExternalStore)($,e,t),W=()=>location.search,G=()=>location.pathname,V=({ssrPath:e}={})=>z(G,e?()=>e:G),K=(e,{replace:t=!1,state:o=null}={})=>history[t?N:U](o,"",e),q=Symbol.for("wouter_v3");if("undefined"!=typeof history&&void 0===window[q]){for(const e of[U,N]){const t=history[e];history[e]=function(){const o=t.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),o}}Object.defineProperty(window,q,{value:!0})}const Z=I.useInsertionEffect,J="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?A.useLayoutEffect:A.useEffect,Y=Z||J,Q=e=>{const t=A.useRef([e,(...e)=>t[0](...e)]).current;return Y((()=>{t[0]=e})),t[1]},X=(e="",t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",ee=e=>{try{return decodeURI(e)}catch(t){return e}},te={hook:(e={})=>[V(e),K],searchHook:({ssrSearch:e=""}={})=>z(W,(()=>e)),parser:D.q,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},oe=(0,A.createContext)(te),ne=()=>(0,A.useContext)(oe),ie={},ae=(0,A.createContext)(ie),re=()=>(0,A.useContext)(ae),se=e=>{const[t,o]=e.hook(e);return[ee(X(e.base,t)),Q(((t,n)=>o(((e,t="")=>"~"===e[0]?e.slice(1):t+e)(t,e.base),n)))]},le=()=>se(ne()),de=(e,t,o,n)=>{const{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),r=i.exec(o)||[],[s,...l]=r;return void 0!==s?[!0,(()=>{const e=!1!==a?Object.fromEntries(a.map(((e,t)=>[e,l[t]]))):r.groups;let t={...l};return e&&Object.assign(t,e),t})(),...n?[s]:[]]:[!1,null]},ce=({children:e,...t})=>{const o=ne(),n=t.hook?te:o;let i=n;const[a,r]=t.ssrPath?.split("?")??[];r&&(t.ssrSearch=r,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs;let s=(0,A.useRef)({}),l=s.current,d=l;for(let e in n){const o="base"===e?n[e]+(t[e]||""):t[e]||n[e];l===d&&o!==d[e]&&(s.current=d={...d}),d[e]=o,o!==n[e]&&(i=d)}return(0,A.createElement)(oe.Provider,{value:i,children:e})},pe=({children:e,component:t},o)=>t?(0,A.createElement)(t,{params:o}):"function"==typeof e?e(o):e,ue=({path:e,nest:t,match:o,...n})=>{const i=ne(),[a]=se(i),[r,s,l]=o??de(i.parser,e,a,t),d=(e=>{let t=(0,A.useRef)(ie),o=t.current;for(const t in e)e[t]!==o[t]&&(o=e);return t.current=o})({...re(),...s});if(!r)return null;const c=l?(0,A.createElement)(ce,{base:l},pe(n,d)):pe(n,d);return(0,A.createElement)(ae.Provider,{value:d,children:c})},ge=(0,A.forwardRef)(((e,t)=>{const o=ne(),[n,i]=se(o),{to:a,href:r=a,onClick:s,asChild:l,children:d,className:c,replace:p,state:u,...g}=e,h=Q((t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||0!==t.button||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(r,e)))})),m=o.hrefs("~"===r[0]?r.slice(1):o.base+r,o);return l&&(0,A.isValidElement)(d)?(0,A.cloneElement)(d,{onClick:h,href:m}):(0,A.createElement)("a",{...g,onClick:h,href:m,className:c?.call?c(n===r):c,children:d,ref:t})})),he=e=>{const{to:t,href:o=t}=e,[,n]=le(),i=Q((()=>n(t||o,e)));return J((()=>{i()}),[]),null},me=(0,A.createContext)(null);function _e(e){if(!e)throw new Error("LoginRouter is not provided.")}function fe(){const e=(0,A.useContext)(me);return _e(e),e.history}function ye(){const e=(0,A.useContext)(me);return _e(e),e.location}function be(e){const[t]=le(),o=Array.isArray(e)?e:[e];return(0,A.useMemo)((()=>{for(const e of o){const[o,n]=de(D.q,e,t,!1);if(o)return{isExact:!0,params:Object.assign({},n)};const[i,a]=de(D.q,e,t,!0);if(i)return{isExact:!1,params:Object.assign({},a)}}return null}),[...o,t])}var xe=o(47172);const ve=e=>{const{history:t,location:o,isMemoryRouter:i}=e,{useWouterLocation:a,useWouterSearch:r}=function(e){const t=(t,o={})=>{var n;null!==(n=o.replace)&&void 0!==n&&n?e.replace(t,o.state):e.push(t,o.state)};return{useWouterSearch:()=>e.location.search,useWouterLocation:()=>[ye().pathname,t]}}(e.history),s=(0,A.useMemo)((()=>({history:t,location:o})),[t,o]),l=(0,n.jsx)(me.Provider,{value:s,children:(0,n.jsx)(ce,{hook:a,searchHook:r,children:e.children})});return i?(0,n.jsx)(xe.CustomRouterContext.Provider,{value:s,children:l}):l},ke=e=>{const{history:t}=e,[o,i]=(0,A.useState)(t.location);return(0,A.useLayoutEffect)((()=>{o!==t.location&&i(t.location);const e=t.listen((e=>{i(e)}));return()=>e()}),[]),(0,n.jsx)(ve,{history:t,location:o,isMemoryRouter:!0,children:e.children})},Ce=e=>{var{path:t,exact:o}=e,i=(0,u.__rest)(e,["path","exact"]);let a;return o||"string"!=typeof t||"*"===t||(a=(0,D.q)(t,!0).pattern),(0,n.jsx)(ue,Object.assign({},i,{path:null!=a?a:t,component:i.component}))};function Se(e){return Array.isArray(e)?e.flatMap((e=>Se(e&&e.type===A.Fragment?e.props.children:e))):[e]}const we=({children:e})=>{const{pathname:t}=ye();for(const o of Se(e)){if(!(0,A.isValidElement)(o))continue;const[e,n]=de(D.q,o.props.path,t,!o.props.exact);if(e)return(0,A.cloneElement)(o,{match:[e,n]})}return null};var je=o(34832),Te=o(95701),Pe=o(40661),Ee=o(84827);const Me={"#app":{justifyContent:"center"},"#loginContainer":{display:"flex",alignItems:"center",flexDirection:"column"}},Le=e=>({body:{boxSizing:"border-box"},".date-selector .rmc-picker":{height:"250px"},".date-selector .rmc-picker:first-of-type":{position:"absolute",right:e?"unset":0,left:e?"0":"unset",width:"33.3333%"},".date-selector .rmc-picker-indicator":{height:"50px"},".date-selector .rmc-picker-item":{height:"50px",lineHeight:"50px",color:"#161823"},".date-selector":{width:"66%"}});var Ae=o(70261),Ie=o(62186),Re=o(72153),Fe=o(97397);const Oe=(0,Ie.default)("div",{target:"esqadv70"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",width:e.isMobile?"300px":"400px",padding:"32px"})),"label:DivContainer;"),De=(0,Ie.default)("h5",{target:"esqadv71"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"24px",lineHeight:"36px",textAlign:"center",margin:"0"}]),"label:H5Title;"),He=(0,Ie.default)("p",{target:"esqadv72"})([({theme:e})=>(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{lineHeight:"17px",margin:"16px 0px 24px",textAlign:"center",fontSize:"14px"}],"label:PDesc;"),Ue=(0,Ie.default)("div",{target:"esqadv73"})({display:"flex",flexDirection:"column"},"label:DivButtonWrapper;"),Ne=(0,Ie.default)(Fe.y,{target:"esqadv74"})({minWidth:"auto",flex:"1",":last-child":{marginTop:"12px"}},"label:StyledButton;"),Be=(0,A.memo)((()=>{const e=(0,f.s)("WebApp_Login"),t=(0,l.Nj)(T.$F),[{showReactiveModal:o,inCancellationResponse:i},{setShowReactiveModal:a,cancelDeleteAccount:r}]=(0,s.Su)(Ae.$),d=(0,A.useCallback)((()=>{a({show:!1});const e=(null==i?void 0:i.apply_time)?Math.floor((Date.now()-1e3*i.apply_time)/24/60/60/1e3):null;t.reactiveCancelClick({is_delete:(null==i?void 0:i.isStopAccount)?0:1,num_days_reactive:e})}),[a,t,null==i?void 0:i.isStopAccount,null==i?void 0:i.apply_time]),c=(0,A.useCallback)((()=>{const e=(null==i?void 0:i.apply_time)?Math.floor((Date.now()-1e3*i.apply_time)/24/60/60/1e3):null;t.reactiveConfirmClick({is_delete:(null==i?void 0:i.isStopAccount)?0:1,num_days_reactive:e}),r()}),[r,null==i?void 0:i.apply_time,null==i?void 0:i.isStopAccount,t]);return(0,n.jsx)(S.aF,{visible:o,maskCloseable:!1,onClose:d,children:(0,n.jsxs)(Oe,{children:[(0,n.jsx)(De,{children:e("reactivate_h1")}),(0,n.jsx)(He,{children:e("logback_reactivate_desc")}),(0,n.jsxs)(Ue,{children:[(0,n.jsx)(Ne,{size:"large",buttonTheme:"primary",onClick:c,children:e("reactivate_btn")}),(0,n.jsx)(Ne,{size:"large",onClick:d,children:e("common_registration_phone_input_popup_button")})]})]})})}));var $e=o(12527);const ze=(0,Ie.default)("div",{target:"e1lgic6i0"})({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",marginTop:"40px",fontWeight:600},"label:DivBack;");ze.defaultProps=Object.assign(Object.assign({},ze.defaultProps),{"data-e2e":"back-btn"});const We=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),t=(0,P.mZ)((e=>e.loginModalShow)),o=fe(),i=be([j.tH.loginQRcode,j.tH.loginPhoneOrEmail,j.tH.signupPhoneOrEmail]),a=(0,A.useCallback)((()=>{o.goBack()}),[o]),r=(0,A.useCallback)((e=>{13===e.keyCode&&o.goBack()}),[o]);return t||!i?null:(0,n.jsxs)(ze,{onClick:a,onKeyDown:r,tabIndex:0,role:"link",children:[(0,n.jsx)($e.A,{}),e("common_login_back")]})}));var Ge=o(55462),Ve=o(60484),Ke=o(3089),qe=o(31960),Ze=o(49057),Je=o(33805),Ye=o(71281),Qe=o(90341),Xe=o(35267),et=o(68252),tt=o(93608);const ot=e=>{tt.f.sendEvent("click_other_login_options",e)},nt=()=>{tt.f.sendEvent("fb_unavailable_notify")},it=()=>{tt.f.sendEvent("fb_unavailable_dismiss")},at=()=>{tt.f.sendEvent("click_user_phone_or_email")};var rt=o(4474),st=o(94777);const lt=(0,Ie.default)("div",{target:"e1vllrfx0"})((({theme:e})=>[{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px",fontWeight:"semibold",lineHeight:"130%",letterSpacing:"0.093px",cursor:"pointer",color:e.colors.TextPrimary,fontFamily:"TikTokFont"}]),"label:DivShowMore;");lt.defaultProps=Object.assign(Object.assign({},lt.defaultProps),{"data-e2e":"see-more-btn"});const dt=(0,Ie.default)("div",{target:"e1vllrfx1"})((({theme:e})=>({display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",marginBottom:"10px",gap:e.isMobile?"8px":"12px"})),"label:DivIconButtonListContainer;"),ct=(0,Ie.default)("div",{target:"e1vllrfx2"})((({theme:e})=>[{width:"28px",height:"28px",display:"flex",marginInlineStart:"-4px",justifyContent:"center",alignItems:"center",fill:e.colors.BGSecondary,border:"1px solid",borderColor:e.colors.LineSecondary,borderRadius:"14px",cursor:"pointer",transform:"ltr"===e.direction?"unset":"rotateY(180deg)","> *":{color:e.colors.TextTertiaryAlt}}]),"label:DivIconShowMore;"),pt=(0,Ie.default)("div",{target:"e1vllrfx3"})((({theme:e})=>[{width:"28px",height:"28px",display:"flex",marginInlineEnd:"-4px",justifyContent:"center",alignItems:"center",fill:e.colors.BGSecondary,border:"1px solid",borderColor:e.colors.LineSecondary,borderRadius:"14px",cursor:"pointer",transform:"ltr"===e.direction?"unset":"rotateY(180deg)","> *":{color:e.colors.TextTertiaryAlt}}]),"label:DivIconShowLess;"),ut=(0,Ie.default)("div",{target:"e1vllrfx4"})((({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid",borderColor:"rgba(22, 24, 35, .12)",borderRadius:"50%",cursor:"pointer",width:e.isMobile?"54px":"62px",height:e.isMobile?"54px":"62px","&:hover":{opacity:.8}})),"label:DivIconButton;");var gt=o(94337);const ht={loginHome:"login",loginPhoneOrEmail:"login",loginPhone:"login",loginEmail:"login",loginPhonePassword:"login",loginDownloadApp:"login",loginTwoStepVerify:"login",loginForgetEmailPassword:"login",loginForgetPhonePassword:"login",loginQRcode:"login",loginSSO:"login",loginWithSignedEmail:"login",loginPhoneDigit:"login",loginReset:"login",loginGuestMode:"login",tvLoginHome:"login",tvLoginEmail:"login",tvLoginPhone:"login",phoneResetDigit:"login",emailResetDigit:"login",resetPassword:"login",signupHome:"signup",signupPhoneOrEmail:"signup",signupPhone:"signup",signupEmail:"signup",signupAgeGate:"signup",signupAgeGateConfirm:"signup",signupPolicyConfirm:"signup",signupCreateAccount:"signup",signupCreateUsername:"signup",signupCreatePassword:"signup",signupPrivateOn:"signup",signupPhoneDigit:"signup",signupEmailDigit:"signup",signupEmailCreatePassword:"signup",signupCountrySelector:"signup",signupInterestSelector:"signup",oauth:"delay_start_until_manually_called",oauthLine:"delay_start_until_manually_called",accountDeactivate:"delay_start_until_manually_called",logout:"delay_start_until_manually_called",linkPhoneOrEmail:"delay_start_until_manually_called",linkPhone:"delay_start_until_manually_called",linkEmail:"delay_start_until_manually_called",linkPhoneDigit:"delay_start_until_manually_called",linkEmailDigit:"delay_start_until_manually_called"},mt=e=>{const t=(0,j.Bd)(e);return t&&t.name in ht?ht[t.name]:"unknown"},_t=(e=!0)=>{const t=gt.Mh.useInstance(),o=(0,Ge.sZ)();return(0,A.useEffect)((()=>{!o&&e&&t.reportActualFMP()}),[t,e,o]),(0,A.useCallback)((()=>{o||t.reportActualFMP()}),[t,o])};var ft=o(45596),yt=o(30721),bt=o(32877),xt=o.n(bt),vt=o(88874),kt=o(64319),Ct=o(10336);function St(e,t){return(0,s.Ph)(kt.t,{selector:t=>{const o=t;return xt()(o,...e())},dependencies:t})}function wt(){const{ttpConfig:e}=St((()=>["ttpConfig"]),[]);let t=null;return(0,v.fU)()||(t=(0,vt.YI)(Ct.dI)),(0,A.useMemo)((()=>Object.assign(Object.assign({},null==t?void 0:t.config.ttpConfig),e)),[e,t])}var jt=o(21189);const Tt=1440,Pt=1920,Et=(0,Ie.default)("a",{target:"e15g97fd0"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont"}),{fontWeight:600,fontSize:"14px",lineHeight:"17px",display:"flex",alignItems:"center",WebkitTapHighlightColor:"transparent","&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${e.colors.Negative}`}}]),"label:AHelpTag;");Et.defaultProps=Object.assign(Object.assign({},Et.defaultProps),{"data-e2e":"feedback-entrance"});const Mt="24px",Lt=(0,Ie.default)(jt.A,{target:"e15g97fd1"})((({isMobileUiOptimize:e,theme:t})=>[{width:e?Mt:"20px",height:e?Mt:"20px",color:t.colors.TextTertiary,transform:"rtl"===t.direction?"rotateY(180deg)":"unset"},t.isMobile&&(0,Re.jJ)({min:Tt,style:{width:"32px",height:"32px"}})]),"label:StyledHelpIcon;"),At=(0,Ie.default)("span",{target:"e15g97fd2"})({marginInlineStart:"7px",color:"TextQuaternary"},"label:SpanHelpText;");var It;!function(e){e.ForYou="https://www.tiktok.com/foryou",e.Support="https://support.tiktok.com",e.Feedback="https://www.tiktok.com/feedback"}(It||(It={}));const Rt=(0,A.memo)((function(){var e;const t=(0,f.s)("WebApp_Login"),{forceLogin:o,phoenix:i}=St((()=>["forceLogin","phoenix"]),[]),{language:a}=(0,Ve.L$)((0,Ze.W)((()=>["language"]),[])),{isMobile:r}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{isMobileUiOptimize:s}=(0,y.Eo)(),d=function(){const e=(0,l.Nj)(T.$F),t=(0,A.useCallback)((t=>{var o;e.helpCenterClick({texts:(null===(o=t.target)||void 0===o?void 0:o.textContent)||"?",document_title:"login"})}),[e]);return t}(),p=o?`https://support.tiktok.com/${a}`:`https://www.tiktok.com/feedback/?lang=${a}`;return(null===(e=be([j.tH.signupPolicyConfirm,j.tH.signupPrivateOn,j.tH.signupAgeGateConfirm,j.tH.signupCreateAccount]))||void 0===e?void 0:e.isExact)||i?null:(0,n.jsxs)(Et,{href:p,target:"_blank",rel:"noopener noreferrer",className:"help-center",onClick:d,children:[(0,n.jsx)(Lt,{isMobileUiOptimize:s&&r}),!r&&(0,n.jsx)(At,{children:t("common_registration_feedback")})]})}));var Ft=o(93427),Ot=o(84987);const Dt={id:"logo-with-text-34b02873",use:"logo-with-text-34b02873-usage",viewBox:"0 0 150 37",content:''};function Ht(e){const t=(0,A.useContext)(Ot.X);return(0,A.useLayoutEffect)((()=>(t.add(Dt),()=>{t.remove("logo-with-text-34b02873")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#logo-with-text-34b02873"},void 0)}),void 0)}const Ut=(0,Ie.default)("header",{target:"e1x3uhsi0"})((({isMobileUiOptimize:e,theme:t})=>[{position:"fixed",width:"100%",top:0,left:0,height:e?52:44,background:`${t.colors.BGPrimary}`,padding:"0 16px",zIndex:2},(0,Re.jJ)({min:Tt,style:{height:"80px"}})]),"label:HeaderWrapper;"),Nt=(0,Ie.default)("div",{target:"e1x3uhsi1"})((({align:e,isMobileUiOptimize:t,theme:o})=>[(0,Re.mp)({direction:o.direction,start:"left"===e?"16px":"unset",end:"right"===e?"16px":"unset"}),{display:"flex",alignItems:"center",fontSize:t?"24px":"20px",position:"absolute",top:"12px"},(0,Re.jJ)({min:Tt,style:[{top:"24px"},(0,Re.mp)({direction:o.direction,start:"left"===e?"48px":"unset",end:"right"===e?"48px":"unset"})]})]),"label:DivIcon;"),Bt=(0,Ie.default)($e.A,{target:"e1x3uhsi2"})((({theme:e})=>[{transform:"rtl"===e.direction?"rotateZ(180deg)":"unset"},(0,Re.jJ)({min:Tt,style:{width:"32px",height:"32px"}})]),"label:StyledBackIcon;"),$t=(0,Ie.default)(a.A,{target:"e1x3uhsi3"})([(0,Re.jJ)({min:Tt,style:{width:"32px",height:"32px"}})],"label:StyledXMark;"),zt=(0,Ie.default)("div",{target:"e1x3uhsi4"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),{fontSize:"17px",textAlign:"center",lineHeight:"44px",fontWeight:700}]),"label:DivTitle;");zt.defaultProps=Object.assign(Object.assign({},zt.defaultProps),{"data-e2e":"header-text"});const Wt=(0,Ie.default)("div",{target:"e1x3uhsi5"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont"}),{position:"absolute",left:"50%",transform:"translateX(-50%)"},(0,Re.jJ)({min:Tt,style:{top:"192px"}}),(0,Re.Ee)({max:720,style:{top:"56px"}}),(0,Re.Ee)({min:1770,style:{top:"537px"}})]),"label:DivLogoWithText;"),Gt=({title:e,showClose:t,showLeft:o=!0,showRight:i=!0,backIcon:a=!0,LeftIcon:r,onClose:s})=>{const{language:d,env:c}=(0,Ve.L$)((0,Ze.W)((()=>["language","env"]),[])),{redirectUrl:p,hideHomePage:u}=St((()=>["redirectUrl","hideHomePage"]),[]),{isMobileUiOptimize:g}=(0,y.Eo)(),{pathname:h}=ye(),m=(0,Ft.$H)(h),_=be([j.tH.loginPhoneOrEmail])&&u,f=(0,l.Nj)(T.$F),{isTtincar:b}=(0,yt.Qt)(),x=fe(),v=(0,A.useCallback)((()=>{t?(f.loginNotifyClose({isSignUp:m?"1":"0",e2eInfo:k.nf.getTrackingInfo()}),s?s():(0,Ft.ik)(d,"boe"===(null==c?void 0:c.type),p)):x.goBack()}),[x,t,s,d,p,c,Ft.$H]),C=(0,A.useCallback)((()=>r?(0,n.jsx)(r,{}):t?(0,n.jsx)($t,{"data-e2e":"close-btn"}):a?(0,n.jsx)(Bt,{"data-e2e":"back-btn"}):null),[r,a,t]),S={isMobileUiOptimize:g};return(0,n.jsxs)(Ut,Object.assign({},S,{children:[!_&&o&&(0,n.jsx)(Nt,Object.assign({align:"left",onClick:v},S,{children:C()})),!b&&e&&(0,n.jsx)(zt,{children:e}),b&&(0,n.jsx)(Wt,{children:(0,n.jsx)(Ht,{width:152,height:35})}),!u&&i&&(0,n.jsx)(Nt,Object.assign({align:"right"},S,{children:(0,n.jsx)(Rt,{})}))]}))};var Vt=o(71507),Kt=o(48268);let qt,Zt;function Jt(e,t,o,n){var i,a;if(e>t)return n;const r=Math.floor((e+t)/2);Zt||(qt=document.createElement("canvas"),Zt=qt.getContext("2d"));const s=window.getComputedStyle(o),l=null!==(i=s.fontWeight)&&void 0!==i?i:"",d=null!==(a=s.fontFamily)&&void 0!==a?a:"";return Zt.font=`${l} ${r}px ${d}`,Math.ceil(Zt.measureText(o.innerText).width){r(Jt(t,e,i.current,0))}),[e,t]);return(0,A.useEffect)((()=>(window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)})),[l]),(0,A.useEffect)((()=>{r(Jt(t,e,i.current,0))}),[e,t,o]),(0,n.jsx)("div",{ref:i,style:s,children:o})},Qt="rgb(208, 209, 211)",Xt="rgb(227, 227, 229)",eo=({theme:e,buttonTheme:t})=>{switch(t){case"default":return{borderWidth:"1px",borderStyle:"solid",color:e.colors.TextPrimary,borderColor:e.colors.LineSecondary2,backgroundColor:e.colors.BGSecondary2,":hover":{borderColor:Qt,backgroundColor:e.colors.BGCreation3},":active":{borderColor:Qt,backgroundColor:e.colors.BGMessageIcon},":disabled":{borderColor:Xt,backgroundColor:e.colors.BGSecondary2,color:e.colors.TextQuaternary}};case"line":return{borderWidth:"1px",borderStyle:"solid",color:e.colors.Primary,borderColor:e.colors.Primary,backgroundColor:e.colors.BGSecondary2,":hover":{backgroundColor:"rgba(254, 44, 85, 0.06)"},":active":{backgroundColor:"rgba(254, 44, 85, 0.16)"},":disabled":{borderColor:e.colors.LineSecondary2,backgroundColor:e.colors.BGSecondary2,color:e.colors.TextQuaternary,pointerEvents:"none"}};case"primary":return{border:"none",color:e.colors.ConstTextInverse,backgroundColor:e.colors.Primary,":hover":{background:"linear-gradient(0deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06)), #FE2C55"},":active":{background:"linear-gradient(0deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12)), #FE2C55"},":disabled":{border:"none",color:e.colors.TextQuaternary,backgroundColor:e.colors.BGInput2,pointerEvents:"none"}};case"secondary":return{border:"none",color:e.colors.TextPrimary,backgroundColor:e.colors.BGSecondary2,":hover":{borderColor:Qt,backgroundColor:e.colors.BGCreation3},":active":{borderColor:Qt,backgroundColor:e.colors.BGMessageIcon},":disabled":{borderColor:Xt,backgroundColor:e.colors.BGSecondary2,color:e.colors.TextQuaternary}};default:return{":hover":{},":active":{},":disabled":{}}}},to=O.i7` 0%, 100% { opacity: 1; } 50% { opacity: 0.31; } `,oo=(0,Ie.default)("div",{target:"e1cgu1qo0"})((({theme:e,isSmallText:t,isPopup:o,isMobileUiOptimize:n,buttonTheme:i="default",showFlashingButton:a})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold",fontFamily:"TikTokFont"}),{fontSize:t?"13px":"15px",borderRadius:"8px",padding:"0 12px",display:"flex",alignItems:"center",justifyContent:"center",height:"44px",position:"relative",cursor:"pointer",marginBottom:o?"8px":"12px",wordBreak:"keep-all",whiteSpace:"nowrap",background:e.colors.BGTertiary,animation:a?`${to} 0.3s linear 2`:"none"},n&&{marginBottom:o?"":"12px"},e.isMobile&&(0,Re.jJ)({min:Pt,style:{height:"72px",marginBottom:"24px",padding:"0 16px",fontSize:"24px"}}),eo({theme:e,buttonTheme:i})]),"label:DivBoxContainer;");oo.defaultProps=Object.assign(Object.assign({},oo.defaultProps),{"data-e2e":"channel-item"});const no=(0,Ie.default)("div",{target:"e1cgu1qo1"})((({theme:e,isMobileUiOptimize:t})=>[(0,Re.mp)({direction:e.direction,start:"12px"}),{fontSize:t?"24px":"20px",position:"absolute",display:"flex"},e.isMobile&&(0,Re.jJ)({min:Pt,style:[{fontSize:"40px"},(0,Re.mp)({direction:e.direction,start:"24px"})]})]),"label:DivIconContainer;"),io=(0,Ie.default)("div",{target:"e1cgu1qo2"})((({theme:e,theme:{direction:t,colors:o}})=>[(0,Re.zy)({theme:e,color:"ConstTextInverse"}),{height:"16px",padding:"0 8px",borderRadius:"ltr"===t?"10px 10px 10px 2px":"10px 10px 2px 10px",backgroundColor:o.Secondary,fontSize:"11px",lineHeight:"16px",fontWeight:600,marginTop:"-8px",marginBottom:"-8px",width:"fit-content",marginInlineStart:"auto",marginInlineEnd:"12px",position:"relative",zIndex:1},(0,Re.mp)({direction:t})]),"label:DivLastLoginMethodContainer;"),ao=(0,Ie.default)("div",{target:"e1cgu1qo3"})((({theme:e})=>[{width:`calc(100% - ${e.isMobile?72:64}px)`,textAlign:"center"}]),"label:DivTextContainer;"),ro=(0,Ie.default)("span",{target:"e1cgu1qo4"})({animation:"spin-animation 1s linear infinite",display:"inline-block",width:24,height:24,verticalAlign:"middle"},{"@keyframes spin-animation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}},"label:SpanSpin;"),so=e=>{const{text:t,Icon:o,focusable:i,onClick:a,isPopup:r,customStyles:s,buttonTheme:l,floatingBannerText:d,showFlashingButton:p,loading:u=!1,effect:g}=e,h=(0,A.useRef)(null),[m,_]=(0,A.useState)(!1),{isMobile:f}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{isMobileUiOptimize:b}=(0,y.Eo)(),x=(0,A.useMemo)((()=>({isMobileUiOptimize:f&&b})),[]);(0,A.useEffect)((()=>{null==g||g()}),[]),(0,A.useEffect)((()=>{var e,t,o;(null!==(o=null===(t=null===(e=h.current)||void 0===e?void 0:e.getBoundingClientRect())||void 0===t?void 0:t.width)&&void 0!==o?o:0)>=292&&_(!0)}),[u]);const[v,k]=(0,A.useState)(d);(0,A.useEffect)((()=>{k(d)}),[d]);const C=(0,A.useCallback)((()=>{null==a||a()}),[a]),S=(0,A.useCallback)((e=>{i&&13===e.keyCode&&C()}),[i,C]);return(0,n.jsxs)("div",{children:[v?(0,n.jsx)(io,{children:v}):(0,n.jsx)(io,{hidden:!0}),(0,n.jsxs)(oo,Object.assign({onClick:u?void 0:C,onKeyDown:u?void 0:S,tabIndex:i?0:void 0,isSmallText:m,isPopup:r,role:"link",style:s,buttonTheme:null!=l?l:"default",showFlashingButton:p},x,{children:[o&&(0,n.jsx)(no,Object.assign({},x,{children:(0,n.jsx)(o,{})})),(0,n.jsx)(ao,{ref:h,children:u?(0,n.jsx)(ro,{children:(0,n.jsx)(Kt.L,{size:24})}):(0,n.jsx)(Yt,{max:15,text:t})})]}))]})};var lo=o(96689),co=o(49343),po=o.n(co);const uo=(e,t,o,n)=>e?"qr_bottom_right"===e?"164px":"sso"===e||"qr"===e?"312px":"375px":n?"475px":t?"435px":o?"375px":"363px",go=(0,Ie.default)("div",{target:"exd0a430"})((({isMobile:e,popupType:t,isCountrySelector:o,isGuestModeRedesign:n,isInterestSelector:i})=>({width:uo(t,o,n,i),margin:"auto",padding:e?"0 30px":"unset",marginTop:o||n||"qr_bottom_right"===t?"unset":"64px"})),"label:DivLoginContainer;"),ho=(0,Ie.default)("div",{target:"exd0a431"})((({isMobile:e})=>({padding:e?"0 30px":"unset"})),"label:DivHomeContainer;"),mo=(0,Ie.default)("div",{target:"exd0a432"})((({isMobileUiOptimize:e,theme:t})=>[(0,Re.zy)({theme:t,color:"TextQuaternary"}),e&&{color:"rgba(0, 0, 0, 0.56)"},{fontSize:"15px",lineHeight:"18px",margin:"0px 0 20px",textAlign:"center"},t.isMobile&&(0,Re.jJ)({min:Pt,style:{fontSize:"24px",lineHeight:"38px",margin:"0 0 24px"}})]),"label:DivDescriptionContainer;"),_o=(0,Ie.default)("h2",{target:"exd0a433"})((({theme:e,isMobileUiOptimize:t})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:t?"TikTokFont":"TikTokDisplayFont"}),{fontSize:e.isMobile?"24px":"33px",margin:e.isMobile?"16px auto":"64px auto 16px",fontWeight:"bold",textAlign:"center"},e.isMobile&&(0,Re.jJ)({min:Pt,style:[{margin:"unset",fontSize:"32px",lineHeight:"48px"},(0,Re.zy)({theme:e,fontFamily:"TikTokFont"})]})]),"label:H2Title;"),fo=(0,Ie.default)("div",{target:"exd0a434"})((({hideGuestMode:e,isModal:t})=>[{overflowY:"scroll",padding:"10px 5px 2px 13px",height:t?e?"368px":"256px":"unset"}]),"label:DivLoginOptionContainer;"),yo=(0,Ie.default)("div",{target:"exd0a435"})({padding:"0px 5px 2px 13px",marginBottom:"16px"},"label:DivLoginOptionContainerRedesign;"),bo=(0,Ie.default)("div",{target:"exd0a436"})({width:"337px",margin:"auto",height:"44px"},"label:DivGuestModeContainer;"),xo=(0,Ie.default)("div",{target:"exd0a437"})({width:"337px",margin:"10px 0px 30px 12px"},"label:DivOtherOptionsContainer;");var vo=o(65504),ko=o(34411);function Co(){var e,t;const{region:o}=(0,s.Ph)(ko.H),{region:n}=(0,Ve.L$)((0,Ze.W)((()=>["region"]),[]));return null!==(t=null===(e=null==o?void 0:o.countryCode)||void 0===e?void 0:e.toUpperCase())&&void 0!==t?t:n}function So(){const{ageGateAction:e}=(0,s.Ph)(Te.T),t=Co(),{isMobile:o}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[]));return o&&0!==e?j.tH.signupAgeGate:"KR"===t?j.tH.signupPolicyConfirm:j.tH.signupPhone}const wo=(0,Ie.default)("a",{target:"epl6mg0"})((({theme:e,textTheme:t,underline:o=!0})=>[(0,Re.zy)({theme:e,color:"primary"===t?"Primary":"TextSecondary",fontWeight:"semiBold"}),{fontSize:"12px","&:hover, &:focus":{textDecoration:o?"underline":"none",textDecorationColor:"primary"===t?e.colors.Primary:e.colors.TextSecondary},"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px auto ${e.colors.Negative}`}}]),"label:ALink;"),jo=({path:e,text:t,children:o,className:i,replace:a=!1,textTheme:r,underline:s,isJumpOutside:l=!1,target:d,onClick:c})=>{const p=fe(),u=(0,A.useCallback)((t=>{l||(t.preventDefault(),t.stopPropagation(),null==c||c(),"_blank"!==d?a?p.replace(e):p.push(e):window.open(e,"_blank"))}),[p,e,a,c]);return(0,n.jsxs)(wo,{onClick:u,href:e,className:i,textTheme:r,underline:s,children:[t,o]})},To=(0,Ie.default)("div",{target:"e1b6crsh0"})((({theme:e,isMobileUiOptimize:t,isModal:o})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),({popupType:n})=>[{height:n?"52px":"64px",borderTop:e.isMobile||n?"none":`0.5px solid ${e.colors.LineSecondary}`,display:"flex",justifyContent:"center",position:e.isMobile?"unset":o?"absolute":"relative",bottom:e.isMobile?"unset":"0",alignItems:"center",fontSize:"15px",lineHeight:"18px",width:o&&!n?"483px":"100%"},t&&{borderTop:"0.5px solid rgba(22, 24, 35, 0.12)"},e.isMobile&&(0,Re.jJ)({min:Pt,style:{height:"64px !important",fontSize:"28px",lineHeight:"44px"}})]]),"label:DivContainer;"),Po=(0,Ie.default)("span",{target:"e1b6crsh1"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,marginStart:"5px"}),{fontWeight:600,fontSize:"15px",lineHeight:"18px",color:e.colors.Primary},e.isMobile&&(0,Re.jJ)({min:Pt,style:{fontWeight:700,fontSize:"28px",lineHeight:"44px"}})]),"label:SpanLinkText;"),Eo=(0,A.memo)((function({style:e,isPopup:t,isButtonStyle:o=!1}){var i,a,r;const{disableSignup:l,hideHomePage:d}=St((()=>["disableSignup","hideHomePage"]),[]),{isMobile:p}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{loginModalShow:u,popupType:g}=(0,P.mZ)((e=>({loginModalShow:e.loginModalShow,popupType:e.popupType})),F.bN),[{loginModalSwitchPath:h},m]=(0,s.Su)(_),{redirectUrl:b,loginType:x}=(0,s.Ph)(kt.t),v=(0,f.s)("WebApp_Login"),{pathname:k,search:C}=ye(),{isMobileUiOptimize:S}=(0,y.Eo)(),{abTestVersion:w}=null!==(i=(0,Ze.W)((()=>["abTestVersion"]),[]))&&void 0!==i?i:{},T=null!==(a=(0,Ye.qt)(w,"login_modal_ui_revamp"))&&void 0!==a?a:"v1",E=null===(r=be([j.tH.signupAgeGateConfirm,j.tH.signupCreateAccount]))||void 0===r?void 0:r.isExact,M=be(d?[j.tH.loginPhoneOrEmail,j.tH.signupPhoneOrEmail]:[j.tH.loginHome,j.tH.signupHome]),I=p&&!d?null==M?void 0:M.isExact:M&&!E,R=k.includes("signup"),O=v(R?"common_registration_panel_entry_1":"common_login_panel_entry_1"),D=So(),H="KR"===Co()?j.tH.signupPolicyConfirm:j.tH.signupHome,U=d&&"v1"===T?D:H;let N=d?j.tH.loginPhoneOrEmail:j.tH.loginHome;"tv"===x&&b.includes("?")&&"1"===po().parse(b.split("?")[1]).login_improvements&&(N=j.tH.tvLoginHome);const B=`${R?N:U}${C}`,$=(0,lo.K)({query:{enter_method:"sso_auto_popup"},loginPath:"/signup"}),z=(0,A.useCallback)((()=>{!h&&m.setLoginModalSwitchPath(!0)}),[m,h]);return o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ft.bm,{children:[(0,n.jsx)(ft.t_,{}),(0,n.jsx)(ft.CA,{children:O.replace("%s"," ")}),(0,n.jsx)(ft.t_,{})]}),(0,n.jsx)(bo,{children:(0,n.jsx)(jo,{path:B,onClick:t?$:z,textTheme:"primary",replace:!1,"data-e2e":"botton-sign-up",underline:!1,children:(0,n.jsx)(so,{text:v(R?"common_registration_panel_entry_2":"common_registration_username_button"),onClick:L(),buttonTheme:"line",focusable:!0},"login-guest-button")})})]}):l||!I?null:(0,n.jsxs)(To,{popupType:g,isModal:u,style:e,isMobileUiOptimize:S&&p,children:[(0,n.jsx)("div",{"data-e2e":"bottom-text",children:O.replace("%s"," ")}),(0,n.jsx)(jo,{path:B,onClick:t?$:z,textTheme:"primary",replace:"v1"===T&&u,"data-e2e":"botton-sign-up",children:(0,n.jsx)(Po,{"data-e2e":R?"bottom-login":"bottom-sign-up",children:v(R?"common_registration_panel_entry_2":"common_registration_username_button")})})]})}));var Mo=o(97046);const Lo=function({children:e}){const{isSmartPlayer:t}=(0,yt.Qt)();return t?null:e};var Ao=o(85997),Io=o(44205);const Ro=o.p+"b39f863c2f9173bc73db.png";var Fo=o(24983),Oo=o(24572),Do=o(44606),Ho=o(3247),Uo=o(35572),No=o(8536),Bo=o(63700),$o=o(23999),zo=o(80339),Wo=o(20259),Go=o(26324),Vo=o(7672),Ko=o(55099);let qo=class{constructor(e){this.fetch=e}getStrategy({language:e}){return this.fetch.get("/tiktok/linker/component/strategy/get/v1/",{query:{biz_name:"Webapp",page_name:"CTA",language:e,wrappers:JSON.stringify([{name:"wrapper_foryou",params:{url_scheme_params:{},url_fallback_params:{}}}])},baseUrlType:2})}};var Zo;qo=(0,u.__decorate)([(0,Vo._)(),(0,u.__metadata)("design:paramtypes",[Ko.p])],qo);let Jo=class extends g.E{constructor(e){super(),this.service=e,this.defaultState={linkerStrategy:void 0}}setStrategy(e,t){e.linkerStrategy=t}getStrategy(e){return e.pipe((0,Uo.p)((e=>this.service.getStrategy({language:e}).pipe((0,No.Z)((({status_code:e,strategy:t={}})=>{const o=0===e?t:{};return(0,Bo.h)((0,$o.of)(this.getActions().setStrategy(o)))})),(0,zo.q)(this.terminate()),(0,Wo.W)((()=>(0,$o.of)(this.noop())))))))}};(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,"function"==typeof(Zo="undefined"!=typeof ILinkerComponentStrategyStruct&&ILinkerComponentStrategyStruct)?Zo:Object]),(0,u.__metadata)("design:returntype",void 0)],Jo.prototype,"setStrategy",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",Go.c)],Jo.prototype,"getStrategy",null),Jo=(0,u.__decorate)([(0,m.n)("CtaModule"),(0,u.__metadata)("design:paramtypes",[qo])],Jo);const Yo=({appType:e,jumpTime:t},o)=>{Ho.u.jump({app_type:e,jump_time:t,status:o?0:1})},Qo=(0,A.memo)((({children:e})=>{const[t,o]=(0,s.Su)(Jo,{selector:e=>e.linkerStrategy,dependencies:[]}),{language:i}=(0,Ve.L$)((0,Ze.W)((()=>["wid","region","language"]),[])),{onelinkParams:a,schemeParams:r}=(0,Do.mE)({downloadType:"app_launch"}),l=(0,A.useCallback)((e=>{Ao.jA.handleDownloadConfirm({enter_method:"app_launch"}),Yo(e,!0)}),[]),d=(0,A.useCallback)((e=>{Yo(e,!1)}),[]);return(0,A.useEffect)((()=>{t||o.getStrategy(i)}),[o,t,i]),(0,n.jsx)(Fo.p,{strategy:t,enableApiOptimization:!0,checkOpenTime:50,children:(0,n.jsx)(Oo.F,{schemeParams:r,fallbackURLParams:a,target:"wrapper_foryou",jumpStartHandler:l,jumpFailHandler:d,children:e})})})),Xo=(0,Ie.default)("div",{target:"euo5c20"})({zIndex:1008,width:"100%",borderRadius:"8px 8px 0 0 ",backgroundColor:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, .06)","&.middle":{width:"310px",borderRadius:"8px"}},"label:DivCtaGuideContainer;"),en=(0,Ie.default)("div",{target:"euo5c21"})({position:"absolute",top:0,left:"50%",width:"64px",height:"64px",padding:"4px",boxSizing:"border-box",borderRadius:"100%",backgroundColor:"#f8f8f8",transform:"translate(-50%, -50%)","& img":{borderRadius:"100%"}},"label:DivIconContainer;"),tn=(0,Ie.default)("div",{target:"euo5c22"})({boxSizing:"border-box",width:"100%",padding:"48px 20px 20px",textAlign:"center"},"label:DivInfoContainer;"),on=(0,Ie.default)("p",{target:"euo5c23"})((({theme:e})=>(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold"})),{fontSize:"20px",lineHeight:"24px"},"label:PGuideTitle;"),nn=(0,Ie.default)("p",{target:"euo5c24"})((({theme:e})=>(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"normal",color:"TextSecondary"})),{marginTop:"12px",fontSize:"15px",lineHeight:"18px"},"label:PGuideDesc;"),an=(0,Ie.default)("div",{target:"euo5c25"})((({paddingBottom:e})=>({boxSizing:"border-box",width:"100%",padding:"0 20px 20px",paddingBottom:e,textAlign:"center"})),"label:DivGuideBtnContainer;"),rn={width:"100%",height:"44px",border:"none",fontSize:"15px",lineHeight:"44px"},sn=(0,Ie.default)("button",{target:"euo5c26"})((({theme:e})=>(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold",color:"ConstTextInverse"})),Object.assign(Object.assign({},rn),{borderRadius:"2px",backgroundColor:"#fe2c55"}),"label:ButtonOpenTT;"),ln=(0,Ie.default)("button",{target:"euo5c27"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"normal"}),Object.assign(Object.assign({},rn),{backgroundColor:"#fff",marginTop:"2px",color:e.colors.ConstTextPrimary})]),"label:ButtonRefuseOrLogin;"),dn={padding:"0"},cn=(0,A.memo)((()=>{const{title:e,desc:t,btnText:o,notNow:i}=(()=>{const e=(0,f.s)("WebApp_Login"),t=e("optimize_web_open_notnow_cta");return{btnText:e("optimize_web_open_tiktok_cta"),title:e("optimize_web_full_app_header"),desc:e("optimize_web_full_app_body"),notNow:t}})(),[a,r]=(0,A.useState)(!1),{isBot:l}=(0,Ve.L$)((0,c.U)((()=>["isBot"]),[])),{noCtaPopup:d}=(0,s.Ph)(kt.t),p=(0,A.useCallback)((e=>()=>{r(!1),Ao.jA.handleDownloadDismiss({modal_type:"bottom_sheet",enter_method:"app_launch",dismiss_method:e})}),[]),u=(0,A.useCallback)(((e,t)=>{p("icon"===t?"x_close":"click_mask")()}),[p]);return(0,A.useEffect)((()=>{const e=!(0,C.Hd)(Mo.j0),{referrer:t}=document,o=performance.getEntriesByType("navigation")[0],n=o&&o instanceof PerformanceNavigationTiming&&o.redirectCount>0;d||l||!e||t.includes(".tiktok.com")||n||(r(!0),(0,C.J2)(Mo.j0,"1"),Ao.jA.handleDownloadShow({modal_type:"bottom_sheet",enter_method:"app_launch"}))}),[l]),(0,n.jsx)(Io.l,{visible:a,contentStyle:dn,closeable:!1,onClose:u,children:(0,n.jsxs)(Xo,{"data-e2e":"bottom-cta-container",children:[(0,n.jsx)(en,{"data-e2e":"bottom-cta-icon",children:(0,n.jsx)("img",{src:Ro,width:56,height:56})}),(0,n.jsxs)(tn,{children:[(0,n.jsx)(on,{"data-e2e":"bottom-cta-title",children:e}),(0,n.jsx)(nn,{"data-e2e":"bottom-cta-desc",children:t})]}),(0,n.jsxs)(an,{children:[(0,n.jsx)(Lo,{children:(0,n.jsx)(Qo,{children:(0,n.jsx)(sn,{"data-e2e":"bottom-cta-confirm-btn",children:o})})}),(0,n.jsx)(ln,{"data-e2e":"bottom-cta-cancel-btn",onClick:p("not_now"),children:i})]})]})})}));var pn=o(47236);const un=(0,pn.Ay)({resolved:{},chunkName:()=>"login-tip-modal",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!o.m[t]},importAsync:()=>Promise.all([o.e(8873),o.e(2514)]).then(o.bind(o,73212)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return o(t)},resolve:()=>73212});var gn=o(99659),hn=o(89570),mn=o(47538);const _n=()=>{const e=(0,l.Nj)(gt.VU),t=(0,f.s)("WebApp_Login"),o=(0,l.Nj)(T.$F);return(0,A.useCallback)(((n=k.nf.getTrackingInfo())=>{o.failToOpenApp({message:"cannot_open_app",e2eInfo:n}),e.emitOnce("noTTApp_toast",{}),(0,mn.P)(t("webLogin_useApp_noTTApp_toast"))}),[])};function fn(){const e=(0,l.Nj)(T.$F),t=(0,l.Nj)(gt.le);return(0,A.useCallback)((o=>{const n=k.nf.getTrackingInfo(),{platform:i,signUp:a,forgetPwd:r}=o;e.setPlatform(i),e.loginSubmit({signUp:a,e2eInfo:n}),t.setPlatform(i),t.loginSubmit({signUp:a,forgetPwd:r})}),[t,e])}function yn(){const e=(0,l.Nj)(T.$F),t=(0,l.Nj)(gt.le);return(0,A.useCallback)((o=>{const n=k.nf.getTrackingInfo(),{platform:i,isSignUp:a}=o;e.setPlatform(i),e.clickLoginOption({isSignUp:a,e2eInfo:n}),t.setPlatform(i),t.clickLoginOption({isSignUp:a})}),[e,t])}const bn=()=>{const{ttpConfig:e}=St((()=>["ttpConfig"]),[]),{startOneTapPolling:t,stopOneTapPolling:o,updateState:n}=(0,s.wA)(gn.q),i=()=>n({authStatus:"stop",authErrorCode:void 0});return{startPollingAndShowPollingPopup:o=>{n({authStatus:"in_progress_with_popup",lastUsedToken:o}),t({token:o,ttpConfig:e,isCountInAppViewedStatus:!1})},stopPolling:()=>{o(),i()},setStopOneTapStatus:i,startPolling:o=>{n({authStatus:"in_progress",lastUsedToken:o}),t({token:o,ttpConfig:e,checkLastUsedToken:!0,isCountInAppViewedStatus:!0})}}},xn=["dev_awrxudrcbk09y7wi"],vn=()=>{var e,t,o;const{enableOneTapFromQuery:n,standaloneAid:i}=St((()=>["enableOneTapFromQuery","standaloneAid"]),[]),a=null!==(t=null===(e=(0,rt.parse)(ye().search))||void 0===e?void 0:e.enter_from)&&void 0!==t?t:"",{abTestVersion:r}=(0,Ve.L$)((0,Ze.W)((()=>["abTestVersion"]),[])),s=null!==(o=(0,Ye.V7)(r,"all_one_tap_login"))&&void 0!==o?o:"v0",{isAndroid:l}=(0,Ve.L$)((0,c.U)((()=>["isAndroid"]),[])),d=(0,hn.Jc)();return!(i||xn.includes(a)||!n&&"v0"===s||l&&"ucbrowser"===d)},kn=()=>{var e;const{pathname:t}=ye(),o=(0,Ft.$H)(t),n=fn(),i=yn(),{abTestVersion:a,appType:r="t"}=(0,Ve.L$)((0,Ze.W)((()=>["abTestVersion","appType"]),[])),d=null!==(e=(0,Ye.qt)(a,"one_tap_ios_deep_link"))&&void 0!==e?e:"v0",{ttNotInstalled:p}=(0,Ve.L$)(St((()=>["ttNotInstalled"]),[])),{isAndroid:u}=(0,Ve.L$)((0,c.U)((()=>["isAndroid"]),[])),{getOneTapToken:g,stopRefreshToken:h}=(0,s.wA)(gn.q),{universalLink:m,token:_,lastUsedToken:y,getTokenLoading:b,getTokenErrorCode:x,authStatus:v}=(0,s.Ph)(gn.q),{startPolling:C,stopPolling:S}=bn(),w=(0,l.Nj)(T.$F),j=(0,l.Nj)(gt.VU),P=(0,f.s)("WebApp_Login"),E=_n(),M=()=>i({platform:"tiktok",isSignUp:o});if(!m||!_)return()=>{M(),(0,mn.P)(P("Sorry, something went wrong, please try again later")),w.failToOpenApp({message:"try_again",error_code:null==x?void 0:x.toString(),e2eInfo:k.nf.getTrackingInfo()}),b||(h(),g())};const L=()=>{w.failToOpenApp({message:"app_not_opened",e2eInfo:k.nf.getTrackingInfo()}),j.emitOnce("appNotOpened_toast",{}),(0,mn.P)(P("webLogin_useApp_appNotOpened_toast"))},A=()=>{location.href=m},I=({redirectTimeoutDuration:e,onRedirectTimeout:t})=>{var o;try{const e="t"===r?"snssdk1180":"snssdk1233",t=null!==(o=new URL(m).searchParams.get("redirect_url"))&&void 0!==o?o:"";window.location.href=`${e}://webview?url=${encodeURIComponent(t)}`}catch(e){console.error("Error when launching by schema",e)}finally{let o;const n=()=>{"hidden"===document.visibilityState&&clearTimeout(o)};o=setTimeout((()=>{"hidden"!==document.visibilityState&&(document.removeEventListener("visibilitychange",n),t())}),e),document.addEventListener("visibilitychange",n,{once:!0})}},R=(e=1e3)=>I({redirectTimeoutDuration:e,onRedirectTimeout:L});return()=>{if(M(),n({platform:"tiktok",signUp:o}),u?(()=>{const e=(0,hn.Jc)();hn.Fq.includes(e)?A():hn.qs.includes(e)?I({redirectTimeoutDuration:1e3,onRedirectTimeout:E}):R()})():(()=>{switch(d){case"v1":return p;case"v2":return"1"===localStorage.getItem(hn.pq);case"v3":return"1"===sessionStorage.getItem(hn.pq);default:return!1}})()?R(1200):A(),y!==_)return S(),void C(_);"stop"===v&&C(_)}},Cn=A.lazy((()=>o.e(1530).then(o.bind(o,77739)))),Sn=A.lazy((()=>Promise.all([o.e(9443),o.e(9378)]).then(o.bind(o,79477)))),wn=A.lazy((()=>o.e(5622).then(o.bind(o,87781)))),jn=()=>(0,n.jsx)(S.aF,{visible:!0,mask:!1,type:"mobile",backgroundColor:"transparent",children:(0,n.jsx)(Ee.R,{size:"small"})}),Tn=()=>{const{authStatus:e}=(0,s.Ph)(gn.q),t="in_progress_with_popup"===e,o="failed"===e,{isLoginSuccessPopupVisible:i}=(0,s.Ph)(gn.q),{stopPolling:a,setStopOneTapStatus:r}=bn();(0,A.useEffect)((()=>a),[]);const l=(0,A.useMemo)((()=>t?(0,n.jsx)(jn,{}):null),[t]),d=(0,A.useMemo)((()=>o?(0,n.jsx)(jn,{}):null),[o]),c=(0,A.useMemo)((()=>i?(0,n.jsx)(jn,{}):null),[i]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.Suspense,{fallback:l,children:(0,n.jsx)(Cn,{visible:t,onClose:a})}),(0,n.jsx)(A.Suspense,{fallback:d,children:(0,n.jsx)(Sn,{visible:o,onClose:r})}),(0,n.jsx)(A.Suspense,{fallback:c,children:(0,n.jsx)(wn,{visible:i})})]})};var Pn=o(57739),En=o(38731),Mn=o(92249),Ln=o(60182),An=o(91272),In=o(92662),Rn=o(40815),Fn=o(97413),On=o(55714),Dn=o(95748),Hn=o(13326),Un=o.n(Hn),Nn=o(340),Bn=o(64356),$n=o(54888),zn=o(42583),Wn=o(62564),Gn=o(68628),Vn=o(24451),Kn=o(74690),qn=o(46657),Zn=o(14270),Jn=o(52913),Yn=o(59622),Qn=o(8350);const Xn=new class{constructor(){this.generateRandomString=e=>{const t=(0,Qn.A)();return(0,C.AP)(`${e}-auth`,t),t},this.getRandomString=e=>(0,C._S)(`${e}-auth`),this.clearData=e=>{(0,C.sc)(`${e}-auth`)}}};var ei=o(32066);const ti=(e,t)=>{const o=(n=e,`${Zn.wW}:${n}`);var n;const i={timestamp:Number(new Date),timeInterval:6e5},a=Object.assign(Object.assign({},t),{expires:i});(0,C.AP)(o,JSON.stringify(a)),(0,C.AP)(e,JSON.stringify(a))},oi=e=>{const t=(0,C._S)(e);try{return JSON.parse(t)}catch(e){return{}}},ni=()=>{const e=(0,rt.stringifyUrl)({url:`${window.location.origin}/oauth/?page=new`,query:{platform:["twitter"],oauthType:0,lang:"en"}});return(0,rt.stringifyUrl)({url:"https://login-us.www.tiktok.com/passport/web/web_login/",query:{platform_app_id:Zn.iU.twitter,platform:["twitter"],aid:Vt.dd,next:encodeURIComponent(e),action:"login_only"}})},ii=()=>(0,rt.stringifyUrl)({url:"https://access.line.me/oauth2/v2.1/authorize",query:{response_type:"code",client_id:Zn.Dt,redirect_uri:`${window.location.origin}/oauthLine/`,state:Xn.generateRandomString("line"),scope:"openid profile"}}),ai=()=>(0,rt.stringifyUrl)({url:"https://oauth.vk.com/authorize",query:{display:"page",response_type:"token",client_id:Zn.g9,redirect_uri:"https://www.tiktok.com/login/",scope:"offline, v",state:Xn.generateRandomString("vk")}}),ri=()=>(0,rt.stringifyUrl)({url:"https://kauth.kakao.com/oauth/authorize",query:{response_type:"code",client_id:Zn.qo,redirect_uri:"https://www.tiktok.com/login",state:JSON.stringify({platform:"kakaotalk",auth:Xn.generateRandomString("kakaotalk")})}}),si=e=>{const{isSignUp:t,brandName:o="",platformList:n,enabledAce:i,disable_platform:a,isMobile:r,disableAll:s,os:l,standaloneAid:d}=e;if(s)return[];const c=Boolean(o),p=/mercedes/i.test(o),u=n,g=[];return t&&(g.push("twitter","vk"),r||"mac"===l||g.push("apple"),i&&g.push("facebook")),c&&(g.push("apple","kakaotalk","line","vk"),p&&g.push("facebook","twitter")),a&&g.push(...a.split(",")),d&&g.push("line"),u.filter((e=>!g.includes(e)))},li=e=>{2===Number(null!=e?e:localStorage.getItem("oauthType"))&&(location.href=`${location.href}&no_refactor=1`)},di="hello_page_login_way",ci=()=>Boolean((0,C._S)(di)),pi=()=>{(0,C.AP)(di,"1")},ui=()=>{if(location.hash){const{state:e,access_token:t,user_id:o}=rt.parse(location.hash.substr(1));if(!e||location.hash.match("accounts.google.com|https://www.googleapis.com/auth"))return;const n=Xn.getRandomString("vk");let i="ok";return n&&e===n?ti("vk",{access_token:null==t?void 0:t.toString(),user_id:null==o?void 0:o.toString()}):i="failed",Xn.clearData("vk"),window.authDoneClose=!0,i}},gi="webapp_third_auth_page_redirect";function hi(e){var t;if(!(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t[e]))return;const o=function(e){const t={},o=e.replace(/^[#?]/,"").match(/([^=/&]+)=([^&]+)/g);if(o)for(let e=0;e{var t,o,n,i;const{disableStandaloneAppFlags:a,standaloneAid:r,standaloneAppVersion:s}=e,l=e.os;if(!r)return!1;const d=null===(o=null===(t=a[r])||void 0===t?void 0:t.versionControls)||void 0===o?void 0:o[l],c=null===(i=null===(n=a[r])||void 0===n?void 0:n.hideAll)||void 0===i?void 0:i[l];if(d&&s){const{disableVersions:e=[],enableVersions:t=[]}=d,o=({op:e,version:t})=>!!mi[e]&&mi[e](s,t);if(e.some(o))return!0;if(t.some(o))return!1}return void 0!==c&&c};var fi=o(28445),yi=o(77653),bi=o(31291),xi=o(50970);let vi=class{constructor(e,t,o){this.loginReport=e,this.fetch=t,this.appContextModule=o,this.initialized=!1}init(){return this.init$||(this.init$=(()=>(0,u.__awaiter)(this,void 0,void 0,(function*(){var e;try{const t=this.appContextModule.state.appContext,n=null!==(e=null==t?void 0:t.appId)&&void 0!==e?e:1180;Zn.iU.apple=Zn.k0[n];const[i,{data:a}]=yield Promise.all([o.e(9807).then(o.t.bind(o,29345,23)),this.getAppleConfig()]),{client_id:r,state:s}=a;i.auth.init({clientId:r,state:s,redirectURI:"https://www.tiktok.com/oauth",scope:"name email",response_mode:"fragment",usePopup:!0}),window.AppleID=i,this.initialized=!0}catch(e){throw console.error(e),this.init$=void 0,{error_code:-1}}})))()),this.init$}login(){return(0,u.__awaiter)(this,void 0,void 0,(function*(){try{this.initialized||(yield this.init());const e=yield window.AppleID.auth.signIn();return this.tokenToAuthentication(e)}catch(e){return this.loginReport.thirdPartyLoginResult(Object.assign(Object.assign({},e),{status:"popup_closed_by_user"===e.error?2:1,error_desc:e.error})),Object.assign(Object.assign({error_code:-1},e),{error_msg:"user_trigger_new_signin_flow"===e.error?"":e.error,platform:"apple"})}}))}tokenToAuthentication(e){const{authorization:t={}}=e,{id_token:o}=t;return{openid:(0,fi.A)(o).sub,platform_app_id:Zn.iU.apple,platform:"apple",id_token:o}}getAppleConfig(){const e=this.fetch.post("https://www.tiktok.com/passport/web/auth/config",{query:{aid:1459,account_sdk_source:"web"},body:po().stringify({platform_app_id:Zn.iU.apple,action:"login_only",next:"https://www.tiktok.com/foryou?lang=en"})});return(0,yi.s)(e.pipe((0,bi.s)(1)))}};vi=(0,u.__decorate)([(0,Vo._)(),(0,u.__metadata)("design:paramtypes",[T.$F,Ko.p,xi.L])],vi);let ki=class{constructor(e){this.loginReport=e,this.initialized=!1}init(){return(0,u.__awaiter)(this,void 0,void 0,(function*(){return this.init$||(this.init$=(()=>(0,u.__awaiter)(this,void 0,void 0,(function*(){try{yield o.e(4305).then(o.t.bind(o,1325,23)),window.fbAsyncInit=()=>{window.FB.init({appId:Zn.jq,cookie:!0,xfbml:!0,version:"v18.0"})},this.initialized=!0}catch(e){throw console.error(e),this.init$=void 0,e}})))()),this.init$}))}login(){var e,t;return(0,u.__awaiter)(this,void 0,void 0,(function*(){try{this.initialized||(yield this.init());const e=yield new Promise((e=>{window.FB.login((t=>e(t)))}));return"connected"===e.status?{openid:e.authResponse.userID,access_token:e.authResponse.accessToken,platform:"facebook",platform_app_id:Zn.iU.facebook}:(console.error(e),{error_code:-1,error_msg:e.message,platform:"facebook"})}catch(o){return this.loginReport.thirdPartyLoginResult(Object.assign(Object.assign({},o),{status:"cancelled"===(null===(e=o.error)||void 0===e?void 0:e.code)?2:1,error_desc:null===(t=o.error)||void 0===t?void 0:t.message})),{error_code:-1,platform:"facebook",error_msg:o.message}}}))}};ki=(0,u.__decorate)([(0,Vo._)(),(0,u.__metadata)("design:paramtypes",[T.$F])],ki);var Ci=o(40812),Si=o(72916);let wi=class{constructor(e){this.loginReport=e,this.loadSdk=e=>{window.HELLOJS_REDIRECT_URL=new RegExp(`^${window.location.origin}/(login|signup|oauth|oauthLine|setting)(/[^.]*){0,}(?!/..)([/?#]|$)|^https://accounts.google.com([/?#]|$)`),function(){for(const e of["search","hash"])try{hi(e)}catch(e){}}(),o.e(2675).then(o.t.bind(o,45875,23)).then((({default:t})=>{t.init({facebook:"1862952583919182",google:"1096011445005-sdea0nf5jvj14eia93icpttv27cidkvk.apps.googleusercontent.com",twitter:"rLsbFQ5NHI2IsWZiRc2McRCFc",instagram:"c8785d0dc7df48f298532fddf33d7cb5",vk:"6961453"}),this.helloJS=t,null==e||e()})).catch((t=>{console.error(t),null==e||e()}))}}get helloJS$(){return this.helloJS?(0,$o.of)(this.helloJS):new Go.c((e=>{this.loadSdk((()=>{e.next(),e.complete()}))}))}login(e){const{platform:t,display:o}=e;return"page"===o&&pi(),this.helloJS$.pipe((0,No.Z)((()=>(0,Gn.H)(this.helloJS(t).login(e)).pipe((0,Si.n)((e=>this.afterHelloAuthentication(e)))))),(0,Wo.W)((n=>{var i,a,r,s;return this.loginReport.thirdPartyLoginResult(Object.assign(Object.assign({},n.error),{status:"cancelled"===(null===(i=n.error)||void 0===i?void 0:i.code)?2:1,error_desc:null===(a=n.error)||void 0===a?void 0:a.message})),"blocked"===(null===(r=n.error)||void 0===r?void 0:r.code)&&"popup"===o&&(e.display="page",this.helloJS(t).login(e),pi()),(0,$o.of)(Object.assign({platform:t,error_code:-1,error_msg:null===(s=n.error)||void 0===s?void 0:s.message},n.error))})))}ListenLogin(){return this.helloJS$.pipe((0,Si.n)((()=>(0,Ci.R)(this.helloJS,"auth.login").pipe((0,bi.s)(1)))),(0,Si.n)((e=>((0,C.sc)(di),this.afterHelloAuthentication(e[0])))))}afterHelloAuthentication(e){return(0,$o.of)(e).pipe((0,Si.n)((e=>{const{network:t,authResponse:o}=e,n="vk"===t?{v:"5.81"}:void 0;return(0,Gn.H)(this.helloJS(t).api("me",n)).pipe((0,Wn.T)((e=>{const{access_token:n="",oauth_token_secret:i=""}=o;return{openid:e.id,access_token:n,access_token_secret:i,platform:t,platform_app_id:Zn.iU[t]}})))})))}};wi=(0,u.__decorate)([(0,Vo._)(),(0,u.__metadata)("design:paramtypes",[T.$F])],wi);let ji=class extends g.E{constructor(e,t,o,n,i,a,r,s,l,d,c){super(),this.service=e,this.loginResultDealModule=t,this.appBiz=o,this.contextModule=n,this.helloJS=i,this.facebookSdk=a,this.appleSdk=r,this.slardar=s,this.loginReport=l,this.sloSlardar=d,this.t=c,this.defaultState={platform:"",loadingThirdParty:!1}}setLoadingThirdParty(e,t){e.loadingThirdParty=t}handleHelloJSAuth(e){return e.pipe((0,No.Z)((e=>this.helloJS.login(e).pipe((0,R.M)((e=>this.reportThirdGetToken(e))),(0,Wn.T)((e=>e.error_code?"cancelled"===e.code?this.noop():this.loginResultDealModule.getActions().handleLoginResult(e):this.getActions().thirdLogin(e)))))))}handleHelloLoginEvent(e){return e.pipe((0,No.Z)((()=>this.helloJS.ListenLogin().pipe((0,Wn.T)((e=>e.error_code?this.noop():this.getActions().thirdLogin(e)))))))}handleFacebookLogin(e){return e.pipe((0,No.Z)((()=>(0,Gn.H)(this.facebookSdk.login()).pipe((0,Wn.T)((e=>(this.reportThirdGetToken(e),this.getActions().thirdLogin(e))))))))}handleAppleLogin(e){return e.pipe((0,No.Z)((({appleToken:e})=>e?(0,$o.of)(this.appleSdk.tokenToAuthentication(e)):(0,Gn.H)(this.appleSdk.login())))).pipe((0,R.M)((e=>this.reportThirdGetToken(e))),(0,Wn.T)((e=>e.error_code?"popup_closed_by_user"===e.error?this.noop():this.loginResultDealModule.getActions().handleLoginResult(e):this.getActions().thirdLogin(e))))}handlePopupAuthorize(e){return e.pipe((0,Vn.E)(this.appBiz.state$),(0,No.Z)((([{url:e,platform:t},{bizContext:o}])=>{var n;return this.jumpAuthorizationPage({url:e,isSmartPlayer:null===(n=null==o?void 0:o.playerInfo)||void 0===n?void 0:n.isSmartPlayer}).pipe((0,Wn.T)((({closeByUser:e})=>{if(e)return this.loginReport.thirdPartyLoginResult({error_code:-1,status:2,error_desc:"user cancel login"}),this.noop();const o=oi(t);if("twitter"===t){const e=JSON.stringify({oauth_token:o.oauth_token,oauth_verifier:o.oauth_verifier});o.code=zn.o4.encode(e)}return this.getActions().thirdLogin(Object.assign({openid:o.user_id,platform_app_id:Zn.iU[t],platform:t},o))})))})))}authPageGoRedirect(e){return e.pipe((0,Vn.E)(this.contextModule.state$),(0,Wn.T)((([{platform:e,state:t},{loginType:o,redirectUrl:n}])=>(((e,t)=>{const o=(0,rt.stringifyUrl)({url:`${window.location.origin}/login`,query:t});location.href=o,(0,C.AP)(gi,e)})(e,{type:o,redirect_url:n,state:t}),this.noop()))))}dealPageAuthRedirect(e){return e.pipe((0,Wn.T)((()=>{const e=(0,C._S)(gi);if(!e)return this.noop();if((0,C.sc)(gi),"line"===e){if(!window.location.search)return(0,mn.P)(this.t("Sorry, something went wrong, please try again later")),console.error("Login: Line missing state."),this.noop();{const{state:e}=po().parse(window.location.search.substr(1));if(Xn.getRandomString("line")!==e)return(0,mn.P)(this.t("Sorry, something went wrong, please try again later")),console.error("Login: Line state validation failed."),this.noop();Xn.clearData("line")}}const t=oi(e);if("twitter"===e){const e=JSON.stringify({oauth_token:t.oauth_token,oauth_verifier:t.oauth_verifier});t.code=zn.o4.encode(e)}return this.getActions().thirdLogin(Object.assign({platform_app_id:Zn.iU[e],platform:e},t))})))}thirdLogin(e){return e.pipe((0,Vn.E)(this.contextModule.state$),(0,No.Z)((([e,{isSecurityVerification:t}])=>e.error_code||!e.platform_app_id?(0,$o.of)(this.loginResultDealModule.getActions().handleLoginResult(e)):(Yn.K.show(),(t?this.service.thirdVerify(Object.assign(Object.assign({},e),{login_only:!0})):this.service.thirdLogin(Object.assign(Object.assign({},e),{login_only:!0}))).pipe((0,Wn.T)((t=>(t.thirdQuery=Object.assign(Object.assign({},e),{profile_key:t.profile_key}),this.loginReport.setPlatform(e.platform),this.sloSlardar.setPlatform(e.platform),t.platform=e.platform,this.loginResultDealModule.getActions().handleLoginResult(t)))),(0,Kn.Z)(this.getActions().setLoadingThirdParty(!0)),(0,zo.q)(this.getActions().setLoadingThirdParty(!1)))))))}jumpAuthorizationPage(e){const{url:t,isSmartPlayer:o}=e;let n="";o||(n="resizable,scrollbars,width=500,height=550,display=popup");const i=window.open(t,"_blank",n);return i?new Go.c((e=>{const t=setInterval((()=>{(!i||i.closed||i.authDoneClose)&&(clearInterval(t),e.next({closeByUser:!i.authDoneClose}),i.authDoneClose&&i.close(),e.complete())}),100)})):(0,qn.I)()}reportThirdGetToken(e){var t;const{error_code:o,code:n,error_msg:i,error:a}=e;this.slardar.handleThirdGetToken({error_code:o?-1:0,error_message:null!==(t=null!=n?n:a)&&void 0!==t?t:i})}};(0,u.__decorate)([(0,h.uk)(),(0,u.__metadata)("design:type",Go.c)],ji.prototype,"dispose$",void 0),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Boolean]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"setLoadingThirdParty",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"handleHelloJSAuth",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"handleHelloLoginEvent",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"handleFacebookLogin",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"handleAppleLogin",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"handlePopupAuthorize",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"authPageGoRedirect",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"dealPageAuthRedirect",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],ji.prototype,"thirdLogin",null),ji=(0,u.__decorate)([(0,m.n)("ThirdPlatformModule"),(0,u.__param)(10,(0,Nn.y)(Bn.hp)),(0,u.__metadata)("design:paramtypes",[Jn.r,Ae.$,$n.$,kt.t,wi,ki,vi,gt.VU,T.$F,gt.le,Function])],ji);const Ti={id:"single-logo-dark-3ed5e24d",use:"single-logo-dark-3ed5e24d-usage",viewBox:"0 0 25 42",content:''};function Pi(e){const t=(0,A.useContext)(Ot.X);return(0,A.useLayoutEffect)((()=>(t.add(Ti),()=>{t.remove("single-logo-dark-3ed5e24d")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#single-logo-dark-3ed5e24d"},void 0)}),void 0)}const Ei="last_login_method",Mi="Sorry, something went wrong, please try again later",Li=e=>{switch(e){case"QRcode":return"qr";case"email":case"handle":case"phone":case"sms_verification":return"email";case"twitter":return"twitter";case"google":return"google";case"facebook":return"facebook";case"vk":return"vk";case"kakaotalk":return"kakaotalk";case"line":return"line";case"apple":return"apple";case"tiktok":return"tiktok";default:return}};function Ai(e){const[t,o]=(0,A.useState)(!1);return{initialized:t,effect:(0,A.useCallback)((()=>(0,u.__awaiter)(this,void 0,void 0,(function*(){try{(0,C.nr)()&&(yield e.init())}finally{o(!0)}}))),[])}}function Ii(e,t,o){const n=null==o?void 0:o.platforms;if(!n)return t;return t.filter((t=>{const o=n[t.toLowerCase()];return!o||!(o.disable||e&&o.disableSignup)}))}const Ri=e=>{var t,o,i;const{isMobile:a,playerInfo:r,os:d}=(0,Ve.L$)((0,c.U)((()=>["isMobile","os","playerInfo"]),[])),{name:p,isSmartPlayer:u}=(0,Ve.L$)(r),{platformConfig:g,thirdPlatformConfig:h,lastLoginMethod:m,standaloneAid:_,standaloneAppVersion:b,disableStandaloneAppFlags:x}=St((()=>["platformConfig","thirdPlatformConfig","lastLoginMethod","standaloneAid","standaloneAppVersion","disableStandaloneAppFlags"]),[]),{isMobileUiOptimize:v}=(0,y.Eo)(),k=Li(null!==(t=null!=m?m:Un().get(Ei))&&void 0!==t?t:""),{isModal:C}=(0,s.Ph)(kt.t),S=fn(),w=yn(),{handleAppleLogin:T,handlePopupAuthorize:P,handleHelloJSAuth:E,handleFacebookLogin:M,handleHelloLoginEvent:L,dealPageAuthRedirect:I}=(0,s.wA)(ji),R=(0,f.s)("WebApp_Login"),F=(0,l.Nj)(vi),O=(0,l.Nj)(ki),D=fe(),{pathname:H,search:U}=ye(),N=(0,rt.parse)(U),B=(0,Ft.$H)(H),$=So(),z=!B&&(!a||u),{loginQRcode:W,loginPath:G}=(0,A.useMemo)((()=>{const e=C?U:"";return{loginQRcode:j.tH.loginQRcode+e,loginPath:B?$+e:j.tH.loginPhoneOrEmail+e}}),[C,U,B,$]),V=(0,A.useCallback)((e=>()=>{T({appleToken:e})}),[T]);(0,A.useEffect)((()=>(document.addEventListener("AppleIDSignInOnSuccess",V),()=>{document.removeEventListener("AppleIDSignInOnSuccess",V)})),[V]),(0,A.useEffect)((()=>{const e=ui();e&&"failed"===e&&((0,mn.P)(R(Mi)),console.error("Login: VK authorization failed."));const t=(()=>{if(!location.search)return;const{state:e,code:t}=rt.parse(location.search);if(!e)return;const o=(e=>{try{return JSON.parse(e)}catch(e){return null}})(e.toString());if(!o)return;const{platform:n,auth:i}=o;if("kakaotalk"!==n)return;const a=Xn.getRandomString("kakaotalk");let r="ok";return a&&i!==a?r="failed":ti("kakaotalk",{code:null==t?void 0:t.toString(),redirect_uri:"https://www.tiktok.com/login"}),Xn.clearData("kakaotalk"),window.authDoneClose=!0,r})();t&&"failed"===t&&((0,mn.P)(R(Mi)),console.error("Login: KekaoTalk authorization failed.")),ci()&&L()}),[R,L]),(0,A.useEffect)((()=>{I()}),[I]);const{stopPolling:K}=bn(),q=(0,A.useCallback)((()=>{w({platform:"QRcode",isSignUp:B}),S({platform:"QRcode",signUp:B}),D.push(W)}),[D,W,w,S,B]),Z=(0,A.useCallback)((()=>{K(),w({platform:"sms_email_handle",isSignUp:B}),D.push(G)}),[D,B,G,w,K]),{abTestVersion:J}=null!==(o=(0,Ze.W)((()=>["abTestVersion"]),[]))&&void 0!==o?o:{},Y=null!==(i=(0,Ye.qt)(J,"enable_fb_sdk"))&&void 0!==i?i:"v1",Q=(0,A.useCallback)((e=>()=>{switch(K(),w({platform:e,isSignUp:B}),S({platform:e,signUp:B}),e){case"apple":T({});break;case"twitter":P({url:ni(),platform:"twitter"});break;case"line":P({url:ii(),platform:"line"});break;case"facebook":case"google":if("facebook"===e&&"v2"===Y){M();break}E({force:"google"===e||null,platform:e,display:u?"page":"popup",redirect_uri:"https://www.tiktok.com/login/",scope:""});break;case"vk":P({url:ai(),platform:"vk"});break;case"kakaotalk":P({url:ri(),platform:"kakaotalk"})}}),[S,w,B,T,P,Y,E,u,M,K]),{initialized:X,effect:ee}=Ai(F),{initialized:te,effect:oe}=Ai(O),{getTokenCalled:ne}=(0,s.Ph)(gn.q),ie={tiktok:{starlingText:"webLogin_useApp_btn",icon:()=>(0,n.jsx)(Pi,{}),onClick:kn(),type:"tiktok",loading:!ne},apple:{starlingText:"common_login_panel_button_apple",icon:En.A,onClick:Q("apple"),type:"apple",loading:!X,effect:ee},email:{starlingText:B?"common_registration_panel_button_phoneoremail":"common_login_panel_button_phoneoremailorusername",icon:v&&a?Pn.Y:Mn.A,onClick:Z,type:"email"},facebook:{starlingText:"common_login_panel_button_facebook",icon:Ln.A,onClick:Q("facebook"),type:"facebook",loading:!te,effect:oe},google:{starlingText:"common_login_panel_button_google",icon:An.A,onClick:Q("google"),type:"google"},kakaotalk:{starlingText:"common_login_panel_button_kakaotalk",icon:In.A,onClick:Q("kakaotalk"),type:"kakaotalk"},line:{starlingText:"common_login_panel_button_line",icon:Rn.A,onClick:Q("line"),type:"line"},phone:{starlingText:B?"common_registration_panel_button_phoneoremail":"common_login_panel_button_phoneoremailorusername",icon:v&&a?Pn.Y:Mn.A,onClick:Z,type:"phone"},qr:{starlingText:"common_login_panel_button_qrcode",icon:Fn.A,onClick:q,type:"qr"},twitter:{starlingText:"common_login_panel_button_twitter",icon:On.A,onClick:Q("twitter"),type:"twitter"},vk:{starlingText:"common_login_panel_button_vk",icon:Dn.A,onClick:Q("vk"),type:"vk"}},ae=0!==g.order.length?g.order.toLowerCase().split(","):["facebook","google","apple","twitter","vk","line","kakaotalk"],re=(0,y.ZO)(),se=[...si({isSignUp:B,brandName:p,platformList:Ii(B,ae,h),enabledAce:re,disable_platform:N.disable_platform,isMobile:a,standaloneAid:_,disableAll:_i({disableStandaloneAppFlags:x,standaloneAid:_,standaloneAppVersion:b,os:d}),os:d}),"email","phone","tiktok"];return z&&se.push("qr"),k&&(ie[k].lastLoginMethod=!0),e.filter((e=>se.includes(e))).map((e=>ie[e]))},Fi=e=>{var t;const o=(0,Ze.W)((()=>["abTestVersion"]),[]),n=null!==(t=(0,Ye.qt)(null==o?void 0:o.abTestVersion,"last_login_method"))&&void 0!==t?t:"v1",{pathname:i}=ye(),a=(0,Ft.$H)(i),{lastLoginMethod:r}=St((()=>["lastLoginMethod"]),[]);return(0,A.useMemo)((()=>{var t;const o=Li(null!==(t=null!=r?r:Un().get(Ei))&&void 0!==t?t:"");return"v3"===n&&void 0!==o&&e.includes(o)&&!a?[o,...e.filter((e=>e!==o))]:e}),[e,a,r,n])};var Oi=o(42617);const Di=(0,A.memo)((function({disabled:e,children:t}){const{loginModalSwitchPath:o}=(0,s.Ph)(_);return o?(0,n.jsx)(Oi.Ay,{disabled:e,autoFocus:!1,children:t}):(0,n.jsx)(n.Fragment,{children:t})}));function Hi(){const{pathname:e}=ye(),t=(0,Ft.$H)(e),{platformConfig:o}=St((()=>["platformConfig"]),[]),n=vn(),i=["qr","email",...o.order.toLowerCase().split(",").filter((e=>"instagram"!==e))];return n&&!t&&i.unshift("tiktok"),i}var Ui=o(57061),Ni=o.n(Ui),Bi=o(27008);const $i=(0,Ie.default)("h2",{target:"e1521l5b1"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"32px",margin:"16px auto",fontWeight:"bold",textAlign:"center",wordWrap:"break-word"}]),"label:H2Title;"),zi=(0,Ie.default)("div",{target:"e1521l5b3"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"15px",display:"flex",justifyContent:"space-between",marginBottom:"5px"}]),"label:DivDescription;"),Wi=(0,Ie.default)("div",{target:"e1521l5b4"})((({theme:e})=>[{marginTop:"20px",border:"1px solid",borderColor:e.colors.LineSecondary2,padding:"13px",borderRadius:"2px",width:"100%",position:"relative",":before":{content:'""',height:"16px",position:"absolute",background:e.colors.BGPrimary,width:"16px",top:"-8px",left:"rtl"===e.direction?"unset":"calc(50% - 8px)",right:"rtl"===e.direction?"calc(50% - 8px)":"unset",borderInlineEnd:`1px solid ${e.colors.LineSecondary2}`,borderTop:`1px solid ${e.colors.LineSecondary2}`,transform:"rotateZ(-45deg)"}}]),"label:DivPhoneNotRegistered;"),Gi=(0,Ie.default)("p",{target:"e1521l5b5"})((({theme:e,link:t})=>[{fontSize:"12px",lineHeight:"17px",color:t?e.colors.Primary:e.colors.TextPrimary,fontWeight:600,margin:"0 0 8px",cursor:"pointer"}]),"label:PPhoneNotRegistered;");var Vi,Ki=o(57431),qi=o(65070),Zi=o(78400),Ji=o(88825),Yi=o(87933);!function(e){e.Init="init",e.GetCode="new",e.Scanned="scanned",e.Confirmed="confirmed",e.Expired="expired",e.Refused="refuse",e.Error="error",e.NeedRetry="need_retry"}(Vi||(Vi={}));let Qi=class extends g.E{constructor(e,t,o){super(),this.service=e,this.fetch=t,this.loginSlardar=o,this.defaultState={status:"init",inQrcodePage:!1}}setStatus(e,t){e.status=t}setInQRCodePage(e,t){e.inQrcodePage=t,t&&(e.status="init")}setGetQrcodeResult(e,t){const{qrCodeUrl:o,clientSecret:n,token:i,ttWid:a}=t;e.token=i,e.clientSecret=n,e.qrCodeUrl=o,e.status="new",e.ttWid=a}getQrCodeUrl(e){return e.pipe((0,No.Z)((()=>this.service.getQrCodeUrl({next:"https://www.tiktok.com"}).pipe((0,No.Z)((e=>{const{token:t,qrcode_index_url:o,ttwid_migration_ticket:n}=e;if(!t||!o)return(0,$o.of)(this.getActions().setStatus("need_retry"));const i=function(e=8){const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");let o="";for(let n=0;n{var o;return this.getActions().setGetQrcodeResult({token:t,clientSecret:i,qrCodeUrl:null!==(o=e.short_url)&&void 0!==o?o:c,ttWid:null!=n?n:""})})))}))))))}checkQrConnect(e){return e.pipe((0,Vn.E)(this.state$),(0,No.Z)((([{ttpConfig:e,oldStatus:t},{token:o="",clientSecret:n="",ttWid:i=""}])=>this.checkQrcodeRequest({token:o,clientSecret:n,ttpConfig:e,oldStatus:t,ttWid:i}).pipe((0,Wn.T)((e=>{const{status:t,error_code:o,description:n}=e;return o?((0,mn.P)(n),this.getActions().setStatus("error")):this.getActions().setStatus(t)}))))))}shortenQrUrl(e){return this.fetch.post("https://www.tiktok.com/shorten/",{query:{safe_token:"true"},body:(0,co.stringify)({belong:"tiktok-webapp-qrcode",persist:0,expired_time:3600,targets:e})}).pipe((0,Wn.T)((e=>{var t;return null!==(t=e.data[0])&&void 0!==t?t:{status:"failed",short_url:void 0}})),(0,Wo.W)((e=>(this.loginSlardar.QRCodeShortenFail({code:`${e.code}`}),(0,$o.of)({status:"failed",short_url:void 0})))))}checkQrcodeRequest(e){const{token:t,clientSecret:o,ttpConfig:n,oldStatus:i,ttWid:a=""}=e,{open:r,syncSeverList:s}=n||{},l=r?s:[{name:"gloable",domain:""}];return(0,qi.p)(l.map((e=>this.service.checkQrconnect({token:null!=t?t:"",next:"https://www.tiktok.com",baseURL:e.domain,ttWid:a})))).pipe((0,No.Z)((e=>{const t=e.find((e=>e.client_secret===o));for(const n of e){const{status:e,client_secret:a,error_code:r,description:s}=t||n;if(this.state.inQrcodePage&&("init"===e||"new"===e||e===i))throw new Error("user not scanned, need check agin");return a===o?(0,$o.of)({status:e}):r?(0,$o.of)({error_code:r,description:s}):(0,$o.of)({status:e})}return(0,$o.of)(this.noop())})),(0,Zi.l)((e=>e.pipe((0,Ji.o)((()=>(0,Yi.O)(800)))))))}};(0,u.__decorate)([(0,h.uk)(),(0,u.__metadata)("design:type",Go.c)],Qi.prototype,"dispose$",void 0),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,String]),(0,u.__metadata)("design:returntype",void 0)],Qi.prototype,"setStatus",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Boolean]),(0,u.__metadata)("design:returntype",void 0)],Qi.prototype,"setInQRCodePage",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Object]),(0,u.__metadata)("design:returntype",void 0)],Qi.prototype,"setGetQrcodeResult",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],Qi.prototype,"getQrCodeUrl",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],Qi.prototype,"checkQrConnect",null),Qi=(0,u.__decorate)([(0,m.n)("QRCodeModule"),(0,u.__metadata)("design:paramtypes",[Jn.r,Ko.p,gt.VU])],Qi);const Xi=o.p+"c4c40812758dc8175106.png",ea=o.p+"0dbff97a224480a207b4.png";var ta=o(72081),oa=o(78448);const na="1px solid #F2F2F2",ia=(0,Ie.default)("div",{target:"eot7zvz0"})((({theme:e,isTtincar:t})=>[{display:"flex",marginTop:"48px",justifyContent:"center",padding:e.isMobile?"0 32px":"unset"},t&&[{justifyContent:"center"},(0,Re.jJ)({min:Tt,style:{marginTop:"200px"}}),(0,Re.Ee)({max:720,style:{marginTop:"40px"}}),(0,Re.Ee)({min:1770,style:{marginTop:"537px"}})]]),"label:DivQRContentBody;"),aa=(0,Ie.default)("div",{target:"eot7zvz1"})((({theme:e})=>[{display:"flex",justifyContent:"center",padding:e.isMobile?"0 32px":"unset"},e.isMobile&&(0,Re.jJ)({min:Tt,style:{justifyContent:"center",marginTop:"80px"}})]),"label:DivQRPopupContentBody;"),ra=(0,Ie.default)("div",{target:"eot7zvz2"})((({theme:e})=>[{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:e.isMobile?"0 32px":"unset"}]),"label:DivQRPopupContentBodyVertical;"),sa=(0,Ie.default)("h2",{target:"eot7zvz4"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"12px",marginTop:"16px",marginBottom:"14px",textAlign:"center",wordWrap:"break-word"}]),"label:H2QRBottomRightPopupTitle;"),la=(0,Ie.default)("div",{target:"eot7zvz5"})((({theme:e})=>[{width:"100%"},e.isMobile&&(0,Re.jJ)({min:Tt,style:[{width:"360px"}]})]),"label:DivTextContainer;"),da=(0,Ie.default)("div",{target:"eot7zvz6"})((({theme:e})=>[{width:"100%",height:"208px",borderRadius:"11px",border:na,margin:"auto",justifyContent:"center",display:"flex",alignItems:"center"},e.isMobile&&(0,Re.jJ)({min:Tt,style:{width:"360px",height:"360px",marginTop:"40px",background:"rgba(242, 242, 242, 1)"}})]),"label:DivCodeImage;"),ca=(0,Ie.default)("div",{target:"eot7zvz7"})((({popupType:e})=>({width:"qr_bottom_right"===e?"104px":"311px",height:"qr_bottom_right"===e?"104px":"184px",borderRadius:"11px",border:"qr_bottom_right"===e?"none":na,margin:"auto",justifyContent:"center",display:"flex",alignItems:"center"})),"label:DivCodePopupImage;"),pa=(0,Ie.default)("div",{target:"eot7zvz8"})((({theme:e,showLoginOptionSlider:t})=>({width:"190px",height:"190px",backgroundColor:"#fff",borderRadius:"24px",border:na,margin:t?"22px auto 14px":"8px auto 8px",boxShadow:e.isDark?"0 2px 15px rgba(255, 255, 255, 0.3), 0 0px 10px rgba(255, 255, 255, 0.5)":"0 2px 12px rgba(0, 0, 0, 0.12)",justifyContent:"center",display:"flex",alignItems:"center"})),"label:DivQRCodePopupImageRedesign;"),ua=(0,Ie.default)("img",{target:"eot7zvz9"})((({theme:e,popupType:t})=>[{width:"qr_bottom_right"===t?"104px":"174px",height:"qr_bottom_right"===t?"104px":"174px",borderRadius:"11px",background:"#FFFFFF",padding:"12px",margin:"auto"},e.isMobile&&(0,Re.jJ)({min:Tt,style:{width:"280px",height:"280px"}})]),"label:ImgCode;"),ga=(0,Ie.default)("div",{target:"eot7zvz11"})((({theme:e})=>[(0,Re.mp)({direction:e.direction}),{position:"absolute",display:"flex",flexDirection:"column",width:"176px",height:"176px",backgroundColor:e.colors.BGReverse2,borderRadius:"12px",padding:"0 24px",justifyContent:"center",alignItems:"center"},e.isMobile&&(0,Re.jJ)({min:Tt,style:{width:"280px",height:"280px",padding:"0"}})]),"label:DivCodeMask;"),ha=(0,Ie.default)("div",{target:"eot7zvz12"})((({theme:e,popupType:t})=>[(0,Re.mp)({direction:e.direction}),{position:"absolute",display:"flex",flexDirection:"column",width:"qr_bottom_right"===t?"108px":"152px",height:"qr_bottom_right"===t?"108px":"152px",backgroundColor:e.colors.BGReverse2,borderRadius:"12px",padding:"0 24px",justifyContent:"center",alignItems:"center"}]),"label:DivPopupCodeMask;"),ma=(0,Ie.default)("div",{target:"eot7zvz13"})((({theme:e})=>[(0,Re.mp)({direction:e.direction}),{position:"absolute",display:"flex",flexDirection:"column",width:"174px",height:"174px",backgroundColor:e.isDark?"rgba(22, 24, 35, 0.7)":"rgba(250, 250, 250, 0.7)",borderRadius:"12px",padding:"0 24px",justifyContent:"center",alignItems:"center"}]),"label:DivPopupCodeMaskRedesign;"),_a=(0,Ie.default)("span",{target:"eot7zvz14"})({fontSize:"42px",height:"30px",marginBottom:"24px"},"label:SpanSuccessIcon;"),fa=(0,Ie.default)("p",{target:"eot7zvz15"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont"}),{fontWeight:600,lineHeight:"20px",fontSize:"14px",color:e.colors.TextPrimary},e.isMobile&&(0,Re.jJ)({min:Tt,style:{fontWeight:700,lineHeight:"44px",fontSize:"28px"}})]),"label:PCodeTip;"),ya=(0,Ie.default)("p",{target:"eot7zvz16"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont"}),{fontWeight:600,lineHeight:"20px",fontSize:"12px",color:e.colors.TextPrimary}]),"label:PPopupCodeTip;"),ba=(0,Ie.default)("div",{target:"eot7zvz17"})({width:"100%",marginTop:"24px"},"label:DivStepContainer;"),xa=(0,Ie.default)("p",{target:"eot7zvz20"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{fontSize:"16px",lineHeight:"20px",marginBottom:"4px",svg:{verticalAlign:"middle"}},e.isMobile&&(0,Re.jJ)({min:Tt,style:{lineHeight:"38px",fontSize:"24px"}})]),"label:PStep;"),va=(0,Ie.default)("div",{target:"eot7zvz22"})({fontSize:"20px",lineHeight:1.3,textAlign:"center",fontWeight:500,color:"rgba(0, 0, 0, 1)"},"label:DivText;"),ka=(0,Ie.default)(ta.A,{target:"eot7zvz23"})((({theme:e})=>({cursor:"pointer",fill:e.colors.TextPrimary,width:"28px",height:"28px"})),"label:StyledRefreshIcon;"),Ca=(0,Ie.default)(oa.A,{target:"eot7zvz24"})({width:"24px",height:"24px",fill:"rgba(11, 224, 155, 1)"},"label:StyledTickIcon;"),Sa=()=>{var e;const t=(0,f.s)("WebApp_Login"),o=(0,f.s)("Webapp"),i=function(){const e=(0,l.Nj)(T.$F),t=(0,l.Nj)(gt.le);return(0,A.useCallback)((o=>{e.setPlatform(o),t.setPlatform(o)}),[t,e])}(),{ttpConfig:a}=St((()=>["ttpConfig"]),[]),r=(0,P.mZ)((e=>e.popupType)),{appId:d,region:p}=(0,Ve.L$)((0,Ze.W)((()=>["appId","region"]),[])),{isMobile:u}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),[{qrCodeUrl:g,status:h},{getQrCodeUrl:m,checkQrConnect:_,setInQRCodePage:b,setStatus:x}]=(0,s.Su)(Qi),{handleLoginResult:v}=(0,s.wA)(Ae.$),{isTtincar:C}=(0,yt.Qt)(),{search:S}=ye(),{enter_method:w}=(0,rt.parse)(S),{isInRedesignLoginPopupTreatment:j,showLoginOptionSlider:E}=(0,y.LK)(),[{isModal:M}]=(0,s.Su)(kt.t),L=null!==(e="mandatory"===w)&&void 0!==e&&e,I=C&&L,R="https://sf-static.tiktokcdn.com/obj/tiktok-web-common-sg/mtact/static/images/tiktok-logo/logo.png",F=(0,A.useCallback)((()=>{m()}),[m]),O=(0,A.useCallback)((()=>{x("init"),m()}),[x]);(0,A.useEffect)((()=>{return b(!0),F(),e=k.nf.getTrackingInfo(),tt.f.sendEvent("show_qr_login",e),()=>{b(!1)};var e}),[]),(0,A.useEffect)((()=>{var e;"scanned"===h&&(e=k.nf.getTrackingInfo(),tt.f.sendEvent("scan_QR_login",e),_({ttpConfig:a,oldStatus:"scanned"})),"confirmed"===h&&(i("QRcode"),v({error_code:0,region:p})),["expired","refuse","error"].includes(h)&&F()}),[_,v,h,a,p,F]),(0,A.useEffect)((()=>{g&&_({ttpConfig:a})}),[_,g,a]);const D=_t(Boolean(g));return"qr_bottom_right"===r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(sa,{"data-e2e":"qr-page-title",children:o("desktopWeb_dynamicBottom_scanLogIn")}),(0,n.jsx)(aa,{children:(0,n.jsx)(la,{children:(0,n.jsxs)(ca,{popupType:r,"data-e2e":"qr-code",children:[g?(0,n.jsx)(Bi.QRCode,{size:100,value:g,qrStyle:"dots",logoImage:R,removeQrCodeBehindLogo:!0,logoPadding:2,logoPaddingStyle:"square",eyeRadius:2,style:{borderRadius:"16px"}}):(0,n.jsx)(ua,{src:1233===d?Xi:ea,alt:"qrcode",onLoad:D,popupType:r}),"need_retry"===h&&(0,n.jsx)(ha,{popupType:r,onClick:O,children:(0,n.jsx)(_a,{children:(0,n.jsx)(ka,{})})}),["scanned","confirmed"].includes(h)&&(0,n.jsxs)(ha,{popupType:r,children:[(0,n.jsx)(_a,{children:(0,n.jsx)(Ca,{})}),(0,n.jsx)(ya,{children:t("common_login_qrcode_status_scanned")})]}),"init"===h&&(0,n.jsx)(ha,{popupType:r,children:(0,n.jsx)(Ee.R,{center:!0,size:"small"})})]})})})]}):j?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(ra,{children:[(0,n.jsxs)(pa,{"data-e2e":"qr-code",showLoginOptionSlider:E,children:[g?(0,n.jsx)(Bi.QRCode,{size:140,value:g,qrStyle:"dots",logoImage:R,removeQrCodeBehindLogo:!0,logoPadding:2,logoPaddingStyle:"square",eyeRadius:2,style:{borderRadius:"20px"}}):(0,n.jsx)(ua,{src:1233===d?Xi:ea,alt:"qrcode",onLoad:D,popupType:r}),"need_retry"===h&&(0,n.jsx)(ma,{onClick:O,children:(0,n.jsx)(_a,{children:(0,n.jsx)(ka,{})})}),["scanned","confirmed"].includes(h)&&(0,n.jsxs)(ma,{children:[(0,n.jsx)(_a,{children:(0,n.jsx)(Ca,{})}),(0,n.jsx)(ya,{children:t("common_login_qrcode_status_scanned")})]}),"init"===h&&(0,n.jsx)(ma,{children:(0,n.jsx)(Ee.R,{center:!0,size:"small"})})]}),!M&&(0,n.jsxs)(ba,{"data-e2e":"qr-body",children:[(0,n.jsx)(xa,{children:t("tiktoktv_login_modal_loginscreen_scanqr1")},1),(0,n.jsx)(xa,{children:t("tiktoktv_login_modal_loginscreen_scanqr2")},2)]})]})}):(0,n.jsxs)(n.Fragment,{children:[u?(0,n.jsx)(Gt,{showLeft:!I,from:"qr-code",title:t("common_login_qrcode_title")}):(0,n.jsx)($i,{"data-e2e":"qr-page-title",children:t("common_login_qrcode_title")}),(0,n.jsx)(ia,{isTtincar:C,children:(0,n.jsxs)(la,{children:[C&&(0,n.jsx)(va,{children:t("v2_car_onboarding_loginPageQRScan_body")}),(0,n.jsxs)(da,{"data-e2e":"qr-code",children:[g?(0,n.jsx)(Ni(),{size:C?300:170,value:g,style:{borderRadius:"11px",background:"#FFFFFF",padding:"12px"}}):(0,n.jsx)(ua,{src:1233===d?Xi:ea,alt:"qrcode",onLoad:D}),"need_retry"===h&&(0,n.jsx)(ga,{onClick:O,children:(0,n.jsx)(_a,{children:(0,n.jsx)(ka,{onClick:O})})}),["scanned","confirmed"].includes(h)&&(0,n.jsxs)(ga,{children:[(0,n.jsx)(_a,{children:(0,n.jsx)(Ca,{})}),(0,n.jsx)(fa,{children:t("common_login_qrcode_status_scanned")})]}),"init"===h&&(0,n.jsx)(ga,{children:(0,n.jsx)(Ee.R,{center:!0,size:"small"})})]}),!C&&(0,n.jsxs)(ba,{"data-e2e":"qr-body",children:[(0,n.jsx)(xa,{children:t("tiktoktv_login_modal_loginscreen_scanqr1")},1),(0,n.jsx)(xa,{children:t("tiktoktv_login_modal_loginscreen_scanqr2")},2)]})]})})]})},wa=()=>{const e=(0,f.s)("WebApp_Login"),t=(0,f.s)("Webapp"),{query:o}=(0,Xe.xw)(),i="1"===o.pure,[a,r]=(0,A.useState)(null),[d,p]=(0,A.useState)(!1),{loginType:u}=St((()=>["loginType"]),[]),{isMobile:g,hashedIP:h}=(0,Ve.L$)((0,c.U)((()=>["isMobile","playerInfo","hashedIP"]),[])),[m,v]=(0,A.useState)(!1),{isMobileUiOptimize:C}=(0,y.Eo)(),S=(0,s.wA)(_),w=Hi(),[{loginModalShow:E,closeCallback:M,isGuestMode:L,isGuestModeUI:I},{setLoginModalShow:R,setCloseCallback:O,setGroupId:D,setIsLoginOnLoadClosed:H}]=(0,P.MR)((e=>({loginModalShow:e.loginModalShow,closeCallback:e.closeCallback,isGuestMode:e.isGuestMode,isGuestModeUI:e.isGuestModeUI})),F.bN),{showLoginOptionButton:U}=(0,y.LK)(),{isInVerification:N,isInBasicTreatment:B}=(0,y.Pl)(),$=(0,qe.TJ)(),z=(0,l.Nj)(T.$F),W=Fi(w);let G=Ri(W);U&&E&&(G=G.filter((e=>"qr"!==e.type)));const{loginTitle:V,loginSlogan:K,signUpSlogan:q,signUpTitle:Z,thirdPlatformConfig:J}=St((()=>["loginTitle","loginSlogan","signUpSlogan","signUpTitle","thirdPlatformConfig"]),[]),{pathname:Y,search:Q}=ye(),X=wt(),ee=(0,Ze.W)((()=>["abTestVersion","user","webIdCreatedTime","region"]),[]),te=(0,Ve.L$)((0,c.U)((()=>["vgeo"]),[])),{vgeo:oe}=te,ne=(0,Je.oN)(Y),ie=(0,Ye.qt)(null==ee?void 0:ee.abTestVersion,"periodic_login_popup_interval"),ae=(0,A.useMemo)((()=>[{expId:"webapp_guest_mode",segmentId:"segment_default",versionId:L?"v12":"v1",propertyList:["cta_style","login_text","signup_text","close_icon"]}]),[L]),{cta_style:re="default",login_text:se="pcWeb_guestLogin_without",signup_text:le="pcWeb_guestLogin_withoutSignup"}=(0,A.useMemo)((()=>(0,b.J)(x.a,ae)),[ae]),[de,ce]=(0,A.useState)(!1);(function(){var e;const{ttNotInstalled:t,ttNotInstalledE2ETrackingInfo:o}=St((()=>["ttNotInstalled","ttNotInstalledE2ETrackingInfo"]),[]),{abTestVersion:n}=(0,Ve.L$)((0,Ze.W)((()=>["abTestVersion"]),[])),i=null!==(e=(0,Ye.qt)(n,"one_tap_ios_deep_link"))&&void 0!==e?e:"v0",a=_n(),r=(()=>{const e=fe();return(0,A.useCallback)((t=>{const o=e.location,n=new URLSearchParams(o.search);t(n);const i=n.toString();e.replace({pathname:o.pathname,search:i})}),[e])})();(0,A.useEffect)((()=>{t&&(a(o),r((e=>{e.delete("tt_not_installed"),e.delete("tt_not_installed_e2e_tracking_info")})),"v2"===i?localStorage.setItem(hn.pq,"1"):"v3"===i&&sessionStorage.setItem(hn.pq,"1"))}),[])})(),function(){const{pathname:e}=ye(),t=(0,Ft.$H)(e),{user:o}=(0,Ve.L$)((0,Ze.W)((()=>["user"]),[])),n=(0,l.Nj)(T.$F),i=vn(),{getOneTapToken:a}=(0,s.wA)(gn.q);(0,A.useEffect)((()=>{o||!i||t||(n.oneTapShow({e2eInfo:k.nf.getTrackingInfo()}),a())}),[o,i])}(),(0,A.useEffect)((()=>{ce(L||I)}),[L,I]);let pe=V;"v3"!==ie&&"v5"!==ie||(pe="login_popup_modal_header");const ue=fe(),ge=(0,A.useMemo)((()=>{var e;return!(null===(e=(0,rt.parse)(Q))||void 0===e?void 0:e.hide_left_icon)}),[Q]),he=(0,Ft.$H)(Y),me=(0,A.useMemo)((()=>({isMobileUiOptimize:g&&C})),[g,C]),_e=(0,A.useCallback)((()=>(0,n.jsx)(_o,Object.assign({"data-e2e":he?"sign-up-title":"login-title",id:"login-modal-title"},me,{children:"non_login"!==u||he?e(he?Z:pe,{},Vt.fN):t(pe,{},Vt.fN)}))),[e,he,pe,u,me,Z,t]),be=(0,A.useCallback)((()=>{if(E&&"loginm3"!==u)return null;const o="loginm3"!==u?e(he?q:K,{},Vt.R2):t(K,{},Vt.R2),i=he?"sign-up-desc":"login-desc";return(0,n.jsx)(mo,Object.assign({"data-e2e":i},me,{children:o}))}),[e,he,E,K,u,me,q,t]),xe=(0,A.useCallback)((e=>{9===e.keyCode&&v(!0)}),[]),ve=(0,A.useCallback)((()=>{p(!0),ot({page_name:ne})}),[]),[ke,Ce]=(0,A.useState)(!0);(0,A.useEffect)((()=>{var e;Ce(!L&&!I||g||!E||"1"===(null!==(e=localStorage.getItem("guest-mode-flag"))&&void 0!==e?e:"0")&&!I)}),[I,L,g,E]);const Se=(0,Qe.eu)(),we=(0,A.useCallback)((()=>{var e;R(!1),localStorage.setItem("guest-mode-flag","1"),localStorage.setItem("timeOfLastPopup",Date.now().toString());const t=(0,et.uh)(oe,!1);z.updateTeaDataCollectionEnabled(t),z.loginNotifyClose({isSignUp:he?"1":"0",e2eInfo:k.nf.getTrackingInfo()}),S.setLoginModalInitialState(),M(),O(st.l),D(void 0),H({isLoginOnLoadClosed:!0}),(N||B)&&$.maybeGenerateAndReportGlobalWidInfo({enterMethod:"post_guest_mode",hashedIP:h,region:null!==(e=null==ee?void 0:ee.region)&&void 0!==e?e:""})}),[R,z,he,S,M,O,D,H,Se]),je=(0,y.ZO)(),Te=(0,A.useCallback)(((e,t)=>()=>{var o,n;if(null===(n=(null!==(o=null==J?void 0:J.platforms)&&void 0!==o?o:{})[e])||void 0===n?void 0:n.enableAce)return r(e),void nt();"facebook"===e&&!he&&je?(r(e),nt()):t()}),[he,je,J]),Pe=t=>t.map((t=>(0,n.jsx)(so,{text:e(t.starlingText),Icon:t.icon,onClick:Te(t.type,t.onClick),floatingBannerText:!t.lastLoginMethod||(null==ee?void 0:ee.user)||he?void 0:e("encouragePreviousLoginPlatform_loginPage_loginBadge_body"),focusable:!0,loading:t.loading,effect:t.effect},t.starlingText))),Ee=(0,A.useCallback)((()=>{ce(!1)}),[]),Me=(0,A.useCallback)((e=>{13===e.keyCode&&ce(!1)}),[ce]);let Le;const Ae=(0,Ye.qt)(null==ee?void 0:ee.abTestVersion,"new_guest_mode_hot"),Ie=(0,Ye.qt)(null==ee?void 0:ee.abTestVersion,"new_guest_mode_other"),Re=(0,rt.parse)(Q).enter_from,Fe="homepage_hot"===Re||"explore"===Re;Re&&(Fe&&"v1"===Ae||!Fe&&"v1"===Ie)&&(Le="pcWeb_guestLogin_without");const Oe="text"===re,De=Oe?e(he?"common_registration_panel_entry_1":"common_login_panel_entry_1").replace("%s"," "):e("guestmode_signup_or"),He=Oe?"default":re,Ue=he?le:null!=Le?Le:se,Ne=(0,A.useCallback)((()=>{r(null),it()}),[]),Be=(0,A.useCallback)((()=>{r(null),at();const e=E?Q:"",t=j.tH.loginPhoneOrEmail+e;ue.push(t)}),[E,Q,ue]);_t();const $e=(0,A.useMemo)((()=>{if("true"===o.coin_spa)return()=>{ue.goBack()}}),[]),ze=vn();return(0,n.jsxs)(n.Fragment,{children:[g&&(0,n.jsx)(Gt,{showClose:!0,showLeft:ge,onClose:$e}),!g&&E&&!he&&U&&ke?(0,n.jsxs)(ho,{isMobile:g,onKeyDown:xe,children:[_e(),(0,n.jsx)(mo,{children:t(Vt.p$.scanQRDescKey,{},Vt.p$.scanQRDescDefault)}),(0,n.jsx)(Sa,{}),(0,n.jsxs)(ft.bm,{children:[(0,n.jsx)(ft.t_,{}),(0,n.jsx)(ft.CA,{children:t("guestmode_signup_or",{},"OR")}),(0,n.jsx)(ft.t_,{})]}),d?(0,n.jsxs)(yo,{hideGuestMode:ke,isModal:E,children:[be(),(0,n.jsxs)(Di,{disabled:m,children:[Pe(de&&!ke?G.slice(0,4):G),de&&!ke&&G.length>4&&(0,n.jsx)(lt,{onClick:Ee,onKeyDown:Me,tabIndex:0,role:"button",children:(0,n.jsx)(Ke.A,{})})]})]}):(0,n.jsx)(xo,{children:(0,n.jsx)(so,{text:t(Vt.p$.otherOptionsKey,{},Vt.p$.otherOptionsDefault),onClick:ve,focusable:!0},Vt.p$.otherOptionsKey)})]}):(0,n.jsxs)(ho,{isMobile:g,onKeyDown:xe,children:[_e(),(0,n.jsxs)(fo,{hideGuestMode:ke,isModal:E,children:[be(),(0,n.jsxs)(Di,{disabled:m,children:[Pe(de&&!ke?G.slice(0,4):G),de&&!ke&&G.length>4&&(0,n.jsx)(lt,{onClick:Ee,onKeyDown:Me,tabIndex:0,role:"button",children:(0,n.jsx)(Ke.A,{})})]})]}),(()=>{if(!ke)return Oe?(0,n.jsx)(Eo,{isButtonStyle:!0}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ft.bm,{children:[(0,n.jsx)(ft.t_,{}),(0,n.jsx)(ft.CA,{children:De}),(0,n.jsx)(ft.t_,{})]}),(0,n.jsx)(bo,{children:(0,n.jsx)(so,{text:e(Ue),onClick:we,buttonTheme:He,focusable:!0},"login-guest-button")})]})})()]}),!(null==X?void 0:X.hideCTA)&&g&&!i&&(0,n.jsx)(cn,{}),(0,n.jsx)(un,{isMobile:g,visible:!!a,platform:a,onOtherLogin:Be,onClose:Ne}),ze&&(0,n.jsx)(Tn,{})]})};var ja=o(26027),Ta=o(22784);const Pa={id:"apple-e3f80e82",use:"apple-e3f80e82-usage",viewBox:"0 0 48 48",content:''};function Ea(e){const t=(0,A.useContext)(Ot.X);return(0,A.useLayoutEffect)((()=>(t.add(Pa),()=>{t.remove("apple-e3f80e82")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#apple-e3f80e82"},void 0)}),void 0)}const Ma=(0,Ie.default)("div",{target:"exattu0"})({display:"flex",alignItems:"center",justifyContent:"center",fontSize:"24px"},"label:DivShowMore;");Ma.defaultProps=Object.assign(Object.assign({},Ma.defaultProps),{"data-e2e":"see-more-btn"});const La={facebook:{text:"common_login_panel_button_facebook",icon:Ln.A},google:{text:"common_login_panel_button_google",icon:An.A},twitter:{text:"common_login_panel_button_twitter",icon:On.A},instagram:{text:"common_login_panel_button_instagram",icon:ja.A},apple:{text:"common_login_panel_button_apple",icon:()=>(0,n.jsx)(Ea,{})},line:{text:"common_login_panel_button_line",icon:Rn.A},kakaotalk:{text:"common_login_panel_button_kakaotalk",icon:In.A},vk:{text:"common_login_panel_button_vk",icon:Dn.A}},Aa=({signUp:e,platformConfigOverride:t})=>{var o,i;const a=fn(),r=yn(),l=(0,f.s)("WebApp_Login"),d=fe();let{platformConfig:p,thirdPlatformConfig:u}=St((()=>["platformConfig","thirdPlatformConfig"]),[]),g=!1;t&&(p=t,g=!0);const{isMobile:h,playerInfo:m}=(0,Ve.L$)((0,c.U)((()=>["isMobile","playerInfo"]),[])),{name:_,isSmartPlayer:b}=(0,Ve.L$)(m),{abTestVersion:x}=null!==(o=(0,Ze.W)((()=>["abTestVersion"]),[]))&&void 0!==o?o:{},v=null!==(i=(0,Ye.qt)(x,"enable_fb_sdk"))&&void 0!==i?i:"v1",{setShowInstagramCantLoginModal:k}=(0,s.wA)(Ta.S),{handleAppleLogin:C,handlePopupAuthorize:S,handleHelloJSAuth:w,handleHelloLoginEvent:T,handleFacebookLogin:P,dealPageAuthRedirect:E}=(0,s.wA)(ji),[M,L]=(0,A.useState)(!1),I=(e=>{const t={show_num:2,order:"FACEBOOK,GOOGLE,INSTAGRAM,LINE,TWITTER,KAKAOTALK"},{isSignUp:o,platform:n,brandName:i="",platformConfig:a=t,phoenix:r}=e,s=Boolean(i),l=/mercedes/i.test(i),d="FACEBOOK,GOOGLE,TWITTER,APPLE,INSTAGRAM,LINE,KAKAOTALK,VK".toLocaleLowerCase().split(","),c="APPLE,INSTAGRAM".toLocaleLowerCase().split(","),p="LINE,KAKAOTALK,APPLE".toLocaleLowerCase().split(",");s&&(p.push("instagram","vk"),l&&p.push("facebook","twitter"));const u=r?{show_num:4,order:"FACEBOOK,GOOGLE,TWITTER,APPLE"}:a,g={expand:[],fold:[]};if(n){const e=d.find((e=>e===n));return e&&g.expand.push(e),g}const h=u.order.toLocaleLowerCase().split(","),m={expand:[...h.slice(0,u.show_num)],fold:[...h.slice(u.show_num)]};return s&&(m.expand=m.expand.filter((e=>!p.includes(e))),m.fold=m.fold.filter((e=>!p.includes(e)))),o?(m.expand=m.expand.filter((e=>!c.includes(e))),m.fold=m.fold.filter((e=>!c.includes(e)))):m.expand=m.expand.concat(m.fold),m.expand=m.expand.filter((e=>d.includes(e))),m.fold=m.fold.filter((e=>d.includes(e))),m})({platformConfig:p,isSignUp:e,brandName:_}),[R,F]=(0,A.useState)(null),O=(0,A.useCallback)((()=>{const e=ni();S({url:e,platform:"twitter"})}),[S]),D=(0,A.useCallback)((()=>{const e=ii();S({url:e,platform:"line"})}),[S]),H=(0,A.useCallback)((()=>{const e=ai();S({url:e,platform:"vk"})}),[S]),U=(0,A.useCallback)((()=>{const e=ri();S({url:e,platform:"kakaotalk"})}),[S]),N=(0,A.useCallback)((()=>{h?k(!0):d.push({pathname:j.tH.loginDownloadApp,state:{fromIns:!0}})}),[h,k,d]),B=(0,y.ZO)(),$=(0,A.useCallback)((()=>{F(null),it()}),[]),z=(0,lo.K)({query:{enter_method:"sso_auto_popup"},loginPath:"/login/phone-or-email"}),W=(0,A.useCallback)((()=>{F(null),at(),z()}),[]),G=(0,A.useCallback)((t=>()=>{var o,n,i,s;if(r({platform:t,isSignUp:e}),a({platform:t,signUp:e}),null===(n=(null!==(o=null==u?void 0:u.platforms)&&void 0!==o?o:{})[t])||void 0===n?void 0:n.enableAce)F(t);else switch(t){case"apple":C({});break;case"twitter":O();break;case"line":D();break;case"facebook":case"google":if("facebook"===t&&B){F(t);break}if("facebook"===t&&"v2"===v){P();break}w({force:"google"===t||null,platform:t,display:b?"page":"popup",redirect_uri:"https://www.tiktok.com/login/",scope:null!==(s=null===(i=La[t])||void 0===i?void 0:i.scope)&&void 0!==s?s:""});break;case"vk":H();break;case"kakaotalk":U();break;case"instagram":N()}}),[a,r,e,C,O,D,B,v,w,b,H,U,N,P,u]),V=(0,A.useCallback)((()=>{L(!0)}),[]),K=(0,A.useCallback)((e=>()=>{C({appleToken:e})}),[C]);(0,A.useEffect)((()=>(document.addEventListener("AppleIDSignInOnSuccess",K),()=>{document.removeEventListener("AppleIDSignInOnSuccess",K)})),[K]),(0,A.useEffect)((()=>{ui(),ci()&&T()}),[T]),(0,A.useEffect)((()=>{E()}),[E]);const q=(0,A.useCallback)((e=>{13===e.keyCode&&L(!0)}),[L]);return(0,n.jsxs)(n.Fragment,{children:[I.expand.map((e=>La[e]?(0,n.jsx)(so,{text:l(La[e].text),type:e,Icon:La[e].icon,onClick:G(e),isPopup:g,focusable:!0},e):null)),I.fold.length>0&&e&&!M&&(0,n.jsxs)(Ma,{onClick:V,onKeyDown:q,tabIndex:0,role:"button",children:[" ",(0,n.jsx)(Ke.A,{})]}),M&&I.fold.map((e=>La[e]?(0,n.jsx)(so,{text:l(La[e].text),Icon:La[e].icon,onClick:G(e),focusable:!0},e):null)),(0,n.jsx)(un,{isMobile:h,visible:!!R,platform:R,onOtherLogin:W,onClose:$})]})};var Ia=o(92246);const Ra=(0,A.memo)((function({disabled:e,children:t}){const{loginModalSwitchPath:o}=(0,s.Ph)(_);return o?(0,n.jsx)(Oi.Ay,{disabled:e,autoFocus:!1,children:t}):(0,n.jsx)(n.Fragment,{children:t})})),Fa=(0,Ie.default)("div",{target:"ey83qp81"})((({isMobile:e})=>({padding:e?"0 30px":"unset"})),"label:DivHomeContainer;"),Oa=(0,Ie.default)("h2",{target:"ey83qp83"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"18px",margin:"16px auto",fontWeight:"bold",textAlign:"center"}]),"label:H2Title;"),Da=()=>{const e=(0,f.s)("WebApp_Login"),{isModal:t}=(0,s.Ph)(kt.t),{isMobile:o}=(0,Ve.L$)((0,c.U)((()=>["isMobile","playerInfo"]),[])),i=(0,l.Nj)(Ia.q),[a,r]=(0,A.useState)(!1),d=ye(),p=(0,A.useMemo)((()=>{var e;return!(null===(e=(0,rt.parse)(d.search))||void 0===e?void 0:e.hide_left_icon)}),[d]);document.body.className=document.body.className.replace(/\s?hidden/g,"");const{pathname:u,search:g}=d,h=(0,Ft.$H)(u),m=So(),_=(0,lo.K)({query:{enter_method:"sso_auto_popup"},loginPath:"/login/phone-or-email"}),y=(0,lo.K)({query:{enter_method:"sso_auto_popup"},loginPath:i.redirectNewModalPage});(0,A.useEffect)((()=>{i.redirectNewModalPage&&(y(),i.setRedirectNewModalPage())}),[i.redirectNewModalPage]);const b=(0,A.useCallback)((()=>(0,n.jsx)(Oa,{"data-e2e":"login-title",id:"login-modal-title",children:(0,n.jsx)(Yt,{max:18,text:e("qr_code_login_prompt_popup_header")})})),[e,h]),{loginPath:x}=(0,A.useMemo)((()=>{const e=t?g:"";return{loginQRcode:j.tH.loginQRcode+e,loginPath:h?m+e:j.tH.loginPhoneOrEmail+e}}),[t,g,h,m]),v=(0,A.useCallback)((e=>{9===e.keyCode&&r(!0)}),[]),k=(0,A.useMemo)((()=>({show_num:2,order:"GOOGLE,FACEBOOK"})),[]);return(0,A.useEffect)((()=>{tt.f.sendEvent("show_sso_modal")}),[]),_t(),(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(Gt,{showClose:!0,showLeft:p}),(0,n.jsxs)(Fa,{isMobile:o,onKeyDown:v,children:[b(),(0,n.jsxs)(Ra,{disabled:a,children:[(0,n.jsx)(Aa,{signUp:h,platformConfigOverride:k}),(0,n.jsx)(jo,{underline:!1,path:x,children:(0,n.jsx)(so,{text:e(h?"common_registration_panel_button_phoneoremail":"common_login_panel_button_phoneoremailorusername"),Icon:Mn.A,isPopup:!0,onClick:_,focusable:!0})})]})]})]})};var Ha=o(63379),Ua=o(77156);let Na=class extends g.E{constructor(){super(...arguments),this.defaultState={password:""}}setPassword(e,t){e.password=t}setHasInvalid(e,t){e.hasInvalid=t}setLengthValid(e,t){e.lengthValid=t}setContentValid(e,t){e.contentValid=t}updatePassword(e){return e.pipe((0,No.Z)((({value:e})=>{const{hasInvalid:t,contentValid:o,lengthValid:n}=(0,Ua.lY)(e);return(0,$o.of)(this.getActions().setPassword(e),this.getActions().setHasInvalid(t),this.getActions().setLengthValid(n),this.getActions().setContentValid(o))})))}};(0,u.__decorate)([(0,h.uk)(),(0,u.__metadata)("design:type",Go.c)],Na.prototype,"dispose$",void 0),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,String]),(0,u.__metadata)("design:returntype",void 0)],Na.prototype,"setPassword",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Object]),(0,u.__metadata)("design:returntype",void 0)],Na.prototype,"setHasInvalid",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Object]),(0,u.__metadata)("design:returntype",void 0)],Na.prototype,"setLengthValid",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Object]),(0,u.__metadata)("design:returntype",void 0)],Na.prototype,"setContentValid",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],Na.prototype,"updatePassword",null),Na=(0,u.__decorate)([(0,m.n)("SetPasswordModule")],Na);var Ba=o(8615);let $a=class extends g.E{constructor(e,t){super(),this.service=e,this.t=t,this.defaultState={bindPhoneLoading:!1,bindEmailLoading:!1}}setSuccess(e){e.success=!0}setErrorMsg(e,t){e.errorMsg=t}setBindPhoneLoading(e,t){e.bindPhoneLoading=t}setBindEmailLoading(e,t){e.bindEmailLoading=t}checkAndBindPhone(e){return e.pipe((0,No.Z)((e=>this.service.validateAndBindPhone(e).pipe((0,Wn.T)((e=>this.getActions().handleCheckResult(Object.assign(Object.assign({},e),{isPhone:!0})))),(0,Kn.Z)(this.getActions().setBindPhoneLoading(!0)),(0,zo.q)(this.getActions().setBindPhoneLoading(!1))))))}checkAndBindEmail(e){return e.pipe((0,No.Z)((e=>this.service.validateAndBindEmail(e).pipe((0,Wn.T)((e=>this.getActions().handleCheckResult(Object.assign(Object.assign({},e),{isPhone:!1})))),(0,Kn.Z)(this.getActions().setBindEmailLoading(!0)),(0,zo.q)(this.getActions().setBindEmailLoading(!1))))))}handleCheckResult(e){return e.pipe((0,No.Z)((e=>{const{error_code:t,description:o,isPhone:n}=e;return t?(0,$o.of)(this.getActions().setErrorMsg(o)):((0,mn.P)(this.t(n?"login_fb_phoneLinked_toast":"login_fb_emailLinked_toast")),n?Ba._.linkPhoneNumberSuccess():Ba._.linkEmailSuccess(),(0,$o.of)(this.getActions().setSuccess()))})))}};(0,u.__decorate)([(0,h.uk)(),(0,u.__metadata)("design:type",Go.c)],$a.prototype,"dispose$",void 0),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object]),(0,u.__metadata)("design:returntype",void 0)],$a.prototype,"setSuccess",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,String]),(0,u.__metadata)("design:returntype",void 0)],$a.prototype,"setErrorMsg",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Boolean]),(0,u.__metadata)("design:returntype",void 0)],$a.prototype,"setBindPhoneLoading",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Boolean]),(0,u.__metadata)("design:returntype",void 0)],$a.prototype,"setBindEmailLoading",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],$a.prototype,"checkAndBindPhone",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],$a.prototype,"checkAndBindEmail",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],$a.prototype,"handleCheckResult",null),$a=(0,u.__decorate)([(0,m.n)("BindPhoneOrEmailModule"),(0,u.__param)(1,(0,Nn.y)(Bn.hp)),(0,u.__metadata)("design:paramtypes",[Jn.r,Function])],$a);var za=o(44319),Wa=o(18211),Ga=o(3513);const Va={email_verify:"email",pwd_verify:"password",mobile_sms_verify:"phone",totp_verify:"totp"},Ka={email:"email_verify",password:"pwd_verify",phone:"mobile_sms_verify",totp:"totp_verify"};let qa=class extends g.E{constructor(e,t,o,n,i,a){super(),this.service=e,this.third=t,this.login=o,this.loginReport=n,this.phone=i,this.t=a,this.defaultState={loginLoading:!1}}setTwoStepVerifyRes(e,t){var o;const n=t.verify_ways,i={};n.forEach((({verify_way:e,mobile:t,email:o})=>{i[e]=e===Ka.totp?"totp":null!=t?t:o})),e.verifyWays=i,e.type=t.default_verify_way||(null===(o=n[0])||void 0===o?void 0:o.verify_way),e.isTwoStep=Boolean(null==t?void 0:t.default_verify_way),e.thirdQuery=t.thirdQuery,e.accountQuery=t.accountQuery,e.password=t.password,e.verify_ticket=t.verify_ticket,e.not_login_ticket=t.not_login_ticket,e.sms_code_key=t.sms_code_key,e.resetPwdType=t.resetPwdType,e.email=t.email}setTwoStepType(e,t){e.type=t}setErrorMsg(e,t){e.errorMsg=this.overrideErrorMsg(e,t)}setErrorCode(e,t){e.errorCode=t}setLoginLoading(e,t){e.loginLoading=t}handleTOTPVerifyAndRestPwd(e){return e.pipe((0,Vn.E)(this.state$),(0,No.Z)((([e,{verify_ticket:t,resetPwdType:o}])=>{const{code:n,password:i}=e;return this.service.verifyTOTPCode({code:n,verify_ticket:t}).pipe((0,R.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"totp"}))),(0,Si.n)((e=>e.error_code?(0,$o.of)(this.getActions().setErrorCode(e.error_code),this.getActions().setErrorMsg(e.description)):(0,$o.of)(this.login.getActions().handleChangePwdByTicket({password:i,ticket:t,type:null!=o?o:"email"})))),(0,Kn.Z)(this.getActions().setLoginLoading(!0)),(0,zo.q)(this.getActions().setLoginLoading(!1)))})))}handleTOTPVerifyAndSmsLogin(e){return e.pipe((0,Vn.E)(this.state$,this.phone.state$),(0,No.Z)((([e,{sms_code_key:t=""},{mobile:o}])=>this.service.verifyTOTPCode(e).pipe((0,R.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"totp"}))),(0,Si.n)((e=>e.error_code?(0,$o.of)(this.getActions().setErrorCode(e.error_code),this.getActions().setErrorMsg(e.description)):this.service.smsLoginContinue({mobile:o,sms_code_key:t}).pipe((0,Wn.T)((e=>this.login.getActions().handleLoginResult(e))),(0,Kn.Z)(this.getActions().setLoginLoading(!0)),(0,zo.q)(this.getActions().setLoginLoading(!1))))),(0,Kn.Z)(this.getActions().setLoginLoading(!0)),(0,zo.q)(this.getActions().setLoginLoading(!1))))))}handlePasswordVerify(e){return e.pipe((0,Vn.E)(this.state$,this.phone.state$),(0,No.Z)((([e,{sms_code_key:t=""},{mobile:o}])=>this.service.accountVerify(e).pipe((0,R.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"password"}))),(0,Si.n)((e=>e.error_code?(0,$o.of)(this.getActions().setErrorMsg(e.description)):this.service.smsLoginContinue({mobile:o,sms_code_key:t}).pipe((0,Wn.T)((e=>this.login.getActions().handleLoginResult(e))),(0,Kn.Z)(this.getActions().setLoginLoading(!0)),(0,zo.q)(this.getActions().setLoginLoading(!1))))),(0,Kn.Z)(this.getActions().setLoginLoading(!0)),(0,zo.q)(this.getActions().setLoginLoading(!1))))))}handleCodeVerify(e){return e.pipe((0,Vn.E)(this.state$),(0,No.Z)((([e,{type:t="",thirdQuery:o,accountQuery:n}])=>o||n?(t===Ka.email?this.service.validateEmailCodeForLogin(e):t===Ka.totp?this.service.verifyTOTPCode(e):this.service.validateMobileCodeForLogin(e)).pipe((0,R.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:Va[t]}))),(0,Si.n)((e=>e.error_code?(0,$o.of)(this.getActions().setErrorCode(e.error_code),this.getActions().setErrorMsg(e.description)):o?(0,$o.of)(this.third.getActions().thirdLogin(o)):n?(0,$o.of)(this.login.getActions().handlePasswordLogin(n)):(0,$o.of)(this.noop()))),(0,Kn.Z)(this.getActions().setLoginLoading(!0)),(0,zo.q)(this.getActions().setLoginLoading(!1))):t===Ka.totp?(0,$o.of)(this.getActions().handleTOTPVerifyAndSmsLogin(e)):(0,$o.of)(this.getActions().handleEmailCodeVerify(e)))))}handleEmailCodeVerify(e){return e.pipe((0,No.Z)((e=>this.service.emailCodeLogin(e).pipe((0,R.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"email"}))),(0,Wn.T)((e=>this.login.getActions().handleLoginResult(e))),(0,Kn.Z)(this.getActions().setLoginLoading(!0)),(0,zo.q)(this.getActions().setLoginLoading(!1))))))}handleSmsCodeVerifyReset(e){return e.pipe((0,No.Z)((e=>this.service.validateMobileCodeForReset(e).pipe((0,R.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"phone"}))),(0,Wn.T)((e=>this.login.getActions().handleLoginResult(e))),(0,Kn.Z)(this.getActions().setLoginLoading(!0)),(0,zo.q)(this.getActions().setLoginLoading(!1))))))}reportTwoStepResult(e){this.loginReport.twoStepResult({verification_method:e.type,result:e.error_code?"fail":"success",error_code:e.error_code})}overrideErrorMsg(e,t){if(!t||!e.errorCode)return t;if(Ga._j.includes(e.errorCode)&&Ga.rS[e.errorCode]){const t=Ga.rS[e.errorCode];return this.t(t)}return t}};(0,u.__decorate)([(0,h.uk)(),(0,u.__metadata)("design:type",Go.c)],qa.prototype,"dispose$",void 0),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Object]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"setTwoStepVerifyRes",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Object]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"setTwoStepType",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,String]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"setErrorMsg",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Number]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"setErrorCode",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Boolean]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"setLoginLoading",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"handleTOTPVerifyAndRestPwd",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"handleTOTPVerifyAndSmsLogin",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"handlePasswordVerify",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"handleCodeVerify",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"handleEmailCodeVerify",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],qa.prototype,"handleSmsCodeVerifyReset",null),qa=(0,u.__decorate)([(0,m.n)("TwoStepModule"),(0,u.__param)(5,(0,Nn.y)(Bn.hp)),(0,u.__metadata)("design:paramtypes",[Jn.r,ji,Ae.$,T.$F,za.U,Function])],qa);let Za=class extends g.E{constructor(e,t){super(),this.service=e,this.history=t,this.defaultState={checkCodeLoading:!1,ticket:"",type:"phone"}}setErrorMsg(e,t){e.errorMsg=t}setTicket(e,t){e.ticket=t}setType(e,t){e.type=t}setForceResetTicket(e,t){e.conditional_login_ticket=t}setCheckCodeLoading(e,t){e.checkCodeLoading=t}checkEmailCodeForReset(e){return e.pipe((0,No.Z)((e=>this.service.validateEmailCodeForReset(e).pipe((0,Wn.T)((e=>(e.resetType="email",this.getActions().handleCheckResult(e)))),(0,Kn.Z)(this.getActions().setCheckCodeLoading(!0)),(0,zo.q)(this.getActions().setCheckCodeLoading(!1))))))}checkPhoneCodeForReset(e){return e.pipe((0,No.Z)((e=>this.service.validatePhoneCodeForReset(e).pipe((0,Wn.T)((e=>(e.resetType="phone",this.getActions().handleCheckResult(e)))),(0,Kn.Z)(this.getActions().setCheckCodeLoading(!0)),(0,zo.q)(this.getActions().setCheckCodeLoading(!1))))))}checkCodeForForceReset(e){return e.pipe((0,No.Z)((e=>{var{type:t}=e,o=(0,u.__rest)(e,["type"]);return("email"===t?this.service.validateEmailCodeForForceReset(o):this.service.validatePhoneCodeForForceReset(o)).pipe((0,Wn.T)((e=>(e.resetType=t,e.forceTicket=o.conditional_login_ticket,this.getActions().handleCheckResult(e)))),(0,Kn.Z)(this.getActions().setCheckCodeLoading(!0)),(0,zo.q)(this.getActions().setCheckCodeLoading(!1)))})))}handleCheckResult(e){return e.pipe((0,No.Z)((e=>{const{ticket:t,description:o,resetType:n,forceTicket:i}=e;return t?(this.history.push(j.tH.resetPassword),(0,$o.of)(this.getActions().setTicket(t),this.getActions().setType(n),this.getActions().setForceResetTicket(i))):(0,$o.of)(this.getActions().setErrorMsg(o))})))}};function Ja(e=[]){var t,o;const[{errorMsg:n},i]=(0,s.Su)(Ae.$),[{errorMsg:a},r]=(0,s.Su)(ko.H),[{errorMsg:l},d]=(0,s.Su)($a),{phone:c,areaCode:p}=(0,s.Ph)(za.U),{email:u}=(0,s.Ph)(Ha.N),[{code:g},{clearGetCodeError:h}]=(0,s.Su)(Wa.m),{password:m}=(0,s.Ph)(Na),[{errorMsg:_},{setErrorMsg:y,setErrorCode:b}]=(0,s.Su)(qa),{setErrorMsg:x}=(0,s.wA)(Za),{abTestVersion:v}=null!==(t=(0,Ze.W)((()=>["abTestVersion"]),[]))&&void 0!==t?t:{},k=null!==(o=(0,Ye.qt)(v,"login_modal_ui_revamp"))&&void 0!==o?o:"v1",[C,S]=(0,A.useState)(""),w=n||a||_||l,T=(0,f.s)("WebApp_Login"),{pathname:P}=ye();return(0,A.useEffect)((()=>{w&&("v1"===k&&P===j.tH.loginHome||P===j.tH.signupAgeGate?(0,mn.P)(T(w)):S(w))}),[T,w,P]),(0,A.useEffect)((()=>{i.clearLoginResult(),r.setErrorMsg(""),d.setErrorMsg(""),h(),S(""),x("")}),[c,p,u,g,i,r,d,m,...e]),(0,A.useEffect)((()=>()=>{i.clearLoginResult(),r.clearSignUpResult(),h(),S(""),y(""),b(0)}),[]),C}function Ya(){const{phone:e,areaCode:t}=(0,s.Ph)(za.U),{email:o}=(0,s.Ph)(Ha.N),[{code:n,getCodeErrorMsg:i},{clearGetCodeError:a}]=(0,s.Su)(Wa.m);return(0,A.useEffect)((()=>{a()}),[e,t,o,n,a]),i}(0,u.__decorate)([(0,h.uk)(),(0,u.__metadata)("design:type",Go.c)],Za.prototype,"dispose$",void 0),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,String]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"setErrorMsg",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,String]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"setTicket",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,String]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"setType",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,String]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"setForceResetTicket",null),(0,u.__decorate)([(0,h.h5)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Object,Boolean]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"setCheckCodeLoading",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"checkEmailCodeForReset",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"checkPhoneCodeForReset",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"checkCodeForForceReset",null),(0,u.__decorate)([(0,h.Mj)(),(0,u.__metadata)("design:type",Function),(0,u.__metadata)("design:paramtypes",[Go.c]),(0,u.__metadata)("design:returntype",void 0)],Za.prototype,"handleCheckResult",null),Za=(0,u.__decorate)([(0,m.n)("CheckDigitCodeModule"),(0,u.__metadata)("design:paramtypes",[Jn.r,vo.D])],Za);const Qa=(0,A.memo)((function(e){const t=(0,A.useCallback)((t=>{var o;t.preventDefault(),null===(o=e.onSubmit)||void 0===o||o.call(e)}),[e]);return(0,n.jsx)("form",{onSubmit:t,style:e.style,children:e.children})}));var Xa=o(51594),er=o(81079),tr=o(23359),or=o(75778);const nr=(0,Ie.default)("div",{target:"etcs7ny0"})({position:"relative",marginBottom:"9px"},"label:DivInputContainer;"),ir=(e,t,o)=>e?{background:"transparent",border:"none",borderRadius:"0",paddingInlineStart:"0px",borderBottom:t?"1px solid":"none"}:{borderRadius:"2px",backgroundColor:o.BGInput,border:t?"1px solid":"none",paddingInlineStart:"12px"},ar=(0,Ie.default)("input",{target:"etcs7ny1"})((({theme:{colors:e,isMobile:t},border:o=!1,errorState:n=!1,hasIconPadding:i})=>[ir(t,o,e),{"::placeholder":{color:e.TextQuaternary},color:n?e.Negative:e.TextPrimary,lineHeight:"100%",outline:"none",fontSize:"16px",height:"44px",caretColor:e.Primary,width:"100%",borderColor:n?e.Negative:e.LineSecondary2,paddingInlineEnd:i?"24px":"unset"}]),"label:InputContainer;"),rr=(0,Ie.default)("div",{target:"etcs7ny2"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,end:"0"}),{display:"flex",alignItems:"center",position:"absolute",top:0,height:"44px",paddingInlineEnd:e.isMobile?"4px":"16px"}]),"label:DivIconContainer;"),sr=(0,Ie.default)("i",{target:"etcs7ny3"})({lineHeight:"0",marginInlineStart:"16px",cursor:"pointer",fontSize:"20px",opacity:"50%"},"label:IPasswordIcon;"),lr=(0,Ie.default)("i",{target:"etcs7ny4"})((({theme:e})=>[{fontSize:"16px",lineHeight:"0",color:e.colors.LineInverse}]),"label:IDeleteIcon;"),dr=(0,A.memo)((function(e){const{errorState:t,value:o,placeholder:i,password:a=!1,className:r,border:s=!0,style:l,autocomplete:d,name:p,autoFocus:u,disableDelete:g,readonly:h=!1,onInput:m=()=>{},onChange:_=()=>{}}=e,y=(0,f.s)(),[b,x]=(0,A.useState)("text"),{isMobile:v}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[]));(0,A.useEffect)((()=>{a&&x("password")}),[a]);const k=(0,A.useCallback)((()=>{x("text")}),[]),C=(0,A.useCallback)((()=>{x("password")}),[]),S=(0,A.useCallback)((()=>{const e={target:{value:""}};_(e),m(e)}),[_,m]),w=(0,A.useCallback)((e=>{_(e)}),[_]),j=(0,A.useCallback)((e=>{13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),e.stopPropagation(),"password"===b?k():C())}),[C,k,b]),T=Boolean((null==o?void 0:o.length)&&v&&!g),P=a&&(!v||g),E=P||T;return(0,n.jsxs)(nr,{className:r,style:l,children:[(0,n.jsx)(ar,{autoFocus:u,value:o,type:b,inputMode:e.inputMode,errorState:t,placeholder:i,onChange:w,onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput,border:s,autoComplete:d,name:p,readOnly:h,hasIconPadding:E}),(0,n.jsxs)(rr,{children:[t&&!v&&(0,n.jsx)(tr.A,{fill:"rgba(254, 44, 85, 1.0)"}),P&&("password"===b?(0,n.jsx)(sr,{onClick:k,onKeyDown:j,tabIndex:0,role:"button","aria-label":y("accessibilityLabels_login_modal_eyeClosedIcon"),"aria-pressed":!1,children:(0,n.jsx)(Xa.A,{})}):(0,n.jsx)(sr,{onClick:C,onKeyDown:j,tabIndex:0,role:"button","aria-label":y("accessibilityLabels_login_modal_eyeOpenIcon"),"aria-pressed":!0,children:(0,n.jsx)(er.A,{})})),T&&(0,n.jsx)(lr,{onClick:S,children:(0,n.jsx)(or.A,{})})]})]})}));var cr=o(96973);const pr=(0,Ie.default)("div",{target:"e3v3zbj0"})((({theme:e,type:t})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont"}),{fontSize:"12px",lineHeight:"15px",margin:"4px 0",color:"error"===t?e.colors.Negative:"success"===t?e.colors.Positive:e.colors.TextTertiary,display:"flex",svg:{marginInlineEnd:"4px"}}]),"label:DivTextContainer;"),ur=(0,A.memo)((({text:e,type:t="default",children:o,style:i,errorIcon:a})=>(0,n.jsxs)(pr,{type:t,style:i,"aria-live":"assertive",children:[a&&(0,n.jsx)(tr.A,{fill:"rgba(254, 44, 85, 1.0)","aria-hidden":!0}),o,(0,n.jsx)("span",{role:"status",children:e})]}))),gr=(0,Ie.default)("div",{target:"e1bi0g3c0"})({marginBottom:"9px"},"label:DivContainer;"),hr=(0,Ie.default)("p",{target:"e1bi0g3c1"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"semiBold"}),{margin:"4px 0"}]),"label:PDescriptionTitleContainer;"),mr=(0,A.memo)((function(e){const{loginErrorText:t="",autoFocus:o,create:i=!0,loginError:a}=e,[{password:r,hasInvalid:l,lengthValid:d,contentValid:p},{updatePassword:u}]=(0,s.Su)(Na),{isMobile:g}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),h=(0,f.s)("WebApp_Login"),[m,_]=(0,A.useState)(!1),y=(0,A.useCallback)((()=>{_(!0)}),[]),b=(0,A.useCallback)((()=>{_(!1)}),[]),x=(0,A.useCallback)((e=>{u({value:e.target.value})}),[u]);(0,A.useEffect)((()=>()=>{u({value:""})}),[]);const v=i&&(!1===d||!1===p)&&(g||!m),k=(!d||!p)&&r||m||g,C=!1!==d||!g&&m?!0===d?"success":"default":"error",S=!1!==p||!g&&m?!0===p?"success":"default":"error";return(0,n.jsxs)(gr,{children:[(0,n.jsx)(dr,{"data-e2e":"passward-input",autoFocus:o,placeholder:h("Password"),onFocus:y,onBlur:b,onChange:x,value:r,errorState:v||Boolean(t)||a,password:!0,autocomplete:"new-password",disableDelete:i}),Boolean(t)&&(0,n.jsx)(ur,{errorIcon:!0,text:h(t),type:"error"}),l&&(0,n.jsx)(ur,{errorIcon:g,text:h("createpw_error_6"),type:"error"}),k&&i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(hr,{children:h("common_registration_password_pc_text")}),(0,n.jsx)(ur,{text:h("common_registration_password_pc_1"),type:C,children:(0,n.jsx)(cr.A,{fill:"success"===C?"rgba(11, 224, 155, 1.0)":"rgba(22,24,35,.5)"})}),(0,n.jsx)(ur,{text:h("createpw_helptext_2"),type:S,children:(0,n.jsx)(cr.A,{fill:"success"===S?"rgba(11, 224, 155, 1.0)":"rgba(22,24,35,.5)"})})]})]})})),_r=(0,Ie.default)(Fe.y,{target:"e1w6iovg0"})((({theme:e})=>[{width:"100%",marginTop:e.isMobile?"32px":"21px"}]),"label:StyledButton;"),fr=e=>{const{children:t}=e,o=(0,u.__rest)(e,["children"]);return(0,n.jsx)(_r,Object.assign({type:"submit",buttonTheme:"primary",size:"largeNew"},o,{children:t}))},yr=(0,Ie.default)(jo,{target:"erbpmjz0"})({size:"16px",lineHeight:"21px",fontWeight:"500",color:"black",display:"inline-block"},"label:StyledTvLoginLink;"),br=(0,Ie.default)("div",{target:"erbpmjz1"})((({theme:e})=>({left:"50%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:e.isMobile?"100%":"",marginTop:e.isMobile?"":"-36px"})),"label:DivTvLoginContainer;"),xr=(0,Ie.default)(fr,{target:"erbpmjz2"})((({theme:e})=>({marginTop:e.isMobile?"24px":"18px",marginBottom:e.isMobile?"80px":"40px",width:"100%",height:"48px",borderRadius:"2px"})),"label:StyledTVloginButton;"),vr=(0,Ie.default)("h1",{target:"erbpmjz3"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont",fontWeight:"bold"}),{fontSize:"24px",lineHeight:"30px",textAlign:"center"}]),"label:H1Title;"),kr=(0,Ie.default)("div",{target:"erbpmjz4"})((({theme:e})=>({width:e.isMobile?"306px":"358px",minHeight:"55px",height:"100%",display:"flex",marginTop:"26px",flexDirection:"column",justifyContent:"center"})),"label:DivInputContainer;"),Cr=(0,Ie.default)("div",{target:"erbpmjz6"})((({theme:e})=>({width:e.isMobile?"306px":"358",display:"flex",flexDirection:"column",justifyContent:"center",marginTop:"26px"})),"label:DivLandingLoginBodyContainer;"),Sr=(0,Ie.default)("div",{target:"erbpmjz7"})((({theme:e})=>({width:e.isMobile?"306px":"326px",display:"flex",flexDirection:"column",justifyContent:"center"})),"label:DivEmailPhoneLoginBodyContainer;"),wr=(0,Ie.default)("div",{target:"erbpmjz8"})((({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:e.isMobile?"333px":"482px"})),"label:DivOrContinueWithContainer;"),jr=(0,Ie.default)("div",{target:"erbpmjz9"})((({theme:e})=>[{width:e.isMobile?"80px":"86px",height:"1px",background:e.colors.LineReverse2}]),"label:DivSeparatorLine;"),Tr=(0,Ie.default)("div",{target:"erbpmjz10"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokDisplayFont"}),{fontSize:"20px",fontWeight:"400",lineHeight:"26px",color:e.colors.TextTertiary2,margin:"0 15px",whiteSpace:"nowrap"}]),"label:DivSeparatorText;"),Pr=(0,Ie.default)("div",{target:"erbpmjz11"})((({theme:e})=>({width:e.isMobile?"100%":"482px",marginTop:e.isMobile?"20px":"24px"})),"label:DivThirdPartyContainer;"),Er=(0,Ie.default)("div",{target:"erbpmjz12"})({width:"100%"},"label:DivTvLoginLinkContainer;"),Mr=(0,Ie.default)("div",{target:"erbpmjz13"})({width:"100%",display:"flex",marginTop:"8px",marginBottom:"24px",justifyContent:"center",alignItems:"center"},"label:DivPhoneNumberTextContainer;"),Lr=(0,Ie.default)("h4",{target:"erbpmjz14"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontWeight:"400",fontSize:"15px",lineHeight:"20px",textAlign:"center"}]),"label:H4EnterCodePhoneNumber;"),Ar=(0,Ie.default)("h4",{target:"erbpmjz15"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextTertiaryAlt",fontFamily:"TikTokFont"}),{fontWeight:"400",fontSize:"14px",lineHeight:"20px",textAlign:"center",marginRight:"4px"}]),"label:H4EnterCodeDescription;"),Ir=({text:e,path:t,onClick:o,replace:i=!1})=>{const a=(0,A.useCallback)((e=>{13===e.keyCode&&o()}),[o]);return(0,n.jsx)(yr,{onClick:o,onKeyDown:a,text:e,path:t,replace:i})},Rr=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),t=fn(),{setEmail:o}=(0,s.wA)(Ha.N),{email:i=""}=(0,s.Ph)(Ha.N),[a,r]=(0,A.useState)(i),{password:l,hasInvalid:d}=(0,s.Ph)(Na),[{loginLoading:c},{handlePasswordLogin:p}]=(0,s.Su)(Ae.$),u=Ja([a]),g=(0,A.useCallback)((()=>{const e=(0,Ua.Ro)(a)?a:void 0;t({platform:e?"email":"handle"}),p({username:a.trim(),password:l,email:e})}),[p,t,l,a]),h=(0,A.useCallback)((e=>{r(e.target.value),o(e.target.value)}),[r,o]),m=(0,A.useCallback)((()=>{(0,Ua.Ro)(a)?o(a):o("")}),[a,o]);return _t(),(0,n.jsx)(Qa,{onSubmit:g,children:(0,n.jsxs)(br,{children:[(0,n.jsx)(vr,{children:e("tv_webLogin_login_header")}),(0,n.jsxs)(Sr,{style:{marginTop:"24px"},children:[(0,n.jsx)(dr,{onChange:h,name:"username",value:a,placeholder:e("Email or Username"),"data-e2e":"email-input"}),(0,n.jsx)(mr,{create:!1,loginError:Boolean(u)}),u&&(0,n.jsx)(ur,{text:e(u),type:"error"}),(0,n.jsx)(Er,{children:(0,n.jsx)(Ir,{onClick:m,text:e("forget_password"),path:j.tH.loginForgetEmailPassword})}),(0,n.jsx)(xr,{disabled:!a||!l||d,loading:c,"data-e2e":"login-button",style:{marginTop:"48px"},children:e("Login")})]})]})})})),Fr=[j.tH.loginEmail,j.tH.loginPhone,j.tH.signupPhone,j.tH.signupEmail,j.tH.loginHome,j.tH.signupHome],Or="signup-email-consent-label",Dr="phone-country-code-selector-wrapper";var Hr=o(54502),Ur=o(25919);const Nr=(0,Ie.default)("ul",{target:"e2hldqz0"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),{padding:"0",margin:0}]),"label:UlListContainer;"),Br=(0,Ie.default)("li",{target:"e2hldqz1"})((({theme:e,selected:t})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary2"}),()=>t&&{backgroundColor:"rgba(22, 24, 35, .03)"},{display:"flex",padding:"0 12px",justifyContent:"space-between",alignItems:"center",height:"34px",lineHeight:"34px",fontSize:"13px"},{":hover":{backgroundColor:"rgba(22, 24, 35, .03)"}}]),"label:LiListItem;"),$r=(0,Ie.default)("span",{target:"e2hldqz2"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary"}),{paddingInlineEnd:"4px"}]),"label:SpanItemName;"),zr=(0,Ie.default)("span",{target:"e2hldqz3"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextSecondary"})]),"label:SpanItemCode;"),Wr=(0,Ie.default)("li",{target:"e2hldqz4"})({margin:0,padding:0,display:"block"},"label:LiAreaCodeOptionWrapper;"),Gr=(0,Ie.default)("ul",{target:"e2hldqz5"})({margin:0,padding:0,display:"block",listStyleType:"none"},"label:UlAreaCodeOptionsGroupContainer;"),Vr="area-number-pick-ul",Kr="#login-phone-search",qr=({filterCountryList:e=[],onSelected:t,searchText:o,currentSelectCode:i,matchSearchArea:a,onKeyDownWithEmptyResult:r})=>{const{isMobile:s}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),l=(0,f.s)("WebApp_Login"),d=RegExp(o.replace("+","\\+"),"ig"),p=(0,A.useCallback)((({code:e,shortname:o})=>()=>{t({code:e,area:o})}),[t]),u=(0,A.useCallback)((e=>{var n,i;if(e.stopPropagation(),9===e.keyCode&&e.shiftKey)return e.preventDefault(),void(null===(n=document.querySelector(Kr))||void 0===n||n.focus());if(13!==e.keyCode&&32!==e.keyCode)9!==e.keyCode||!o||a||null==r||r();else if(e.target){const o=null===(i=e.target)||void 0===i?void 0:i.getAttribute("id");if(!o)return;const[n,a]=o.split("-");try{t({code:a,area:n})}catch(e){console.error(e)}}}),[a,r,t,o]),g=(0,A.useCallback)((e=>{var t,o,n,i,a;try{const r=Array.from(null!==(o=null===(t=document.querySelector(`#${Vr}`))||void 0===t?void 0:t.children)&&void 0!==o?o:[]).reverse().find((e=>e.children.length>0));(null===(i=Array.from(null!==(n=null==r?void 0:r.children)&&void 0!==n?n:[]).reverse())||void 0===i?void 0:i[0])===e.target&&(null===(a=document.querySelector(Kr))||void 0===a||a.focus())}catch(e){console.error(e)}}),[]);return(0,n.jsxs)(Nr,{onKeyDown:u,id:Vr,role:"listbox",children:[Ur.W.map((t=>{const{label:a,lists:r}=t;return(0,n.jsx)(Wr,{children:(0,n.jsx)(Gr,{id:a,role:"group",children:r.map(((t,a)=>{const{name:r,code:l,shortname:c}=t;if(-1!==e.indexOf(c))return null;if(o&&!(r.match(d)||`+${l}`.match(d)||c.match(d)))return null;const u=`${i}`==`${l}`;return(0,n.jsx)(Br,{index:a,id:`${c}-${l}`,selected:u,tabIndex:0,onClick:p({shortname:c,code:l}),onKeyDown:g,role:"option","aria-selected":u,children:s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($r,{children:r}),(0,n.jsx)(zr,{children:`+${l}`})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($r,{dangerouslySetInnerHTML:{__html:(h=`${r} +${l}`,o?h=h.replace(d,(e=>`${e}`)):h)}}),u&&(0,n.jsx)(Hr.A,{width:16,height:16,fill:"#000"})]})},r+l);var h}))},a)},a)})),o&&!a&&(0,n.jsx)(Br,{selected:!1,style:{justifyContent:"center"},role:"status",children:l("registration_phone_search_empty")})]})};var Zr=o(81825);const Jr=(0,Ie.default)("div",{target:"emwsnhg0"})((({theme:{colors:e}})=>({top:"45px",height:"35px",width:"326px",boxSizing:"border-box",borderBottom:`1px solid ${e.LineSecondary}`,background:e.BGPrimary,marginTop:"4px",display:"flex",justifyContent:"space-between",flexShrink:0})),"label:DivSearchContainer;"),Yr=(0,Ie.default)("div",{target:"emwsnhg1"})((({theme:e})=>({margin:"0 15px",color:e.colors.LineInput,display:"flex",alignItems:"center"})),"label:DivSearchIcon;"),Qr=(0,Ie.default)("input",{target:"emwsnhg2"})((({theme:e})=>({outline:"none",border:"none",flex:"1",color:e.colors.TextPrimary,background:e.colors.BGPrimary,caretColor:e.colors.Primary})),"label:InputSearch;"),Xr=({searchText:e,onKeyDownWithEmptyResult:t})=>{const o=(0,f.s)("WebApp_Login"),{matchSearchArea:i}=(0,s.Ph)(za.U),{setAreaSearchText:a,selectAreaCode:r}=(0,s.wA)(za.U),l=(0,A.useCallback)((e=>{a(e.target.value)}),[a]),d=(0,A.useCallback)((e=>{13===e.keyCode&&i&&r({code:i.code,area:i.shortname})}),[i,r]),c=(0,A.useCallback)((o=>{9===o.keyCode&&(e&&!i||o.shiftKey)&&(null==t||t())}),[i,t,e]);return(0,A.useEffect)((()=>()=>{a("")}),[a]),(0,n.jsxs)(Jr,{children:[(0,n.jsx)(Yr,{children:(0,n.jsx)(Zr.A,{width:14,height:14})}),(0,n.jsx)(Qr,{id:"login-phone-search",autoFocus:!0,maxLength:35,onKeyUp:d,placeholder:o("registration_phone_search_placeholder"),onChange:l,onKeyDown:c})]})},es=(0,Ie.default)("div",{target:"e1llxcni0"})((({theme:e,maxHeight:t})=>[(0,Re.mp)({direction:e.direction,start:"0"}),{maxHeight:t||"320px",background:e.colors.BGPrimary,border:"0.5px solid rgba(22, 24, 35, 0.12)",boxSizing:"border-box",boxShadow:"0px 2px 12px rgba(0, 0, 0, 0.12)",borderRadius:"4px",position:"absolute",top:"54px",display:"flex",flexDirection:"column",zIndex:2}]),"label:DivSelectorContainer;"),ts=(0,Ie.default)("div",{target:"e1llxcni1"})({flex:"1",overflow:"auto"},"label:DivListWrapper;"),os=(0,Ie.default)("div",{target:"e1llxcni2"})({position:"fixed",zIndex:11,top:0,bottom:0,left:0,right:0,background:"#fff",overflowY:"auto"},"label:DivPageSelectorContainer;"),ns=(0,Ie.default)("div",{target:"e1llxcni3"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,paddingEnd:"32px",paddingStart:"16px"}),{marginTop:"44px",borderTop:`1px solid ${e.colors.LineSecondary}`}]),"label:DivPageSelector;"),is=e=>(0,n.jsxs)(es,{id:Dr,maxHeight:e.maxHeight,children:[(0,n.jsx)(Xr,{searchText:e.searchText,onKeyDownWithEmptyResult:e.onKeyDownWithEmptyResult}),(0,n.jsx)(ts,{children:(0,n.jsx)(qr,{matchSearchArea:e.matchSearchArea,filterCountryList:e.filterCountryList,onSelected:e.onSelected,currentSelectCode:e.currentSelectCode,searchText:e.searchText,onKeyDownWithEmptyResult:e.onKeyDownWithEmptyResult})})]});function as(e){const{region:t,appType:o}=(0,Ve.L$)((0,Ze.W)((()=>["region","appType"]),[])),[n,i]=(0,s.Su)(za.U),{areaCode:a}=n;(0,A.useEffect)((()=>{if(!a){let n=!1;if(Ur.W.forEach((({lists:e})=>e.forEach((({code:e,shortname:o})=>{o===t&&(n=!0,i.selectAreaCode({code:e,area:o}))})))),!n){let t="m"===o?{code:1,area:"US"}:{code:81,area:"JP"};(null==e?void 0:e.find((e=>e===t.area)))&&(t={code:1,area:"CA"}),i.selectAreaCode(t)}}}),[o,t,a,i,e])}var rs=o(92681);const ss=(0,Ie.default)("div",{target:"ewblsjs0"})({marginBottom:"9px"},"label:DivContainer;"),ls=(0,Ie.default)(dr,{target:"ewblsjs1"})((({theme:e})=>({flex:1,width:0,marginBottom:"0","& > input":{background:"transparent!important","&:-webkit-autofill":{"-webkit-box-shadow":`0 0 0 30px ${e.isDark?"#3f3f3f":"#f1f1f2"} inset !important`,"-webkit-text-fill-color":e.colors.TextPrimary}}})),"label:StyledBaseInput;");ls.defaultProps=Object.assign(Object.assign({},ls.defaultProps),{"data-e2e":"phone-number-input"});const ds=(0,Ie.default)("div",{target:"ewblsjs2"})((({theme:{colors:e},errState:t})=>[{background:e.BGInput,border:`1px solid ${e.LineSecondary2}`,transition:"all 0.3s",borderRadius:"4px",display:"flex"},()=>t?{border:`1px solid ${e.Negative}`,input:{color:e.Negative}}:{}]),"label:DivPhoneInputContainer;"),cs=(0,Ie.default)("div",{target:"ewblsjs3"})({position:"relative",cursor:"pointer"},"label:DivAreaSelectionContainer;"),ps=(0,Ie.default)("div",{target:"ewblsjs4"})((({theme:{colors:e,direction:t}})=>[{display:"flex",alignItems:"center",justifyContent:"space-between",position:"relative",padding:"12px",height:"44px","::after":{content:'""',width:"1px",height:"30px",background:e.LineSecondary,right:"rtl"===t?"unset":"0",left:"rtl"===t?"0":"unset",position:"absolute"}}]),"label:DivAreaLabelContainer;"),us=(0,Ie.default)("span",{target:"ewblsjs5"})((({theme:{colors:e}})=>[{fontSize:"16px",lineHeight:1,color:e.TextPrimary,marginInlineEnd:"12px"}]),"label:SpanLabelContainer;"),gs=(0,Ie.default)(rs.A,{target:"ewblsjs7"})((({up:e})=>[{transform:e?"rotateZ(180deg)":"rotateZ(0deg)",transition:"all .3S"}]),"label:StyledArrowIcon;"),hs=(0,A.memo)((function({errorStatus:e,filterCountryList:t}){as(t);const o=(0,A.useRef)(null),[i,a]=(0,s.Su)(za.U),{area:r,areaCode:l,phoneErrorMsg:d,showAreaCodeSelector:c,searchText:p,phone:u,matchSearchArea:g}=i,[h,m]=(0,A.useState)(!1),{checkPhoneNumberFormat:_}=a,{toggleAreaCodeSelector:y,selectAreaCode:b}=a,x=(0,f.s)("WebApp_Login"),v=(0,A.useCallback)((e=>{var t;c&&!(null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.contains(e.target))&&y()}),[c,y]);(0,A.useEffect)((()=>(window.addEventListener("mousedown",v),()=>{window.removeEventListener("mousedown",v)})),[a,v]);const k=(0,A.useCallback)((e=>{_({phone:e.target.value})}),[_]),C=(0,A.useCallback)((()=>{m(!0)}),[]),S=(0,A.useCallback)((()=>{m(!1)}),[]),w=(0,A.useCallback)((({code:e,area:t})=>{b({code:e,area:t})}),[b]),j=(0,A.useCallback)((e=>{13!==e.keyCode&&32!==e.keyCode||y()}),[y]),T=Boolean((d||e)&&!h),P=(0,A.useMemo)((()=>`${r} +${l}`),[r,l]);return(0,n.jsxs)(ss,{children:[(0,n.jsxs)(ds,{errState:T,children:[(0,n.jsxs)(cs,{ref:o,children:[(0,n.jsxs)(ps,{onClick:y,onKeyDown:j,tabIndex:0,role:"button","aria-haspopup":"true","aria-expanded":c,"aria-controls":Dr,"aria-label":x("accessibilityLabels_login_form_placeholder_countryCode",{readPhoneCountryCode:P}),children:[(0,n.jsx)(us,{children:P}),(0,n.jsx)(gs,{up:c})]}),c&&(0,n.jsx)(is,{matchSearchArea:g,filterCountryList:t,onSelected:w,currentSelectCode:l,searchText:p,onKeyDownWithEmptyResult:y})]}),(0,n.jsx)(ls,{value:u,border:!1,errState:T,placeholder:x("phone_number"),onChange:k,onFocus:C,onBlur:S,name:"mobile",autocomplete:"tel-national",type:"tel"})]}),T&&(0,n.jsx)(ur,{text:x(d||e||""),type:"error"})]})}));var ms=o(34393),_s=o(65404);const fs=({loginData:e})=>{const{isMobile:t}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),o=e.icon,i=t?24:30;return(0,n.jsx)(ut,{onClick:e.onClick,onKeyDown:e.onClick,tabIndex:0,role:"link",children:(0,n.jsx)(o,{width:i,height:i})})},ys=({platformConfigOverride:e,foldSize:t=2})=>{let{platformConfig:o}=St((()=>["platformConfig"]),[]);e&&(o=e);const i=[...o.order.toLowerCase().split(",").filter((e=>"instagram"!==e))],a=Fi(i),r=Ri(a),[s,l]=(0,A.useState)(!1),d={expand:r.filter((e=>a.slice(0,t).includes(e.type))),fold:r.filter((e=>a.slice(t).includes(e.type)))},c=(0,A.useCallback)((()=>{l(!0)}),[]),p=(0,A.useCallback)((()=>{l(!1)}),[]),u=(0,A.useCallback)((e=>{13===e.keyCode&&l(!0)}),[l]),g=(0,A.useCallback)((e=>{13===e.keyCode&&l(!1)}),[l]);return s?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(dt,{children:[(0,n.jsx)(pt,{onClick:p,onKeyDown:g,tabIndex:0,role:"button",children:(0,n.jsx)(_s.p,{size:16})}),d.fold.map((e=>(0,n.jsx)(fs,{loginData:e},e.type)))]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(dt,{children:[d.expand.map((e=>(0,n.jsx)(fs,{loginData:e},e.type))),d.fold.length>0&&(0,n.jsx)(ct,{onClick:c,onKeyDown:u,tabIndex:0,role:"button",children:(0,n.jsx)(ms.a,{size:16})})]})})},bs=(0,Ie.default)("div",{target:"eybrrr40"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,end:"0"}),{width:"20px",position:"fixed",top:"50%",transform:"translateY(-50%)",textAlign:"center"}]),"label:DivLetterListContainer;"),xs=(0,Ie.default)("div",{target:"eybrrr41"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont"}),{fontWeight:600,fontSize:"12px",lineHeight:"14px",color:"rgba(22, 24, 35, .5)"}]),"label:DivLetterItem;"),vs=e=>(0,n.jsx)(bs,{children:Ur.W.map((t=>(0,n.jsx)(xs,{onClick:e.onClick(t.label),children:t.label},t.label)))}),ks=e=>{const{onClose:t}=e,o=(0,u.__rest)(e,["onClose"]),i=(0,f.s)("WebApp_Login"),a=(0,A.useRef)(null),r=(0,A.useCallback)((e=>()=>{var t,o;const n=document.getElementById(e);null===(t=null==a?void 0:a.current)||void 0===t||t.scrollTo(0,null!==(o=null==n?void 0:n.offsetTop)&&void 0!==o?o:0)}),[]);return(0,n.jsxs)(os,{ref:a,children:[(0,n.jsx)(Gt,{onClose:e.onClose,showRight:!1,title:i("select_region"),showClose:!0}),(0,n.jsxs)(ns,{children:[(0,n.jsx)(qr,Object.assign({},o)),(0,n.jsx)(vs,{onClick:r})]})]})},Cs=(0,Ie.default)("div",{target:"eex98o0"})({marginBottom:"12px"},"label:DivContainer;"),Ss=(0,Ie.default)(dr,{target:"eex98o1"})({flex:1,width:0,marginBottom:"0"},"label:StyledBaseInput;");Ss.defaultProps=Object.assign(Object.assign({},Ss.defaultProps),{"data-e2e":"phone-number-input"});const ws=(0,Ie.default)("div",{target:"eex98o2"})((({theme:{colors:e},errState:t})=>[{transition:"all 0.3s",display:"flex",borderBottom:"1px solid",input:{color:t?e.Negative:"unset",paddingInlineStart:"8px"},borderColor:t?e.Negative:e.LineSecondary2}]),"label:DivPhoneInputContainer;"),js=(0,Ie.default)("div",{target:"eex98o3"})((({theme:{colors:e,direction:t}})=>[{display:"flex",alignItems:"center",justifyContent:"space-between",position:"relative",padding:"2px",height:"44px","::after":{content:'""',width:"1px",height:"10px",background:e.LineSecondary,right:"rtl"===t?"unset":"0",left:"rtl"===t?"0":"unset",position:"absolute"}}]),"label:DivAreaLabelContainer;"),Ts=(0,Ie.default)("span",{target:"eex98o4"})((({theme:{colors:e}})=>[{fontSize:"15px",lineHeight:1,color:e.TextPrimary,fontWeight:400}]),"label:SpanLabelContainer;"),Ps=(0,Ie.default)(Ke.A,{target:"eex98o5"})({fontSize:"16px",margin:"0 4px"},"label:StyledArrowIcon;"),Es=(0,A.memo)((function({filterCountryList:e}){as(e);const[t,o]=(0,s.Su)(za.U),{area:i,areaCode:a,phoneErrorMsg:r,showAreaCodeSelector:l,searchText:d,phone:c,matchSearchArea:p}=t,{checkPhoneNumberFormat:u}=o,{toggleAreaCodeSelector:g,selectAreaCode:h}=o,m=(0,f.s)("WebApp_Login"),_=Ya(),y=(0,A.useCallback)((e=>{u({phone:e.target.value.replace(/[^\d]/g,"")})}),[u]),b=(0,A.useCallback)((({code:e,area:t})=>{h({code:e,area:t})}),[h]),x=Boolean(r||_);return(0,n.jsxs)(Cs,{children:[(0,n.jsxs)(ws,{errState:x,children:[(0,n.jsxs)(js,{onClick:g,role:"select",children:[(0,n.jsxs)(Ts,{children:[i," +",a]}),(0,n.jsx)(Ps,{})]}),l&&(0,n.jsx)(ks,{onClose:g,matchSearchArea:p,filterCountryList:e,onSelected:b,currentSelectCode:a,searchText:d}),(0,n.jsx)(Ss,{value:c,border:!1,errState:x,placeholder:m("phone_number"),onChange:y,name:"mobile",inputMode:"tel"})]}),x&&(0,n.jsx)(ur,{text:m(r||_||""),type:"error"})]})}));var Ms=o(56441);const Ls="email",As="phone",Is=()=>{const e=fe(),{isMobile:t}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{isSecurityVerification:o}=St((()=>["isSecurityVerification"]),[]),a=(0,f.s)("WebApp_Login"),[{email:r=""},{setEmail:l}]=(0,s.Su)(Ha.N),[{phoneErrorMsg:d,phone:p,mobile:u},{setPhoneNumber:g,setPhoneCode:h}]=(0,s.Su)(za.U),[{sendCodeLoading:m,getCodeErrorMsg:_},{sendPhoneCodeForLogin:y,sendPhoneCodeForVerify:b}]=(0,s.Su)(Wa.m),[{phoneNotRegistered:x}]=(0,s.Su)(Ae.$),[v,k]=(0,A.useState)(p?As:Ls),C=(0,A.useCallback)((e=>{k(e)}),[k]),S=(0,A.useCallback)((e=>{l(e.target.value)}),[l]),w=!r,T=Boolean(d)||!u||Boolean(x),P=v===As?T:w,E=(0,A.useCallback)((()=>{if(v===Ls)h(""),g(""),e.push(j.tH.tvLoginEmail);else if(!(0,Ua.nP)(p)){const{countDownSecond:t}=(0,Ms.o)(u);if(t)e.push(j.tH.tvLoginPhone);else{const e=j.tH.tvLoginPhone;o?b({mobile:u,nextUrl:e}):y({mobile:u,nextUrl:e})}}}),[e,o,u,p,v,y,b,h,g]),M=(0,A.useMemo)((()=>[{id:Ls,title:a("Email"),content:(0,n.jsx)(kr,{children:(0,n.jsx)(dr,{placeholder:a("Email or Username"),name:"username","data-e2e":"email-input",onChange:S,value:r})})},{id:As,title:a("Phone"),content:(0,n.jsx)(kr,{children:t?(0,n.jsx)(Es,{}):(0,n.jsx)(hs,{errorStatus:_})})}]),[a,S,r,t,_]);return _t(),(0,n.jsxs)(br,{children:[(0,n.jsx)(vr,{children:a("tv_webLogin_login_header")}),(0,n.jsxs)(Cr,{children:[(0,n.jsx)(i.eh,{activeTab:v,tabs:M,onChange:C,align:"fitted"}),(0,n.jsx)(Qa,{onSubmit:E,children:(0,n.jsx)(xr,{disabled:P,loading:v===As&&m,children:a("login_next")})})]}),(0,n.jsxs)(wr,{children:[(0,n.jsx)(jr,{}),(0,n.jsx)(Tr,{children:a("webapp_orContinueWith")}),(0,n.jsx)(jr,{})]}),(0,n.jsx)(Pr,{children:(0,n.jsx)(ys,{foldSize:4})})]})},Rs=(e,t,o)=>{const[n,i]=(0,A.useState)(0),[a,r]=(0,A.useState)(!1),s=(0,A.useRef)({});return(0,A.useEffect)((()=>{const{hasSent:t,countDownSecond:n}=(0,Ms.o)(e,o);r(t),i(n)}),[e,o,t]),(0,A.useEffect)((()=>{n>0?(s.current&&clearTimeout(s.current),s.current=setTimeout((()=>{i(n-1)}),1e3)):s.current&&clearTimeout(s.current)}),[n]),{hasSent:a,countDownSecond:n}},Fs=(0,Ie.default)("input",{target:"e18135wj0"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokDisplayFont"}),{height:"52px",width:"49px",textAlign:"center",backgroundColor:"rgba(0, 0, 0, 0.05)",border:"none",borderRadius:"8px",lineHeight:"25px",fontSize:"20px",outline:"none",caretColor:e.colors.Primary}]),"label:InputSingleDigitInput;"),Os=(0,Ie.default)("div",{target:"e18135wj1"})({width:"25px",height:"1px",backgroundColor:"#000"},"label:DividerDash;"),Ds=(0,Ie.default)("div",{target:"e18135wj2"})({display:"flex",justifyContent:"center",alignItems:"center",position:"relative",gap:"6px"},"label:DivSingleDigitInputContainer;"),Hs=Ie.default.div` position: relative; display: flex; flex-direction: column; `,Us="divider",Ns=e=>{e&&e.focus()},Bs=({length:e,errorMsg:t,value:o,chunkSize:i,onChange:a,inputStyle:r})=>{const l=(0,f.s)("WebApp_Login"),d=[],[c,p]=(0,A.useState)([...o]),u=(0,A.useRef)(null),[{getCodeErrorMsg:g},{setCode:h}]=(0,s.Su)(Wa.m);(0,A.useEffect)((()=>()=>{h("")}),[]),(0,A.useEffect)((()=>{""===o&&(p([...o]),Ns(u.current))}),[o]);const m=(e,t)=>{let o=[];0===t&&6===e.length?o=e.split(""):(o=[...c],o[t]=e),p(o);const n=o.join("");h(n),null==a||a(n)},_=(e,t)=>{const o=e.target,n=o.value;if(0===t&&6===n.length)((e,t)=>{m(t,0);let o=0,n=e;for(;o<=5;)n.id===Us?n=n.nextElementSibling:(n.value=t[o],5===o&&Ns(n),n=n.nextElementSibling,o++)})(o,n);else{m(n.substring(0,1),t);let e=o.nextElementSibling;(null==e?void 0:e.id)===Us&&(e=e.nextElementSibling),e&&o.value&&Ns(e)}},y=(e,t)=>{switch(e.keyCode){case 8:((e,t)=>{const o=e.target;if(o.value)return void m("",t);let n=o.previousElementSibling;(null==n?void 0:n.id)===Us&&(n=n.previousElementSibling),Ns(n)})(e,t);break;case 37:(e=>{let t=e.target.previousElementSibling;(null==t?void 0:t.id)===Us&&(t=t.previousElementSibling),Ns(t)})(e);break;case 39:(e=>{let t=e.target.nextElementSibling;(null==t?void 0:t.id)===Us&&(t=t.nextElementSibling),Ns(t)})(e)}},b=(0,Ua.$L)(c.join(""))?"common_login_reset_email_verify_title":"",x=t||g||b,v=6===c.length&&Boolean(x);for(let t=0;t0&&t_(e,t),onKeyDown:e=>y(e,t),autoFocus:0===t,error:v,value:c[t]||"",ref:0===t?u:null,style:r},t)),o&&d.push((0,n.jsx)(Os,{id:Us}))}return(0,n.jsxs)(Hs,{children:[(0,n.jsx)(Ds,{children:d}),v&&x&&(0,n.jsx)(ur,{style:{width:"100%"},text:l(x),type:"error"})]})},$s={height:"52px",width:"46px"},zs={height:"52px",width:"49px"},Ws=()=>{const e=(0,f.s)("WebApp_Login"),t=fn(),{isSecurityVerification:o}=St((()=>["isSecurityVerification"]),[]),{isMobile:i}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{region:a}=(0,Ve.L$)((0,Ze.W)((()=>["region"]),[])),[{phoneNotRegistered:r}]=(0,s.Su)(Ae.$),{registerPhone:l}=(0,s.wA)(ko.H),[d]=(0,s.Su)(za.U),{mobile:p,phoneErrorMsg:u}=d,[{sendCodeLoading:g},{sendPhoneCodeForLogin:h,sendPhoneCodeForVerify:m}]=(0,s.Su)(Wa.m),_=Ja(),y=(e=>{if(e.length<10)return e;const t=e.length-4-1,o=e.split("");for(let e=t;e>=t-6;e--)o[e]="*";return o.join("")})(p),[{loginLoading:b},{handleSmsLogin:x,handleSmsVerify:v}]=(0,s.Su)(Ae.$),k=fe(),C=(0,A.useCallback)((()=>{k.goBack()}),[k]),{countDownSecond:S}=Rs(p,g),w=(0,A.useCallback)((e=>{t({platform:"sms_verification"});const n={mobile:p,phoneCode:e,login_only:!0};o?v(n):x(n)}),[t,p,o,v,x]),T=(0,A.useCallback)((e=>{p&&e&&!u&&!(0,Ua.$L)(e)&&w(e)}),[w,p,u]),P=Boolean(S)||b||g||r,E=(0,A.useCallback)((()=>{P||(o?m({mobile:p}):h({mobile:p}))}),[o,p,P,h,m]),M=(0,A.useCallback)((()=>{l({region:a})}),[l,a]);return _t(),(0,n.jsx)(Qa,{onSubmit:E,children:(0,n.jsxs)(br,{children:[(0,n.jsx)(vr,{children:e("tv_webLogin_login_header")}),(0,n.jsxs)(Mr,{children:[(0,n.jsx)(Ar,{children:e("tv_webLogin_enterCode_bodyv2",{phone_number:""})}),(0,n.jsx)(Lr,{children:y})]}),(0,n.jsxs)(Sr,{children:[(0,n.jsx)(Bs,{value:"",length:6,onChange:T,errorMsg:_,inputStyle:i?zs:$s}),r&&(0,n.jsxs)(Wi,{children:[(0,n.jsx)(Gi,{children:e("common_login_sms_unregistered_pc_1")}),(0,n.jsx)(Gi,{link:!0,onClick:M,children:e("common_login_sms_unregistered_pc_2")})]}),(0,n.jsx)(Er,{style:{marginTop:"24px"},children:(0,n.jsx)(Ir,{onClick:C,text:e("tv_webLogin_enterCode_altMethod"),path:j.tH.tvLoginHome,replace:!0})}),(0,n.jsx)(xr,{loading:b||g,disabled:P,children:`${e("common_registration_phone_sms_button")}${S?`: ${S}s`:""}`})]})]})})},Gs=(0,Ie.default)("div",{target:"e1rj4s2h0"})((({theme:e})=>{return[(t=e.isMobile,t?{padding:"0px 32px 32px"}:{})];var t}),"label:DivContainer;"),Vs=(0,Ie.default)("div",{target:"e1rj4s2h1"})((({theme:e})=>{return[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont",fontWeight:"bold"}),(t=e.isMobile,t?{fontSize:"20px",marginTop:"24px"}:{fontSize:"33px"})];var t}),"label:DivTitleContainer;"),Ks=(0,Ie.default)("p",{target:"e1rj4s2h2"})((({theme:e})=>{return[(0,Re.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),(t=e.isMobile,t?{fontSize:"14px",lineHeight:"17px",margin:"8px 0"}:{fontSize:"16px",lineHeight:"22px",margin:"16px 0"})];var t}),"label:PDescriptionContainer;"),qs=e=>e?{position:"absolute",bottom:"28px",left:"32px",right:"32px",width:"auto"}:{},Zs=({theme:{isMobile:e}})=>[qs(e)],Js=(0,Ie.default)(fr,{target:"e1rj4s2h5"})(Zs,"label:StyledTwoStepButton;"),Ys=(0,Ie.default)("hr",{target:"e1rj4s2h6"})({border:0,margin:0,marginTop:"48px",marginBottom:"30px",borderBottom:"1px solid rgba(22, 24, 35, .12)"},"label:HrDivider;"),Qs=(0,Ie.default)("p",{target:"e1rj4s2h7"})((({theme:e})=>[(0,Re.zy)({theme:e,typography:"P2",fontWeight:"bold",fontFamily:"TikTokFont"}),{margin:0}]),"label:PTitle;");var Xs=o(28367);const el=(0,Ie.default)("button",{target:"e1gzcpl10"})((({theme:e})=>[(0,Re.zy)({color:"TextPrimary",theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold"}),{margin:0,backgroundColor:e.colors.BGInput2,borderColor:e.colors.LineSecondary2,borderWidth:1.5,borderStyle:"solid",borderRadius:"rtl"===e.direction?"4px 0 0 4px":"0px 4px 4px 0px",borderInlineStartWidth:1.5,cursor:"pointer",fontSize:"16px",padding:"0px 16px",height:"44px",flexShrink:0,boxSizing:"content-box","&:disabled":{color:e.colors.TextQuaternary,cursor:"not-allowed"}}]),"label:ButtonSendCode;");el.defaultProps=Object.assign(Object.assign({},el.defaultProps),{"data-e2e":"send-code-button"});const tl=(0,Ie.default)(Xs.A,{target:"e1gzcpl11"})({marginInlineStart:"4px",fontSize:"20px",verticalAlign:"middle",marginTop:"-2px",animation:"loading-circle-anim linear 1s infinite","@keyframes loading-circle-anim":{"0%":{transform:"rotate(0)"},"100%":{transform:"rotate(360deg)"}}},"label:StyledLoadingCircle;"),ol=(0,A.memo)((function(e){const{text:t,disabled:o,countDownSecond:i=0,loading:a}=e;return(0,n.jsxs)(el,{type:"button",onClick:e.onClick,disabled:Boolean(o)||Boolean(i),lo:!0,children:[t+(i?`: ${i}s`:""),a&&(0,n.jsx)(tl,{})]})})),nl=(0,Ie.default)("div",{target:"e2oypfg0"})({transition:"all 0.3s",display:"flex",justifyContent:"space-between"},"label:DivCodeInputContainer;"),il=(0,Ie.default)(dr,{target:"e2oypfg1"})((({theme:e})=>({flex:1,width:0,"& > input":{height:"47px",borderRadius:"rtl"===e.direction?"0 4px 4px 0":"4px 0px 0px 4px"}})),"label:StyledBaseInput;");il.defaultProps=Object.assign(Object.assign({},il.defaultProps),{"data-e2e":"digit-code-input"});const al=(0,A.memo)((function(e){const{errorMsg:t,disabled:o,codeFromNumber:i,loading:a,autoSendFirstTime:r,email:l,isSendCodeHidden:d}=e,c=(0,f.s)("WebApp_Login"),[p,u]=(0,A.useState)(!1),[g,h]=(0,A.useState)(),[{codeFormatError:m,getCodeErrorMsg:_,code:y},{setCode:b}]=(0,s.Su)(Wa.m);(0,A.useEffect)((()=>{h(t)}),[t]),(0,A.useEffect)((()=>{h(_)}),[_]);const{countDownSecond:x,hasSent:v}=Rs(i,a,l);(0,A.useEffect)((()=>{if(r){const{countDownSecond:t}=(0,Ms.o)(i,l);!t&&e.onClickSendCode()}return()=>{b("")}}),[]);const k=(0,A.useCallback)((()=>{u(!0)}),[]),C=(0,A.useCallback)((()=>{u(!1)}),[]),S=(0,A.useCallback)((e=>{b(e.target.value)}),[b]),w=g||m,j=m?!p:Boolean(w);return(0,n.jsxs)("div",{children:[(0,n.jsxs)(nl,{children:[(0,n.jsx)(il,{placeholder:c("common_login_reset_email_verify_title"),onFocus:k,onBlur:C,onChange:S,value:y,className:"code-input",autoComplete:"off",errorState:j}),!d&&(0,n.jsx)(ol,{loading:a,onClick:e.onClickSendCode,disabled:Boolean(o)||Boolean(x)||a,countDownSecond:x,text:c(v?"common_registration_phone_sms_button":"common_registration_phone_input_button")})]}),j&&w&&(0,n.jsx)(ur,{text:c(w),type:"error"})]})})),rl=(0,Ie.default)("p",{target:"e17ptbg00"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"semiBold"}),{fontSize:"20px",lineHeight:"24px",marginTop:"24px",marginBottom:"8px"}]),"label:PTitleContainer;"),sl=(0,Ie.default)("p",{target:"e17ptbg01"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextTertiary2",fontFamily:"TikTokFont"}),{fontSize:"14px",lineHeight:"17px",marginBottom:"8px"}]),"label:PDescriptionContainer;"),ll=(0,Ie.default)(Xs.A,{target:"eo6lrdp0"})({marginInlineStart:"4px",fontSize:"20px",verticalAlign:"middle",marginTop:"-2px",animation:"loading-circle-anim linear 1s infinite","@keyframes loading-circle-anim":{"0%":{transform:"rotate(0)"},"100%":{transform:"rotate(360deg)"}}},"label:StyledLoadingCircle;"),dl=(0,Ie.default)("div",{target:"e1ait7k0"})({display:"flex",margin:"20px 0",height:"18px",justifyContent:"space-between"},"label:DivContainer;"),cl=(0,Ie.default)("span",{target:"e1ait7k1"})((({theme:e,disabled:t})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold"}),{color:t?e.colors.TextQuaternary:e.colors.TextPrimary,fontSize:"14px",lineHeight:"18px"}]),"label:SpanText;"),pl=(0,A.memo)((function(e){const{loading:t,codeFromNumber:o,email:i}=e,{countDownSecond:a}=Rs(o,t,i),r=(0,f.s)("WebApp_Login");return(0,n.jsxs)(dl,{children:[(0,n.jsx)(cl,{onClick:e.onClick,disabled:Boolean(a),children:`${r("common_registration_phone_sms_button")}${a?`: ${a}s`:""}`}),t&&(0,n.jsx)(ll,{})]})})),ul=(0,Ie.default)("p",{target:"e1tvj6xp0"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextTertiary2",fontFamily:"TikTokFont"}),{fontSize:"14px",lineHeight:"17px",marginBottom:"8px"}]),"label:PDescriptionContainer;"),gl=(0,Ie.default)("div",{target:"e1tvj6xp1"})({height:"48px",display:"flex"},"label:DivInputContainer;"),hl=(0,Ie.default)("input",{target:"e1tvj6xp2"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,start:"-1000px"}),{opacity:0,position:"absolute"}]),"label:Input;"),ml=(0,Ie.default)("div",{target:"e1tvj6xp3"})((({theme:e,error:t,active:o})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"semiBold"}),{position:"relative",fontSize:"20px",flex:"1",borderBottom:"1px solid",borderBottomColor:t?e.colors.Negative:e.colors.LinePrimary2,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",marginInlineEnd:"10px",":last-child":{marginInlineEnd:"0"},"::before":{content:'""',position:"absolute",height:"16px",width:"2px",background:e.colors.Primary,margin:"auto",display:o?"block":"none",animation:"cursor-animation 1.5s linear infinite"},"@keyframes cursor-animation":{"0%":{opacity:0},"25%":{opacity:0},"50%":{opacity:1},"75%":{opacity:1},"100%":{opacity:0}}}]),"label:DivLabel;"),_l=(0,A.memo)((function(e){const t=(0,f.s)("WebApp_Login"),{codeFromNumber:o,codeDesc:i,email:a,loading:r,onSubmit:l,showTitle:d=!0,autoSubmit:c=!0,errorMsg:p="",autoSendFirstTime:u,isSendCodeHidden:g}=e,[{code:h,sendCodeLoading:m,getCodeErrorMsg:_=""},{setCode:y}]=(0,s.Su)(Wa.m),b=(0,A.useRef)(null),x=(0,A.useCallback)((()=>{var e;null===(e=b.current)||void 0===e||e.focus()}),[]),v=(0,A.useCallback)((e=>{if(6===h.length&&5===e.target.value.length)y("");else{const t=e.target.value.replace(/[^\d]/g,"");y(t)}}),[y,h]),k=(0,A.useCallback)((e=>{e.persist()}),[]);(0,A.useEffect)((()=>{if(u){const{countDownSecond:t}=(0,Ms.o)(o,a);!t&&e.onClickSendCode()}return()=>{y("")}}),[]),(0,A.useEffect)((()=>{6===h.length&&c&&l()}),[h,l,c]);const C=null!=i?i:t("Your code was sent to {code}",{code:o}),S=_||p,w=Boolean(S);return(0,n.jsxs)(n.Fragment,{children:[d&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(rl,{children:t("common_login_reset_email_verify_title")}),(0,n.jsx)(ul,{children:C})]}),(0,n.jsxs)(gl,{onClick:x,children:[(0,n.jsx)(hl,{ref:b,onChange:v,type:"tel",autoFocus:!0,value:h,autoComplete:"one-time-code",onAnimationEnd:k}),Array(6).fill("").map(((e,t)=>(0,n.jsx)(ml,{active:h.length===t,error:w,children:h[t]},t)))]}),(0,n.jsx)(ur,{text:t(S),type:"error"}),!g&&(0,n.jsx)(pl,{codeFromNumber:o,loading:m||r,onClick:e.onClickSendCode,email:a})]})})),fl=e=>{const{onSubmit:t}=e,o=(0,u.__rest)(e,["onSubmit"]),{isMobile:i}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[]));return i?(0,n.jsx)(_l,Object.assign({},o,{onSubmit:e.onSubmit,autoSubmit:!1,showTitle:!1})):(0,n.jsx)(al,Object.assign({},o))},yl=(0,Ie.default)(jo,{target:"ep888o80"})({fontSize:"12px",display:"inline-block"},"label:StyledLink;"),bl=(0,A.memo)((function(e){const{text:t,path:o,replace:i,textTheme:a}=e;return(0,n.jsx)(yl,{path:o,text:t,replace:i,textTheme:a,onClick:e.onClick})}));var xl=o(78016);const vl=(0,Ie.default)("div",{target:"e1mtjw290"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",padding:"4px 0 0",textAlign:"center",margin:"auto",overflow:"hidden"})),"label:DivContainer;"),kl=(0,Ie.default)("h5",{target:"e1mtjw291"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"20px",lineHeight:"24px",padding:"24px",margin:"0"}]),"label:H5Title;"),Cl=(0,Ie.default)(xl.K,{target:"e1mtjw292"})((({theme:e})=>({width:"100%",borderRadius:"0",height:"48px",fontWeight:600,border:"none",borderTop:`1px solid ${e.colors.LineSecondary2}`,"&:last-child":{color:e.colors.TextTertiary2}})),"label:StyledButton;"),Sl={width:"80%",maxWidth:"400px",background:"transparent"},wl=(0,A.memo)((({title:e,visible:t,actions:o})=>{const i=(0,f.s)("WebApp_Login");return(0,n.jsx)(S.aF,{contentStyle:Sl,visible:t,maskCloseable:!1,children:(0,n.jsxs)(vl,{children:[(0,n.jsx)(kl,{children:i(e)}),o.map((({onClick:e,text:t},o)=>(0,n.jsx)(Cl,{onClick:e,children:i(t)},o)))]})})})),jl=(0,Ie.default)("div",{target:"e8ziav60"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"15px",lineHeight:"18px",margin:"20px 0 -12px 0"}]),"label:DivText;");jl.defaultProps=Object.assign(Object.assign({},jl.defaultProps),{"data-e2e":"forgot-passport-button"});const Tl=(0,A.memo)((function({onClickForgetEmailPwd:e}){const t=fe(),o=(0,f.s)("WebApp_Login"),[i,a]=(0,A.useState)(!1),r=(0,A.useCallback)((()=>{a(!0)}),[]),s=(0,A.useCallback)((()=>{t.push(j.tH.loginForgetPhonePassword)}),[t]),l=(0,A.useCallback)((()=>{null==e||e(),t.push(j.tH.loginForgetEmailPassword)}),[t,e]),d=(0,A.useMemo)((()=>[{text:"Phone number",onClick:s},{text:"Email",onClick:l},{text:"common_registration_phone_input_popup_button",onClick:()=>a(!1)}]),[l,s]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(jl,{onClick:r,children:[o("forget_password")," "]}),(0,n.jsx)(wl,{visible:i,actions:d,title:"common_login_reset_popup_title"})]})})),Pl=(0,A.memo)((function(e){const t=(0,f.s)("WebApp_Login"),{isMobile:o}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[]));return o?(0,n.jsx)(Tl,{onClickForgetEmailPwd:e.onClickForgetEmailPwd}):(0,n.jsx)(bl,{text:t("forget_password"),path:j.tH.loginForgetEmailPassword,onClick:e.onClickForgetEmailPwd})})),El=(0,Ie.default)("span",{target:"eea75y50"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{display:"inline-block",fontSize:"14px",lineHeight:"17px",margin:"12px 0",paddingInlineEnd:"12px","& + &":{paddingInlineStart:"12px",position:"relative","&::before":Object.assign({content:'""',position:"absolute",height:"12px",width:"1px",top:"2px",background:e.colors.LineSecondary},[(0,Re.mp)({start:"0",direction:e.direction})])}}]),"label:SpanOptionsText;"),Ml=(0,Ie.default)("span",{target:"eea75y51"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{margin:"12px 0",display:"inline-block",fontSize:"14px",fontWeight:600,zIndex:20}]),"label:SpanChangeWayText;"),Ll=(0,Ie.default)(xl.K,{target:"eea75y52"})((({theme:e})=>({width:"100%",borderRadius:"0",height:"48px",fontWeight:600,border:"none",borderBottom:`1px solid ${e.colors.LineSecondary2}`,"&:last-child":{color:e.colors.TextTertiary2,marginTop:"8px"}})),"label:StyledButton;"),Al={[Ka.email]:"twostep_verification_useemail",[Ka.password]:"twostep_verification_usepassword",[Ka.phone]:"twostep_verification_usesms",[Ka.totp]:"twostep_verification_useauthenticator"},Il=(0,A.memo)((function(e){const t=(0,f.s)("WebApp_Login"),{verifyWays:o=[]}=e;return(0,n.jsx)(n.Fragment,{children:o.map((o=>{const i=`/login/2sv/${Va[o]}`;return(0,n.jsx)(El,{onClick:e.onClickType(o),children:(0,n.jsx)(ge,{to:i,children:t(Al[o])})},o)}))})}));var Rl=o(70461);const Fl=(0,Ie.default)("div",{target:"e1pjeozo0"})({position:"fixed",left:0,top:0,bottom:0,right:0,overflow:"auto",outline:"0px",zIndex:12,display:"none",transition:"all 500ms cubic-bezier(.075, .82, .165, 1)","&.enter-active":{display:"block"},"&.enter-done":{display:"block"},"&.exit":{display:"block"},"&.exit-active":{display:"none"}},"label:DivPopup;"),Ol=(0,Ie.default)("div",{target:"e1pjeozo1"})((({theme:e})=>({position:"absolute",width:"100vw",bottom:0,left:0,right:0,background:e.colors.BGPlaceholderOpaque,borderRadius:"8px 8px 0 0",overflow:"hidden",transition:"all 500ms",zIndex:11,"&.enter-active":{opacity:1,transform:"translateY(100%)"},"&.enter-done":{transform:"translateY(0)"}})),"label:DivContent;"),Dl=(0,Ie.default)("div",{target:"e1pjeozo2"})((({theme:{colors:e}})=>({background:e.SDSecondary,position:"absolute",left:0,right:0,top:0,bottom:0})),"label:DivMask;"),Hl=e=>{const{visible:t}=e,o=(0,A.useRef)(null);return(0,n.jsx)(Rl.A,{in:t,timeout:300,children:(0,n.jsxs)(Fl,{children:[(0,n.jsx)(Dl,{}),(0,n.jsx)(Rl.A,{in:t,timeout:100,nodeRef:o,children:(0,n.jsx)(Ol,{ref:o,children:e.children})})]})})},Ul={[Ka.email]:"login_send_code_email",[Ka.phone]:"login_send_code_sms",[Ka.password]:"twosv_login_switch_pw",[Ka.totp]:"2_step_verification_alt_method3"},Nl=(0,A.memo)((function(e){const t=(0,f.s)("WebApp_Login"),[o,i]=(0,A.useState)(!1),{verifyWays:a=[],onClickType:r}=e,s=(0,A.useCallback)((()=>{i(!0)}),[]),l=(0,A.useCallback)((()=>{i(!1)}),[]),d=(0,A.useCallback)((e=>()=>{r(e)(),i(!1)}),[r]);return a.length?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Hl,{visible:o,children:(0,n.jsxs)("div",{children:[a.map(((e,o)=>(0,n.jsx)(Ll,{onClick:d(e),loading:!1,children:t(Ul[e])},o))),(0,n.jsx)(Ll,{onClick:l,children:t("step_verification_cancel")})]})}),(0,n.jsx)(Ml,{onClick:s,children:t("login_try_another_method")})]}):null})),Bl=(0,A.memo)((function(){const[{verifyWays:e={},type:t},{setTwoStepType:o}]=(0,s.Su)(qa),{isMobile:i}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),a=(0,A.useCallback)((e=>()=>{o(e)}),[o]),r=(0,A.useMemo)((()=>({verifyWays:Object.keys(e).filter((e=>e!==t)),onClickType:a})),[t,e,a]);return(0,n.jsxs)(n.Fragment,{children:[i?(0,n.jsx)(Nl,Object.assign({},r)):r.verifyWays.length<2?(0,n.jsx)(Il,Object.assign({},r)):null,"pwd_verify"===t&&1===Object.keys(e).length&&(0,n.jsx)(Pl,{})]})})),$l={[Ka.email]:"2_step_verification_alt_method2",[Ka.password]:"2_step_verification_alt_method4",[Ka.phone]:"2_step_verification_alt_method1",[Ka.totp]:"2_step_verification_alt_method3"},zl=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),[{verifyWays:t={},type:o},{setTwoStepType:i}]=(0,s.Su)(qa),{isMobile:a}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),r=fe(),l=(0,A.useCallback)(((e,t)=>()=>{i(t),r.push(e)}),[r,i]),d=(0,A.useMemo)((()=>Object.keys(t).filter((e=>e!==o))),[o,t]);return!a&&d.length>1?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ys,{}),(0,n.jsx)(Qs,{children:e("2_step_verification_try_alt_method")}),d.map(((t,o)=>{const i=`/login/2sv/${Va[t]}`;return(0,n.jsx)(_r,{onClick:l(i,t),size:"small",buttonTheme:"default",children:e($l[t])},o)}))]}):null})),Wl=()=>{const e=(0,f.s)("WebApp_Login"),t=(0,l.Nj)(T.$F),[{sendCodeLoading:o,code:i,codeFormatError:a},{sendEmailCodeForReset:r,sendEmailCodeForLogin:d,sendEmailCodeForVerify:c}]=(0,s.Su)(Wa.m),[{verifyWays:p,not_login_ticket:u,verify_ticket:g,password:h="",loginLoading:m},{handleCodeVerify:_}]=(0,s.Su)(qa),{changePwdByEmail:y}=(0,s.wA)(Ae.$),b=Ja(),x=(0,A.useCallback)((()=>{t.twoStepSubmit({verification_method:"email",forReset:Boolean(h)}),h?y({not_login_ticket:u,verify_ticket:g,emailCode:i,password:h,email:""}):_({code:i,not_login_ticket:u,verify_ticket:g})}),[y,i,_,t,u,h,g]),v=(0,A.useCallback)((()=>{h?r({not_login_ticket:u,verify_ticket:g}):u?d({not_login_ticket:u,verify_ticket:g}):c({verify_ticket:g})}),[h,r,u,d,g,c]);return(0,n.jsxs)(Qa,{onSubmit:x,children:[(0,n.jsx)(Ks,{children:e("common_login_reset_email_verify_title")}),(0,n.jsx)(Ks,{children:e("common_verify_email_text",{email:null==p?void 0:p.email_verify})}),(0,n.jsx)(fl,{autoSendFirstTime:!0,email:!0,codeFromNumber:g,loading:o,onClickSendCode:v,onSubmit:x,errorMsg:b}),(0,n.jsx)(Bl,{}),(0,n.jsx)(Js,{disabled:Boolean(a)||!i,loading:m,children:e("login_next")}),(0,n.jsx)(zl,{})]})},Gl=()=>{const e=(0,f.s)("WebApp_Login"),t=(0,l.Nj)(T.$F),{password:o,hasInvalid:i}=(0,s.Ph)(Na),{isMobile:a}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),[{verify_ticket:r,loginLoading:d},{handlePasswordVerify:p}]=(0,s.Su)(qa),u=Ja(),g=(0,A.useCallback)((()=>{t.twoStepSubmit({verification_method:"password",forReset:!1}),p({password:o,verify_ticket:r})}),[p,t,o,r]);return(0,n.jsxs)(Qa,{onSubmit:g,children:[(0,n.jsx)(Ks,{children:e("common_verify_password_text")}),(0,n.jsx)(mr,{create:!1,loginError:Boolean(u),loginErrorText:a?u:void 0}),(0,n.jsx)(Bl,{}),!a&&(0,n.jsx)(ur,{text:e(u),type:"error"}),(0,n.jsx)(Js,{disabled:Boolean(i)||!o,loading:d,children:e("login_next")}),(0,n.jsx)(zl,{})]})},Vl=()=>{const e=(0,f.s)("WebApp_Login"),t=(0,l.Nj)(T.$F),[{sendCodeLoading:o,code:i,codeFormatError:a},{sendPhoneCodeForTwoStep:r,sendPhoneCodeForResetPwd:d}]=(0,s.Su)(Wa.m),[{verifyWays:c,verify_ticket:p,not_login_ticket:u,password:g,loginLoading:h,accountQuery:m},{handleCodeVerify:_,handleSmsCodeVerifyReset:y}]=(0,s.Su)(qa),b=Ja(),x=(0,A.useCallback)((()=>{const e={verify_ticket:p,not_login_ticket:u,mobile:null==m?void 0:m.mobile};g?d(e):r(e)}),[null==m?void 0:m.mobile,u,g,d,r,p]),v=(0,A.useCallback)((()=>{t.twoStepSubmit({verification_method:"phone",forReset:Boolean(g)}),g?y({not_login_ticket:u,verify_ticket:p,code:i,password:g}):_({verify_ticket:p,code:i,not_login_ticket:u})}),[i,_,y,t,u,g,p]);return(0,n.jsxs)(Qa,{onSubmit:v,children:[(0,n.jsx)(Ks,{children:e("common_login_reset_email_verify_title")}),(0,n.jsx)(Ks,{children:e("common_verify_sms_text",{mobile:null==c?void 0:c.mobile_sms_verify})}),(0,n.jsx)(fl,{autoSendFirstTime:!0,codeFromNumber:p,loading:o,onClickSendCode:x,onSubmit:v,errorMsg:b}),(0,n.jsx)(Bl,{}),(0,n.jsx)(Js,{disabled:Boolean(a)||!i,loading:h,children:e("login_next")}),(0,n.jsx)(zl,{})]})},Kl=()=>{const e=(0,f.s)("WebApp_Login"),t=(0,l.Nj)(T.$F),[{sendCodeLoading:o,code:i,codeFormatError:a}]=(0,s.Su)(Wa.m),[{not_login_ticket:r,verify_ticket:d,password:c="",loginLoading:p},{handleCodeVerify:u,handleTOTPVerifyAndRestPwd:g}]=(0,s.Su)(qa),h=Ja(),m=(0,A.useCallback)((()=>{t.twoStepSubmit({verification_method:"totp",forReset:Boolean(c)}),c?g({verify_ticket:d,code:i,password:c}):u({code:i,not_login_ticket:r,verify_ticket:d})}),[i,g,u,t,r,c,d]),_=(0,A.useCallback)((()=>{}),[]);return(0,n.jsxs)(Qa,{onSubmit:m,children:[(0,n.jsx)(Ks,{children:e("2_step_verification_body")}),(0,n.jsx)(fl,{autoSendFirstTime:!0,email:!0,codeFromNumber:d,loading:o,onClickSendCode:_,onSubmit:m,errorMsg:h,isSendCodeHidden:!0}),(0,n.jsx)(Bl,{}),(0,n.jsx)(Js,{disabled:Boolean(a)||!i,loading:p,children:e("login_next")}),(0,n.jsx)(zl,{})]})},ql=()=>{const e=(0,f.s)("WebApp_Login"),t=(0,l.Nj)(T.$F),{isMobile:o}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),i=fe(),{isTwoStep:a,verifyWays:r,password:d}=(0,s.Ph)(qa),{type:p}=re(),u=Ka[p];return(0,A.useEffect)((()=>{u&&(null==r?void 0:r[u])||i.replace(j.tH.loginHome),t.twoStepNotify({verification_method:p,forReset:Boolean(d)})}),[i,t,d,p,r,u]),_t(),(0,n.jsxs)(Gs,{children:[o&&(0,n.jsx)(Gt,{}),(0,n.jsx)(Vs,{children:e(a?"security_step_verification":"common_verify_title")}),p===Va.pwd_verify?(0,n.jsx)(Gl,{}):p===Va.email_verify?(0,n.jsx)(Wl,{}):p===Va.totp_verify?(0,n.jsx)(Kl,{}):(0,n.jsx)(Vl,{})]})};var Zl=o(4912),Jl=o(2584),Yl=o(9450);const Ql={initialized:!1,eventCommonParams:{},init(e){var t;const o=rt.parse(e),{platform:n,group_id:i,last_group_id:a}=o,r=(0,Yl.r)(o,["enter_method","enter_from","enter_ref_id","device_platform","ref_hash"]),{enter_from:s}=r,l=(0,u.__rest)(r,["enter_from"]);this.initialized=!0,this.eventCommonParams=Object.assign(Object.assign({},l),{enter_from:null!==(t=null==s?void 0:s.toString())&&void 0!==t?t:"login",platform:n,group_id:null==i?void 0:i.toString(),last_group_id:null==a?void 0:a.toString(),inferred_app:(0,hn.Jc)()})},setDevicePlatform(e){const t=e?"mobile_web":"desktop_web";this.eventCommonParams.device_platform=t},setEnterMethodForTeaEvents(e){this.eventCommonParams.enter_method=e},setGroupIdForTeaEvents(e){this.eventCommonParams.group_id=e},setLastGroupIdForTeaEvents(e){this.eventCommonParams.last_group_id=e}},Xl=({groupId:e,lastGroupId:t,enterMethod:o,closeable:n,predictionPayload:i}={})=>{o&&(e=>{Ql.setEnterMethodForTeaEvents(e)})(o);const a=(0,l.Nj)(T.$F),r=(0,l.Nj)(gt.le),s=(0,l.Nj)(gt.VU);(0,A.useEffect)((()=>{(e=>{Ql.setGroupIdForTeaEvents(e)})(e),a.setGroupId(e)}),[a,e]),(0,A.useEffect)((()=>{(e=>{Ql.setLastGroupIdForTeaEvents(e)})(t),a.setLastGroupId(t)}),[a,t]),(0,A.useEffect)((()=>{o&&(r.setEnterMethod(o),a.setEnterMethod(o)),r.setEnterFrom(),null!=n||a.setCloseable(n),i&&a.setPredictionPayload(i);const e=k.nf.getDurationSinceClickTimestampOnce(),t=k.nf.getTrackingInfo();a.loginNotify({click_to_notify_duration:e,e2eInfo:t}),r.loginNotify(),e&&s.sendLoginClickToNotifyDurationPerfMetric(e)}),[a,o,n,i,r,s])},ed=e=>{const t=(0,A.useRef)(void 0),o=(0,l.Nj)(T.$F);(0,A.useEffect)((()=>{if(void 0===t.current||void 0!==e){const t=k.nf.getTrackingInfo();o.enterSignUp({groupId:e,e2eInfo:t})}t.current=e}),[e,o])};var td=o(10828),od=o(28591);const nd={login:{title:"log_in",description:"Log in or sign up for an account on TikTok. Start watching to discover real people and real videos that will make your day.",keywords:"Log in, Log in to TikTok"},signup:{title:"sign_up",description:"Sign up for an account or log back into TikTok. Create an account to discover real people and real videos that will make your day.",keywords:"Sign up, Sign up for TikTok"}},id=(0,A.memo)((({page:e})=>{var t;const o=nd[e],i=(0,f.s)("WebApp_Login"),{language:a}=(0,Ve.L$)((0,Ze.W)((()=>["language"]),[])),{isMobile:r}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{pathname:s}=ye();return(0,n.jsxs)(od.mg,{htmlAttributes:{lang:a},children:[r&&"loginDownloadApp"===(null===(t=(0,j.Iv)(s))||void 0===t?void 0:t.name)&&(0,n.jsx)("link",{rel:"canonical",href:`${td.C}/download`},"canonical"),(0,n.jsx)("title",{children:`${i(o.title)} | TikTok`}),(0,n.jsx)("meta",{name:"description",content:i(o.description)}),(0,n.jsx)("meta",{name:"keywords",content:o.keywords})]})}));var ad=o(28918);const rd={id:"single-logo-light-1115c5dd",use:"single-logo-light-1115c5dd-usage",viewBox:"0 0 25 42",content:''};function sd(e){const t=(0,A.useContext)(Ot.X);return(0,A.useLayoutEffect)((()=>(t.add(rd),()=>{t.remove("single-logo-light-1115c5dd")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#single-logo-light-1115c5dd"},void 0)}),void 0)}const ld=(0,Ie.default)("div",{target:"e15366060"})({display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:"8px"}},"label:DivIconButtonListContainer;"),dd=(0,Ie.default)("div",{target:"e15366061"})((({width:e,height:t,theme:{colors:o}})=>[{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",border:"1px solid",borderColor:o.LineSecondary,borderRadius:"50%",cursor:"pointer",width:`${e}px`,height:`${t}px`,"&:hover":{opacity:.8}}]),"label:DivIconButton;"),cd=({configItem:e,width:t,height:o})=>{const i=e.icon;return(0,n.jsx)(dd,{onClick:e.onClick,onKeyDown:e.onClick,width:t,height:o,tabIndex:0,role:"link",children:(0,n.jsx)(i,{width:t/2,height:o/2})})},pd=({config:e,width:t,height:o})=>(0,n.jsx)(ld,{children:e.map((e=>(0,n.jsx)(cd,{configItem:e,width:t,height:o},e.type)))}),ud=(0,Ie.default)("div",{target:"e16hbrhj0"})({width:"315px",margin:"auto",height:"44px"},"label:DivGuestModeContainer;"),gd=(0,Ie.default)("div",{target:"e16hbrhj1"})({height:"158px",paddingTop:"56px",paddingBottom:"18px",justifyContent:"space-between",alignItems:"center",display:"flex",flexDirection:"column"},"label:DivStartsOnTikTokContainer;"),hd=(0,Ie.default)("div",{target:"e16hbrhj2"})({display:"flex",flexDirection:"row",flexShrink:"0",alignItems:"center",justifyContent:"center",margin:"16px auto",overflow:"hidden",width:"315px"},"label:DivGuestModeOrContinueWithContainer;"),md=(0,Ie.default)("div",{target:"e16hbrhj3"})((({theme:e})=>[{width:"100%",height:"1px",flexShrink:"0",background:e.colors.LineReverse2}]),"label:DivGuestModeSeparatorLine;"),_d=(0,Ie.default)("div",{target:"e16hbrhj4"})([{margin:"0 6px",whiteSpace:"nowrap"}],"label:DivGuestModeSeparatorText;");var fd=o(72241);const yd=(0,A.memo)((function(){const e=Ri(["google","facebook"]),t=(0,lo.K)({isGuestMode:!0}),o=(0,l.Nj)(T.$F),a=(0,A.useCallback)((()=>{o.loginMethodExpand(),t()}),[o,t]),r=(0,A.useMemo)((()=>[...e,{icon:ad.A,onClick:a,type:"openLogin"}]),[a,e]),[d,{setLoginModalShow:c,setCloseCallback:p,setGroupId:u,setIsLoginOnLoadClosed:g}]=(0,P.MR)((e=>e.closeCallback)),h=(0,f.s)("Webapp"),[{showFlashingButton:m}]=(0,s.Su)(kt.t),y=(0,s.wA)(_),b=(0,A.useCallback)((()=>{c(!1),o.loginNotifyClose({isSignUp:"0",e2eInfo:k.nf.getTrackingInfo()}),y.setLoginModalInitialState(),d(),p(L()),u(void 0),localStorage.setItem("guest-mode-flag","1"),localStorage.setItem("timeOfLastPopup",Date.now().toString()),g({isLoginOnLoadClosed:!0})}),[c,o,y,d,p,u,g]),{value:x}=(0,A.useContext)(fd.xm),v=(0,A.useMemo)((()=>x?(0,n.jsx)(sd,{width:40,height:48}):(0,n.jsx)(Pi,{width:40,height:48})),[x]);return _t(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(gd,{children:[v,(0,n.jsx)(i.Fm,{type:"H6",color:"TextPrimary",children:h("tiktok_instant_app_loading_status_header")})]}),(0,n.jsx)(ud,{children:(0,n.jsx)(so,{text:h("pcWeb_guestLogin_without"),showFlashingButton:m,onClick:b,buttonTheme:"primary",focusable:!0},"login-guest-button")}),(0,n.jsxs)(hd,{children:[(0,n.jsx)(md,{}),(0,n.jsx)(_d,{children:(0,n.jsx)(i.Fm,{type:"P5-Regular",color:"TextQuaternary",children:h("webapp_orContinueWith")})}),(0,n.jsx)(md,{})]}),(0,n.jsx)(pd,{config:r,width:44,height:44})]})}));var bd=o(1452),xd=o(93981);const vd=(0,Ie.default)("div",{target:"e10o7n900"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"24px",lineHeight:"32px",margin:"32px auto 12px",fontWeight:"bold",textAlign:"center"}]),"label:DivTitle;"),kd=(0,Ie.default)("div",{target:"e10o7n901"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary"}),{fontSize:"18px",lineHeight:"25px",display:"flex",justifyContent:"space-between",marginBottom:"40px"}]),"label:DivDescription;"),Cd=(0,Ie.default)("img",{target:"e10o7n902"})({width:"80%",margin:"0 auto 16px"},"label:ImgQR;"),Sd=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),{appType:t}=(0,s.Ph)(xi.L,{selector:e=>{var t;return{appType:null===(t=e.appContext)||void 0===t?void 0:t.appType}},dependencies:[]}),o="m"===t?bd:xd;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(kd,{"data-e2e":"instagram-desc",children:e("login_risk_popup_pc_body_2")}),(0,n.jsx)(Cd,{src:o,"data-e2e":"instagram-img"})]})})),wd=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),t=ye(),{fromIns:o}=t.state||{};return _t(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(vd,{"data-e2e":"instagram-title",children:e(o?"login_new_ins_PC_title":"login_risk_popup_pc_title")}),(0,n.jsx)(Sd,{}),(0,n.jsx)(od.mg,{children:(0,n.jsx)("link",{rel:"canonical",href:`${td.C}/download`},"canonical")})]})})),jd=(0,Ie.default)("div",{target:"eop2wpq1"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),{marginBottom:"16px",fontSize:"18px",lineHeight:"24px",display:"flex",justifyContent:"space-between"}]),"label:DivDescription;"),Td=()=>{const e=(0,l.Nj)(T.$F),t=(0,f.s)("WebApp_Login"),[{forceResetResponse:o,loginLoading:i},{handleForceResetPwdByEmail:a,handleForceResetPwdByPhone:r,clearForceResetRes:d}]=(0,s.Su)(Ae.$),{conditional_login_ticket:c,type:p,email:u,mobile:g}=(0,Ve.L$)(o),[{sendCodeLoading:h,ticket:m,code:_,codeFormatError:y},{sendPhoneCodeForForceResetPwd:b,sendEmailCodeForForceResetPwd:x}]=(0,s.Su)(Wa.m),{password:v,contentValid:k,lengthValid:C}=(0,s.Ph)(Na),S=Ja(),w=(0,A.useCallback)((()=>{"email"===p?x({conditional_login_ticket:c}):b({conditional_login_ticket:c})}),[p,x,c,b]),j=(0,A.useCallback)((()=>{const t={code:_,ticket:null!=m?m:"",password:v,conditional_login_ticket:c};e.forceResetSubmit(),"email"===p?a(t):r(t)}),[_,c,a,r,e,v,m,p]),P=!_||!v||!k||!C||Boolean(y),E="email"===p?t("setting_password_code_email_text",{email:u}):t("setting_password_code_sms_text",{mobile:g}).replace(/(\D{1})(4)(\D{1})/,((e,t,o,n)=>`${t}6${n}`));return(0,A.useEffect)((()=>()=>{d()}),[]),_t(),(0,n.jsxs)(Qa,{onSubmit:j,children:[(0,n.jsx)($i,{children:t("common_login_reset_password_title")}),(0,n.jsx)(jd,{children:t("changepw_banner")}),(0,n.jsx)(al,{email:"email"===p,autoSendFirstTime:!0,disabled:!c,codeFromNumber:c,loading:h,onClickSendCode:w}),(0,n.jsx)(ur,{text:E,type:"default"}),(0,n.jsx)(mr,{loginError:Boolean(S)}),(0,n.jsx)(ur,{text:t(S),type:"error"}),(0,n.jsx)(fr,{disabled:P,loading:i,children:t("Login")})]})},Pd=(0,Ie.default)("div",{target:"e1419m800"})({marginBottom:"9px",position:"relative"},"label:DivEmailContainer;"),Ed=(0,Ie.default)("ul",{target:"e3y4xh60"})((({theme:e})=>({position:"absolute",top:"44px",borderRadius:"4px",background:e.colors.BGPrimary,border:"1px solid",borderColor:e.colors.LineSecondary,zIndex:2,marginTop:"4px",width:"100%",padding:"0"})),"label:UlList;"),Md=(0,Ie.default)("li",{target:"e3y4xh61"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary2"}),{display:"flex",padding:"0 12px",justifyContent:"space-between",alignItems:"center",height:"34px",lineHeight:"34px",fontSize:"13px",cursor:"pointer"},{":hover":{backgroundColor:"rgba(22, 24, 35, .03)"}}]),"label:LiListItem;"),Ld=(0,A.memo)((function({focused:e}){const{emailSuffixConfig:t}=St((()=>["emailSuffixConfig"]),[]),[{email:o=""},{setSuggestEmailSuffixConfig:i}]=(0,s.Su)(Ha.N),[a,r]=(0,A.useState)(!1);(0,A.useEffect)((()=>{if(e){const e=o.split("@")[1];if(o.includes("@")&&".com"!==e.slice(-4))return void r(!0)}r(!1)}),[e,a,o]);const l=(0,A.useCallback)((e=>()=>{r(!1),i(e)}),[i]);return a?(0,n.jsx)(Ed,{children:t.map(((e,t)=>{var i;return(0,n.jsxs)(Md,{onClick:l(`@${e}`),children:[null!==(i=null==o?void 0:o.split("@")[0])&&void 0!==i?i:"","@",e]},t)}))}):null})),Ad=(0,A.memo)((function(e){const t=(0,f.s)("WebApp_Login"),{isMobile:o}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{emailRegistered:i,errorMsg:a=""}=e,[{emailErrorMsg:r="",email:l=""},{setEmailInfo:d}]=(0,s.Su)(Ha.N),[p,u]=(0,A.useState)(!1),g=(0,A.useCallback)((()=>{u(!0)}),[]),h=(0,A.useCallback)((()=>{setTimeout((()=>{u(!1)}),300)}),[]),m=(0,A.useCallback)((e=>{const t=e.target.value;d({email:t,valid:!0})}),[d]);(0,A.useEffect)((()=>{if(!p&&!o){const e=(0,Ua.Ro)(l);d({email:l,valid:e})}}),[o,l,p,d]);const _=(Boolean(r||a)||i)&&(!p||o),y=r||a;return(0,n.jsxs)(Pd,{children:[(0,n.jsx)(dr,{placeholder:t("common_login_reset_email_input_placeholder"),onFocus:g,onBlur:h,onInput:m,value:l,errorState:_,autocomplete:"email",name:"email",type:"email"}),!o&&(0,n.jsx)(Ld,{focused:p}),_&&(0,n.jsx)(ur,{text:t(y),type:"error"})]})})),Id=()=>{const e=(0,f.s)("WebApp_Login"),t=fn(),{emailErrorMsg:o,email:i=""}=(0,s.Ph)(Ha.N),[{loginLoading:a},{changePwdByEmail:r}]=(0,s.Su)(Ae.$),[{sendCodeLoading:l,code:d,codeFormatError:c},{sendEmailCodeForReset:p}]=(0,s.Su)(Wa.m),{password:u,lengthValid:g,contentValid:h}=(0,s.Ph)(Na),m=Ja(),_=(0,A.useCallback)((()=>{t({platform:"email",forgetPwd:!0}),r({password:u,email:i,emailCode:d})}),[t,r,u,i,d]),y=(0,A.useCallback)((()=>{p({email:i,email_logic_type:2})}),[i,p]),b=!i||!u||!d||!h||!g||Boolean(c)||Boolean(o);return _t(),(0,n.jsxs)(Qa,{onSubmit:_,children:[(0,n.jsx)($i,{children:e("common_login_reset_password_title")}),(0,n.jsxs)(zi,{children:[e("setting_password_email_verify_title"),(0,n.jsx)(bl,{text:e("forget_password_switch_phone"),path:j.tH.loginForgetPhonePassword,replace:!0})]}),(0,n.jsx)(Ad,{}),(0,n.jsx)(al,{email:!0,disabled:Boolean(o)||!i,codeFromNumber:i,loading:l,onClickSendCode:y}),(0,n.jsx)(mr,{loginError:Boolean(m)}),(0,n.jsx)(ur,{text:e(m),type:"error"}),(0,n.jsx)(fr,{disabled:b,loading:a,children:e("Login")})]})},Rd=()=>{const e=(0,f.s)("WebApp_Login"),t=fn(),[o]=(0,s.Su)(za.U),{phoneErrorMsg:i,mobile:a,phone:r}=o,[{sendCodeLoading:l,codeFormatError:d,code:c},{sendPhoneCodeForResetPwd:p}]=(0,s.Su)(Wa.m),[{loginLoading:u},{changePwdByMobile:g}]=(0,s.Su)(Ae.$),{password:h,lengthValid:m,contentValid:_}=(0,s.Ph)(Na),y=Ja(),b=(0,A.useCallback)((()=>{t({platform:"sms_verification",forgetPwd:!0}),g({password:h,mobile:a,phoneCode:c})}),[t,g,h,a,c]),x=(0,A.useCallback)((()=>{p({mobile:a})}),[a,p]),v=!a||!h||!c||!_||!m||Boolean(i)||Boolean(d);return _t(),(0,n.jsxs)(Qa,{onSubmit:b,children:[(0,n.jsx)($i,{children:e("common_login_reset_password_title")}),(0,n.jsxs)(zi,{children:[e("setting_bind_phone_input_title"),(0,n.jsx)(bl,{text:e("forget_password_switch_email"),path:j.tH.loginForgetEmailPassword,replace:!0})]}),(0,n.jsx)(hs,{}),(0,n.jsx)(al,{disabled:Boolean(i)||!r,codeFromNumber:a,loading:l,onClickSendCode:x}),(0,n.jsx)(mr,{loginError:Boolean(y)}),(0,n.jsx)(ur,{text:e(y),type:"error"}),(0,n.jsx)(fr,{disabled:v,loading:u,children:e("Login")})]})},Fd=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),t=fn(),{setEmail:o}=(0,s.wA)(Ha.N),[{loginLoading:i},{handlePasswordLogin:a}]=(0,s.Su)(Ae.$),{password:r,hasInvalid:l}=(0,s.Ph)(Na),[d,c]=(0,A.useState)(""),p=Ja([d]),u=(0,A.useCallback)((()=>{const e=(0,Ua.Ro)(d)?d.trim():void 0;t({platform:e?"email":"handle"}),a({username:d.trim(),password:r,email:e})}),[a,t,r,d]),g=(0,A.useCallback)((e=>{c(e.target.value)}),[]),h=(0,A.useCallback)((()=>{(0,Ua.Ro)(d)&&o(d.trim())}),[d,o]);return(0,n.jsxs)(Qa,{onSubmit:u,children:[(0,n.jsx)(dr,{placeholder:e("Email or Username"),onChange:g,name:"username",value:d,"data-e2e":"email-input"}),(0,n.jsx)(mr,{create:!1,loginError:Boolean(p)}),p&&(0,n.jsx)(ur,{text:e(p),type:"error"}),(0,n.jsx)(Pl,{onClickForgetEmailPwd:h}),(0,n.jsx)(fr,{disabled:!d||!r||l,loading:i,"data-e2e":"login-button",children:e("Login")})]})})),Od=()=>{const e=(0,f.s)("WebApp_Login"),{showLoginOptionSlider:t}=(0,y.LK)();return _t(),(0,n.jsxs)(n.Fragment,{children:[!t&&(0,n.jsx)($i,{id:"login-modal-title",children:e("Login")}),(0,n.jsxs)(zi,{children:[e("Email or Username")," ",(0,n.jsx)(bl,{text:e("common_login_switch_phone"),path:j.tH.loginPhone,replace:!0})]}),(0,n.jsx)(Fd,{})]})};let Dd=!1;function Hd(e,t){const{ttpConfig:o}=St((()=>["ttpConfig"]),[]),n=fe(),i=function(){const{featureFlags:e}=St((()=>["featureFlags"]),[]);return!!(null==e?void 0:e.showTipWhenEnterPhoneCodeLogin)&&!Dd}(),[a,r]=(0,A.useState)(null),[s,l]=(0,A.useState)(i),d=(0,A.useCallback)((()=>{r(null),l(!1),Dd=!0}),[l]),c=(0,A.useCallback)(((e=null)=>{r(e),l(!0)}),[l]),p=(0,A.useCallback)((()=>{a&&t?n.push(t):n.push(e),d()}),[n,d,e,a,t]),u=(0,A.useCallback)((e=>!e.isAxiosError||(c(e),!1)),[c]);return o.preferPasswordLogin?{visible:s,closeModal:d,showModal:c,gotoPasswordLogin:p,errorInterceptor:u}:{visible:!1,closeModal:L(),showModal:L(),gotoPasswordLogin:L()}}const Ud=(0,pn.Ay)({resolved:{},chunkName:()=>"login-tip-modal",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!o.m[t]},importAsync:()=>Promise.all([o.e(8873),o.e(2514)]).then(o.bind(o,58004)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return o(t)},resolve:()=>58004}),Nd=()=>{const e=(0,f.s)("WebApp_Login"),t=fn(),[{sendCodeLoading:o,code:i,codeFormatError:a},{sendPhoneCodeForLogin:r,sendPhoneCodeForVerify:l}]=(0,s.Su)(Wa.m),[{phoneNotRegistered:d,loginLoading:c},{handleSmsLogin:p,handleSmsVerify:u}]=(0,s.Su)(Ae.$),{registerPhone:g}=(0,s.wA)(ko.H),{isSecurityVerification:h}=St((()=>["isSecurityVerification"]),[]),{region:m}=(0,Ve.L$)((0,Ze.W)((()=>["region"]),[])),[_]=(0,s.Su)(za.U),{mobile:b,phoneErrorMsg:x}=_,v=b&&i&&!x&&!a,k=Ja(),C=Hd(j.tH.loginPhonePassword),S=(0,A.useCallback)((()=>{t({platform:"sms_verification"});const e={mobile:b,phoneCode:i,login_only:!0};h?u(e):p(e)}),[p,u,h,t,b,i]),w=(0,A.useCallback)((()=>{const e=C.errorInterceptor;h?l({mobile:b,errorInterceptor:e}):r({mobile:b,errorInterceptor:e})}),[h,b,r,l,C.errorInterceptor]),T=(0,A.useCallback)((()=>{g({region:m})}),[g,m]),{showLoginOptionSlider:P}=(0,y.LK)();return _t(),(0,n.jsxs)(Qa,{onSubmit:S,children:[!P&&(0,n.jsx)($i,{id:"login-modal-title",children:e("Login")}),(0,n.jsxs)(zi,{children:[e("phone"),(0,n.jsx)(bl,{text:e("common_login_switch_email"),path:j.tH.loginEmail,replace:!0,"data-e2e":"email-tab"})]}),(0,n.jsx)(hs,{}),(0,n.jsx)(al,{disabled:Boolean(x)||!b,codeFromNumber:b,loading:o,errorMsg:k,onClickSendCode:w}),(0,n.jsx)(bl,{text:e("login_option_password"),path:j.tH.loginPhonePassword}),(0,n.jsx)(fr,{disabled:!v,loading:c,"data-e2e":"login-button",children:e("Login")}),d&&(0,n.jsxs)(Wi,{children:[(0,n.jsx)(Gi,{children:e("common_login_sms_unregistered_pc_1")}),(0,n.jsx)(Gi,{link:!0,onClick:T,children:e("common_login_sms_unregistered_pc_2")})]}),(0,n.jsx)(Ud,Object.assign({},C,{isMobile:!1}))]})},Bd=(0,Ie.default)("div",{target:"e1c067ot0"})({display:"flex",alignItems:"center",marginTop:"9px"},"label:DivLinksContainer;"),$d=(0,Ie.default)("span",{target:"e1c067ot1"})((({theme:e})=>({width:"1px",height:"12px",margin:"0 16px",background:e.colors.LineSecondary})),"label:SpanSplitLine;"),zd=()=>{const e=(0,f.s)("WebApp_Login"),t=fn(),[{loginLoading:o},{handlePasswordLogin:i}]=(0,s.Su)(Ae.$),{phoneErrorMsg:a,phone:r,areaCode:l}=(0,s.Ph)(za.U),{password:d,hasInvalid:c}=(0,s.Ph)(Na),p=Ja(),u=(0,A.useCallback)((()=>{const e=`+${l} ${r}`;t({platform:"phone"}),i({account:e,password:d,mobile:e})}),[l,i,t,d,r]),{showLoginOptionSlider:g}=(0,y.LK)();return _t(),(0,n.jsxs)(Qa,{onSubmit:u,children:[!g&&(0,n.jsx)($i,{id:"login-modal-title",children:e("Login")}),(0,n.jsxs)(zi,{children:[e("phone")," ",(0,n.jsx)(bl,{text:e("common_login_switch_email"),path:j.tH.loginEmail,replace:!0})]}),(0,n.jsx)(hs,{}),(0,n.jsx)(mr,{create:!1,loginError:Boolean(p)}),p&&(0,n.jsx)(ur,{text:e(p),type:"error"}),(0,n.jsxs)(Bd,{children:[(0,n.jsx)(bl,{text:e("forget_password"),path:j.tH.loginForgetPhonePassword}),(0,n.jsx)($d,{}),(0,n.jsx)(bl,{text:e("common_login_password_button"),path:j.tH.loginPhone})]}),(0,n.jsx)(fr,{disabled:Boolean(a)||!r||!d||c,loading:o,children:e("Login")})]})},Wd=(0,Ie.default)("h2",{target:"eph3mrd0"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:e.isMobile?"20px":"15px",display:"flex",justifyContent:"space-between",marginBottom:"5px"}]),"label:H2Title;"),Gd=(0,Ie.default)("div",{target:"eph3mrd1"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextTertiary"}),{fontSize:"14px",display:"flex",justifyContent:"space-between",marginBottom:"24px"}]),"label:DivDescription;"),Vd=()=>{const e=(0,f.s)("WebApp_Login"),t=fn(),[{loginLoading:o},{handlePasswordLogin:i}]=(0,s.Su)(Ae.$),{email:a}=(0,s.Ph)(Ha.N),{isMobile:r}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),[l,d]=(0,A.useState)(""),p=Ja([l]),u=(0,A.useCallback)((()=>{t({platform:"email"}),i({email:a,password:l,username:a})}),[a,i,t,l]),g=(0,A.useCallback)((e=>{d(e.target.value)}),[]),{showLoginOptionSlider:h}=(0,y.LK)();return(0,n.jsxs)(Qa,{onSubmit:u,children:[!h&&(0,n.jsx)(Wd,{children:e("common_registration_email_existing_title")}),r&&(0,n.jsx)(Gd,{children:e("common_registration_email_existing_text")}),(0,n.jsx)(dr,{value:a,readonly:!0,disableDelete:!0}),(0,n.jsx)(dr,{placeholder:e("Password"),onChange:g,password:!0,border:!0,errorState:Boolean(p)}),(0,n.jsx)(ur,{text:e(p||(r?"":"common_registration_email_existing_text")),type:p?"error":"default"}),(0,n.jsx)(Pl,{}),(0,n.jsx)(fr,{disabled:!l,loading:o,children:e("Login")})]})},Kd=()=>{const e=(0,f.s)("WebApp_Login");return _t(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($i,{children:e("Login")}),(0,n.jsx)(Vd,{})]})};var qd=o(58542);const Zd=(0,Ie.default)("div",{target:"enfnoax0"})((({isOriginalLoginContainer:e})=>({maxHeight:"463px",overflowY:"scroll",overflowX:"hidden",margin:"auto",padding:"unset",marginTop:e?"64px":"unset",width:e?"363px":"unset"})),"label:DivLoginContainer;"),Jd=(0,Ie.default)("h2",{target:"enfnoax4"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"32px",margin:"64px auto 16px",fontWeight:"bold",textAlign:"center"}]),"label:H2TitleRedesign;"),Yd=(0,Ie.default)("div",{target:"enfnoax5"})({display:"flex",justifyContent:"center",margin:"16px 0px 48px"},"label:DivSegmentControlContainer;"),Qd=()=>{var e;const t=(0,f.s)("WebApp_Login"),o=(0,f.s)("Webapp"),{loginTitle:i}=St((()=>["loginTitle"]),[]),[a,r]=(0,A.useState)("qr"),[s,l]=(0,A.useState)(!1),d=(0,Ze.W)((()=>["abTestVersion","user","webIdCreatedTime"]),[]),[c,p]=(0,A.useState)(!1),u=Hi(),g=Fi(u),h=Ri(g).filter((e=>"qr"!==e.type&&"email"!==e.type)),m=(0,Je.oN)(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.pathname),_=(0,A.useMemo)((()=>[{value:"qr",title:o(Vt.p$.qrCodeKey,{},Vt.p$.qrCodeDefault)},{value:"phone",title:o(Vt.p$.phoneKey,{},Vt.p$.phoneDefault)},{value:"other",title:o(Vt.p$.otherKey,{},Vt.p$.otherDefault)}]),[]),b=(0,A.useCallback)((e=>{var t;r(e),"qr"===e?(t={page_name:m},tt.f.sendEvent("click_QR_login",t)):"phone"===e?(e=>{tt.f.sendEvent("click_login_button",e)})({device_platform:"pc",enter_method:"login_redesign"}):"other"===e&&ot({page_name:m})}),[r]),x=(0,A.useCallback)((()=>(0,n.jsx)(Jd,{"data-e2e":"login-title",id:"login-modal-title",children:t(i,{},Vt.fN)})),[t,i]),v=(0,y.ZO)(),k=(0,A.useCallback)(((e,t)=>()=>{"facebook"===e&&v?(l(!0),nt()):t()}),[v]),C=(0,A.useCallback)((()=>{p(!1)}),[]),S=(0,A.useCallback)((e=>{13===e.keyCode&&p(!1)}),[p]);return(0,n.jsxs)(ft.rz,{children:[x(),(0,n.jsx)(Yd,{children:(0,n.jsx)(qd.DUM,{compact:!1,size:"xs",shape:"rectangle",style:{margin:"0 auto",minHeight:"32px",height:"32px",width:"100%"},value:a,onChange:b,items:_})}),"qr"===a?(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.loginQRcode,component:Sa,exact:!0}),(0,n.jsx)(Ce,{path:"*",component:Sa})]}):"phone"===a?(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.loginPhoneOrEmail,component:Nd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhone,component:Nd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhonePassword,component:zd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginEmail,component:Od,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginWithSignedEmail,component:Vd,exact:!0}),(0,n.jsx)(Ce,{path:"*",component:Nd})]}):"other"===a?(0,n.jsxs)(n.Fragment,{children:[(w=c?h.slice(0,4):h,w.map((e=>(0,n.jsx)(so,{text:t(e.starlingText),Icon:e.icon,onClick:k(e.type,e.onClick),floatingBannerText:e.lastLoginMethod&&!(null==d?void 0:d.user)?t("encouragePreviousLoginPlatform_loginPage_loginBadge_body"):void 0,focusable:!0,loading:e.loading,effect:e.effect},e.starlingText)))),c&&h.length>4&&(0,n.jsx)(lt,{onClick:C,onKeyDown:S,tabIndex:0,role:"button",children:(0,n.jsx)(Ke.A,{})})]}):null]});var w},Xd=(0,A.memo)((()=>{const{enterMethod:e,closeable:t,groupId:o,lastGroupId:i,predictionPayload:a,popupType:r,loginModalShow:l,isGuestMode:d,isGuestModeUI:p}=(0,P.mZ)((e=>({enterMethod:e.enterMethod,closeable:e.closeable,groupId:e.groupId,lastGroupId:e.lastGroupId,predictionPayload:e.predictionPayload,popupType:e.popupType,loginModalShow:e.loginModalShow,isGuestMode:e.isGuestMode,isGuestModeUI:e.isGuestModeUI})),F.bN);Xl({enterMethod:e,closeable:t,groupId:o,lastGroupId:i,predictionPayload:a}),(0,Ge.rF)({pid:"login"});const{forceResetResponse:u}=(0,s.Ph)(Ae.$),{isMobile:g}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{pathname:h}=ye(),m=(0,A.useCallback)((e=>{27!==e.keyCode&&e.stopPropagation()}),[]),{showLoginOptionSlider:_}=(0,y.LK)(),f=[j.tH.loginForgetEmailPassword,j.tH.loginForgetPhonePassword,j.tH.loginDownloadApp,j.tH.loginSSO,j.tH.loginGuestMode],[b,x]=(0,A.useState)(!0);return(0,A.useEffect)((()=>{var e;x(!d&&!p||g||!l||"1"===(null!==(e=localStorage.getItem("guest-mode-flag"))&&void 0!==e?e:"0")&&!p)}),[p,d,g,l]),!g&&b&&_&&l&&"qr_bottom_right"!==r?(0,n.jsxs)(Zd,{isOriginalLoginContainer:f.includes(h)||h.startsWith("/login/2sv"),children:[(0,n.jsx)(id,{page:"login"}),(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.loginTwoStepVerify,component:ql,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginForgetEmailPassword,component:u?Td:Id,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginForgetPhonePassword,component:u?Td:Rd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginDownloadApp,component:wd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginSSO,component:Da,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginGuestMode,component:yd,exact:!0}),(0,n.jsx)(Ce,{path:"*",component:Qd})]})]}):(0,n.jsxs)(go,{isMobile:g,popupType:r,isGuestModeRedesign:h===j.tH.loginGuestMode,onKeyDown:m,children:[(0,n.jsx)(id,{page:"login"}),(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.loginHome,component:wa,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginQRcode,component:Sa,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhoneOrEmail,component:Nd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhone,component:Nd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhonePassword,component:zd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginEmail,component:Od,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginWithSignedEmail,component:Kd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginTwoStepVerify,component:ql,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.tvLoginHome,component:Is,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.tvLoginEmail,component:Rr,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.tvLoginPhone,component:Ws,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginForgetEmailPassword,component:u?Td:Id,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginForgetPhonePassword,component:u?Td:Rd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginDownloadApp,component:wd,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginSSO,component:Da,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginGuestMode,component:yd,exact:!0}),(0,n.jsx)(Ce,{path:"*",component:wa})]})]})}));var ec=o(15942),tc=o(78214);const oc=(0,Ie.default)("li",{target:"euwmh3o0"})({display:"flex",alignItems:"center",position:"relative",borderBottom:"",padding:"12px 12px",boxSizing:"border-box"},"label:LiGroupItem;"),nc=e=>(0,n.jsx)(oc,{children:(0,n.jsx)(i.Fm,{type:"P3-Semibold",children:e.groupLabel})}),ic=(0,Ie.default)("li",{target:"e1x05iuc0"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontWeight:"normal",fontFamily:"TikTokFont",typography:"P3"}),{alignItems:"center",position:"relative",borderBottom:"",padding:"12px 12px",boxSizing:"border-box",":hover":{background:e.colors.BGView}}]),"label:LiGroupItem;"),ac=e=>{const{label:t,defaultChecked:o,onClickRadio:a}=e,r=(0,A.useCallback)((e=>{a(e.target.value)}),[a]);return(0,n.jsx)(ic,{children:(0,n.jsx)(i.v3,{label:t,defaultChecked:o,name:"region",value:t,labelPosition:"before",onChange:r})})},rc=(0,Ie.default)("form",{target:"e1mlcez20"})((({theme:{colors:e},isMobile:t,isModal:o})=>({display:"flex",flexDirection:"row",alignItems:"center",padding:"12px 16px",background:e.BGInput,borderRadius:"92px",overflow:"hidden",height:"40px",margin:t?"16px 16px":"16px 10px",position:o?"absolute":"fixed",width:t?"92%":"100%",maxWidth:"400px",top:t?"60px":"90px",zIndex:2})),"label:FormElement;"),sc=(0,Ie.default)("div",{target:"e1mlcez21"})((({theme:{colors:e},isFocused:t})=>({display:"none",position:"absolute",left:"0",top:"0",right:"0",bottom:"0",border:t?`2px solid ${e.Negative}`:`1.5px solid ${e.LinePrimary}`,borderRadius:"92px",zIndex:-1})),"label:DivInputBorder;"),lc=(0,Ie.default)("input",{target:"e1mlcez22"})((({theme:{colors:e,typography:t,fontFamilies:o,fontWeights:n},withIcon:i})=>Object.assign(Object.assign({fontFamily:o.TikTokFont,fontWeight:n.normal},t.P2),{border:"none",background:"transparent",outline:"none",padding:"0",width:i?"306px":"346px",color:e.TextPrimary,caretColor:e.Primary,appearance:"textfield",[`:focus ~ ${sc}`]:{display:"block"},"::placeholder":{color:e.TextTertiary},":placeholder-shown":{textOverflow:"ellipsis"}})),"label:InputElement;");lc.defaultProps=Object.assign(Object.assign({},lc.defaultProps),{"data-e2e":"search-user-input"});const dc=(0,Ie.default)("span",{target:"e1mlcez24"})((({theme:{colors:e}})=>({width:"1px",height:"28px",margin:"-3px 0",background:e.LineSecondary})),"label:SpanSplitter;"),cc=(0,Ie.default)("button",{target:"e1mlcez25"})((({theme:{colors:e,direction:t}})=>[{padding:"11px 16px 11px 12px",margin:"-12px -16px",fontSize:"0",cursor:"pointer",outline:"none",border:"none",background:"transparent",":hover":{background:e.BGView},":active":{background:e.BGInput2},"&:focus, :focus-visible":{outline:"none!important"}},(0,Re.mp)({direction:t,marginStart:"0"})]),"label:ButtonSearch;");cc.defaultProps=Object.assign(Object.assign({},cc.defaultProps),{"data-e2e":"search-button"});const pc=(0,Ie.default)("div",{target:"e1mlcez26"})((({focused:e,theme:t})=>({outline:e?`2px solid ${t.colors.Negative}`:"none"})),"label:DivSearchIconContainer;"),uc=(0,A.memo)((function({searchValue:e,setSearchValue:t,onSubmit:o,isMobile:i}){const a=(0,f.s)("WebApp_Login"),{colors:l}=(0,r.u)(),d=(0,A.useRef)(null),[{isModal:c}]=(0,s.Su)(kt.t),p=(0,A.useCallback)((e=>{e.preventDefault(),null==o||o()}),[o]),[u,g]=(0,A.useState)(!1),[h,m]=(0,A.useState)(!1),[_,y]=(0,A.useState)(!1),b=(0,A.useCallback)((e=>()=>{e&&h||g(e)}),[h]),x=(0,A.useCallback)((()=>{m(!0),g(!1)}),[]),v=(0,A.useCallback)((()=>{m(!1)}),[]),k=(0,A.useCallback)((e=>{13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),e.stopPropagation(),null==o||o())}),[o]),C=(0,A.useCallback)((e=>{9===e.keyCode&&y(e.target!==d.current)}),[]),S=(0,A.useRef)(null),w=a("accessibilityLabels_search_button"),j=(0,A.useCallback)((e=>{const o=e.target.value;(e=>!e.startsWith(" "))(o)&&t(o)}),[t,e]);return(0,n.jsxs)(rc,{className:"search-input",action:"/search",onSubmit:p,onKeyUp:C,isMobile:i,isModal:c,children:[(0,n.jsx)(lc,{ref:S,value:e,onChange:j,placeholder:w,name:"q",type:"search",autoComplete:"off",role:"combobox"}),(0,n.jsx)(dc,{}),(0,n.jsx)(cc,{type:"submit",ref:d,onFocus:b(!0),onBlur:b(!1),onMouseDown:x,onMouseUp:v,onKeyDown:k,"aria-label":a("accessibilityLabels_search_button"),children:(0,n.jsx)(pc,{focused:u,children:(0,n.jsx)(Zr.A,{fill:e?l.TextSecondary:l.TextQuaternary,width:24,height:24})})}),(0,n.jsx)(sc,{isFocused:_})]})})),gc=(0,A.memo)((function({disabled:e,children:t}){const{loginModalSwitchPath:o}=(0,s.Ph)(_);return o?(0,n.jsx)(Oi.Ay,{disabled:e,autoFocus:!1,children:t}):(0,n.jsx)(n.Fragment,{children:t})})),hc=(0,Ie.default)("div",{target:"e1r43con0"})((({isMobile:e})=>({padding:e?"0 30px":"unset","@media (max-width: 432px)":{padding:"0 16px"}})),"label:DivHomeContainer;"),mc=(0,Ie.default)("ul",{target:"e1r43con1"})({padding:"0px 0px",margin:0,listStyle:"none",boxSizing:"border-box",userSelect:"none"},"label:UlCountryListContainer;"),_c=e=>e.reduce(((e,t)=>{const o=t.localizedCountryName[0].toUpperCase().normalize("NFD").replace(/\p{Diacritic}/gu,"");return Object.assign(Object.assign({},e),{[o]:[...e[o]||[],t]})}),{}),fc=(e,t,o,n)=>{const i=[];return n&&i.push({itemType:"header",label:o},{itemType:"region",label:n.localizedCountryName,region:n}),Object.entries(t).forEach((t=>{const o=t[0].normalize("NFD").replace(/\p{Diacritic}/gu,""),n=t[1].sort((e=>(t,o)=>e.compare(t.localizedCountryName,o.localizedCountryName))(e));i.push({itemType:"header",label:o}),n.forEach((e=>{i.push({itemType:"region",label:e.localizedCountryName,region:e})}))})),i},yc=()=>{var e;const t=(0,f.s)("WebApp_Login"),{isMobile:o}=(0,Ve.L$)((0,c.U)((()=>["isMobile","playerInfo"]),[])),{language:i="en"}=null!==(e=(0,Ze.W)((()=>["language"]),[]))&&void 0!==e?e:{},a=Intl.Collator(i),[r,d]=(0,A.useState)(!1),[p,u]=(0,A.useState)([]),[g,h]=(0,A.useState)(!1),[{region:m,regionList:_,initializedTTPConfig:y},{fetchRegionList:b,setUserSelectedRegion:x}]=(0,s.Su)(ko.H),v=(0,A.useCallback)((()=>{b()}),[b]);(0,A.useEffect)((()=>{var e;e={enter_from:"sign_up_page"},tt.f.sendEvent("region_selection_page_show",e)}),[]),(0,A.useEffect)((()=>{y&&v()}),[y]);const k=(0,A.useCallback)((e=>{9===e.keyCode&&d(!0)}),[]),C=(0,A.useMemo)((()=>{const e=(g?p:_).filter((e=>e.countryCode.toUpperCase()!==(null==m?void 0:m.countryCode.toUpperCase()))),o=p.some((e=>e.countryCode.toUpperCase()===(null==m?void 0:m.countryCode.toUpperCase())));return g&&!o?fc(a,_c(e),t("regionOption_selectCountry_list_description")):fc(a,_c(e),t("regionOption_selectCountry_list_description"),m)}),[g,p,_,m,a]),S=(0,l.Nj)(T.$F),w=e=>{const t=null==_?void 0:_.find((t=>t.localizedCountryName===e));var o;t&&(x(t),o={enter_from:"sign_up_page",origin_region:null==m?void 0:m.countryCode,region_selected:t.countryCode},tt.f.sendEvent("select_account_region",o),S.setSignUpRegionSourceParams({region_source:1,origin_region:null==m?void 0:m.countryCode,region_selected:t.countryCode}))},j=(0,A.useMemo)((()=>C.flatMap((e=>"header"===e.itemType?(0,n.jsx)(nc,{groupLabel:e.label},e.label):"region"===e.itemType&&e.region?(0,n.jsx)(ac,{label:e.label,onClickRadio:w,defaultChecked:e.region.countryCode.toUpperCase()===(null==m?void 0:m.countryCode.toUpperCase())},e.label):[]))),[C]),[P,E]=(0,A.useState)(""),M=(0,A.useCallback)((()=>{u(_.filter((e=>e.localizedCountryName.toUpperCase().includes(P.toUpperCase())))),h(!0)}),[P]);return _t(),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(gc,{disabled:r,children:[o&&(0,n.jsx)(Gt,{title:t("regionOption_selectCountry_list_title"),showRight:!1}),(0,n.jsx)("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:(0,n.jsx)(uc,{searchValue:P,setSearchValue:E,onSubmit:M,isMobile:o})}),(0,n.jsx)(hc,{isMobile:o,onKeyDown:k,children:(0,n.jsx)(mc,{children:j})})]})})};function bc(){const{registerLimited:e}=(0,s.Ph)(Te.T),t=fe();(0,A.useEffect)((()=>{e&&t.replace(j.tH.signupCreateAccount)}),[t,e])}function xc(){const e=Co(),t=fe(),{validateAge:o}=(0,s.wA)(Te.T),[{fromNotRegisterLogin:n,thirdPlatformNotRegistered:i},{registerThirdPlatform:a,registerPhone:r}]=(0,s.Su)(ko.H),l=(0,A.useCallback)((()=>{"KR"===e?t.push(j.tH.signupPolicyConfirm):"Third"===n&&i?a({ageCheckDone:!0,platform:i.platform,profileKey:i.profileKey,region:e}):"Phone"===n?r({ageCheckDone:!0,region:e}):t.push(j.tH.signupPhoneOrEmail)}),[e,n,t,r,a,i]),d=(0,A.useCallback)((e=>{e||l()}),[l]);return{handleCheckAge:(0,A.useCallback)((()=>{o({canSkip:!1,checkPassCallback:d,region:e})}),[d,o,e]),nextStep:l}}function vc(){const{initial:e,registerLimited:t,ageGateAction:o}=(0,s.Ph)(Te.T),n=fe();(0,A.useEffect)((()=>{e&&!t&&1!==o&&n.replace(j.tH.signupHome)}),[e,o,n,t])}var kc=o(45102),Cc=o(30615);function Sc(e,t){const o=[],n=new RegExp(`(${Object.keys(t).join("|")})`),i=e.split(n);for(const[e,n]of i.entries()){const i=t[n];i?o.push(i.key?i:A.cloneElement(i,Object.assign({key:e},i.props),i.props.children)):o.push(n)}return o}const wc=(0,Ie.default)("div",{target:"e1nc6q650"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",maxWidth:e.isMobile?"300px":"400px",paddingTop:e.isMobile?"24px":"32px",textAlign:"center"})),"label:DivContainer;"),jc=(0,Ie.default)("div",{target:"e1nc6q651"})((({theme:e})=>({display:"flex",padding:e.isMobile?"0":"0 32px 32px 32px"})),"label:DivFooterContainer;"),Tc=(0,Ie.default)("div",{target:"e1nc6q652"})((({theme:e})=>({padding:e.isMobile?"12px 20px 20px 20px":"16px 32px 24px 32px"})),"label:DivBodyContainer;"),Pc=(0,Ie.default)("h1",{target:"e1nc6q653"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"24px",lineHeight:"30px",padding:e.isMobile?"0 20px":"0 32px"}]),"label:H1ModalTitle;"),Ec=(0,Ie.default)("p",{target:"e1nc6q654"})([({theme:e})=>(0,Re.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),{fontSize:"16px",lineHeight:"20px",margin:"24px 0",textAlign:"center"}],"label:PDesc;"),Mc=(0,Ie.default)("a",{target:"e1nc6q655"})((({theme:e})=>({fontWeight:"bold",color:e.colors.TextSecondary,"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${e.colors.Negative}`}})),"label:ALink;"),Lc={style:"pop",business:"hungary_tos"},Ac={borderWidth:"0.5px",borderRadius:"0",fontWeight:"normal"},Ic=e=>{const t=(0,f.s)("WebApp_Login"),{isMobile:o}=e,{language:i}=(0,Ve.L$)((0,Ze.W)((()=>["language"]),[])),a=Co(),[r,s]=(0,A.useState)(!1),d="HU"===a&&!r,c=(0,l.Nj)(kc.W),p=(0,A.useCallback)((()=>{s(!0),c.handleUniversalPopClick(Object.assign(Object.assign({},Lc),{button_info:"accept"}))}),[]),u=(0,A.useCallback)((()=>{c.handleUniversalPopClick(Object.assign(Object.assign({},Lc),{button_info:"decline"})),(0,Cc.iM)(`https://www.tiktok.com/foryou?lang=${i}`)}),[]);return(0,A.useEffect)((()=>{d&&c.handleUniversalPopShow(Lc)}),[d]),d?(0,n.jsx)(S.aF,{visible:!0,maskCloseable:!1,type:o?"mobile":"pc",children:(0,n.jsxs)(wc,{children:[(0,n.jsx)(Pc,{children:t("HUToS_signupConsent_halfSheet_headline")}),(0,n.jsxs)(Tc,{children:[(0,n.jsx)(Ec,{children:Sc(t("HUToS_signupConsent_halfSheet_par1").replace("{s_termsOfService}","TOS_PLACEHOLDER").replace("{s_privacyPolicy}","PP_PLACEHOLDER").replace("{s_cookiesPolicy}","CP_PLACEHOLDER"),{TOS_PLACEHOLDER:(0,n.jsx)(Rc,{href:`https://www.tiktok.com/legal/page/eea/terms-of-service/${i}`,text:t("HUToS_signupConsent_halfSheet_par1tos")}),PP_PLACEHOLDER:(0,n.jsx)(Rc,{href:`https://www.tiktok.com/legal/page/eea/privacy-policy/${i}`,text:t("HUToS_signupConsent_halfSheet_par1pp")}),CP_PLACEHOLDER:(0,n.jsx)(Rc,{href:`https://www.tiktok.com/legal/page/global/cookie-policy/${i}`,text:t("HUToS_signupConsent_halfSheet_par1cp")})})}),(0,n.jsx)(Ec,{children:Sc(t("HUToS_signupConsent_halfSheet_par2").replace("{s_summaryOfOurTerms}","SOT_PLACEHOLDER").replace("{s_privacyHighlights}","PH_PLACEHOLDER"),{SOT_PLACEHOLDER:(0,n.jsx)(Rc,{href:`https://www.tiktok.com/legal/page/global/summary-of-terms-and-conditions-eea/${i}`,text:t("HUToS_signupConsent_halfSheet_par2sot")}),PH_PLACEHOLDER:(0,n.jsx)(Rc,{href:"https://www.tiktok.com/privacy/privacy-highlights",text:t("HUToS_signupConsent_halfSheet_par2ph")})})})]}),(0,n.jsxs)(jc,{children:[(0,n.jsx)(fr,{buttonTheme:"default",onClick:u,style:o?Ac:{fontWeight:"500"},children:t("HUToS_signupConsent_halfSheet_declineButton")}),(0,n.jsx)(fr,{buttonTheme:"default",onClick:p,style:o?Ac:{marginLeft:"8px",fontWeight:"500"},children:t("HUToS_signupConsent_halfSheet_acceptButton")})]})]})}):null};function Rc({href:e,text:t}){return(0,n.jsx)(Mc,{target:"_blank",rel:"noopener noreferrer",href:e,children:t})}const Fc=(0,Ie.default)("div",{target:"e7y6k0x0"})((({theme:e,isModal:t})=>[(0,Re.zy)({theme:e,fontWeight:"bold",fontFamily:"TikTokDisplayFont"}),{textAlign:"center",fontSize:t?"20px":"32px",lineHeight:t?"24px":"38px"}]),"label:DivTitle;"),Oc=(0,Ie.default)("div",{target:"e7y6k0x1"})((({theme:e,isModal:t})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextSecondary"}),{fontSize:t?"14px":"18px",lineHeight:t?"18px":"24px",textAlign:"center",padding:"16px 8px"}]),"label:DivDescription;"),Dc=e=>e?{paddingTop:"32px",width:"300px"}:{marginTop:"110px"},Hc=(0,Ie.default)("div",{target:"e7y6k0x2"})((({isModal:e=!1})=>[Dc(e)]),"label:DivContainer;"),Uc=({isModal:e=!1})=>{const t=(0,f.s)("WebApp_Login"),{setShowAgeConfirm:o}=(0,s.wA)(Te.T),i=fe(),a=(0,A.useCallback)((()=>{o(!1),i.push(j.tH.signupCreateAccount)}),[i,o]),r=(0,A.useMemo)((()=>e?{borderLeft:"none",borderRight:"none",borderBottom:"none",borderRadius:"0 0 8px 8px",fontWeight:500}:void 0),[e]);return _t(),(0,n.jsxs)(Hc,{isModal:e,children:[(0,n.jsx)(Fc,{isModal:e,children:t("mus_agegate_error_ftc_title")}),(0,n.jsx)(Oc,{isModal:e,children:t("mus_agegate_error_ftc_desc")}),(0,n.jsx)(fr,{onClick:a,buttonTheme:e?"default":"primary",bottonTheme:"text",style:r,children:t("Continue")})]})};var Nc=o(68652);const Bc=(e,t)=>e?{position:"fixed",bottom:"0px",left:"0",right:"0",padding:"12px 32px"}:{marginTop:t||"9px"},$c=(0,Ie.default)("div",{target:"eb49p770"})((({theme:e})=>[{paddingBottom:e.isMobile?"64px":"5px",marginTop:e.isMobile?"8px":"unset"}]),"label:DivPolicyContainer;"),zc=(0,Ie.default)("h3",{target:"eb49p771"})((({theme:e})=>{return[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont",fontWeight:"bold"}),(t=e.isMobile,t?{fontSize:"17px",lineHeight:"22px",marginBottom:"24px",textAlign:"left"}:{fontSize:"32px",lineHeight:"38px",marginBottom:"32px",textAlign:"center",marginTop:"64px"})];var t}),"label:H3Title;"),Wc=(0,Ie.default)("div",{target:"eb49p773"})({padding:"12px 0",display:"flex",i:{outline:"unset"}},"label:DivCheckItem;"),Gc=(0,Ie.default)("div",{target:"eb49p774"})({display:"flex",flexDirection:"column"},"label:DivCheckboxContent;"),Vc=(0,Ie.default)("p",{target:"eb49p776"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{fontSize:"14px",lineHeight:"18px",display:"inline"}]),"label:PCheckboxContent;"),Kc=(0,Ie.default)("h4",{target:"eb49p778"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"15px",lineHeight:"19.5px",display:"inline",margin:0}]),"label:H4CheckboxTitle;"),qc=(0,Ie.default)("div",{target:"eb49p7710"})((({theme:e,marginTop:t,backgroundColor:o})=>[Bc(e.isMobile,t),{background:o||e.colors.BGPrimary}]),"label:DivButtonWrapper;"),Zc=(0,Ie.default)("a",{target:"eb49p7711"})((({theme:e})=>({color:e.colors.Primary,fontSize:"14px",fontWeight:500,"&:visited":{color:e.colors.Primary},"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${e.colors.Negative}`},display:"flex",alignItems:"center",marginTop:"4px"})),"label:ALink;");var Jc;!function(e){e.Big="big",e.Small="small"}(Jc||(Jc={}));const Yc=(0,Ie.default)("div",{target:"e14eam340"})((({size:e})=>({width:"big"===e?"32px":"24px",position:"relative",flexShrink:0})),"label:DivCheckboxWrapper;"),Qc=(0,Ie.default)("input",{target:"e14eam341"})({display:"block",width:"24px",height:"24px",opacity:0},"label:InputCheckbox;"),Xc=(e,t)=>"small"===e?{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px"}:{width:t?"24px":"22px",height:t?"24px":"22px"},ep=(0,Ie.default)("label",{target:"e14eam342"})((({theme:e,circle:t=!0,size:o})=>[(0,Re.mp)({direction:e.direction,start:"0"}),{position:"absolute",top:0,"-webkit-tap-highlight-color":"transparent"},Xc(o,t)]),"label:LabelCheck;"),tp=(0,Ie.default)("i",{target:"e14eam343"})((({theme:e,checked:t,circle:o=!0,size:n,focus:i=!1})=>[(0,Re.mp)({direction:e.direction,start:"0"}),{position:"absolute",top:0,borderRadius:o?"50%":"unset",border:"1px solid",borderColor:t?e.colors.Primary:e.colors.TextReverse3,marginInlineEnd:"8px",display:"inline-block",background:t?e.colors.Primary:e.colors.BGPrimary,transition:"all .1s",padding:"3px 0",textAlign:"center",boxSizing:"border-box",outline:i?`2px solid ${e.colors.Negative}`:"none"},Xc(n,o)]),"label:ICheckboxIcon;"),op=({id:e,value:t,checked:o,onChange:i,circle:a,size:s="big"})=>{const{colors:l}=(0,r.u)(),[d,c]=(0,A.useState)(!1),p=(0,A.useCallback)((e=>{i(e.target.checked,t)}),[i,t]),u=(0,A.useCallback)((()=>{c(!0)}),[]),g=(0,A.useCallback)((()=>{c(!1)}),[]);return(0,n.jsxs)(Yc,{size:s,children:[(0,n.jsx)(Qc,{type:"checkbox",value:t,id:e,onClick:p,onFocus:u,onBlur:g,"aria-labelledby":Or}),(0,n.jsx)(ep,{htmlFor:e,circle:a,size:s,children:(0,n.jsx)(tp,{checked:o,circle:a,size:s,focus:d,children:(0,n.jsx)(Hr.A,{fill:o?"#fff":l.BGPrimary,fontSize:"14px"})})})]})};var np,ip;!function(e){e.Terms="terms-of-service",e.Privacy="privacy-policy",e.Push="push-policy"}(np||(np={})),function(e){e.ToS="tiktok_terms_of_service",e.Privacy="tiktok_privacy_policy",e.Marketing="receive_notifications_of_marketing_content_and_promotions"}(ip||(ip={}));const ap=[{content:"updatedConsent_web_modal_radio2",link:"https://www.tiktok.com/legal/page/row/terms-of-service/ko",linkText:"updatedConsent_web_modal_radio2Link",value:"tiktok_terms_of_service"},{content:"updatedConsent_web_modal_radio3",link:"https://www.tiktok.com/legal/page/global/terms-and-conditions-kr/ko",linkText:"updatedConsent_web_modal_radio3Link",value:"tiktok_privacy_policy"},{content:"updatedConsent_web_modal_radio4",link:"https://www.tiktok.com/legal/page/global/consent-to-collection-and-use-of-your-personal-information-for-marketing-purposes",linkText:"updatedConsent_web_modal_radio4Link",value:"receive_notifications_of_marketing_content_and_promotions"}];function rp({consent:e,language:t,link:o}){return"receive_notifications_of_marketing_content_and_promotions"===e?"ko-KR"===t?`${o}/ko`:`${o}/en`:o}const sp=()=>{const e=fe(),{isMobile:t}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{language:o="en",region:i=""}=(0,Ve.L$)((0,Ze.W)((()=>["language","region"]),[])),[{fromNotRegisterLogin:a,thirdPlatformNotRegistered:r},{registerThirdPlatform:d,registerPhone:p,setKRMarketingConsent:u}]=(0,s.Su)(ko.H),g=(0,f.s)("WebApp_Login"),h=(0,l.Nj)(kc.W),[m,_]=(0,A.useState)([{item:"tiktok_terms_of_service",value:!1},{item:"tiktok_privacy_policy",value:!1},{item:"receive_notifications_of_marketing_content_and_promotions",value:!1}]),y=m.every((e=>!!e.value));(0,A.useEffect)((()=>{h.hanldeKRConsentShow()}),[]);const b=(0,A.useCallback)((()=>{const e=!y;h.hanldeKRConsentClick("total",e),u(e),_(m.map((t=>({item:t.item,value:e}))))}),[y,m,h,u]),x=(0,A.useCallback)(((e,t)=>{const o=Number(t),n=[...m],i=!n[o].value;h.hanldeKRConsentClick(`agree_to_${ap[o].value}`,i),n[o].value=i,"receive_notifications_of_marketing_content_and_promotions"===ap[o].value&&u(i),_(n)}),[m,u,h]),v=(0,A.useCallback)((()=>{h.hanldeKRConsentClickNext(y),"Third"===a&&r?d({ageCheckDone:!0,platform:r.platform,profileKey:r.profileKey,region:i}):"Phone"===a?p({ageCheckDone:!0,region:i}):e.push(j.tH.signupPhone)}),[a,e,p,d,r,i]),k=(0,A.useCallback)((e=>()=>{h.hanldeKRConsentClickSeeDetail("receive_notifications_of_marketing_content_and_promotions"===e?`agree_to_${e}`:e)}),[]),C=(0,A.useMemo)((()=>({width:t?"100%":"unset",marginTop:t?"0":"12px",marginLeft:"auto",marginRight:"auto"})),[t]),S=!!m.find((e=>"tiktok_privacy_policy"===e.item&&!1===e.value))||!!m.find((e=>"tiktok_terms_of_service"===e.item&&!1===e.value));return(0,n.jsxs)($c,{children:[(0,n.jsx)(zc,{"data-e2e":"policy-confirm-title",children:g("updatedConsent_web_modal_header")}),(0,n.jsxs)(Wc,{children:[(0,n.jsx)(op,{"data-e2e":"policy-confirm-box",circle:!0,checked:y,onChange:b,id:"signup-policy-all"}),(0,n.jsx)(Kc,{"data-e2e":"policy-confirm-item",children:g("updatedConsent_web_modal_radio1")})]}),ap.map((({content:e,link:t,linkText:i,value:a},r)=>(0,n.jsx)("div",{children:(0,n.jsxs)(Wc,{children:[(0,n.jsx)(op,{id:`signup-policy-${a}`,value:r.toString(),checked:m[r].value,onChange:x,circle:!0}),(0,n.jsxs)(Gc,{children:[(0,n.jsx)(Vc,{children:g(e)}),(0,n.jsxs)(Zc,{target:"_blank",rel:"noopener noreferrer",href:rp({consent:a,language:o,link:t}),onClick:k(a),children:[g(i),(0,n.jsx)(Nc.A,{})]})]})]})},r))),(0,n.jsx)(qc,{marginTop:"40px",backgroundColor:"unset",children:(0,n.jsx)(fr,{disabled:S,onClick:v,style:C,"data-e2e":"next-button",children:g("updatedConsent_web_modal_btn")})})]})};var lp=o(11983);const dp=["Month_1","Month_2","Month_3","Month_4","Month_5","Month_6","Month_7","Month_8","Month_9","Month_10","Month_11","Month_12"],cp=()=>dp.map(((e,t)=>({value:t+1,key:e}))),pp=(e=1)=>{let t=31;return 2===e?t=29:-1!==[4,6,9,11].indexOf(e)&&(t=30),Array(t).fill(0).map(((e,t)=>({value:t+1,key:`${t+1}`})))};var up=o(70142);const gp=(e,t)=>{if(null===t||-1===t||null===e.current)return;const o=34*t,n=34*(t+1),i=e.current.clientHeight,{scrollTop:a}=e.current;oi+a&&(e.current.scrollTop=n-i)};function hp(e=[],t,o=[]){return e.filter((e=>0===String(e.key).toLowerCase().indexOf(t.toLowerCase())&&o.indexOf(e)<0))}const mp=(0,Ie.default)("div",{target:"e1phcp2x0"})((({theme:e})=>({background:e.colors.BGInput,borderRadius:"4px",position:"relative","& + &":{marginInlineStart:"8px"},cursor:"pointer"})),"label:DivSelector;");mp.defaultProps=Object.assign(Object.assign({},mp.defaultProps),{"data-e2e":"select-container"});const _p=(0,Ie.default)("div",{target:"e1phcp2x1"})((({hasValue:e,theme:t,error:o})=>({width:"115px",height:"44px",padding:"0 12px",display:"flex",justifyContent:"space-between",alignItems:"center",color:o?t.colors.Negative:e?t.colors.TextPrimary:t.colors.TextQuaternary,fontSize:"16px"})),"label:DivSelectLabel;"),fp=(0,Ie.default)(rs.A,{target:"e1phcp2x2"})((({theme:e,up:t})=>({color:e.colors.TextPrimary,transform:t?"rotateZ(180deg)":"rotateZ(0deg)",transition:"all .3S"})),"label:StyledArrowTriangleDownLargeFill;"),yp=(0,Ie.default)(Hr.A,{target:"e1phcp2x3"})({width:"16px",height:"16px",marginInlineStart:"12px"},"label:StyledSelectIcon;"),bp=(0,Ie.default)("div",{target:"e1phcp2x4"})((({theme:e,show:t})=>[(0,Re.mp)({direction:e.direction,end:"0",start:"0"}),{width:"120px",maxHeight:"320px",overflow:"auto",position:"absolute",background:e.colors.BGPrimary,borderRadius:"4px",boxShadow:"0px 2px 12px rgba(0, 0, 0, 0.12)",top:"50px",zIndex:12,display:t?"block":"none",transition:"display .3s"}]),"label:DivOptionsWrapper;");bp.defaultProps=Object.assign(Object.assign({},bp.defaultProps),{"data-e2e":"select-list"});const xp=(0,Ie.default)("div",{target:"e1phcp2x5"})((({theme:e,selected:t})=>({height:"34px",overflow:"auto",fontSize:"16px",padding:"0 12px",cursor:"pointer",display:"flex",alignItems:"center",color:e.colors.TextPrimary,background:t?e.colors.BGView:"unset",":hover, :focus":{background:e.colors.BGView}})),"label:DivOption;"),vp=e=>{const t=(0,f.s)("WebApp_Login"),{placeholder:o,options:i,selectItem:a,onClick:r,error:s,ariaLabel:l}=e,{key:d,value:c}=null!=a?a:{},p=(0,A.useRef)(null),u=(0,A.useRef)(null),[g,h]=(0,A.useState)(!1),{setLoginModalShow:m}=(0,P.b1)(),{isModal:_}=St((()=>["isModal"]),[]),y=(0,A.useMemo)((()=>e=>e.value===c),[c]),b=(0,A.useMemo)((()=>i.findIndex(y)),[y,i]),x=(0,A.useCallback)((e=>{var t;g&&!(null===(t=null==p?void 0:p.current)||void 0===t?void 0:t.contains(e.target))&&h(!1)}),[g]);(0,A.useEffect)((()=>(window.addEventListener("mousedown",x),()=>{window.removeEventListener("mousedown",x)})),[x]);const v=i.concat().map((({value:e,key:o})=>({value:e,key:t(null!=o?o:"")}))),{keyboardHandler:k,visualFocusIndex:C}=(({panelOpen:e,options:t,initialFocusIndex:o=-1,setPanelShow:n,panelContainerRef:i,onSelect:a,onOpen:r=L(),onClose:s=L(),stopPropagation:l=!0,isModal:d=!1,setModalShow:c=L(),trapFocusWhenPanelOpen:p=!0})=>{const[u,g]=(0,A.useState)(o),h=(0,A.useRef)(),m=(0,A.useRef)(""),_=(0,A.useCallback)((_=>{l&&_.stopPropagation();const f=(0,up.t3)(_,e,p,d);switch(f){case 2:n(!0),o>-1&&g(o),null==r||r();break;case 3:e&&n(!1),null==s||s();break;case 13:c(!1),null==s||s();break;case 4:u>-1&&(a(t[u]),n(!1),null==s||s());break;case 11:_.preventDefault();break;case 1:case 0:case 8:case 7:case 5:case 6:{const e=function(e,t,o){switch(o){case 5:return 0;case 6:return t;case 1:return Math.max(0,e-1);case 0:return Math.min(t,e+1);case 8:return Math.max(0,e-10);case 7:return Math.min(t,e+10);default:return e}}(u,t.length-1,f);g(e),gp(i,e);break}case 10:try{"number"==typeof h.current&&window.clearTimeout(h.current),h.current=window.setTimeout((()=>{m.current=""}),500),m.current+=_.key;const e=function(e=[],t,o=0){const n=[...e.slice(o),...e.slice(0,o)],i=hp(n,t)[0];if(i)return e.indexOf(i);if((a=t.split("")).every((e=>e===a[0]))){const o=hp(n,t[0]);return e.indexOf(o[0])}return-1;var a}(t,m.current,u+1);e>-1?(g(e),gp(i,e)):(window.clearTimeout(h.current),m.current="")}catch(e){console.warn("[Role=select] Type Error: ",e)}break;default:return}}),[o,d,s,r,a,t,i,e,c,n,l,p,u]);return{keyboardHandler:_,visualFocusIndex:u,setVisualFocusIndex:g}})({panelOpen:g,options:v,initialFocusIndex:b,setPanelShow:h,panelContainerRef:u,onSelect:r,isModal:_,setModalShow:m}),S=(0,A.useCallback)((e=>()=>{r(e),h(!1)}),[r,h]),w=(0,A.useCallback)((()=>{h(!g)}),[g]);return(0,n.jsxs)(mp,{ref:p,tabIndex:0,role:"combobox",onKeyDown:k,"aria-label":l,"aria-expanded":g,"aria-haspopup":"listbox","aria-controls":g?`${o}-options-list-container`:"","aria-activedescendant":C>-1?`${o}-options-item-${C}`:void 0,children:[(0,n.jsxs)(_p,{onClick:w,hasValue:Boolean(d),error:s,children:[t(null!=d?d:o),(0,n.jsx)(fp,{up:g})]}),(0,n.jsx)(bp,{show:g,ref:u,role:"listbox",id:`${o}-options-list-container`,children:i.map(((e,i)=>{var a;return(0,n.jsxs)(xp,{id:`${o}-options-item-${i}`,selected:c===e.value||C===i,onClick:S(e),role:"option","aria-selected":c===e.value,children:[t(`${null!==(a=e.key)&&void 0!==a?a:e.value}`),c===e.value&&(0,n.jsx)(yp,{})]},i)}))})]})},kp=(0,Ie.default)("div",{target:"e18rms3f0"})({display:"flex",marginBottom:"4px"},"label:DivAgeSelector;"),Cp=(0,Ie.default)("div",{target:"e18rms3f1"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"16px",lineHeight:"22px",marginBottom:"4px"}]),"label:DivTitle;"),Sp=(0,Ie.default)("div",{target:"e18rms3f2"})((({theme:e,type:t})=>[(0,Re.zy)({theme:e,color:"error"===t?"Negative":"TextTertiary"}),{fontSize:"14px",lineHeight:"20px",marginBottom:"16px"}]),"label:DivDescription;"),wp=cp(),jp=(()=>{const e=new Date(1900,0,1,0,0,0),t=new Date((new Date).getFullYear()-1,11,31,0,0,0);return Array(t.getFullYear()-e.getFullYear()+1).fill(t.getFullYear()).map(((e,t)=>({value:e-t,key:""+(e-t)})))})(),Tp=(0,A.memo)((function(){const e=(0,l.Nj)(T.$F),[{ageErrorMsg:t,year:o,month:i,date:a},{setBirthday:r,setMonth:d,setYear:c,setDate:p}]=(0,s.Su)(Te.T),u=(0,f.s)("WebApp_Login");(0,A.useEffect)((()=>{i&&o&&a&&r({year:o.value,month:i.value,date:a.value})}),[o,i,a,r]),(0,A.useEffect)((()=>{e.ageGateShow()}),[]);const g=(0,A.useCallback)((e=>{d(e)}),[d]),h=(0,A.useCallback)((e=>{p(e)}),[p]),m=(0,A.useCallback)((e=>{c(e)}),[c]),_=t||"mus_age_gate_tips";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Cp,{children:u("common_registration_agegate_title")}),(0,n.jsxs)(kp,{children:[(0,n.jsx)(vp,{error:Boolean(t),placeholder:"Month",selectItem:i,options:wp,ariaLabel:u("accessibilityLabels_signup_form_placeholder_month"),onClick:g}),(0,n.jsx)(vp,{error:Boolean(t),placeholder:"Day",selectItem:a,options:pp(null==i?void 0:i.value),ariaLabel:u("accessibilityLabels_signup_form_placeholder_day"),onClick:h}),(0,n.jsx)(vp,{error:Boolean(t),placeholder:"Year",selectItem:o,options:jp,ariaLabel:u("accessibilityLabels_signup_form_placeholder_year"),onClick:m})]}),(0,n.jsx)(Sp,{type:t?"error":"default",children:u(_)})]})})),Pp=(0,Ie.default)("h2",{target:"e1lzrlvq0"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"32px",margin:"16px auto",fontWeight:"bold",textAlign:"center",wordWrap:"break-word"}]),"label:H2Title;"),Ep=(0,Ie.default)("div",{target:"e1lzrlvq1"})({width:"375px",margin:"auto"},"label:DivLoginContainer;"),Mp=(0,Ie.default)("div",{target:"e1lzrlvq2"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"15px",display:"flex",justifyContent:"space-between",marginBottom:"5px"}]),"label:DivDescription;");var Lp,Ap,Ip,Rp,Fp;!function(e){e[e.USInvalidAgeConfirmation=1]="USInvalidAgeConfirmation",e[e.USInvalidAgeConfirmationV2=2]="USInvalidAgeConfirmationV2",e[e.USSuccessConfirmationError=3]="USSuccessConfirmationError",e[e.USSuccessConfirmationAdult=4]="USSuccessConfirmationAdult",e[e.USSuccessConfirmationTeen=5]="USSuccessConfirmationTeen",e[e.USSuccessConfirmationMixAge=6]="USSuccessConfirmationMixAge",e[e.USSuccessConfirmationUnderage=7]="USSuccessConfirmationUnderage",e[e.USConfirmationSuccessV2=8]="USConfirmationSuccessV2"}(Lp||(Lp={})),function(e){e[e.DISMISS=1]="DISMISS",e[e.CONTINUE=2]="CONTINUE",e[e.NATIVE=3]="NATIVE",e[e.URL=4]="URL",e[e.EXIT=5]="EXIT"}(Ap||(Ap={})),function(e){e[e.VERTICAL=1]="VERTICAL",e[e.HORIZONTAL=2]="HORIZONTAL"}(Ip||(Ip={})),function(e){e[e.MINOR=0]="MINOR",e[e.MEDIUM=1]="MEDIUM",e[e.MAJOR=2]="MAJOR"}(Rp||(Rp={})),function(e){e[e.DEFAULT=0]="DEFAULT",e[e.POP=1]="POP",e[e.BUTTOM=2]="BUTTOM"}(Fp||(Fp={}));const Op=(0,Ie.default)("div",{target:"eo2b7p50"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",maxWidth:e.isMobile?"300px":"400px",paddingTop:e.isMobile?"0":"32px",textAlign:"center",overflow:"hidden"})),"label:DivContainer;"),Dp=(0,Ie.default)("div",{target:"eo2b7p51"})((({theme:e})=>({display:"flex",padding:e.isMobile?"0":"0 32px 32px 32px",gap:e.isMobile?"0":"8px",overflow:"hidden"})),"label:DivFooterContainer;"),Hp=(0,Ie.default)("div",{target:"eo2b7p52"})((({theme:e})=>({padding:e.isMobile?"20px":"0 32px"})),"label:DivBodyContainer;"),Up=(0,Ie.default)("h1",{target:"eo2b7p53"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"24px",lineHeight:"30px",padding:e.isMobile?"0 20px":"0 32px"}]),"label:H1ModalTitle;"),Np=(0,Ie.default)("p",{target:"eo2b7p54"})([({theme:e})=>(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),({theme:e})=>({fontSize:"16px",lineHeight:"20px",margin:e.isMobile?"0":"24px 0",textAlign:"center"})],"label:PDesc;"),Bp={borderWidth:"0.5px",borderRadius:"0",fontWeight:"normal",margin:"0"},$p={[Ap.CONTINUE]:"continue",[Ap.URL]:"url",[Ap.EXIT]:"exit",[Ap.DISMISS]:"dismiss",[Ap.NATIVE]:"native"},zp=e=>{const{isMobile:t,onContinue:o}=e,{setShowFeedbackModal:i}=(0,s.wA)(Te.T),{showFeedbackModal:a,feedbackModal:r={}}=(0,s.Ph)(Te.T),{modal:d={},business:c=""}=r,{title:p="",description:u="",options:g}=d,h=fe(),m=(0,l.Nj)(kc.W),_={style:"pop",business:c},f=(0,A.useCallback)(((e,t)=>()=>{switch(m.handleUniversalPopClick(Object.assign(Object.assign({},_),{button_info:e?$p[e]:""})),e){case Ap.CONTINUE:i(!1),null==o||o();break;case Ap.URL:window.open(t,"_blank");break;case Ap.EXIT:i(!1),h.push(j.tH.signupHome);break;case Ap.DISMISS:default:i(!1)}}),[o,h,i]),y=(0,A.useMemo)((()=>g&&0!==g.length?[...g].reverse().map((e=>(0,n.jsx)(fr,{buttonTheme:"default",style:t?Bp:{fontWeight:"500"},onClick:f(e.option_type,e.option_url),children:e.option_content},e.option_content))):(0,n.jsx)(n.Fragment,{})),[g,t,f]);return(0,A.useEffect)((()=>{a&&m.handleUniversalPopShow(_)}),[a]),(0,n.jsx)(S.aF,{visible:a,maskCloseable:!1,type:t?"mobile":"pc",children:(0,n.jsxs)(Op,{children:[p&&(0,n.jsx)(Up,{children:p}),(0,n.jsx)(Hp,{children:(0,n.jsx)(Np,{children:u})}),(0,n.jsx)(Dp,{children:y})]})})},Wp=()=>{const e=(0,f.s)("WebApp_Login"),{handleCheckAge:t,nextStep:o}=xc(),{signupLoading:i}=(0,s.Ph)(ko.H),{birthday:a,ageErrorMsg:r,showErrorByToast:l,checkAgeLoading:d}=(0,s.Ph)(Te.T);return(0,A.useEffect)((()=>{r&&l&&lp.F.open({content:e(r),duration:3})}),[r,e,l]),_t(),(0,n.jsxs)(Ep,{children:[(0,n.jsx)(Pp,{children:e("common_login_panel_entry_2")}),(0,n.jsx)(Tp,{}),(0,n.jsx)(zp,{isMobile:!1,onContinue:o}),(0,n.jsx)(fr,{disabled:!a,loading:i||d,onClick:t,"data-e2e":"next-button",children:e("common_registration_email_input_button")})]})},Gp=(0,Ie.default)("div",{target:"eopmsux0"})({marginBottom:"16px",position:"relative"},"label:DivUsernameContainer;"),Vp=(0,Ie.default)("div",{target:"eopmsux1"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,end:"12px"}),{position:"absolute",boxSizing:"border-box",paddingTop:"14.5px",width:"20px",height:"44px",top:0,div:{position:"absolute",width:"15px",height:"15px",margin:"2px",border:"2px solid rgba(22, 24, 35, .34)",borderRadius:"50%",animation:"lds-ring 1.2s cubic-bezier(.5, 0, .5, 1) infinite",borderColor:"rgba(22, 24, 35, .34) transparent transparent transparent",":nth-of-type(1)":{animationDelay:"-.45s"},":nth-of-type(2)":{animationDelay:"-.3s"},":nth-of-type(3)":{animationDelay:"-.15s"}},"@keyframes lds-ring":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}]),"label:DivNameCheckLoading;"),Kp=(0,Ie.default)("div",{target:"e1ulspo0"})((({theme:{colors:e,direction:t}})=>[{position:"relative",marginTop:"11px",borderRadius:"4px",border:"1px solid",background:e.BGPrimary,borderColor:e.LineSecondary,zIndex:2,width:"100%",":before":{content:'""',height:"14px",position:"absolute",background:e.BGPrimary,width:"14px",top:"-7px",left:"rtl"===t?"unset":"14px",right:"rtl"===t?"14px":"unset",zIndex:-1,borderInlineEnd:`1px solid ${e.LineSecondary2}`,borderTop:`1px solid ${e.LineSecondary2}`,transform:"rtl"===t?"rotateZ(45deg)":"rotateZ(-45deg)"}}]),"label:DivSuggestListWrapper;"),qp=(0,Ie.default)("div",{target:"e1ulspo1"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary"}),{fontSize:"13px",lineHeight:"17px",padding:"16px 12px 9px"}]),"label:DivLabel;"),Zp=(0,Ie.default)("ul",{target:"e1ulspo2"})({padding:"0",margin:"0",maxHeight:"200px",overflowY:"auto"},"label:UlList;"),Jp=(0,Ie.default)("li",{target:"e1ulspo3"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),{display:"flex",padding:"0 12px",justifyContent:"space-between",alignItems:"center",height:"34px",lineHeight:"34px",fontSize:"13px",cursor:"pointer"},{":hover":{backgroundColor:"rgba(22, 24, 35, .03)"}}]),"label:LiListItem;"),Yp=(0,A.memo)((function(){var e,t;const[{usernameInfo:o},{setUsername:i}]=(0,s.Su)(ko.H),a=(0,f.s)("WebApp_Login"),r=(0,A.useCallback)((e=>()=>{i(e)}),[i]);return(null==o?void 0:o.isValid)||!(null===(e=null==o?void 0:o.suggestList)||void 0===e?void 0:e.length)?null:(0,n.jsxs)(Kp,{children:[(0,n.jsx)(qp,{children:a("common_registration_email_input_suggested")}),(0,n.jsx)(Zp,{children:null===(t=null==o?void 0:o.suggestList)||void 0===t?void 0:t.map(((e,t)=>(0,n.jsx)(Jp,{onClick:r(`${e}`),children:e},t)))})]})})),Qp=(0,A.memo)((function({autoFocus:e,ftc:t,placeholder:o,tip:i}){var a,r;const[{usernameInfo:l,username:d,checkNameLoading:p},{validateUsername:u,validateFTCUsername:g,setUsername:h,setUsernameInfo:m}]=(0,s.Su)(ko.H),{isMobile:_}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),y=(0,f.s)("WebApp_Login"),b=(0,A.useCallback)((e=>{const t=e.target.value;h(t)}),[h]);(0,A.useEffect)((()=>{d?t?g({name:d}):u({name:d}):m(void 0)}),[t,m,d,g,u]);const x=_?"":"common_registration_username_text";return(0,n.jsxs)(Gp,{children:[(0,n.jsx)(dr,{autoFocus:e,placeholder:y(null!=o?o:"common_registration_username_placeholder"),onChange:b,errorState:l&&!l.isValid&&!p,autoComplete:"off",name:"new-username",value:d,disableDelete:p}),p&&(0,n.jsxs)(Vp,{children:[(0,n.jsx)("div",{}),(0,n.jsx)("div",{}),(0,n.jsx)("div",{}),(0,n.jsx)("div",{})]}),(0,n.jsx)(ur,{text:y(null!==(r=null!==(a=null==l?void 0:l.errorMsg)&&void 0!==a?a:i)&&void 0!==r?r:x),type:(null==l?void 0:l.errorMsg)?"error":"default"}),!_&&(0,n.jsx)(Yp,{})]})}));var Xp=o(35248),eu=o(28889);const tu=(0,Ie.default)("div",{target:"e1sbfgbz0"})((({theme:e,asText:t,isModal:o,isMobile:n,isGuestModeRedesign:i})=>({width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:e.colors.BGSecondary,padding:t?"unset":i?"0 28px 30px 28px":"16px 30px",marginBottom:t?"12px":o||n||i?"unset":"64px"})),"label:DivAgreement;");tu.defaultProps=Object.assign(Object.assign({},tu.defaultProps),{"data-e2e":"policy-confirm-tips"});const ou=(0,Ie.default)("p",{target:"e1sbfgbz1"})((({theme:e,asText:t})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary"}),{fontSize:"12px",lineHeight:"15px",width:"337px",textAlign:t?"unset":"center"},e.isMobile&&(0,Re.jJ)({min:Pt,style:{width:"unset",fontSize:"24px",lineHeight:"38px"}})]),"label:PText;"),nu=(0,Ie.default)("a",{target:"e1sbfgbz2"})((({theme:e})=>({color:e.colors.TextPrimary,"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${e.colors.Negative}`}})),"label:ALink;"),iu=(0,A.memo)((function({i18nKey:e,show:t,asText:o}){var i,a,r,l;const{language:d,abTestVersion:p}=(0,Ve.L$)((0,Ze.W)((()=>["language","abTestVersion"]),[])),{isMobile:u}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),[{region:g,initializedTTPConfig:h},{fetchStoreRegion:m}]=(0,s.Su)(ko.H),_=null!==(i=(0,Ye.qt)(p,"sign_up_webapp_region_change"))&&void 0!==i?i:"v1",b=null!==(a=(0,Ye.qt)(p,"login_modal_ui_revamp"))&&void 0!==a?a:"v1",x=(0,P.mZ)((e=>e.loginModalShow)),v=Co(),{showLoginOptionSlider:k}=(0,y.LK)(),C="v2"===_,S=(0,A.useCallback)((()=>{m()}),[m]);(0,A.useEffect)((()=>{h&&!g&&S()}),[h]);const w=u?[j.tH.signupHome,j.tH.loginHome,j.tH.tvLoginHome,j.tH.tvLoginEmail,j.tH.tvLoginPhone]:[j.tH.signupPhoneOrEmail,j.tH.signupPhone,j.tH.signupEmail,j.tH.signupHome,j.tH.signupInterestSelector,j.tH.loginHome,j.tH.loginGuestMode,j.tH.tvLoginHome,j.tH.tvLoginEmail,j.tH.tvLoginPhone],T="v1"===b?[]:[j.tH.signupCreateAccount,j.tH.signupCreatePassword,j.tH.signupCreateUsername,j.tH.signupAgeGate,j.tH.signupAgeGateConfirm,j.tH.loginForgetEmailPassword,j.tH.loginForgetPhonePassword,j.tH.signupCountrySelector],E=[j.tH.loginPhoneOrEmail,j.tH.loginPhone,j.tH.loginEmail,j.tH.loginPhonePassword],{pathname:M}=ye(),L=null!==(r=t&&!T.find((e=>e===M.replace(/\/$/,""))))&&void 0!==r?r:w.find((e=>e===M.replace(/\/$/,""))),I=k&&E.find((e=>e===M.replace(/\/$/,""))),R=null!==(l=null==g?void 0:g.countryCode.toUpperCase())&&void 0!==l?l:"",F=(0,Ft.$H)(M),O=!("HU"===R&&F)&&(L||I),D=(0,f.s)("WebApp_Login"),H=()=>(0,n.jsx)(n.Fragment,{children:(null==g?void 0:g.enabledRegionOption)?(0,n.jsx)(ru,{text:null==g?void 0:g.localizedCountryName}):null==g?void 0:g.localizedCountryName}),U=()=>(0,n.jsx)(su,{href:`https://www.tiktok.com/legal/terms-of-use?lang=${d}`,text:D("common_registration_terms_use"),policyType:"terms_of_service"}),N=()=>{const e="TR"===v&&"tr-TR"===d,t=e?"https://www.tiktok.com/legal/page/row/privacy-policy/tr#privacy-policy-addendum-for-tr":`https://www.tiktok.com/legal/privacy-policy?lang=${d}`,o=D(e?"signUpTR_panel_acknowledgement_placeholder3":"common_registration_privacy_policy");return(0,n.jsx)(su,{href:t,text:o,policyType:"privacy_policy"})};return O?(0,n.jsx)(tu,{asText:o,isModal:x,isMobile:u,isGuestModeRedesign:M===j.tH.loginGuestMode,children:(()=>{if("TR"===R){const e=D("turkeyUsersConsent_chooseInterests_popUp_description").split(/%\d*\$s/);return(0,n.jsxs)(ou,{asText:o,children:[e[0]," ",U(),e[1]," ",N(),e[2]]})}if("US"===R){const t=D(null!=e?e:"common_registration_email_input_agreement").split(/%\d*\$s/);return(0,n.jsxs)(ou,{asText:o,children:[t[0]," ",U(),t[1]," ",N(),t[2]]})}if(C&&(null==g?void 0:g.enabledRegionOption)){if("CO"===R){const e=D("regionOption_signUp_COdisclaimer_description").split(/%\d*\$s/);return(0,n.jsxs)(ou,{asText:o,children:[e[0]," ",H(),e[1]," ",U(),e[2]," ",N(),e[3]]})}if(Xp._v.includes(R)){const e=D("regionOption_signUp_disclaimer_description").split(/%\d*\$s/);return(0,n.jsxs)(ou,{asText:o,children:[e[0]," ",H(),e[1]," ",U(),e[2]," ",N(),e[3]," ",(0,n.jsx)(su,{href:`https://www.tiktok.com/legal/page/global/cookie-policy/${d}`,text:D("regionOption_signUp_disclaimer_placeholder"),policyType:"cookie_policy"}),e[4]]})}{const e=D("regionOption_signUp_nonEUdisclaimer_description").split(/%\d*\$s/);return(0,n.jsxs)(ou,{asText:o,children:[e[0]," ",H(),e[1]," ",U(),e[2]," ",N(),e[3]]})}}{const t=D(null!=e?e:"common_registration_email_input_agreement").split(/%\d*\$s/);return(0,n.jsxs)(ou,{asText:o,children:[t[0]," ",U(),t[1]," ",N(),t[2]]})}})()}):null})),au="sign_up_page";function ru({text:e}){(0,A.useEffect)((()=>{eu.X.handleAccountRegionEntranceShow(void 0,au)}),[]);const t=(0,A.useCallback)((()=>{eu.X.handleAccountRegionEntranceClick(au)}),[]);return(0,n.jsx)(jo,{path:j.tH.signupCountrySelector,underline:!1,text:e,onClick:t})}function su({href:e,text:t,policyType:o}){(0,A.useEffect)((()=>{var e;e={enter_from:au,policy_type:o},tt.f.sendEvent("policy_link_show",e)}),[]);const i=(0,A.useCallback)((()=>{var e;e={enter_from:au,policy_type:o},tt.f.sendEvent("policy_link_clicked",e)}),[o]);return(0,n.jsx)(nu,{target:"_blank",rel:"noopener noreferrer",href:e,onClick:i,children:t})}const lu=()=>{const e=(0,f.s)("WebApp_Login"),[{usernameInfo:t,errorMsg:o,signupLoading:i},{usernameRegister:a}]=(0,s.Su)(ko.H),{registerLimited:r}=(0,s.Ph)(Te.T);vc();const{password:l,lengthValid:d,contentValid:c}=(0,s.Ph)(Na),p=Co(),u=(0,A.useCallback)((()=>{a({password:l,region:p})}),[l,a,p]),g=!1===(null==t?void 0:t.isValid)||!l||!c||!d;return _t(),(0,n.jsxs)(Qa,{onSubmit:u,children:[(0,n.jsx)(Pp,{children:e("common_login_panel_entry_2")}),(0,n.jsx)(Mp,{children:e("common_login_sms_popup_option_1")}),(0,n.jsx)(Qp,{autoFocus:!0,placeholder:e("common_registration_username_placeholder"),tip:"mus_create_account_desc_pc",ftc:!0}),(0,n.jsx)(mr,{loginError:Boolean(o)}),r&&(0,n.jsx)(iu,{show:!0}),(0,n.jsx)(ur,{text:e(null!=o?o:""),type:"error"}),(0,n.jsx)(fr,{disabled:g,loading:i,children:e("common_notification_unlogged_button")})]})},du=(0,Ie.default)("div",{target:"e6sea5o0"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:e.isMobile?"normal":"bold"}),{height:e.isMobile?"16px":"44px",lineHeight:e.isMobile?"16px":"44px",textAlign:"center",fontSize:"16px",marginTop:e.isMobile?"unset":"10px",width:"100%",cursor:"pointer"}]),"label:DivTextContainer;"),cu=(0,A.memo)((function(){var e;const t=(0,f.s)("WebApp_Login"),{setLoginSuccess:o}=(0,s.wA)(Ae.$),{isMobile:i}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),a=fe(),r=(null===(e=be(j.tH.signupCreatePassword))||void 0===e?void 0:e.isExact)&&i,l=(0,A.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),r?a.push(j.tH.signupCreateUsername):o()}),[a,r,o]),d=(0,A.useCallback)((e=>{13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),o())}),[o]);return(0,n.jsx)(du,{onClick:l,onKeyDown:d,tabIndex:0,children:t("common_registration_username_skip")})})),pu=()=>{const e=(0,f.s)("WebApp_Login"),{usernameInfo:t,username:o}=(0,s.Ph)(ko.H),[{loginLoading:i},{setAccount:a}]=(0,s.Su)(Ae.$),{password:r,lengthValid:l,contentValid:d}=(0,s.Ph)(Na),c=(0,A.useCallback)((()=>{a({password:r,username:o})}),[a,r,o]),p=!((null==t?void 0:t.isValid)&&r&&d&&l);return _t(),(0,n.jsxs)(Qa,{onSubmit:c,children:[(0,n.jsx)(Pp,{children:e("common_login_panel_entry_2")}),(0,n.jsx)(Mp,{children:e("common_registration_password_title")}),(0,n.jsx)(mr,{autoFocus:!0}),(0,n.jsx)(Mp,{children:e("common_registration_username_title")}),(0,n.jsx)(Qp,{}),(0,n.jsx)(fr,{disabled:p,loading:i,children:e("common_notification_unlogged_button")}),(0,n.jsx)(cu,{})]})},uu=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),{usernameInfo:t,username:o}=(0,s.Ph)(ko.H),[{loginLoading:i},{setAccount:a}]=(0,s.Su)(Ae.$),r=(0,A.useCallback)((()=>{a({username:o})}),[a,o]),l=!(null==t?void 0:t.isValid);return _t(),(0,n.jsxs)(Qa,{onSubmit:r,children:[(0,n.jsx)(Pp,{children:e("common_login_panel_entry_2")}),(0,n.jsx)(Mp,{children:e("common_registration_username_title")}),(0,n.jsx)(Qp,{}),(0,n.jsx)(fr,{disabled:l,loading:i,children:e("common_notification_unlogged_button")}),(0,n.jsx)(cu,{})]})}));var gu=o(86553),hu=o(80596);const mu=(0,Ie.default)("div",{target:"e19c4o080"})({marginBottom:"16px",display:"flex"},"label:DivContainer;"),_u=(0,Ie.default)("label",{target:"e19c4o081"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),{fontSize:"12px",lineHeight:"16px",display:"inline"}]),"label:LabelCheckboxText;");_u.defaultProps=Object.assign(Object.assign({},_u.defaultProps),{"data-e2e":"collect-email-conconsent-text"});const fu=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),{emailConsent:t}=St((()=>["emailConsent"]),[]),o=Co(),{isMobile:i}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),[{emailConsent:a},{setEmailConsent:r}]=(0,s.Su)(ko.H),l=(0,A.useCallback)((e=>{hu.H.clickEmailConsent({checked:e}),r(e)}),[r]);return(0,A.useEffect)((()=>{t&&(hu.H.showEmailConsent(),["MY","PK","BD"].includes(o)&&r(!0))}),[o,t,r]),t?(0,n.jsxs)(mu,{children:[(0,n.jsx)(op,{"data-e2e":"collect-email-conconsent-box",size:i?"small":"big",checked:Boolean(a),onChange:l,id:"email-consent",circle:i}),(0,n.jsx)(_u,{htmlFor:"email-consent",id:Or,children:e("EDM_onboarding_email_consent_checkbox_list")})]}):null})),yu=(0,Ie.default)("p",{target:"esdrtey0"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary"}),{fontSize:"12px",lineHeight:"15px",marginBottom:"8px",marginTop:"-4px",display:"flex"}]),"label:PRegister;"),bu=(0,Ie.default)("span",{target:"esdrtey1"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"Primary"}),{display:"flex",alignItems:"center"}]),"label:SpanLink;"),xu=()=>{const e=(0,f.s)("WebApp_Login"),{ageGateAction:t,birthday:o}=(0,s.Ph)(Te.T),[{errorMsg:i,signupLoading:a},{emailRegister:r}]=(0,s.Su)(ko.H),{emailErrorMsg:l,email:d=""}=(0,s.Ph)(Ha.N),[{sendCodeLoading:c,code:p,codeFormatError:u,emailRegistered:g},{sendEmailCodeForSignup:h}]=(0,s.Su)(Wa.m),{password:m,lengthValid:_,contentValid:y}=(0,s.Ph)(Na),b=Co(),x=(0,A.useCallback)((()=>{h({email:d,region:b})}),[d,h,b]),v=(0,A.useCallback)((()=>{r({password:m,code:p,email:d,region:b})}),[d,p,r,m,b]),k=!d||!m||!p||!y||!_||Boolean(u)||Boolean(l)||Boolean(!o&&t);return _t(),(0,n.jsxs)(Qa,{onSubmit:v,children:[(0,n.jsx)(Pp,{children:e("common_login_panel_entry_2")}),Boolean(t)&&(0,n.jsx)(Tp,{}),Boolean(t)&&(0,n.jsx)(zp,{isMobile:!1}),(0,n.jsxs)(Mp,{children:[e("email")," ",(0,n.jsx)(bl,{text:e("common_registration_switch_phone"),path:j.tH.signupPhone,replace:!0})]}),(0,n.jsx)(Ad,{emailRegistered:g}),g&&(0,n.jsxs)(yu,{children:[e("common_registration_email_existing_title"),",",(0,n.jsx)(jo,{path:j.tH.loginWithSignedEmail,underline:!1,children:(0,n.jsxs)(bu,{children:[e("log_in"),(0,n.jsx)(gu.A,{})]})})]}),(0,n.jsx)(mr,{}),(0,n.jsx)(al,{email:!0,disabled:Boolean(l||!d||!o&&t),codeFromNumber:d,loading:c,errorMsg:i,onClickSendCode:x}),(0,n.jsx)(fu,{}),(0,n.jsx)(fr,{loading:a,disabled:k,children:e("common_registration_email_input_button")})]})},vu=()=>{const e=(0,f.s)("WebApp_Login"),[{birthday:t,ageGateAction:o}]=(0,s.Su)(Te.T),[{sendCodeLoading:i,code:a,codeFormatError:r},{sendPhoneCodeForLogin:l}]=(0,s.Su)(Wa.m),[{loginLoading:d},{handleSmsLogin:c}]=(0,s.Su)(Ae.$),p=fn(),u=Co(),[g]=(0,s.Su)(za.U),{mobile:h,phoneErrorMsg:m,phone:_}=g,y=h&&a&&!m&&!r&&(t||!o),b=Ja(),x=(0,A.useCallback)((()=>{p({platform:"sms_verification",signUp:!0}),c({birthday:t,phoneCode:a,mobile:h,login_only:!1,region:u})}),[t,c,p,h,a,u]),v=(0,A.useCallback)((()=>{l({mobile:h,isSignUp:!0,region:u})}),[h,l,u]);return _t(),(0,n.jsxs)(Qa,{onSubmit:x,children:[(0,n.jsx)(Pp,{children:e("common_login_panel_entry_2")}),Boolean(o)&&(0,n.jsx)(Tp,{platform:"sms_verification"}),Boolean(o)&&(0,n.jsx)(zp,{isMobile:!1}),(0,n.jsxs)(Mp,{children:[e("phone")," ",(0,n.jsx)(bl,{text:e("common_registration_switch_email"),path:j.tH.signupEmail,replace:!0})]}),(0,n.jsx)(hs,{}),(0,n.jsx)(al,{disabled:Boolean(m||!_||!t&&o),codeFromNumber:h,loading:i,errorMsg:b,onClickSendCode:v}),(0,n.jsx)(fr,{loading:d,disabled:!y,children:e("common_registration_email_input_button")})]})};var ku=o(26290),Cu=o(60163),Su=o(31209),wu=o(43723),ju=o(56070),Tu=o(26325),Pu=o(80241);const Eu=(0,wu.p)("interestSelectorAtom@tiktok/webapp-atoms",{isInterestSelected:{},selectedCount:0}),{useAtomService:Mu,useServiceState:Lu,useServiceDispatchers:Au}=(0,Su.i)(Eu,((e,t)=>({setItemSelected(e){t(Eu,(t=>({isInterestSelected:Object.assign(Object.assign({},t.isInterestSelected),{[e]:!0}),selectedCount:t.selectedCount+1})))},setItemDeselected(e){t(Eu,(t=>({isInterestSelected:Object.assign(Object.assign({},t.isInterestSelected),{[e]:!1}),selectedCount:t.selectedCount-1})))},submitInterests(){return t=this,o=void 0,i=function*(){try{const t=e(Eu).isInterestSelected,o=Object.entries(t).filter((([,e])=>e)).map((([e])=>e));Pu.o.handleInterestSubmit({},o);const{status_code:n,status_msg:i}=yield function(e){var t,o,n,i,a;return o=this,n=void 0,a=function*(){return ju.h.post("/api/fyp/interest",{signal:(new AbortController).signal,query:{category_type:null===(t=e.category_type)||void 0===t?void 0:t.join(","),fromWeb:1},baseUrlType:2,headers:{[Tu.nk]:ju.h.csrfToken}})},new((i=void 0)||(i=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(r,s)}l((a=a.apply(o,n||[])).next())}))}({category_type:o});if(0!==n)throw new Error(i)}catch(e){console.warn(e)}},new((n=void 0)||(n=Promise))((function(e,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(t){var o;t.done?e(t.value):(o=t.value,o instanceof n?o:new n((function(e){e(o)}))).then(r,s)}l((i=i.apply(t,o||[])).next())}));var t,o,n,i}}))),Iu="2.5rem",Ru=(0,Ie.default)("div",{target:"e1mzwt2j0"})({width:"20rem",maxHeight:`calc(5 * (${Iu} + 1rem))`,gap:"1rem",display:"flex",justifyContent:"center",alignItems:"center",overflowY:"clip",flexWrap:"wrap",paddingTop:"0.5rem"},"label:DivInterestPanelContainer;"),Fu=(0,Ie.default)(qd.I05,{target:"e1mzwt2j1"})((({theme:{colors:e},isItemSelected:t})=>({height:Iu,"& > div":{"& > .TUXButton-label":{}},"&.TUXButton.TUXButton":{borderWidth:"1px",borderStyle:"solid",boxShadow:`0px 2px 8px 0px ${e.ShadowSecondary}`,borderColor:t?qd.Tj4.UIText1:qd.Tj4.UIShapeNeutral4,transition:"border-color 0.3s ease-in-out",":not(:hover)":{backgroundColor:qd.Tj4.UIPageFlat3}}})),"label:StyledTUXInterestItem;"),Ou=(0,Ie.default)("div",{target:"e1mzwt2j2"})({fontSize:"24px",display:"flex",alignItems:"center","&.icon-enter":{opacity:0,transition:"opacity 0.15s ease-in"},"&.icon-enter-active":{opacity:1},"&.icon-exit":{opacity:1},"&.icon-exit-active":{opacity:0,transition:"opacity 0.15s ease-out"}},"label:DivIconContainer;"),Du=(0,A.memo)((function({interest:e}){const[t,{setItemSelected:o,setItemDeselected:i}]=Mu((t=>t.isInterestSelected[e.id]),F.bN),a=(0,f.s)("Webapp"),[r,s]=(0,A.useState)(!1),[l,d]=(0,A.useState)(!0),c=(0,A.useCallback)((e=>{e?d(!1):s(!1)}),[]),p=(0,A.useCallback)((e=>{e?d(!0):s(!0)}),[]),u=(0,A.useCallback)((()=>(0,n.jsx)(Cu.A,{children:(0,n.jsx)(Rl.A,{timeout:150,classNames:"icon",mountOnEnter:!0,unmountOnExit:!0,onEnter:()=>c(t),onExited:()=>p(t),children:(0,n.jsxs)(Ou,{children:[r&&(0,n.jsx)(qd.IuZ,{size:"14"}),l&&(0,n.jsx)(qd.mPD,{size:"14",color:"UIText3"})]})},t?"check":"plus")})),[c,p,t,r,l]);return(0,n.jsx)(Fu,{size:"medium",shape:"capsule",variant:"secondary",label:a(e.text_key,{},e.text),trailingIcon:u(),onClick:()=>t?i(e.id):o(e.id),isItemSelected:t})})),Hu=(0,A.memo)((function({interestList:e}){return(0,n.jsx)(Ru,{children:e.map((e=>(0,n.jsx)(Du,{interest:e},e.id)))})})),Uu=(0,Ie.default)("div",{target:"erjdrsu0"})({width:"100%",gap:"1.5rem",padding:"1.5rem",display:"flex"},"label:DivInterestSelectorButtonWrapper;");const Nu=(0,A.memo)((function({onClose:e,onSkip:t,showContinueButton:o}){const[{selectedCount:i},{submitInterests:a}]=Mu((e=>({selectedCount:e.selectedCount})),F.bN),r=(0,f.s)("Webapp"),[s,l]=(0,A.useState)(!1),d=(0,A.useCallback)((()=>{return t=this,o=void 0,i=function*(){l(!0),yield a(),e()},new((n=void 0)||(n=Promise))((function(e,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(t){var o;t.done?e(t.value):(o=t.value,o instanceof n?o:new n((function(e){e(o)}))).then(r,s)}l((i=i.apply(t,o||[])).next())}));var t,o,n,i}),[e,a]),c=(0,A.useCallback)((()=>{Pu.o.handleSelectorSkip({}),t()}),[t]);return o?(0,n.jsx)(Uu,{children:(0,n.jsx)(qd.I05,{label:r("bricFriction_popUp_noPhone_cont"),onClick:i>0?d:c,loading:s,style:{width:"100%"}})}):(0,n.jsxs)(Uu,{children:[(0,n.jsx)(qd.I05,{label:r("pcWeb_chooseInterest_skip_btn"),variant:"secondary",onClick:c,style:{width:"50%"}}),(0,n.jsx)(qd.I05,{label:r("pcWeb_chooseInterest_done_btn"),onClick:d,disabled:0===i,loading:s,style:{width:"50%"}})]})})),Bu=(0,Ie.default)("div",{target:"e4k2dvg0"})({paddingLeft:"1.5rem",paddingRight:"1.5rem"},"label:DivInterestSelectorContainer;"),$u=(0,Ie.default)("div",{target:"e4k2dvg1"})({display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"2rem"},"label:DivTitleContainer;"),zu=(0,Ie.default)("div",{target:"e4k2dvg2"})({display:"flex",alignItems:"center",justifyContent:"center",height:"17.5rem"},"label:DivInterestPanelContainer;"),Wu=(0,Ie.default)("div",{target:"e4k2dvg3"})({paddingLeft:"0.75rem",paddingRight:"0.75rem"},"label:DivInterestButtonContainer;"),Gu=(0,A.memo)((function(){var e,t,o,i;const a=(0,f.s)("Webapp"),{showContinueButton:r}=(0,y.aO)(),d=(0,s.wA)(_),[{closeCallback:p},{setLoginModalShow:u,setCloseCallback:g,setGroupId:h,setIsLoginOnLoadClosed:m}]=(0,P.MR)((e=>({loginModalShow:e.loginModalShow,closeCallback:e.closeCallback,isGuestMode:e.isGuestMode,isGuestModeUI:e.isGuestModeUI})),F.bN),b=(0,l.Nj)(T.$F),x=(0,Ve.L$)((0,c.U)((()=>["vgeo","interestList","claConfig"]),[])),{vgeo:v}=x;let C=[];try{C=null!==(o=null===(t=JSON.parse(null!==(e=x.interestList)&&void 0!==e?e:JSON.stringify({interest_list:[]})))||void 0===t?void 0:t.interest_list)&&void 0!==o?o:[]}catch(e){console.error("Error parsing interest list...",e)}const S=parseInt(null!==(i=localStorage.getItem("ppe-max-interest-count"))&&void 0!==i?i:"10"),w=(0,Qe.eu)(),j=(0,A.useCallback)((()=>{u(!1),localStorage.setItem("guest-mode-flag","1"),localStorage.setItem("timeOfLastPopup",Date.now().toString());const e=(0,et.uh)(v,!1);b.updateTeaDataCollectionEnabled(e),b.loginNotifyClose({isSignUp:"1",e2eInfo:k.nf.getTrackingInfo()}),d.setLoginModalInitialState(),p(),g(L()),h(void 0),m({isLoginOnLoadClosed:!0})}),[u,b,d,p,g,h,m,w]);return(0,n.jsxs)(Bu,{children:[(0,n.jsx)($u,{children:(0,n.jsx)(ku.F.H1,{weight:"bold",children:a("pcWeb_chooseInterest_header")})}),(0,n.jsx)(zu,{children:(0,n.jsx)(Hu,{interestList:null==C?void 0:C.slice(0,S)})}),(0,n.jsx)(Wu,{children:(0,n.jsx)(Nu,{onClose:j,onSkip:j,showContinueButton:r})})]})})),Vu=(0,A.memo)((()=>{const{initial:e}=(0,s.Ph)(Te.T),t=(0,P.mZ)((e=>e.groupId));ed(t),(0,Ge.rF)({pid:"signup"}),bc(),function(){const{isMobile:e}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{showAgeConfirm:t}=(0,s.Ph)(Te.T),o=fe();(0,A.useEffect)((()=>{t&&!e&&o.push(j.tH.signupAgeGateConfirm)}),[o,t,e])}();const{handlePopupHide:o,handlePopupShow:i}=(0,ec.H)(),a=fe(),{pathname:r}=ye(),l=(0,A.useCallback)((e=>{27!==e.keyCode&&e.stopPropagation()}),[]),d=Co(),{isModal:p}=(0,s.Ph)(kt.t),[u,g]=(0,A.useState)(!1);return"KR"!==d||p||u||(g(!0),a.push(j.tH.signupPolicyConfirm)),e||r===j.tH.signupHome?(0,n.jsxs)(go,{onKeyDown:l,isCountrySelector:r===j.tH.signupCountrySelector,isInterestSelector:r===j.tH.signupInterestSelector,children:[(0,n.jsx)(id,{page:"signup"}),(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.signupHome,component:wa,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupPhoneOrEmail,component:vu,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupPhone,component:vu,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupEmail,component:xu,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupCreatePassword,component:pu,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupCreateUsername,component:uu,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupCreateAccount,component:lu,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupAgeGate,component:Wp,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupAgeGateConfirm,component:Uc,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupPolicyConfirm,component:sp,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupCountrySelector,component:yc,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupInterestSelector,component:Gu,exact:!0}),(0,n.jsx)(Ce,{path:"*",component:wa})]}),(0,n.jsx)(Ic,{isMobile:!1}),!p&&(0,n.jsx)(tc.H,{hideByDefault:!0,onShow:i,onHide:o})]}):(0,n.jsx)(Ee.R,{center:!0,style:{margin:"auto"}})})),Ku=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ce,{path:j.tH.loginHome,component:Xd}),(0,n.jsx)(Ce,{path:j.tH.signupHome,component:Vu}),(0,n.jsx)(Be,{}),(0,n.jsx)(We,{})]});var qu=o(63619),Zu=o(48632),Ju=o(31578);const Yu=(0,Ie.default)("div",{target:"e1pdjumk0"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,start:"0"}),{background:e.colors.BGPrimary,borderRadius:"8px 8px 0 0",width:"100%",padding:"16px",textAlign:"center"}]),"label:DivContainer;"),Qu=(0,Ie.default)("div",{target:"e1pdjumk1"})((({fill:e})=>({height:"64px",width:"64px",borderRadius:"50%",position:"relative",background:"rgba(22, 24, 35, .03)",display:"inline-block","&::before, &::after":{width:"5px",height:"23px",display:"block",content:'""',background:null!=e?e:"#fe3824",position:"absolute",left:"50%",transform:"translate(-50%, 16px)"},"&::after":{height:"5px",transform:"translate(-50%, 43px)"}})),"label:DivIcon;"),Xu=(0,Ie.default)("i",{target:"e1pdjumk2"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,end:"16px"}),{position:"absolute",top:"16px",cursor:"pointer"}]),"label:IClose;"),eg=(0,Ie.default)("p",{target:"e1pdjumk3"})([({theme:e})=>(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{lineHeight:"20px",fontSize:"17px",margin:"24px 0",textAlign:"center"}],"label:PDesc;"),tg={US:{1357:"login_deactivated_popup_website_text_US"},1357:"login_deactivated_popup_website_text_nonUS",1384:"ban_age_gate_removed_pc_text"},og={1357:"login_deactivated_popup_webapp_text",1384:"ban_age_gate_removed_mobile_text"},ng=(0,A.memo)((()=>{const e=(0,f.s)("WebApp_Login"),[{showRiskModal:t,errorCode:o,showInstagramRisk:i=!1},r]=(0,s.Su)(Ta.S),{region:l,appType:d}=(0,Ve.L$)((0,Ze.W)((()=>["region","appType"]),[])),{isMobile:p}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),u=((e,t,o)=>{var n,i;if(o)return t?og[o]:null!==(i=null===(n=tg[e])||void 0===n?void 0:n[o])&&void 0!==i?i:tg[o]})(l,p,o)||(i?"login_new_ins_mobile_body":"login_risk_popup_body"),g=(0,A.useCallback)((()=>{r.setShowRiskModal(!1),r.setShowInstagramCantLoginModal(!1)}),[r]),h=(0,A.useCallback)((()=>{const e=(({pid:e,downloadLink:t="",appType:o,pageName:n,enterMethod:i,samsung:a=!1,wid:r,utmCampaign:s,activationAd:l,region:d,config:c,modalType:p,extraOnelinkParams:u})=>{const{samsungEnableRegion:g}=(0,Ve.L$)(c),{region:h=[],isFull:m}=(0,Ve.L$)(g),_=a||navigator.userAgent.indexOf("SamsungBrowser")>-1&&(m||h.includes(d)),f="1"===(0,C.Hd)("is_from_samsung_quick_access");t||(t=_?"https://snssdk1233.onelink.me/bIdt":"t"===o?"https://www.tiktok.com/download-link/ol/BAuo":"https://www.tiktok.com/download-link/ol/bIdt");const y=(0,C.Hd)("webapp_launch_mode"),b=(0,C.Hd)("webapp_original_traffic_type");let x="tiktokwebother";e?x=e:"paid"===y?x="tiktokwebsem":("referral_amp"===y||"organic"===y)&&(x="tiktokwebseo");const v=(0,Ju.qu)(navigator.userAgent)||(0,Ju.KJ)(navigator.userAgent)?"mobile":"pc",k=n,S=null!=l?l:`${i?`enter_method:${i};`:""}${p?`modal_type:${p};`:""}`,w={jump_time:Date.now(),af_adset:y,pid:x,af_siteid:v,c:k,af_ad:S,web_id:r,wid:r,af_ad_id:b};"paid"===y&&(w.is_retargeting=!0,w.af_click_lookback="1d");const j=(0,C.Hd)("utm_source"),T=(0,C.Hd)("utm_medium"),P=(0,C.Hd)("utm_campaign"),E=(0,C.Hd)("utm_term"),M=(0,C.Hd)("utm_content"),L=s?`${s},${P}`:P,A=(0,C.Hd)("referer_url"),I=(0,C.Hd)("referer_video_id"),R=`${j?`source:${j};`:""}${T?`medium:${T};`:""}${L?`campaign:${L};`:""}${E?`term:${E};`:""}${M?`content:${M};`:""}`,F=`${A?`referer_url:${A}};`:""}${I?`referer_video_id:${I};`:""}`;if(R&&(w.af_adset_id=R),F&&(w.af_channel=F),_&&f&&(w.pid="samsungbrowser",w.c=`samsungbrowser_${null==d?void 0:d.toLowerCase()}`,w.af_click_lookback="1d",w.af_android_url="https://apps.samsung.com/appquery/appDetail.as?appId=com.zhiliaoapp.musically",w.af_dp="snssdk1233://"),"undefined"!=typeof window){w.canonical=encodeURIComponent(`${td.C}${decodeURIComponent(location.pathname)}`);const e=rt.parse(location.search);e.embed_source&&(w.embed_source=e.embed_source)}return u&&Object.assign(w,u),`${t}?${rt.stringify(w)}`})({appType:d,enterMethod:"login_anti_spam",pageName:tt.f.commonParams.page_name});(e=>{const t=navigator.userAgent&&-1!==navigator.userAgent.indexOf("CriOS")?"_self":"_blank",o=window.open(e,t);o&&(o.opener=null)})(e)}),[d]);return(0,n.jsx)(Hl,{visible:t||i,maskCloseable:!1,children:(0,n.jsxs)(Yu,{"data-e2e":"instagram-modal",children:[(0,n.jsx)(Qu,{}),(0,n.jsx)(Xu,{onClick:g,"data-e2e":"instagram-modal-close",children:(0,n.jsx)(a.A,{})}),(0,n.jsx)(eg,{"data-e2e":"instagram-modal-desc",children:e(u)}),(0,n.jsx)(fr,{onClick:h,"data-e2e":"instagram-modal-button",children:e("login_risk_popup_button")})]})})})),ig=()=>{const[{phoneNotRegistered:e=!1},{setPhoneNotRegistered:t}]=(0,s.Su)(Ae.$),{registerPhone:o}=(0,s.wA)(ko.H),i=fe(),a=Co(),r=(0,A.useCallback)((()=>{t(!1),o({region:a})}),[t,o,a]),l=(0,A.useCallback)((()=>{t(!1),i.goBack()}),[t,i]),d=(0,A.useMemo)((()=>[{text:"common_login_sms_popup_option_1",onClick:r},{text:"common_login_sms_popup_option_2",onClick:l}]),[l,r]);return(0,n.jsx)(wl,{visible:e,title:"common_login_sms_popup_text",actions:d})},ag=(0,Ie.default)("div",{target:"e7p76pd0"})({padding:"0 32px",flex:"1",minHeight:"550x"},"label:DivMobileBody;"),rg=e=>{const{children:t,onSubmit:o}=e,i=(0,u.__rest)(e,["children","onSubmit"]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Gt,Object.assign({},i)),(0,n.jsx)(ag,{children:o?(0,n.jsx)(Qa,{onSubmit:e.onSubmit,children:t}):t})]})},sg=()=>{var e;const t=(0,f.s)("WebApp_Login"),o=fn(),{birthday:i}=(0,s.Ph)(Te.T),{mobile:a}=(0,s.Ph)(za.U),[{code:r},{sendPhoneCodeForLogin:l,sendPhoneCodeForVerify:d}]=(0,s.Su)(Wa.m),[{loginLoading:c},{handleSmsLogin:p,handleSmsVerify:u}]=(0,s.Su)(Ae.$),{isSecurityVerification:g}=St((()=>["isSecurityVerification"]),[]),h=null===(e=be(j.tH.signupPhoneDigit))||void 0===e?void 0:e.isExact,m=Ja(),_=Co(),y=(0,A.useCallback)((()=>{g?d({mobile:a}):l({mobile:a,region:_})}),[g,a,_,l,d]),b=(0,A.useCallback)((()=>{o({platform:"sms_verification",signUp:h});const e={birthday:h?i:void 0,mobile:a,phoneCode:r,login_only:!h};g?u(e):p(e)}),[o,h,i,a,r,g,u,p]);return _t(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_l,{codeFromNumber:a,onClickSendCode:y,onSubmit:b,loading:c,errorMsg:m}),!h&&(0,n.jsx)(bl,{text:t("login_option_password"),path:j.tH.loginPhonePassword})]})},lg=(0,Ie.default)("div",{target:"e1ntpldy0"})((({theme:e})=>({height:"40px",borderBottom:`1px solid ${e.colors.LinePrimary2}`,display:"flex",padding:"0 16px",boxSizing:"border-box",width:"100%",marginInlineStart:"50%",transform:"rtl"===e.direction?"translateX(50%)":"translateX(-50%)",marginBottom:"40px"})),"label:DivTabWrapper;"),dg=(0,Ie.default)("div",{target:"e1ntpldy1"})((({theme:e,selected:t})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold",color:t?"TextPrimary":"TextQuaternary"}),{textAlign:"center",lineHeight:"40px",transition:"all .1s",flex:1,margin:"0 10px",borderBottom:"2px solid",borderBottomColor:t?e.colors.TextPrimary:"transparent",whiteSpace:"nowrap"}]),"label:DivTab;"),cg=(0,A.memo)((function(e){const{tabs:t,currentTab:o}=e;return(0,n.jsx)(lg,{children:t.map((({text:i,e2e:a},r)=>(0,n.jsx)(dg,{onClick:e.onSwitchTab(r),selected:t[o].text===i,"data-e2e":a,children:i},r)))})})),pg=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),{phone:t,mobile:o}=(0,s.Ph)(za.U),[{sendCodeLoading:i},{sendPhoneCodeForLogin:a,sendPhoneCodeForVerify:r}]=(0,s.Su)(Wa.m),{isSecurityVerification:l}=St((()=>["isSecurityVerification"]),[]),d=be(j.tH.signupPhoneOrEmail),c=Hd(j.tH.loginEmail,j.tH.loginPhonePassword),p=(0,A.useCallback)((()=>{const e={mobile:o,nextUrl:d?j.tH.signupPhoneDigit:j.tH.loginPhoneDigit,errorInterceptor:d?void 0:c.errorInterceptor};l?r(e):a(e)}),[l,r,o,a,d,c.errorInterceptor]);return(0,n.jsxs)(Qa,{onSubmit:p,children:[(0,n.jsx)(Es,{}),d&&(0,n.jsx)(iu,{show:!0,asText:!0,i18nKey:"common_registration_phone_input_agreement"}),(0,n.jsx)(fr,{loading:i,disabled:!t,"data-e2e":"login-button",children:e(d?"common_registration_phone_input_button":"Login")}),!d&&(0,n.jsx)(Ud,Object.assign({},c,{isMobile:!0}))]})})),ug=(0,A.memo)((function(){var e;const t=(0,f.s)("WebApp_Login"),o=fe(),i=be(`${j.tH.loginPhoneOrEmail}/:type`),a="email"===(null===(e=null==i?void 0:i.params)||void 0===e?void 0:e.type)?1:0,r=(0,A.useMemo)((()=>[{text:t("Phone")},{text:t("common_login_email_input_tab"),e2e:"email-tab"}]),[t]),s=(0,A.useCallback)((e=>()=>{0===e?o.replace(j.tH.loginPhone):o.replace(j.tH.loginEmail)}),[o]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(cg,{tabs:r,currentTab:a,onSwitchTab:s}),0===a&&(0,n.jsx)(pg,{}),1===a&&(0,n.jsx)(Fd,{})]})})),gg=()=>{const e=(0,f.s)("WebApp_Login"),t=fn(),[{loginLoading:o},{handlePasswordLogin:i}]=(0,s.Su)(Ae.$),{mobile:a}=(0,s.Ph)(za.U),{password:r}=(0,s.Ph)(Na),l=Ja(),d=(0,A.useCallback)((()=>{t({platform:"phone"}),i({account:a,password:r,mobile:a})}),[i,t,a,r]);return(0,n.jsxs)(Qa,{onSubmit:d,children:[(0,n.jsx)(rl,{children:e("common_login_password_title")}),(0,n.jsx)(mr,{create:!1,loginError:Boolean(l)}),(0,n.jsx)(ur,{text:e(l),type:"error"}),(0,n.jsx)(Tl,{}),(0,n.jsx)(fr,{loading:o,disabled:!r,children:e("Login")})]})},hg=()=>{const e=(0,f.s)("WebApp_Login"),{hideHomePage:t,loginTitle:o}=St((()=>["hideHomePage","loginTitle"]),[]),i=t?o:"Login";return _t(),(0,n.jsxs)(rg,{title:e(i,{},Vt.fN),children:[(0,n.jsx)(Ce,{path:j.tH.loginPhonePassword,component:gg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhoneOrEmail,component:ug,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhone,component:ug,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginEmail,component:ug,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhoneDigit,component:sg,exact:!0})]})},mg=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),[{sendCodeLoading:t},{sendEmailCodeForReset:o}]=(0,s.Su)(Wa.m),[{emailErrorMsg:i,email:a=""},{setEmailInfo:r}]=(0,s.Su)(Ha.N),l=Ya(),d=(0,A.useCallback)((()=>{const e=(0,Ua.Ro)(a);r({email:a,valid:e}),e&&o({email:a,email_logic_type:2,nextUrl:j.tH.emailResetDigit})}),[o,a,r]);return(0,n.jsxs)(Qa,{onSubmit:d,children:[(0,n.jsx)(rl,{children:e("setting_password_email_verify_title")}),(0,n.jsx)(sl,{children:e("common_login_reset_email_input_text")}),(0,n.jsx)(Ad,{errorMsg:l}),(0,n.jsx)(fr,{loading:t,disabled:Boolean(i)||!a,children:e("common_registration_phone_input_button")})]})})),_g=(0,A.memo)((function(){const{email:e=""}=(0,s.Ph)(Ha.N),[{code:t},{sendEmailCodeForReset:o}]=(0,s.Su)(Wa.m),[{checkCodeLoading:i,errorMsg:a},{checkEmailCodeForReset:r,setErrorMsg:l}]=(0,s.Su)(Za);(0,A.useEffect)((()=>{l("")}),[t,l]);const d=(0,A.useCallback)((()=>{o({email:e,email_logic_type:2})}),[e,o]),c=(0,A.useCallback)((()=>{r({email:e,code:t})}),[t,r,e]);return(0,n.jsx)(_l,{codeFromNumber:e,onClickSendCode:d,onSubmit:c,loading:i,errorMsg:a,email:!0})})),fg=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),[{code:t},{sendPhoneCodeForForceResetPwd:o,sendEmailCodeForForceResetPwd:i}]=(0,s.Su)(Wa.m),[{forceResetResponse:a},{clearForceResetRes:r}]=(0,s.Su)(Ae.$),{conditional_login_ticket:l,mobile:d,email:c,type:p}=(0,Ve.L$)(a),[{checkCodeLoading:u,errorMsg:g},{checkCodeForForceReset:h,setErrorMsg:m}]=(0,s.Su)(Za);(0,A.useEffect)((()=>{m("")}),[t,m]);const _=(0,A.useCallback)((()=>{"email"===p?i({conditional_login_ticket:l}):o({conditional_login_ticket:l})}),[i,o,l,p]),y=(0,A.useCallback)((()=>{h({conditional_login_ticket:l,code:t,type:p})}),[h,l,t,p]);(0,A.useEffect)((()=>()=>{r()}),[]);const b="email"===p?e("setting_password_code_email_text",{email:c}):e("setting_password_code_sms_text",{mobile:d}).replace(/(\D{1})(4)(\D{1})/,((e,t,o,n)=>`${t}6${n}`));return(0,n.jsx)(_l,{autoSendFirstTime:!0,codeDesc:b,codeFromNumber:l,onClickSendCode:_,onSubmit:y,loading:u,errorMsg:g,email:"email"===p})})),yg=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),{phone:t,mobile:o}=(0,s.Ph)(za.U),[i,{sendPhoneCodeForResetPwd:a}]=(0,s.Su)(Wa.m),{sendCodeLoading:r}=i,l=(0,A.useCallback)((()=>{a({mobile:o,nextUrl:j.tH.phoneResetDigit})}),[a,o]);return(0,n.jsxs)(Qa,{onSubmit:l,children:[(0,n.jsx)(rl,{children:e("setting_bind_phone_input_title")}),(0,n.jsx)(sl,{children:e("common_login_reset_phone_input_text")}),(0,n.jsx)(Es,{}),(0,n.jsx)(fr,{loading:r,disabled:!t,children:e("common_registration_phone_input_button")})]})})),bg=(0,A.memo)((function(){const{mobile:e}=(0,s.Ph)(za.U),[{code:t},{sendPhoneCodeForResetPwd:o}]=(0,s.Su)(Wa.m),[{checkCodeLoading:i,errorMsg:a},{checkPhoneCodeForReset:r,setErrorMsg:l}]=(0,s.Su)(Za);(0,A.useEffect)((()=>{l("")}),[t,l]);const d=(0,A.useCallback)((()=>{o({mobile:e})}),[e,o]),c=(0,A.useCallback)((()=>{r({mobile:e,code:t})}),[e,t,r]);return(0,n.jsx)(_l,{codeFromNumber:e,onClickSendCode:d,onSubmit:c,loading:i,errorMsg:a})})),xg=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),t=(0,l.Nj)(T.$F),o=fn(),{password:i,lengthValid:a,contentValid:r}=(0,s.Ph)(Na),{ticket:d,type:c,conditional_login_ticket:p}=(0,s.Ph)(Za),[{loginLoading:u},{handleChangePwdByTicket:g,handleForceResetPwd:h}]=(0,s.Su)(Ae.$),m=Ja(),_=(0,A.useCallback)((()=>{p?(t.forceResetSubmit(),h({ticket:d,password:i,conditional_login_ticket:p,type:c})):(o({platform:"email"===c?"email":"sms_verification"}),g({password:i,ticket:d,type:c}))}),[t,c,p,h,d,i,g]),y=!(d&&i&&a&&r);return(0,n.jsxs)(Qa,{onSubmit:_,children:[(0,n.jsx)(rl,{children:e("common_login_reset_password_title")}),(0,n.jsx)(mr,{autoFocus:!0,loginErrorText:m}),(0,n.jsx)(fr,{loading:u,disabled:y,children:e("Login")})]})})),vg=(0,Ie.default)("div",{target:"e1ku7a1t0"})((({theme:e})=>[{background:e.colors.BGPlaceholderDefault,padding:"8px 16px",color:e.colors.TextTertiary,width:"100vw",marginInlineStart:"-32px"}]),"label:DivTips;"),kg=()=>{var e;const t=(0,f.s)("WebApp_Login"),{forceResetResponse:o}=(0,s.Ph)(Ae.$),i=(null===(e=be([j.tH.loginForgetPhonePassword,j.tH.loginForgetEmailPassword]))||void 0===e?void 0:e.isExact)&&o,a=o?"":t("Reset");return _t(),(0,n.jsxs)(rg,{title:a,showLeft:!i,children:[i&&(0,n.jsx)(vg,{children:t("changepw_banner")}),(0,n.jsx)(Ce,{path:j.tH.loginForgetEmailPassword,component:o?fg:mg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.emailResetDigit,component:_g,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginForgetPhonePassword,component:o?fg:yg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.phoneResetDigit,component:bg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.resetPassword,component:xg,exact:!0})]})},Cg=()=>{const e=(0,f.s)("WebApp_Login");return _t(),(0,n.jsx)(rg,{title:e("Login"),children:(0,n.jsx)(Vd,{})})},Sg=(0,A.memo)((()=>{const{enterMethod:e,closeable:t,groupId:o,lastGroupId:i}=(0,P.mZ)((e=>({enterMethod:e.enterMethod,closeable:e.closeable,groupId:e.groupId,lastGroupId:e.lastGroupId})),F.bN);return Xl({enterMethod:e,closeable:t,groupId:o,lastGroupId:i}),(0,Ge.rF)({pid:"login"}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(id,{page:"login"}),(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.loginHome,component:wa,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginQRcode,component:Sa,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginPhoneOrEmail,component:hg}),(0,n.jsx)(Ce,{path:j.tH.loginPhoneDigit,component:hg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginWithSignedEmail,component:Cg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.tvLoginHome,component:Is,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.tvLoginEmail,component:Rr,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.tvLoginPhone,component:Ws,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginForgetEmailPassword,component:kg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginForgetPhonePassword,component:kg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginReset,component:kg}),(0,n.jsx)(Ce,{path:j.tH.loginTwoStepVerify,component:ql,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.loginTwoStepVerify,component:ql,exact:!0}),(0,n.jsx)(Ce,{path:"*",component:wa})]}),(0,n.jsx)(ig,{})]})})),wg=()=>{const{showAgeConfirm:e}=(0,s.Ph)(Te.T);return(0,n.jsx)(S.aF,{visible:e,children:(0,n.jsx)(Uc,{isModal:!0})})};var jg=o(3273);const Tg=(0,Ie.default)("div",{target:"e1i2f2310"})({position:"absolute",marginTop:"24px",left:0,right:0},"label:DivWrapper;"),Pg=new Date(1900,0,1,0,0,0),Eg=new Date((new Date).getFullYear()-1,11,31,0,0,0),Mg=cp(),Lg=(0,A.memo)((function(){const e=(0,l.Nj)(T.$F),[{year:t,month:o,date:i},{setBirthday:a,setMonth:r,setYear:d,setDate:c}]=(0,s.Su)(Te.T),p=(0,f.s)("WebApp_Login");(0,A.useEffect)((()=>{e.ageGateShow()}),[]);const u=(0,A.useCallback)((e=>{var t;return(0,n.jsx)(A.Fragment,{children:p(null===(t=Mg[e])||void 0===t?void 0:t.key)})}),[p]),g=(0,A.useCallback)((e=>{const t=e.getDate(),o=e.getMonth()+1,n=e.getFullYear();r({value:o,key:String(o-1)}),d({value:n,key:String(n)}),c({value:t,key:String(t)}),a({year:n,month:o,date:t})}),[a,c,r,d]),h=(0,A.useMemo)((()=>{if(!(null==t?void 0:t.value)||!(null==o?void 0:o.value)||!(null==i?void 0:i.value)){const e=new Date;return new Date(Eg.getFullYear(),e.getMonth(),e.getDate())}return new Date(t.value,o.value,i.value)}),[t,o,i]);return(0,n.jsx)(Tg,{children:(0,n.jsx)(jg.A,{className:"date-selector",defaultDate:h,mode:"date",maxDate:Eg,minDate:Pg,onDateChange:g,formatMonth:u})})})),Ag=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),{birthday:t,checkAgeLoading:o,ageErrorMsg:i="",showErrorByToast:a}=(0,s.Ph)(Te.T),{signupLoading:r}=(0,s.Ph)(ko.H),{user:l}=(0,Ve.L$)((0,Ze.W)((()=>["user"]),[])),{handleCheckAge:d,nextStep:c}=xc();(0,A.useEffect)((()=>{i&&a&&(0,mn.P)(e(i))}),[a,i,e]);const p=Boolean(i)&&!a;return _t(),(0,n.jsxs)(rg,{title:e("sign_up"),children:[(0,n.jsx)(rl,{"data-e2e":"birthday-text",children:e("common_registration_agegate_title")}),(0,n.jsx)(sl,{"data-e2e":"birthday-desc",children:e("mus_age_gate_tips")}),(0,n.jsx)(dr,{errorState:p,disableDelete:!0,placeholder:e("birthdate_placeholder"),value:t,readonly:!0}),p&&(0,n.jsx)(ur,{text:e(i),type:"error"}),(0,n.jsx)(fr,{disabled:!t||Boolean(l),onClick:d,loading:r||o,"data-e2e":"next-button",children:e("common_registration_email_input_button")}),(0,n.jsx)(Lg,{}),(0,n.jsx)(zp,{isMobile:!0,onContinue:c})]})})),Ig=(0,Ie.default)("div",{target:"ekgsvu50"})({height:"30px",overflow:"hidden",marginTop:"32px"},"label:DivWrapper;"),Rg=(0,Ie.default)("div",{target:"ekgsvu51"})((({theme:{colors:e}})=>[{position:"relative",background:e.BGPrimary,borderColor:e.LineSecondary,width:"100%",display:"flex",overflowX:"auto",alignItems:"center",paddingBottom:"10px"}]),"label:DivSuggestListWrapper;"),Fg=(0,Ie.default)("span",{target:"ekgsvu52"})((({theme:e,disabled:t})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:t?"TextTertiary":"TextPrimary",fontWeight:"semiBold"}),{padding:"6px 10px",fontSize:"13px",lineHeight:"14px",border:`1px solid ${e.colors.LineSecondary2}`,borderRadius:"2px",marginInlineEnd:"8px",whiteSpace:"nowrap"}]),"label:SpanItem;"),Og=(0,A.memo)((function({labelText:e="common_registration_email_input_suggested",list:t=[],onSelect:o}){const i=(0,f.s)("WebApp_Login");return(0,n.jsx)(Ig,{children:(0,n.jsxs)(Rg,{children:[(0,n.jsx)(Fg,{disabled:!0,children:i(e)}),t.map(((e,t)=>(0,n.jsx)(Fg,{onClick:o(`${e}`),children:e},t)))]})})})),Dg=(0,A.memo)((function(){var e;const[{usernameInfo:t},{setUsername:o}]=(0,s.Su)(ko.H),i=(0,A.useCallback)((e=>()=>{o(e)}),[o]);return(null==t?void 0:t.isValid)||!(null===(e=null==t?void 0:t.suggestList)||void 0===e?void 0:e.length)?null:(0,n.jsx)(Og,{onSelect:i,list:null==t?void 0:t.suggestList})})),Hg=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),{usernameInfo:t}=(0,s.Ph)(ko.H),o=fe();vc();const i=(0,A.useCallback)((()=>{o.push({pathname:j.tH.signupCreatePassword,state:{createAccount:!0}})}),[o]);return _t(),(0,n.jsxs)(rg,{title:e("sign_up"),onSubmit:i,children:[(0,n.jsxs)(rl,{children:[" ",e("common_login_sms_popup_option_1")]}),(0,n.jsxs)(sl,{children:[" ",e("mus_create_account_desc")," "]}),(0,n.jsx)(Qp,{ftc:!0}),(0,n.jsx)(fr,{disabled:!(null==t?void 0:t.isValid),children:e("common_registration_email_input_button")}),(0,n.jsx)(Dg,{})]})})),Ug=()=>{const e=(0,f.s)("WebApp_Login"),[{loginLoading:t},{setAccount:o}]=(0,s.Su)(Ae.$),{usernameRegister:i}=(0,s.wA)(ko.H),{password:a,lengthValid:r,contentValid:l}=(0,s.Ph)(Na),d=ye(),{createAccount:c}=(0,Ve.L$)(d.state),p=Co(),u=(0,A.useCallback)((()=>{c?i({password:a,region:p}):o({password:a,nextUrl:j.tH.signupCreateUsername})}),[o,a,c,i,p]),g=!a||!l||!r;return _t(),(0,n.jsxs)(rg,{LeftIcon:c?void 0:cu,onSubmit:u,title:e("sign_up"),children:[(0,n.jsx)(rl,{children:e("common_registration_password_title")}),(0,n.jsx)(mr,{autoFocus:!0}),(0,n.jsx)(fr,{disabled:g,loading:t,children:e("common_registration_email_input_button")})]})},Ng=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),{usernameInfo:t,username:o}=(0,s.Ph)(ko.H),[{loginLoading:i},{setAccount:a}]=(0,s.Su)(Ae.$),r=(0,A.useCallback)((()=>{a({username:o})}),[a,o]);return _t(),(0,n.jsxs)(rg,{title:e("sign_up"),onSubmit:r,LeftIcon:cu,children:[(0,n.jsx)(rl,{children:e("common_registration_username_title")}),(0,n.jsx)(sl,{children:e("common_registration_username_text")}),(0,n.jsx)(Qp,{}),(0,n.jsx)(fr,{loading:i,disabled:!(null==t?void 0:t.isValid),children:e("common_notification_unlogged_button")}),(0,n.jsx)(Dg,{})]})})),Bg=(0,A.memo)((function(){const{email:e=""}=(0,s.Ph)(Ha.N),[{code:t},{sendEmailCodeForSignup:o}]=(0,s.Su)(Wa.m),[{errorMsg:i,signupLoading:a},{emailRegister:r}]=(0,s.Su)(ko.H),l=ye(),{password:d}=l.state||{},c=Co(),p=(0,A.useCallback)((()=>{o({email:e,region:c})}),[e,o,c]),u=(0,A.useCallback)((()=>{r({email:e,code:t,password:d,region:c})}),[t,r,e,d,c]);return _t(),(0,n.jsx)(_l,{autoSendFirstTime:!0,codeFromNumber:e,onClickSendCode:p,onSubmit:u,loading:a,errorMsg:i,email:!0})})),$g=()=>{const e=(0,f.s)("WebApp_Login"),{password:t,lengthValid:o,contentValid:i}=(0,s.Ph)(Na),a=fe(),r=(0,A.useCallback)((()=>{a.push({pathname:j.tH.signupEmailDigit,state:{password:t}})}),[a,t]),l=!t||!i||!o;return _t(),(0,n.jsxs)(Qa,{onSubmit:r,children:[(0,n.jsx)(rl,{children:e("common_registration_password_title")}),(0,n.jsx)(mr,{autoFocus:!0}),(0,n.jsx)(fr,{disabled:l,children:e("common_notification_unlogged_button")})]})},zg=(0,A.memo)((function(){const{setSuggestEmailSuffixConfig:e}=(0,s.wA)(Ha.N),{emailSuffixConfig:t}=St((()=>["emailSuffixConfig"]),[]),o=(0,A.useCallback)((t=>()=>{e(t)}),[e]),i=t.map((e=>`@${e}`));return(0,n.jsx)(Og,{list:i,onSelect:o})})),Wg=(0,A.memo)((function(){const e=(0,f.s)("WebApp_Login"),[{email:t="",emailErrorMsg:o,checkEmailLoading:i},{checkEmailRegistered:a}]=(0,s.Su)(Ha.N),r=Ya(),l=(0,A.useCallback)((()=>{a()}),[a]);return(0,n.jsxs)(Qa,{onSubmit:l,children:[(0,n.jsx)(Ad,{errorMsg:r}),(0,n.jsx)(iu,{show:!0,asText:!0}),(0,n.jsx)(fu,{}),(0,n.jsx)(fr,{loading:i,disabled:!t||Boolean(o),"data-e2e":"next-button",children:e("common_registration_email_input_button")}),(0,n.jsx)(zg,{})]})})),Gg=(0,A.memo)((function(){var e;const t=(0,f.s)("WebApp_Login"),o=fe(),i=be(`${j.tH.signupPhoneOrEmail}/:type`),a="email"===(null===(e=null==i?void 0:i.params)||void 0===e?void 0:e.type)?1:0,r=(0,A.useMemo)((()=>[{text:t("Phone")},{text:t("Email"),e2e:"email-tab"}]),[t]),s=(0,A.useCallback)((e=>()=>{0===e?o.replace(j.tH.signupPhone):o.replace(j.tH.signupEmail)}),[o]);return _t(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(cg,{tabs:r,currentTab:a,onSwitchTab:s}),0===a&&(0,n.jsx)(pg,{}),1===a&&(0,n.jsx)(Wg,{})]})})),Vg=()=>{const e=(0,f.s)("WebApp_Login");return(0,n.jsxs)(rg,{title:e("sign_up"),children:[(0,n.jsx)(Ce,{path:j.tH.signupPhoneOrEmail,component:Gg}),(0,n.jsx)(Ce,{path:j.tH.signupPhoneDigit,component:sg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupEmailDigit,component:Bg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupEmailCreatePassword,component:$g,exact:!0})]})},Kg=(0,A.memo)((function(){return(0,n.jsx)(rg,{showRight:!1,children:(0,n.jsx)(sp,{})})})),qg=(0,A.memo)((()=>{const e=(0,P.mZ)((e=>e.groupId)),{handlePopupHide:t,handlePopupShow:o}=(0,ec.H)();return ed(e),bc(),(0,Ge.rF)({pid:"signup"}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(id,{page:"signup"}),(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.signupHome,component:wa,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupPhoneOrEmail,component:Vg}),(0,n.jsx)(Ce,{path:j.tH.signupPhoneDigit,component:Vg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupEmailDigit,component:Vg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupEmailCreatePassword,component:Vg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupCreatePassword,component:Ug,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupCreateUsername,component:Ng,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupCreateAccount,component:Hg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupAgeGate,component:Ag,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupPolicyConfirm,component:Kg,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.signupCountrySelector,component:yc,exact:!0}),(0,n.jsx)(Ce,{path:"*",component:wa})]}),(0,n.jsx)(wg,{}),(0,n.jsx)(Ic,{isMobile:!0}),(0,n.jsx)(tc.H,{hideByDefault:!0,onShow:o,onHide:t})]})})),Zg=(0,Ie.default)("div",{target:"e1apasj50"})({paddingTop:"150px",textAlign:"center"},"label:DivWrapper;"),Jg=(0,Ie.default)("p",{target:"e1apasj51"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{fontSize:"17px",lineHeight:"20px",marginTop:"20px"}]),"label:PTitleContainer;"),Yg=(0,Ie.default)("div",{target:"e1apasj52"})([({theme:e})=>(0,Re.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),{lineHeight:"17px",marginTop:"12px",textAlign:"center",fontSize:"14px"}],"label:DivContentWrapper;"),Qg=(0,Ie.default)("div",{target:"e1apasj53"})({position:"absolute",bottom:"32px",left:"32px",right:"32px"},"label:DivButtonWrapper;"),Xg=()=>{const e=(0,f.s)("WebApp_Login"),t=fe(),o=ye(),i=(0,l.Nj)(T.$F),[{inCancellationResponse:a},{cancelDeleteAccount:r}]=(0,s.Su)(Ae.$);(0,A.useEffect)((()=>{var e;(null===(e=o.state)||void 0===e?void 0:e.init)||t.replace(j.tH.loginHome)}),[o,t]);const d=(0,A.useCallback)((()=>{r();const e=(null==a?void 0:a.apply_time)?Math.floor((Date.now()-1e3*a.apply_time)/24/60/60/1e3):null;i.reactiveConfirmClick({is_delete:(null==a?void 0:a.isStopAccount)?0:1,num_days_reactive:e})}),[r,null==a?void 0:a.apply_time,null==a?void 0:a.isStopAccount,i]),c=(0,A.useCallback)((()=>{t.push(j.tH.loginHome);const e=(null==a?void 0:a.apply_time)?Math.floor((Date.now()-1e3*a.apply_time)/24/60/60/1e3):null;i.reactiveCancelClick({is_delete:(null==a?void 0:a.isStopAccount)?0:1,num_days_reactive:e})}),[t,null==a?void 0:a.apply_time,null==a?void 0:a.isStopAccount,i]);return(0,n.jsx)(rg,{showLeft:!1,showRight:!1,children:(0,n.jsxs)(Zg,{children:[(0,n.jsx)(Qu,{fill:"rgba(22, 24, 35, 0.45)"}),(0,n.jsx)(Jg,{children:e("reactivate_h1")}),(0,n.jsx)(Yg,{children:e("logback_reactivate_desc")}),(0,n.jsxs)(Qg,{children:[(0,n.jsx)(fr,{onClick:d,children:e("reactivate_btn")}),(0,n.jsx)(fr,{buttonTheme:"default",onClick:c,style:{marginTop:"16px"},children:e("common_registration_phone_input_popup_button")})]})]})})};function eh(){return(0,A.useEffect)((()=>{location.reload()}),[]),null}const th=()=>{const{language:e}=(0,Ve.L$)((0,Ze.W)((()=>["language"]),[])),t="ar"===e||"ur"===e||"he-IL"===e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(od.mg,{children:[(0,n.jsx)("link",{rel:"stylesheet",href:qu}),(0,n.jsx)("link",{rel:"stylesheet",href:Zu})]}),(0,n.jsx)(O.mL,{styles:Le(t)}),(0,n.jsx)(Ce,{path:j.tH.loginHome,component:Sg}),(0,n.jsx)(Ce,{path:j.tH.signupHome,component:qg}),(0,n.jsx)(Ce,{path:j.tH.accountDeactivate,component:Xg}),(0,n.jsx)(Ce,{path:"/coin",component:eh}),(0,n.jsx)(ng,{})]})};var oh=o(52401);const nh=(0,Ie.default)("div",{target:"e1lgi0990"})({display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},"label:DivOauthBodyContainer;"),ih=(0,A.memo)((function(){const{user:e,language:t,env:o}=(0,Ve.L$)((0,Ze.W)((()=>["user","language","env"]),[])),{redirectUrl:i,aid:a}=(0,s.Ph)(kt.t),r=(0,l.Nj)(gt.le);return(0,A.useEffect)((()=>{const n=k.BL.getTrackingInfo(),s=e?Object.assign({status:0,error_code:0},n):Object.assign({status:1,error_code:-1,error_desc:"no account info"},n);oh.z.logout(s),r.logout(s);const l=encodeURIComponent((0,Ft.M3)(t,"boe"===(null==o?void 0:o.type),i));location.href=`https://${location.host}/passport/web/logout/?aid=${a}&account_sdk_source=web&next=${l}&`}),[i,a,t,e,o,r]),(0,n.jsx)(nh,{children:(0,n.jsx)(Ee.R,{})})})),ah=(0,Ie.default)("div",{target:"e10jupx40"})({display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},"label:DivOauthBodyContainer;"),rh=(0,A.memo)((function(){const{search:e}=ye(),{oauth_token:t,oauth_verifier:o,error:i,oauthType:a,state:r}=(0,rt.parse)(e),d=(0,l.Nj)(T.$F),c=(0,l.Nj)(gt.VU),{authPageGoRedirect:p}=(0,s.wA)(ji);return(0,A.useEffect)((()=>{li(null==a?void 0:a.toString()),c.handleThirdGetToken({error_code:t&&o?0:-1,error_message:String(i)}),t&&o?(ti("twitter",{oauth_token:t.toString(),oauth_verifier:o.toString()}),window.parent?window.authDoneClose=!0:p({platform:"line",state:r})):d.thirdPartyLoginResult({status:1,error_code:-1,error_desc:null==i?void 0:i.toString()})}),[i,d,t,o,c,a,p]),(0,n.jsx)(ah,{children:(0,n.jsx)(Ee.R,{})})})),sh=()=>{const{search:e}=ye(),{code:t,error:o,state:i}=(0,rt.parse)(e),a=(0,l.Nj)(T.$F),r=(0,l.Nj)(gt.VU),{authPageGoRedirect:d}=(0,s.wA)(ji);return(0,A.useEffect)((()=>{li(),r.handleThirdGetToken({error_code:t?0:-1,error_message:String(o)}),t?(ti("line",{code:null==t?void 0:t.toString()}),window.opener?window.authDoneClose=!0:d({platform:"line",state:i})):a.thirdPartyLoginResult({status:1,error_code:-1,error_desc:String(o)})}),[t,o,a,r,d]),(0,n.jsx)(ah,{children:(0,n.jsx)(Ee.R,{})})};var lh=o(56578),dh=o(5441);const ch=e=>{tt.f.sendEvent("private_notify_click",e)},ph={id:"icon-ee6a017a",use:"icon-ee6a017a-usage",viewBox:"0 0 50 50",content:''};function uh(e){const t=(0,A.useContext)(Ot.X);return(0,A.useLayoutEffect)((()=>(t.add(ph),()=>{t.remove("icon-ee6a017a")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#icon-ee6a017a"},void 0)}),void 0)}const gh=(0,Ie.default)("div",{target:"e6r3pim0"})((({theme:e})=>({margin:e.isMobile?"30px 32px 0":"80px auto 0",maxWidth:"400px"})),"label:DivContainer;"),hh=(0,Ie.default)("div",{target:"e6r3pim1"})((({theme:e})=>({width:"80px",height:"80px",fontSize:"50px",margin:"24px auto",border:`1px solid ${e.colors.LineSecondary}`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"})),"label:DivIcon;"),mh=(0,Ie.default)("div",{target:"e6r3pim2"})((({theme:e})=>[(0,Re.zy)({theme:e,fontWeight:"bold",fontFamily:"TikTokDisplayFont"}),{textAlign:"center",fontSize:"24px",lineHeight:"28px",marginBottom:"24px"}]),"label:DivTitle;"),_h=(0,Ie.default)("div",{target:"e6r3pim3"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextSecondary"}),{fontSize:"16px",textAlign:"center",lineHeight:"22px",marginBottom:"12px"}]),"label:DivDescription;"),fh=(0,Ie.default)("span",{target:"e6r3pim4"})((({theme:e})=>[{fontSize:"16px",lineHeight:"22px",color:e.colors.Primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold"}]),"label:SpanLinkText;"),yh=()=>{const e=(0,f.s)("WebApp_Login"),{handlePrivateConfirm:t}=(0,s.wA)(lh.S),{isElectronApp:o}=(0,dh.B)(),i=(0,A.useCallback)((()=>{t(),ch({result:"ok"})}),[t]),a=(0,A.useCallback)((()=>{ch({result:"learn_more"})}),[]);return(0,A.useEffect)((()=>{tt.f.sendEvent("private_notify_show")}),[]),_t(),(0,n.jsxs)(gh,{children:[(0,n.jsx)(hh,{children:(0,n.jsx)(uh,{})}),(0,n.jsx)(mh,{children:e("title_private_on")}),(0,n.jsx)(_h,{children:e("descrip_private_on_signup")}),(0,n.jsx)(jo,{isJumpOutside:!0,underline:!1,target:o?"_blank":void 0,path:"https://support.tiktok.com/en/account-and-privacy/account-privacy-settings/making-your-account-public-or-private",children:(0,n.jsxs)(fh,{onClick:a,children:[e("link_learn_more_private_accounts_signup")," >"]})}),(0,n.jsx)(fr,{onClick:i,bottonTheme:"text",children:e("button_signup_private_on")})]})};var bh=o(54378);function xh(e=1e3){return new Promise((t=>setTimeout(t,e)))}const vh=({url:e,relatedPromises:t=[],redirectDelay:o})=>(0,u.__awaiter)(void 0,void 0,void 0,(function*(){yield Promise.all([...t,xh(o)]).catch(L()),k.nf.setUpLoginSuccessE2ETracking(),location.href=e})),kh={redirectHandler:vh,disableMetaAndroidOneTapSuccessPopup:!1,successToastDuration:3},Ch=(0,A.createContext)(kh),Sh=(Ch.Provider,()=>{const{redirectHandler:e=vh,disableMetaAndroidOneTapSuccessPopup:t=!1,successToastDuration:o=3}=(0,A.useContext)(Ch);return{goRedirect:(0,A.useCallback)(((t,o,n,i)=>{const a=(0,Ft.M3)(t,o,n),r=new URL(a),s=`${r.pathname}${r.search}`,l=k.nf.getLoginSuccessE2ETrackingProps();e({url:a,nonOriginUrl:s,trackingProps:l,relatedPromises:i,redirectDelay:Ft.l6})}),[e]),disableMetaAndroidOneTapSuccessPopup:t,successToastDuration:o}});var wh=o(83062);const jh=(0,Ie.default)("div",{target:"ermvtw20"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",maxWidth:e.isMobile?"300px":"400px",padding:"0px 32px 32px",textAlign:"center"})),"label:DivContainer;"),Th=(0,Ie.default)("h5",{target:"ermvtw21"})((({theme:e})=>[(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"20px",lineHeight:"24px"}]),"label:H5Title;"),Ph=(0,Ie.default)("p",{target:"ermvtw22"})([({theme:e})=>(0,Re.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{lineHeight:"20px",margin:"24px 0",textAlign:"center"}],"label:PDesc;"),Eh=e=>{const t=(0,f.s)("WebApp_Login"),{title:o,text:i,buttonText:a,visible:r,supportText:s}=e,{language:l}=(0,Ve.L$)((0,Ze.W)((()=>["language"]),[])),d={marginTop:"16px"};return(0,n.jsx)(S.aF,{visible:r,maskCloseable:!1,onClose:e.onClose,children:(0,n.jsxs)(jh,{children:[o&&(0,n.jsx)(Th,{children:t(o)}),(0,n.jsx)(Ph,{children:t(i)}),s&&(0,n.jsx)("a",{href:`https://support.tiktok.com?lang=${l}`,target:"_blank",rel:"noopener noreferrer",children:(0,n.jsx)(fr,{style:d,children:t(null!=a?a:"twosv_recover_pw_popup_btn")})}),(0,n.jsx)(fr,{buttonTheme:"default",onClick:e.onClose,style:d,children:t(null!=a?a:"OK")})]})})},Mh={inexistent:{title:"age_verify_login_inexistent",subTitle:"age_verify_login_inexistent_intro"},ineligible:{title:"age_verify_login_ineligible",subTitle:"age_verify_login_ineligible_intro"},twoStepVerifyBlock:{title:"twosv_login_sms_block_title",subTitle:"twosv_login_sms_block_content"},TwoStepBlockResetPwd:{title:"twosv_recover_pw_popup_title",subTitle:"twosv_recover_pw_popup_desc",supportText:"twosv_recover_pw_popup_btn"}},Lh=()=>{var e;const t=fe(),[{showAlertMessageType:o},{setShowAlertMessageType:i}]=(0,s.Su)(kt.t),a=null===(e=be(j.tH.loginHome))||void 0===e?void 0:e.isExact,r=(0,A.useCallback)((()=>{var e;i("");const{message:o}=(0,rt.parse)(window.location.search),n=new RegExp(`&?message=${o}`);t.replace({pathname:j.tH.loginHome,search:null===(e=window.location)||void 0===e?void 0:e.search.replace(n,"")})}),[t,i]);return(0,A.useEffect)((()=>{o&&!a&&t.push(j.tH.loginHome)}),[o,t,a]),o?(0,n.jsx)(Eh,{supportText:Mh[o].supportText,visible:Boolean(o),title:Mh[o].title,text:Mh[o].subTitle,onClose:r}):null},Ah=(0,Ie.default)("div",{target:"e1xbfihi0"})({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",padding:"24px 20px 6px"},"label:DivLinkPhoneOrEmailContainer;"),Ih={wordWrap:"break-word"},Rh=(0,Ie.default)("div",{target:"e1xbfihi1"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"bold",fontStyle:"normal"}),Object.assign({fontSize:20,lineHeight:"25px"},Ih)]),"label:DivLinkPhoneOrEmailTitleContainer;"),Fh=(0,Ie.default)("div",{target:"e1xbfihi2"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontStyle:"normal"}),Object.assign({color:e.colors.TextTertiaryAlt,fontSize:15,lineHeight:"19.5px",marginTop:"12px",marginBottom:"20px",letterSpacing:"0.061px"},Ih)]),"label:DivLinkPhoneOrEmailDescContainer;"),Oh=(0,Ie.default)(Fe.y,{target:"e1xbfihi3"})({width:"100%",height:"48px",lineHeight:"21px",padding:"8px 14px",borderRadius:"8px",marginBottom:"1px"},"label:StyledLinkButton;"),Dh=(0,Ie.default)("div",{target:"e1xbfihi4"})((({isMobile:e})=>({display:"flex",flexDirection:"column",justifyContent:e?"start":"center",alignItems:"center",height:"100%",padding:e?"30px":"48px",textAlign:e?"start":"center"})),"label:DivLinkPhoneContainer;"),Hh=(0,Ie.default)("div",{target:"e1xbfihi5"})({height:"100%",padding:"48px"},"label:DivMobileDigitCodeContainer;"),Uh=(0,Ie.default)("div",{target:"e1xbfihi6"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"bold",fontStyle:"normal"}),Object.assign({fontSize:24,lineHeight:"30px"},Ih)]),"label:DivLinkPhoneTitle;"),Nh=(0,Ie.default)("div",{target:"e1xbfihi7"})((({theme:e,isMobile:t=!1})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont"}),Object.assign({marginTop:t?"8px":"67px",display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"16px",lineHeight:"20.8px",fontWeight:"400"},Ih)]),"label:DivBottomTextContainer;"),Bh=(0,Ie.default)(jo,{target:"e1xbfihi8"})((({theme:e})=>[(0,Re.mp)({direction:e.direction,marginStart:"5px"}),{fontWeight:500,fontSize:"16px",lineHeight:"20.8px",display:"inline-block",":visited":{color:e.colors.Primary}}]),"label:StyledBottomLinkText;"),$h=()=>{const e=(0,f.s)(),{isMobile:t}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{mobile:o,phoneErrorMsg:i}=(0,s.Ph)(za.U),[{sendCodeLoading:a,code:r,codeFormatError:l},{sendPhoneCodeForBindAccount:d}]=(0,s.Su)(Wa.m),[{bindPhoneLoading:p},{checkAndBindPhone:u}]=(0,s.Su)($a),g=Ja(),h=o&&r&&!i&&!l,m=(0,A.useCallback)((()=>{if(t){const e=j.tH.linkPhoneDigit;d({mobile:o,nextUrl:e})}else d({mobile:o})}),[t,o,d]),_=(0,A.useCallback)((()=>{u({mobile:o,code:r})}),[o,r,u]),y=(0,A.useMemo)((()=>{var e;return!(null===(e=(0,rt.parse)(location.search))||void 0===e?void 0:e.hide_left_icon)}),[location]);(0,A.useEffect)((()=>{Ba._.clickLinkPhoneNumber()}),[]);const b=(0,A.useMemo)((()=>({maxWidth:"100%",minWidth:t?"unset":"376px"})),[t]);return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(Gt,{showLeft:y}),(0,n.jsx)(Dh,{isMobile:t,children:(0,n.jsxs)(Qa,{style:b,children:[(0,n.jsx)(Uh,{children:e("login_fb_noLonger_LinkPhoneReminder")}),(0,n.jsx)(Fh,{children:e("login_fb_noLonger_LoginWithPhoneNextTime")}),t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Es,{}),(0,n.jsx)(fr,{disabled:Boolean(i)||!o,loading:a,onClick:m,children:e("login_fb_noLonger_phone_send_cta")}),(0,n.jsxs)(Nh,{children:[(0,n.jsx)("div",{children:e("login_fb_noLonger_can'tVerifyPhone")}),(0,n.jsx)(Bh,{path:j.tH.linkEmail,text:e("login_fb_noLonger_can'tVerifyPhone_useEmail"),textTheme:"primary"})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(hs,{}),(0,n.jsx)(al,{disabled:Boolean(i)||!o,codeFromNumber:o,loading:a,errorMsg:g,onClickSendCode:m}),(0,n.jsxs)(Nh,{children:[(0,n.jsx)("div",{children:e("login_fb_noLonger_can'tVerifyPhone")}),(0,n.jsx)(Bh,{path:j.tH.linkEmail,text:e("login_fb_noLonger_can'tVerifyPhone_useEmail"),textTheme:"primary"})]}),(0,n.jsx)(fr,{disabled:!h,loading:p,onClick:_,children:e("login_fb_link_cta")})]})]})})]})},zh=()=>{const e=(0,f.s)(),{isMobile:t}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[])),{colors:o}=(0,r.u)(),{emailErrorMsg:i,email:a=""}=(0,s.Ph)(Ha.N),[{sendCodeLoading:l,code:d,codeFormatError:p},{sendEmailCodeForBindAccount:u}]=(0,s.Su)(Wa.m),g=Ja(),[{bindEmailLoading:h},{checkAndBindEmail:m}]=(0,s.Su)($a),_=(0,A.useCallback)((()=>{if(t){const e=j.tH.linkEmailDigit;u({email:a,nextUrl:e})}else u({email:a})}),[t,a,u]),y=(0,A.useCallback)((()=>{m({email:a,code:d})}),[a,d,m]),b=(0,A.useCallback)((()=>{Ba._.ClickFeedback()}),[Ba._]),x=(0,A.useMemo)((()=>{var e;return!(null===(e=(0,rt.parse)(location.search))||void 0===e?void 0:e.hide_left_icon)}),[location]),v=!a||!d||Boolean(p)||Boolean(i);(0,A.useEffect)((()=>{Ba._.clickLinkEmail()}),[]);const k=(0,A.useMemo)((()=>({maxWidth:"100%",minWidth:t?"unset":"376px"})),[t]);return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(Gt,{showLeft:x}),(0,n.jsx)(Dh,{isMobile:t,children:(0,n.jsxs)(Qa,{style:k,children:[(0,n.jsx)(Uh,{children:e("login_fb_noLonger_LinkEmailAddress")}),(0,n.jsxs)(Fh,{children:[e("login_fb_noLonger_EmailLoginAlternative")," ",(0,n.jsx)("a",{style:{color:o.TextPrimary},target:"_blank",href:"https://www.tiktok.com/feedback",onClick:b,rel:"noopener noreferrer",children:e("login_fb_noLonger_GiveFeedback")})]}),t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ad,{errorMsg:i}),(0,n.jsx)(fr,{disabled:Boolean(i)||!a,loading:l,onClick:_,children:e("login_fb_noLonger_phone_send_cta")}),(0,n.jsxs)(Nh,{isMobile:t,children:[(0,n.jsx)("div",{children:e("login_fb_noLonger_can'tVerifyEmail")}),(0,n.jsx)(Bh,{path:j.tH.linkPhone,text:e("login_fb_noLonger_can'tVerifyEmail_usePhone"),textTheme:"primary"})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ad,{}),(0,n.jsx)(al,{email:!0,disabled:Boolean(i)||!a,codeFromNumber:a,loading:l,onClickSendCode:_,errorMsg:g}),(0,n.jsxs)(Nh,{isMobile:t,children:[(0,n.jsx)("div",{children:e("login_fb_noLonger_can'tVerifyEmail")}),(0,n.jsx)(Bh,{path:j.tH.linkPhone,text:e("login_fb_noLonger_can'tVerifyEmail_usePhone"),textTheme:"primary"})]}),(0,n.jsx)(fr,{disabled:v,loading:h,onClick:y,children:e("login_fb_link_cta")})]})]})})]})},Wh=()=>{const{setLoginModalShow:e,setIsLinkPhoneOrEmail:t,setIsLoginOnLoadClosed:o}=(0,P.b1)(),{isModal:i}=(0,s.Ph)(kt.t),a=fe(),{search:l}=ye(),{colors:d}=(0,r.u)(),c=(0,f.s)(),p=(0,A.useCallback)((()=>{a.push({pathname:j.tH.linkPhone,search:i?l:""}),t(!1)}),[a,i,l,t]),u=(0,A.useCallback)((()=>{e(!1),o({isLoginOnLoadClosed:!0})}),[e]);return(0,n.jsxs)(Ah,{children:[(0,n.jsx)(Rh,{children:c("login_fb_noLonger_LinkPhoneNumber")}),(0,n.jsx)(Fh,{children:c("login_fb_noLonger_LinkPhoneNumberReminder")}),(0,n.jsx)(Oh,{size:"medium",buttonTheme:"primary",onClick:p,children:c("login_fb_noLonger_LinkPhone")}),(0,n.jsx)(Oh,{size:"medium",buttonTheme:"default",style:{border:"none",fontWeight:"400",fontSize:"16px",color:d.TextTertiaryAlt},onClick:u,children:c("login_fb_noLonger_notNow_cta")})]})},Gh=(0,A.memo)((function(){const{mobile:e}=(0,s.Ph)(za.U),[{code:t},{sendPhoneCodeForBindAccount:o}]=(0,s.Su)(Wa.m),[{bindPhoneLoading:i,errorMsg:a},{checkAndBindPhone:r,setErrorMsg:l}]=(0,s.Su)($a);(0,A.useEffect)((()=>{l("")}),[t,l]);const d=(0,A.useCallback)((()=>{o({mobile:e})}),[e,o]),c=(0,A.useCallback)((()=>{r({mobile:e,code:t})}),[e,t,r]),p=(0,A.useMemo)((()=>{var e;return!(null===(e=(0,rt.parse)(location.search))||void 0===e?void 0:e.hide_left_icon)}),[location]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Gt,{showLeft:p}),(0,n.jsx)(Hh,{children:(0,n.jsx)(_l,{codeFromNumber:e,onClickSendCode:d,onSubmit:c,loading:i,errorMsg:a})})]})})),Vh=(0,A.memo)((function(){const{email:e=""}=(0,s.Ph)(Ha.N),[{code:t},{sendEmailCodeForBindAccount:o}]=(0,s.Su)(Wa.m),[{bindEmailLoading:i,errorMsg:a},{checkAndBindEmail:r,setErrorMsg:l}]=(0,s.Su)($a);(0,A.useEffect)((()=>{l("")}),[t,l]);const d=(0,A.useCallback)((()=>{o({email:e})}),[e,o]),c=(0,A.useCallback)((()=>{r({email:e,code:t})}),[e,t,r]),p=(0,A.useMemo)((()=>{var e;return!(null===(e=(0,rt.parse)(location.search))||void 0===e?void 0:e.hide_left_icon)}),[location]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Gt,{showLeft:p}),(0,n.jsx)(Hh,{children:(0,n.jsx)(_l,{codeFromNumber:e,onClickSendCode:d,onSubmit:c,loading:i,errorMsg:a,email:!0})})]})})),Kh=(0,A.memo)((()=>{const e=(0,Ze.W)((()=>["user"]),[]),{isMobile:t}=(0,Ve.L$)((0,c.U)((()=>["isMobile"]),[]));return(0,y.ZO)()?(null==e?void 0:e.user)?(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.linkPhoneOrEmail,component:Wh,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.linkPhone,component:$h,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.linkEmail,component:zh,exact:!0}),t&&(0,n.jsx)(Ce,{path:j.tH.linkPhoneDigit,component:Gh,exact:!0}),t&&(0,n.jsx)(Ce,{path:j.tH.linkEmailDigit,component:Vh,exact:!0})]}):(0,n.jsx)(he,{to:j.tH.loginHome}):(0,n.jsx)(he,{to:"https://www.tiktok.com/foryou"})})),qh=(0,A.memo)((function({onRouteChange:e=L(),isLoginPage:t=!0}){var o,i,a,g,h;const m=(0,d.Us)(),_=(0,c.y)(),y=wt();((e,t,o)=>{const n=ye(),{loginModalShow:i,url:a}=(0,P.mZ)((e=>({loginModalShow:e.loginModalShow,url:e.url})),F.bN),{loginType:r}=St((()=>["loginType"]),[]);Ql.initialized||(Ql.init(i?a.split("?")[1]:n.search),Ql.setDevicePlatform(o)),(0,Zl.tF)((()=>Object.assign(Object.assign({page_name:e,login_type:r},Ql.eventCommonParams),{skip_init:!t,initConfig:{enable_ios_sendbeacon:!0}})),[r,e,Ql.eventCommonParams.enter_method,t]),(0,A.useEffect)((()=>{r&&t&&Jl.O.handlePageView({})}),[r,t])})(null!==(o=null==y?void 0:y.pageName)&&void 0!==o?o:"login",t,Boolean(null===(i=_.bizContext)||void 0===i?void 0:i.isMobile));const b=(0,f.Y)(["WebApp_Login"]),x=(0,l.Nj)(Jn.r),v=(0,l.Nj)(bh.d),C=null===(a=be(j.tH.loginHome))||void 0===a?void 0:a.isExact;!function(){const{twoStepResponse:e}=(0,s.Ph)(Ae.$),[{type:t},{setTwoStepVerifyRes:o,setTwoStepType:n}]=(0,s.Su)(qa),{setRedirectNewModalPage:i}=(0,l.Nj)(Ia.q),a=fe(),{pathname:r}=ye();(0,A.useEffect)((()=>{e&&o(e)}),[e,o]),(0,A.useEffect)((()=>{if(t){const e=`/login/2sv/${Va[t]}`;if(e!==r){if(r===j.tH.loginSSO)return i(e);a.push(e)}}}),[t,e]),(0,A.useEffect)((()=>()=>{n(void 0)}),[])}(),function(){var e;const{isRegisterWithPrivateOn:t}=(0,s.Ph)(lh.S),{success:o}=(0,s.Ph)(Ae.$),{redirectUrl:n,lastSuccessPlatform:i}=(0,s.Ph)(kt.t),a=(0,P.mZ)((e=>e.isRedirectToProfilePage)),{success:r}=(0,s.Ph)(ko.H),{success:d}=(0,s.Ph)($a),{language:p,env:g,abTestVersion:h}=(0,Ve.L$)((0,Ze.W)((()=>["language","env","abTestVersion"]),[])),{isMobile:m=!1}=null!==(e=(0,c.U)((()=>["isMobile"]),[]))&&void 0!==e?e:{},{updateState:_}=(0,s.wA)(gn.q),{pathname:y}=ye(),{isAndroid:b}=(0,Ve.L$)((0,c.U)((()=>["isAndroid"]),[])),x=(0,f.s)("WebApp_Login"),v=fe(),k=(0,l.Nj)(Jn.r),{goRedirect:C,disableMetaAndroidOneTapSuccessPopup:S,successToastDuration:w}=Sh();(0,A.useEffect)((()=>{d&&(m?setTimeout((()=>{location.href=`https://www.tiktok.com/foryou?lang=${p}`}),1e3):setTimeout((()=>{window.location.reload()}),3e3))}),[d,m]),(0,A.useEffect)((()=>{if(o||r){if(t)return void v.push(j.tH.signupPrivateOn);const e=(0,hn.Jc)(),r=hn.WQ.includes(e)&&"tiktok"===i&&b&&!S&&y===j.tH.loginHome;if(!r){const e=x(x(2===o?"reactivate_toast":"Login Success"));(0,mn.P)(e,w)}const s=e=>{var t;if(r)return _({isLoginSuccessPopupVisible:!0});const o="v1"===(null===(t=null==h?void 0:h.parameters.login_itp_resolve)||void 0===t?void 0:t.vid)?[k.refreshSessionPromise]:[];C(p,"boe"===(null==g?void 0:g.type),e,o)};if(a){const e=()=>(0,u.__awaiter)(this,void 0,void 0,(function*(){var e;const t=yield fetch((0,rt.stringifyUrl)({url:"/node-webapp/api/common-app-context"})),o=yield t.json();return null===(e=null==o?void 0:o.user)||void 0===e?void 0:e.uniqueId}));e().then((e=>{s(`${td.C}/@${e}`)})).catch((e=>{console.error(`Error Occur when fetching user uniqueId and about to redirect to profile page: ${e}`)}))}else s(n)}}),[p,x,n,a,r,o,t,v,g,i])}(),function(){const e=(0,l.Nj)(wi);(0,A.useEffect)((()=>{e.loadSdk()}),[e])}(),function(){var e;const{user:t,language:o,env:n,abTestVersion:i}=(0,Ve.L$)((0,Ze.W)((()=>["user","language","env","abTestVersion"]),[])),{redirectUrl:a,initialized:r,isSecurityVerification:d,ignoreLoggedInCheck:c}=(0,s.Ph)(kt.t),p=(0,f.s)("WebApp_Login"),u=function(){const e=(0,l.Nj)(T.$F),t=(0,l.Nj)(gt.le);return(0,A.useCallback)((o=>{const n=k.nf.getTrackingInfo();e.setPlatform(o.platform),e.loginSuccess({signUp:o.signUp,is_register:Number(o.signUp),e2eInfo:n}),t.setPlatform(o.platform),t.loginSuccess({signUp:o.signUp,forgetPwd:o.forgetPwd,e2eInfo:n})}),[t,e])}(),g=null!==(e=(0,Ye.qt)(i,"webapp_switch_account"))&&void 0!==e?e:"v1",h=be([j.tH.oauth,j.tH.oauthLine,j.tH.logout,j.tH.linkPhoneOrEmail])||d||c;(0,A.useEffect)((()=>{t&&!h&&r&&"v1"===g&&((0,mn.P)(p("You are logged in, no need to repeat")),u({platform:"repeatLogin",signUp:!1}),(0,Ft.ik)(o,"boe"===(null==n?void 0:n.type),a))}),[a,r,n,g,t,h,o])}(),Ja(),function(){const e=(0,l.Nj)(vo.D),t=fe();if(!t)throw new Error("History not found!.");(0,A.useEffect)((()=>{e.init(t)}),[t,e])}(),function(){const{hideHomePage:e}=St((()=>["hideHomePage"]),[]),t=fe();(0,A.useEffect)((()=>{e&&t.replace(j.tH.loginPhoneOrEmail)}),[e,t])}();const{modalType:S,url:w}=(0,P.mZ)((e=>({modalType:e.modalType,url:e.url})),F.bN),[,{setInitializedTTPConfig:E}]=(0,s.Su)(ko.H),[{initialized:M,ttpConfig:I,phoenix:R,hideHomePage:D,previousModalType:H,targetAid:U,standaloneAid:N},{init:B}]=(0,s.Su)(kt.t),[{initial:$},{getComplianceSettings:z}]=(0,s.Su)(Te.T),W=S!==H;(0,A.useEffect)((()=>{var e,t,o;m.appContext&&x.setContext(m.appContext,{phoenix:R,targetAid:U,standaloneAid:N}),m.appContext&&(null===(t=null===(e=window.byted_acrawler)||void 0===e?void 0:e.setUserMode)||void 0===t||t.call(e,(0,wh.W)("TTP"===(null===(o=m.appContext)||void 0===o?void 0:o.clusterRegion))))}),[m.appContext,x,R]),(0,A.useEffect)((()=>{var e;I&&(v.setInitConfig({isSG:1180===(null===(e=m.appContext)||void 0===e?void 0:e.appId),ttpConfig:I,phoenix:R}),E())}),[null===(g=m.appContext)||void 0===g?void 0:g.appId,I,R,v]),(0,A.useEffect)((()=>{(!M||W||w)&&B(),!$&&z()}),[w]);const{pathname:G}=ye();(0,A.useEffect)((()=>{Fr.indexOf(G)>-1&&(null==e||e())}),[G,e]);const V=(()=>{const e=(0,r.u)().colors.Negative;return O.AH` *[role='button'], *[role='link'], *[role='switch'], *[tabindex], button[aria-label], button[aria-labelledby], button[aria-pressed], button[aria-expanded], button[role='tab'], a[aria-label] { &:focus { outline: none; } &:focus-visible { outline: 2px solid ${e}; } } , *[role='button'], button[aria-label], button[aria-labelledby], button[aria-pressed], button[aria-expanded] { &:focus-visible { outline-offset: 1px; } } , li[role='option'] { &:focus-visible { outline-style: auto; } } `})(),K=(()=>{const{pathname:e}=ye(),t=(0,A.useRef)(null);return t.current||(t.current=mt(e)),t.current})();return!b||!M||D&&C||W?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(O.mL,{styles:Me}),(0,n.jsx)(Ee.R,{center:!0,style:{margin:"auto"}})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(O.mL,{styles:V}),(0,n.jsx)("link",{rel:"stylesheet",href:je}),(0,n.jsxs)(we,{children:[(0,n.jsx)(Ce,{path:j.tH.logout,component:ih}),(0,n.jsx)(Ce,{path:j.tH.oauth,component:rh}),(0,n.jsx)(Ce,{path:j.tH.oauthLine,component:sh}),(0,n.jsx)(Ce,{path:j.tH.signupPrivateOn,component:yh,exact:!0}),(0,n.jsx)(Ce,{path:j.tH.linkPhoneOrEmail,component:Kh}),(null===(h=_.bizContext)||void 0===h?void 0:h.isMobile)?(0,n.jsx)(th,{}):(0,n.jsx)(Ku,{})]}),(0,n.jsx)(Pe.p,{appContext:m.appContext,bizContext:_.bizContext,slardarBid:p.yH,initialPid:K}),(0,n.jsx)(Lh,{})]})})),Zh=(0,Ie.default)("div",{target:"elnl1sy0"})((({theme:e})=>[(0,Re.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),{height:"84px",borderTop:`1px solid ${e.colors.LineSecondary}`,display:"flex",justifyContent:"flex-end",paddingInlineEnd:"24px",alignItems:"center",fontSize:"15px",lineHeight:"18px"},e.isMobile&&(0,Re.jJ)({min:Pt,style:{height:"84px !important",fontSize:"28px",lineHeight:"44px"}})]),"label:DivContainer;"),Jh=({goBack:e,shouldShowBackButton:t})=>{const o=(0,f.s)("WebApp_Login"),[{region:a,userSelectedRegion:r},{setNewUserRegion:l}]=(0,s.Su)(ko.H),d=(0,A.useCallback)((()=>{r&&(null==r?void 0:r.countryCode)!==(null==a?void 0:a.countryCode)&&l(r),e()}),[a,r]);return(0,n.jsxs)(Zh,{children:[t&&(0,n.jsx)(i.I0,{onClick:e,label:o("common_login_back"),variant:"primary",marginInlineEnd:"16px"}),(0,n.jsx)(i.I0,{onClick:d,label:o("regionOption_selectCountry_list_confirmation"),variant:"primary"})]})},Yh={margin:"auto",position:"relative",overflow:"hidden",display:"flex"},Qh=()=>{const{appContext:e}=(0,d.Us)(),{bizContext:t}=(0,c.y)(),o=fe();return(0,A.useEffect)((()=>(gt.Mh.start({appContext:e,bizContext:t,bid:p.yH,initLocation:o.location,extractPid:mt}),o.listen((e=>gt.Mh.handleLocationChange(e))))),[e,t,o]),null},Xh={transform:"scale(1.7)"},em={transform:"scale(1.2)"},tm=Object.assign(Object.assign({},Xh),{marginTop:"8px",marginInlineEnd:"8px"}),om=(0,A.memo)((function({parentRef:e}){var t;const[o,{setLoginModalShow:d,setCloseCallback:c,setGroupId:p,setIsLoginOnLoadClosed:u}]=(0,P.MR)((e=>({loginModalShow:e.loginModalShow,url:e.url,closeable:e.closeable,closeCallback:e.closeCallback,modalImage:e.modalImage,isGuestMode:e.isGuestMode,isGuestModeUI:e.isGuestModeUI,popupType:e.popupType})),F.bN),[,{setShowFlashingButton:g}]=(0,s.Su)(kt.t),[{loginLoading:h}]=(0,s.Su)(Ae.$),m=(0,s.wA)(_),M=(0,l.Nj)(T.$F),[I,O]=(0,A.useState)(0),[D,H]=(0,A.useState)(!1),[U,N]=(0,A.useState)(!1),B=(0,f.Y)(["WebApp_Login"]),[$,z]=(0,A.useState)(!1),W=(0,A.useRef)((0,E.sC)({initialEntries:[null!==(t=o.url)&&void 0!==t?t:j.tH.loginHome]})),G=W.current.location.pathname,V=h||$,K=(0,f.s)("WebApp_Login"),q=(0,Ft.lw)(G),Z=G===j.tH.linkPhoneOrEmail,J=G===j.tH.loginGuestMode,{showLoginOptionSlider:Y}=(0,y.LK)(),Q=(0,A.useMemo)((()=>[{expId:"webapp_guest_mode",segmentId:"segment_default",versionId:o.isGuestMode?"v12":"v1",propertyList:["cta_style","login_text","signup_text","close_icon"]}]),[o.isGuestMode]),{cta_style:X="default",login_text:ee="pcWeb_guestLogin_without",signup_text:te="pcWeb_guestLogin_withoutSignup",close_icon:oe=!1}=(0,A.useMemo)((()=>(0,b.J)(x.a,Q)),[Q]);(0,A.useMemo)((()=>{!(0,v.fU)()&&o.loginModalShow&&o.url&&(W.current.go(Number(`-${W.current.length}`)),W.current.replace(o.url))}),[o.loginModalShow,o.url]),(0,A.useEffect)((()=>{const{unsubscribe:e}=Jn.D.pipe((0,R.M)((e=>{z(e)}))).subscribe();return()=>{e()}}),[]);const{forceLogin:ne}=St((()=>["forceLogin"]),[]),ie=(0,A.useCallback)((()=>{W.current.goBack(),M.clickGoBackButton()}),[M]),ae=(0,A.useCallback)((e=>{13===e.keyCode&&ie()}),[ie]),re=(0,A.useCallback)((()=>{H([j.tH.signupAgeGateConfirm,j.tH.signupCreateAccount,j.tH.signupHome,j.tH.loginHome,j.tH.loginGuestMode].includes(G))}),[G]),se=(0,A.useCallback)((()=>{N([j.tH.signupAgeGateConfirm,j.tH.signupCreateAccount,j.tH.linkPhoneOrEmail,j.tH.linkPhone,j.tH.linkEmail,j.tH.loginGuestMode].includes(G))}),[G,N]),le=G.match("/signup"),de=G===j.tH.signupCountrySelector,ce=(0,A.useCallback)((()=>{var e;d(!1),M.loginNotifyClose({isSignUp:le?"1":"0",e2eInfo:k.nf.getTrackingInfo()}),m.setLoginModalInitialState(),null===(e=o.closeCallback)||void 0===e||e.call(o),c(L()),p(void 0),o.isGuestMode&&((0,C.AP)("guest-mode-flag","1"),(0,C.AP)("timeOfLastPopup",Date.now().toString())),o.isGuestModeUI&&(0,C.AP)("timeOfLastPopup",Date.now().toString()),u({isLoginOnLoadClosed:!0})}),[d,M,le,m,o.closeCallback,c,p,o.isGuestMode,o.isGuestModeUI,u]);(0,A.useEffect)((()=>{o.loginModalShow||k.nf.resetTrackingProps()}),[o.loginModalShow]),(0,A.useEffect)((()=>{(q||J)&&N(!0),W.current.listen((()=>{se(),re(),O(W.current.index)}))}),[q,W,re,se,N,J]);const{colors:pe}=(0,r.u)(),ue=(0,A.useMemo)((()=>Object.assign(Object.assign(Object.assign(Object.assign({},Yh),{height:q?"unset":"642px"}),J?{width:"379px",height:"409px"}:{}),{backgroundColor:pe.BGSecondary})),[pe.BGSecondary,J,q]),ge=(e=>{const t=(0,f.Y)(["WebApp_Login"]),o=(0,f.s)("WebApp_Login");return(0,A.useMemo)((()=>t?o(e?"accessibilityLabels_signup_form_back":"accessibilityLabels_login_form_back"):""),[t,e,o])})(Boolean(le)),he=(0,A.useCallback)((()=>{if(I>0&&!D){const e=document.querySelector("#login-modal");null==e||e.focus()}}),[D,I]);(0,A.useEffect)((()=>{he()}),[he]);const me=o.popupType?4:ne||U||!o.closeable||(o.isGuestMode||o.isGuestModeUI)&&!oe?0:(o.isGuestMode||o.isGuestModeUI)&&oe?4:2,_e=(0,A.useMemo)((()=>de?tm:o.popupType?{}:(o.isGuestMode||o.isGuestModeUI)&&oe?em:Xh),[oe,de,o.isGuestMode,o.isGuestModeUI,o.popupType]),fe=(0,A.useCallback)((()=>J?null:"text"!==X||!o.isGuestMode&&!o.isGuestModeUI||o.popupType?G===j.tH.signupCountrySelector?(0,n.jsx)(Jh,{goBack:ie}):(0,n.jsx)(Eo,{isPopup:"sso"===o.popupType}):(0,n.jsx)(To,{popupType:o.popupType,isModal:o.loginModalShow,isMobileUiOptimize:!1,children:(0,n.jsxs)("div",{onClick:ce,style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:[oe&&(0,n.jsx)(a.A,{}),(0,n.jsx)(ft.UU,{children:K(le?te:ee)})]})})),[J,X,o.isGuestMode,o.isGuestModeUI,o.popupType,G,o.loginModalShow,ce,oe,K,le,te,ee,ie]),ye=(0,A.useCallback)((()=>{g(!0),setTimeout((function(){g(!1)}),3e3)}),[]);return(0,n.jsx)(S.aF,{visible:o.loginModalShow,parentRef:e,onClose:ce,maskCloseable:!1,contentStyle:ue,closeStyles:_e,closeStyle:me,focusTrapDisabled:V,popupType:o.popupType,maskOnClickAction:ye,zIndex:3001,keyboardCloseable:G!==j.tH.signupInterestSelector&&!o.isGuestMode,children:(0,n.jsxs)(ke,{history:W.current,children:[(0,n.jsx)(Qh,{}),(0,n.jsx)(ft.Ug,{popupType:o.popupType,role:"dialog","aria-modal":"true","aria-labelledby":"login-modal-title",isCountrySelector:de,isLinkPhoneOrEmail:q,isLinkPhoneOrEmailHome:Z,isGuestModeRedesign:J,children:(0,n.jsxs)(w.t,{isMobile:!1,componentName:"login-modal-new",children:[de&&(0,n.jsx)("div",{style:{marginInlineStart:"60px",marginTop:"10px",marginBottom:"16px",height:"108px"},children:(0,n.jsx)(i.Fm,{type:"P1-Bold",align:"start",children:K("regionOption_selectCountry_list_title")})}),(0,n.jsxs)(ft.YM,{isGuestModeRedesign:J,popupType:o.popupType,isInterestSelector:G===j.tH.signupInterestSelector,id:"loginContainer",children:[I>0&&!D&&"qr_bottom_right"!==o.popupType&&(0,n.jsx)(ft.Rf,{onClick:ie,onKeyDown:ae,tabIndex:0,role:"button","aria-label":ge,isCountrySelector:de,children:(0,n.jsx)(ft.xr,{})}),(0,n.jsx)(qh,{onRouteChange:he,isLoginPage:!1})]}),B&&"qr"!==o.popupType&&"qr_bottom_right"!==o.popupType&&(!q||Y)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(iu,{}),fe()]})]})})]})})})),nm=om},45596:(e,t,o)=>{o.d(t,{CA:()=>m,Rf:()=>r,UU:()=>_,Ug:()=>c,YM:()=>p,bm:()=>g,rz:()=>u,t_:()=>h,xr:()=>s});var n=o(62186),i=o(12527),a=o(72153);const r=(0,n.default)("div",{target:"eg439om0"})((({theme:e,isCountrySelector:t})=>[(0,a.mp)({direction:e.direction,start:"16px"}),{position:"absolute",top:t?"30px":"16px",cursor:"pointer",transform:"rtl"===e.direction?"rotateZ(180deg)":"unset"}]),"label:DivBack;"),s=(0,n.default)(i.A,{target:"eg439om1"})([{width:"24px",height:"24px"}],"label:StyledChevronLeftOffset;"),l=(e,t,o,n)=>e||o||n?"0 0 0":t?"16px 0 0":"0 0 64px",d=(e,t,o)=>e?"qr_bottom_right"===e?"164px":"360px":t?"280px":o?"375px":"483px",c=(0,n.default)("div",{target:"eg439om2"})({height:"100%",display:"flex",flexDirection:"column"},(({popupType:e,isCountrySelector:t,isLinkPhoneOrEmail:o,isLinkPhoneOrEmailHome:n,isGuestModeRedesign:i})=>[{width:d(e,n,i),padding:l(e,t,o,i)}]),"label:DivModalContent;");c.defaultProps=Object.assign(Object.assign({},c.defaultProps),{"data-e2e":"login-modal"});const p=(0,n.default)("div",{target:"eg439om3"})((({theme:e,isGuestModeRedesign:t,popupType:o,isInterestSelector:n})=>[{flex:"1",overflowY:t||"qr_bottom_right"===o||n?"hidden":"scroll",background:"qr_bottom_right"===o?e.colors.BGView:e.colors.BGPrimary}]),"label:DivPageWrapper;"),u=(0,n.default)("div",{target:"eg439om4"})([{display:"flex",flexDirection:"column",padding:"0 60px 0 60px",width:"483px"}],"label:DivModalRevampContent;"),g=(0,n.default)("div",{target:"eg439om7"})({display:"flex",flexDirection:"row",flexShrink:"0",alignItems:"center",justifyContent:"center",margin:"22px auto",overflow:"hidden",width:"337px"},"label:DivOrContinueWithContainer;"),h=(0,n.default)("div",{target:"eg439om8"})((({theme:e})=>[{width:"100%",height:"1px",flexShrink:"0",background:e.colors.LineReverse2}]),"label:DivSeparatorLine;"),m=(0,n.default)("div",{target:"eg439om9"})((({theme:e})=>[{fontSize:"12px",fontStyle:"normal",fontWeight:"500",lineHeight:"22px",letterSpacing:"0.127px",color:e.colors.TextTertiary2,margin:"0 15px",whiteSpace:"nowrap"}]),"label:DivSeparatorText;"),_=(0,n.default)("p",{target:"eg439om11"})((({theme:e})=>[(0,a.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"13px",marginInlineStart:"5px","&:hover, &:focus":{textDecoration:"underline",textDecorationColor:e.colors.TextPrimary},"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px auto ${e.colors.Negative}`}}]),"label:PGuestModeLink;");n.default.img` display: flex; height: 642px; width: 408px; @media (max-width: 800px) { display: none; } `},3513:(e,t,o)=>{o.d(t,{$X:()=>a,AX:()=>h,Ci:()=>m,Dj:()=>r,SH:()=>d,_j:()=>g,_o:()=>n,j9:()=>s,nC:()=>i,rS:()=>l,uI:()=>u});const n={format:"common_registration_phone_input_error"},i={1011:"common_login_email_error",1009:"common_login_password_error"},a={1002:"common_registration_phone_input_error",1003:"common_registration_phone_input_error",1054:"common_login_reset_phone_input_error"},r={1011:"common_login_reset_email_input_error",1202:"common_registration_phone_sms_error"},s={1039:"login_risk_SMS_1",1091:"passport_uid_banned",1203:"mus_error_code",1054:"common_login_reset_phone_input_error",1051:"common_registration_password_error",1382:"createpw_error_1",8:"login_expired",2027:"login_page_lock",2028:"login_page_lock"},l={1016:"incorrect_code"},d=[1203];var c,p;c||(c={}),function(e){e[e.NeedTwoStep=2046]="NeedTwoStep",e[e.NeedForceResetPassword=1381]="NeedForceResetPassword",e[e.TwoStepBlockResetPassword=1356]="TwoStepBlockResetPassword",e[e.TwoStepBlockLogin=1053]="TwoStepBlockLogin",e[e.NeedSignup=1011]="NeedSignup",e[e.AuthorizationError=1045]="AuthorizationError",e[e.ReactiveAccountError=4]="ReactiveAccountError",e[e.MissingTicketCookie=17006]="MissingTicketCookie"}(p||(p={}));const u=[1023,1031,1044],g=[1016],h=1430,m=[1075,h]},71507:(e,t,o)=>{var n;o.d(t,{Jw:()=>l,R2:()=>r,dd:()=>i,fN:()=>a,p$:()=>s,wT:()=>d}),function(e){e.Main="webapp",e.TV="tv",e.AgeVerify="ageVerify",e.DataExport="dataExport",e.Seller="seller",e.Rechange="recharge",e.Search="search",e.LoginSearchMore="loginsearchmore",e.DataExportLogin="dataExportLogin",e.TT4DWebView="developer_webview",e.LoginM3="loginm3",e.SEOCardNonLogin="non_login"}(n||(n={}));const i="1459",a="Login to TikTok",r="Create a profile, follow other accounts, make your own videos, and more.",s={scanQRDescKey:"ttWeb_loginPopup_scanQR_desc",scanQRDescDefault:"Scan QR code from your logged in device",phoneKey:"ttWeb_loginPopup_phone",phoneDefault:"Phone",qrCodeKey:"ttWeb_loginPopup_QRcode",qrCodeDefault:"QR code",otherKey:"ttWeb_loginPopup_other",otherDefault:"Other",otherOptionsKey:"ttWeb_loginPopup_otherOptions",otherOptionsDefault:"Other login options"},l={loginTitle:"common_login_panel_title",loginSlogan:"common_login_panel_copy",signUpTitle:"common_registration_panel_title",signUpSlogan:"common_registration_panel_copy",aid:"1459",disableSignup:!1,isSecurityVerification:!1,hideHomePage:!1},d={tv:{loginTitle:"tv_login_title",loginSlogan:"tv_login_tiktoktv-desc",signUpTitle:"tv_sign_up_title",signUpSlogan:"tv_login_tiktoktv-desc"},ageVerify:{loginTitle:"age_verify_login_title",loginSlogan:"age_verify_login_intro",disableSignup:!0,isSecurityVerification:!0},dataExport:{loginTitle:"data_export_login_title",loginSlogan:"data_export_login_intro",disableSignup:!0,isSecurityVerification:!0},seller:{aid:"4068"},recharge:{loginTitle:"webapp_coin_recharge_login",signUpTitle:"WebApp_coin_recharge_9"},search:{loginTitle:"login_to_search",signUpTitle:"login_to_search"},loginsearchmore:{loginTitle:"nonloggedinsearch_popup_header_v1",signUpTitle:"nonloggedinsearch_popup_header_v1"},developer_webview:{hideHomePage:!0},loginm3:{loginTitle:"common_login_panel_title",loginSlogan:"classifyV1AWeb_webAppDesktop_maskLayer_bodyDesc"},non_login:{loginTitle:"seo_pcweb_logIn_header"}};var c,p,u;!function(e){e.AccountNotExist="inexistent",e.InEligible="ineligible",e.TwoStepBlock="twoStepVerifyBlock",e.TwoStepBlockResetPwd="TwoStepBlockResetPwd",e.Null=""}(c||(c={})),function(e){e[e.Login=1]="Login",e[e.Reactive=2]="Reactive"}(p||(p={})),function(e){e.Phone="phone",e.Email="email"}(u||(u={}))},64319:(e,t,o)=>{o.d(t,{t:()=>_});var n=o(58632),i=o(340),a=o(64162),r=o(4126),s=o(93995),l=o(23999),d=o(26324),c=o(8536),p=o(35572),u=o(80339),g=o(16680),h=o(17995),m=o(10336);let _=class extends a.E{constructor(e,t){super(),this.service=e,this.jotaiStore=t,this.defaultState={initialized:!1,phoenix:!1,platformConfig:{order:""},emailSuffixConfig:[],previousModalType:""}}setContext(e,t){for(const o in t)e[o]=t[o]}setInitialized(e,t){e.initialized=t}setShowAlertMessageType(e,t){e.showAlertMessageType=t}setPreviousModalType(e,t){e.previousModalType=t}setShowFlashingButton(e,t){e.showFlashingButton=t}init(e){return e.pipe((0,c.Z)((e=>{const{url:t,loginModalShow:o,modalType:n}=this.jotaiStore.get(g.JF);let i=o?t:void 0;return(null==e?void 0:e.url)&&(i=e.url),this.service.getLoginContext(i).pipe((0,p.p)((e=>(0,l.of)(this.getActions().setContext(e),this.getActions().setPreviousModalType(n),this.getActions().setInitialized(!0)))),(0,u.q)(this.terminate()))})))}};(0,n.__decorate)([(0,r.uk)(),(0,n.__metadata)("design:type",d.c)],_.prototype,"dispose$",void 0),(0,n.__decorate)([(0,r.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],_.prototype,"setContext",null),(0,n.__decorate)([(0,r.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],_.prototype,"setInitialized",null),(0,n.__decorate)([(0,r.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],_.prototype,"setShowAlertMessageType",null),(0,n.__decorate)([(0,r.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],_.prototype,"setPreviousModalType",null),(0,n.__decorate)([(0,r.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],_.prototype,"setShowFlashingButton",null),(0,n.__decorate)([(0,r.Mj)({ssr:!0}),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[d.c]),(0,n.__metadata)("design:returntype",void 0)],_.prototype,"init",null),_=(0,n.__decorate)([(0,s.n)("LoginContextModule"),(0,n.__param)(1,(0,i.y)(h.J7)),(0,n.__metadata)("design:paramtypes",[m.G2,Object])],_)},10336:(e,t,o)=>{o.d(t,{G2:()=>f,dI:()=>h});var n=o(58632),i=o(7672),a=o(88874),r=o(4474),s=o(89600),l=o(8536),d=o(23999),c=o(20259),p=o(62564),u=o(71507),g=o(9450);const h="login_config";let m=null,_=class{getUrlParams(e){const t=e?e.split("?")[1]:window.location.search;return(0,r.parse)(t)}getIsPhoenix(){return"www.tiktok.in"===window.location.host}getLoginConfig(){return(0,s.v)((()=>(0,n.__awaiter)(this,void 0,void 0,(function*(){return yield function(){const e=(0,a.YI)(h);if(e)return e;if(m)return m;const t=window.fetch("https://www.tiktok.com/node-webapp/api/login-config");return m=t.then((e=>e.json())).then((e=>((0,a.A7)(h,e),e))).catch((e=>{throw m=null,e})),m}()}))))}};_=(0,n.__decorate)([(0,i._)()],_);let f=class{constructor(e){this.service=e,this.getLoginType=e=>{var t;const o=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:null==e?void 0:e.enter_method;if(!o)return"webapp";const n=Array.isArray(o)?o[0]:o;return u.wT[n]?o:"webapp"},this.getShowAlertMessageType=(e,t)=>{const{message:o}=t;if(!o)return;const n=Array.isArray(o)?o[0]:o;return"ageVerify"!==e||"ineligible"!==n&&"inexistent"!==n?void 0:n}}getLoginContext(e,t=""){var o;const n=this.service.getUrlParams(e),i=this.getLoginType(n),a=this.getShowAlertMessageType(i,n),r=null!==(o=u.wT[i])&&void 0!==o?o:{},{is_modal:s,hide_close_btn:h,hide_toggle_login_signup:m,target_aid:_,no_cta_popup:f,standalone_aid:y,tt_not_installed:b,tt_not_installed_e2e_tracking_info:x,redirect_url:v,enable_one_tap:k,id_token:C}=(0,g.r)(n,["is_modal","hide_close_btn","hide_toggle_login_signup","target_aid","no_cta_popup","standalone_aid","tt_not_installed","tt_not_installed_e2e_tracking_info","redirect_url","enable_one_tap","id_token"]),S="true"===b;let w;if(x)try{w=JSON.parse(atob(x))}catch(e){console.error("Parse tt_not_installed_e2e_tracking_info query param failed",e)}const j="1"===k,T=Boolean(C),P="1"===f||j||S||T,E=Array.isArray(v)?v[0]:null!=v?v:"",M=this.getAppVersion(E);return this.service.getLoginConfig().pipe((0,l.Z)((e=>{if(0!==e.statusCode)throw new Error("get api error");return(0,d.of)(Object.assign({},e.config))})),(0,c.W)((()=>(0,d.of)({emailSuffixConfig:[],platformConfig:{show_num:3,order:"FACEBOOK,GOOGLE,TWITTER,INSTAGRAM"},disableSignup:!1,forceLogin:!1,emailConsent:!1,phoenix:this.service.getIsPhoenix(),ttpConfig:{open:!0,syncSeverList:[{name:"global",domain:"https://web-va.tiktok.com"},{name:"ttp",domain:"https://us.tiktok.com"},{name:"gcp",domain:"https://web-i18n.tiktok.com"}]},disableStandaloneAppFlags:{}})))).pipe((0,p.T)((e=>{var o,n;return Object.assign(Object.assign(Object.assign(Object.assign({},u.Jw),r),{loginType:i,phoenix:this.service.getIsPhoenix(),showAlertMessageType:a,redirectUrl:E,isModal:"1"===s,hideCloseButton:"1"===h,hideToggleLoginSign:"1"===m,previousModalType:t,targetAid:null!==(o=_)&&void 0!==o?o:"",noCtaPopup:P,standaloneAid:null!==(n=y)&&void 0!==n?n:"",standaloneAppVersion:M,enableOneTapFromQuery:j,ttNotInstalled:S,ttNotInstalledE2ETrackingInfo:w}),e)})))}getAppVersion(e){if(!e)return null;try{const t=new URL(e);return(0,r.parse)(t.search).version_code}catch(e){return null}}};f=(0,n.__decorate)([(0,i._)(),(0,n.__metadata)("design:paramtypes",[_])],f)},63379:(e,t,o)=>{o.d(t,{N:()=>y});var n=o(58632),i=o(64162),a=o(4126),r=o(93995),s=o(8536),l=o(23999),d=o(24451),c=o(62564),p=o(74690),u=o(80339),g=o(26324),h=o(75792),m=o(52913),_=o(65504),f=o(77156);let y=class extends i.E{constructor(e,t){super(),this.service=e,this.history=t,this.defaultState={}}setEmail(e,t){e.email=null==t?void 0:t.trim()}setEmailErrorMsg(e,t){e.emailErrorMsg=t}setSuggestEmailSuffixConfig(e,t){var o,n;e.email=(null!==(n=null===(o=e.email)||void 0===o?void 0:o.split("@")[0])&&void 0!==n?n:"")+t,e.emailErrorMsg=void 0}setLoading(e,t){e.checkEmailLoading=t}setEmailInfo(e){return e.pipe((0,s.Z)((({email:e,valid:t})=>(0,l.of)(this.getActions().setEmail(null==e?void 0:e.trim()),this.getActions().setEmailErrorMsg(t||!e?"":"common_registration_email_input_error")))))}checkEmailRegistered(e){return e.pipe((0,d.E)(this.state$),(0,s.Z)((([e,{email:t=""}])=>(0,f.Ro)(t)?this.service.checkEmailRegistered({email:t}).pipe((0,c.T)((e=>{const{error_code:t,description:o,is_registered:n}=e;if(t)return this.getActions().setEmailErrorMsg(o);{const e=n?h.tH.loginWithSignedEmail:h.tH.signupEmailCreatePassword;return this.history.push(e),this.noop()}})),(0,p.Z)(this.getActions().setLoading(!0)),(0,u.q)(this.getActions().setLoading(!1))):(0,l.of)(this.getActions().setEmailErrorMsg("common_registration_email_input_error")))))}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",g.c)],y.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],y.prototype,"setEmail",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],y.prototype,"setEmailErrorMsg",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],y.prototype,"setSuggestEmailSuffixConfig",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],y.prototype,"setLoading",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[g.c]),(0,n.__metadata)("design:returntype",void 0)],y.prototype,"setEmailInfo",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[g.c]),(0,n.__metadata)("design:returntype",void 0)],y.prototype,"checkEmailRegistered",null),y=(0,n.__decorate)([(0,r.n)("EmailModule"),(0,n.__metadata)("design:paramtypes",[m.r,_.D])],y)},70261:(e,t,o)=>{o.d(t,{$:()=>N});var n=o(58632),i=o(64162),a=o(4126),r=o(93995),s=o(340),l=o(67805),d=o(64356),c=o(50970),p=o(54888),u=o(95701),g=o(75792),h=o(31974),m=o(13326),_=o.n(m),f=o(24451),y=o(8536),b=o(23999),x=o(72916),v=o(62564),k=o(74690),C=o(80339),S=o(1475),w=o(65070),j=o(26324),T=o(3513),P=o(52913),E=o(54378),M=o(65504),L=o(47538),A=o(59622),I=o(23301),R=o(94337),F=o(64319),O=o(44319),D=o(22784),H=o(18211),U=o(34411);let N=class extends i.E{constructor(e,t,o,n,i,a,r,s,l,d,c,p,u,g){super(),this.appContext=e,this.bizContext=t,this.contextModule=o,this.signupModule=n,this.service=i,this.regionService=a,this.ageGate=r,this.loginReport=s,this.sloReporter=l,this.sendCode=d,this.phone=c,this.t=p,this.history=u,this.riskError=g,this.defaultState={errorMsg:"",showReactiveModal:!1,loginLoading:!1}}setLoginSuccess(e,t){e.success=null!=t?t:1}setErrorMsg(e,t){e.errorMsg=t}setErrorCode(e,t){e.errorCode=t}setTwoStepVerifyRes(e,t){e.twoStepResponse=t}setNeedForceResetPassword(e,t){const o=t.otp_type.match("email")?"email":"phone";this.history.push("email"===o?g.tH.loginForgetEmailPassword:g.tH.loginForgetPhonePassword),e.forceResetResponse=Object.assign(Object.assign({},t),{type:o})}clearForceResetRes(e){e.forceResetResponse=void 0}setShowReactiveModal(e,t){e.showReactiveModal=t.show,t.res?e.inCancellationResponse=Object.assign(Object.assign({},t.res),{isStopAccount:t.res.error_code===T.AX}):e.inCancellationResponse=void 0}setLoginLoading(e,t){e.loginLoading=t}setPhoneNotRegistered(e,t){e.phoneNotRegistered=t}clearLoginResult(e){e.errorMsg="",e.phoneNotRegistered=!1,e.twoStepResponse=void 0}cancelDeleteAccount(e){return e.pipe((0,f.E)(this.state$),(0,y.Z)((([e,t])=>{var o,n;const i=null===(o=t.inCancellationResponse)||void 0===o?void 0:o.token;return((null===(n=t.inCancellationResponse)||void 0===n?void 0:n.isStopAccount)?this.service.cancelDeactiveAccount({token:i,type:0}):this.service.cancelDeleteAccount({token:i,type:0})).pipe((0,y.Z)((e=>(e.successType=2,(0,b.of)(this.getActions().setShowReactiveModal({show:!1}),this.getActions().handleLoginResult(e))))))})))}handleForceResetPwdByEmail(e){return e.pipe((0,y.Z)((e=>this.service.validateEmailCodeForForceReset(e).pipe((0,x.n)((t=>{const{error_code:o,ticket:n}=t;return o?(0,b.of)(this.getActions().handleLoginResult(t)):this.service.forceResetPwdByEmailTicket(Object.assign(Object.assign({},e),{ticket:n})).pipe((0,v.T)((t=>(t.password=e.password,this.getActions().handleLoginResult(t)))),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1)))})),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1))))))}handleForceResetPwdByPhone(e){return e.pipe((0,y.Z)((e=>this.service.validatePhoneCodeForForceReset(e).pipe((0,y.Z)((t=>{const{error_code:o,ticket:n}=t;return o?(0,b.of)(this.getActions().handleLoginResult(t)):this.service.forceResetPwdByMobileTicket(Object.assign(Object.assign({},e),{ticket:n})).pipe((0,v.T)((t=>(t.password=e.password,this.getActions().handleLoginResult(t)))),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1)))})),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1))))))}handleForceResetPwd(e){return e.pipe((0,y.Z)((e=>{var{type:t}=e,o=(0,n.__rest)(e,["type"]);return("email"===t?this.service.forceResetPwdByEmailTicket(o):this.service.forceResetPwdByMobileTicket(o)).pipe((0,v.T)((e=>(e.password=o.password,this.getActions().handleLoginResult(e)))),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1)))})))}handlePasswordLogin(e){return e.pipe((0,f.E)(this.contextModule.state$),(0,y.Z)((([e,{isSecurityVerification:t}])=>(t?this.service.verifyPwdWithoutLogin(e):this.service.passwordLogin(e)).pipe((0,v.T)((t=>{var o;const{verify_ticket:n}=null!==(o=e.extra_params)&&void 0!==o?o:{};return n&&this.loginReport.twoStepResult({error_code:t.error_code,result:t.error_code?"fail":"success",verification_method:"password"}),t.accountQuery=e,T.nC[t.error_code]&&e.mobile&&(t.errorMsg=T.nC[t.error_code]),this.getActions().handleLoginResult(t)})),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1))))))}changePwdByEmail(e){return e.pipe((0,y.Z)((({password:e,email:t,emailCode:o,not_login_ticket:n,verify_ticket:i})=>this.service.resetPwdLoginByEmail({email:t,code:o,password:e,extra_params:{not_login_ticket:n,verify_ticket:i}}).pipe((0,v.T)((t=>(i&&this.loginReport.twoStepResult({verification_method:"email",error_code:t.error_code,result:t.error_code?"fail":"success"}),t.resetPwdType="email",t.error_code&&(t.password=e,1011===t.error_code&&(t.errorMsg="common_login_reset_email_input_error")),this.getActions().handleLoginResult(t)))),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1))))))}handleSmsLogin(e){return e.pipe((0,y.Z)((({mobile:e,phoneCode:t,login_only:o,birthday:n,region:i})=>this.ageGate.validateAge((0,b.of)({canSkip:o,region:i})).pipe((0,S.i)(1),(0,y.Z)((({payload:a})=>"boolean"==typeof a?(0,b.of)(this.ageGate.getActions().setShowAgeConfirm(a)):(null==a?void 0:a.ageEligible)||null===a?this.service.smsLogin({mobile:e,code:t,login_only:o,birthday:n}).pipe((0,y.Z)((e=>(e.error_code&&(e.errorMsg=T.j9[e.error_code]),(0,b.of)(this.getActions().handleLoginResult(e),o?this.noop():this.signupModule.getActions().storeConsent({region:String(i),user_id_str:e.user_id_str}),a?this.ageGate.getActions().setAgeCheckResult(a):this.noop())))),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1))):(0,b.of)(this.ageGate.getActions().setAgeCheckResult(a))))))))}handleSmsVerify(e){return e.pipe((0,y.Z)((({mobile:e,phoneCode:t})=>this.service.smsVerify({mobile:e,code:t,extra_params:{web_verify_need_region:1,web_verify_expire_in:1200}}).pipe((0,y.Z)((e=>(e.error_code&&(e.errorMsg=T.j9[e.error_code]),(0,b.of)(this.getActions().handleLoginResult(e))))),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1))))))}changePwdByMobile(e){return e.pipe((0,y.Z)((({password:e,mobile:t,phoneCode:o})=>this.service.changePwdByMobile({mobile:t,code:o,password:e}).pipe((0,v.T)((t=>(t.resetPwdType="mobile",t.error_code&&(t.password=e,t.errorMsg=T.j9[t.error_code]),this.getActions().handleLoginResult(t)))),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1))))))}setAccount(e){return e.pipe((0,y.Z)((e=>{var{nextUrl:t}=e,o=(0,n.__rest)(e,["nextUrl"]);return this.service.setAccount(o).pipe((0,v.T)((e=>{const{error_code:o,description:n}=e;if(o){const e=this.t(n);return(0,L.P)(e),console.error(`Login: Set account error: ${e}`),this.noop()}return t?(this.history.push(t),this.noop()):this.getActions().setLoginSuccess()})),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1)))})))}handleChangePwdByTicket(e){return e.pipe((0,y.Z)((e=>{var{type:t}=e,o=(0,n.__rest)(e,["type"]);return("email"===t?this.service.resetPwdByEmailTicket(o):this.service.resetPwdByMobileTicket(o)).pipe((0,v.T)((e=>(e.resetPwdType=t,e.error_code&&(e.password=o.password,e.errorMsg=T.j9[e.error_code]),this.getActions().handleLoginResult(e)))),(0,k.Z)(this.getActions().setLoginLoading(!0)),(0,C.q)(this.getActions().setLoginLoading(!1)))})))}handleLoginResult(e){return e.pipe((0,f.E)(this.contextModule.state$,this.phone.state$,this.bizContext.state$,this.appContext.state$),(0,y.Z)((([e,{disableSignup:t,isSecurityVerification:o,phoenix:n},{mobile:i},{bizContext:a},{appContext:r}])=>{var s,d,c,p;const{error_code:u,errorMsg:h,error_msg:m,description:_,new_user:f,screen_name:x,sec_user_id:v,successType:k,ticket:C,default_error_msg:S,region:j,resetPwdType:P}=e,E=l.nf.getTrackingInfo(),M=e.platform||this.loginReport.platform,L=e=>{this.loginReport.loginSuccess({signUp:e,is_register:e?1:0,e2eInfo:E}),this.sloReporter.loginSuccess({signUp:e,forgetPwd:Boolean(P),e2eInfo:E}),l.nf.saveLoginSuccessInfo({teaPlatform:M,isSignUp:e})};if(A.K.hide(),f)return L(!0),(0,b.of)(this.contextModule.getActions().setContext({lastSuccessPlatform:M}),this.signupModule.getActions().syncUserInfos({region:String(j)}));if(!u)return L(!1),o&&this.setTicketIntoCookie(C,n),(0,w.p)([this.regionService.authBroadcast({screen_name:x,sec_uid:v}),"v1"===(null===(d=null===(s=null==r?void 0:r.abTestVersion)||void 0===s?void 0:s.parameters.login_itp_resolve)||void 0===d?void 0:d.vid)?this.service.refreshSession():(0,b.of)(null)]).pipe((0,y.Z)((()=>(0,b.of)(this.contextModule.getActions().setContext({lastSuccessPlatform:M}),this.getActions().setLoginSuccess(k)))));const R=T.j9[u]||h||m||_||S,F=null!==(p=null===(c=this.history.location())||void 0===c?void 0:c.pathname.startsWith("/signup"))&&void 0!==p&&p;if(this.loginReport.loginFailure({error_code:u,e2eInfo:E,signUp:F}),this.sloReporter.loginFailure({errorCode:u,forgetPwd:Boolean(P),errorMsg:R,signUp:F}),1381===u)return(0,b.of)(this.getActions().setNeedForceResetPassword(e));if(2046===u)return(0,b.of)(this.getActions().setTwoStepVerifyRes(e));if(-1!==T.Ci.indexOf(u))return(null==a?void 0:a.isMobile)&&this.history.push({pathname:g.tH.accountDeactivate,state:{init:!0}}),(0,b.of)(this.getActions().setShowReactiveModal({show:!0,res:e}));if(1053===u)return(0,b.of)(this.contextModule.getActions().setShowAlertMessageType("twoStepVerifyBlock"));if(1356===u)return(0,b.of)(this.contextModule.getActions().setShowAlertMessageType("TwoStepBlockResetPwd"));if(1011===u&&t||1045===u&&o)return(0,b.of)(this.contextModule.getActions().setShowAlertMessageType("inexistent"));if(1011===u){if(e.sms_code_key)return(0,b.of)(this.getActions().setPhoneNotRegistered(!0),this.signupModule.getActions().cacheSmsCodeKey({smsCodeKey:e.sms_code_key,mobile:i}));if(e.profile_key)return(0,b.of)(this.signupModule.getActions().registerThirdPlatform({profileKey:e.profile_key,platform:e.platform,region:j}))}return(0,I.X)(u)?(0,b.of)(this.riskError.getActions().handleRiskError({errorCode:u})):T.$X[u]?(0,b.of)(this.phone.getActions().setErrorMsg(T.$X[u])):T.SH.includes(u)?(0,b.of)(this.sendCode.getActions().setErrorMsg({description:R})):(0,b.of)(this.getActions().setErrorMsg(R),this.getActions().setErrorCode(u))})))}setTicketIntoCookie(e,t){const o=new Date;o.setTime((new Date).getTime()+12e5),_().set("security_verification_ticket",e,{domain:t?"www.tiktok.in":"tiktok.com",secure:!0,expires:o})}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",j.c)],N.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Number]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setLoginSuccess",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setErrorMsg",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Number]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setErrorCode",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setTwoStepVerifyRes",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setNeedForceResetPassword",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"clearForceResetRes",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setShowReactiveModal",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setLoginLoading",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setPhoneNotRegistered",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"clearLoginResult",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"cancelDeleteAccount",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"handleForceResetPwdByEmail",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"handleForceResetPwdByPhone",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"handleForceResetPwd",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"handlePasswordLogin",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"changePwdByEmail",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"handleSmsLogin",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"handleSmsVerify",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"changePwdByMobile",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"setAccount",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",void 0)],N.prototype,"handleChangePwdByTicket",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[j.c]),(0,n.__metadata)("design:returntype",j.c)],N.prototype,"handleLoginResult",null),N=(0,n.__decorate)([(0,r.n)("LoginResultDealModule"),(0,n.__param)(11,(0,s.y)(d.hp)),(0,n.__metadata)("design:paramtypes",[c.L,p.$,F.t,U.H,P.r,E.d,u.T,h.$F,R.le,H.m,O.U,Function,M.D,D.S])],N)},99659:(e,t,o)=>{o.d(t,{q:()=>H});var n=o(58632),i=o(64162),a=o(4126),r=o(93995),s=o(340),l=o(71281),d=o(67805),c=o(64356),p=o(50970),u=o(31974),g=o(4474),h=o(24451),m=o(35572),_=o(87933),f=o(8536),y=o(23999),b=o(2668),x=o(74690),v=o(80339),k=o(76435),C=o(20259),S=o(62564),w=o(65070),j=o(53708),T=o(63700),P=o(26324),E=o(52913),M=o(9450),L=o(89570),A=o(10707),I=o(94337),R=o(70261),F=o(91498);const O=e=>(0,A._)(btoa(JSON.stringify(e)));var D;!function(e){e.Init="init",e.InProgress="in_progress",e.InProgressWithPopup="in_progress_with_popup",e.Stop="stop",e.Failed="failed"}(D||(D={}));let H=class extends i.E{constructor(e,t,o,n,i,a){super(),this.service=e,this.appContext=t,this.loginReport=o,this.sloSlardar=n,this.loginResult=i,this.t=a,this.defaultState={getTokenLoading:!1,getTokenCalled:!1}}updateState(e,t){return Object.assign(Object.assign({},e),t)}getOneTapToken(e){return e.pipe((0,h.E)(this.state$,this.appContext.state$),(0,m.p)((([,e,t])=>{var o,n,i,a,r,s;const c=`https://${"t"===(null!==(n=null===(o=t.appContext)||void 0===o?void 0:o.appType)&&void 0!==n?n:"t")?"www.tiktokv.com":"app-va.tiktokv.com"}/redirect?decode_once=1`,p=g.parse(location.search),u=null!==(i=e.storedState)&&void 0!==i?i:(0,M.r)(p,["enter_method","enter_from","device_platform","ref_hash","redirect_url"]);u.web_id=null===(a=t.appContext)||void 0===a?void 0:a.wid,u.infer_app=(0,L.Jc)(),u.is_home_screen="pwa"===(0,F.o7)()?"1":"0";const h=null!==(s=(0,l.V7)(null===(r=t.appContext)||void 0===r?void 0:r.abTestVersion,"live_recharge_one_tap_polling_optimize"))&&void 0!==s?s:"v1";u.is_optimize_one_tap_v3="v1"!==h?"1":"0";const m=d.nf.getTrackingInfo();u.e2e_tracking_info=m,p.tt_not_installed="true",delete p.coin_spa,m&&(p.tt_not_installed_e2e_tracking_info=btoa(JSON.stringify(m)));const S=`https://www.tiktok.com/login?${g.stringify(p)}`;return(0,_.O)(0,15e4).pipe((0,f.Z)((()=>{var e;return this.service.getOneTapToken({next:null!==(e=u.redirect_url)&&void 0!==e?e:"",state:O(u),web_to_app_redirect_uri:c,web_to_app_fallback_uri:S}).pipe((0,f.Z)((({data:e})=>{const t=e.error_code;return t?(0,b.$)((()=>({errorCode:t,error:new Error(`Get one tap token failed, error_code ${t}`)}))):(0,y.of)(this.getActions().updateState({token:e.token,universalLink:e.redirect_url,getTokenErrorCode:void 0}))})),(0,x.Z)(this.getActions().updateState({getTokenLoading:!0})),(0,v.q)(this.getActions().updateState({getTokenLoading:!1,storedState:u,getTokenCalled:!0})),(0,k.Q)(this.disposeRefresh$))})),(0,k.Q)(this.disposeRefresh$),(0,C.W)((e=>{const t=(e=>{if(!e||"object"!=typeof e||!("errorCode"in e))return;const t=e.errorCode;return"number"==typeof t?t:void 0})(e);return(0,y.of)(this.getActions().updateState({getTokenLoading:!1,getTokenErrorCode:t,storedState:u,getTokenCalled:!0,token:void 0,universalLink:void 0}))})))})))}stopRefreshToken(e){return e.pipe((0,S.T)((()=>this.getActions().disposeRefresh$())))}startOneTapPolling(e){return e.pipe((0,h.E)(this.state$),(0,f.Z)((([{ttpConfig:e,token:t,checkLastUsedToken:o,isCountInAppViewedStatus:n=!0},{authStatus:i}])=>{const{open:a,syncSeverList:r}=e||{},s=a?r:[{name:"gloable",domain:""}];return(0,w.p)(s.map((e=>this.service.checkOneTapState({token:t,baseURL:e.domain})))).pipe((0,f.Z)((a=>{const r={token:t,checkLastUsedToken:o,ttpConfig:e,isCountInAppViewedStatus:n};for(const{data:e,message:t}of a){const{status:o,error_code:a}=e;if("error"!==t&&0!==a)return(0,y.of)({status:o,error_code:a,pollingArgs:r});if(o&&"new"!==o&&("inapp_viewed"!==o||n&&"in_progress_with_popup"!==i))return(0,y.of)({status:o,pollingArgs:r})}throw new Error("User not confirmed, need to retry")})),(0,j.L)({delay:()=>(0,_.O)(800)}),(0,k.Q)(this.disposePolling$))})),(0,h.E)(this.state$,this.appContext.state$),(0,f.Z)((([e,{token:t,lastUsedToken:o,getTokenLoading:n},{appContext:i}])=>{if(e.pollingArgs.checkLastUsedToken&&e.pollingArgs.token!==o)return(0,y.of)(this.noop());const a="error_code"in e?"failed":function(e){switch(e){case"inapp_viewed":return"in_progress_with_popup";case"confirmed":default:return"stop";case"expired":return"failed"}}(e.status),r={authStatus:a,lastUsedToken:t,authErrorCode:"error_code"in e?e.error_code:void 0};if("failed"===a){const o=t===e.pollingArgs.token;o&&(r.token=void 0,r.universalLink=void 0);const i=[this.getActions().updateState(r)];return o&&!n&&i.push(this.getActions().stopRefreshToken(),this.getActions().getOneTapToken()),(0,T.h)(i)}return"confirmed"===e.status?(r.token=void 0,r.universalLink=void 0,this.loginReport.setPlatform("tiktok"),this.sloSlardar.setPlatform("tiktok"),(0,T.h)([this.getActions().updateState(r),this.loginResult.getActions().handleLoginResult({error_code:0,region:null==i?void 0:i.region,platform:"tiktok"})])):(0,T.h)((0,y.of)(this.getActions().updateState(r)),(0,_.O)(800).pipe((0,S.T)((()=>this.getActions().startOneTapPolling(e.pollingArgs)))))})))}stopOneTapPolling(e){return e.pipe((0,S.T)((()=>this.getActions().disposePolling$())))}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",P.c)],H.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",P.c)],H.prototype,"disposePolling$",void 0),(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",P.c)],H.prototype,"disposeRefresh$",void 0),(0,n.__decorate)([(0,a.HI)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",Object)],H.prototype,"updateState",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[P.c]),(0,n.__metadata)("design:returntype",void 0)],H.prototype,"getOneTapToken",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[P.c]),(0,n.__metadata)("design:returntype",void 0)],H.prototype,"stopRefreshToken",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[P.c]),(0,n.__metadata)("design:returntype",Object)],H.prototype,"startOneTapPolling",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[P.c]),(0,n.__metadata)("design:returntype",void 0)],H.prototype,"stopOneTapPolling",null),H=(0,n.__decorate)([(0,r.n)("OneTapModule"),(0,n.__param)(5,(0,s.y)(c.hp)),(0,n.__metadata)("design:paramtypes",[E.r,p.L,u.$F,I.le,R.$,Function])],H)},44319:(e,t,o)=>{o.d(t,{U:()=>h});var n=o(58632),i=o(64162),a=o(4126),r=o(93995),s=o(24451),l=o(8536),d=o(23999),c=o(26324),p=o(25919),u=o(3513),g=o(77156);let h=class extends i.E{constructor(){super(...arguments),this.defaultState={area:"",phone:"",phoneCode:"",searchText:"",showAreaCodeSelector:!1,mobile:"",mobileOpenId:""}}setShowAreaCodeSelector(e,t){e.showAreaCodeSelector=t}setAreaCode(e,t){const{code:o,area:n}=t;e.areaCode=o,e.area=n,this.setMobileInfo(e,{areaCode:o,phone:e.phone})}setPhoneNumber(e,t){e.phone=t,this.setMobileInfo(e,{areaCode:e.areaCode,phone:t})}setErrorMsg(e,t){e.phoneErrorMsg=t}setAreaSearchText(e,t){if(e.searchText=t,!t)return void(e.matchSearchArea=void 0);const o=RegExp(t.replace("+","\\+"),"ig");e.matchSearchArea=p.W.reduce(((e,{lists:t})=>e.concat(t)),[]).find((({name:e,code:t,shortname:n})=>e.match(o)||`${t}`.match(o)||n.match(o)))}setPhoneCode(e,t){e.phoneCode=t}toggleAreaCodeSelector(e){return e.pipe((0,s.E)(this.state$),(0,l.Z)((([,{showAreaCodeSelector:e}])=>(0,d.of)(this.getActions().setShowAreaCodeSelector(!e)))))}selectAreaCode(e){return e.pipe((0,l.Z)((({code:e,area:t})=>(0,d.of)(this.getActions().setAreaCode({area:t,code:e}),this.getActions().setShowAreaCodeSelector(!1)))))}checkPhoneNumberFormat(e){return e.pipe((0,l.Z)((({phone:e})=>{const t=(0,g.nP)(e);return(0,d.of)(this.getActions().setPhoneNumber(e),this.getActions().setErrorMsg(t?u._o.format:""))})))}setMobileInfo(e,t){const{phone:o,areaCode:n}=t;if(!o||!n)return e.mobile="",void(e.mobileOpenId="");e.mobile=`+${n} ${o}`,e.mobileOpenId=86===n?o:`+${n}${o}`}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",c.c)],h.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setShowAreaCodeSelector",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setAreaCode",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setPhoneNumber",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setErrorMsg",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setAreaSearchText",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setPhoneCode",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[c.c]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"toggleAreaCodeSelector",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[c.c]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"selectAreaCode",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[c.c]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"checkPhoneNumberFormat",null),h=(0,n.__decorate)([(0,r.n)("PhoneNumberModule")],h)},22784:(e,t,o)=>{o.d(t,{S:()=>h});var n=o(58632),i=o(64162),a=o(4126),r=o(93995),s=o(24451),l=o(8536),d=o(23999),c=o(26324),p=o(54888),u=o(75792),g=o(65504);let h=class extends i.E{constructor(e,t){super(),this.bizContext=e,this.history=t,this.defaultState={}}setErrorCode(e,t){e.errorCode=t}setShowInstagramCantLoginModal(e,t){e.showInstagramRisk=t}setShowRiskModal(e,t){e.showRiskModal=t}handleRiskError(e){return e.pipe((0,s.E)(this.bizContext.state$),(0,l.Z)((([{errorCode:e},{bizContext:t}])=>(null==t?void 0:t.isMobile)?(0,d.of)(this.getActions().setShowRiskModal(!0),this.getActions().setErrorCode(e)):(this.history.push(u.tH.loginDownloadApp),(0,d.of)(this.noop())))))}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",c.c)],h.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Number]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setErrorCode",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setShowInstagramCantLoginModal",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"setShowRiskModal",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[c.c]),(0,n.__metadata)("design:returntype",void 0)],h.prototype,"handleRiskError",null),h=(0,n.__decorate)([(0,r.n)("RiskErrorModule"),(0,n.__metadata)("design:paramtypes",[p.$,g.D])],h)},18211:(e,t,o)=>{o.d(t,{m:()=>A});var n,i=o(58632),a=o(64162),r=o(4126),s=o(93995),l=o(95701),d=o(93608);!function(e){e.Click="user_click",e.Resend="resend",e.ForgotPwd="forgot_password",e.TwoStep="2sv",e.ForceReset="force_reset",e.Delete="delete",e.Bind="bind"}(n||(n={}));const c=e=>{d.f.sendEvent("send_sms",e)},p=e=>{d.f.sendEvent("send_mail",e)};var u=o(95719),g=o(8536),h=o(17354),m=o(72916),_=o(23999),f=o(1475),y=o(74690),b=o(80339),x=o(24451),v=o(26324),k=o(3513),C=o(52913),S=o(65504),w=o(77156),j=o(56441),T=o(23301),P=o(64319),E=o(63379),M=o(44319),L=o(22784);let A=class extends a.E{constructor(e,t,o,n,i,a,r){super(),this.contextModule=e,this.service=t,this.ageGate=o,this.phone=n,this.email=i,this.history=a,this.riskError=r,this.defaultState={sendCodeLoading:!1,code:""},this.sendReason="user_click",this.isEmail=!1}setCode(e,t){const o=(0,w.$L)(t);e.codeFormatError=o?"common_login_reset_email_verify_title":"",e.code=t}setTicket(e,t){e.ticket=t}setSendCodeLoading(e,t){t&&(e.getCodeErrorMsg=""),e.sendCodeLoading=t}clearGetCodeError(e){e.getCodeErrorMsg="",e.emailRegistered=void 0}setErrorMsg(e,t){const{description:o,emailRegistered:n}=t;e.emailRegistered=n,e.getCodeErrorMsg=o}sendPhoneCodeForVerify(e){return e.pipe((0,u.M)((({mobile:e})=>this.reportSendCode({reason:"user_click",cacheKey:e}))),(0,g.Z)((({mobile:e,nextUrl:t,errorInterceptor:o})=>this.service.notLoginSendCode({mobile:e}).pipe((0,h.p)((e=>!o||o(e))),this.sendCodeHandler({cacheKey:e,nextUrl:t})))))}sendPhoneCodeForLogin(e){return e.pipe((0,u.M)((({mobile:e})=>this.reportSendCode({reason:"user_click",cacheKey:e}))),(0,m.n)((e=>{const{isSignUp:t,mobile:o,region:n,errorInterceptor:a}=e;return this.ageGate.validateAge((0,_.of)({canSkip:!t,region:n})).pipe((0,f.i)(1),(0,g.Z)((({payload:t})=>{if("boolean"==typeof t)return(0,_.of)(this.ageGate.getActions().setShowAgeConfirm(t));if(!(null==t?void 0:t.ageEligible)&&null!==t)return(0,_.of)(this.ageGate.getActions().setAgeCheckResult(t));const{region:n}=e,r=(0,i.__rest)(e,["region"]);return this.service.sendPhoneCode(r).pipe((0,h.p)((e=>!a||a(e))),this.sendCodeHandler({cacheKey:o,agePayload:null!=t?t:void 0,nextUrl:e.nextUrl}))})),(0,y.Z)(this.getActions().setSendCodeLoading(!0)),(0,b.q)(this.getActions().setSendCodeLoading(!1)))})))}sendPhoneCodeForResetPwd(e){return e.pipe((0,u.M)((({mobile:e,verify_ticket:t})=>{var o;return this.reportSendCode({reason:"forgot_password",cacheKey:null!==(o=null!=e?e:t)&&void 0!==o?o:""})})),(0,u.M)((()=>c({send_reason:"forgot_password"}))),(0,g.Z)((({mobile:e,verify_ticket:t,not_login_ticket:o,nextUrl:n})=>{var i;return this.service.sendPhoneCodeWithType({mobile:e,type:4,method:"GET",verify_ticket:t,not_login_ticket:o}).pipe(this.sendCodeHandler({cacheKey:null!==(i=null!=e?e:t)&&void 0!==i?i:"",nextUrl:n}))})))}sendPhoneCodeForTwoStep(e){return e.pipe((0,u.M)((e=>this.reportSendCode({reason:"2sv",cacheKey:e.verify_ticket}))),(0,g.Z)((({verify_ticket:e,not_login_ticket:t,mobile:o})=>this.service.sendPhoneCodeWithType({verify_ticket:e,not_login_ticket:t,type:t?13:22,method:"GET",mobile:o}).pipe(this.sendCodeHandler({cacheKey:e})))))}sendPhoneCodeForForceResetPwd(e){return e.pipe((0,u.M)((e=>this.reportSendCode({reason:"force_reset",cacheKey:e.conditional_login_ticket}))),(0,x.E)(this.state$),(0,g.Z)((([{conditional_login_ticket:e},{code:t}])=>this.service.sendPhoneCodeForForceResetPwd({code:t,conditional_login_ticket:e}).pipe(this.sendCodeHandler({cacheKey:e})))))}sendPhoneCodeForBindAccount(e){return e.pipe((0,u.M)((({mobile:e})=>this.reportSendCode({reason:"bind",cacheKey:e}))),(0,g.Z)((({mobile:e,nextUrl:t})=>this.service.sendPhoneCodeForBindAccount({mobile:e}).pipe(this.sendCodeHandler({cacheKey:e,nextUrl:t})))))}sendEmailCodeForForceResetPwd(e){return e.pipe((0,u.M)((e=>this.reportSendCode({reason:"force_reset",cacheKey:e.conditional_login_ticket,isEmail:!0}))),(0,x.E)(this.state$),(0,g.Z)((([{conditional_login_ticket:e},{code:t}])=>this.service.sendEmailCodeForForceResetPwd({code:t,conditional_login_ticket:e}).pipe(this.sendCodeHandler({email:!0,cacheKey:e})))))}sendEmailCodeForLogin(e){return e.pipe((0,u.M)((e=>this.reportSendCode({reason:"2sv",cacheKey:`${e.verify_ticket}`,isEmail:!0}))),(0,u.M)((()=>p({send_reason:"user_click"}))),(0,g.Z)((({email:e,not_login_ticket:t,verify_ticket:o})=>this.service.sendEmailCodeForLogin({email:null!=e?e:"",extra_params:{not_login_ticket:t,verify_ticket:o}}).pipe(this.sendCodeHandler({email:!0,cacheKey:o})))))}sendEmailCodeForVerify(e){return e.pipe((0,u.M)((e=>this.reportSendCode({reason:"2sv",cacheKey:`${e.verify_ticket}`,isEmail:!0}))),(0,g.Z)((e=>this.service.verifySendEmailCode(e).pipe(this.sendCodeHandler({email:!0,cacheKey:`${e.verify_ticket}`})))))}sendEmailCodeForSignup(e){return e.pipe((0,u.M)((e=>this.reportSendCode({reason:"user_click",cacheKey:`${e.email}`,isEmail:!0}))),(0,g.Z)((e=>this.ageGate.validateAge((0,_.of)({canSkip:!1,region:e.region})).pipe((0,f.i)(1),(0,g.Z)((({payload:t})=>"boolean"==typeof t?(0,_.of)(this.ageGate.getActions().setShowAgeConfirm(t)):(null==t?void 0:t.ageEligible)||null===t?this.service.sendEmailCodeForSignup(e).pipe((0,u.M)((e=>{1023===e.error_code&&(e.emailRegistered=!0)})),this.sendCodeHandler({email:!0,agePayload:null!=t?t:void 0,cacheKey:`${e.email}`})):(0,_.of)(this.ageGate.getActions().setAgeCheckResult(t)))),(0,y.Z)(this.getActions().setSendCodeLoading(!0)),(0,b.q)(this.getActions().setSendCodeLoading(!1))))))}sendEmailCodeForReset(e){return e.pipe((0,u.M)((e=>{var t;return this.reportSendCode({reason:"forgot_password",cacheKey:`${null!==(t=e.email)&&void 0!==t?t:e.verify_ticket}`,isEmail:!0})})),(0,g.Z)((e=>{var t;return this.service.sendEmailCodeForResetPwd(e).pipe(this.sendCodeHandler({email:!0,cacheKey:`${null!==(t=e.email)&&void 0!==t?t:`${e.verify_ticket}`}`,nextUrl:e.nextUrl}))})))}sendEmailCodeForBindAccount(e){return e.pipe((0,u.M)((e=>this.reportSendCode({reason:"bind",cacheKey:`${e.email}`,isEmail:!0}))),(0,g.Z)((e=>this.service.sendEmailCodeForBindAccount(e).pipe(this.sendCodeHandler({email:!0,cacheKey:`${e.email}`,nextUrl:e.nextUrl})))))}reportSendCode(e){const{cacheKey:t,reason:o,isEmail:n}=e;this.sendReason=o,this.isEmail=Boolean(n);const{hasSent:i}=(0,j.o)(t);n?p({is_retry:i,send_reason:o}):c({is_retry:i,send_reason:o})}reportSendCodeResult(e){const{error_code:t,"x-tt-logid":o,message:n,description:i}=e,a={status:t?1:0,error_code:t,error_desc:n||i,type:this.sendReason,logid:o};var r;this.isEmail?(r=a,d.f.sendEvent("monitor_send_email_code",r)):(e=>{d.f.sendEvent("monitor_send_sms",e)})(a)}sendCodeHandler({cacheKey:e,agePayload:t,email:o,nextUrl:n}){return i=>i.pipe((0,u.M)((e=>this.reportSendCodeResult(e))),(0,g.Z)((i=>{var a,r;const{retry_time:s=60,emailRegistered:l,ticket:d,error_code:c}=i;return c||((0,j._)(e,s,o),n&&this.history.push(n)),(0,T.X)(c)?(0,_.of)(this.riskError.getActions().handleRiskError({errorCode:c})):1356===c?(0,_.of)(this.contextModule.getActions().setShowAlertMessageType("TwoStepBlockResetPwd")):d?(0,_.of)(this.getActions().setTicket(d)):k.$X[c]?(0,_.of)(this.phone.getActions().setErrorMsg(k.$X[c]),t?this.ageGate.getActions().setAgeCheckResult(t):this.noop()):k.Dj[c]?(0,_.of)(this.email.getActions().setEmailErrorMsg(k.Dj[c]),t?this.ageGate.getActions().setAgeCheckResult(t):this.noop()):k.uI.includes(c)&&!l?(0,_.of)(this.email.getActions().setEmailErrorMsg(null!==(a=i.description)&&void 0!==a?a:"Sorry, something went wrong, please try again later")):(c&&console.error(`Login: email bind failed: ${c} (${i.description}).`),(0,_.of)(this.getActions().setErrorMsg({description:l||!c?"":null!==(r=i.description)&&void 0!==r?r:"Sorry, something went wrong, please try again later",emailRegistered:l}),t?this.ageGate.getActions().setAgeCheckResult(t):this.noop()))})),(0,y.Z)(this.getActions().setSendCodeLoading(!0)),(0,b.q)(this.getActions().setSendCodeLoading(!1)))}};(0,i.__decorate)([(0,r.uk)(),(0,i.__metadata)("design:type",v.c)],A.prototype,"dispose$",void 0),(0,i.__decorate)([(0,r.h5)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[Object,String]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"setCode",null),(0,i.__decorate)([(0,r.h5)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[Object,String]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"setTicket",null),(0,i.__decorate)([(0,r.h5)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[Object,Boolean]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"setSendCodeLoading",null),(0,i.__decorate)([(0,r.h5)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[Object]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"clearGetCodeError",null),(0,i.__decorate)([(0,r.h5)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[Object,Object]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"setErrorMsg",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendPhoneCodeForVerify",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendPhoneCodeForLogin",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendPhoneCodeForResetPwd",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendPhoneCodeForTwoStep",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendPhoneCodeForForceResetPwd",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendPhoneCodeForBindAccount",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendEmailCodeForForceResetPwd",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendEmailCodeForLogin",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendEmailCodeForVerify",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendEmailCodeForSignup",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendEmailCodeForReset",null),(0,i.__decorate)([(0,r.Mj)(),(0,i.__metadata)("design:type",Function),(0,i.__metadata)("design:paramtypes",[v.c]),(0,i.__metadata)("design:returntype",void 0)],A.prototype,"sendEmailCodeForBindAccount",null),A=(0,i.__decorate)([(0,s.n)("SendCode"),(0,i.__metadata)("design:paramtypes",[P.t,C.r,l.T,M.U,E.N,S.D,L.S])],A)},34411:(e,t,o)=>{o.d(t,{H:()=>zo});var n=o(58632),i=o(64162),a=o(4126),r=o(93995),s=o(340),l=o(26263),d=o(6585),c=o(67805),p=o(64356),u=o(8536),g=o(65070),h=o(23999),m=o(62564),_=o(20259),f=o(53708),y=o(26324),b=o(7672),x=o(11654);let v=class{constructor(e){this.service=e,this.defaultMetrics={count:1},this.handleSyncKrPolicyApprove=e=>{this.service.emitEvent("SyncKrPolicyApprove",this.defaultMetrics,e)}}};v=(0,n.__decorate)([(0,b._)(),(0,n.__metadata)("design:paramtypes",[x.V$])],v);var k=o(45102),C=o(4474),S=o(55099);let w=class{constructor(e){this.fetch=e}getUniversalPopConfig(e){return this.fetch.get("/api/policy/notice/",{query:e})}setUniversalPopOperation(e){return this.fetch.post("https://www.tiktok.com/api/policy/notice/approve/",{body:(0,C.stringify)(e)})}getPolicyContent(e){return this.fetch.get("https://www.tiktok.com/web/api/v2/project/articleContent/",{query:e})}};w=(0,n.__decorate)([(0,b._)(),(0,n.__metadata)("design:paramtypes",[S.p])],w);let j=class extends i.E{constructor(e,t,o){super(),this.pnsSlardar=e,this.pnsReport=t,this.service=o,this.defaultState={krPolicySelection:[],termsDomContent:"",privacyDomContent:""}}setKrPolicySelection(e,t){e.krPolicySelection=t}setTermsDomContent(e,t){e.termsDomContent=t}setPrivacyDomContent(e,t){e.privacyDomContent=t}requestPolicyContent(e){return e.pipe((0,u.Z)((({articleKeys:e,lang:t})=>(0,g.p)(e.map((e=>this.service.getPolicyContent({lang:t,project_key:"legal",article_key:e}))))))).pipe((0,u.Z)((e=>(0,h.of)(this.getActions().setTermsDomContent(e[0].body.article_content),this.getActions().setPrivacyDomContent(e[1].body.article_content)))))}syncKrPolicyApprove(e){const{krPolicySelection:t}=this.state;if("KR"!==e||!t.length)return(0,h.of)(null);const o=-1!==t.indexOf("push-policy");return this.pnsReport.handlePolicyConfirmOnFYP({trending:o?"on":"off"}),this.service.setUniversalPopOperation({business:"kr_consent_market_message",policy_version:"v20200629",style:"bottom",operation:-1!==t.indexOf("push-policy")?"2":"1",aid:1988}).pipe((0,m.T)((({status_code:e})=>{if(this.pnsSlardar.handleSyncKrPolicyApprove({error_code:`${e}`}),0!==e)throw new Error(`sync kr policy error, error_code: ${e}`);return(0,h.of)(null)})),(0,_.W)((e=>(console.error(e),(0,h.of)({status_code:-1})))),(0,f.L)(1))}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",y.c)],j.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Array]),(0,n.__metadata)("design:returntype",void 0)],j.prototype,"setKrPolicySelection",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],j.prototype,"setTermsDomContent",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],j.prototype,"setPrivacyDomContent",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],j.prototype,"requestPolicyContent",null),j=(0,n.__decorate)([(0,r.n)("PolicyModule"),(0,n.__metadata)("design:paramtypes",[v,k.W,w])],j);var T=o(56578),P=o(95701),E=o(50970),M=o(75792),L=o(80596),A=o(31974),I=o(24451),R=o(74690),F=o(80339),O=o(68628),D=o(72916),H=o(95719),U=o(78288),N=o(31014),B=o(98812),$=o(14270),z=o(54378),W=o(65504),G=o(52913),V=o(23301),K=o(47538),q=o(71510),Z=o.n(q),J=o(65738),Y=o.n(J),Q=o(29380),X=o.n(Q);let ee={};const te=()=>{var e,t,o,n;if(Object.keys(ee).length)return ee;const i=(new(X())).getResult(),{browser:a,os:r}=i;return ee={platform:"Web",browser:null!=(e=null==a?void 0:a.name)?e:"",browser_version:null!=(t=null==a?void 0:a.version)?t:"",os:null!=(o=null==r?void 0:r.name)?o:"",os_version:null!=(n=null==r?void 0:r.version)?n:""},ee},oe="1.1.7",ne=`_ccfs_${oe}`,ie=`${ne}_consent`,ae=`${ne}_notifications`,re="pns_consent_system";var se=(e=>(e.US_EAST="US-East",e.US_EASTRED="US-EastRed",e.SINGAPORE_CENTRAL="Singapore-Central",e.EU_TTP="EU-TTP",e.EU_TTP2="EU-TTP2",e.US_TTP="US-TTP",e.US_TTP2="US-TTP2",e))(se||{}),le=(e=>(e.PRODUCTION="production",e.DEV="dev",e.BOE="boe",e))(le||{}),de=class{constructor(){this.region="",this.bid="",this.debug=!1}init(e){const{region:t="",bid:o="",debug:n=!1}=null!=e?e:{};this.region=t,this.bid=o,this.debug=n}send(e){}info(e,t){}warn(e,t){}error(e,t){}getMeta(...e){return{version:oe,bid:this.bid,region:this.region}}reportCUJ(e,t,o){}destruct(){}},ce=(e=>(e.beforeFetchUserInfo="beforeFetchUserInfo",e.afterFetchUserInfo="afterFetchUserInfo",e.beforeFetchConsentData="beforeFetchConsentData",e.afterFetchConsentData="afterFetchConsentData",e.beforeFetchNotificationData="beforeFetchNotificationData",e.afterFetchNotificationData="afterFetchNotificationData",e.beforeUpdateRecords="beforeUpdateRecords",e.afterUpdateRecords="afterUpdateRecords",e.beforeNotify="beforeNotify",e.afterNotify="afterNotify",e.beforeRemoveNotification="beforeRemoveNotification",e.afterRemoveNotification="afterRemoveNotification",e.beforeThirdPartyApprove="beforeThirdPartyApprove",e.afterThirdPartyApprove="afterThirdPartyApprove",e.beforeThirdPartyReject="beforeThirdPartyReject",e.afterThirdPartyReject="afterThirdPartyReject",e))(ce||{}),pe=(e=>(e.sessionStorage="sessionStorage",e.localStorage="localStorage",e.inMem="inMem",e))(pe||{}),ue=(e=>(e.INFO="info",e.WARN="warn",e.ERROR="error",e))(ue||{}),ge=(e=>(e.UNSUPPORTED="Unsupported",e.APPROVE="Approve",e.REJECT="Reject",e.NOT_DETERMINED="NotDetermined",e.PENDING_REVIEW="PENDING_REVIEW",e.REVOKE="REVOKE",e))(ge||{});const he={Unsupported:0,Approve:1,Reject:2,NotDetermined:3,PENDING_REVIEW:4,REVOKE:5};var me=(e=>(e.DEVICE_ID="DeviceID",e.USER_ID="UserID",e.ANY="Any",e.BOTH="Both",e))(me||{}),_e=(e=>(e.DEVICE_CONSENT="device",e.USER_CONSENT="user",e.BOTH_CONSENT="both",e.NOTIFICATION="notification",e))(_e||{}),fe=(e=>(e.V1="v1",e.V2="v2",e))(fe||{}),ye=o(31780),be=(e=>(e.SDK_INIT="sdk_init",e.FETCH_DATA="fetch_data",e.UPDATE_RECORD="update_record",e.GET_RECORD="get_record",e.GET_RECORDS="get_records",e.GET_ENTITY="get_entity",e.GET_ENTITIES="get_entities",e.SUBSCRIBE_EVENT="subscribe_event",e.UNSUBSCRIBE_EVENT="unsubscribe_event",e))(be||{});const xe={sdk_init:"consent_init_sdk",fetch_data:"consent_fetch_data",update_record:"consent_create_record_api",get_record:"consent_get_record",get_records:"consent_get_records",get_entity:"consent_get_entity",get_entities:"consent_get_entities",subscribe_event:"consent_subscribe_event",unsubscribe_event:"consent_unsubscribe_event"};var ve=o(54059),ke=Object.defineProperty,Ce=Object.defineProperties,Se=Object.getOwnPropertyDescriptors,we=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable,Pe=(e,t,o)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ee=(e,t)=>{for(var o in t||(t={}))je.call(t,o)&&Pe(e,o,t[o]);if(we)for(var o of we(t))Te.call(t,o)&&Pe(e,o,t[o]);return e};class Me{constructor(e){this.sendEvent=e=>{this._client&&this._client.sendEvent&&this._client.sendEvent(e)},this.reportActualFMP=()=>{};const{region:t,bid:o,mode:n,slardar:i}=e;this._client=(0,ve.kT)();let a={};switch(t){case se.US_EASTRED:case se.EU_TTP:case se.EU_TTP2:a={domain:"https://mon-i18n.tiktokv.com",pluginPathPrefix:"https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/slardar/fe/sdk-web/plugins"};break;case se.US_TTP:case se.US_TTP2:a={domain:"https://mon16-normal-useast5.tiktokv.us",pluginPathPrefix:"https://lf16-cdn-tos.tiktokcdn-us.com/obj/static-tx/slardar/fe/sdk-web/plugins"};break;case se.US_EAST:case se.SINGAPORE_CENTRAL:default:a={domain:"https://mon.tiktokv.com",pluginPathPrefix:"https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/slardar/fe/sdk-web/plugins"}}var r,s;this._client&&(this._client("init",(r=Ee(Ee({},a),i),s={bid:re,pid:o||window.location.href,release:oe,env:n,plugins:{pageview:!1,jsError:!1,tti:!1,performance:!1,resource:!1,ajax:!1,fetch:!1,fmp:!1,blankScreen:!1}},Ce(r,Se(s)))),this._client("start"))}}var Le=o(80249),Ae=Object.defineProperty,Ie=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,Oe=(e,t,o)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,De=(e,t)=>{for(var o in t||(t={}))Re.call(t,o)&&Oe(e,o,t[o]);if(Ie)for(var o of Ie(t))Fe.call(t,o)&&Oe(e,o,t[o]);return e};var He=Object.defineProperty,Ue=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,$e=(e,t,o)=>t in e?He(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ze=class{constructor(){this._name=`${re}_${oe}_${Date.now()}`,this._trackingModule=(0,ye.Q_)(this._name),this._tea=null,this._slardar=null,this.init=e=>{this._tea=(e=>{let t=null;if(!1!==(null==e?void 0:e.tea))try{const{appId:o,tea:n,region:i,debug:a}=e,r=(e=>{let t={};switch(e){case se.US_EASTRED:t={channel:"in",channel_type:"tcpy",channel_domain:"https://mcs-i18n.tiktok.com"};break;case se.EU_TTP:t={channel:"ie",channel_type:"ttp",channel_domain:"https://mcs-ie.tiktokw.eu"};break;case se.EU_TTP2:t={channel:"ie2",channel_type:"ttp",channel_domain:"https://mcs-ie2.tiktokw.eu"};break;case se.US_TTP:t={channel_type:"ttp",channel_domain:"https://mcs.tiktokv.us"};break;case se.US_TTP2:t={channel_type:"ttp",channel_domain:"https://mcs.tiktokw.us"};break;case se.SINGAPORE_CENTRAL:t={channel:"sg",channel_type:"tcpy",channel_domain:"https://mcs-sg.tiktokv.com"};break;case se.US_EAST:t={channel:"va",channel_type:"tcpy",channel_domain:"https://mcs-va.tiktokv.com"}}return t})(i),s=De(De({},r),null!=n?n:{});(e=>!(!e||!e.channel_type||!e.channel&&!e.channel_domain))(s)&&(t=new Le.g(`${re}_${oe}_${Date.now()}`),t.init(De({app_id:null!=o?o:1988,log:a},s)),t.start())}catch(e){}return t})(e),this._slardar=(e=>{let t=null;if(!1!==(null==e?void 0:e.slardar))try{t=new Me(e)}catch(e){}return t})(e),this._slardar&&this._trackingModule.init({slardarContainer:this._slardar,shouldReportJSError:{cuj:!0},shouldRegisterUserDrop:!1})},this.reportCUJ=(e,t,o)=>{if(e)try{this._trackingModule.reportCUJ(e,t,o),this._tea&&this._tea.event(xe[e],((e,t)=>{for(var o in t||(t={}))Ne.call(t,o)&&$e(e,o,t[o]);if(Ue)for(var o of Ue(t))Be.call(t,o)&&$e(e,o,t[o]);return e})({status:t},null!=o?o:{}))}catch(e){}}}},We=Object.defineProperty,Ge=Object.getOwnPropertySymbols,Ve=Object.prototype.hasOwnProperty,Ke=Object.prototype.propertyIsEnumerable,qe=(e,t,o)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;class Ze extends de{constructor(){return super(),this._monitorModule=new ze,this._isInitialized=!1,this.region="",this.bid="",this.debug=!1,Ze._instance||(Ze._instance=this),Ze._instance}init(e){if(this._isInitialized)return;this._monitorModule.init(e);const{region:t="",bid:o="",appId:n,debug:i=!1,modules:a}=null!=e?e:{};this.appId=n,this.region=t,this.bid=o,this.debug=i;const r=null==a?void 0:a.logging;r&&r instanceof de?this._customLogger=r:this.warn("[LoggingModule]: init - incorrect implementation of LoggingModule"),this._isInitialized=!0}sendDebugMessage(e){if(this.debug){const{level:t}=e;console[t](e.message,e);try{chrome.runtime.sendMessage(e)}catch(e){}}}send(e){this.sendDebugMessage(e)}getMeta(){return((e,t)=>{for(var o in t||(t={}))Ve.call(t,o)&&qe(e,o,t[o]);if(Ge)for(var o of Ge(t))Ke.call(t,o)&&qe(e,o,t[o]);return e})({version:oe,bid:this.bid,region:this.region,appId:this.appId},te())}info(e,t){var o;"function"==typeof(null==(o=this._customLogger)?void 0:o.info)&&this._customLogger.info(e,t),this.send({message:e,level:ue.INFO,meta:this.getMeta(),data:t})}warn(e,t){var o;"function"==typeof(null==(o=this._customLogger)?void 0:o.warn)&&this._customLogger.warn(e,t),this.send({message:e,level:ue.WARN,meta:this.getMeta(),data:t})}error(e,t){var o;"function"==typeof(null==(o=this._customLogger)?void 0:o.error)&&this._customLogger.error(e,t),this.send({message:e,level:ue.ERROR,meta:this.getMeta(),data:t})}destruct(){var e;"function"==typeof(null==(e=this._customLogger)?void 0:e.destruct)&&this._customLogger.destruct(),this._isInitialized=!1}reportCUJ(e,t,o){this._monitorModule.reportCUJ(e,t,o)}}var Je=new Ze,Ye=Object.defineProperty,Qe=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,tt=(e,t,o)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ot=(e,t)=>{for(var o in t||(t={}))Xe.call(t,o)&&tt(e,o,t[o]);if(Qe)for(var o of Qe(t))et.call(t,o)&&tt(e,o,t[o]);return e};const nt=/^(https?:\/\/)/;class it{constructor(){return this._region="",this._bid="",this._debug=!1,this.init=e=>{Je.info("[ServiceModule]: init");const{region:t="",bid:o="",appId:n,domain:i}=null!=e?e:{};this._appId=n,this._region=t,this._bid=o,this._domain=i},this.sendRequest=(e,t,o,n)=>{const i=nt.test(e)?e:`${this._domain}${e}`,a=new URL(i),r=Array.from(a.searchParams.entries()).reduce(((e,t)=>{const[o,n]=t;return void 0===n&&""===n||(e[o]=n),e}),{}),s=null!=n?n:{},{params:l,timeout:d}=s,c=((e,t)=>{var o={};for(var n in e)Xe.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&Qe)for(var n of Qe(e))t.indexOf(n)<0&&et.call(e,n)&&(o[n]=e[n]);return o})(s,["params","timeout"]);let p=ot(ot(ot({region:this._region,aid:this._appId,bid:this._bid},r),null!=l?l:{}),te());"GET"===t&&o&&"object"==typeof o&&(p=ot(ot({},p),o));const u=new URLSearchParams((e=>{if(!e)return"";const t=new URLSearchParams;return Object.entries(e).forEach((([e,o])=>{Array.isArray(o)?o.forEach((o=>{t.append(e,o)})):null!=o&&t.append(e,o)})),t.toString()})(p)),g=new URL(`${a.origin}${a.pathname}?${u.toString()}`),h=Z()({},c,{method:t,timeout:null!=d?d:0,data:o});return Je.info("[ServiceModule]: sendRequest start",h),Y()(g.href,h).then((e=>(Je.info("[ServiceModule]: sendRequest finish",e),e))).catch((e=>{throw Je.error("[ServiceModule]: sendRequest error",e),e}))},this.destruct=()=>{Je.info("[ServiceModule]: destruct")},it._instance||(it._instance=this),it._instance}}var at=new it,rt=o(84573),st=o.n(rt),lt=o(60664),dt=o.n(lt),ct=Object.defineProperty,pt=Object.defineProperties,ut=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,_t=(e,t,o)=>t in e?ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;const ft={data:{},timestamp:0};var yt=class{constructor(e="BaseStorageWrapper",t=!1){this.insertDataByStorageName=(e,t,o,n)=>{Je.info(`[${this.name}]: insertDataByStorageName`,{data:o,storageName:t,timestamp:n});const{data:i={},timestamp:a=0}=e[t];if(a{Je.info(`[${this.name}]: getConsentData`,{userInfo:e,keys:t});const o={};try{const{user_id:n="",device_id:i=""}=null!=e?e:{},a=this.getConsentStore(e);((null==t?void 0:t.length)?t:Object.keys(a.consentEntityValidationMap)).forEach((e=>{var t,r,s,l,d;if(e)switch(null==(t=a.consentEntityValidationMap)?void 0:t[e]){case me.BOTH:n&&i&&(o[e]=a[_e.BOTH_CONSENT].data[e]);break;case me.DEVICE_ID:i&&(o[e]=a[_e.DEVICE_CONSENT].data[e]);break;case me.USER_ID:n&&(o[e]=a[_e.USER_CONSENT].data[e]);break;case me.ANY:{const t=a[_e.USER_CONSENT].data[e],c=a[_e.DEVICE_CONSENT].data[e],p=null!=(s=null==(r=null==t?void 0:t.record)?void 0:r.created_at)?s:0,u=null!=(d=null==(l=null==c?void 0:c.record)?void 0:l.created_at)?d:0;n&&p>=u?o[e]=t:i&&(o[e]=c);break}}}))}catch(o){Je.error(`[${this.name}]: getConsentData Error`,{userInfo:e,keys:t,error:o})}return o},this.getNotificationData=e=>(Je.info(`[${this.name}]: getNotificationData`,{userInfo:e}),this.getNotificationStore(e).notification.data),this.splitConsentEntityData=(e,t)=>{Je.info(`[${this.name}]: splitConsentEntityData`,{userInfo:t,data:e});const o={},n={},i={},a={},{device_id:r="",user_id:s=""}=null!=t?t:{};return e&&"object"==typeof e&&Object.keys(e).forEach((t=>{const l=e[t];if(l)switch(a[t]=l.validator,l.validator){case me.ANY:r&&(o[t]=l),s&&(n[t]=l);break;case me.DEVICE_ID:r&&(o[t]=l);break;case me.USER_ID:s&&(n[t]=l);break;case me.BOTH:s&&r&&(i[t]=l)}})),{deviceConsentData:o,userConsentData:n,bothRequiredConsentData:i,consentEntityValidationMap:a}},this.insertDataIntoStore=(e,t,o)=>{Je.info(`[${this.name}]: insertDataIntoStore`,{userInfo:o,data:e,timestamp:t});const n=this.getConsentStore(o),{deviceConsentData:i,userConsentData:a,bothRequiredConsentData:r,consentEntityValidationMap:s}=this.splitConsentEntityData(e,o);return this.insertDataByStorageName(n,_e.DEVICE_CONSENT,i,t),this.insertDataByStorageName(n,_e.USER_CONSENT,a,t),this.insertDataByStorageName(n,_e.BOTH_CONSENT,r,t),n.consentEntityValidationMap=dt()({},s,n.consentEntityValidationMap),n},this._formatConsentRecord=e=>{const{key:t,type:o,name:n,category:i,validator:a,record:r}=null!=e?e:{};if(r&&o&&n&&i&&a&&t){return s=((e,t)=>{for(var o in t||(t={}))ht.call(t,o)&&_t(e,o,t[o]);if(gt)for(var o of gt(t))mt.call(t,o)&&_t(e,o,t[o]);return e})({},r),pt(s,ut({entity_key:t,entity_type:o,entity_name:n,entity_category:i,entity_validator:a}))}return null;var s},this.getRecord=(e,t)=>{Je.info(`[${this.name}]: getRecord`,{userInfo:t,key:e});const o=this.getConsentData(t,[e]),n=this._formatConsentRecord(null==o?void 0:o[e]);return n?this.shouldClone?st()(n):n:(Je.info(`[${this.name}]: getRecord - no record for ${e}`,{key:e}),null)},this.getEntity=(e,t)=>{var o;Je.info(`[${this.name}]: getEntity`,{userInfo:t,key:e});const n=this.getConsentData(t,[e]),i=null!=(o=null==n?void 0:n[e])?o:null;return i||Je.info(`[${this.name}]: getEntity - no entity for ${e}`,{key:e}),this.shouldClone?st()(i):i},this.getEntities=(e,t)=>{var o;Je.info(`[${this.name}]: getEntities`,{userInfo:t,keys:e});const n=[],i=null!=(o=this.getConsentData(t,e))?o:{};if(null==e?void 0:e.length){const t=[];e.forEach((e=>{var o;const a=null!=(o=null==i?void 0:i[e])?o:null;a?n.push(this.shouldClone?st()(a):a):t.push(e)})),t.length&&Je.info(`[${this.name}]: getEntities - missing some entities`,{entityKeys:t})}else Object.keys(null!=i?i:{}).forEach((e=>{var t;const o=null!=(t=null==i?void 0:i[e])?t:null;o&&n.push(this.shouldClone?st()(o):o)}));return n},this.getRecords=(e,t)=>{Je.info(`[${this.name}]: getRecords`,{userInfo:t,keys:e});const o=[],n=this.getConsentData(t,e);if(null==e?void 0:e.length){const t=[];e.forEach((e=>{const i=this._formatConsentRecord(null==n?void 0:n[e]);i?o.push(this.shouldClone?st()(i):i):t.push(e)})),t.length&&Je.info(`[${this.name}]: getRecords - missing some records`,{entityKeys:t})}else Object.keys(null!=n?n:{}).forEach((e=>{const t=this._formatConsentRecord(null==n?void 0:n[e]);t&&o.push(this.shouldClone?st()(t):t)}));return o},this.clean=()=>{this.cleanConsentData(),this.cleanNotificationData()},this.destruct=()=>{this.clean()},this.name=e,this.shouldClone=t}};const bt={consentEntityValidationMap:{},[_e.USER_CONSENT]:st()(ft),[_e.DEVICE_CONSENT]:st()(ft),[_e.BOTH_CONSENT]:st()(ft)},xt={[_e.NOTIFICATION]:st()(ft)};var vt=class extends yt{constructor(){super("InMemStorageWrapper",!0),this._updateUserInfo=(e,t)=>{Je.info(`[${this.name}]: _updateUserInfo`,{userId:t,deviceId:e}),this._did=e,this._uid=t},this.insertConsentData=(e,t,o)=>{Je.info(`[${this.name}]: insertConsentData`,{data:e,timestamp:t,userInfo:o});try{this.insertDataIntoStore(e,t,o)}catch(e){Je.error(`[${this.name}]: insert - ${e.message}`,e)}},this.insertNotificationData=(e,t,o)=>{Je.info(`[${this.name}]: insertNotificationData`,{data:e,timestamp:t,userInfo:o});try{const n=this.getNotificationStore(o);this.insertDataByStorageName(n,_e.NOTIFICATION,e,t)}catch(e){Je.error(`[${this.name}]: insert - ${e.message}`,e)}},this.getConsentStore=e=>(this._cleanUpUnrelatedUserData(e),this._consentStore),this.getNotificationStore=e=>this._notificationStore,this._cleanUpUnrelatedUserData=e=>{const{device_id:t="",user_id:o=""}=null!=e?e:{};t!==this._did&&(this._consentStore[_e.DEVICE_CONSENT]=st()(ft),this._consentStore[_e.BOTH_CONSENT]=st()(ft)),o!==this._uid&&(this._consentStore[_e.USER_CONSENT]=st()(ft),this._consentStore[_e.BOTH_CONSENT]=st()(ft)),this._updateUserInfo(t,o)},this.cleanConsentData=()=>{this._consentStore.consentEntityValidationMap={},this._consentStore[_e.USER_CONSENT]=st()(ft),this._consentStore[_e.DEVICE_CONSENT]=st()(ft),this._consentStore[_e.BOTH_CONSENT]=st()(ft)},this.cleanNotificationData=()=>{this._notificationStore[_e.NOTIFICATION]=st()(ft)},this.clean=()=>{this._consentStore=st()(bt),this._notificationStore=st()(xt)},this.destruct=()=>{this.clean()},this.clean()}},kt=o(3546),Ct=o.n(kt);class St extends yt{constructor(e="WebStorageWrapper",t=pe.sessionStorage){super(e,!1),this._decrypt=(e,t,o)=>{Je.info(`[${this.name}]: _decrypt`);let n=null;if(t||o){const i=`${null!=t?t:""}_${null!=o?o:""}`;try{const t=Ct().AES.decrypt(e,i).toString(Ct().enc.Utf8),o=JSON.parse(t);(null==o?void 0:o.data)&&"number"==typeof(null==o?void 0:o.timestamp)&&(n=o)}catch(e){Je.info(`[${this.name}]: _decrypt - ${e.message}`,e)}}return Je.info(`[${this.name}]: _decrypt - finish`,n),n},this._encrypt=(e,t,o)=>{Je.info(`[${this.name}]: _encrypt`);let n="";if(t||o){const i=`${null!=t?t:""}_${null!=o?o:""}`;n=Ct().AES.encrypt(JSON.stringify(e),i).toString()}return n},this._encryptConsentStorage=e=>{var t,o,n,i;return{consentEntityValidationMap:e.consentEntityValidationMap,[_e.BOTH_CONSENT]:this._encrypt(e[_e.BOTH_CONSENT],null!=(t=this._did)?t:"",null!=(o=this._uid)?o:""),[_e.DEVICE_CONSENT]:this._encrypt(e[_e.DEVICE_CONSENT],null!=(n=this._did)?n:"",""),[_e.USER_CONSENT]:this._encrypt(e[_e.USER_CONSENT],"",null!=(i=this._uid)?i:"")}},this._updateUserInfo=(e,t)=>{this._did=e,this._uid=t},this._setConsentWebStorage=e=>{const t=this._encryptConsentStorage(e);window[this._storageName].setItem(ie,JSON.stringify(t))},this.insertConsentData=(e,t,o)=>{Je.info(`[${this.name}]: insertConsentData`,{data:e,timestamp:t,userInfo:o});try{const n=this.insertDataIntoStore(e,t,o);this._setConsentWebStorage(n)}catch(e){throw Je.error(`[${this.name}]: insertConsentData - ${e.message}`,e),e}},this.insertNotificationData=(e,t,o)=>{Je.info(`[${this.name}]: insertNotificationData`,{data:e,timestamp:t,userInfo:o});try{const n=this.getNotificationStore(o);this.insertDataByStorageName(n,_e.NOTIFICATION,e,t),window[this._storageName].setItem(ae,JSON.stringify(n))}catch(e){throw Je.error(`[${this.name}]: insertNotificationData - ${e.message}`,e),e}},this.getConsentStore=e=>{var t,o;const{device_id:n="",user_id:i=""}=null!=e?e:{};let a={},r=st()(ft),s=st()(ft),l=st()(ft);try{const e=null!=(t=window[this._storageName].getItem(ie))?t:"{}",d=null!=(o=JSON.parse(e))?o:{};a=d.consentEntityValidationMap,l=this._retrieveConsentData(d,_e.BOTH_CONSENT,n,i),s=this._retrieveConsentData(d,_e.USER_CONSENT,"",i),r=this._retrieveConsentData(d,_e.DEVICE_CONSENT,n,""),this._updateUserInfo(n,i)}catch(e){Je.error(`[${this.name}]: getConsentStore - ${e.message}`,e)}const d={consentEntityValidationMap:a,[_e.DEVICE_CONSENT]:r,[_e.USER_CONSENT]:s,[_e.BOTH_CONSENT]:l};return this._setConsentWebStorage(d),d},this.getNotificationStore=e=>{var t,o;let n=st()(ft);try{const e=null!=(t=window[this._storageName].getItem(ae))?t:"{}";n=null!=(o=JSON.parse(e))?o:{}}catch(e){Je.error(`[${this.name}]: getNotificationStore - ${e.message}`,e)}return{[_e.NOTIFICATION]:n}},this.cleanConsentData=()=>{window[this._storageName].removeItem(ie)},this.cleanNotificationData=()=>{window[this._storageName].removeItem(ae)},this.clean=()=>{window[this._storageName].removeItem(ie),window[this._storageName].removeItem(ae)},this.destruct=()=>{this.clean()},this._storageName=t}_retrieveConsentData(e,t,o,n){let i=!1;const a=st()(ft);switch(t){case _e.BOTH_CONSENT:i=o===this._did&&n===this._uid;break;case _e.USER_CONSENT:i=n===this._uid;break;case _e.DEVICE_CONSENT:i=o===this._did}if(i){const i=this._decrypt(e[t],o,n);if(i)return i}return a}}class wt extends St{constructor(){super("LocalStorageWrapper",pe.localStorage)}}class jt extends St{constructor(){super("SessionStorageWrapper",pe.sessionStorage)}}const Tt={[pe.inMem]:vt,[pe.localStorage]:wt,[pe.sessionStorage]:jt};class Pt{constructor(){return Pt._instance||(Pt._instance=this),Pt._instance}init(e){Je.info("[StorageModule]: init");const{storageType:t=pe.sessionStorage}=null!=e?e:{};t&&(Object.values(pe).includes(t)||Je.error(`[StorageModule]: init - Invalid Storage Type ${t}`,{storageType:t}),this._setupStorage(t))}getRecord(e,t){return Je.info("[StorageModule]: getRecord",{key:e}),this._store.getRecord(e,t)}getRecords(e,t){return Je.info("[StorageModule]: getRecords",{keys:e}),this._store.getRecords(e,t)}getEntity(e,t){return Je.info("[StorageModule]: getEntity",{key:e}),this._store.getEntity(e,t)}getEntities(e,t){return Je.info("[StorageModule]: getEntities",{keys:e}),this._store.getEntities(e,t)}insertConsentData(e,t,o){Je.info("[StorageModule]: insertConsentData",{data:e,timestamp:t});try{this._inMemStore.insertConsentData(e,t,o),this._store.insertConsentData(e,t,o)}catch(e){e instanceof DOMException&&"QuotaExceededError"===e.name?Je.error("[StorageModule]: insertConsentData - Storage limit exceeded, switch to in mem storage",e):Je.error("[StorageModule]: insertConsentData - Error",e),this._store.destruct(),this._store=this._inMemStore}}insertNotificationData(e,t,o){Je.info("[StorageModule]: insertNotificationData",{data:e,timestamp:t});try{this._inMemStore.insertNotificationData(e,t,o),this._store.insertNotificationData(e,t,o)}catch(e){e instanceof DOMException&&"QuotaExceededError"===e.name?Je.error("[StorageModule]: insertNotificationData - Storage limit exceeded, switch to in mem storage",e):Je.error("[StorageModule]: insertNotificationData - Error",e),this._store.destruct(),this._store=this._inMemStore}}_checkStorage(e){return Je.info("[StorageModule]: checkStorage",{storageType:e}),e===pe.inMem||!("undefined"==typeof window||!window[e])}_setupStorage(e){if(Je.info("[StorageModule]: setupStorage",{storageType:e}),this._inMemStore=new vt,e&&this._checkStorage(e)){const t=Tt[e];this._store=new t}else this._checkStorage(pe.sessionStorage)?this._store=new jt:this._checkStorage(pe.localStorage)?this._store=new wt:this._store=this._inMemStore}clean(){Je.info("[StorageModule]: clean"),this._store&&this._store.clean(),this._inMemStore&&this._inMemStore.clean()}destruct(){Je.info("[StorageModule]: destruct"),this.clean()}}var Et,Mt,Lt,At,It,Rt,Ft,Ot,Dt,Ht,Ut,Nt,Bt,$t,zt,Wt,Gt=new Pt,Vt=class{constructor(){this.userInfo={}}init(e){Je.info("[BaseInfoModule]: init")}getUserInfo(){return Je.info("[BaseInfoModule]: getUserInfo"),this.userInfo}setUserInfo(e){Je.info("[BaseInfoModule]: setUserInfo"),this.userInfo=e}fetchUserInfo(){return Je.info("[BaseInfoModule]: fetchUserInfo"),Promise.resolve({})}},Kt=class{getName(){return this.constructor.name}getLifeCycleEvents(){return Object.values(ce).filter((e=>"function"==typeof(null==this?void 0:this[e])))}},qt=Object.defineProperty,Zt=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Qt=(e,t,o)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;const Xt=Object.keys(ce).reduce(((e,t)=>(e[ce[t]]={},e)),{});Et=ce.beforeFetchUserInfo,Mt=ce.afterFetchUserInfo,Lt=ce.beforeFetchConsentData,At=ce.afterFetchConsentData,It=ce.beforeFetchNotificationData,Rt=ce.afterFetchNotificationData,Ft=ce.beforeUpdateRecords,Ot=ce.afterUpdateRecords,Dt=ce.beforeNotify,Ht=ce.afterNotify,Ut=ce.beforeRemoveNotification,Nt=ce.afterRemoveNotification,Bt=ce.beforeThirdPartyApprove,$t=ce.afterThirdPartyApprove,zt=ce.beforeThirdPartyReject,Wt=ce.afterThirdPartyReject;var eo=class extends Kt{constructor(){super(...arguments),this.addEventListener=(e,t,o)=>{var n,i;Je.info("[DefaultEventPlugin]: addEventListener"),(null==(i=null==(n=this._registeredCallbackMap)?void 0:n[e])?void 0:i[t])?Je.error("[DefaultEventPlugin]: addEventListener - id for this event callback has been used"):this._registeredCallbackMap[e][t]=o},this.removeEventListener=(e,t)=>{var o,n;Je.info("[DefaultEventPlugin]: removeEventListener"),(null==(n=null==(o=this._registeredCallbackMap)?void 0:o[e])?void 0:n[t])&&delete this._registeredCallbackMap[e][t]},this[Et]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.beforeFetchUserInfo}`),this._triggerEvent(ce.beforeFetchUserInfo,e)},this[Mt]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.afterFetchUserInfo}`),this._triggerEvent(ce.afterFetchUserInfo,e)},this[Lt]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.beforeFetchConsentData}`),this._triggerEvent(ce.beforeFetchConsentData,e)},this[At]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.afterFetchConsentData}`),this._triggerEvent(ce.afterFetchConsentData,e)},this[It]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.beforeFetchNotificationData}`),this._triggerEvent(ce.beforeFetchNotificationData,e)},this[Rt]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.afterFetchNotificationData}`),this._triggerEvent(ce.afterFetchNotificationData,e)},this[Ft]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.beforeUpdateRecords}`),this._triggerEvent(ce.beforeUpdateRecords,e)},this[Ot]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.afterUpdateRecords}`),this._triggerEvent(ce.afterUpdateRecords,e)},this[Dt]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.beforeNotify}`),this._triggerEvent(ce.beforeNotify,e)},this[Ht]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.afterNotify}`),this._triggerEvent(ce.afterNotify,e)},this[Ut]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.beforeRemoveNotification}`),this._triggerEvent(ce.beforeRemoveNotification,e)},this[Nt]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.afterRemoveNotification}`),this._triggerEvent(ce.afterRemoveNotification,e)},this[Bt]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.beforeThirdPartyApprove}`),this._triggerEvent(ce.beforeThirdPartyApprove,e)},this[$t]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.afterThirdPartyApprove}`),this._triggerEvent(ce.afterThirdPartyApprove,e)},this[zt]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.beforeThirdPartyReject}`),this._triggerEvent(ce.beforeThirdPartyReject,e)},this[Wt]=e=>{Je.info(`[DefaultEventPlugin]: ${ce.afterThirdPartyReject}`),this._triggerEvent(ce.afterThirdPartyReject,e)},this.destruct=()=>{Object.keys(ce).forEach((e=>{const t=ce[e];Object.keys(this._registeredCallbackMap[t]).forEach((e=>{delete this._registeredCallbackMap[t][e]})),this._registeredCallbackMap[t]={}}))}}init(){this._registeredCallbackMap=st()(Xt)}_triggerEvent(e,t){return o=this,n=function*(){Je.info("[DefaultEventPlugin]: triggerEvent");const o=[];Object.values(this._registeredCallbackMap[e]).forEach((e=>{if("function"==typeof e){const n=t,{plugin:i}=n,a=((e,t)=>{var o={};for(var n in e)Jt.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&Zt)for(var n of Zt(e))t.indexOf(n)<0&&Yt.call(e,n)&&(o[n]=e[n]);return o})(n,["plugin"]);o.push(e(((e,t)=>{for(var o in t||(t={}))Jt.call(t,o)&&Qt(e,o,t[o]);if(Zt)for(var o of Zt(t))Yt.call(t,o)&&Qt(e,o,t[o]);return e})({plugin:i},st()(a))))}}));try{yield Promise.all(o)}catch(e){Je.warn("[DefaultEventPlugin]: plugin callback error",e)}},new Promise(((e,t)=>{var i=e=>{try{r(n.next(e))}catch(e){t(e)}},a=e=>{try{r(n.throw(e))}catch(e){t(e)}},r=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,a);r((n=n.apply(o,null)).next())}));var o,n}},to=o(42411),oo=o.n(to),no=Object.defineProperty,io=Object.defineProperties,ao=Object.getOwnPropertyDescriptors,ro=Object.getOwnPropertySymbols,so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable,co=(e,t,o)=>t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,po=(e,t)=>{for(var o in t||(t={}))so.call(t,o)&&co(e,o,t[o]);if(ro)for(var o of ro(t))lo.call(t,o)&&co(e,o,t[o]);return e},uo=(e,t)=>io(e,ao(t));const go={fetch:{pageSize:100,version:fe.V2},update:{pageSize:100,version:fe.V2}};var ho=class{constructor(){this.destruct=()=>{Je.info("[ConsentModule]: destruct")}}init(e){Je.info("[ConsentModule]: init");const{api:t}=null!=e?e:{},{consent:o}=null!=t?t:{};this._config=dt()({},o,go)}getRecord(e,t){return Je.info("[ConsentModule]: getRecord",{entityKey:e,userInfo:t}),Gt.getRecord(e,t)}getEntity(e,t){return Je.info("[ConsentModule]: getEntity",{entityKey:e,userInfo:t}),Gt.getEntity(e,t)}getRecords(e,t){return Je.info("[ConsentModule]: getRecords",{entityKeys:e,userInfo:t}),Gt.getRecords(e,t)}getEntities(e,t){return Je.info("[ConsentModule]: getEntities",{entityKeys:e,userInfo:t}),Gt.getEntities(e,t)}getEntitiesWithApprovedRecord(e,t){return Je.info("[ConsentModule]: getEntitiesWithApprovedRecord",{entityKeys:e,userInfo:t}),Gt.getEntities(e,t).filter((e=>{var t;return(null==(t=null==e?void 0:e.record)?void 0:t.status)===ge.APPROVE}))}shouldFetch(){return Je.info("[ConsentModule]: shouldFetch"),!0}_fetchWithPagination(e,t,o,n,i,a,r,s,l){return at.sendRequest(`${o}/consent/api/combine/list/${i}`,n,{entity_keys:e,page_size:a,page_token:null!=s?s:""},uo(po({},l),{timeout:r,params:po({},t)}))}fetch(e,t){var o;Je.info("[ConsentModule]: fetch");let n={};n="function"==typeof(null==(o=this._config)?void 0:o.fetch)?this._config.fetch():this._config.fetch;const{version:i,pageSize:a,timeout:r,domain:s="",requestConfig:l}=n,d=i===fe.V1?"GET":"POST",c={data:{},pageSize:a};let p=(new Date).getTime();const u=oo()(e,a).map((e=>this._fetchWithPagination(e,t,s,d,i,a,r,"",l).then((e=>{var t,o,n;const{entities:i,data:a,status_code:r,extra:s}=null!=(t=null==e?void 0:e.data)?t:{},l=null!=(o=null!=i?i:a)?o:[];if(0===r&&l&&s){const e=null==(n=null==l?void 0:l.reduce)?void 0:n.call(l,((e,t)=>{const{key:o}=null!=t?t:{};return o&&(e[o]=t),e}),{});c.data=po(po({},c.data),e),p{Je.error("[ConsentModule]: fetch - fail to fetch",e)}))));return Promise.all(u).then((e=>{var o;return Gt.insertConsentData(null!=(o=c.data)?o:{},p,t),c})).catch((e=>{Je.error("[ConsentModule]: fetch - fail to fetch",e)}))}updateRecords(e,t){var o;if(0===(null==e?void 0:e.length))return Je.error("[ConsentModule]: updateRecords - invalid params",{params:e}),Promise.reject(new Error("[ConsentModule]: updateRecords - invalid params"));Je.info("[ConsentModule]: updateRecords");let n={};n="function"==typeof(null==(o=this._config)?void 0:o.update)?this._config.update():this._config.update;const{version:i,domain:a="",timeout:r,requestConfig:s}=n;if(i===fe.V1){const t="[ConsentModule]: updateRecords - v1 api is not supported anymore";return Je.error(t,{version:i,params:e}),Promise.reject(new Error(t))}return at.sendRequest(`${a}/consent/api/record/create/sync/${i}`,"POST",((e,t)=>{var o;return{consent_records:null!=(o=null==t?void 0:t.filter((e=>null==e?void 0:e.key)).map((e=>po({entity_key:e.key,flow:e.businessFlow,status:he[e.status]},e.extra?{extra:e.extra}:{}))))?o:[]}})(0,e),uo(po({},null!=s?s:{}),{timeout:r,params:po({},t)})).then((o=>{var n,a,r,s;const l=((e,t)=>new Set(null==t?void 0:t.filter((e=>null==e?void 0:e.key)).map((e=>e.key))))(0,e),{consent_record_ids:d,data:c={},status_code:p,extra:u}=null!=(n=null==o?void 0:o.data)?n:{};let g={};const h=null!=(a=null!=d?d:Object.keys(null!=c?c:{}))?a:[];return 0===p?(g=null==(r=null==h?void 0:h.reduce)?void 0:r.call(h,((e,o)=>{const n=i===fe.V1?o:c[o],a=i===fe.V1?n.entity_key:o,r=null!=n?n:{},{record_id:s="",created_at:d,business_flow:p,status:g}=r,h=((e,t)=>{var o={};for(var n in e)so.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&ro)for(var n of ro(e))t.indexOf(n)<0&&lo.call(e,n)&&(o[n]=e[n]);return o})(r,["record_id","created_at","business_flow","status"]);if(a){l.delete(a);const o=this.getEntity(a,t);e[a]=uo(po({},o),{record:po({id:s,entity_key:a,status:g,created_at:null!=d?d:u.now,business_flow:p},h)})}return e}),{}),Gt.insertConsentData(g,u.now,t),Je.reportCUJ(be.UPDATE_RECORD,ye.PY.FINISH,{data:g?null==(s=Object.keys(g))?void 0:s.map((e=>{var t,o;return{key:e,status:null==(o=null==(t=g[e])?void 0:t.record)?void 0:o.status}})):[]})):(Je.reportCUJ(be.UPDATE_RECORD,ye.PY.FAILURE,{error:new Error("[ConsentModule]: updateRecords - invalid response")}),Je.error("[ConsentModule]: updateRecords - invalid response",{statusCode:p})),l.size&&(Je.reportCUJ(be.UPDATE_RECORD,ye.PY.FAILURE,{error:new Error("[ConsentModule]: updateRecords - fail to create records for certain entities")}),Je.info("[ConsentModule]: updateRecords - fail to create records for certain entities",{keys:[...l]})),g})).catch((e=>{throw Je.reportCUJ(be.UPDATE_RECORD,ye.PY.FAILURE,{error:e}),Je.error("[ConsentModule]: updateRecords - fail to create records",e),e}))}},mo=class{init(e){}getData(){return null}shouldNotify(e){return!0}notify(e){}canNotificationBeRemoved(e){return!1}removeNotification(e){}shouldFetch(){return!0}fetch(...e){return Promise.resolve(null)}destruct(){}},_o=Object.defineProperty,fo=Object.getOwnPropertySymbols,yo=Object.prototype.hasOwnProperty,bo=Object.prototype.propertyIsEnumerable,xo=(e,t,o)=>t in e?_o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,vo=(e,t,o)=>new Promise(((n,i)=>{var a=e=>{try{s(o.next(e))}catch(e){i(e)}},r=e=>{try{s(o.throw(e))}catch(e){i(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(a,r);s((o=o.apply(e,t)).next())}));class ko{constructor(){return this._thirdPartyMap={},this._cleanUpPlugins=()=>{this._pluginsMap&&Object.keys(this._pluginsMap).forEach((e=>{const t=e,o=this._pluginsMap[t];(null==o?void 0:o.length)&&(o.forEach((e=>{var t;null==(t=null==e?void 0:e.destruct)||t.call(e)})),delete this._pluginsMap[t])})),this._defaultPlugin=null},this.dispatch=(e,t)=>vo(this,null,(function*(){var o;if(Je.info("[LifeCycleModule]: dispatch start"),this._currentEvent.has(e))return void Je.error("[LifeCycleModule]: Dispatch is already in process",{currentEvent:[...this._currentEvent],upcomingEvent:e});this._currentEvent.add(e);const n=null==(o=this._pluginsMap)?void 0:o[e],i=[];(null==n?void 0:n.length)&&n.forEach((o=>{var n;(null==o?void 0:o[e])&&"function"==typeof o[e]&&i.push(null==(n=null==o?void 0:o[e])?void 0:n.call(o,{name:e,data:st()(t),plugin:o}))}));try{yield Promise.all(i)}catch(e){Je.warn("[LifeCycleModule]: plugin callback error",e)}this._currentEvent.delete(e),Je.info("[LifeCycleModule]: dispatch finish")})),this._dispatchAfterEvent=(e,t)=>{Je.info("[LifeCycleModule]: dispatchAfterEvent"),t instanceof Promise?t.then((t=>{this.dispatch(e,t)})).catch((t=>{this.dispatch(e,t)})):this.dispatch(e,t)},this.addEventListener=(e,t,o)=>{var n;null==(n=this._defaultPlugin)||n.addEventListener(e,t,o)},this.removeEventListener=(e,t)=>{var o;null==(o=this._defaultPlugin)||o.removeEventListener(e,t)},ko._instance||(ko._instance=this),ko._instance}init(e){this._entityKeys=e.entityKeys,this._currentEvent=new Set,Je.info("[LifeCycleModule]: init"),this._initPlugins(e),this._initModules(e),this._registerThirdParties(e)}_initModules(e){var t,o;if(Je.info("[LifeCycleModule]: initModules"),this._consentModule=new ho,this._consentModule.init(e),(null==(t=null==e?void 0:e.modules)?void 0:t.notification)&&(e.modules.notification instanceof mo?(this._notificationModule=e.modules.notification,this._notificationModule.init(e)):Je.warn("[LifeCycleModule]: initModules - incorrect implementation of NotificationModule, will skip")),null==(o=null==e?void 0:e.modules)?void 0:o.info)if(e.modules.info instanceof Vt)this._infoModule=e.modules.info,this._infoModule.init(e);else{const e="[LifeCycleModule]: initModules - incorrect implementation of InfoModule";Je.error(e)}else{const e="[LifeCycleModule]: initModules - info module is required";Je.error(e)}}_initPlugins(e){var t;Je.info("[LifeCycleModule]: initPlugins"),this._cleanUpPlugins(),this._pluginsMap=Object.values(ce).reduce(((e,t)=>(e[t]=[],e)),{}),this._defaultPlugin=new eo;let o=[this._defaultPlugin];(null==(t=e.plugins)?void 0:t.length)&&(o=o.concat(e.plugins));const n=new Set;o.forEach(((e,t)=>{var o;null==(o=e.init)||o.call(e),this._registerPlugin(e,t,n)}))}_registerPlugin(e,t,o){var n,i,a;const r=null==(n=null==e?void 0:e.getName)?void 0:n.call(e);if(!r)return void Je.error(`[LifeCycleModule]: registerPlugin - Plugin on index ${t} is an invalid Plugin. Plugin should always have a unique name`,{index:t,plugin:e});if(o.has(r))return void Je.error(`[LifeCycleModule]: registerPlugin - Duplicate Plugin ${r}.`,{index:t,pluginName:r,plugin:e});if(!(e instanceof Kt))return void Je.error(`[LifeCycleModule]: registerPlugin - ${r} incorrectly implements of Plugin.`,{index:t,pluginName:r,plugin:e});Je.info(`[LifeCycleModule]: registerPlugin ${r} start`);const s=null==(a=null==(i=e.getLifeCycleEvents)?void 0:i.call(e))?void 0:a.filter((e=>e in ce));(null==s?void 0:s.length)&&s.forEach((t=>{this._pluginsMap[t].push(e)})),Je.info(`[LifeCycleModule]: registerPlugin ${r} finish`,{plugin:r,events:s})}_registerThirdParties(e){var t,o,n;Je.info("[LifeCycleModule]: registerThirdParties");const{thirdParties:i}=null!=(t=null==e?void 0:e.modules)?t:{};this._thirdPartyMap=null!=(n=null==(o=null==i?void 0:i.reduce)?void 0:o.call(i,((e,t)=>{const o=t.getRelatedEntities();for(const n of o)e[n]?e[n].push(t):e[n]=[t];return e}),{}))?n:{}}_initThirdParties(e){var t,o;if(Je.info("[LifeCycleModule]: initThirdParties"),e&&(null==(t=Object.values(e))?void 0:t.length)){const t=new Set,n=new Set;if(Object.values(e).forEach((e=>{var o;const i=null==(o=this._thirdPartyMap)?void 0:o[null==e?void 0:e.key];(null==i?void 0:i.length)&&i.forEach((e=>{if(e){const o=e.getRelatedEntities();(null==o?void 0:o.length)&&(o.forEach((e=>{t.add(e)})),n.add(e))}}))})),n.size){const e=this._getUserInfo(),i=(null!=(o=this._consentModule.getEntitiesWithApprovedRecord([...t],e))?o:[]).reduce(((e,t)=>(e[t.key]=t,e)),{});for(const e of n)e.initThirdPartyModule(i,this.dispatch,this._dispatchAfterEvent)}}}fetch(e){return Je.info("[LifeCycleModule]: fetch"),this.fetchUserInfo().then((()=>{const t=[this.shouldFetchConsentData()?this.fetchConsentData(this._entityKeys):Promise.resolve({}),this.shouldFetchNotificationData()?this.fetchNotificationData(null==e?void 0:e.notificationParam):Promise.resolve({})];return Promise.all(t).then((e=>{var t;const[o,n]=e;return o&&(null==(t=Object.keys(o))?void 0:t.length)&&this._initThirdParties(o),n&&this._triggerNotification({notificationData:n,relatedConsentEntityMap:o}),{consentData:o,notificationData:n}}))})).catch((e=>{Je.error("[LifeCycleModule]: fetch failure",e)}))}fetchUserInfo(){return vo(this,null,(function*(){var e,t,o,n;Je.info("[LifeCycleModule]: fetchUserInfo"),this.dispatch(ce.beforeFetchUserInfo);let i={};try{i=null!=(o=yield null!=(t=null==(e=this._infoModule)?void 0:e.fetchUserInfo())?t:Promise.resolve({}))?o:{},null==(n=this._infoModule)||n.setUserInfo(i)}catch(e){Je.error("[LifeCycleModule]: fetchUserInfo - error",e)}return this.dispatch(ce.afterFetchUserInfo,{userInfo:i}),i}))}_getUserInfo(){var e,t;return Je.info("[LifeCycleModule]: _getUserInfo"),null!=(t=null==(e=this._infoModule)?void 0:e.getUserInfo())?t:{}}shouldFetchConsentData(){var e,t;return Je.info("[LifeCycleModule]: shouldFetchConsentData"),null!=(t=null==(e=this._consentModule)?void 0:e.shouldFetch())&&t}fetchConsentData(e){Je.info("[LifeCycleModule]: fetchConsentData"),this.dispatch(ce.beforeFetchConsentData,{entityKeys:e});const t=this._getUserInfo();return this._consentModule.fetch(e,t).then((t=>{const{data:o}=null!=t?t:{};return this.dispatch(ce.afterFetchConsentData,{entityKeys:e,data:o}),o})).catch((t=>{Je.error("[LifeCycleModule]: fetchConsentData failure",t),this.dispatch(ce.afterFetchConsentData,{entityKeys:e,data:null,error:t})}))}shouldFetchNotificationData(){var e,t,o;return Je.info("[LifeCycleModule]: shouldFetchNotificationData"),this._notificationModule?null!=(o=null==(t=null==(e=this._notificationModule)?void 0:e.shouldFetch)?void 0:t.call(e))&&o:(Je.info("[LifeCycleModule]: no notification module"),!1)}fetchNotificationData(...e){var t,o;return Je.info("[LifeCycleModule]: fetchNotificationData"),this._notificationModule?(this.dispatch(ce.beforeFetchNotificationData,{notificationParams:e}),null==(o=null==(t=this._notificationModule)?void 0:t.fetch)?void 0:o.call(t,...e).then((t=>{const{data:o}=null!=t?t:{};return this.dispatch(ce.afterFetchNotificationData,{notificationParams:e,data:o}),o})).catch((t=>{Je.error("[LifeCycleModule]: fetchNotificationData failure",t),this.dispatch(ce.afterFetchNotificationData,{notificationParams:e,data:null,error:t})}))):(Je.info("[LifeCycleModule]: no notification module"),Promise.resolve(null))}getConsentRecord(e){Je.info("[LifeCycleModule]: getConsentRecord",{entityKey:e});const t=this._getUserInfo();return this._consentModule.getRecord(e,t)}getConsentEntity(e){Je.info("[LifeCycleModule]: getConsentEntity",{entityKey:e});const t=this._getUserInfo();return this._consentModule.getEntity(e,t)}getConsentRecords(e){var t;Je.info("[LifeCycleModule]: getConsentRecords",{entityKeys:e});const o=this._getUserInfo();return null!=(t=this._consentModule.getRecords(e,o))?t:[]}getConsentEntities(e){Je.info("[LifeCycleModule]: getConsentEntities",{entityKeys:e});const t=this._getUserInfo();return this._consentModule.getEntities(e,t)}updateConsentRecords(e){return vo(this,null,(function*(){Je.info("[LifeCycleModule]: updateConsentRecords",{params:e}),this.dispatch(ce.beforeUpdateRecords,{params:e});let t={};const o=this._getUserInfo();try{t=yield this._consentModule.updateRecords(e,o),this.dispatch(ce.afterUpdateRecords,{data:t})}catch(t){Je.error("[LifeCycleModule]: updateConsentRecords",t),this.dispatch(ce.afterUpdateRecords,{params:e,data:null,error:t})}return this._initThirdParties(t),t}))}getNotificationData(){return Je.info("[LifeCycleModule]: getNotificationData"),this._notificationModule?this._notificationModule.getData():(Je.info("[LifeCycleModule]: no notification module"),null)}removeNotification(e){if(Je.info("[LifeCycleModule]: removeNotification"),!this._notificationModule)return void Je.info("[LifeCycleModule]: no notification module");if(!this._notificationModule.canNotificationBeRemoved(e))return;this.dispatch(ce.beforeRemoveNotification,e);const t=this._notificationModule.removeNotification(e);this._dispatchAfterEvent(ce.afterRemoveNotification,t)}notify(e){var t,o=e,{relatedEntityKeys:n=[]}=o,i=((e,t)=>{var o={};for(var n in e)yo.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&fo)for(var n of fo(e))t.indexOf(n)<0&&bo.call(e,n)&&(o[n]=e[n]);return o})(o,["relatedEntityKeys"]);if(Je.info("[LifeCycleModule]: notify"),!this._notificationModule)return void Je.info("[LifeCycleModule]: no notification module");const a=(null!=(t=this.getConsentEntities(n))?t:[]).reduce(((e,t)=>(t&&(e[t.key]=t),e)),{});this._triggerNotification(((e,t)=>{for(var o in t||(t={}))yo.call(t,o)&&xo(e,o,t[o]);if(fo)for(var o of fo(t))bo.call(t,o)&&xo(e,o,t[o]);return e})({relatedEntityKeys:n,notificationData:this.getNotificationData(),relatedConsentEntityMap:a},i))}_triggerNotification(e){if(Je.info("[LifeCycleModule]: triggerNotification"),!this._notificationModule)return void Je.info("[LifeCycleModule]: no notification module");if(!this._notificationModule.shouldNotify(e))return;this.dispatch(ce.beforeNotify,e);const t=this._notificationModule.notify(e);this._dispatchAfterEvent(ce.afterNotify,t)}destruct(){this._cleanUpPlugins(),Je.info("[LifeCycleModule]: destruct")}}var Co=new ko,So=(e,t,o)=>new Promise(((n,i)=>{var a=e=>{try{s(o.next(e))}catch(e){i(e)}},r=e=>{try{s(o.throw(e))}catch(e){i(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(a,r);s((o=o.apply(e,t)).next())}));const wo={appId:-1,domain:"",entityKeys:[],mode:le.PRODUCTION,isPPE:!1,debug:!1,fetchDataAtInit:!0,region:se.SINGAPORE_CENTRAL,storageType:pe.sessionStorage,modules:{info:new Vt}};class jo{constructor(){return this._isInitialized=!1,this._validateInitStatus=()=>!!this._isInitialized||(console.error("[SDK]: SDK is used before init"),!1),this.getConsentRecord=e=>{if(!this._validateInitStatus())return null;Je.reportCUJ(be.GET_RECORD,ye.PY.START);try{Je.info("[SDK]: getConsentRecord",{entityKey:e});const t=Co.getConsentRecord(e);return Je.reportCUJ(be.GET_RECORD,ye.PY.FINISH),t}catch(e){return Je.reportCUJ(be.GET_RECORD,ye.PY.FAILURE,{error:e}),null}},this.getConsentRecords=e=>{if(!this._validateInitStatus())return[];Je.reportCUJ(be.GET_RECORDS,ye.PY.START);try{Je.info("[SDK]: getConsentRecords",{entityKeys:e});const t=Co.getConsentRecords(e);return Je.reportCUJ(be.GET_RECORDS,ye.PY.FINISH),t}catch(e){return Je.reportCUJ(be.GET_RECORDS,ye.PY.FAILURE,{error:e}),[]}},this.getConsentEntity=e=>{if(!this._validateInitStatus())return null;Je.reportCUJ(be.GET_ENTITY,ye.PY.START);try{Je.info("[SDK]: getConsentEntity",{entityKey:e});const t=Co.getConsentEntity(e);return Je.reportCUJ(be.GET_ENTITY,ye.PY.FINISH),t}catch(e){return Je.reportCUJ(be.GET_ENTITY,ye.PY.FAILURE,{error:e}),null}},this.getConsentEntities=e=>{if(!this._validateInitStatus())return[];Je.reportCUJ(be.GET_ENTITIES,ye.PY.START);try{Je.info("[SDK]: getConsentEntities",{entityKeys:e});const t=Co.getConsentEntities(e);return Je.reportCUJ(be.GET_ENTITIES,ye.PY.FINISH),t}catch(e){return Je.reportCUJ(be.GET_ENTITIES,ye.PY.FAILURE,{error:e}),[]}},this.updateConsentRecords=e=>So(this,null,(function*(){if(!this._validateInitStatus())return Promise.resolve();Je.reportCUJ(be.UPDATE_RECORD,ye.PY.START,{data:e});try{return Je.info("[SDK]: updateConsentRecords",{params:e}),yield Co.updateConsentRecords(e)}catch(e){throw Je.reportCUJ(be.UPDATE_RECORD,ye.PY.FAILURE,{error:e}),e}})),this.removeNotification=e=>{this._validateInitStatus()&&(Je.info("[SDK]: removeNotification",{arg:e}),Co.removeNotification(e))},this.notify=e=>{this._validateInitStatus()&&(Je.info("[SDK]: notify",{arg:e}),Co.notify(e))},this.fetch=e=>So(this,null,(function*(){if(!this._validateInitStatus())return Promise.resolve();Je.reportCUJ(be.FETCH_DATA,ye.PY.START);try{Je.info("[SDK]: fetch",{arg:e});const t=yield Co.fetch(e);return Je.reportCUJ(be.FETCH_DATA,ye.PY.FINISH),t}catch(e){throw Je.reportCUJ(be.FETCH_DATA,ye.PY.FAILURE,{error:e}),e}})),this.refresh=e=>this._validateInitStatus()?(Je.info("[SDK]: refresh",{arg:e}),Co.fetch(e)):Promise.resolve(),this.addEventListener=(e,t,o)=>{if(this._validateInitStatus()){if(Je.reportCUJ(be.SUBSCRIBE_EVENT,ye.PY.START),Je.info("[SDK]: addEventListener"),!e||!ce[e]||!t||"function"!=typeof o){const e="[SDK]: addEventListener - invalid param for adding new event listener",t=new Error(e);return Je.error(e,t),void Je.reportCUJ(be.SUBSCRIBE_EVENT,ye.PY.FAILURE,{error:t})}try{Co.addEventListener(e,t,o),Je.reportCUJ(be.SUBSCRIBE_EVENT,ye.PY.FINISH)}catch(e){Je.reportCUJ(be.SUBSCRIBE_EVENT,ye.PY.FAILURE,{error:e})}}},this.removeEventListener=(e,t)=>{if(this._validateInitStatus()){Je.reportCUJ(be.UNSUBSCRIBE_EVENT,ye.PY.START),Je.info("[SDK]: removeEventListener");try{Co.removeEventListener(e,t),Je.reportCUJ(be.UNSUBSCRIBE_EVENT,ye.PY.FINISH)}catch(e){Je.reportCUJ(be.UNSUBSCRIBE_EVENT,ye.PY.FAILURE,{error:e})}}},this.destruct=()=>{Je.info("[SDK]: destruct"),Co.destruct(),at.destruct(),Gt.destruct(),Je.destruct(),this._isInitialized=!1},jo._instance||(jo._instance=this),jo._instance}init(e){return So(this,null,(function*(){if("undefined"==typeof window)return console.warn("ConsentClientFrameworkSDK can not be init on server"),Promise.resolve();if(this._isInitialized)throw new Error("ConsentClientFrameworkSDK has been initialized");const t=dt()({},e,wo),{debug:o,fetchDataAtInit:n}=t;o&&(window.consentSDK=this,window.consentSDK.storage=Gt),Je.init(t),Je.reportCUJ(be.SDK_INIT,ye.PY.START);try{if(Je.info("[SDK]: init global module"),at.init(t),Gt.init(t),Je.info("[SDK]: init life cycle"),Co.init(t),this._isInitialized=!0,n){Je.reportCUJ(be.FETCH_DATA,ye.PY.START);const e=yield Co.fetch();return Je.reportCUJ(be.FETCH_DATA,ye.PY.FINISH),Je.reportCUJ(be.SDK_INIT,ye.PY.FINISH),e}return Je.reportCUJ(be.SDK_INIT,ye.PY.FINISH),Promise.resolve()}catch(e){throw Je.reportCUJ(be.SDK_INIT,ye.PY.FAILURE,{error:e}),e}}))}isInitialized(){return Je.info("[SDK]: isInitialized"),this._isInitialized}}var To=new jo,Po=class{init(e,t){}isInitialized(){return!1}approve(e){}reject(e){}shouldDestructAfterReject(){return!0}destruct(){}},Eo=(e=>(e.ad_storage="ad_storage",e.ad_user_data="ad_user_data",e.ad_personalization="ad_personalization",e.analytics_storage="analytics_storage",e.functionality_storage="functionality_storage",e.personalization_storage="personalization_storage",e.security_storage="security_storage",e))(Eo||{});function Mo(...e){window.dataLayer.push(arguments)}const Lo=["ad_storage","analytics_storage","ad_user_data","ad_personalization"];(class extends Po{constructor(e){super(),this._isInitialized=!1,this._waitForUpdate=0;const{availableFields:t,waitForUpdate:o}=null!=e?e:{};this._availableFieldSet=new Set(null!=t?t:Lo),this._waitForUpdate=null!=o?o:0}init(e,t){Je.info("[GoogleModeModule]: init",{isApproved:t,consentEntityMap:e}),"undefined"==typeof window||this._isInitialized||(this._isInitialized=!0,window.dataLayer=window.dataLayer||[],t?this._defaultGrantAll():this._defaultDenyAll())}isInitialized(){return this._isInitialized}approve(e){Je.info("[GoogleModeModule]: approve",{consentEntityMap:e}),this._updateGrantAll()}reject(e){Je.info("[GoogleModeModule]: reject",{consentEntityMap:e}),this._updateDenyAll()}shouldDestructAfterReject(){return Je.info("[GoogleModeModule]: shouldDestructAfterReject"),!1}destruct(){Je.info("[GoogleModeModule]: destruct"),window.dataLayer=[],this._isInitialized=!1}_getGTagParam(e){const t={};for(const o of this._availableFieldSet)Eo[o]&&(t[o]=e);return this._waitForUpdate&&(t.wait_for_update=this._waitForUpdate),t}_defaultGrantAll(){Je.info("[GoogleModeModule]: defaultGrantAll"),Mo("consent","default",this._getGTagParam("granted"))}_defaultDenyAll(){Je.info("[GoogleModeModule]: defaultDenyAll"),Mo("consent","default",this._getGTagParam("denied"))}_updateGrantAll(){Je.info("[GoogleModeModule]: updateGrantAll"),Mo("consent","update",this._getGTagParam("granted"))}_updateDenyAll(){Je.info("[GoogleModeModule]: updateDenyAll"),Mo("consent","update",this._getGTagParam("denied"))}}).canBeInitBeforeApprove=!0;var Ao,Io=To,Ro=o(64431);!function(e){e.PP="conditions-policy-privacy-policy",e.TOS="conditions-policy-terms-of-service",e.MARKET="conditions-policy-consent-to-collection-and-use-of-your-personal-information-for-marketing-purposes"}(Ao||(Ao={}));const Fo="signup-consent-webapp";class Oo extends Vt{constructor(e,t){super(),this.uid=e,this.wid=t}init(e){}fetchUserInfo(){return Promise.resolve({user_id:this.uid,device_id:this.wid})}}class Do{static getInstance(e,t,o){return Do.instance||(Do.instance=new Do(e,t,o)),Do.instance}constructor(e,t,o){const{vregion:n}=(0,Ro.c)();this.region=o;const i=["conditions-policy-privacy-policy","conditions-policy-terms-of-service"];"KR"===o.toUpperCase()&&i.push("conditions-policy-consent-to-collection-and-use-of-your-personal-information-for-marketing-purposes"),Io.init({domain:"https://www.tiktok.com",appId:1988,entityKeys:i,debug:!1,modules:{info:new Oo(e,t)},region:"-"===n?void 0:n,bid:"tiktok_webapp_signup_flow"}).catch(null)}storeConsent({consentToMarket:e}){var t;return(0,n.__awaiter)(this,void 0,void 0,(function*(){const o=[{key:"conditions-policy-privacy-policy",status:ge.APPROVE,businessFlow:Fo},{key:"conditions-policy-terms-of-service",status:ge.APPROVE,businessFlow:Fo}];"KR"===(null===(t=this.region)||void 0===t?void 0:t.toUpperCase())&&o.push({key:"conditions-policy-consent-to-collection-and-use-of-your-personal-information-for-marketing-purposes",status:e?ge.APPROVE:ge.REJECT,businessFlow:Fo}),yield Io.updateConsentRecords(o)}))}}var Ho,Uo=o(94337),No=o(22784),Bo=o(92246),$o=o(64319);!function(e){e.Third="Third",e.Phone="Phone"}(Ho||(Ho={}));let zo=class extends i.E{constructor(e,t,o,n,i,a,r,s,l,d,c,p,u){super(),this.service=e,this.policy=t,this.registerPrivateAccount=o,this.ageGate=n,this.accountService=i,this.loginReport=a,this.loginSlardar=r,this.contextModule=s,this.t=l,this.regionService=d,this.history=c,this.riskError=p,this.appContext=u,this.defaultState={username:"",signupLoading:!1,regionList:[],initializedTTPConfig:!1,consentToMarket:!1,hasStoredConsent:!1}}setSuccess(e){e.success=!0}setInitializedTTPConfig(e){e.initializedTTPConfig=!0}setEmailConsent(e,t){e.emailConsent=t}setErrorMsg(e,t){e.errorMsg=t}setLoading(e,t){e.signupLoading=t}setCheckNameLoading(e,t){e.checkNameLoading=t}setUsername(e,t){e.username=t}setUsernameInfo(e,t){e.usernameInfo=t}setFromNotRegisterLogin(e,t){e.fromNotRegisterLogin=t}cacheSmsCodeKey(e,t){e.phoneNotRegistered=t,e.fromNotRegisterLogin="Phone"}cacheThirdNotRegistered(e,t){e.thirdPlatformNotRegistered=t,e.fromNotRegisterLogin="Third"}clearSignUpResult(e){e.errorMsg=""}setNewUserRegion(e,t){var o,n;e.region=Object.assign(Object.assign({},t),{enabledRegionOption:null!==(n=null===(o=e.region)||void 0===o?void 0:o.enabledRegionOption)&&void 0!==n&&n}),this.accountService.setOverrideRegionCode(t.countryCode)}setRegion(e,t){e.region={countryCode:t.store_region,localizedCountryName:t.localized_country_name,enabledRegionOption:t.enabled_region_option}}setRegionList(e,t){e.regionList=t.flatMap((e=>({countryCode:e.country_code,localizedCountryName:e.localized_country_name})))}setHasUserSelectedRegion(e,t){e.hasUserSelectedRegion=t}setUserSelectedRegion(e,t){e.userSelectedRegion=t}setKRMarketingConsent(e,t){e.consentToMarket=t}setHasStoredConsent(e,t){e.hasStoredConsent=t}registerThirdPlatform(e){return e.pipe((0,I.E)(this.ageGate.state$),(0,u.Z)((([{platform:e,profileKey:t,rrc:o,ageCheckDone:n,region:i},{ageGateAction:a,birthday:r}])=>0===a||n?this.accountService.thirdLogin({platform_app_id:$.iU[e],platform:e,profile_key:t,rrc:o,login_only:!1,birthday:r}).pipe((0,m.T)((t=>(t.fromThird=!0,this.loginReport.setPlatform(e),this.loginSlardar.setPlatform(e),t.platform=e,t.region=i,this.getActions().handleSignupResult(t)))),(0,R.Z)(this.getActions().setLoading(!0)),(0,F.q)(this.getActions().setLoading(!1))):(this.navigateToNextPageWithSSOOpenModal(M.tH.signupAgeGate),(0,h.of)(this.getActions().cacheThirdNotRegistered({platform:e,profileKey:t}))))))}registerPhone(e){return e.pipe((0,H.M)((()=>{this.reportLoginSubmit("sms_verification")})),(0,I.E)(this.state$,this.ageGate.state$),(0,u.Z)((([{ageCheckDone:e,region:t},{phoneNotRegistered:o},{ageGateAction:n,birthday:i}])=>{var a,r;return n&&!e?(this.history.push(M.tH.signupAgeGate),(0,h.of)(this.noop())):this.accountService.smsLoginContinue({mobile:null!==(a=null==o?void 0:o.mobile)&&void 0!==a?a:"",sms_code_key:null!==(r=null==o?void 0:o.smsCodeKey)&&void 0!==r?r:"",extra_params:{birthday:i}}).pipe((0,m.T)((e=>(e.platform="sms_verification",e.region=t,this.getActions().handleSignupResult(e)))),(0,R.Z)(this.getActions().setLoading(!0)),(0,F.q)(this.getActions().setLoading(!1)))})))}storeConsent(e){return e.pipe((0,I.E)(this.state$),(0,u.Z)((([{region:e,user_id_str:t},{consentToMarket:o,hasStoredConsent:n}])=>{var i,a,r;if(n)return(0,h.of)(this.noop());const s=((e,t,o)=>Do.getInstance(e,t,o))((null===(a=null===(i=this.appContext.state.appContext)||void 0===i?void 0:i.user)||void 0===a?void 0:a.uid)||t||"-1",(null===(r=this.appContext.state.appContext)||void 0===r?void 0:r.wid)||"-1",e),l="KR"===e.toUpperCase();return(0,g.p)([l&&o?this.service.storeMarketConsentInPopup():(0,h.of)(null),(0,O.H)(s.storeConsent({consentToMarket:o}).then((()=>this.getActions().setHasStoredConsent(!0))).catch(null))]).pipe((0,m.T)((()=>this.noop())))})))}syncUserInfos(e){return e.pipe((0,I.E)(this.state$,this.appContext.state$),(0,u.Z)((([{fromThird:e,fromEmail:t,fromFTC:o,region:n},{emailConsent:i},{appContext:a}])=>{var r,s;return(0,g.p)([this.policy.syncKrPolicyApprove(n),this.syncEmailConsent(i),this.registerPrivateAccount.getIsRegisterPrivateAccount(),"v1"===(null===(s=null===(r=null==a?void 0:a.abTestVersion)||void 0===r?void 0:r.parameters.login_itp_resolve)||void 0===s?void 0:s.vid)?this.accountService.refreshSession():(0,h.of)(null)]).pipe((0,D.n)((n=>{const[,,i]=n,a=e||t?M.tH.signupCreateUsername:M.tH.signupCreatePassword;return o||this.navigateToNextPageWithSSOOpenModal(a),(0,h.of)(this.getActions().setLoading(!1),this.registerPrivateAccount.getActions().setIsRegisterWithPrivateOn(i),o?this.getActions().setSuccess():this.noop())})))})))}validateUsername(e){return e.pipe((0,u.Z)((({name:e,fromThird:t})=>e?this.service.validateUsername(e).pipe((0,u.Z)((o=>{const{status_code:n,recommended_unique_ids:i,is_valid:a,status_msg:r}=o,s=!a&&t?null==i?void 0:i[0]:e;return t&&!s?(0,h.of)(this.noop()):(0,h.of)(this.getActions().setUsernameInfo({value:s,isValid:a,suggestList:i,errorMsg:t?"":(0,V.V)(n,Boolean(i),r)}))})),(0,R.Z)(this.getActions().setCheckNameLoading(!0)),(0,F.q)(this.getActions().setCheckNameLoading(!1))):(0,h.of)(this.getActions().setUsernameInfo(void 0)))))}validateFTCUsername(e){return e.pipe((0,U.w)("name"),(0,N.B)(300),(0,D.n)((({name:e})=>e?this.accountService.validateFTCUsername(e).pipe((0,m.T)((t=>{const{login_name:o,error_code:n}=t,i=(0===n||void 0===n)&&Boolean(o);return this.getActions().setUsernameInfo({value:e,isValid:i,errorMsg:i?"":"common_registration_username_error_ sensitivity"})})),(0,R.Z)(this.getActions().setCheckNameLoading(!0)),(0,F.q)(this.getActions().setCheckNameLoading(!1))):(0,h.of)(this.getActions().setUsernameInfo(void 0)))))}usernameRegister(e){return e.pipe((0,H.M)((()=>{this.reportLoginSubmit("handle")})),(0,I.E)(this.state$,this.ageGate.state$),(0,u.Z)((([{password:e,region:t},{username:o},{birthday:n}])=>this.accountService.usernameRegister({password:e,username:o,extra_params:{birthday:n}}).pipe((0,m.T)((e=>(e.fromFTC=!0,e.region=t,this.getActions().handleSignupResult(e)))),(0,R.Z)(this.getActions().setLoading(!0)),(0,F.q)(this.getActions().setLoading(!1))))))}emailRegister(e){return e.pipe((0,I.E)(this.ageGate.state$,this.state$),(0,H.M)((([,,{emailConsent:e}])=>{this.reportLoginSubmit("email"),L.H.rigisterClickNext(void 0===e?{}:{status:e?"checked":"unchecked",text_type:"long_version"})})),(0,u.Z)((([{password:e,code:t,email:o,region:n},{birthday:i}])=>this.accountService.emailRegister({password:e,code:t,email:o,ifLogin:!0,extra_params:{birthday:i,email_logic_type:e?2:1}}).pipe((0,m.T)((e=>(e.fromEmail=!0,e.region=n,this.getActions().handleSignupResult(e)))),(0,R.Z)(this.getActions().setLoading(!0)),(0,F.q)(this.getActions().setLoading(!1))))))}fetchStoreRegion(e){var t,o;const n=null!==(o=null===(t=this.appContext.state.appContext)||void 0===t?void 0:t.region)&&void 0!==o?o:"";return e.pipe((0,u.Z)((()=>this.regionService.fetchUserStoreRegion().pipe((0,H.M)((e=>{this.loginReport.setSignUpRegionSourceParams({region_source:0,origin_region:null==e?void 0:e.store_region})})),(0,m.T)((e=>{var t,o,i;return this.getActions().setRegion({store_region:null!==(t=null==e?void 0:e.store_region)&&void 0!==t?t:n,localized_country_name:null!==(o=null==e?void 0:e.localized_country_name)&&void 0!==o?o:n,enabled_region_option:null!==(i=null==e?void 0:e.enabled_region_option)&&void 0!==i&&i})}))))))}fetchRegionList(e){return e.pipe((0,u.Z)((()=>this.regionService.fetchUserRegionList().pipe((0,m.T)((e=>"string"==typeof e?((0,K.P)(e),console.error(`Login: Fetch region list error: ${e}.`),this.getActions().setRegionList([])):e?this.getActions().setRegionList(e):this.getActions().setRegionList([])))))))}handleSignupResult(e){return e.pipe((0,u.Z)((e=>{const{error_code:t,errorMsg:o,description:n,error_msg:i,fromThird:a,fromFTC:r,fromEmail:s,name:p,screen_name:u,sec_user_id:g,default_error_msg:m,region:_,user_id_str:f}=e,y=c.nf.getTrackingInfo(),b=e.platform||this.loginReport.platform;if(!t)return(0,l.Y)(d.H.WebappFreshSignup).setLocalStorage(!0),this.loginReport.loginSuccess({signUp:!0,is_register:1,e2eInfo:y}),this.loginSlardar.loginSuccess({signUp:!0}),c.nf.saveLoginSuccessInfo({teaPlatform:b,isSignUp:!0}),this.regionService.authBroadcast({screen_name:u,sec_uid:g}).pipe((0,B.H)((()=>(0,h.of)(this.contextModule.getActions().setContext({lastSuccessPlatform:b}),this.getActions().syncUserInfos({fromThird:a,fromEmail:s,fromFTC:r,region:String(_)}),this.getActions().storeConsent({region:String(_),user_id_str:f}),a?this.getActions().validateUsername({name:p,fromThird:a}):this.noop()))));const x=o||i||n||m;return this.loginReport.loginFailure({error_code:t,signUp:!0,e2eInfo:y}),this.loginSlardar.loginFailure({errorCode:t,signUp:!0,errorMsg:x}),(0,V.X)(t)?(0,h.of)(this.riskError.getActions().handleRiskError({errorCode:t})):a?((0,K.P)(this.t(x)),console.error(`Login: Third-party signup error: ${x}.`),(0,h.of)(this.noop())):(0,h.of)(this.getActions().setErrorMsg(x))})))}syncEmailConsent(e){return e?this.service.syncEmailConsentInfo().pipe((0,m.T)((()=>(0,h.of)(null))),(0,_.W)((e=>(console.error(e),(0,h.of)({status_code:-1}))))):(0,h.of)(null)}navigateToNextPageWithSSOOpenModal(e){var t;if((null===(t=this.history.location())||void 0===t?void 0:t.pathname)===M.tH.loginSSO)return this.service.setRedirectNewModalPage(e);this.history.push(e)}reportLoginSubmit(e){const t=c.nf.getTrackingInfo();this.loginReport.setPlatform(e),this.loginReport.loginSubmit({signUp:!0,e2eInfo:t}),this.loginSlardar.setPlatform(e),this.loginSlardar.loginSubmit({signUp:!0})}};(0,n.__decorate)([(0,a.uk)(),(0,n.__metadata)("design:type",y.c)],zo.prototype,"dispose$",void 0),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setSuccess",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setInitializedTTPConfig",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setEmailConsent",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setErrorMsg",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setLoading",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setCheckNameLoading",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setUsername",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setUsernameInfo",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,String]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setFromNotRegisterLogin",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"cacheSmsCodeKey",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"cacheThirdNotRegistered",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"clearSignUpResult",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setNewUserRegion",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setRegion",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Array]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setRegionList",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setHasUserSelectedRegion",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Object]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setUserSelectedRegion",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setKRMarketingConsent",null),(0,n.__decorate)([(0,a.h5)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[Object,Boolean]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"setHasStoredConsent",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"registerThirdPlatform",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"registerPhone",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"storeConsent",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"syncUserInfos",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"validateUsername",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"validateFTCUsername",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"usernameRegister",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"emailRegister",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"fetchStoreRegion",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"fetchRegionList",null),(0,n.__decorate)([(0,a.Mj)(),(0,n.__metadata)("design:type",Function),(0,n.__metadata)("design:paramtypes",[y.c]),(0,n.__metadata)("design:returntype",void 0)],zo.prototype,"handleSignupResult",null),zo=(0,n.__decorate)([(0,r.n)("SignupModule"),(0,n.__param)(8,(0,s.y)(p.hp)),(0,n.__metadata)("design:paramtypes",[Bo.q,j,T.S,P.T,G.r,A.$F,Uo.le,$o.t,Function,z.d,W.D,No.S,E.L])],zo)},92246:(e,t,o)=>{o.d(t,{q:()=>c});var n=o(58632),i=o(7672),a=o(49343),r=o.n(a),s=o(20259),l=o(23999),d=o(55099);let c=class{constructor(e){this.fetch=e}setRedirectNewModalPage(e){this.redirectNewModalPage=e}validateUsername(e){return this.fetch.get("/api/uniqueid/check/",{query:{unique_id:e,fromWeb:1,aid:1988},baseUrlType:2}).pipe(this.errorHandler)}syncEmailConsentInfo(){return this.fetch.post("/api/privacy/agreement/record/agree/v1",{body:r().stringify({record_name:"email_consent",tt_csrf_token:this.fetch.csrfToken||"IQodDvCCo34LIXpe5ArEKd-S"}),baseUrlType:2})}storeMarketConsentInPopup(){return this.fetch.post("/api/policy/notice/approve/",{body:r().stringify({business:"kr_consent_market_message",operation:2,policy_version:"v20200906",style:"pop"})})}errorHandler(e){return e.pipe((0,s.W)((e=>(0,l.of)(Object.assign({error_code:e.error_code||-1},e)))))}};c=(0,n.__decorate)([(0,i._)(),(0,n.__metadata)("design:paramtypes",[d.p])],c)},65504:(e,t,o)=>{o.d(t,{D:()=>a});var n=o(58632),i=o(7672);let a=class{init(e){this.history=e}push(e,t){var o;null===(o=this.history)||void 0===o||o.push(e,t)}location(){var e;return null===(e=this.history)||void 0===e?void 0:e.location}};a=(0,n.__decorate)([(0,i._)()],a)},10707:(e,t,o)=>{o.d(t,{H:()=>i,_:()=>n});const n=e=>e.replace(/\+/g,"-").replace(/\//g,"_"),i=e=>e.replace(/-/g,"+").replace(/_/g,"/")},77156:(e,t,o)=>{o.d(t,{$L:()=>i,Ro:()=>a,lY:()=>n,nP:()=>r});const n=e=>{if(!e)return{};if(e.length>50)return{hasInvalid:!1,contentValid:!0,lengthValid:!1};const t=/[^\w~!@#$%^&*()+,.:;=<>?/|\-[\]\\]+/,o=/[_~!@#$%^&*()+,.:;=<>?/|\-[\]\\]+/.test(e)&&/[0-9]+/.test(e)&&/[A-Za-z]+/.test(e)&&!t.test(e),n=e.length>=8&&e.length<=20;return{hasInvalid:t.test(e),lengthValid:n,contentValid:o}},i=e=>Boolean(e&&(6!==e.length||/[^\d]+/.test(e))),a=e=>!(e.length>320)&&/^\w+([.\-+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,8})+\s*$/.test(e),r=e=>0{o.d(t,{P:()=>i});var n=o(11983);const i=(e,t=3)=>{n.F.destroy(),n.F.open({content:e,duration:t,widthType:"half",style:{minWidth:"300px"}})}},23301:(e,t,o)=>{o.d(t,{V:()=>n,X:()=>i});const n=(e,t,o)=>{switch(e){case 1027:case 3250:return"common_registration_username_error_format";case 3251:return"common_registration_username_error_short";case 3252:return"common_registration_username_error_long";case 3253:return"common_registration_username_error_period";case 3254:return"common_registration_username_error_number";case 1024:case 1028:return"common_registration_username_error_ sensitivity";case 0:return;default:return null!=o?o:t?"common_registration_username_error_occupied":"common_registration_username_error_ sensitivity"}},i=e=>-1!==[1340,1341].indexOf(e)||-1!==[2025,2031,2046].indexOf(e)||-1!==[1357,1384].indexOf(e)},89570:(e,t,o)=>{o.d(t,{Fq:()=>d,Jc:()=>s,WQ:()=>l,pq:()=>g,qs:()=>c});var n=o(35267),i=o(60951);let a;const r=[{regex:"WhatsApp(?:[ /]([\\d.]+))?",browserName:"Whatsapp"},{regex:"(?:MessengerForiOS|MESSENGER|FB_IAB/Orca-Android).(?:FBAV)(?:[ /]([\\d.]+))?",browserName:"Messenger"}],s=()=>{var e;if(void 0===a){const t=(()=>{const{userAgent:e}=(0,n.T6)();for(const{regex:t,browserName:o}of r)if(e.match(t))return o;return new i.UAParser(e).getBrowser().name})();a=null!==(e=null==t?void 0:t.toLowerCase().replace(" ","_"))&&void 0!==e?e:"$OTHERS"}return a},l=["facebook","instagram","messenger","whatsapp"],d=["chrome","chrome_mobile","mobile_chrome"],c=["samsung_internet","line","opera","opera_mobi","opera_touch","opera_mini","yandex"],p=[...l,"edge","firefox","firefox_mobile","mobile_firefox","vivo_browser"],u=[...d,...c,...p],g=(new Set(u),"one_tap_use_ios_deep_link")},93427:(e,t,o)=>{o.d(t,{$H:()=>a,M3:()=>s,ik:()=>d,l6:()=>l,lw:()=>r});var n=o(53702),i=o(75792);const a=e=>e.startsWith(i.tH.signupHome),r=e=>e.startsWith(i.tH.linkPhoneOrEmail),s=(e,t,o="")=>{var a;const r=`https://www.tiktok.com/foryou?lang=${e}`,{pathname:s,href:l}=location,d=s.startsWith(i.tH.loginHome)||s.startsWith(i.tH.signupHome)||s.startsWith(i.tH.oauth)||s.startsWith(i.tH.logout)||s.startsWith(i.tH.accountDeactivate)||s.startsWith(i.tH.linkPhoneOrEmail)?r:l,c=(e=>{try{return new URL(e),e}catch(t){return decodeURIComponent(e)}})((0,n.Jf)(o)),p=c.match(location.origin)&&"/"===(null===(a=new URL(c))||void 0===a?void 0:a.pathname),u=[/^https?:\/\/([\w\-.]+?\.)?tiktok\.(com|in)(\/.*)?$/,/^https:\/\/seller\.tiktokglobalshop\.com\//,/^https:\/\/business\.tiktokshop\.com(\/.*)?/].some((e=>new RegExp(e).test(c)))||t&&[/^https:\/\/seller-boe\.byteintl\.net\//,/^https?:\/\/([\w\-.]+?\.)?bytedance\.net(\/.*)?$/].some((e=>new RegExp(e).test(c)));return p?r:u&&c?c:d},l=1e3,d=(e,t,o)=>{const n=s(e,t,o);setTimeout((()=>{location.href=n}),l)}},9450:(e,t,o)=>{o.d(t,{r:()=>i});var n=o(10707);function i(e,t){var o;let i={};try{i=JSON.parse(null!==(o=atob((0,n.H)(decodeURIComponent(e.state))))&&void 0!==o?o:"{}")}catch(e){console.warn(e)}return t.reduce(((t,o)=>{var n;return t[o]=null!==(n=e[o])&&void 0!==n?n:i[o],t}),{})}},56441:(e,t,o)=>{o.d(t,{o:()=>r,_:()=>a});var n=o(58305);const i="sms_code_count_down",a=(e,t,o)=>{(0,n.J2)(`${i}${o?"_email":""}_${e}`,`${Date.now()+1e3*t}`)},r=(e,t=!1)=>{const o=(0,n.Hd)(`${i}${t?"_email":""}_${e}`),a=Number(o)-Date.now();return"number"!=typeof a||a<0?{hasSent:Boolean(o),countDownSecond:0}:{hasSent:Boolean(o),countDownSecond:Math.round(a/1e3)}}},85997:(e,t,o)=>{o.d(t,{jA:()=>s});var n,i,a,r=o(93608);!function(e){e.Apple="apple",e.Amazon="amazon",e.Google="google",e.Download="download",e.Microsoft="microsoft"}(n||(n={})),function(e){e.Notify="download_app_notify",e.Confirm="download_app_confirm",e.Dismiss="download_app_dismiss",e.ClickAppStore="click_app_store",e.SwipeUpGuideShow="swipe_up_guide_show",e.SwipeUpGuideClose="swipe_up_guide_close"}(i||(i={})),function(e){e.XClose="x_close",e.ClickMask="click_mask",e.NotNow="not_now"}(a||(a={}));const s={handleClickAppStore:e=>{r.f.sendEvent("click_app_store",{channel:e,enter_from:"webapp_download_modal"})},handleDownloadShow:e=>{r.f.sendEvent("download_app_notify",e)},handleDownloadConfirm:e=>{r.f.sendEvent("download_app_confirm",e)},handleDownloadDismiss:e=>{r.f.sendEvent("download_app_dismiss",e)},handleNewUserGuideShow:e=>{r.f.sendEvent("swipe_up_guide_show",e)},handleNewUserGuideClose:e=>{r.f.sendEvent("swipe_up_guide_close",e)},tapDownloadConfirm:e=>{r.f.event("tap",Object.assign(Object.assign({},e),{duration:performance.now()})),window.__COIN_ACTIVITY_TAP_PARAMS&&r.f.event("luckycat_click_download",window.__COIN_ACTIVITY_TAP_PARAMS)}}},80596:(e,t,o)=>{o.d(t,{H:()=>i});var n=o(93608);const i={showEmailConsent:()=>{n.f.sendEvent("show_button_consent_check_box",{page_name:"email_signup_page",exp_name:"onboarding_collect_email_consent",text_type:"long_version"})},clickEmailConsent:e=>{n.f.sendEvent("clikc_button_consent_check_box",{page_name:"email_signup_page",exp_name:"onboarding_collect_email_consent",text_type:"long_version",status:e.checked?"checked":"unchecked"})},rigisterClickNext:e=>{n.f.sendEvent("register_click_next",e)}}},52401:(e,t,o)=>{o.d(t,{S:()=>a,z:()=>i});var n=o(93608);const i={logout:e=>{n.f.sendEvent("monitor_logout",e)},logoutNotify:e=>{n.f.sendEvent("logout_notify",e)},logoutSubmit:e=>{n.f.sendEvent("logout_submit",e)},logoutCancel:e=>{n.f.sendEvent("logout_cancel",e)},clickLogout:e=>{n.f.sendEvent("click_logout",e)}};class a{constructor(e){this.getCommonTrackingInfo=e}report(e,t){const o=this.getCommonTrackingInfo?Object.assign(Object.assign({},this.getCommonTrackingInfo()),t):t;n.f.sendEvent(e,o)}logoutNotify(e){this.report("logout_notify",e)}logoutSubmit(e){this.report("logout_submit",e)}logoutCancel(e){this.report("logout_cancel",e)}logout(e){this.report("monitor_logout",e)}clickLogout(e){this.report("click_logout",e)}}},3247:(e,t,o)=>{o.d(t,{u:()=>a});var n,i=o(93608);!function(e){e.Popup="launch_popup",e.Modal="jump_to_pwa",e.Jump="jump"}(n||(n={}));const a={jump:(e={})=>{i.f.sendEvent("jump",e)},jumpSchemeStart:(e={})=>{i.f.sendEvent("jump_schema_start",e)},jumpCheck:(e={})=>{i.f.sendEvent("jump_check",e)},groupPopupClick:()=>{i.f.sendEvent("jump_window_click",{click_position:"jump"})},downloadApk:()=>{i.f.sendEvent("apk_download_click")}}},78016:(e,t,o)=>{o.d(t,{K:()=>p});var n=o(58632),i=o(24643),a=o(40099),r=o(45446),s=o(62186);const l=({theme:e,buttonTheme:t})=>{switch(t){case"default":return{borderWidth:"1px",borderStyle:"solid",borderRadius:"2px",color:e.colors.TextPrimary,borderColor:e.colors.LineSecondary2,backgroundColor:e.colors.BGTertiary2,":disabled":{borderColor:"rgb(227, 227, 229)",backgroundColor:e.colors.BGPrimary2,color:e.colors.TextQuaternary}};case"primary":return{borderRadius:"2px",border:"none",color:e.colors.ConstTextInverse,backgroundColor:e.colors.Primary,":disabled":{border:"none",color:e.colors.TextQuaternary,backgroundColor:e.colors.BGInput2}};default:return{":disabled":{}}}},d={large:{minWidth:"248px",minHeight:"44px",fontSize:"15px",lineHeight:"18px",fontWeight:700},medium:{minWidth:"144px",height:"35px",fontSize:"14px",lineHeight:"17px",fontWeight:700},small:{minWidth:"88px",height:"28px",fontSize:"14px",lineHeight:"17px",fontWeight:700},tiny:{minWidth:"74px",minHeight:"24px",fontSize:"13px",lineHeight:"17px",fontWeight:600}},c=(0,s.default)("button",{target:"e5u1qxo0"})((({buttonTheme:e="default",size:t="medium",theme:o,loading:n=!1})=>[l({theme:o,buttonTheme:e}),d[t],{display:"flex",position:"relative",alignItems:"center",justifyContent:"center",padding:"6px 8px",userSelect:"none",cursor:"pointer",boxSizing:"border-box",fontFamily:"TikTokFont, PingFangSC, sans-serif",":focus":{outline:"none"}},Object.assign({},n?{color:"transparent",pointerEvents:"none"}:{})]),"label:Button;"),p=(0,a.memo)((function(e){var{buttonTheme:t,size:o,type:a="button",loading:s=!1,loadingTheme:l="primary",loadingSize:d="medium",children:p}=e,u=(0,n.__rest)(e,["buttonTheme","size","type","loading","loadingTheme","loadingSize","children"]);return(0,i.jsxs)(c,Object.assign({type:a,buttonTheme:t,loading:s,size:o},u,{children:[p,s&&(0,i.jsx)(r.h,{style:{position:"absolute"},theme:l,size:d})]}))}))},44205:(e,t,o)=>{o.d(t,{l:()=>b});var n=o(24643),i=o(40099),a=o(17784),r=o(21380),s=o(73635),l=o(18499),d=o(62186);const c=(0,d.default)("div",{target:"e1dsngob0"})({position:"fixed",left:0,right:0,top:0,bottom:0,overflow:"hidden",userSelect:"none",pointerEvents:"none"},(({zIndex:e})=>({zIndex:e})),"label:DivContainer;"),p=(0,d.default)("div",{target:"e1dsngob1"})({pointerEvents:"auto",position:"absolute",left:0,top:0,bottom:0,right:0,background:"rgba(0, 0, 0, 0.5)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.06)",transition:"opacity 0.3s"},(({status:e})=>({opacity:e===a.kp||e===a.ze||e===a.ns?0:1})),"label:DivMask;"),u=(0,d.default)("div",{target:"e1dsngob2"})({pointerEvents:"auto",position:"absolute",left:0,bottom:0,width:"100%",background:"#fff",borderRadius:"12px 12px 0 0",maxHeight:"73vh",transition:"transform 0.3s"},(({status:e})=>({transform:e===a.ze||e===a.kp||e===a.ns?"translateY(100%)":"none"})),"label:DivBodyWrapper;"),g=(0,d.default)("div",{target:"e1dsngob3"})({padding:"16px 20px 20px"},"label:DivContentWrapper;"),h=(0,d.default)("div",{target:"e1dsngob4"})({position:"absolute",top:"16px",width:"24px",height:"24px",zIndex:1,display:"flex",justifyContent:"center",alignItems:"center"},(({theme:e})=>({["rtl"===e.direction?"left":"right"]:"16px"})),"label:DivCloseWrapper;"),m=(0,d.default)("div",{target:"e1dsngob5"})({position:"absolute",top:"16px",width:"24px",height:"24px",zIndex:1,display:"flex",justifyContent:"center",alignItems:"center"},(({theme:e})=>({["rtl"===e.direction?"right":"left"]:"16px"})),"label:DivExtraAction;"),_=(0,d.default)("div",{target:"e1dsngob6"})((({theme:e})=>({padding:"16px 20px",borderBottom:`0.5px solid ${e.colors.LinePrimary}`,display:"flex",justifyContent:"center",alignItems:"center"})),"label:DivHeaderWrapper;"),f=(0,d.default)("div",{target:"e1dsngob7"})({display:"flex"},"label:DivTuxCloseIconWrapper;");var y;!function(e){e.Icon="icon",e.Mask="mask"}(y||(y={}));const b=(0,i.memo)((function(e){const{mask:t=!0,maskClosable:o=!0,onClickMask:d,closeable:y=!0,visible:b=!1,style:x,containerStyle:v,maskStyle:k,needTouchEvents:C=!0,zIndex:S=3001,onClose:w,direction:j,header:T,children:P,contentStyle:E,extraAction:M,bodyE2E:L,e2eTag:A,closeStyle:I,shouldUseTux:R=!1,headerStyle:F={},xAxisTouchOptimization:O=!1,supportSSR:D=!1,bodyTimeout:H=300}=e,[U,N]=(0,i.useState)(D);(0,i.useEffect)((()=>{N(!0)}),[]);const B=(0,i.useRef)(null),$=(0,i.useRef)(null),z=(0,i.useRef)(),W=(0,i.useCallback)((e=>{z.current=e.targetTouches[0].clientY}),[]),G=(0,i.useCallback)((e=>{var t,o;if(!(null===(t=$.current)||void 0===t?void 0:t.contains(e.target)))return e.stopPropagation(),void e.preventDefault();const n=e.targetTouches[0].clientY-(null!==(o=z.current)&&void 0!==o?o:0),i=$.current,a=O?-5:0,r=O?5:0;return i&&Math.abs(i.scrollHeight-i.clientHeight-i.scrollTop)<1&&nr?e.preventDefault():void 0}),[]);(0,i.useEffect)((()=>{if(C)return b&&(document.addEventListener("touchstart",W),document.addEventListener("touchmove",G,{passive:!1})),()=>{document.removeEventListener("touchstart",W),document.removeEventListener("touchmove",G)}}),[b,G,W,C]);const V=(0,i.useCallback)((e=>{o&&(null==w||w(e,"mask")),null==d||d(e)}),[o,w]),K=(0,i.useCallback)((e=>{y&&(null==w||w(e,"icon"))}),[y,w]);if(!U)return null;const q=(0,n.jsx)(a.Ay,Object.assign({timeout:300,in:b,nodeRef:B,mountOnEnter:!0,unmountOnExit:!0,onExited:e.onExitEnd},{children:e=>(0,n.jsxs)(c,Object.assign({style:v,zIndex:S,ref:B,status:e},{children:[t&&(0,n.jsx)(p,{status:e,style:k,onClick:V}),(0,n.jsx)(a.Ay,Object.assign({appear:!0,timeout:H,in:b,unmountOnExit:!0},{children:e=>(0,n.jsxs)(u,Object.assign({"data-e2e":L,status:e,style:x},{children:[Boolean(T)&&(0,n.jsx)(_,Object.assign({style:F},{children:T})),y&&(0,n.jsx)(h,Object.assign({direction:j,onClick:K,style:I},{children:R?(0,n.jsx)(f,Object.assign({e2eTag:A},{children:(0,n.jsx)(r.h,{size:24})})):(0,n.jsx)(s.A,{e2eTag:A,style:{width:"100%",height:"100%"}})})),M&&(0,n.jsx)(m,Object.assign({direction:j},{children:M})),(0,n.jsx)(g,Object.assign({style:Object.assign({overflow:"auto"},E),header:Boolean(T),ref:$},{children:P}))]}))}))]}))}));return D?q:(0,l.createPortal)(q,document.body)}))},1452:(e,t,o)=>{e.exports=o.p+"c287bca871661e22ee8a.png"},93981:(e,t,o)=>{e.exports=o.p+"47624c235266dedd8e4d.png"}}]);