1"use strict";(self.webpackChunkFusion=self.webpackChunkFusion||[]).push([[60723],{60723:(e,r,t)=>{t.d(r,{Ay:()=>L});var i=t(41967),n=t(2693),o=t(14841),l=t(34784),s=t(72114),d=t(38370),c=t(18350),a=t(16924),h=t(82236),u=t(77467),p=t(82306),g=t(8440),y=t(44575),Y=t(12615),x=t(30169),b=t(84183),f=t(99940),A=t(86377),m=t(40509),F=t(58711),I=t(81282),S=t(73792),$=t(37447),w=t(47502),v=t(65545),k=t(91156),D=t(22361),C=t(67133),B=t(40014);const q=(0,i._F)(o.A,(e=>{let{$theme:r,$headerHeight:t}=e;return{color:r.colors.onHeader,position:"relative",display:"flex",flexDirection:"row",alignItems:"center",height:`${t}px`}})),_=((0,i.I4)("div",{position:"relative"}),(0,i.I4)("button",{display:"flex",flexDirection:"row",cursor:"pointer",whiteSpace:"nowrap"}),(0,i.I4)("div",(e=>{let{$theme:r}=e;return{width:"100%",background:r.colors.backgroundPrimary}}))),H=(0,i.I4)("div",{width:"100%",maxWidth:"722px"}),O=(0,i.I4)("div",{flex:1}),P=(0,i.I4)("div",{justifyContent:"flex-end",display:"flex",flexGrow:0,alignItems:"center"}),M=e=>{let{shouldNotRedirectToHomeFeed:r,showDiningMode:t,showCart:i,isSearchFeed:o,isSchedulable:M,storeUuid:L}=e;const{user:R}=(0,b.A)(),T=(0,a.A)(),U=(0,D.A)(),Q=(0,Y.A)(),z=(0,k.Ay)(),G=(0,l.IY)("header-location-typeahead"),{openMenu:K,closeMenu:j,closeAndUpdate:E}=(0,g.A)(),W=(0,m.A)(),N=(0,S.W)(),V=Boolean(L),{showSigninSignup:J,campaign:X,logSignInSignUpClick:Z}=(0,v.s)(V||!1),{headerHeight:ee}=(0,C.A)();let re;re=W?(0,B.Y)(A.A,{startShoppingRedirect:!o&&!V}):(0,B.Y)(f.A,{});const{feed:te}=(0,F.A)(),ie=Q?.address?.address1||"";return U?(0,B.Y)(_,{children:(0,B.Y)(q,{$headerHeight:ee,children:(0,B.Y)(d.A,{})})}):"DELIVERY"===N?(0,B.Y)($.Ay,{shouldNotRedirectToHomeFeed:r,showDiningMode:t,showCart:i,isSearchFeed:o,showSigninSignup:J,campaign:X,logSignInSignUpClick:Z,storeUuid:L,isSchedulable:M}):(0,B.Y)(_,{children:(0,B.FD)(q,{$headerHeight:ee,children:[T?null:(0,B.FD)(B.FK,{children:[(0,B.Y)(x.A,{}),(0,B.Y)(n.Ay,{$width:"32px"}),(0,B.Y)(d.A,{}),(0,B.Y)(n.Ay,{$width:"40px"})]}),Q?(0,B.FD)(B.FK,{children:[t?(0,B.FD)(B.FK,{children:[(0,B.Y)(y.A,{isDisabled:te.isLoading}),(0,B.Y)(n.Ay,{$width:"16px"})]}):null,(0,B.Y)(c.A,{size:"large",storeUuid:L,isSchedulable:M}),(0,B.Y)(n.Ay,{$width:"64px"}),T?null:(0,B.Y)(p.A,{onFocus:()=>{z("eats:search_bar_clicked"),K("search")},clickOutside:()=>{j()}})]}):(0,B.FD)(B.FK,{children:[(0,B.Y)(n.Ay,{$width:"64px"}),(0,B.Y)(H,{children:(0,B.Y)(u.A,{registerRef:G,onLocationSelected:e=>{E(e,void 0,r)},initialQuery:ie,id:"header"})}),(0,B.Y)(O,{})]}),(0,B.FD)(P,{children:[Q||i?(0,B.Y)(h.A,{}):null,(0,B.Y)(B.FK,{children:re}),(0,B.Y)(s.A,{}),R.data?.isLoggedIn?null:(0,B.FD)(B.FK,{children:[(0,B.Y)(n.Ay,{$width:"24px"}),J?(0,B.Y)(I.H,{campaign:X}):(0,B.Y)(w.A,{campaign:X,beforeClick:()=>Z("signin","header")})]})]})]})})};M.displayName="HeaderDesktop";const L=M},82306:(e,r,t)=>{t.d(r,{A:()=>N});var i=t(90417),n=t(86105),o=t(45292),l=t(41967),s=t(56074),d=t("__fusion__95b4ba69e5"),c=t(75344),a=t(82647);var h=t(10621),u=t.n(h),p=t(60331),g=t(40014);const y=(0,l.I4)("div",{display:"flex",flexDirection:"column",minWidth:0}),Y=(0,l.I4)("div",(e=>({borderRadius:"50%",width:"36px",height:"36px",backgroundImage:`url(${u()(e.$src)})`,backgroundSize:"cover",flexShrink:0}))),x=(0,l.I4)("div",{maxWidth:"100%",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),b=(0,l._F)(x,(e=>{let{$theme:r}=e;return{...r.typography.ParagraphSmall,color:r.colors.contentSecondary}})),f=(0,l._F)(x,(e=>{let{$theme:r}=e;return{...r.typography.LabelMedium,color:r.colors.contentTertiary}})),A=(0,l.I4)("div",(e=>{let{$theme:r}=e;return{...r.typography.LabelMedium,color:r.colors.contentPrimary,display:"inline"}})),m=(0,l.I4)("div",(e=>{let{$theme:r,$hasBorder:t}=e;return{...r.typography.LabelMedium,display:"flex",alignItems:"center",justifyContent:"space-between",flexGrow:1,height:"100%",overflow:"hidden",boxSizing:"border-box",...t?{borderBottom:`1px solid ${r.colors.borderOpaque}`}:{}}})),F=(0,l.I4)("div",(e=>{let{$isGrayedOut:r}=e;return{display:"flex",width:"100%",height:"100%",alignItems:"center",opacity:r?.6:void 0}})),I=(0,l.I4)("div",{width:"64px",height:"72px",display:"flex",flexGrow:0,flexShrink:0,boxSizing:"border-box",justifyContent:"center",alignItems:"center"});function S(e){const r=function(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}(e.query),t=new RegExp(r,"gi");let i=t.exec(e.text),n=0;const o=[];for(;e.query.length>0&&null!==i;)i.index>n&&o.push(e.text.substring(n,i.index)),o.push((0,g.Y)(A,{children:i[0]},n)),n=i.index+i[0].length,i=t.exec(e.text);return n<=e.text.length-1&&o.push(e.text.substring(n)),(0,g.Y)(f,{children:o})}function $(e){return(0,g.FD)(F,{children:[(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Search"})}),(0,g.FD)(m,{$hasBorder:e.hasBorder,children:[(0,g.Y)(S,{text:e.title,query:e.query}),(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Chevron",rotate:90,color:"contentStateDisabled"})})]})]})}function w(e){return(0,g.FD)(F,{children:[(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Time"})}),(0,g.FD)(m,{$hasBorder:e.hasBorder,children:[(0,g.Y)(x,{children:e.title}),(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Chevron",rotate:90,color:"contentStateDisabled"})})]})]})}function v(e){return(0,g.FD)(F,{children:[(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Search"})}),(0,g.FD)(m,{$hasBorder:e.hasBorder,children:[(0,g.Y)(x,{children:e.title}),(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Chevron",rotate:90,color:"contentStateDisabled"})})]})]})}function k(e){let{store:r,query:t,hasBorder:i}=e;const n=Boolean(r?.isOrderable),o=r?.heroImageUrl,l=r?.title||"",s=r?.meta1,d=r?.categories||[];return(0,g.FD)(F,{$isGrayedOut:!1===n,children:[(0,g.Y)(I,{children:o?(0,g.Y)(Y,{$src:o}):null}),(0,g.FD)(m,{$hasBorder:i,children:[(0,g.FD)(y,{children:[(0,g.Y)(S,{text:l,query:t}),s?(0,g.Y)(p.Ay,{text:s}):(0,g.Y)(b,{children:d.join(" ⢠")})]}),(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Chevron",rotate:90,color:"contentStateDisabled"})})]})]})}function D(e){let{store:r,hasBorder:t}=e;const i=r?.heroImageUrl,n=r?.title;return(0,g.FD)(F,{children:[(0,g.Y)(I,{children:i?(0,g.Y)(Y,{$src:i}):null}),(0,g.FD)(m,{$hasBorder:t,children:[(0,g.Y)(y,{children:(0,g.Y)(A,{children:n})}),(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Chevron",rotate:90,color:"contentStateDisabled"})})]})]})}function C(e){const r=(0,o.c)();return(0,g.FD)(F,{children:[(0,g.Y)(I,{children:(0,g.Y)(a.A,{})}),(0,g.FD)(m,{$hasBorder:e.hasBorder,children:[(0,g.Y)(f,{children:(0,g.Y)(A,{children:r("search.your_past_orders_link")})}),(0,g.Y)(I,{children:(0,g.Y)(c.A,{type:"Chevron",rotate:90,color:"contentStateDisabled"})})]})]})}var B=t(39182),q=t(91156);const _=function(e){const{suggestions:r,query:t}=e,n=(0,q.Ay)();i.useEffect((()=>{const e=r.filter((e=>"croStore"===e.type));!t&&e.length>0&&n("eats:search_bar_past_order_impression",{pastOrderStoreUuids:e.map((e=>
1e?.store?.uuid||"")).filter(Boolean)})}),[n,r,t])},H=(0,l.I4)("ul",(e=>{let{$theme:r,$isHidden:t}=e;return{background:r.colors.menuFill,position:"absolute",top:"100%",left:0,right:0,zIndex:B.IQ.banner,borderColor:r.colors.borderOpaque,borderStyle:"solid",borderWidth:"0 1px 1px 1px",boxShadow:r.shadows.box,...t?{display:"none"}:{}}})),O=(0,l.I4)("li",(e=>({backgroundColor:e.$isHighlighted?e.$theme.colors.menuFillHover:"transparent",height:"72px",boxSizing:"border-box",cursor:"pointer",display:"flex",alignItems:"center",transition:B.bm.itemBackground,outline:"none",":hover":{background:e.$theme.colors.menuFillHover}}))),P=["pastOrdersLink","croStore","text","searchHistory","popularCategory","store"];const M=function(e){(e=>{const r=(0,q.Ay)(),t=(0,i.useRef)([]);(0,i.useEffect)((()=>{e.suggestions.length&&t.current!==e.suggestions&&(t.current=e.suggestions,r("eats:search_dropdown_impression",{userQuery:e.query,result:e.suggestions.map((e=>e.title||e?.store?.title||"")).join(",")}))}),[r,e.query,e.suggestions])})({query:e.query,suggestions:e.suggestions}),_({query:e.query,suggestions:e.suggestions});const r=e.suggestions.filter((e=>P.includes(e.type)));return e.suggestions.length?(0,g.Y)(H,{...e.getMenuProps(),children:r.map(((t,i)=>{const n=i<r.length-1;return(0,g.FD)(O,{$isHighlighted:e.highlightedIndex===i,...e.getItemProps({index:i}),children:["pastOrdersLink"===t.type?(0,g.Y)(C,{hasBorder:n}):null,"croStore"===t.type?(0,g.Y)(D,{hasBorder:n,store:t.store}):null,"text"===t.type?(0,g.Y)($,{title:t.title,query:e.query,hasBorder:n}):null,"searchHistory"===t.type?(0,g.Y)(w,{hasBorder:n,title:t.title}):null,"popularCategory"===t.type?(0,g.Y)(v,{hasBorder:n,title:t.title}):null,"store"===t.type?(0,g.Y)(k,{query:e.query,hasBorder:n,store:t.store}):null]},i)}))}):(0,g.Y)(H,{...e.getMenuProps(),$isHidden:!0})};var L=t(43428),R=t(57887),T=t(17503);const U=(0,l._F)(R.A,(e=>({...e.$width?{width:`${e.$width}px`}:{}}))),Q=(0,l.I4)("label",B.mT),z=e=>{const r=d.useRef(null);(0,T.A)(r,(()=>{e.onClickOutside&&e.onClickOutside()}),e.isOpen);const{query:t,results:i,isOpen:n,getInputProps:o,getMenuProps:l,openMenu:s,getItemProps:c,reset:a,highlightedIndex:h,placeholder:u,onFocus:p,onClose:y,height:Y,width:x,backgroundColor:b,getLabelProps:f}=e,A=n&&i?.data||[];return(0,g.FD)(U,{$width:x,ref:r,children:[(0,g.Y)(Q,{...f(),children:u}),(0,g.Y)(L.A,{onFocus:()=>{p&&p(),s()},query:t,getInputProps:o,reset:a,onClose:y,placeholder:u,isLoading:!1,iconType:"Search",backgroundColor:b||"inputFill",height:Y,borderStyle:"rounded"}),(0,g.Y)(M,{query:t,suggestions:A,getMenuProps:l,getItemProps:c,highlightedIndex:h})]})},G=e=>{const r=(0,o.c)(),t=(0,s.Ay)({initialQuery:e.initialQuery,onSuggestionSelected:e.onSelect,initialIsClosed:e.initialIsClosed,searchTypeaheadPlaceholder:r("shared.searchBarHintText")});return(0,g.Y)(z,{onClose:e.onClose,onFocus:e.onFocus,onClickOutside:e.onClickOutside,height:48,...t})};var K=t(66292),j=t(61073),E=t(58711);const W=(0,l.I4)("div",{flexGrow:1}),N=e=>{const{onFocus:r}=e,t=(0,n.zy)(),{userQuery:l}=(0,K.g$k)(t,["userQuery"]),s=(0,o.c)(),d=(0,q.Ay)(),c=i.useCallback((()=>{d("eats:search_bar_click"),r()}),[d,r]),{feed:a}=(0,E.A)(),h=(0,g.Y)(W,{role:"search","aria-label":s("shared.searchBarHintText"),"data-testid":"header-desktop-search-input",children:(0,g.Y)(G,{initialIsClosed:!0,onFocus:c,onClickOutside:e.clickOutside,initialQuery:l})});return(0,g.Y)(j.A,{source:a,error:()=>null,loaded:e=>!1===e.isInServiceArea?(0,g.Y)(W,{}):h,loading:()=>h})}}}]); 2//# sourceMappingURL=https://sourcemaps.uberinternal.com/raw/web-eats-v2/client-60723-89c52dc8a02488c0.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.