AdsTargetingLocationTypeaheadFunctionalComponent",["cx","fbt","AMSearchTrigger.react","ASAAudienceLocationUtils","AbstractTypeahead.react","AdsApplicationUtils","AdsCommonTargetingApiTransformer","AdsInterfacesLogger","AdsLocationActions","AdsLocationBulkInputShowDialogFromTypeaheadDataAction","AdsLocationBulkInputShowNuxDataAction","AdsLocationSearchSource","AdsLocationTypeaheadPasteDialog.react","AdsPathLink","AdsTargetingAccountControlInfoLocationUtils","AdsTargetingAudienceEditorGKSelectors","AdsTargetingBrowseTreeSelectEntryDataAction","AdsTargetingDMAToComscoreMigrationUtils","AdsTargetingIncludeExcludeSelector","AdsTargetingLocationDataTransformer","AdsTargetingLocationIncludeExcludeButton.react","AdsTargetingLocationLoggingEvents","AdsTargetingLocationNux","AdsTargetingLocationTypeaheadBusyIndicator","AdsTargetingLocationTypeaheadPresenter","AdsTargetingLocationTypeaheadSearchBox.react","AdsTargetingTypeaheadScenarioHelper","AutomatedShoppingAdsStrings","DOMQuery","FBLogger","GeoIcon.react","GeoLink.react","GeoSpinner.react","Keys","LocationConstants","Promise","QPLUserFlow","Random","ReactDOM_DEPRECATED","ReactInputSelection","SimpleNUXMessage","XUIContextualDialog.react","XUIContextualDialogBody.react","XUIError.react","adsTargetingLocationAreSameLatLng","adsTargetingLocationFetchSuggestedRadiusOrDefault","adsTargetingLocationGetExcludedEntriesFromLocations","adsTargetingLocationRemoveCommonLocations","adsTargetingLocationRemoveDuplicates","adsTargetingLocationSendTypeaheadLog","cr:11144","emptyFunction","geoMargin","intlList","meta-brand-circle-handle-filled-16","nullthrows","promiseDone","qpl","react"],(function(t,n,r,o,a,i,l,s,u){"use strict";var e,c,d=c||(c=o("react")),m=c,p=m.useCallback,_=m.useEffect,f=m.useRef,g=m.useState,h=100,y=50,C=5,b=1,v=1,S=/[ ]/g,R="523608931147539",L=3e4,E=95,k=450,I="/business/help/285255905140138";function T(t){var a=g(""),l=a[0],s=a[1],c=g(null),m=c[0],T=c[1],D=g(null),x=D[0],$=D[1],P=g(null),N=P[0],M=P[1],w=g(null),A=w[0],F=w[1],O=g(null),B=O[0],W=O[1],q=g(!1),U=q[0],V=q[1],H=g(0),G=H[0],z=H[1],j=f(null),K=f(null),Q=f(null),X=g(0),Y=X[0],J=X[1],Z=g(0),ee=Z[0],te=Z[1],ne=f(null),re=g(0),oe=re[0],ae=re[1],ie=t.disabledLocationTypeahead,le=ie===void 0?!1:ie,se=t.excludedGeoLocations,ue=se===void 0?{}:se,ce=t.isAdAccountBusinessConstraintsExclusion,de=ce===void 0?!1:ce,me=t.searchSourceOptions,pe=me===void 0?{allowedCountryList:[],disallowedCountryList:[],disallowedLocationExclusionTypes:new Set,disallowedLocationTypes:new Set}:me,_e=t.onlyInclusion,fe=_e===void 0?!1:_e,ge=t.variantIndex,he=ge===void 0?null:ge,ye=t.onAddLocationModeChange,Ce=ye===void 0?r("emptyFunction"):ye,be=t.onFocusTypeahead,ve=be===void 0?r("emptyFunction"):be,Se=t.onSelectAttempt,Re=Se===void 0?r("emptyFunction"):Se,Le=t.addLocationMode,Ee=t.geoLocations,ke=t.onMultiSelectAttempt,Ie=g(!1),Te=Ie[0],De=Ie[1],xe=g(""),$e=xe[0],Pe=xe[1],Ne=g(!1),Me=Ne[0],we=Ne[1],Ae=g(!1),Fe=Ae[0],Oe=Ae[1],Be=g(!1),We=Be[0],qe=Be[1],Ue="all",Ve=g(!1),He=Ve[0],Ge=Ve[1],ze=g(!1),je=ze[0],Ke=ze[1],Qe=g(!1),Xe=Qe[0],Ye=Qe[1],Je=g(""),Ze=Je[0],et=Je[1],tt=g(0),nt=tt[0],rt=tt[1],ot=function(){var e=Q.current,t=e!=null&&e.offsetWidth>0?e.offsetWidth:k;rt(t)},at=function(){return t.shouldShowNuxTooltip?d.jsx(r("AdsTargetingLocationNux"),{contextRef:qt},"nux"):null},it=function(){if(Xe)return d.jsx(r("AdsTargetingLocationTypeaheadBusyIndicator"),{ref:K,children:u._(/*BTDS*/"Validating address")});if(je)return d.jsx("div",{ref:K,children:d.jsxs("div",{className:"_35b6",children:[d.jsx(r("GeoSpinner.react"),{shade:"dark",size:"small",loggingName:i.id}),d.jsx("span",{className:"_35b7 mls",children:u._(/*BTDS*/"Adding locations")})]})});var e=st(),n=r("AdsLocationSearchSource").getInstance(),a=r("AdsTargetingLocationTypeaheadPresenter");a.extraRendererProps={onRenderEntryProps:t.audienceControlMetaData!=null?function(e){return o("AdsTargetingAccountControlInfoLocationUtils").getAccountControlInfoLocationEntryProps(t.addLocationMode,t.audienceControlMetaData,e,t.accountID,t.enableASAStateInclusions)}:null,dao:t.dao,isTargetingYouthByAge:t.isTargetingYouthByAge,allowedAudienceGroups:t.allowedAudienceGroups,youthAdsAgeCutoff:t.youthAdsAgeCutoff,isFDS:!0,isTargetingOnlyYouth:t.isTargetingOnlyYouth,maxAge:t.maxAge};var l=Me,s=null;Fe?s=d.jsxs("div",{children:[d.jsx("div",{children:u._(/*BTDS*/"Address not found.")}),d.jsx("div",{children:u._(/*BTDS*/"- check the spelling of the address")}),d.jsx("div",{children:u._(/*BTDS*/"- make sure you include a real street address, city, state or country")}),d.jsx("div",{children:u._(/*BTDS*/"- drop a pin on the map instead of searching")})]}):We&&(s=d.jsxs("div",{children:[d.jsx("div",{children:u._(/*BTDS*/"Duplicate address found.")}),d.jsx("div",{children:u._(/*BTDS*/"- check the addresses you have already added")}),d.jsx("div",{children:u._(/*BTDS*/"- drop a pin on the map instead of searching")})]}));var c=null,m=o("AdsTargetingAudienceEditorGKSelectors").passGeoLocationUplift();!fe&&!de&&(c=m?d.jsx(r("AdsTargetingLocationIncludeExcludeButton.react"),{isDisabled:t.disabledIncludeExcludeSelector,mode:t.addLocationMode,onChangeMode:St}):d.jsx(r("AdsTargetingIncludeExcludeSelector"),{className:"_438w",isDisabled:t.disabledIncludeExcludeSelector,mode:t.addLocationMode,showDropIcon:!0,onBlur:yt,onChangeMode:St,onFocus:Ct}));var p=d.jsx(r("GeoIcon.react"),{icon:o("meta-brand-circle-handle-filled-16").metaBrandCircleHandleFilled16,xstyle:[{minWidth:"16px"},r("geoMargin").end12]}),_=babelHelpers.extends({},pe,{disallowedLocationTypes:Wt(),selectedLocationType:Ue,enableGeoSearchFrictionImprovements:!0,adAccountID:t.accountID}),f=d.jsx(o("AdsPathLink").Activatable,{onActivate:lt,children:d.jsx(r("XUIError.react"),{xuiError:s,xuiErrorPosition:"below",children:d.jsx(r("AMSearchTrigger.react"),{callsite:i.id,disabled:!o("AdsApplicationUtils").isPowerEditor(),interaction:"am.edit_targeting.search_targeting_typeahead",overrideTrackingSurface:"am.editor_typeahead.targeting_location",onBlur:bt,onChange:Dt,children:function(i,l){return d.jsx(r("AbstractTypeahead.react"),babelHelpers.extends({autoHighlight:!0,disabled:le,excludedEntries:gt(),hideViewWithEntries:!0,inputLeftChild:p},m?{inputStyle:{fontSize:"14px"}}:{},{inputStyles:{label:babelHelpers.extends({display:"flex",alignItems:"center"},m?{}:{marginTop:"2px"})},placeholder:e,presenter:a,queryString:Ze,ref:K,searchSource:n,searchSourceOptions:_,selectOnTab:!0,selectedEntry:void 0,onAddBrowseEntryAttempt:mt,onBlur:l,onChange:i,onClick:t.onClick,onEntriesFound:ht,onFocus:vt,onKeyDown:xt,onPaste:$t,onSelectAttempt:Rt}))}})})});return m?d.jsx(r("AdsTargetingLocationTypeaheadSearchBox.react"),{enableMap:t.enableMap,isMapCollapsed:t.isMapCollapsed,locationPicker:pt(),modeSelector:c,searchInputBox:d.jsx("div",{className:"_438x",children:f}),tooManyLocations:t.tooManyLocations,typeaheadRootRef:Q,updateMapCollapseState:t.updateMapCollapseState,variant:t.typeaheadSearchBoxVariant}):d.jsxs("div",{className:"_438u"+(l?" _438v":"")+(Fe?" _7bo":"")+(We?" _3x2j":""),children:[c,d.jsx("div",{className:"_438x","data-testid":void 0,ref:Q,children:d.jsxs("div",{className:"_60xf",children:[f,pt()]})})]})},lt=function(){var e;(e=K.current)==null||e.focusInput()},st=function(){return t.enableASAStateInclusions===!0?o("AutomatedShoppingAdsStrings").INCLUDED_LOCATIONS_TOKENIZER_TYPEAHEAD_PLACEHOLDER_TEXT:u._(/*BTDS*/"Search locations")},ut=function(){Ge(!0)},ct=function(){Ge(!1)},dt=function(){if(!t.hideTip&&!Te&&(Me||He)&&Ze===""){var e=function(){return K.current},n=nt-E;return d.jsx("span",{onMouseEnter:ut,onMouseLeave:ct,children:d.jsx(r("XUIContextualDialog.react"),{contextRef:e,label:"targetingLocationTypeaheadTip",position:"below",shown:!0,width:n,children:d.jsx(r("XUIContextualDialogBody.react"),{children:ft()})})})}return null},mt=function(n){r("AdsTargetingBrowseTreeSelectEntryDataAction").dispatch({entry_type:n.type,id:n.id},{line:"538",module:"AdsTargetingLocationTypeaheadFunctionalComponent.js",moduleID:i.id});var e;if(n.type===r("LocationConstants").SAVED_LOCATIONS)e=r("AdsCommonTargetingApiTransformer").fromGeoLocations({geo_locations:n.geoLocations}).geoLocations;else{var a=t.enableASAStateInclusions===!0?o("ASAAudienceLocationUtils").convertToSearchableEntriesForASACampaign(n):o("AdsTargetingLocationDataTransformer").convertToSearchableEntries(n);e=o("AdsTargetingLocationDataTransformer").entriesToDataStore(a,t.addLocationMode===r("LocationConstants").INCLUDE)}t.enableASAStateInclusions===!0&&(e=o("ASAAudienceLocationUtils").adsTargetingLocationRemoveOverlappingExclusions(e,ue)),t.onMultiSelectAttempt(e,t.addLocationMode===r("LocationConstants").INCLUDE)},pt=function(){if(t.enableLocationBrowser){var e=nt-E;return d.jsx(n("cr:11144"),{accountControlInfo:t.accountControlInfo,accountID:t.accountID,addLocationMode:t.addLocationMode,audienceControlMetaData:t.audienceControlMetaData,enableASAStateInclusions:t.enableASAStateInclusions,excludedGeoLocations:ue,geoLocations:t.geoLocations,hideSavedLocations:t.hideLocationBrowserSavedLocations,rootRef:Q,safrConfig:t.safrConfig,selectedRegulatedCategory:t.selectedRegulatedCategory,shouldDisableEUCountries:t.isTargetingOnlyYouth===!0,variantIndex:he,width:e,onAddBrowseEntryAttempt:mt,onBrowseButtonMouseDown:_t,onReplaceAttempt:t.onReplaceAttempt})}return null},_t=function(){t.onBrowseButtonMouseDown&&t.onBrowseButtonMouseDown(),et(""),J(function(e){return e+1})},ft=function(){var e=u._(/*BTDS*/"DMAs");o("AdsTargetingDMAToComscoreMigrationUtils").passTargetingComscoreUISignpostingEnabled?e=u._(/*BTDS*/"DMAs, Comscore Markets"):o("AdsTargetingDMAToComscoreMigrationUtils").checkDMADeprecationAdvertiserGKEnabled()&&(e=u._(/*BTDS*/"Comscore Markets"));var n=Wt(),a=[],i=[[r("LocationConstants").COUNTRIES,u._(/*BTDS*/"countries")],[r("LocationConstants").REGIONS,u._(/*BTDS*/"state/regions")],[r("LocationConstants").CITIES,u._(/*BTDS*/"cities")],[r("LocationConstants").ZIPS,u._(/*BTDS*/"postal codes")],[r("LocationConstants").CUSTOM_LOCATIONS,u._(/*BTDS*/"addresses")],[r("LocationConstants").GEO_MARKETS,e],[r("LocationConstants").ELECTORAL_DISTRICTS,u._(/*BTDS*/"congressional districts")]];i.forEach(function(e){n.has(e[0])||a.push(e[1])});var l=d.jsx(r("GeoLink.react"),{href:I,target:"_blank",children:u._(/*BTDS*/"Learn more")}),s=t.hideAdsHelpLink?d.jsx("div",{children:u._(/*BTDS*/"You can also add worldwide or global regions.")}):d.jsx("div",{children:u._(/*BTDS*/"You can also add worldwide or global regions. {Learn More link}",[u._param("Learn More link",l)])});return d.jsx("div",{children:u._(/*BTDS*/"You can type in specific {Supported location types}. {Country group location type}",[u._param("Supported location types",r("intlList")(a,r("intlList").CONJUNCTIONS.OR)),u._param("Country group location type",n.has(r("LocationConstants").COUNTRY_GROUPS)?"":s)])})},gt=function(){var e=r("adsTargetingLocationGetExcludedEntriesFromLocations")(t.geoLocations),n=r("adsTargetingLocationGetExcludedEntriesFromLocations")(ue);return babelHelpers.extends({},e,n)},ht=function(){o("AdsApplicationUtils").isPowerEditor()&&o("AdsTargetingTypeaheadScenarioHelper").searchResultsLoaded(),W(window.setTimeout(function(){r("AdsInterfacesLogger").log({eventName:r("AdsTargetingLocationLoggingEvents").GEO_LOCATION_TYPEAHEAD_NO_INTERACTION},r("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP)},L))},yt=function(){window.clearTimeout(N),M(window.setTimeout(function(){},h))},Ct=function(){window.clearTimeout(N),ve()},bt=function(){B&&Ze!==""&&(r("AdsInterfacesLogger").log({eventName:r("AdsTargetingLocationLoggingEvents").GEO_LOCATION_ABANDONED_SEARCH},r("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP),r("adsTargetingLocationSendTypeaheadLog")({ad_account_id:t.accountID,event:r("AdsTargetingLocationLoggingEvents").ABANDONED_SEARCH,query:Ze})),r("QPLUserFlow").endCancel(r("qpl")._(1016866030,"1350"),{instanceKey:G}),Oe(!1),qe(!1),window.clearTimeout(m),window.clearTimeout(B),T(window.setTimeout(function(){U&&we(!1)},h))},vt=function(){window.clearTimeout(m),we(!0),z(o("Random").uint32()),r("QPLUserFlow").start(r("qpl")._(1016866030,"1350"),{instanceKey:G,cancelExisting:!0}),ve()},St=function(t){var e;Ce(t),(e=K.current)==null||e.focusInput()},Rt=function(t){t&&(De(!0),t.getType()===r("LocationConstants").CUSTOM_LOCATIONS&&t.getAuxiliaryData().showSearchLabel?Lt(t):Tt(t))},Lt=function(n){Ft(),Ye(!0);var e=r("AdsLocationSearchSource").getInstance(),o=n.getAuxiliaryData().matchedText;e.validateAddress(o,function(e,n,o){if(e&&r("FBLogger")("ads").warn("AdsLocationSearchSource returned error: %s",e),n&&o!=null){var a=[].concat(t.geoLocations.custom_locations||[],ue.custom_locations||[]),i=a.some(function(e){return r("adsTargetingLocationAreSameLatLng")(e,o)});i?(Ye(!1),qe(!0),te(function(e){return e+1})):r("promiseDone")(Et(o),function(e){Ye(!1),kt(babelHelpers.extends({},o,{radius:e}))})}else{var l,s;Ye(!1);var u=r("AdsTargetingLocationLoggingEvents").GEO_LOCATION_GEOCODE_FAIL,c=(l=K.current)==null||(l=l.props)==null?void 0:l.queryString;r("AdsInterfacesLogger").log({eventName:u,data:(s={},s.targeting_ui_event_data=JSON.stringify({isValid:n,geo:o,error:e}),s)},r("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP),r("adsTargetingLocationSendTypeaheadLog")({ad_account_id:t.accountID,event:u,query:c,select_entry_json:null}),Oe(!0),te(function(e){return e+1})}})},Et=function(a){return t.shouldGetSuggestedRadius?r("adsTargetingLocationFetchSuggestedRadiusOrDefault")(a):(e||(e=n("Promise"))).resolve(r("LocationConstants").RadiusInfo.getAddressDefaultRadius(t.addLocationMode===r("LocationConstants").INCLUDE))},kt=function(t){var e=o("AdsTargetingLocationDataTransformer").getSearchableEntryFromGeoCoder(t);Tt(e)},It=function(){window.clearTimeout(m),window.clearTimeout(N),window.clearTimeout(B),et(""),we(!0),window.setTimeout(function(){var e;(e=K.current)==null||e.focusInput()},h)},Tt=function(n){var e,a,i=o("AdsTargetingLocationDataTransformer").entriesToDataStore([n],t.addLocationMode===r("LocationConstants").INCLUDE,t.minRadius),u=n.getAuxiliaryData();t.onUserSelectAttempt(u),Re(i,t.addLocationMode===r("LocationConstants").INCLUDE),t.addLocationMode===r("LocationConstants").INCLUDE?a=r("AdsTargetingLocationLoggingEvents").GEO_LOCATION_SELECT:a=r("AdsTargetingLocationLoggingEvents").GEO_LOCATION_SELECT_EXCLUDE;var c=(e=K.current)==null||(e=e.props)==null?void 0:e.queryString,d=c||l||n.getTitle();r("AdsInterfacesLogger").log({eventName:a},r("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP);var m=JSON.stringify(u);r("adsTargetingLocationSendTypeaheadLog")({ad_account_id:t.accountID,event:a,query:d,select_position:n.getOrder(),select_entry_json:m}),r("QPLUserFlow").addPoint(r("qpl")._(1016866030,"1350"),"typeahead_search_select_entry",{instanceKey:G,data:{string:{query:d,selection:m},int:{select_position:n.getOrder()}}}),r("QPLUserFlow").endSuccess(r("qpl")._(1016866030,"1350"),{instanceKey:G}),s(""),It()},Dt=function(t){if(!Xe){var e=t.target.value,n=l===""&&e!=="";et(e),s(e),n&&r("AdsInterfacesLogger").log({eventName:r("AdsTargetingLocationLoggingEvents").GEO_LOCATION_START_TYPING},r("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP)}},xt=function(t){if(!Xe){window.clearTimeout(B),Oe(!1),qe(!1);var e=t.keyCode;if(e===r("Keys").ESC){var n;et(""),(n=K.current)==null||n.clearActiveEntries(),s("")}}},$t=function(n){if(!Xe){var e=Pt(n);if(t.enableBulkInput){Bt(e)?(r("AdsLocationBulkInputShowDialogFromTypeaheadDataAction").dispatch({text:e},{line:"1011",module:"AdsTargetingLocationTypeaheadFunctionalComponent.js",moduleID:i.id}),n.preventDefault()):r("SimpleNUXMessage").hasUserSeenMessage_LEGACY(R)||(r("SimpleNUXMessage").markMessageSeenByUser(R),r("AdsLocationBulkInputShowNuxDataAction").dispatch({},{line:"1020",module:"AdsTargetingLocationTypeaheadFunctionalComponent.js",moduleID:i.id}));return}if(Nt(e))$(e),Ke(!0),we(!1),j.current&&j.current.show();else return;n.preventDefault()}},Pt=function(t){var e;return((e=t.clipboardData)==null?void 0:e.getData)!=null&&typeof t.clipboardData.getData!="function"&&r("FBLogger")("ads").info("getData from clipboard is %s type instead of function. getData value is %s",typeof t.clipboardData.getData,t.clipboardData.getData),!t.clipboardData||!t.clipboardData.getData?"":t.clipboardData.getData("Text")||t.clipboardData.getData("text/plain")},Nt=function(t){var e=(t.split(/,|;/)||[]).filter(function(e){return!!e.trim()});return e.length>1},Mt=function(){Ke(!1)},wt=function(t){var e=[];switch(t){case r("LocationConstants").COUNTRIES:case r("LocationConstants").REGIONS:case r("LocationConstants").ZIPS:e=r("nullthrows")(x).split(/[,; ]/).map(function(e){return e.trim()});break;case r("LocationConstants").CITIES:case r("LocationConstants").CUSTOM_LOCATIONS:e=r("nullthrows")(x).split(/[; ]/).map(function(e){return e.trim()});break}e=e.filter(function(e){return!!e}),ne.current=e,Pe(t),ae(function(e){return e+1})},At=p(function(e,t){Ke(!1),r("AdsInterfacesLogger").log({eventName:r("AdsTargetingLocationLoggingEvents").GEO_LOCATION_COPY_PASTE},r("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP);var n=r("LocationConstants").getEmptyLocations();n[$e]=e,n=r("adsTargetingLocationRemoveDuplicates")(n),n=r("adsTargetingLocationRemoveCommonLocations")(Ee,ue,n),ke(n,Le===r("LocationConstants").INCLUDE,$e)},[ue,$e,Le,Ee,ke]),Ft=function(){var e=o("ReactDOM_DEPRECATED").findDOMNode_DEPRECATED(K.current),t=o("DOMQuery").find(e,"input");F(r("ReactInputSelection").getSelection(t))},Ot=p(function(){var e=o("ReactDOM_DEPRECATED").findDOMNode_DEPRECATED(K.current),t=o("DOMQuery").find(e,"input");t&&A&&r("ReactInputSelection").setSelection(t,A)},[A]),Bt=function(t){return t.length>=y&&(t.split(",").length-1>=C||t.split(";").length-1>=b||(t.match(S)||[]).length>=v)},Wt=p(function(){return t.addLocationMode===r("LocationConstants").INCLUDE?pe.disallowedLocationTypes:pe.disallowedLocationExclusionTypes},[t.addLocationMode,pe.disallowedLocationTypes,pe.disallowedLocationExclusionTypes]),qt=function(){return K.current||{}};_(function(){ee>0&&Ot()},[ee,Ot]),_(function(){Y>0&&o("AdsLocationActions").toggleBrowseTreeIsActive(he)},[Y,he]),_(function(){if(oe>0){var e=ne.current;if(e!=null&&$e!==""){var t=babelHelpers.extends({},pe,{disallowedLocationTypes:Wt()});r("AdsLocationSearchSource").getInstance().validate(e,$e,At,t),ne.current=null}}},[Wt,$e,At,oe,pe]),_(function(){return V(!0),ot(),function(){return V(!1)}},[]);var Ut=Wt(),Vt=!Ut.has(r("LocationConstants").CUSTOM_LOCATIONS);return d.jsxs(d.Fragment,{children:[it(),dt(),d.jsx(r("AdsLocationTypeaheadPasteDialog.react"),{allowAddress:Vt,ref:j,onDialogHide:Mt,onLocationTypeSelect:wt}),at()]})}T.displayName=T.name+" [from "+i.id+"]",T.displayName="AdsTargetingLocationTypeaheadFunctionalComponent",l.default=T}),226);
-----
AdsTargetingLocationTypeahead",["cx","fbt","ix","AMSearchTrigger.react","ASAAudienceLocationUtils","AbstractTypeahead.react","AdsApplicationUtils","AdsCommonTargetingApiTransformer","AdsInterfacesLogger","AdsLocationActions","AdsLocationBulkInputShowDialogFromTypeaheadDataAction","AdsLocationBulkInputShowNuxDataAction","AdsLocationSearchSource","AdsLocationTypeaheadPasteDialog.react","AdsPathLink","AdsTargetingAccountControlInfoLocationUtils","AdsTargetingBrowseTreeSelectEntryDataAction","AdsTargetingIncludeExcludeSelector","AdsTargetingLocationBrowseListContainer.react","AdsTargetingLocationDataTransformer","AdsTargetingLocationLoggingEvents","AdsTargetingLocationNux","AdsTargetingLocationTypeaheadBusyIndicator","AdsTargetingLocationTypeaheadPresenter","AdsTargetingLocationTypeaheadUtils","AdsTargetingTypeaheadScenarioHelper","AutomatedShoppingAdsStrings","DOMQuery","FBLogger","GeoSpinner.react","Image.react","Keys","Link.react","LocationConstants","Promise","QPLUserFlow","Random","ReactDOM_DEPRECATED","ReactInputSelection","SimpleNUXMessage","XUIContextualDialog.react","XUIContextualDialogBody.react","XUIError.react","adsTargetingLocationAreSameLatLng","adsTargetingLocationFetchSuggestedRadiusOrDefault","adsTargetingLocationGetExcludedEntriesFromLocations","adsTargetingLocationRemoveCommonLocations","adsTargetingLocationRemoveDuplicates","adsTargetingLocationSendTypeaheadLog","emptyFunction","intlList","nullthrows","promiseDone","qpl","react"],(function(a,b,c,d,e,f,g,h,i,j){"use strict";var k,l,m=l||d("react"),n=100,o=50,p=5,q=1,r=1,s=/[ ]/g,t="523608931147539",u=3e4,v=95,w=450,x="/business/help/285255905140138";a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,e;for(var g=arguments.length,h=new Array(g),i=0;i0?a.offsetWidth:w;this.setState({width:a})};g.componentDidUpdate=function(){this.$11()};g.componentDidMount=function(){this.$7=!0,this.$11()};g.componentWillUnmount=function(){this.$7=!1};g.render=function(){var a=this.$12();a=!a.has(c("LocationConstants").CUSTOM_LOCATIONS);return m.jsxs(m.Fragment,{children:[this.$13(),this.$14(),m.jsx(c("AdsLocationTypeaheadPasteDialog.react"),{allowAddress:a,ref:"pasteDialog",onDialogHide:this.$15,onLocationTypeSelect:this.$16}),this.renderLayers()]})};g.renderLayers=function(){return!this.props.shouldShowNuxTooltip?null:m.jsx(c("AdsTargetingLocationNux"),{contextRef:this.$17},"nux")};g.$13=function(){var a=this;if(this.state.isValidating)return m.jsx(c("AdsTargetingLocationTypeaheadBusyIndicator"),{ref:this.$9,children:i._("Validating Address")});if(this.state.isPasting)return m.jsx("div",{ref:this.$9,children:m.jsxs("div",{className:"_35b6",children:[m.jsx(c("GeoSpinner.react"),{shade:"dark",size:"small"}),m.jsx("span",{className:"_35b7 mls",children:i._("Adding locations")})]})});var b=this.$18(),e=c("AdsLocationSearchSource").getInstance(),g=c("AdsTargetingLocationTypeaheadPresenter");g.extraRendererProps={onRenderEntryProps:this.props.audienceControlMetaData!=null?function(b){return d("AdsTargetingAccountControlInfoLocationUtils").getAccountControlInfoLocationEntryProps(a.props.addLocationMode,a.props.audienceControlMetaData,b,a.props.accountID,a.props.enableASAStateInclusions)}:null,dao:this.props.dao,isTargetingYouthByAge:this.props.isTargetingYouthByAge,youthAdsAgeCutoff:this.props.youthAdsAgeCutoff,isFDS:!0,isTargetingOnlyYouth:this.props.isTargetingOnlyYouth};var h=this.state.inputHasFocus,k=null;this.state.invalid?k=m.jsxs("div",{children:[m.jsx("div",{children:i._("Address not found.")}),m.jsx("div",{children:i._("- Check the spelling of the address")}),m.jsx("div",{children:i._("- Make sure that you include a real street address, city, county/region or country")}),m.jsx("div",{children:i._("- Drop a pin on the map instead of searching")})]}):this.state.duplicate&&(k=m.jsxs("div",{children:[m.jsx("div",{children:i._("Duplicate address found.")}),m.jsx("div",{children:i._("- Check the addresses that you have already added")}),m.jsx("div",{children:i._("- Drop a pin on the map instead of searching")})]}));var l=null;!this.props.onlyInclusion&&!this.props.isAdAccountBusinessConstraintsExclusion&&(l=m.jsx(c("AdsTargetingIncludeExcludeSelector"),{className:"_438w",isDisabled:this.props.disabledIncludeExcludeSelector,mode:this.props.addLocationMode,showDropIcon:!0,onBlur:this.$19,onChangeMode:this.$20,onFocus:this.$21}));var n=m.jsx(c("Image.react"),{className:"_3-91",src:j("560463"),style:{minWidth:"16px"}}),o=babelHelpers["extends"]({},this.props.searchSourceOptions,{disallowedLocationTypes:this.$12(),selectedLocationType:this.state.selectedLocationType,enableGeoSearchFrictionImprovements:d("AdsTargetingLocationTypeaheadUtils").shouldEnableGeoSearchFrictionImprovements(),adAccountID:this.props.accountID});return m.jsxs("div",{className:"_438u"+(h?" _438v":"")+(this.state.invalid?" _7bo":"")+(this.state.duplicate?" _3x2j":""),children:[l,m.jsx("div",{className:"_438x","data-testid":void 0,ref:this.$10,children:m.jsxs("div",{className:"_60xf",children:[m.jsx(d("AdsPathLink").Activatable,{onActivate:this.$22,children:m.jsx(c("XUIError.react"),{xuiError:k,xuiErrorPosition:"below",children:m.jsx(c("AMSearchTrigger.react"),{callsite:f.id,disabled:!d("AdsApplicationUtils").isPowerEditor(),interaction:"am.edit_targeting.search_targeting_typeahead",overrideTrackingSurface:String("am.editor_typeahead.targeting_location"),onBlur:this.$23,onChange:this.$24,children:function(d,f){return m.jsx(c("AbstractTypeahead.react"),{autoHighlight:!0,disabled:a.props.disabledLocationTypeahead,excludedEntries:a.$25(),hideViewWithEntries:!0,inputLeftChild:n,inputStyles:{label:{display:"flex",alignItems:"center",marginTop:"2px"}},placeholder:b,presenter:g,queryString:a.state.queryString,ref:a.$9,searchSource:e,searchSourceOptions:o,selectOnTab:!0,selectedEntry:void 0,onAddBrowseEntryAttempt:a.$26,onBlur:f,onChange:d,onClick:a.props.onClick,onEntriesFound:a.$27,onFocus:a.$28,onKeyDown:a.$29,onPaste:a.$30,onSelectAttempt:a.$31})}})})}),this.$32()]})})]})};g.$18=function(){return this.props.enableASAStateInclusions===!0?d("AutomatedShoppingAdsStrings").INCLUDED_LOCATIONS_TOKENIZER_TYPEAHEAD_PLACEHOLDER_TEXT:i._("Search locations")};g.$14=function(){var a=this;if(!this.props.hideTip&&!this.state.addedLocationsFromTypeahead&&(this.state.inputHasFocus||this.state.isInsideTypeaheadTip)&&this.state.queryString===""){var b=function(){return a.$9.current},d=this.state.width-v;return m.jsx("span",{onMouseEnter:this.$33,onMouseLeave:this.$34,children:m.jsx(c("XUIContextualDialog.react"),{contextRef:b,label:"targetingLocationTypeaheadTip",position:"below",shown:!0,width:d,children:m.jsx(c("XUIContextualDialogBody.react"),{children:this.$35()})})})}return null};g.$32=function(){if(this.props.enableLocationBrowser){var a=this.state.width-v;return m.jsx(c("AdsTargetingLocationBrowseListContainer.react"),{accountControlInfo:this.props.accountControlInfo,accountID:this.props.accountID,addLocationMode:this.props.addLocationMode,enableASAStateInclusions:this.props.enableASAStateInclusions,excludedGeoLocations:this.props.excludedGeoLocations,geoLocations:this.props.geoLocations,hideSavedLocations:this.props.hideLocationBrowserSavedLocations,rootRef:this.$10,safrConfig:this.props.safrConfig,selectedRegulatedCategory:this.props.selectedRegulatedCategory,shouldDisableEUCountries:this.props.isTargetingOnlyYouth===!0,variantIndex:this.props.variantIndex,width:a,onAddBrowseEntryAttempt:this.$26,onBrowseButtonMouseDown:this.$36,onReplaceAttempt:this.props.onReplaceAttempt})}return null};g.$35=function(){var a,b=this.$12(),d=[];a=[[(a=c("LocationConstants")).COUNTRIES,i._("countries")],[a.REGIONS,i._("counties/regions")],[a.CITIES,i._("cities")],[a.ZIPS,i._("postal codes")],[a.CUSTOM_LOCATIONS,i._("addresses")],[a.GEO_MARKETS,i._("DMAs")],[a.ELECTORAL_DISTRICTS,i._("congressional districts")]];a.forEach(function(a){b.has(a[0])||d.push(a[1])});a=m.jsx(c("Link.react"),{href:x,target:"_blank",children:i._("Learn more")});a=this.props.hideAdsHelpLink?m.jsx("div",{children:i._("You can also add worldwide or global regions.")}):m.jsx("div",{children:i._("You can also add worldwide or global regions. {Learn More link}",[i._param("Learn More link",a)])});return m.jsx("div",{children:i._("You can type in specific {Supported location types}. {Country group location type}",[i._param("Supported location types",c("intlList")(d,c("intlList").CONJUNCTIONS.OR)),i._param("Country group location type",b.has(c("LocationConstants").COUNTRY_GROUPS)?"":a)])})};g.$25=function(){var a=c("adsTargetingLocationGetExcludedEntriesFromLocations")(this.props.geoLocations),b=c("adsTargetingLocationGetExcludedEntriesFromLocations")(this.props.excludedGeoLocations);return babelHelpers["extends"]({},a,b)};g.$37=function(a){var b=this;this.$39();this.setState({isValidating:!0});var d=c("AdsLocationSearchSource").getInstance();a=a.getAuxiliaryData().matchedText;d.validateAddress(a,function(a,d,e){a&&c("FBLogger")("ads").warn("AdsLocationSearchSource returned error: %s",a);if(d&&e!=null){var f=[].concat(b.props.geoLocations.custom_locations||[],b.props.excludedGeoLocations.custom_locations||[]);f=f.some(function(a){return c("adsTargetingLocationAreSameLatLng")(a,e)});f?b.setState({isValidating:!1,duplicate:!0},function(){b.$40()}):c("promiseDone")(b.$41(e),function(a){b.setState({isValidating:!1}),b.$42(babelHelpers["extends"]({},e,{radius:a}))})}else{var g,h;b.setState({isValidating:!1});f=c("AdsTargetingLocationLoggingEvents").GEO_LOCATION_GEOCODE_FAIL;g=(g=b.$9.current)==null?void 0:(g=g.props)==null?void 0:g.queryString;c("AdsInterfacesLogger").log({eventName:f,data:(h={},h.targeting_ui_event_data=JSON.stringify({isValid:d,geo:e,error:a}),h)},c("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP);c("adsTargetingLocationSendTypeaheadLog")({ad_account_id:b.props.accountID,event:f,query:g,select_entry_json:null});b.setState({invalid:!0},function(){b.$40()})}})};g.$41=function(a){return!this.props.shouldGetSuggestedRadius?(k||(k=b("Promise"))).resolve(c("LocationConstants").RadiusInfo.getAddressDefaultRadius()):c("adsTargetingLocationFetchSuggestedRadiusOrDefault")(a)};g.$42=function(a){a=d("AdsTargetingLocationDataTransformer").getSearchableEntryFromGeoCoder(a);this.$38(a)};g.$43=function(){var a=this;window.clearTimeout(this.$2);window.clearTimeout(this.$4);window.clearTimeout(this.$6);this.setState({queryString:"",inputHasFocus:!0,selectorHasFocus:!1},function(){window.setTimeout(function(){var b;(b=a.$9.current)==null?void 0:b.focusInput()},n)})};g.$38=function(a){var b,e=d("AdsTargetingLocationDataTransformer").entriesToDataStore([a],this.props.minRadius),f=a.getAuxiliaryData();this.props.onUserSelectAttempt(f);this.props.onSelectAttempt(e,this.props.addLocationMode===c("LocationConstants").INCLUDE);this.props.addLocationMode===c("LocationConstants").INCLUDE?e=c("AdsTargetingLocationLoggingEvents").GEO_LOCATION_SELECT:e=c("AdsTargetingLocationLoggingEvents").GEO_LOCATION_SELECT_EXCLUDE;b=(b=this.$9.current)==null?void 0:(b=b.props)==null?void 0:b.queryString;b=b||this.$1||a.getTitle();c("AdsInterfacesLogger").log({eventName:e},c("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP);f=JSON.stringify(f);c("adsTargetingLocationSendTypeaheadLog")({ad_account_id:this.props.accountID,event:e,query:b,select_position:a.getOrder(),select_entry_json:f});c("QPLUserFlow").addPoint(c("qpl")._(1016866030,"1350"),"typeahead_search_select_entry",{instanceKey:this.$8,data:{string:{query:b,selection:f},"int":{select_position:a.getOrder()}}});c("QPLUserFlow").endSuccess(c("qpl")._(1016866030,"1350"),{instanceKey:this.$8});this.$1="";this.$43()};g.$44=function(a){var b;((b=a.clipboardData)==null?void 0:b.getData)!=null&&typeof a.clipboardData.getData!=="function"&&c("FBLogger")("ads").info("getData from clipboard is %s type instead of function. getData value is %s",typeof a.clipboardData.getData,a.clipboardData.getData);return!a.clipboardData||!a.clipboardData.getData?"":a.clipboardData.getData("Text")||a.clipboardData.getData("text/plain")};g.$46=function(a){a=(a.split(/,|;/)||[]).filter(function(a){return!!a.trim()});return a.length>1};g.$39=function(){var a=this.$9.current;a=d("ReactDOM_DEPRECATED").findDOMNode_DEPRECATED(a);a=d("DOMQuery").find(a,"input");this.$5=c("ReactInputSelection").getSelection(a)};g.$40=function(){var a=this.$9.current;a=d("ReactDOM_DEPRECATED").findDOMNode_DEPRECATED(a);a=d("DOMQuery").find(a,"input");a&&this.$5&&c("ReactInputSelection").setSelection(a,this.$5)};g.$45=function(a){return a.length>=o&&(a.split(",").length-1>=p||a.split(";").length-1>=q||(a.match(s)||[]).length>=r)};g.$12=function(){return this.props.addLocationMode===c("LocationConstants").INCLUDE?this.props.searchSourceOptions.disallowedLocationTypes:this.props.searchSourceOptions.disallowedLocationExclusionTypes};return e}(m.PureComponent);a.displayName="AdsTargetingLocationTypeahead";a.defaultProps={disabledLocationTypeahead:!1,excludedGeoLocations:{},isAdAccountBusinessConstraintsExclusion:!1,page:null,searchSourceOptions:{allowedCountryList:[],disallowedCountryList:[],disallowedLocationExclusionTypes:new Set(),disallowedLocationTypes:new Set()},onlyInclusion:!1,variantIndex:null,onAddLocationModeChange:c("emptyFunction"),onFocusTypeahead:c("emptyFunction"),onSelectAttempt:c("emptyFunction")};g["default"]=a}),226);
-----
adsTargetingLocationAreSameLatLng",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){var c=Math.round((a.latitude||0)*1e3),d=Math.round((b.latitude||0)*1e3);a=Math.round((a.longitude||0)*1e3);b=Math.round((b.longitude||0)*1e3);return c===d&&a===b}f["default"]=a}),66);
-----
adsTargetingLocationAreSameCustomLocation",["adsTargetingLocationAreSameLatLng","adsTargetingLocationIsMultiCityCustomLocation"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return c("adsTargetingLocationIsMultiCityCustomLocation")(a)&&c("adsTargetingLocationIsMultiCityCustomLocation")(b)?a.min_population!==b.min_population||a.max_population!==b.max_population?!1:a.country&&b.country?a.country===b.country:a.country_group===b.country_group:c("adsTargetingLocationAreSameLatLng")(a,b)}g["default"]=a}),98);
-----
AdsTargetingLocationTypeahead",["cx","fbt","ix","AMSearchTrigger.react","AbstractTypeahead.react","AdsApplicationUtils","AdsInterfacesLogger","AdsLocationActions","AdsLocationBulkInputShowDialogFromTypeaheadDataAction","AdsLocationBulkInputShowNuxDataAction","AdsLocationSearchSource","AdsLocationTypeaheadPasteDialog.react","AdsMgmtPerfScenarioController","AdsPathLink","AdsTargetingIncludeExcludeSelector","AdsTargetingLocationBrowseListContainer.react","AdsTargetingLocationDataTransformer","AdsTargetingLocationLoggingEvents","AdsTargetingLocationNux","AdsTargetingLocationTypeaheadBusyIndicator","AdsTargetingLocationTypeaheadPresenter","AdsTargetingMTCUsabilityScenarioLoggingEvents","AdsTargetingTypeaheadScenarioHelper","BUIButton.react","BUISpinner_DEPRECATED.react","DOMQuery","FBLogger","Image.react","Keys","Link.react","LocationConstants","Promise","ReactDOM","ReactInputSelection","SimpleNUXMessage","Tooltip.react","XUIContextualDialog.react","XUIContextualDialogBody.react","XUIError.react","adsTargetingLocationAreSameLatLng","adsTargetingLocationFetchSuggestedRadiusOrDefault","adsTargetingLocationGetExcludedEntriesFromLocations","adsTargetingLocationGetLocationsCount","adsTargetingLocationRemoveCommonLocations","adsTargetingLocationRemoveDuplicates","adsTargetingLocationSendTypeaheadLog","emptyFunction","intlList","justknobx","nullthrows","promiseDone","react","setupScenarioStart"],(function(a,b,c,d,e,f,g,h,i,j){"use strict";var k=d("react"),l=100,m=50,n=5,o=1,p=1,q=/[ ]/g,r="523608931147539",s=3e4,t=95,u=450,v="/business/help/285255905140138";a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h0?a.offsetWidth:u};g.componentDidMount=function(){this.$8=!0};g.componentWillUnmount=function(){this.$8=!1};g.render=function(){var a=this.$11();a=!a.has(c("LocationConstants").CUSTOM_LOCATIONS);return k.jsxs(k.Fragment,{children:[this.$12(),this.$13(),k.jsx(c("AdsLocationTypeaheadPasteDialog.react"),{allowAddress:a,ref:"pasteDialog",onDialogHide:this.$14,onLocationTypeSelect:this.$15}),this.renderLayers()]})};g.renderLayers=function(){return!this.props.shouldShowNuxTooltip?null:k.jsx(c("AdsTargetingLocationNux"),{contextRef:this.$16},"nux")};g.$12=function(){var a=this;if(this.state.isValidating)if(c("justknobx")._("231"))return k.jsx(c("AdsTargetingLocationTypeaheadBusyIndicator"),{ref:this.$9,children:i._("u6b63u5728u9a8cu8bc1u5730u5740")});else return k.jsx(c("AdsTargetingLocationTypeaheadBusyIndicator"),{ref:"typeahead",children:i._("u6b63u5728u9a8cu8bc1u5730u5740")});if(this.state.isPasting)if(c("justknobx")._("231"))return k.jsx("div",{ref:this.$9,children:k.jsxs("div",{className:"_35b6",children:[k.jsx(c("BUISpinner_DEPRECATED.react"),{shade:"dark",size:"small"}),k.jsx("span",{className:"_35b7 mls",children:i._("u6dfbu52a0u5730u533a")})]})});else return k.jsx("div",{ref:"typeahead",children:k.jsxs("div",{className:"_35b6",children:[k.jsx(c("BUISpinner_DEPRECATED.react"),{shade:"dark",size:"small"}),k.jsx("span",{className:"_35b7 mls",children:i._("u6dfbu52a0u5730u533a")})]})});var b=this.$17(),e=c("AdsLocationSearchSource").getInstance(),g=c("AdsTargetingLocationTypeaheadPresenter");g.extraRendererProps={dao:this.props.dao,isTargetingYouthByAge:this.props.isTargetingYouthByAge,youthAdsAgeCutoff:this.props.youthAdsAgeCutoff,isFDS:!0};var h=this.state.inputHasFocus,l=null;this.state.invalid?l=k.jsxs("div",{children:[k.jsx("div",{children:i._("u5730u5740u672au627eu5230")}),k.jsx("div",{children:i._("- u68c0u67e5u5730u5740u6709u65e0u5199u9519")}),k.jsx("div",{children:i._("- u786eu4fddu8857u9053u5730u5740u3001u57ceu5e02u3001u5ddeu3001u6216u56fdu5bb6/u5730u533au771fu5b9eu5b58u5728")}),k.jsx("div",{children:i._("- u5728u5730u56feu4e0au9489u9009u5730u70b9uff0cu65e0u9700u641cu7d22")})]}):this.state.duplicate&&(l=k.jsxs("div",{children:[k.jsx("div",{children:i._("u53d1u73b0u91cdu590du7684u5730u5740")}),k.jsx("div",{children:i._("- u67e5u770bu5df2u6dfbu52a0u7684u5730u5740")}),k.jsx("div",{children:i._("- u5728u5730u56feu4e0au9489u9009u5730u70b9uff0cu65e0u9700u641cu7d22")})]}));var m=null;this.props.onlyInclusion||(m=k.jsx(c("AdsTargetingIncludeExcludeSelector"),{className:"_438w",isDisabled:this.props.disabledIncludeExcludeSelector,mode:this.props.addLocationMode,showDropIcon:!0,onBlur:this.$18,onChangeMode:this.$19,onFocus:this.$20}));var n=k.jsx(c("Image.react"),{className:"_3-91",src:j("560463"),style:{minWidth:"16px"}}),o=babelHelpers["extends"]({},this.props.searchSourceOptions,{disallowedLocationTypes:this.$11(),selectedLocationType:this.state.selectedLocationType});return k.jsxs("div",{className:"_438u"+(h?" _438v":"")+(this.state.invalid?" _7bo":"")+(this.state.duplicate?" _3x2j":""),children:[m,k.jsx("div",{className:"_438x","data-testid":void 0,ref:this.$10,children:k.jsxs("div",{className:"_60xf",children:[k.jsx(d("AdsPathLink").Activatable,{onActivate:this.$21,children:k.jsx(c("XUIError.react"),{xuiError:l,xuiErrorPosition:"below",children:c("justknobx")._("231")?k.jsx(c("AMSearchTrigger.react"),{callsite:f.id,disabled:!d("AdsApplicationUtils").isPowerEditor(),interaction:"am.edit_targeting.search_targeting_typeahead",overrideTrackingSurface:String("am_targeting_location_typeahead"),onBlur:this.$22,onChange:this.$23,children:function(d,f){return k.jsx(c("AbstractTypeahead.react"),{autoHighlight:!0,disabled:a.props.disabledLocationTypeahead,excludedEntries:a.$24(),hideViewWithEntries:!0,inputLeftChild:n,inputStyles:{label:{display:"flex",alignItems:"center",marginTop:"2px"}},placeholder:b,presenter:g,queryString:a.state.queryString,ref:a.$9,searchSource:e,searchSourceOptions:o,selectOnTab:!0,selectedEntry:void 0,onBlur:f,onChange:d,onClick:a.props.onClick,onEntriesFound:a.$25,onFocus:a.$26,onKeyDown:a.$27,onPaste:a.$28,onSelectAttempt:a.$29})}}):k.jsx(c("AbstractTypeahead.react"),{autoHighlight:!0,disabled:this.props.disabledLocationTypeahead,excludedEntries:this.$24(),hideViewWithEntries:!0,inputLeftChild:n,inputStyles:{label:{display:"flex",alignItems:"center",marginTop:"2px"}},placeholder:b,presenter:g,queryString:this.state.queryString,ref:"typeahead",searchSource:e,searchSourceOptions:o,selectOnTab:!0,selectedEntry:void 0,onBlur:this.$22,onChange:this.$23,onClick:this.props.onClick,onEntriesFound:this.$25,onFocus:this.$26,onKeyDown:this.$27,onPaste:this.$28,onSelectAttempt:this.$29})})}),this.$30()]})}),this.$31()]})};g.$17=function(){return i._("u641cu7d22u5730u533a")};g.$13=function(){var a=this;if(!this.props.hideTip&&!this.state.addedLocationsFromTypeahead&&(this.state.inputHasFocus||this.state.isInsideTypeaheadTip)&&this.state.queryString===""){var b=function(){if(c("justknobx")._("231"))return a.$9.current;else return a.refs.typeahead},d=this.$1-t;return k.jsx("span",{onMouseEnter:this.$32,onMouseLeave:this.$33,children:k.jsx(c("XUIContextualDialog.react"),{contextRef:b,label:"targetingLocationTypeaheadTip",position:"below",shown:!0,width:d,children:k.jsx(c("XUIContextualDialogBody.react"),{children:this.$34()})})})}return null};g.$30=function(){if(this.props.enableLocationBrowser){var a=this.$1-t;return k.jsx(c("AdsTargetingLocationBrowseListContainer.react"),{accountID:this.props.accountID,addLocationMode:this.props.addLocationMode,excludedGeoLocations:this.props.excludedGeoLocations,geoLocations:this.props.geoLocations,rootRef:this.$10,selectedRegulatedCategory:this.props.selectedRegulatedCategory,variantIndex:this.props.variantIndex,width:a,onBrowseButtonMouseDown:d("AdsApplicationUtils").isPowerEditor()?this.$35:this.$36,onMultiSelectAttempt:this.props.onMultiSelectAttempt,onReplaceAttempt:this.props.onReplaceAttempt})}return null};g.$34=function(){var a=this.$11(),b=[],d=[[c("LocationConstants").COUNTRIES,i._("u56fdu5bb6/u5730u533a")],[c("LocationConstants").REGIONS,i._("u5ddeuff08u7701uff09/u5730u533a")],[c("LocationConstants").CITIES,i._("u57ceu5e02")],[c("LocationConstants").ZIPS,i._("u90aeu7f16")],[c("LocationConstants").CUSTOM_LOCATIONS,i._("u5730u5740")],[c("LocationConstants").GEO_MARKETS,i._("u6307u5b9au8425u9500u5730u533a (DMA)")],[c("LocationConstants").ELECTORAL_DISTRICTS,i._("u9009u533a")]];d.forEach(function(c){a.has(c[0])||b.push(c[1])});d=k.jsx(c("Link.react"),{href:v,target:"_blank",children:i._("u8be6u7ec6u4e86u89e3")});d=this.props.hideAdsHelpLink?k.jsx("div",{children:i._("u4f60u4e5fu53efu4ee5u6dfbu52a0u5168u7403u5730u533au6216u5927u533au3002")}):k.jsx("div",{children:i._("u4f60u4e5fu53efu4ee5u6dfbu52a0u5168u7403u5730u533au6216u5927u533au3002{Learn More link}",[i._param("Learn More link",d)])});return k.jsx("div",{children:i._("u4f60u53efu4ee5u8f93u5165u5177u4f53{Supported location types}u3002{Country group location type}",[i._param("Supported location types",c("intlList")(b,c("intlList").CONJUNCTIONS.OR)),i._param("Country group location type",a.has(c("LocationConstants").COUNTRY_GROUPS)?"":d)])})};g.$31=function(){var a=this.props.page,b=a==null?void 0:a.picture;b=typeof b==="string"?null:b==null?void 0:(b=b.data)==null?void 0:b.url;return!this.props.shouldShowPageLocationSuggestion||!(a==null?void 0:a.location)||!b||!this.$37()?null:k.jsx("div",{className:"_3-9s",children:k.jsx(c("Tooltip.react"),{tooltip:i._("u516cu5171u4e3bu9875u663eu793au7684u76eeu6807u5730u5740"),children:k.jsx("div",{className:"_3-9t",children:k.jsx(c("BUIButton.react"),{icon:k.jsx(c("Image.react"),{height:16,src:b,width:16}),label:i._("u516cu5171u4e3bu9875u663eu793au7684u76eeu6807u5730u5740"),labelIsHidden:!0,size:"medium",onClick:this.props.onUsePageLocation})})})})};g.$24=function(){var a=c("adsTargetingLocationGetExcludedEntriesFromLocations")(this.props.geoLocations),b=c("adsTargetingLocationGetExcludedEntriesFromLocations")(this.props.excludedGeoLocations);return babelHelpers["extends"]({},a,b)};g.$38=function(a){var b=this;this.$40();this.setState({isValidating:!0});var d=c("AdsLocationSearchSource").getInstance();a=a.getAuxiliaryData().matchedText;d.validateAddress(a,function(a,d,e){a&&c("FBLogger")("ads").warn("AdsLocationSearchSource returned error: %s",a);if(d&&e!=null){var f=[].concat(b.props.geoLocations.custom_locations||[],b.props.excludedGeoLocations.custom_locations||[]);f=f.some(function(a){return c("adsTargetingLocationAreSameLatLng")(a,e)});f?(b.setState({isValidating:!1,duplicate:!0},function(){b.$41()}),b.$42()):c("promiseDone")(b.$43(e),function(a){b.setState({isValidating:!1}),b.$44(babelHelpers["extends"]({},e,{radius:a}))})}else{b.setState({isValidating:!1});f=c("AdsTargetingLocationLoggingEvents").GEO_LOCATION_GEOCODE_FAIL;var g=null;if(c("justknobx")._("231")){var h;g=(h=b.$9.current)==null?void 0:(h=h.props)==null?void 0:h.queryString}else g=b.refs.typeahead.props.queryString;c("AdsInterfacesLogger").log({eventName:f,data:(h={},h.targeting_ui_event_data=JSON.stringify({isValid:d,geo:e,error:a}),h)},c("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP);c("adsTargetingLocationSendTypeaheadLog")({event:f,query:g,select_entry_json:null});b.$42();b.setState({invalid:!0},function(){b.$41()})}})};g.$42=function(){d("AdsApplicationUtils").isPowerEditor()&&c("AdsMgmtPerfScenarioController").endScenariosWithTrigger("am_edit_targeting_update_target_spec_fail",d("AdsTargetingMTCUsabilityScenarioLoggingEvents").SELECT_LOCATION_FROM_TYPEAHEAD_FAIL,null)};g.$43=function(a){return!this.props.shouldGetSuggestedRadius?b("Promise").resolve(c("LocationConstants").RadiusInfo.getAddressDefaultRadius()):c("adsTargetingLocationFetchSuggestedRadiusOrDefault")(a)};g.$44=function(a){a=d("AdsTargetingLocationDataTransformer").getSearchableEntryFromGeoCoder(a);this.$39(a)};g.$45=function(){var a=this;window.clearTimeout(this.$3);window.clearTimeout(this.$5);window.clearTimeout(this.$7);this.setState({queryString:"",inputHasFocus:!0,selectorHasFocus:!1},function(){window.setTimeout(function(){if(c("justknobx")._("231")){var b;(b=a.$9.current)==null?void 0:b.focusInput()}else a.refs.typeahead&&a.refs.typeahead.focusInput()},l)})};g.$39=function(a){var b,e=d("AdsTargetingLocationDataTransformer").entriesToDataStore([a],this.props.minRadius),f=a.getAuxiliaryData();this.props.onUserSelectAttempt(f);this.props.onSelectAttempt(e,this.props.addLocationMode===c("LocationConstants").INCLUDE);this.props.addLocationMode===c("LocationConstants").INCLUDE?e=c("AdsTargetingLocationLoggingEvents").GEO_LOCATION_SELECT:e=c("AdsTargetingLocationLoggingEvents").GEO_LOCATION_SELECT_EXCLUDE;b=c("justknobx")._("231")?(b=this.$9.current)==null?void 0:(b=b.props)==null?void 0:b.queryString:this.refs.typeahead&&this.refs.typeahead.props.queryString;b=b||this.$2||a.getTitle();c("AdsInterfacesLogger").log({eventName:e},c("AdsInterfacesLogger").LOG_TYPE_PRIMARY_APP);c("adsTargetingLocationSendTypeaheadLog")({event:e,query:b,select_position:a.getOrder(),select_entry_json:JSON.stringify(f)});this.$2="";this.$45()};g.$46=function(a){var b;((b=a.clipboardData)==null?void 0:b.getData)!=null&&typeof a.clipboardData.getData!=="function"&&c("FBLogger")("ads").info("getData from clipboard is %s type instead of function. getData value is %s",typeof a.clipboardData.getData,a.clipboardData.getData);return!a.clipboardData||!a.clipboardData.getData?"":a.clipboardData.getData("Text")||a.clipboardData.getData("text/plain")};g.$48=function(a){a=(a.split(/,|;/)||[]).filter(function(a){return!!a.trim()});return a.length>1};g.$40=function(){var a=c("justknobx")._("231")?this.$9.current:this.refs.typeahead;a=d("ReactDOM").findDOMNode(a);a=d("DOMQuery").find(a,"input");this.$6=c("ReactInputSelection").getSelection(a)};g.$41=function(){var a=c("justknobx")._("231")?this.$9.current:this.refs.typeahead;a=d("ReactDOM").findDOMNode(a);a=d("DOMQuery").find(a,"input");a&&this.$6&&c("ReactInputSelection").setSelection(a,this.$6)};g.$47=function(a){return a.length>=m&&(a.split(",").length-1>=n||a.split(";").length-1>=o||(a.match(q)||[]).length>=p)};g.$37=function(){var a=c("adsTargetingLocationGetLocationsCount")(this.props.geoLocations);return this.props.page!==null&&a>0&&!this.$50()};g.$50=function(){var a;if(!this.props.page)return!1;var b=(a=this.props.page)==null?void 0:a.location;if(!b)return!1;a=this.props.geoLocations[c("LocationConstants").CUSTOM_LOCATIONS]||[];return a.some(function(a){return c("adsTargetingLocationAreSameLatLng")(b,a)})};g.$11=function(){return this.props.addLocationMode===c("LocationConstants").INCLUDE?this.props.searchSourceOptions.disallowedLocationTypes:this.props.searchSourceOptions.disallowedLocationExclusionTypes};return e}(k.PureComponent);a.displayName="AdsTargetingLocationTypeahead";a.defaultProps={disabledLocationTypeahead:!1,excludedGeoLocations:{},page:null,searchSourceOptions:{allowedCountryList:[],disallowedCountryList:[],disallowedLocationExclusionTypes:new Set(),disallowedLocationTypes:new Set()},onlyInclusion:!1,variantIndex:null,onAddLocationModeChange:c("emptyFunction"),onFocusTypeahead:c("emptyFunction"),onSelectAttempt:c("emptyFunction")};g["default"]=a}),98);
-----
adsTargetingLocationAreSameLatLng",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){var c=Math.round((a.latitude||0)*1e3),d=Math.round((b.latitude||0)*1e3);a=Math.round((a.longitude||0)*1e3);b=Math.round((b.longitude||0)*1e3);return c===d&&a===b}f["default"]=a}),66);
-----
adsTargetingLocationAreSameCustomLocation",["adsTargetingLocationAreSameLatLng","adsTargetingLocationIsMultiCityCustomLocation"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return c("adsTargetingLocationIsMultiCityCustomLocation")(a)&&c("adsTargetingLocationIsMultiCityCustomLocation")(b)?a.min_population!==b.min_population||a.max_population!==b.max_population?!1:a.country&&b.country?a.country===b.country:a.country_group===b.country_group:c("adsTargetingLocationAreSameLatLng")(a,b)}g["default"]=a}),98);
-----