text: !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=53)}([function(e,t,r){"use strict";var n=r(5),o=r(35),i=Object.prototype.toString;function a(e){return"[object Array]"===i.call(e)}function s(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!==e&&void 0!==e)if("object"!=typeof e&&(e=[e]),a(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:o,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:u,isStream:function(e){return s(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]=r}for(var n=0,o=arguments.length;n<o;n++)c(arguments[n],r);return t},extend:function(e,t,r){return c(t,function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,r){"use strict";t.__esModule=!0,t.extend=s,t.indexOf=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},t.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}if(!i.test(e))return e;return e.replace(o,a)},t.isEmpty=function(e){return!e&&0!==e||!(!l(e)||0!==e.length)},t.createFrame=function(e){var t=s({},e);return t._parent=e,t},t.blockParams=function(e,t){return e.path=t,e},t.appendContextPath=function(e,t){return(e?e+".":"")+t};var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},o=/[&<>"'`=]/g,i=/[&<>"'`=]/;function a(e){return n[e]}function s(e){for(var t=1;t<arguments.length;t++)for(var r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&(e[r]=arguments[t][r]);return e}var u=Object.prototype.toString;t.toString=u;var c=function(e){return"function"==typeof e};c(/x/)&&(t.isFunction=c=function(e){return"function"==typeof e&&"[object Function]"===u.call(e)}),t.isFunction=c;var l=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===u.call(e)};t.isArray=l},function(e,t,r){"use strict";t.__esModule=!0;var n=["description","fileName","lineNumber","message","name","number","stack"];function o(e,t){var r=t&&t.loc,i=void 0,a=void 0;r&&(e+=" - "+(i=r.start.line)+":"+(a=r.start.column));for(var s=Error.prototype.constructor.call(this,e),u=0;u<n.length;u++)this[n[u]]=s[n[u]];Error.captureStackTrace&&Error.captureStackTrace(this,o);try{r&&(this.lineNumber=i,Object.defineProperty?Object.defineProperty(this,"column",{value:a,enumerable:!0}):this.column=a)}catch(e){}}o.prototype=new Error,t.default=o,e.exports=t.default},function(e,t,r){"use strict";(function(t){var n=r(0),o=r(38),i={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s={adapter:function(){var e;return"undefined"!=typeof XMLHttpRequest?e=r(6):void 0!==t&&(e=r(6)),e}(),transformRequest:[function(e,t){return o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],function(e){s.headers[e]={}}),n.forEach(["post","put","patch"],function(e){s.headers[e]=n.merge(i)}),e.exports=s}).call(this,r(37))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=c;var o=r(1),i=n(r(2)),a=r(19),s=r(27),u=n(r(29));t.VERSION="4.0.12";t.COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};function c(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},a.registerDefaultHelpers(this),s.registerDefaultDecorators(this)}c.prototype={constructor:c,logger:u.default,log:u.default.log,registerHelper:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new i.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===o.toString.call(e))o.extend(this.partials,e);else{if(void 0===t)throw new i.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new i.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]}};var l=u.default.log;t.log=l,t.createFrame=o.createFrame,t.logger=u.default},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(0),o=r(39),i=r(41),a=r(42),s=r(43),u=r(7),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||r(44);e.exports=function(e){return new Promise(function(t,l){var f=e.data,d=e.headers;n.isFormData(f)&&delete d["Content-Type"];var h=new XMLHttpRequest,p="onreadystatechange",v=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||s(e.url)||(h=new window.XDomainRequest,p="onload",v=!0,h.onprogress=function(){},h.ontimeout=function(){}),e.auth){var m=e.auth.username||"",g=e.auth.password||"";d.Authorization="Basic "+c(m+":"+g)}if(h.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h[p]=function(){if(h&&(4===h.readyState||v)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in h?a(h.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:r,config:e,request:h};o(t,l,n),h=null}},h.onerror=function(){l(u("Network Error",e,null,h)),h=null},h.ontimeout=function(){l(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var y=r(45),w=(e.withCredentials||s(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;w&&(d[e.xsrfHeaderName]=w)}if("setRequestHeader"in h&&n.forEach(d,function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:h.setRequestHeader(t,e)}),e.withCredentials&&(h.withCredentials=!0),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){h&&(h.abort(),l(e),h=null)}),void 0===f&&(f=null),h.send(f)})}},function(e,t,r){"use strict";var n=r(40);e.exports=function(e,t,r,o,i){var a=new Error(e);return n(a,t,r,o,i)}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){var n=r(17);e.exports=(n.default||n).template({compiler:[7,">= 4.0.0"],main:function(e,t,r,n,o){var i,a=null!=t?t:e.nullContext||{},s=r.helperMissing,u=e.escapeExpression;return'<li class="list__item">\n    <img src='+u("function"==typeof(i=null!=(i=r.webformatURL||(null!=t?t.webformatURL:t))?i:s)?i.call(a,{name:"webformatURL",hash:{},data:o}):i)+" id="+u("function"==typeof(i=null!=(i=r.id||(null!=t?t.id:t))?i:s)?i.call(a,{name:"id",hash:{},data:o}):i)+' alt="photo">\n</li>'},useData:!0})},function(e,t,r){e.exports=r(34)},function(e,t,r){var n=r(13);"string"==typeof n&&(n=[[e.i,n,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};r(15)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,r){},,function(e,t,r){var n={},o=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),i=function(e){var t={};return function(e,r){if("function"==typeof e)return e();if(void 0===t[e]){var n=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,r);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),a=null,s=0,u=[],c=r(16);function l(e,t){for(var r=0;r<e.length;r++){var o=e[r],i=n[o.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](o.parts[a]);for(;a<o.parts.length;a++)i.parts.push(m(o.parts[a],t))}else{var s=[];for(a=0;a<o.parts.length;a++)s.push(m(o.parts[a],t));n[o.id]={id:o.id,refs:1,parts:s}}}}function f(e,t){for(var r=[],n={},o=0;o<e.length;o++){var i=e[o],a=t.base?i[0]+t.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};n[a]?n[a].parts.push(s):r.push(n[a]={id:a,parts:[s]})}return r}function d(e,t){var r=i(e.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=u[u.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),u.push(t);else if("bottom"===e.insertAt)r.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=i(e.insertAt.before,r);r.insertBefore(t,o)}}function h(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=u.indexOf(e);t>=0&&u.splice(t,1)}function p(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var n=function(){0;return r.nc}();n&&(e.attrs.nonce=n)}return v(t,e.attrs),d(e,t),t}function v(e,t){Object.keys(t).forEach(function(r){e.setAttribute(r,t[r])})}function m(e,t){var r,n,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var u=s++;r=a||(a=p(t)),n=y.bind(null,r,u,!1),o=y.bind(null,r,u,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),d(e,t),t}(t),n=function(e,t,r){var n=r.css,o=r.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(n=c(n));o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([n],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,r,t),o=function(){h(r),r.href&&URL.revokeObjectURL(r.href)}):(r=p(t),n=function(e,t){var r=t.css,n=t.media;n&&e.setAttribute("media",n);if(e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}.bind(null,r),o=function(){h(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var r=f(e,t);return l(r,t),function(e){for(var o=[],i=0;i<r.length;i++){var a=r[i];(s=n[a.id]).refs--,o.push(s)}e&&l(f(e,t),t);for(i=0;i<o.length;i++){var s;if(0===(s=o[i]).refs){for(var u=0;u<s.parts.length;u++)s.parts[u]();delete n[s.id]}}}};var g=function(){var e=[];return function(t,r){return e[t]=r,e.filter(Boolean).join("\n")}}();function y(e,t,r,n){var o=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var r=t.protocol+"//"+t.host,n=r+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?r+i:n+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},function(e,t,r){e.exports=r(18).default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.__esModule=!0;var i=o(r(4)),a=n(r(30)),s=n(r(2)),u=o(r(1)),c=o(r(31)),l=n(r(32));function f(){var e=new i.HandlebarsEnvironment;return u.extend(e,i),e.SafeString=a.default,e.Exception=s.default,e.Utils=u,e.escapeExpression=u.escapeExpression,e.VM=c,e.template=function(t){return c.template(t,e)},e}var d=f();d.create=f,l.default(d),d.default=d,t.default=d,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),i.default(e),a.default(e),s.default(e),u.default(e),c.default(e),l.default(e)};var o=n(r(20)),i=n(r(21)),a=n(r(22)),s=n(r(23)),u=n(r(24)),c=n(r(25)),l=n(r(26))},function(e,t,r){"use strict";t.__esModule=!0;var n=r(1);t.default=function(e){e.registerHelper("blockHelperMissing",function(t,r){var o=r.inverse,i=r.fn;if(!0===t)return i(this);if(!1===t||null==t)return o(this);if(n.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):o(this);if(r.data&&r.ids){var a=n.createFrame(r.data);a.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:a}}return i(t,r)})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(1),o=function(e){return e&&e.__esModule?e:{default:e}}(r(2));t.default=function(e){e.registerHelper("each",function(e,t){if(!t)throw new o.default("Must pass iterator to #each");var r=t.fn,i=t.inverse,a=0,s="",u=void 0,c=void 0;function l(t,o,i){u&&(u.key=t,u.index=o,u.first=0===o,u.last=!!i,c&&(u.contextPath=c+t)),s+=r(e[t],{data:u,blockParams:n.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=n.appendContextPath(t.data.contextPath,t.ids[0])+"."),n.isFunction(e)&&(e=e.call(this)),t.data&&(u=n.createFrame(t.data)),e&&"object"==typeof e)if(n.isArray(e))for(var f=e.length;a<f;a++)a in e&&l(a,a,a===e.length-1);else{var d=void 0;for(var h in e)e.hasOwnProperty(h)&&(void 0!==d&&l(d,a-1),d=h,a++);void 0!==d&&l(d,a-1,!0)}return 0===a&&(s=i(this)),s})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=function(e){return e&&e.__esModule?e:{default:e}}(r(2));t.default=function(e){e.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new n.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(1);t.default=function(e){e.registerHelper("if",function(e,t){return n.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||n.isEmpty(e)?t.inverse(this):t.fn(this)}),e.registerHelper("unless",function(t,r){return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)t.push(arguments[n]);var o=1;null!=r.hash.level?o=r.hash.level:r.data&&null!=r.data.level&&(o=r.data.level),t[0]=o,e.log.apply(e,t)})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",function(e,t){return e&&e[t]})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(1);t.default=function(e){e.registerHelper("with",function(e,t){n.isFunction(e)&&(e=e.call(this));var r=t.fn;if(n.isEmpty(e))return t.inverse(this);var o=t.data;return t.data&&t.ids&&((o=n.createFrame(t.data)).contextPath=n.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:o,blockParams:n.blockParams([e],[o&&o.contextPath])})})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){n.default(e)};var n=function(e){return e&&e.__esModule?e:{default:e}}(r(28))},function(e,t,r){"use strict";t.__esModule=!0;var n=r(1);t.default=function(e){e.registerDecorator("inline",function(e,t,r,o){var i=e;return t.partials||(t.partials={},i=function(o,i){var a=r.partials;r.partials=n.extend({},a,t.partials);var s=e(o,i);return r.partials=a,s}),t.partials[o.args[0]]=o.fn,i})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(1),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=n.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];console[t].apply(console,n)}}};t.default=o,e.exports=t.default},function(e,t,r){"use strict";function n(e){this.string=e}t.__esModule=!0,n.prototype.toString=n.prototype.toHTML=function(){return""+this.string},t.default=n,e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,r=i.COMPILER_REVISION;if(t!==r){if(t<r){var n=i.REVISION_CHANGES[r],a=i.REVISION_CHANGES[t];throw new o.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+a+").")}throw new o.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}},t.template=function(e,t){if(!t)throw new o.default("No environment passed to template");if(!e||!e.main)throw new o.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var r={strict:function(e,t){if(!(t in e))throw new o.default('"'+t+'" not defined in '+e);return e[t]},lookup:function(e,t){for(var r=e.length,n=0;n<r;n++)if(e[n]&&null!=e[n][t])return e[n][t]},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:n.escapeExpression,invokePartial:function(r,i,a){a.hash&&(i=n.extend({},i,a.hash),a.ids&&(a.ids[0]=!0));r=t.VM.resolvePartial.call(this,r,i,a);var s=t.VM.invokePartial.call(this,r,i,a);null==s&&t.compile&&(a.partials[a.name]=t.compile(r,e.compilerOptions,t),s=a.partials[a.name](i,a));if(null!=s){if(a.indent){for(var u=s.split("\n"),c=0,l=u.length;c<l&&(u[c]||c+1!==l);c++)u[c]=a.indent+u[c];s=u.join("\n")}return s}throw new o.default("The partial "+a.name+" could not be compiled when running in runtime-only mode")},fn:function(t){var r=e[t];return r.decorator=e[t+"_d"],r},programs:[],program:function(e,t,r,n,o){var i=this.programs[e],s=this.fn(e);return t||o||n||r?i=a(this,e,s,t,r,n,o):i||(i=this.programs[e]=a(this,e,s)),i},data:function(e,t){for(;e&&t--;)e=e._parent;return e},merge:function(e,t){var r=e||t;return e&&t&&e!==t&&(r=n.extend({},t,e)),r},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function s(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=n.data;s._setup(n),!n.partial&&e.useData&&(o=function(e,t){t&&"root"in t||((t=t?i.createFrame(t):{}).root=e);return t}(t,o));var a=void 0,c=e.useBlockParams?[]:void 0;function l(t){return""+e.main(r,t,r.helpers,r.partials,o,c,a)}return e.useDepths&&(a=n.depths?t!=n.depths[0]?[t].concat(n.depths):n.depths:[t]),(l=u(e.main,l,r,n.depths||[],o,c))(t,n)}return s.isTop=!0,s._setup=function(n){n.partial?(r.helpers=n.helpers,r.partials=n.partials,r.decorators=n.decorators):(r.helpers=r.merge(n.helpers,t.helpers),e.usePartial&&(r.partials=r.merge(n.partials,t.partials)),(e.usePartial||e.useDecorators)&&(r.decorators=r.merge(n.decorators,t.decorators)))},s._child=function(t,n,i,s){if(e.useBlockParams&&!i)throw new o.default("must pass block params");if(e.useDepths&&!s)throw new o.default("must pass parent depths");return a(r,t,e[t],n,0,i,s)},s},t.wrapProgram=a,t.resolvePartial=function(e,t,r){e?e.call||r.name||(r.name=e,e=r.partials[e]):e="@partial-block"===r.name?r.data["partial-block"]:r.partials[r.name];return e},t.invokePartial=function(e,t,r){var a=r.data&&r.data["partial-block"];r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var u=void 0;r.fn&&r.fn!==s&&function(){r.data=i.createFrame(r.data);var e=r.fn;u=r.data["partial-block"]=function(t){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return r.data=i.createFrame(r.data),r.data["partial-block"]=a,e(t,r)},e.partials&&(r.partials=n.extend({},r.partials,e.partials))}();void 0===e&&u&&(e=u);if(void 0===e)throw new o.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)},t.noop=s;var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(1)),o=function(e){return e&&e.__esModule?e:{default:e}}(r(2)),i=r(4);function a(e,t,r,n,o,i,a){function s(t){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=a;return!a||t==a[0]||t===e.nullContext&&null===a[0]||(s=[t].concat(a)),r(e,t,e.helpers,e.partials,o.data||n,i&&[o.blockParams].concat(i),s)}return(s=u(r,s,e,a,n,i)).program=t,s.depth=a?a.length:0,s.blockParams=o||0,s}function s(){return""}function u(e,t,r,o,i,a){if(e.decorator){var s={};t=e.decorator(t,s,r,o&&o[0],i,a,o),n.extend(t,s)}return t}},function(e,t,r){"use strict";(function(r){t.__esModule=!0,t.default=function(e){var t=void 0!==r?r:window,n=t.Handlebars;e.noConflict=function(){return t.Handlebars===e&&(t.Handlebars=n),e}},e.exports=t.default}).call(this,r(33))},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=r(0),o=r(5),i=r(36),a=r(3);function s(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var u=s(a);u.Axios=i,u.create=function(e){return s(n.merge(a,e))},u.Cancel=r(9),u.CancelToken=r(51),u.isCancel=r(8),u.all=function(e){return Promise.all(e)},u.spread=r(52),e.exports=u,e.exports.default=u},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
  /*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   */
  e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict";var n=r(3),o=r(0),i=r(46),a=r(47);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e&&(e=o.merge({url:arguments[0]},arguments[1])),(e=o.merge(n,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[a,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},o.forEach(["delete","get","head","options"],function(e){s.prototype[e]=function(t,r){return this.request(o.merge(r||{},{method:e,url:t}))}}),o.forEach(["post","put","patch"],function(e){s.prototype[e]=function(t,r,n){return this.request(o.merge(n||{},{method:e,url:t,data:r}))}}),e.exports=s},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e}},function(e,t,r){"use strict";var n=r(0);function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var a=[];n.forEach(t,function(e,t){null!==e&&void 0!==e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))}))}),i=a.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,r){"use strict";var n=r(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,a={};return e?(n.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}}),a):a}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,r,i=String(e),a="",s=0,u=n;i.charAt(0|s)||(u="=",s%1);a+=u.charAt(63&t>>8-s%1*8)){if((r=i.charCodeAt(s+=.75))>255)throw new o;t=t<<8|r}return a}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(o)&&s.push("path="+o),n.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},function(e,t,r){"use strict";var n=r(0),o=r(48),i=r(8),a=r(3),s=r(49),u=r(50);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!s(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||a.adapter)(e).then(function(t){return c(e),t.data=o(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t,r){return n.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(9);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new n(e),t(r.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";r.r(t);r(12);var n=[],o={currentImage:document.querySelector(".page-modal img"),nextImage:"",prevImage:"",currentImgIndex:0,getNextImage:function(){if(o.currentImgIndex!==n.length-1)return o.currentImgIndex+=1,o.nextImage=n[o.currentImgIndex]},getPrevImage:function(){if(0!==o.currentImgIndex)return o.currentImgIndex-=1,o.prevImage=n[o.currentImgIndex]}};function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.currentQuery="",this.currentPage=1,this.localImages=JSON.parse(localStorage.getItem("favorites")),this.keys={37:1,38:1,39:1,40:1},null!==this.localImages&&0!==this.localImages.length||(this.localImages=[])}return function(e,t,r){t&&i(e.prototype,t),r&&i(e,r)}(e,[{key:"resetCurrentPage",value:function(){this.currentPage=1}},{key:"incrementCurrentPage",value:function(){this.currentPage+=1}},{key:"addToLocalStorage",value:function(e){var t=JSON.stringify(e);localStorage.setItem("favorites",t)}},{key:"isHasId",value:function(e,t){return t.some(function(t){return t.id===e})}},{key:"backdropImageInit",value:function(e){return function(e){return n.length=0,document.querySelectorAll(".list__item img").forEach(function(e){n.push(e)}),o.currentImgIndex=n.indexOf(e),o.currentImage}(e)}},{key:"backdropShowNextImage",value:function(){return o.getNextImage(),o.currentImage=o.nextImage,o.currentImage}},{key:"backdropShowPrevImage",value:function(){return o.getPrevImage(),o.currentImage=o.prevImage,o.currentImage}},{key:"backdropCloseModal",value:function(){return o.nextImage="",void(o.prevImage="")}},{key:"preventDefault",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.returnValue=!1}},{key:"preventDefaultForScrollKeys",value:function(e){if(this.keys[e.keyCode])return e.preventDefault(),!1}},{key:"disableScroll",value:function(){window.addEventListener&&window.addEventListener("DOMMouseScroll",this.preventDefault,!1),window.onwheel=this.preventDefault,window.onmousewheel=document.onmousewheel=this.preventDefault,document.onkeydown=this.preventDefaultForScrollKeys}},{key:"enableScroll",value:function(){window.removeEventListener&&window.removeEventListener("DOMMouseScroll",this.preventDefault,!1),window.onmousewheel=document.onmousewheel=null,window.onwheel=null,window.ontouchmove=null,document.onkeydown=null}}]),e}(),s=r(10),u=r.n(s);function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.refs={},this.refs.body=document.querySelector(".page"),this.refs.siteLogo=document.querySelector(".site-logo"),this.refs.list=document.querySelector(".list"),this.refs.form=document.querySelector(".form"),this.refs.input=document.querySelector(".input-js"),this.refs.loader=document.querySelector(".loader-overlay"),this.refs.loadMoreBtn=document.querySelector(".list__load-more"),this.refs.backdrop=document.querySelector(".backdrop"),this.refs.modalPage=document.querySelector(".page-modal"),this.refs.modalImg=document.querySelector(".page-modal__img"),this.refs.modalIcons=document.querySelector(".page-modal__icons"),this.refs.favoriteModalBtn=document.querySelector('button[data-action="favorite"]'),this.refs.showFavorite=document.querySelector(".favorites__link")}return function(e,t,r){t&&c(e.prototype,t),r&&c(e,r)}(e,[{key:"showLoadMoreBtn",value:function(){this.refs.loadMoreBtn.classList.contains("visible")||this.refs.loadMoreBtn.classList.add("visible")}},{key:"createListItems",value:function(e){return e.reduce(function(e,t){return e+u()(t)},"")}},{key:"updatePhotosList",value:function(e){this.refs.list.insertAdjacentHTML("beforeend",e)}},{key:"resetPhotosList",value:function(){this.refs.list.innerHTML=""}},{key:"toggleLoader",value:function(){return this.refs.loader.classList.toggle("show-loader")}},{key:"changeColorFavoriteBtn",value:function(e){this.refs.favoriteModalBtn.style.color=e}},{key:"changeDisplayElem",value:function(e,t){e.style.display=t}}]),e}(),f=r(11),d=r.n(f);function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var p=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._model=t,this._view=r,this.images=this._model.localImages,this.imagesOnPage=n,this._view.refs.body.addEventListener("click",this.handleModalFalseClick.bind(this)),this._view.refs.siteLogo.addEventListener("click",this.handleLogoClick.bind(this)),this._view.refs.form.addEventListener("submit",this.handleFormSumit.bind(this)),this._view.refs.loadMoreBtn.addEventListener("click",this.handleLoadMoreClick.bind(this)),this._view.refs.list.addEventListener("click",this.handleOpenModal.bind(this)),this._view.refs.modalPage.addEventListener("click",this.handleModalControls.bind(this)),this._view.refs.modalPage.addEventListener("click",this.handleFavoritesModalControls.bind(this)),this._view.refs.showFavorite.addEventListener("click",this.handleShowFavorite.bind(this)),this.init()}return function(e,t,r){t&&h(e.prototype,t),r&&h(e,r)}(e,[{key:"init",value:function(){this._model.addToLocalStorage(this.images)}},{key:"handleLogoClick",value:function(){window.location.reload()}},{key:"handleFormSumit",value:function(e){e.preventDefault(),this.imagesOnPage=[],this._model.resetCurrentPage(),this._view.resetPhotosList(),this._model.currentQuery=this._view.refs.input.value,this.handleFetch({query:this._model.currentQuery,page:this._model.currentPage}),this._view.showLoadMoreBtn(),this._view.refs.list.classList.remove("js-favorites")}},{key:"handleFetch",value:function(e){var t=this;this._view.toggleLoader(),function(e){var t=e.query,r=e.page,n="https://pixabay.com/api/?image_type=photo&q=".concat(t,"&per_page=12&page=").concat(r,"&key=").concat("10456559-ece128cde22be6e54d79b9b25");return d.a.get(n).then(function(e){return e.data.hits}).catch(function(e){return console.log("axios err : ",e)})}(e).then(function(e){var r=t._view.createListItems(e);t._view.updatePhotosList(r),t._view.toggleLoader()})}},{key:"handleLoadMoreClick",value:function(){this._model.incrementCurrentPage(),this.handleFetch({query:this._model.currentQuery,page:this._model.currentPage})}},{key:"handleOpenModal",value:function(e){e.target.src&&(this._model.disableScroll(),this._model.backdropImageInit(e.target),this.changeColorFavorite(e.target),this._view.refs.backdrop.classList.add("show-modal"),window.addEventListener("keydown",this.handleModalKeyPress.bind(this)))}},{key:"handleModalFalseClick",value:function(e){"IMG"===e.target.nodeName||"BUTTON"===e.target.nodeName||e.target.classList.contains("page-modal__icons")||this.handleCloseModal()}},{key:"handleModalKeyPress",value:function(e){switch(e.code){case"Escape":this.handleCloseModal();break;case"ArrowLeft":this.keyPrev();break;case"ArrowRight":this.keyNext()}}},{key:"handleCloseModal",value:function(){this._model.backdropCloseModal(),this._model.enableScroll(),this._view.refs.backdrop.classList.contains("show-modal")&&(this._view.refs.backdrop.classList.remove("show-modal"),window.removeEventListener("keydown",this.handleModalKeyPress.bind(this)))}},{key:"handleShowFavorite",value:function(){this._view.refs.backdrop.classList.contains("show-modal")||0===this.images.length&&alert("Вы ничего не добавили в избранное"),this._view.refs.list.classList.add("js-favorites"),this._view.refs.favoriteModalBtn.classList.add("js-favorites__icon"),this._view.refs.loadMoreBtn.classList.remove("visible"),this._view.refs.list.textContent="";var e=this._view.createListItems(this.images);this._view.updatePhotosList(e)}},{key:"handleFavoritesModalControls",value:function(e){if(this._view.refs.list.classList.contains("js-favorites")){var t=e.target;if("BUTTON"===t.nodeName)switch(t.dataset.action){case"favorite":this.handleShowFavorite(),this.handleCloseModal()}}}},{key:"handleModalControls",value:function(e){e.preventDefault();var t=e.target;if("BUTTON"===t.nodeName)switch(t.dataset.action){case"next":this.keyNext();break;case"prev":this.keyPrev();break;case"favorite":var r=this._view.refs.modalImg.getAttribute("src"),n=this._view.refs.modalImg.getAttribute("id");if(this._model.isHasId(n,this.images))return this.images=this.images.filter(function(e){return e.id!==n}),this._model.addToLocalStorage(this.images),void this._view.changeColorFavoriteBtn("#ffffff");this._view.changeColorFavoriteBtn("#eeed11");var o={id:n,webformatURL:r};this.images.push(o),this._model.addToLocalStorage(this.images);break;case"close-modal":this.handleCloseModal()}}},{key:"changeColorFavorite",value:function(e){var t=e.getAttribute("src");this._view.refs.modalImg.setAttribute("src",t);var r=e.getAttribute("id");this._view.refs.modalImg.setAttribute("id",r),this._model.isHasId(r,this.images)?this._view.changeColorFavoriteBtn("#eeed11"):this._view.changeColorFavoriteBtn("#ffffff")}},{key:"keyPrev",value:function(){var e=this._model.backdropShowPrevImage();""!==e&&(this._view.refs.modalImg.src=e.src,this._view.refs.modalImg.id=e.id,this.changeColorFavorite(e))}},{key:"keyNext",value:function(){var e=this._model.backdropShowNextImage();""!==e&&(this._view.refs.modalImg.src=e.src,this._view.refs.modalImg.id=e.id,this.changeColorFavorite(e))}}]),e}(),v=new l;new p(new a,v)}]);