webpackJsonp(["home"],{"+DVQ":function(e,t,n){"use strict";var r=n("GiK3"),o=n.n(r),i=n("CIox"),a=n("HW6M"),c=n.n(a),u=n("aMbA"),l=n("AdWY"),s=n("sdpm"),f=n("9ThW"),p=n("Levb"),d=n("13mL"),y=n("IHI7"),b=n.n(y),m=n("Swk3");function h(e){"@babel/helpers - typeof";return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(){return(v=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;t._setState(O(O({},t.defaultState),e),n)}),P(S(t),"handleKeyPress",function(e){var n=e.keyCode===m.f.ESCAPE,r=e.keyCode===m.f.UP,o=e.keyCode===m.f.DOWN,i=e.keyCode===m.f.ENTER;if(n&&!Object(l.v)(t.state.inputValue)&&t.clearInput(),(r||o||i)&&!Object(l.v)(t.state.suggestLocations)&&t._searchResults){var a,c=null,u=t.state.focusedIndex;if(-1!==u&&(c=t.state.suggestLocations[u]),i&&c)return void t.onClickLocation(c);!c&&o?a=0:!c&&r?a=t.state.suggestLocations.length-1:c&&o?(a=u+1)>=t.state.suggestLocations.length&&(a=0):c&&r&&(a=u-1)<0&&(a=t.state.suggestLocations.length-1),t._setState({focusedIndex:a})}}),P(S(t),"clearInput",function(){t.resetStateWithUpdates({})}),P(S(t),"handleSuccess",function(e,n){t._isMounted&&t.state.inProgress&&!Object(l.v)(e)&&t.onAddressIsServiceable(e,n)}),P(S(t),"handleError",function(e){if(t._isMounted&&t.state.inProgress){var n=Object(d.c)(e).message;t.showError(n),t._setState({inProgress:!1})}}),P(S(t),"onAddressIsServiceable",function(e){var n=e.address;t.props.changeUserLocation(n),i.browserHistory.replace("/")}),P(S(t),"geoFindMe",function(){if(!t.state.inProgress&&"undefined"!=typeof navigator){if(void 0===navigator.geolocation)return alert(m.b.GEO_NOT_SUPPORTED);t.resetStateWithUpdates({inputValue:"".concat(m.o.FETCHING_YOUR_LOCATION,"..."),inProgress:!0,inputDisabled:!0},function(){var e,n,r,o;(n=m.l,r=new Promise(function(e,t){navigator.geolocation.getCurrentPosition(e,t,n)}),o=new Promise(function(e,t){setTimeout(t,m.c)}),void 0===Promise.race?r:Promise.race([r,o])).then((e=t.geoSuggest).reverseGeoCode.bind(e)).then(t.checkIfAddressIsServiceable).then(t.handleSuccess).catch(t.handleError).then(function(){t._setState({inputValue:"",inProgress:!1,inputDisabled:!1})})})}}),P(S(t),"showSuggests",Object(l.h)(m.m,function(e){t.searchSuggests(e)})),P(S(t),"hideSuggests",function(){t._setState({showSuggestLocations:!1})}),P(S(t),"onClickFindFood",function(){t.state.inputDisabled||t.showError(m.o.ENTER_LOCATION)}),P(S(t),"onClickLocation",function(e){Object(l.v)(e)||t._setState({inProgress:!0,inputValue:e.description},function(){t.geoSuggest.reverseGeoCode(e).then(t.checkIfAddressIsServiceable).then(t.handleSuccess).catch(t.handleError)})}),P(S(t),"onInputChange",function(e){t._setState({inputValue:e}),t._setState({showError:!1}),Object(l.z)(e.length>=m.j,function(){return t.showSuggests(e)},function(){return t.hideSuggests()})}),P(S(t),"_renderSuggestionList",function(){var e=t.state.suggestLocations;return e.map(function(n,r){var i,a,u=c()((P(i={},b.a.searchItemText,!0),P(i,b.a.searchItemTextLast,r===e.length-1),i)),l=c()((P(a={},b.a.searchItem,!0),P(a,b.a.activeResult,r===t.state.focusedIndex),a));return o.a.createElement("button",{key:n.placeId,className:l,onClick:function(){return t.onClickLocation(n)},onMouseEnter:function(e){return t.itemHovered(e,r)},tabIndex:r+2},o.a.createElement("span",{className:"".concat(m.e.LOCATION_MARKER," ").concat(b.a.searchItemIcon)}),o.a.createElement("span",{className:u},n.description))})}),P(S(t),"focused",function(){t._setState({focused:!0})}),P(S(t),"blurred",function(){t._setState({focused:!1})}),P(S(t),"itemHovered",function(e,n){t._setState({focusedIndex:n})}),t.state=t.defaultState,t.geoSuggest=new u.a,t}return t=h,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0,window.onkeyup=this.handleKeyPress}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,window.onkeyup=null}},{key:"showError",value:function(e){this.resetStateWithUpdates({errorMessage:e,showError:!0,inputValue:this.state.inputValue})}},{key:"checkIfAddressIsServiceable",value:function(e){return Object(d.e)(e,!1).then(function(t){return Promise.resolve({address:e,data:t})})}},{key:"searchSuggests",value:function(e){var t=this;this._setState({suggestLocationInProgress:!0},function(){t.geoSuggest.getSuggests(e).then(function(e){Object(l.v)(t.state.inputValue)||t._setState({suggestLocations:e,showSuggestLocations:!0})}).catch(t.handleError).then(function(){return t._setState({suggestLocationInProgress:!1})})})}},{key:"render",value:function(){var e,t,n,r=this,i=Object(l.v)(this.state.inputValue),a=!Object(l.v)(this.state.inputValue)&&!this.state.inProgress,u=c()((P(e={},b.a.landingLocationField,!0),P(e,b.a.landingLocationFieldFocused,this.state.focused),e)),d=c()((P(t={},b.a.landingLocationInput,!0),P(t,b.a.landingLocationInputDisabled,this.state.inputDisabled),t)),y=c()((P(n={},b.a.landingFindButton,!0),P(n,b.a.landingFindButtonDisabled,this.state.inputDisabled),n));return o.a.createElement("div",{className:b.a.landingLocation},o.a.createElement("div",{className:b.a.landingLocationContainer},o.a.createElement(p.a,v({className:u,inputClassName:d,value:this.state.inputValue,disabled:this.state.inputDisabled,onChange:this.onInputChange,autoFocus:!0,onFocus:this.focused,onBlur:this.blurred},N)),i&&o.a.createElement("button",{className:b.a.landingLocateMe,onClick:this.geoFindMe},o.a.createElement("span",{className:"".concat(m.e.LOCATE_ME," ").concat(b.a.landingLocateMeIcon)}),o.a.createElement("span",{className:b.a.landingLocateMeText},m.o.LOCATE_ME)),a&&o.a.createElement("button",{className:b.a.landingClear,onClick:this.clearInput},m.o.CLEAR),this.state.showError&&o.a.createElement("div",{className:b.a.landingError},this.state.errorMessage),!this.state.inProgress&&this.state.showSuggestLocations&&o.a.createElement("div",{className:b.a.searchResults,ref:function(e){return r._searchResults=e}},this._renderSuggestionList())),o.a.createElement(s.a,{className:y,onClick:this.onClickFindFood},this.state.inProgress&&o.a.createElement(f.a,{className:b.a.landingLoading}),!this.state.inProgress&&o.a.createElement("span",null,m.o.FIND_FOOD)))}}])&&w(t.prototype,n),a&&w(t,a),Object.defineProperty(t,"prototype",{writable:!1}),h}();t.a=C},"+jv6":function(e,t,n){"use strict";var r=n("GiK3"),o=n.n(r),i=n("AN6t"),a=n.n(i),c=["className","children"];function u(e){"@babel/helpers - typeof";return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function f(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1])||arguments[1],n=e.lat,r=e.lng;return t?Object(i.K)({lat:n,lng:r}).then(function(e){return 0===e.statusCode&&!0===e.data.is_address_serviceable?Promise.resolve(e.data):Promise.reject(a.c.RESTAURANT_ADDRESS_NOT_SERVICEABLE)}):Object(i.z)({lat:n,lng:r}).then(function(e){return 0!==e.statusCode||Object(o.v)(e.data.cards)?Promise.reject(a.c.ADDRESS_NOT_SERVICEABLE):Promise.resolve(e.data)})},v=function(){return void 0===y&&(y=r.a.getItem("recentLocationSearch",{items:[]})),y},g=Object(c.a)(function(e,t){var n=e.toLowerCase(),r=v().items.filter(function(e){return Object(u.b)(e).toLowerCase().indexOf(n)>-1||Object(u.c)(e).toLowerCase().indexOf(n)>-1});return t?r.slice(0,2):r}),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=function(e){for(var t=1;t=t&&o.pop(),n.items=[e].concat(l(o)),r.a.setItem("recentLocationSearch",n),y=n},w=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"overlay-enabled",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"overlay",r=document.querySelector(".".concat(n));if(null!==r)return void r.addEventListener("click",e);var o=document.querySelector("body"),i=c();o.classList.add(t),0===i&&o.classList.add(u);var a=document.createElement("div");a.className=n,a.addEventListener("click",function(r){return l(e,t,n)}),window.onkeyup=function(r){27==r.keyCode&&(l(e,t,n),window.onkeyup=null)},o.appendChild(a)},t.g=l,n.d(t,"e",function(){return f}),n.d(t,"f",function(){return p}),n.d(t,"b",function(){return d});var r={37:1,38:1,39:1,40:1};function o(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.returnValue=!1}function i(e){if(r[e.keyCode])return o(e),!1}var a=!1;function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!1!==a)return a;if("undefined"!=typeof document){var t=document.createElement("div");t.className=e,t.style.width="100px",t.style.height="100px",t.style.position="absolute",t.style.overflow="scroll",t.style.top="-9999px",document.body.appendChild(t),a=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}else a=0;return a||0}var u="overlay-no-margin";function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"overlay-enabled",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"overlay",r=document.querySelector("body");r.classList.remove(t),r.classList.remove(u);var o=document.querySelector(".".concat(n));null!==o&&o.parentNode.removeChild(o),e()}var s,f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.createTextRange){var n=e.createTextRange();n.move("character",t),n.select()}else e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t)):e.focus()},p=function(e){if(void 0!==s)return s;if("undefined"==typeof document||"undefined"==typeof window)return!1;var t=document.createElement("input"),n=window.getComputedStyle(t);return s=!(!n||void 0===n.webkitTextSecurity)};var d=function(e){var t=document.createElement("textarea");t.style.position="fixed",t.style.top="-100%",t.style.left="-100%",t.style.width="2em",t.style.height="2em",t.style.padding=0,t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",t.value=e,document.body.appendChild(t),t.select();try{document.execCommand("copy")}catch(e){}document.body.removeChild(t)}},F83o:function(e,t,n){"use strict";var r=n("GiK3"),o=n.n(r),i=n("K9EU"),a=(n.n(i),n("IHI7")),c=n.n(a),u=n("Swk3");function l(e){"@babel/helpers - typeof";return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function y(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:t.props;return!Object(c.v)(e.value)||!Object(c.v)(e.attrs.placeholder)||null!==t._input&&(t._input===document.activeElement||!Object(c.v)(t._input.value))}),t.state={isLabelActive:!1},t}return t=f,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.setState({isLabelActive:this._isLabelActive()})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e,t){this.setState({isLabelActive:this._isLabelActive(e)})}},{key:"componentDidMount",value:function(){(this.props.autoFocus||this.props.attrs.autoFocus)&&(this.setFocus(),this.setState({isLabelActive:this._isLabelActive()}))}},{key:"setFocus",value:function(){this._input.focus()}},{key:"setFocusAtEnd",value:function(){Object(u.e)(this._input,this.props.value.length)}},{key:"getInput",value:function(){return this._input}},{key:"render",value:function(){var e,t,n,r,i=this,u=this.props,l=u.className,f=u.disabled,d=u.error,y=u.inputClassName,b=u.labelClassName,m=u.style,h=u.type,g=u.value,O=u.action,w=u.name,_=u.showClear,E=u.clearButtonText,S=u.clearAction,j=_&&!Object(c.v)(E)&&!Object(c.v)(g),P=a()((v(e={},s.a.inputField,!0),v(e,l,void 0!==l),e)),I=a()((v(t={},s.a.input,!0),v(t,s.a.inputClear,j),v(t,y,void 0!==y),t)),N=a()((v(n={},s.a.label,!0),v(n,s.a.labelActive,this.state.isLabelActive),v(n,s.a.labelError,d),v(n,b,void 0!==b),n)),C=a()((v(r={},s.a.action,!0),v(r,s.a.actionActive,this.state.isLabelActive),r));return o.a.createElement("div",{ref:function(e){return i._inputContainer=e},className:P,style:m},o.a.createElement("input",p({ref:function(e){return i._input=e},className:I,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onChange:this.onInputChange,onKeyDown:this.onKeyDown,disabled:f,value:g,type:h,name:w,id:this.getInputId()},this.props.attrs)),!Object(c.v)(O)&&o.a.createElement("div",{className:C,onClick:O.onClick},O.text),o.a.createElement("label",{className:N,htmlFor:this.getInputId()},this.props.label),j&&o.a.createElement("div",{className:s.a.clearButton,onClick:S},E))}}])&&d(t.prototype,n),i&&d(t,i),Object.defineProperty(t,"prototype",{writable:!1}),f}();O.defaultProps={attrs:{},type:"text",style:{},value:"",name:"",label:"",autoFocus:!1,inline:!1,error:!1,disabled:!1,scrollIntoView:!1,onChange:function(){},action:{text:"",onClick:function(){}},showClear:!1,clearAction:function(){},clearButtonText:""},t.a=O},"rO+1":function(e,t,n){"use strict";var r=n("GiK3"),o=n.n(r),i=n("K9EU"),a=(n.n(i),n("IHI7")),c=n.n(a),u=n("Swk3");function l(e){"@babel/helpers - typeof";return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t={};return Object(r.v)(e)||Object(r.v)(e.cityName)?t.canonicalUrl="".concat(a.a.SITE_URL):e.cityName&&(t.canonicalUrl="".concat(a.a.SITE_URL,"/").concat(e.cityName)),t}},wMMp:function(e,t,n){"use strict";n.d(t,"a",function(){return g});var r=n("GiK3"),o=n.n(r),i=n("0mDK"),a=n("Ne2Z"),c=n("355D"),u=n("IHI7"),l=n.n(u),s=n("Swk3");function f(e){"@babel/helpers - typeof";return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n=s.p.length&&(e=0),t._setState({isTitleAnimating:!0,titleIndex:e,oldIndex:t.state.titleIndex})}}),h(b(t),"endTitleAnimation",function(){t._setState({isTitleAnimating:!1,oldIndex:null})}),t.state=t.defaultState,t}return t=m,(n=[{key:"render",value:function(){return o.a.createElement("div",{className:l.a.landing},o.a.createElement(i.a,null),this.state.isTitleAnimating?o.a.createElement("h1",{className:"".concat(l.a.landingTitle," ").concat(l.a.landingTitleAnimating)},o.a.createElement("div",{className:l.a.landingTitleAniTxtOld},s.p[this.state.oldIndex]),o.a.createElement("div",{className:l.a.landingTitleAniTxtNew,onAnimationEnd:this.endTitleAnimation},s.p[this.state.titleIndex])):o.a.createElement("h1",{className:l.a.landingTitle},s.p[this.state.titleIndex]),o.a.createElement("h2",{className:l.a.landingSubTitle},s.o.LANDING_SUBTITLE),o.a.createElement(c.a,null),o.a.createElement(a.a,{cities:this.props.cities}))}},{key:"componentDidMount",value:function(){this._isMounted=!0,this._intervalPoller=window.setInterval(this.animateTitle,s.q)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,clearInterval(this._intervalPoller)}},{key:"_setState",value:function(e,t){this._isMounted&&this.setState(e,t)}}])&&p(t.prototype,n),u&&p(t,u),Object.defineProperty(t,"prototype",{writable:!1}),m}()},yyiv:function(e,t){e.exports={submitBtn:"_1ike9",submitBtnContainer:"_25qBi",submitBtnDisabled:"_3jW_K",submitBtnProgress:"TAplo",lineProgressBar:"_1alK3"}},"znG+":function(e,t,n){"use strict";n.d(t,"i",function(){return r}),n.d(t,"c",function(){return o}),n.d(t,"a",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"f",function(){return c}),n.d(t,"g",function(){return u}),n.d(t,"e",function(){return l}),n.d(t,"h",function(){return s}),n.d(t,"b",function(){return f});var r={USE_CURRENT_LOCATION:"Get current location",USING_GPS:"Using GPS",HOME:"Home",WORK:"Work",OTHER:"Other",SEARCH_BAR_PLACEHOLDER:"Search for area, street name..",FETCHING_RESULTS:"Fetching results",NO_RESULTS_PLACEHOLDER_TITLE:"No results",NO_RESULTS_PLACEHOLDER_DESC:"Are you sure you entered the right location?",FETCHING_YOUR_LOCATION:"Fetching your location",ACCESS_TO_LOCATION_DENIED:"Access to location services disabled",YOU_DENIED_LOCATION_PREVIOUSLY:"You denied location access previously",RECENT_SEARCHES:"RECENT SEARCHES",SAVED_ADDRESS:"SAVED ADDRESSES"},o={ADDRESS_NOT_SERVICEABLE:"Sorry! We don't serve at your location currently.",RESTAURANT_ADDRESS_NOT_SERVICEABLE:"The location is too far away from the restaurant for Swiggy to deliver. Please pick a valid location",GEO_PERMISSION_DENIED:"You have blocked Swiggy from tracking your location. To use this, change your location settings in browser.",GEO_POSITION_UNAVAILABLE:"We are unable to fetch your location currently.",GEO_TIMEOUT:"We are unable to fetch your location currently.",GEO_NOT_SUPPORTED:"Geolocation is not supported by your browser",UNKNOWN_ERROR:"Oops! something went wrong. Please try entering your location again"},i={HOME:"home",WORK:"work"},a={HOME_ICON:"icon-home",WORK_ICON:"icon-work",LOCATION_ICON_MARKER:"icon-location",LOCATION_ICON_RECENT:"icon-recent",USE_CURRENT_LOCATION_ICON:"icon-location-crosshair"},c=2,u=3,l=200,s={timeout:5e3,enableHighAccuracy:!0},f={WIDTH:202,HEIGHT:200,ID:"empty_location_unserviceable_3x_dt3civ"}}}); //# sourceMappingURL=home.8e2d1c24258e304.js.map