text: (function(e){function t(t){for(var a,i,u=t[0],o=t[1],c=t[2],p=0,f=[];p<u.length;p++)i=u[p],Object.prototype.hasOwnProperty.call(s,i)&&s[i]&&f.push(s[i][0]),s[i]=0;for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a]);l&&l(t);while(f.length)f.shift()();return r.push.apply(r,c||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],a=!0,u=1;u<n.length;u++){var o=n[u];0!==s[o]&&(a=!1)}a&&(r.splice(t--,1),e=i(i.s=n[0]))}return e}var a={},s={app:0},r=[];function i(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=a,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(n,a,function(t){return e[t]}.bind(null,a));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/";var u=window["webpackJsonp"]=window["webpackJsonp"]||[],o=u.push.bind(u);u.push=t,u=u.slice();for(var c=0;c<u.length;c++)t(u[c]);var l=o;r.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"034f":function(e,t,n){"use strict";var a=n("85ec"),s=n.n(a);s.a},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var a=n("2b0e"),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container"},[n("pagination",{attrs:{value:e.currentPage,"per-page":e.perPage,total:e.total,activeClass:"paginate-active",btnHideClass:"paginate-hide"},on:{input:e.getData},scopedSlots:e._u([{key:"prevPage",fn:function(){return[e._v("PREV")]},proxy:!0},{key:"nextPage",fn:function(){return[e._v("NEXT")]},proxy:!0},{key:"breakView",fn:function(){return[e._v("...")]},proxy:!0}])}),n("ul",{staticClass:"list"},e._l(e.photos,(function(e){return n("li",{key:e.id,staticClass:"list__item"},[n("img",{staticClass:"list__img",attrs:{src:e.webformatURL,alt:e.id}})])})),0)],1)},r=[],i=(n("4160"),n("b64b"),n("d3b7"),n("3ca3"),n("159b"),n("ddb0"),n("2b3d"),n("96cf"),n("1da1")),u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.classes.wrapperClass},[e.showPrevNext?n("span",{class:e.classes.itemClass},[n("button",{class:[e.classes.btnClass,e.classes.prevNextClass],attrs:{disabled:e.hasPrev},on:{click:e.prevPage}},[e._t("prevPage",[e._v(" Prev ")])],2)]):e._e(),e._l(e.renderBtnsArray,(function(t,a){return[e.hasRenderDots(a)?n("span",{key:a+100,class:[e.hasHideDot(a),e.classes.itemClass,e.classes.breakViewClass]},[e._t("breakView",[e._v(" ... ")])],2):e._e(),n("span",{key:a,class:[e.classes.itemClass,e.hasHideNavBtn(t)]},[n("button",{class:[e.setActiveClass(t),e.classes.btnClass],on:{click:function(n){return e.updatePage(t)}}},[e._v(" "+e._s(t)+" ")])])]})),e.showPrevNext?n("span",{class:e.classes.itemClass},[n("button",{class:[e.classes.btnClass,e.classes.prevNextClass],attrs:{disabled:e.hasNext},on:{click:e.nextPage}},[e._t("nextPage",[e._v(" Next ")])],2)]):e._e()],2)},o=[],c=(n("4de4"),n("c975"),n("a9e3"),1),l=2,p=0,f=2,h="input",d="",g={name:"Pagination",props:{value:{type:Number,required:!0},perPage:{type:Number,required:!0},total:{type:Number,required:!0},pageRange:{type:Number,default:l},showPrevNext:{type:Boolean,default:!0},classes:{type:Object,default:function(){return{wrapperClass:"v-simple-pagination",itemClass:d,btnClass:d,breakViewClass:d,prevNextClass:d}}},activeClass:{type:String,default:"active"},btnHideClass:{type:String,default:"hide"}},computed:{diameter:function(){return this.pageRange*l},countOfPages:function(){var e=0;return Math.ceil(this.total/this.perPage)||e},renderBtnsArray:function(){for(var e=[c],t=this.value-this.getDynamicRadius,n=this.value+this.getDynamicRadius,a=t;a<=n;a++)a>=c&&a<=this.countOfPages&&e.push(a);return e.push(this.countOfPages),e.filter((function(t,n){return e.indexOf(t)===n}))},pageIndex:function(){return this.value-c},getDynamicRadius:function(){return this.pageIndex===p||this.pageIndex===this.countOfPages-c?this.diameter:this.pageIndex===c||this.pageIndex===this.countOfPages-f?this.diameter-c:this.pageRange},bottomOfBorder:function(){return this.pageIndex-this.renderBtnsArray.length},topOfBorder:function(){return this.pageIndex+this.renderBtnsArray.length},hasPrev:function(){return this.value<=c},hasNext:function(){return this.value>=this.countOfPages}},methods:{setActiveClass:function(e){return e===this.value?this.activeClass:d},hasHideNavBtn:function(e){var t=e-c,n=!(t>=this.bottomOfBorder&&t<=this.topOfBorder)&&!this.hasFirstOfLastPage(e);return n?this.btnHideClass:d},hasRenderDots:function(e){var t=this.countOfPages>this.diameter,n=e===c,a=e===this.renderBtnsArray.length-c;return t&&(n||a)},hasHideDot:function(e){var t=this.renderBtnsArray.indexOf(this.countOfPages-c)>=p;return e===c&&(t=this.renderBtnsArray.indexOf(f)>=p),t?this.btnHideClass:d},hasFirstOfLastPage:function(e){return e===c||e===this.countOfPages},nextPage:function(){if(this.value<this.countOfPages){var e=this.value+c;this.input(e)}},prevPage:function(){if(this.value>c){var e=this.value-c;this.input(e)}},updatePage:function(e){e!==this.value&&this.input(e)},input:function(e){this.$emit(h,e)}}},v=g,b=n("2877"),y=Object(b["a"])(v,u,o,!1,null,null,null),P=y.exports,m={name:"App",components:{Pagination:P},data:function(){return{photos:[],total:0,perPage:19,currentPage:1}},mounted:function(){this.getData(this.currentPage)},methods:{getData:function(e){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function n(){var a,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,fetch(t.getUrl(e));case 3:return a=n.sent,n.next=6,a.json();case 6:s=n.sent,t.photos=s.hits,t.total=s.totalHits,t.currentPage=e,n.next=15;break;case 12:n.prev=12,n.t0=n["catch"](0),console.error(n.t0);case 15:case"end":return n.stop()}}),n,null,[[0,12]])})))()},getUrl:function(e){var t=new URL("https://pixabay.com/api/"),n={key:"18632235-225bcc434ebaee33e53a4b891",image_type:"photo",category:"places",per_page:this.perPage,page:e};return Object.keys(n).forEach((function(e){return t.searchParams.append(e,n[e])})),t}}},x=m,O=(n("034f"),Object(b["a"])(x,s,r,!1,null,null,null)),_=O.exports;a["a"].config.productionTip=!1,new a["a"]({render:function(e){return e(_)}}).$mount("#app")},"85ec":function(e,t,n){}});
  //# sourceMappingURL=app.7f64c0cd.js.map