(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{188:function(e,t,a){e.exports=a(420)},420:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),o=a(25),l=a(171),i=a(172),s=a.n(i),c=a(51),m=(a(73),a(20)),u=a.n(m),p="http://78.128.6.13:8080",h="REQUEST_HOTEL_OVERVIEW";var d="RECEIVE_HOTEL_OVERVIEW";function b(e){return{type:d,isFetching:!1,hotelOverview:e,receivedAt:Date.now()}}var v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{hotelOverview:{description:"",properties:[]}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case h:return Object.assign({},e,{isFetching:!0});case d:return Object.assign({},e,{isFetching:!1,hotelOverview:t.hotelOverview});default:return e}},E="REQUEST_HOTEL_DESCRIPTION";var f="RECEIVE_HOTEL_DESCRIPTION";function g(e){return{type:f,isFetching:!1,hotelDescription:e,receivedAt:Date.now()}}var O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{hotelDescription:{title:"",subTitle:"",description:""}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case E:return Object.assign({},e,{isFetching:!0});case f:return Object.assign({},e,{isFetching:!1,hotelDescription:t.hotelDescription});default:return e}},N="REQUEST_HOTEL_RATES";var y="RECEIVE_HOTEL_RATES";function j(e){return{type:y,isFetching:!1,hotelRates:e,receivedAt:Date.now()}}function w(e){return function(t){return u()(p+"/api/hotelRates",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(e){return t(j(e))})}}var R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{hotelRates:{title:"",properties:[],url:""}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case N:return Object.assign({},e,{isFetching:!0});case y:return Object.assign({},e,{isFetching:!1,hotelRates:t.hotelRates});default:return e}},k="REQUEST_HOTEL_HOUSE_RATES";var C="RECEIVE_HOTEL_HOUSE_RATES";function S(e){return{type:C,isFetching:!1,hotelHouseRates:e,receivedAt:Date.now()}}function x(e){return function(t){return u()(p+"/api/hotelHouseRates",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(e){return t(S(e))})}}var D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{hotelHouseRates:{title:"",properties:[],url:"",description:""}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case k:return Object.assign({},e,{isFetching:!0});case C:return Object.assign({},e,{isFetching:!1,hotelHouseRates:t.hotelHouseRates});default:return e}},I="REQUEST_MAIL";var T="RECEIVE_MAIL";function A(e){return function(t){return t({type:I,mail:{},isFetching:!0}),u()(p+"/api/sendMail",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(e){return t(function(e){return{type:T,isFetching:!1,mail:e,receivedAt:Date.now()}}(e))})}}var P=a(19),H=a.n(P);var _=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{mail:{result:!1}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case I:return Object.assign({},e,{isFetching:!0});case T:return Object.assign({},e,{isFetching:!1,mail:t.mail});default:return e}},F=Object(c.combineReducers)({hotelDescription:O,hotelOverview:v,hotelRates:R,hotelHouseRates:D,mail:_}),L=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function Y(e){navigator.serviceWorker.register(e).then(function(e){e.onupdatefound=function(){var t=e.installing;t.onstatechange=function(){"installed"===t.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}}).catch(function(e){console.error("Error during service worker registration:",e)})}var M=a(6),W=a(7),U=a(12),B=a(13),V=a(15),J=a(14),z=a(16),Q=a(3),q=a(179);function K(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name;this.setState(Object(q.a)({},n,a))}function G(e){this.props.onSubmit(this.state),e.preventDefault()}var $=function(e){function t(e){var a;return Object(U.a)(this,t),(a=Object(V.a)(this,Object(J.a)(t).call(this,e))).handleInputChange=K.bind(Object(Q.a)(Object(Q.a)(a))),a.handleSubmit=G.bind(Object(Q.a)(Object(Q.a)(a))),a.state={title:a.props.hotelDescription.title,subTitle:a.props.hotelDescription.subTitle,description:a.props.hotelDescription.description},a.handleInputChange=a.handleInputChange.bind(Object(Q.a)(Object(Q.a)(a))),a.handleSubmit=a.handleSubmit.bind(Object(Q.a)(Object(Q.a)(a))),a}return Object(z.a)(t,e),Object(B.a)(t,[{key:"componentWillReceiveProps",value:function(e){this.setState(Object.assign({},e.hotelDescription))}},{key:"render",value:function(){return r.a.createElement("div",{className:"react"},r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement("div",null,r.a.createElement("input",{name:"title",type:"text",value:this.state.title,className:"form-control",onChange:this.handleInputChange})),r.a.createElement("div",null,r.a.createElement("input",{name:"subTitle",type:"text",value:this.state.subTitle,className:"form-control",onChange:this.handleInputChange})),r.a.createElement("div",null,r.a.createElement("textarea",{name:"description",rows:4,value:this.state.description,className:"form-control",onChange:this.handleInputChange})),r.a.createElement("br",null),r.a.createElement("button",{type:"submit",className:"btn btn-primary"},"\u0417\u0430\u043f\u0438\u0448\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f\u0442\u0430")))}}]),t}(n.Component);var X=Object(M.b)(function(e,t){return{hotelDescription:e.hotelDescription.hotelDescription}},function(e,t){return{onSubmit:function(t){e(function(e){return function(t){return u()(p+"/api/hotelDescription",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(e){return t(g(e))})}}(t))}}})($),Z=(a(50),function(e){function t(){return Object(U.a)(this,t),Object(V.a)(this,Object(J.a)(t).call(this))}return Object(z.a)(t,e),Object(B.a)(t,[{key:"render",value:function(){return r.a.createElement("div",{className:"react"},r.a.createElement("h3",{className:"mt-4 mb-0 pb-0 text-uppercase"},this.props.hotelDescription.title),r.a.createElement("div",{className:"divider divider-primary divider-small mb-4 mt-0"},r.a.createElement("hr",{className:"mt-2 mr-auto"})),r.a.createElement("p",{className:"lead"},this.props.hotelDescription.subTitle),r.a.createElement("p",{className:"mt-4"},this.props.hotelDescription.description),r.a.createElement("a",{className:"btn btn-primary btn-lg text-2 text-uppercase mt-2 mb-4",href:"#"},"\u041d\u0430\u0443\u0447\u0435\u0442\u0435 \u043f\u043e\u0432\u0435\u0447\u0435"))}}]),t}(n.Component));var ee=Object(M.b)(function(e,t){return{hotelDescription:e.hotelDescription.hotelDescription}})(Z),te=a(26),ae=function(e){function t(e){var a;return Object(U.a)(this,t),(a=Object(V.a)(this,Object(J.a)(t).call(this,e))).state={description:a.props.hotelOverview.description,properties:a.props.hotelOverview.properties},a.handleInputChange=K.bind(Object(Q.a)(Object(Q.a)(a))),a.handleSubmit=G.bind(Object(Q.a)(Object(Q.a)(a))),a.handlePropertyChange=a.handlePropertyChange.bind(Object(Q.a)(Object(Q.a)(a))),a}return Object(z.a)(t,e),Object(B.a)(t,[{key:"handlePropertyChange",value:function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name,r=Object(te.a)(this.state.properties);r[n]=a,this.setState({properties:r})}},{key:"componentWillReceiveProps",value:function(e){this.setState(Object.assign({},e.hotelOverview))}},{key:"render",value:function(){for(var e=[],t=0;t<3;t++){for(var a=[],n=0;n<3;n++)a.push(r.a.createElement("li",{key:t+" "+n},r.a.createElement("i",{className:"fas fa-check"}),r.a.createElement("input",{name:3*t+n,type:"text",value:this.state.properties[3*t+n],className:"form-control",onChange:this.handlePropertyChange})));e.push(r.a.createElement("div",{key:t,className:"col-lg-4"},r.a.createElement("ul",{className:"list list-icons list-primary list-borders text-uppercase text-color-dark text-2"},a)))}return r.a.createElement("div",{className:"react"},r.a.createElement("h3",{className:"mt-4 mb-0 pb-0 text-uppercase"},"\u0417\u0410 \u0425\u041e\u0422\u0415\u041b\u0410"),r.a.createElement("div",{className:"divider divider-primary divider-small mb-4 mt-0"},r.a.createElement("hr",{className:"mt-2 mr-auto"})),r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement("div",null,r.a.createElement("textarea",{name:"description",rows:3,value:this.state.description,className:"form-control",onChange:this.handleInputChange})),r.a.createElement("div",{className:"row"},e),r.a.createElement("br",null),r.a.createElement("button",{type:"submit",className:"btn btn-primary"},"\u0417\u0430\u043f\u0438\u0448\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f\u0442\u0430")))}}]),t}(n.Component);var ne=Object(M.b)(function(e,t){return{hotelOverview:e.hotelOverview.hotelOverview}},function(e,t){return{onSubmit:function(t){var a;e((a=t,function(e){return u()(p+"/api/hotelOverview",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(t){return e(b(t))})}))}}})(ae),re=function(e){function t(){return Object(U.a)(this,t),Object(V.a)(this,Object(J.a)(t).call(this))}return Object(z.a)(t,e),Object(B.a)(t,[{key:"render",value:function(){for(var e=[],t=0;t<3;t++){for(var a=[],n=0;n<3;n++){var o=this.props.hotelOverview.properties[3*t+n];o&&a.push(r.a.createElement("li",null,r.a.createElement("i",{className:"fas fa-check"})," ",o))}e.push(r.a.createElement("div",{className:"col-lg-4"},r.a.createElement("ul",{className:"list list-icons list-primary list-borders text-uppercase text-color-dark text-2"},a)))}var l=[];return this.props.expanded?l.push(r.a.createElement("p",{className:"mt-4"},this.props.hotelOverview.description)):l.push(r.a.createElement("p",{className:"mt-4"},this.props.hotelOverview.description.substring(0,230)," ",r.a.createElement("a",{href:"hotel.html",className:"custom-rtl-link-fix",title:""},"(\u0412\u0438\u0436\u0442\u0435 \u041f\u043e\u0432\u0435\u0447\u0435...)"))),r.a.createElement("div",{className:"react"},r.a.createElement("h3",{className:"mt-4 mb-0 pb-0 text-uppercase"},"\u0417\u0410 \u0425\u041e\u0422\u0415\u041b\u0410"),r.a.createElement("div",{className:"divider divider-primary divider-small mb-4 mt-0"},r.a.createElement("hr",{className:"mt-2 mr-auto"})),l,r.a.createElement("div",{className:"row"},e))}}]),t}(n.Component);var oe=Object(M.b)(function(e,t){return{hotelOverview:e.hotelOverview.hotelOverview,expanded:!1}})(re),le=function(e){function t(){return Object(U.a)(this,t),Object(V.a)(this,Object(J.a)(t).call(this))}return Object(z.a)(t,e),Object(B.a)(t,[{key:"render",value:function(){for(var e=this.props.hotelRates,t=[],a=0;a<e.properties.length;a++)t.push(r.a.createElement("li",{key:a},r.a.createElement("label",null,e.properties[a].key),r.a.createElement("span",null,e.properties[a].value)));return r.a.createElement("div",{className:"col-md-6 col-lg-4 isotope-item rooms mb-4 pb-3"},r.a.createElement("a",{href:this.props.detailsUrl+"/"+this.props.hotelRateKey},r.a.createElement("span",{className:"thumb-info thumb-info-centered-info thumb-info-no-borders"},r.a.createElement("span",{className:"thumb-info-wrapper"},r.a.createElement("img",{src:e.url,className:"img-fluid"}),r.a.createElement("span",{className:"thumb-info-title"},r.a.createElement("span",{className:"thumb-info-inner"},"\u0412\u0438\u0436\u0442\u0435 \u0434\u0435\u0442\u0430\u0439\u043b\u0438"))))),r.a.createElement("h5",{className:"mt-3 mb-0"},this.props.hotelRates.title),r.a.createElement("div",{className:"room-suite-info"},r.a.createElement("ul",null,t,r.a.createElement("li",null,r.a.createElement("a",{href:this.props.detailsUrl+"/"+this.props.hotelRateKey,className:"room-suite-info-detail",title:!0},"\u0412\u0438\u0436\u0442\u0435 \u043f\u043e\u0432\u0435\u0447\u0435 ",r.a.createElement("i",{className:"fas fa-long-arrow-alt-right"})),r.a.createElement("a",{href:"hotel-book.html",className:"room-suite-info-book",title:!0},"\u0420\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0430\u0439\u0442\u0435 \u0441\u0435\u0433\u0430")))))}}]),t}(n.Component),ie=function(e){function t(){return Object(U.a)(this,t),Object(V.a)(this,Object(J.a)(t).call(this))}return Object(z.a)(t,e),Object(B.a)(t,[{key:"render",value:function(){for(var e=this.props.hotelRates,t=[],a=0;a<e.length;a++)t.push(r.a.createElement(le,{hotelRates:e[a],key:a,detailsUrl:this.props.detailsUrl,hotelRateKey:a}));return r.a.createElement("div",null,r.a.createElement("div",{className:"row mb-4"},r.a.createElement("div",{className:"col"},r.a.createElement("div",{className:"row"},r.a.createElement("br",null),r.a.createElement("br",null)),r.a.createElement("div",{className:""},r.a.createElement("div",{className:"row mb-4 portfolio-list"},t)))))}}]),t}(n.Component),se=Object(M.b)(function(e,t){return{hotelRates:e.hotelRates.hotelRates,detailsUrl:"hotel-rooms-rates.html#/details"}})(ie),ce=function(e){function t(e){var a;return Object(U.a)(this,t),(a=Object(V.a)(this,Object(J.a)(t).call(this,e))).state={title:a.props.hotelRates.title,properties:a.props.hotelRates.properties,url:a.props.hotelRates.url,images:a.props.hotelRates.images,description:a.props.hotelRates.description,_id:a.props.hotelRates._id},a.handleInputChange=K.bind(Object(Q.a)(Object(Q.a)(a))),a.handleSubmit=G.bind(Object(Q.a)(Object(Q.a)(a))),a.handlePropertyChange=a.handlePropertyChange.bind(Object(Q.a)(Object(Q.a)(a))),a}return Object(z.a)(t,e),Object(B.a)(t,[{key:"handleSubmit",value:function(e){}},{key:"handlePropertyChange",value:function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,n=t.name,r=Object(te.a)(this.state.properties);t.classList.contains("key")?r[n].key=a:t.classList.contains("value")&&(r[n].value=a),this.setState({properties:r})}},{key:"deleteProperty",value:function(e){this.state.properties.length<=1||this.setState({properties:Object(te.a)(this.state.properties.slice(0,e)).concat(Object(te.a)(this.state.properties.slice(e+1)))})}},{key:"addProperty",value:function(e){this.setState({properties:Object(te.a)(this.state.properties.slice(0,e+1)).concat([{key:"",value:""}],Object(te.a)(this.state.properties.slice(e+1)))})}},{key:"componentWillReceiveProps",value:function(e){this.setState(Object.assign({},e.hotelRates))}},{key:"componentDidMount",value:function(){var e=this;window.runImageUpload(this.state._id),window.imageEvent[this.state._id].initEvent("imageReady"+this.state._id,!0,!0),window.addEventListener("imageReady"+this.state._id,function(t){e.setState({url:"https://res.cloudinary.com/df3euu0sz/image/upload/v1532481656/"+t.data[0].public_id}),console.log(t)},!1)}},{key:"render",value:function(){for(var e=this,t=this.state,a=this,n=[],o=function(o){n.push(r.a.createElement("li",{key:o},r.a.createElement("div",{className:"row",style:{marginLeft:0,marginRight:"0px"}},r.a.createElement("div",{className:"col-md-2",style:{padding:0}},r.a.createElement("img",{src:"img/ok.png",style:{marginRight:"10px"},width:"15px",onClick:function(){a.addProperty(o)}}),r.a.createElement("img",{src:"img/delete.png",width:"15px",onClick:function(){a.deleteProperty(o)}})),r.a.createElement("input",{name:o,value:t.properties[o].key,type:"text",className:"form-control col-md-5 key",onChange:e.handlePropertyChange}),r.a.createElement("input",{name:o,type:"text",key:o,value:t.properties[o].value,className:"form-control col-md-5 value",onChange:e.handlePropertyChange}))))},l=0;l<t.properties.length;l++)o(l);return r.a.createElement("div",{className:"col-md-6 col-lg-4 isotope-item rooms mb-4 pb-3"},r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement("a",{id:"upload_widget_opener"+this.state._id},r.a.createElement("span",{className:"thumb-info thumb-info-centered-info thumb-info-no-borders"},r.a.createElement("span",{className:"thumb-info-wrapper"},r.a.createElement("img",{src:this.state.url,className:"img-fluid",alt:!0}),r.a.createElement("span",{className:"thumb-info-title"},r.a.createElement("span",{className:"thumb-info-inner"},"\u041a\u0430\u0447\u0438 \u0441\u043d\u0438\u043c\u043a\u0430"))))),r.a.createElement("h5",{className:"mt-3 mb-0"},r.a.createElement("input",{name:"title",type:"text",value:t.title,className:"form-control",onChange:this.handleInputChange})),r.a.createElement("div",{className:"room-suite-info"},r.a.createElement("ul",null,n,r.a.createElement("li",{style:{marginTop:"10px"}},r.a.createElement("button",{type:"submit",className:"btn btn-primary pull-left"},"\u0417\u0430\u043f\u0438\u0448\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f\u0442\u0430"),r.a.createElement("img",{src:"img/ok.png",title:"\u0414\u043e\u0431\u0430\u0432\u0438 \u043d\u043e\u0432 \u0442\u0438\u043f \u0441\u0442\u0430\u044f",style:{marginRight:"10px",marginLeft:"30px"},width:"40px",onClick:this.props.addRates}),r.a.createElement("img",{src:"img/delete.png",title:"\u0418\u0437\u0442\u0440\u0438\u0439 \u0442\u0438\u043f\u0430 \u0441\u0442\u0430\u044f",width:"40px",onClick:this.props.deleteRates}))))))}}]),t}(n.Component),me=function(e){function t(e){var a;return Object(U.a)(this,t),(a=Object(V.a)(this,Object(J.a)(t).call(this,e))).state={hotelRates:a.props.hotelRates},a}return Object(z.a)(t,e),Object(B.a)(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({hotelRates:e.hotelRates})}},{key:"deleteRates",value:function(e,t){this.state.hotelRates.length<=1||(this.setState({hotelRates:Object(te.a)(this.state.hotelRates.slice(0,e)).concat(Object(te.a)(this.state.hotelRates.slice(e+1)))}),this.props.onDeleteRate(t))}},{key:"addRates",value:function(e){var t={title:"\u0422\u0438\u043f \u043d\u0430 \u0441\u0442\u0430\u044f",properties:[{key:"\u0415\u043a\u0441\u0442\u0440\u0438",value:"\u0438\u043c\u0430/\u043d\u044f\u043c\u0430"}],description:"\u0422\u043e\u0432\u0430 \u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u0442\u043e \u043d\u0430 \u0441\u0442\u0430\u044f\u0442\u0430",url:"https://res.cloudinary.com/df3euu0sz/image/upload/v1532481656/iomxrfbtffximwmeizta",images:["https://res.cloudinary.com/df3euu0sz/image/upload/v1532481656/iomxrfbtffximwmeizta"]};this.setState({hotelRates:Object(te.a)(this.state.hotelRates.slice(0,e+1)).concat([t],Object(te.a)(this.state.hotelRates.slice(e+1)))}),this.props.onAddRate(t)}},{key:"render",value:function(){for(var e=this,t=[],a=this,n=function(n){t.push(r.a.createElement(ce,{key:n,onSubmit:e.props.onSubmit,hotelRates:e.state.hotelRates[n],addRates:function(){a.addRates(n)},deleteRates:function(){a.deleteRates(n,a.state.hotelRates[n])}}))},o=0;o<this.state.hotelRates.length;o++)n(o);return r.a.createElement("section",{className:"section section-no-background section-no-border m-0 p-0"},r.a.createElement("div",{className:"container"},r.a.createElement("div",{className:"row mb-4"},r.a.createElement("div",{className:"col"},r.a.createElement("div",{className:""},r.a.createElement("div",{className:"row mb-4 portfolio-list",style:{paddingTop:"40px"}},t))))))}}]),t}(n.Component);function ue(e){return e.images=e.images||[""],e.images[0]=e.url,e}var pe=Object(M.b)(function(e,t){return{hotelRates:e.hotelRates.hotelRates}},function(e,t){return{onSubmit:function(t){t=ue(t),e(w(t))},onAddRate:function(t){t=ue(t),e(function(e){return function(t){return u()(p+"/api/hotelRates",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(e){return t(j(e))})}}(t))},onDeleteRate:function(t){t=ue(t),e(function(e){return function(t){return u()(p+"/api/hotelRates",{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(e){return t(j(e))})}}(t))}}})(me),he=function(e){function t(){return Object(U.a)(this,t),Object(V.a)(this,Object(J.a)(t).call(this))}return Object(z.a)(t,e),Object(B.a)(t,[{key:"render",value:function(){var e=this.props.hotelRates[this.props.match.params.id];e||(e={properties:[],images:[]});for(var t=[],a=0;a<e.properties.length;a++)t.push(r.a.createElement("li",{key:a},r.a.createElement("label",null,e.properties[a].key),r.a.createElement("span",null,e.properties[a].value)));for(var n=[],o=0;o<e.images.length;o++)n.push(r.a.createElement("div",null,r.a.createElement("img",{src:e.images[o],className:"img-fluid",alt:""})));return r.a.createElement("section",{className:"section section-no-background section-no-border m-0 p-0"},r.a.createElement("div",{className:"container"},r.a.createElement("div",{className:"row mb-4"},r.a.createElement("div",{className:"col"},r.a.createElement("h3",{className:"mt-4 pt-4 mb-0 pb-0 text-uppercase"},e.title),r.a.createElement("div",{className:"divider divider-primary divider-small mb-4 mt-0"},r.a.createElement("hr",{className:"mt-2 mr-auto"})),r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-lg-7"},r.a.createElement("p",{className:"mt-4 lead"},e.description),r.a.createElement("div",{className:"room-suite-info"},r.a.createElement("ul",null,t,r.a.createElement("li",null,r.a.createElement("a",{href:"hotel-book.html",className:"btn btn-primary btn-lg text-2 text-uppercase mt-2 room-suite-info-book-now",title:!0},"\u0420\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0430\u0439\u0442\u0435 \u0441\u0435\u0433\u0430"))))),r.a.createElement("div",{className:"col-lg-5"},r.a.createElement("div",{className:""},r.a.createElement("div",{className:"owl-carousel owl-theme nav-inside box-shadow-custom mt-4","data-plugin-options":"{'items': 1, 'margin': 10, 'animateOut': 'fadeOut', 'autoplay': true, 'autoplayTimeout': 3000}"},n))))))))}}]),t}(n.Component),de=Object(M.b)(function(e,t){return{hotelRates:e.hotelRates.hotelRates}})(he),be=Object(M.b)(function(e,t){return{hotelRates:e.hotelHouseRates.hotelHouseRates,detailsUrl:"hotel-house-rates.html#/details-house"}})(ie);function ve(e){return e.images=e.images||[""],e.images[0]=e.url,e}var Ee=Object(M.b)(function(e,t){return{hotelRates:e.hotelHouseRates.hotelHouseRates}},function(e,t){return{onSubmit:function(t){t=ve(t),e(x(t))},onAddRate:function(t){t=ve(t),e(function(e){return function(t){return u()(p+"/api/hotelHouseRates",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(e){return t(S(e))})}}(t))},onDeleteRate:function(t){t=ve(t),e(function(e){return function(t){return u()(p+"/api/hotelHouseRates",{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(e){return t(S(e))})}}(t))}}})(me),fe=Object(M.b)(function(e,t){return{hotelRates:e.hotelHouseRates.hotelHouseRates}})(he),ge=function(e){function t(e){var a;Object(U.a)(this,t);var n=(a=Object(V.a)(this,Object(J.a)(t).call(this,e))).props.hotelRates[a.props.match.params.id];return n||(n={}),a.state={title:n.title,properties:n.properties,url:n.url,description:n.description,images:n.images,_id:n._id},a.handleInputChange=K.bind(Object(Q.a)(Object(Q.a)(a))),a.handleSubmit=G.bind(Object(Q.a)(Object(Q.a)(a))),a.addImage=a.addImage.bind(Object(Q.a)(Object(Q.a)(a))),a.deleteImage=a.deleteImage.bind(Object(Q.a)(Object(Q.a)(a))),a}return Object(z.a)(t,e),Object(B.a)(t,[{key:"componentWillReceiveProps",value:function(e){var t=this,a=e.hotelRates[this.props.match.params.id];a||(a={}),this.setState(Object.assign({},a),function(){t.addImageWidgets()})}},{key:"componentDidMount",value:function(){this.addImageWidgets()}},{key:"addImageWidgets",value:function(){var e=this;if(this.state.images)for(var t=function(t){window.runImageUpload(t),window.imageEvent[t].initEvent("imageReady"+t,!0,!0),window.addEventListener("imageReady"+t,function(a){var n=e.state.images;n[t]="https://res.cloudinary.com/df3euu0sz/image/upload/v1532481656/"+a.data[0].public_id,e.setState({images:n}),console.log(a)},!1)},a=1;a<this.state.images.length;a++)t(a)}},{key:"addImage",value:function(e){var t=this,a=this.state.images;a.splice(e+1,0,"https://res.cloudinary.com/df3euu0sz/image/upload/v1532481656/iomxrfbtffximwmeizta"),this.setState({images:a},function(){t.addImageWidgets()})}},{key:"deleteImage",value:function(e){var t=this,a=this.state.images;a=Object(te.a)(a.slice(0,e)).concat(Object(te.a)(a.slice(e+1))),this.setState({images:a},function(){t.addImageWidgets()})}},{key:"render",value:function(){var e=this,t=this.props.hotelRates[this.props.match.params.id];t||(t={properties:[]});for(var a=[],n=0;n<t.properties.length;n++)a.push(r.a.createElement("li",{key:n},r.a.createElement("label",null,t.properties[n].key),r.a.createElement("span",null,t.properties[n].value)));var o=[],l=this.state.images;return l&&function(){for(var t=e,a=function(e){e>0?o.push(r.a.createElement("div",null,r.a.createElement("div",null,r.a.createElement("a",{id:"upload_widget_opener"+e},r.a.createElement("span",{className:"thumb-info thumb-info-centered-info thumb-info-no-borders"},r.a.createElement("span",{className:"thumb-info-wrapper"},r.a.createElement("img",{src:l[e],className:"img-fluid",alt:!0}),r.a.createElement("span",{className:"thumb-info-title"},r.a.createElement("span",{className:"thumb-info-inner"},"\u041a\u0430\u0447\u0438 \u0441\u043d\u0438\u043c\u043a\u0430")))))),r.a.createElement("br",null),r.a.createElement("div",null,r.a.createElement("img",{src:"img/ok.png",title:"\u0414\u043e\u0431\u0430\u0432\u0438 \u043d\u043e\u0432\u0430 \u0441\u043d\u0438\u043c\u043a\u0430",style:{marginRight:"10px",marginLeft:"30px"},width:"40px",onClick:function(){t.addImage(e)}}),r.a.createElement("img",{src:"img/delete.png",title:"\u0418\u0437\u0442\u0440\u0438\u0439 \u0442\u0438\u043f\u0430 \u0441\u0442\u0430\u044f",width:"40px",onClick:function(){t.deleteImage(e)}})),r.a.createElement("br",null))):o.push(r.a.createElement("div",null,r.a.createElement("div",null,r.a.createElement("img",{src:l[e],height:"250px"})),r.a.createElement("br",null),r.a.createElement("div",null,r.a.createElement("img",{src:"img/ok.png",title:"\u0414\u043e\u0431\u0430\u0432\u0438 \u043d\u043e\u0432\u0430 \u0441\u043d\u0438\u043c\u043a\u0430",style:{marginRight:"10px",marginLeft:"30px"},width:"40px",onClick:function(){t.addImage(e)}})),r.a.createElement("br",null)))},n=0;n<l.length;n++)a(n)}(),r.a.createElement("section",{className:"section section-no-background section-no-border m-0 p-0"},r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement("div",{className:"container"},r.a.createElement("div",{className:"row mb-4"},r.a.createElement("div",{className:"col"},r.a.createElement("h3",{className:"mt-4 pt-4 mb-0 pb-0 text-uppercase"},t.title),r.a.createElement("div",{className:"divider divider-primary divider-small mb-4 mt-0"},r.a.createElement("hr",{className:"mt-2 mr-auto"})),r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-lg-7"},r.a.createElement("p",{className:"mt-4 lead"},r.a.createElement("textarea",{name:"description",cols:"70",rows:"8",className:"form-control",onChange:this.handleInputChange,value:this.state.description})),r.a.createElement("div",{className:"room-suite-info"},r.a.createElement("ul",null,a,r.a.createElement("li",null,r.a.createElement("br",null),r.a.createElement("button",{type:"submit",className:"btn btn-primary pull-right"},"\u0417\u0430\u043f\u0438\u0448\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f\u0442\u0430"))))),r.a.createElement("div",{className:"col-lg-5"},r.a.createElement("div",null,o))))))))}}]),t}(n.Component),Oe=Object(M.b)(function(e,t){return{hotelRates:e.hotelHouseRates.hotelHouseRates}},function(e,t){return{onSubmit:function(t){e(x(t))}}})(ge),Ne=a(71),ye=a(92),je=(a(406),a(180)),we=a.n(je),Re=function(e){function t(e){var a;Object(U.a)(this,t),(a=Object(V.a)(this,Object(J.a)(t).call(this,e))).handleInputChange=K.bind(Object(Q.a)(Object(Q.a)(a)));var n=we.a.parse(window.location.search),r=n.arriveDate?H()(n.arriveDate,"DD/MM/YYYY"):H()(),o=n.departureDate?H()(n.departureDate,"DD/MM/YYYY"):H()(),l=n.kids||0,i=n.adults||0;return a.state={selected:{},name:"",phone:"",arriveDate:r,departureDate:o,adults:i,kids:l,agree:!1,isArriveSelected:!1,isDepartureSelected:!1,isDisabled:!1},a.handleInputChange=a.handleInputChange.bind(Object(Q.a)(Object(Q.a)(a))),a.handleArriveChange=a.handleArriveChange.bind(Object(Q.a)(Object(Q.a)(a))),a.handleDepartureChange=a.handleDepartureChange.bind(Object(Q.a)(Object(Q.a)(a))),a.sendEmail=a.sendEmail.bind(Object(Q.a)(Object(Q.a)(a))),a.isSent=!1,a}return Object(z.a)(t,e),Object(B.a)(t,[{key:"componentWillReceiveProps",value:function(e){e.mail.result&&!this.isSent&&(this.props.alert.success("\u0417\u0430\u043f\u0438\u0442\u0432\u0430\u043d\u0435\u0442\u043e \u0435 \u0438\u0437\u043f\u0440\u0430\u0442\u0435\u043d\u043e. \u041e\u0447\u0430\u043a\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u0430\u0436\u0434\u0430\u043d\u0435."),this.setState({isDisabled:!0}),this.isSent=!0)}},{key:"sendEmail",value:function(e){e.preventDefault();var t=!0;this.state.phone?0===Object.keys(this.state.selected).length?(this.props.alert.error("\u041c\u043e\u043b\u044f \u0438\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0441\u0442\u0430\u044f"),t=!1):this.state.agree?this.state.name?this.state.adults?0==this.state.kids?(this.props.alert.error("\u041c\u043e\u043b\u044f \u0438\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0431\u0440\u043e\u0439 \u0434\u0435\u0446\u0430"),t=!1):this.state.isArriveSelected&&this.state.isDepartureSelected||(this.props.alert.error("\u041c\u043e\u043b\u044f \u0438\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u043d\u0430\u0447\u0430\u043b\u043d\u0430 \u0438 \u043a\u0440\u0430\u0439\u043d\u0430 \u0434\u0430\u0442\u0430"),t=!1):(this.props.alert.error("\u041c\u043e\u043b\u044f \u0438\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0431\u0440\u043e\u0439 \u0432\u044a\u0437\u0440\u0430\u0441\u0442\u043d\u0438"),t=!1):(this.props.alert.error("\u041c\u043e\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u0435\u0442\u0435 \u0438\u043c\u0435 \u0437\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442"),t=!1):(this.props.alert.error("\u041c\u043e\u043b\u044f \u0441\u044a\u0433\u043b\u0430\u0441\u0435\u0442\u0435 \u0441\u0435 \u0441 \u043e\u0431\u0449\u0438\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f"),t=!1):(this.props.alert.error("\u041c\u043e\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u0435\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u0438\u044f \u0441\u0438 \u043d\u043e\u043c\u0435\u0440"),t=!1),t&&this.props.onSubmit(this.state)}},{key:"handleArriveChange",value:function(e){this.setState({arriveDate:e,isArriveSelected:!0})}},{key:"handleDepartureChange",value:function(e){this.setState({departureDate:e,isDepartureSelected:!0})}},{key:"findPropertyValue",value:function(e,t){t=t.toLowerCase();for(var a=0;a<e.length;a++)if(e[a].key.toLowerCase()==t)return e[a].value}},{key:"onRadioChanged",value:function(e){this.setState({selected:this.props.hotelRates[e.currentTarget.value]})}},{key:"onHouseRadioChanged",value:function(e){this.setState({selected:this.props.hotelHouseRates[e.currentTarget.value]})}},{key:"render",value:function(){for(var e=this.props.hotelRates,t=[],a=0;a<e.length;a++)t.push(r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-1 text-center"},r.a.createElement("label",{className:"mt-4 mb-4"},r.a.createElement("input",{type:"radio",name:"bookNowRoom",onChange:this.onRadioChanged.bind(this),value:a,id:"bookNowRoom"}))),r.a.createElement("div",{className:"col-2 d-none d-sm-block"},r.a.createElement("img",{src:e[a].url,className:"img-fluid"})),r.a.createElement("div",{className:"col-11 col-sm-9"},r.a.createElement("h5",{className:"mt-0 mb-0"},e[a].title),r.a.createElement("div",{className:"room-suite-info"},r.a.createElement("ul",null,r.a.createElement("li",null,r.a.createElement("label",null,"\u041b\u0415\u0413\u041b\u0410"),r.a.createElement("span",null,this.findPropertyValue(e[a].properties,"\u041b\u0415\u0413\u041b\u0410"))),r.a.createElement("li",null,r.a.createElement("label",null,"\u0426\u0415\u041d\u0410 \u041e\u0422"),r.a.createElement("strong",null,this.findPropertyValue(e[a].properties,"\u0426\u0415\u041d\u0410"))))))));e=this.props.hotelHouseRates;for(var n=[],o=0;o<e.length;o++)n.push(r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-1 text-center"},r.a.createElement("label",{className:"mt-4 mb-4"},r.a.createElement("input",{type:"radio",name:"bookNowRoom",onChange:this.onHouseRadioChanged.bind(this),value:o,id:"bookNowRoom"}))),r.a.createElement("div",{className:"col-2 d-none d-sm-block"},r.a.createElement("img",{src:e[o].url,className:"img-fluid"})),r.a.createElement("div",{className:"col-11 col-sm-9"},r.a.createElement("h5",{className:"mt-0 mb-0"},e[o].title),r.a.createElement("div",{className:"room-suite-info"},r.a.createElement("ul",null,r.a.createElement("li",null,r.a.createElement("label",null,"\u041b\u0415\u0413\u041b\u0410"),r.a.createElement("span",null,this.findPropertyValue(e[o].properties,"\u041b\u0415\u0413\u041b\u0410"))),r.a.createElement("li",null,r.a.createElement("label",null,"\u0426\u0415\u041d\u0410 \u041e\u0422"),r.a.createElement("strong",null,this.findPropertyValue(e[o].properties,"\u0426\u0415\u041d\u0410"))))))));return r.a.createElement("form",{onSubmit:this.sendEmail},r.a.createElement("div",{className:"row mt-5 mb-5"},r.a.createElement("div",{className:"col-lg-4"},r.a.createElement("section",{className:"section section-tertiary section-no-border p-5 mt-1 mb-4","data-plugin-sticky":!0,"data-plugin-options":"{'minWidth': 991, 'containerSelector': '.container', 'padding': {'top': 150}}"},r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("h4",{className:"mt-4 mb-4 pb-0 text-uppercase"},"\u0414\u0435\u0442\u0430\u0439\u043b\u0438 \u043d\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0430\u0446\u0438\u044f\u0442\u0430"))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("div",{className:"form-control-custom form-control-datepicker-custom"},r.a.createElement(Ne.a,{className:"form-control text-uppercase text-2",selected:this.state.arriveDate,onChange:this.handleArriveChange})))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("div",{className:"form-control-custom form-control-datepicker-custom"},r.a.createElement(Ne.a,{className:"form-control text-uppercase text-2 form-control-custom form-control-datepicker-custom",selected:this.state.departureDate,onChange:this.handleDepartureChange})))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("div",{className:"form-control-custom"},r.a.createElement("select",{className:"form-control text-uppercase text-2",name:"adults",id:"adults",onChange:this.handleInputChange,value:this.state.adults},r.a.createElement("option",{value:!0},"\u0412\u044a\u0437\u0440\u0430\u0441\u0442\u043d\u0438"),r.a.createElement("option",{value:1},"1"),r.a.createElement("option",{value:2},"2"),r.a.createElement("option",{value:3},"3"),r.a.createElement("option",{value:4},"4"))))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("div",{className:"form-control-custom"},r.a.createElement("select",{className:"form-control text-uppercase text-2",name:"kids",id:"kids",onChange:this.handleInputChange,value:this.state.kids},r.a.createElement("option",{value:0},"\u0414\u0435\u0446\u0430"),r.a.createElement("option",{value:-1},"0"),r.a.createElement("option",{value:1},"1"),r.a.createElement("option",{value:2},"2"),r.a.createElement("option",{value:3},"3"),r.a.createElement("option",{value:4},"4"))))))),r.a.createElement("div",{className:"col-lg-8"},r.a.createElement("section",{className:"section section-quaternary section-no-border text-light p-5 mt-1 mb-4"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col"},r.a.createElement("h4",{className:"mt-4 mb-4 pb-0 text-uppercase"},"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0441\u0442\u0430\u044f \u043e\u0442 \u0445\u043e\u0442\u0435\u043b\u0430"))),t,r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col"},r.a.createElement("h4",{className:"mt-4 mb-4 pb-0 text-uppercase"},"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0441\u0442\u0430\u044f \u043e\u0442 \u043a\u044a\u0449\u0430\u0442\u0430 \u0437\u0430 \u0433\u043e\u0441\u0442\u0438"))),n),r.a.createElement("section",{className:"section section-quaternary section-no-border text-light p-5 mt-1 mb-4"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col"},r.a.createElement("h4",{className:"mt-4 mb-4 pb-0 text-uppercase"},"\u0414\u0430\u043d\u043d\u0438 \u043d\u0430 \u0433\u043e\u0441\u0442\u0430"))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("label",{htmlFor:"name",className:"form-control-label"},"\u0418\u043c\u0435"),r.a.createElement("input",{type:"text",onChange:this.handleInputChange,value:this.state.name,className:"form-control",id:"name",name:"name"}))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("label",{htmlFor:"phone",className:"form-control-label"},"\u0422\u0435\u043b\u0435\u0444\u043e\u043d \u0437\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442"),r.a.createElement("input",{type:"phone",placeholder:"088 888 888",onChange:this.handleInputChange,value:this.state.phone,className:"form-control",id:"phone",name:"phone"}))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("br",null),r.a.createElement("label",{className:"form-control-label"},"\u0429\u0435 \u0441\u0435 \u0441\u0432\u044a\u0440\u0436\u0435\u043c \u0441 \u0432\u0430\u0441 \u043d\u0430 \u043f\u043e\u0441\u043e\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440, \u0437\u0430 \u0434\u0430 \u0432\u0438 \u043f\u043e\u0442\u0432\u044a\u0440\u0434\u0438\u043c \u0440\u0435\u0437\u0435\u0440\u0432\u0430\u0446\u0438\u044f\u0442\u0430.")))),r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col"},r.a.createElement("input",{type:"submit",defaultValue:"\u0418\u0437\u043f\u0440\u0430\u0442\u0438 \u0437\u0430\u043f\u0438\u0442\u0432\u0430\u043d\u0435",disabled:this.state.isDisabled,className:"btn btn-primary btn-lg btn-block text-uppercase p-4 mb-4"}))),r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col"},r.a.createElement("div",{className:"col-sm-12"},r.a.createElement("div",{className:"form-group"},r.a.createElement("div",null,r.a.createElement("label",{htmlFor:"agree"},"\u0421\u044a\u0433\u043b\u0430\u0441\u0438\u0435 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430 \u043b\u0438\u0447\u043d\u0438 \u0434\u0430\u043d\u043d\u0438")),r.a.createElement("input",{name:"agree",id:"agree",type:"checkbox",onChange:this.handleInputChange}),r.a.createElement("a",{href:"hotel.html",target:"_blank"},"\xa0\xa0\u041f\u0440\u043e\u0447\u0435\u0442\u043e\u0445 \u0438 \u0440\u0430\u0437\u0431\u0440\u0430\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e\u0442\u043e \u0432 \u041e\u0431\u0449\u0438\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0437\u0430 \u043f\u043e\u043b\u0437\u0432\u0430\u043d\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0430. \u041f\u043e\u0442\u0432\u044a\u0440\u0436\u0434\u0430\u0432\u0430\u043c, \u0447\u0435 \u0441\u044a\u043c \u0441\u044a\u0433\u043b\u0430\u0441\u0435\u043d/\u043d\u0430 \u043b\u0438\u0447\u043d\u0438\u0442\u0435 \u043c\u0438 \u0434\u0430\u043d\u043d\u0438 \u0434\u0430 \u0431\u044a\u0434\u0430\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0432\u0430\u043d\u0438."))))))))}}]),t}(n.Component),ke=Object(ye.b)(Re),Ce=Object(M.b)(function(e,t){return{hotelRates:e.hotelRates.hotelRates,hotelHouseRates:e.hotelHouseRates.hotelHouseRates,mail:e.mail.mail}},function(e,t){return{onSubmit:function(t){var a=Object.assign({},t);a.arriveDate=t.arriveDate.format("DD/MM/YYYY"),a.departureDate=t.departureDate.format("DD/MM/YYYY"),e(A(a))}}})(ke),Se=a(181),xe=a(182),De=function(e){function t(){var e;return Object(U.a)(this,t),(e=Object(V.a)(this,Object(J.a)(t).call(this))).handleInputChange=K.bind(Object(Q.a)(Object(Q.a)(e))),e.state={arriveDate:H()(),departureDate:H()(),adults:0,kids:0},e.handleArriveChange=e.handleArriveChange.bind(Object(Q.a)(Object(Q.a)(e))),e.handleDepartureChange=e.handleDepartureChange.bind(Object(Q.a)(Object(Q.a)(e))),e.handleInputChange=e.handleInputChange.bind(Object(Q.a)(Object(Q.a)(e))),e}return Object(z.a)(t,e),Object(B.a)(t,[{key:"getQueryData",value:function(e){return"arriveDate="+e.arriveDate.format("DD/MM/YYYY")+"&departureDate="+e.departureDate.format("DD/MM/YYYY")+"&kids="+e.kids+"&adults="+e.adults}},{key:"handleArriveChange",value:function(e){this.setState({arriveDate:e})}},{key:"handleDepartureChange",value:function(e){this.setState({departureDate:e})}},{key:"render",value:function(){return r.a.createElement("li",null,r.a.createElement("div",{className:"dropdown-mega-content"},r.a.createElement("form",{id:"bookFormHeader",action:"hotel-book.html",method:"POST"},r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("div",{className:"form-control-custom form-control-datepicker-custom"},r.a.createElement(Ne.a,{className:"form-control text-uppercase text-2",selected:this.state.arriveDate,onChange:this.handleArriveChange})))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col"},r.a.createElement("div",{className:"form-control-custom form-control-datepicker-custom"},r.a.createElement(Ne.a,{className:"form-control text-uppercase text-2 form-control-custom form-control-datepicker-custom",selected:this.state.departureDate,onChange:this.handleDepartureChange})))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col-lg-6"},r.a.createElement("div",{className:"form-control-custom"},r.a.createElement("select",{className:"form-control text-uppercase text-2",name:"adults",id:"adults",onChange:this.handleInputChange,value:this.state.adults},r.a.createElement("option",{value:!0},"\u0412\u044a\u0437\u0440\u0430\u0441\u0442\u043d\u0438"),r.a.createElement("option",{value:1},"1"),r.a.createElement("option",{value:2},"2"),r.a.createElement("option",{value:3},"3"),r.a.createElement("option",{value:4},"4")))),r.a.createElement("div",{className:"form-group col-lg-6"},r.a.createElement("div",{className:"form-control-custom"},r.a.createElement("select",{className:"form-control text-uppercase text-2",name:"kids",id:"kids",onChange:this.handleInputChange,value:this.state.kids},r.a.createElement("option",{value:!0},"\u0414\u0435\u0446\u0430"),r.a.createElement("option",{value:1},"1"),r.a.createElement("option",{value:2},"2"),r.a.createElement("option",{value:3},"3"),r.a.createElement("option",{value:4},"4"))))),r.a.createElement("div",{className:"form-row"},r.a.createElement("div",{className:"form-group col mb-0"},r.a.createElement("a",{href:"/hotel-book.html?"+this.getQueryData(this.state),className:"btn btn-secondary btn-lg btn-block text-uppercase text-2"},"\u041f\u0440\u043e\u0432\u0435\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u043d\u043e\u0441\u0442\u0442\u0430"))))))}}]),t}(n.Component);var Ie=Object(M.b)(function(e,t){return{hotelOverview:e.hotelOverview.hotelOverview,expanded:!0}})(re),Te=Object(M.b)(function(e,t){return{hotelRates:e.hotelRates.hotelRates}},function(e,t){return{onSubmit:function(t){e(w(t))}}})(ge),Ae=a(69),Pe=a(183),He=new Ae.a;function _e(){var e=He.get("username"),t=He.get("password");return e&&t?"?username="+e+"&password="+t:""}var Fe=function(e){function t(){var e,a;Object(U.a)(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(a=Object(V.a)(this,(e=Object(J.a)(t)).call.apply(e,[this].concat(r)))).state={open:!0,email:"",password:""},a.onOpenModal=function(){a.setState({open:!0})},a.onCloseModal=function(){a.setState({open:!1})},a.login=function(){if(a.state.email&&a.state.password){a.writeCookie("username",a.state.email,3),a.writeCookie("password",a.state.password,3);var e=Object(Q.a)(Object(Q.a)(a));u()(p+"/api/authenticate"+_e()).then(function(t){401==t.status&&e.props.history.push("/login"),200==t.status&&e.props.history.push("/")})}},a.writeCookie=function(e,t,a){var n=new Date;return n.setTime(+n+36e5*a),window.document.cookie=e+"="+t+"; expires="+n.toGMTString()+"; path=/",t},a.changeEmail=function(e){a.setState({email:e.target.value})},a.changePassword=function(e){a.setState({password:e.target.value})},a}return Object(z.a)(t,e),Object(B.a)(t,[{key:"render",value:function(){var e=this.state.open;return r.a.createElement("div",null,r.a.createElement("button",{class:"btn btn-primary",onClick:this.onOpenModal},"Press here to log in"),r.a.createElement(Pe.a,{open:e,classNames:{modal:"modal-login-react"},onClose:this.onCloseModal,center:!0},r.a.createElement("div",{className:"container"},r.a.createElement("form",{className:"form-signin"},r.a.createElement("h2",{className:"form-signin-heading"},"Please sign in"),r.a.createElement("label",{htmlFor:"email",className:"sr-only"},"Email address"),r.a.createElement("input",{type:"text",id:"email",onChange:this.changeEmail.bind(this),className:"form-control",placeholder:"Email address",required:!0,autoFocus:!0}),r.a.createElement("br",null),r.a.createElement("label",{htmlFor:"password",className:"sr-only"},"Password"),r.a.createElement("input",{type:"password",id:"password",onChange:this.changePassword.bind(this),className:"form-control",placeholder:"Password",required:!0}),r.a.createElement("br",null),r.a.createElement("button",{className:"btn btn-lg btn-primary btn-block",onClick:this.login.bind(this),type:"submit"},"Sign in")))))}}]),t}(r.a.Component),Le=a(187),Ye=new Ae.a;var Me=function(e){var t=e.component,a=Object(Le.a)(e,["component"]);return r.a.createElement(W.c,Object.assign({},a,{render:function(e){return!0===function(e){return u()(p+"/api/authenticate"+_e()).then(function(t){401==t.status&&e.history.push("/login")}),!(!Ye.get("username")||!Ye.get("password"))}(e)?r.a.createElement(t,e):r.a.createElement(W.b,{to:"/login"})}}))},We=(new Ae.a,Object(l.createLogger)()),Ue=Object(c.createStore)(F,Object(xe.composeWithDevTools)(Object(c.applyMiddleware)(s.a,We)));Ue.dispatch(function(e){return e({type:E,isFetching:!0}),u()(p+"/api/hotelDescription").then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(t){return e(g(t))})}),Ue.dispatch(function(e){return e({type:h,hotelOverview:{},isFetching:!0}),u()(p+"/api/hotelOverview").then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(t){return e(b(t))})}),Ue.dispatch(function(e){return e({type:N,hotelRates:{},isFetching:!0}),u()(p+"/api/hotelRates").then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(t){return e(j(t))})}),Ue.dispatch(function(e){return e({type:k,hotelHouseRates:{},isFetching:!0}),u()(p+"/api/hotelHouseRates").then(function(e){return e.json()},function(e){return console.log("An error occurred.",e)}).then(function(t){return e(S(t))})});var Be={position:"bottom right",timeout:5e3,offset:"30px",transition:"scale",zIndex:1e5};window.addEventListener("load",function(){document.getElementById("reservation")&&Object(o.render)(r.a.createElement(M.a,{store:Ue},r.a.createElement(W.a,null,r.a.createElement(W.d,null,r.a.createElement(W.c,{path:"/login",component:Fe}),r.a.createElement(W.c,{path:"/",component:De})))),document.getElementById("reservation")),document.getElementById("hotel-description")&&Object(o.render)(r.a.createElement(M.a,{store:Ue},r.a.createElement(W.a,null,r.a.createElement(W.d,null,r.a.createElement(Me,{path:"/administration",component:X}),r.a.createElement(W.c,{path:"/login",component:Fe}),r.a.createElement(W.c,{path:"/",component:ee})))),document.getElementById("hotel-description")),document.getElementById("hotel-house-rates")&&Object(o.render)(r.a.createElement(M.a,{store:Ue},r.a.createElement(W.a,null,r.a.createElement(W.d,null,r.a.createElement(Me,{path:"/administration",component:Ee}),r.a.createElement(Me,{path:"/details-house/:id/administration",component:Oe}),r.a.createElement(W.c,{path:"/details-house/:id",component:fe}),r.a.createElement(W.c,{path:"/login",component:Fe}),r.a.createElement(W.c,{path:"/",component:be})))),document.getElementById("hotel-house-rates")),document.getElementById("hotel-rates")&&Object(o.render)(r.a.createElement(M.a,{store:Ue},r.a.createElement(W.a,null,r.a.createElement(W.d,null,r.a.createElement(Me,{path:"/administration",component:pe}),r.a.createElement(W.c,{path:"/details/:id/administration",component:Te}),r.a.createElement(W.c,{path:"/details/:id",component:de}),r.a.createElement(W.c,{path:"/login",component:Fe}),r.a.createElement(W.c,{path:"/",component:se})))),document.getElementById("hotel-rates")),document.getElementById("hotel-overview")&&Object(o.render)(r.a.createElement(M.a,{store:Ue},r.a.createElement(W.a,null,r.a.createElement(W.d,null,r.a.createElement(Me,{path:"/administration",component:ne}),r.a.createElement(W.c,{path:"/login",component:Fe}),r.a.createElement(W.c,{path:"/",component:oe})))),document.getElementById("hotel-overview")),document.getElementById("about-hotel-page")&&Object(o.render)(r.a.createElement(M.a,{store:Ue},r.a.createElement(W.a,null,r.a.createElement(W.d,null,r.a.createElement(Me,{path:"/administration",component:ne}),r.a.createElement(W.c,{path:"/login",component:Fe}),r.a.createElement(W.c,{path:"/",component:Ie})))),document.getElementById("about-hotel-page")),document.getElementById("hotel-book")&&Object(o.render)(r.a.createElement(ye.a,Object.assign({template:Se.a},Be),r.a.createElement(M.a,{store:Ue},r.a.createElement(W.a,null,r.a.createElement(W.d,null,r.a.createElement(W.c,{path:"/login",component:Fe}),r.a.createElement(W.c,{path:"/",component:Ce}))))),document.getElementById("hotel-book"))},!1),function(){if("serviceWorker"in navigator){if(new URL("",window.location).origin!==window.location.origin)return;window.addEventListener("load",function(){var e="".concat("","/service-worker.js");L?(function(e){fetch(e).then(function(t){404===t.status||-1===t.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then(function(e){e.unregister().then(function(){window.location.reload()})}):Y(e)}).catch(function(){console.log("No internet connection found. App is running in offline mode.")})}(e),navigator.serviceWorker.ready.then(function(){console.log("This web app is being served cache-first by a service worker. To learn more, visit https://goo.gl/SC7cgQ")})):Y(e)})}}()},50:function(e,t,a){}},[[188,2,1]]]);
//# sourceMappingURL=main.ff201ff6.chunk.js.map