import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { SlickCarouselComponent } from 'ngx-slick-carousel';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "ngx-slick-carousel";
var _c0 = ["slickModal"];
function PhotoStreamComponent_div_5_div_3_figure_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "figure", 17);
    i0.ɵɵelement(1, "img", 18);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var img_r7 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("src", img_r7, i0.ɵɵsanitizeUrl);
} }
function PhotoStreamComponent_div_5_div_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 14);
    i0.ɵɵelementStart(1, "div", 15);
    i0.ɵɵtemplate(2, PhotoStreamComponent_div_5_div_3_figure_2_Template, 2, 1, "figure", 16);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var slide_r5 = ctx.$implicit;
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", slide_r5);
} }
function PhotoStreamComponent_div_5_Template(rf, ctx) { if (rf & 1) {
    var _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 8);
    i0.ɵɵelementStart(1, "ngx-slick-carousel", 9, 10);
    i0.ɵɵtemplate(3, PhotoStreamComponent_div_5_div_3_Template, 3, 1, "div", 11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "a", 12);
    i0.ɵɵlistener("click", function PhotoStreamComponent_div_5_Template_a_click_4_listener() { i0.ɵɵrestoreView(_r9); var _r3 = i0.ɵɵreference(2); return _r3.slickPrev(); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "a", 13);
    i0.ɵɵlistener("click", function PhotoStreamComponent_div_5_Template_a_click_5_listener() { i0.ɵɵrestoreView(_r9); var _r3 = i0.ɵɵreference(2); return _r3.slickNext(); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("config", ctx_r0.slideConfig);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", ctx_r0.slides);
} }
function PhotoStreamComponent_p_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 19);
    i0.ɵɵelement(1, "i", 20);
    i0.ɵɵtext(2, " Photos attached from your posts will appear here. ");
    i0.ɵɵelementEnd();
} }
function PhotoStreamComponent_a_8_Template(rf, ctx) { if (rf & 1) {
    var _r12 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 21);
    i0.ɵɵlistener("click", function PhotoStreamComponent_a_8_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r12); var ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.onViewAll(); });
    i0.ɵɵtext(1, "View all");
    i0.ɵɵelementEnd();
} }
var PhotoStreamComponent = /** @class */ (function () {
    function PhotoStreamComponent() {
        this.photos = [];
        this.photosPerSlide = 4;
        this.viewAll = new EventEmitter();
        this.slides = [];
        this.slideConfig = { slidesToShow: 1, slidesToScroll: 1, arrows: false };
    }
    PhotoStreamComponent.prototype.ngOnInit = function () { };
    PhotoStreamComponent.prototype.ngOnChanges = function () {
        this.slides = this.divideIntoSlides(this.photos.map(function (photo) { return photo.thumbnail_URL; }), this.photosPerSlide);
    };
    PhotoStreamComponent.prototype.divideIntoSlides = function (photos, photosPerSlide) {
        return Array(Math.ceil(photos.length / photosPerSlide))
            .fill(Array(Math.ceil(photos.length / photosPerSlide)))
            .map(function (_, index) { return index * photosPerSlide; })
            .map(function (begin) { return photos.slice(begin, begin + photosPerSlide); });
    };
    PhotoStreamComponent.prototype.onViewAll = function () {
        this.viewAll.emit();
    };
    PhotoStreamComponent.ɵfac = function PhotoStreamComponent_Factory(t) { return new (t || PhotoStreamComponent)(); };
    PhotoStreamComponent.ɵcmp = i0.ɵɵdefineComponent({ type: PhotoStreamComponent, selectors: [["ins-photo-stream"]], viewQuery: function PhotoStreamComponent_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(_c0, true);
        } if (rf & 2) {
            var _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.SlickCarousel = _t.first);
        } }, inputs: { photos: "photos", photosPerSlide: "photosPerSlide" }, outputs: { viewAll: "viewAll" }, features: [i0.ɵɵNgOnChangesFeature], decls: 9, vars: 3, consts: [[1, "widget-pack"], [1, "wp-head"], [1, "wp-title", 3, "click"], [1, "wp-body"], ["class", "photo-stream", 4, "ngIf"], ["class", "neutral-info", 4, "ngIf"], [1, "wp-foot"], ["class", "wp-link", "id", "viewAllLink", 3, "click", 4, "ngIf"], [1, "photo-stream"], [1, "carousel", 3, "config"], ["slickModal", "slick-carousel"], ["ngxSlickItem", "", "class", "slide", 4, "ngFor", "ngForOf"], [1, "icn-arrow-left", "photo-nav", 3, "click"], [1, "icn-arrow-right", "photo-nav", 3, "click"], ["ngxSlickItem", "", 1, "slide"], [1, "photo-slide"], ["class", "photo-figure", 4, "ngFor", "ngForOf"], [1, "photo-figure"], ["alt", "", 3, "src"], [1, "neutral-info"], [1, "icn-img"], ["id", "viewAllLink", 1, "wp-link", 3, "click"]], template: function PhotoStreamComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "section", 0);
            i0.ɵɵelementStart(1, "div", 1);
            i0.ɵɵelementStart(2, "h1", 2);
            i0.ɵɵlistener("click", function PhotoStreamComponent_Template_h1_click_2_listener() { return ctx.onViewAll(); });
            i0.ɵɵtext(3, "My Photo Stream");
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(4, "div", 3);
            i0.ɵɵtemplate(5, PhotoStreamComponent_div_5_Template, 6, 2, "div", 4);
            i0.ɵɵtemplate(6, PhotoStreamComponent_p_6_Template, 3, 0, "p", 5);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(7, "div", 6);
            i0.ɵɵtemplate(8, PhotoStreamComponent_a_8_Template, 2, 0, "a", 7);
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance(5);
            i0.ɵɵproperty("ngIf", ctx.slides.length);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", !ctx.slides.length);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.photos.length);
        } }, directives: [i1.NgIf, i2.SlickCarouselComponent, i1.NgForOf, i2.SlickItemDirective], styles: ["a[_ngcontent-%COMP%]{text-decoration:none}*[_ngcontent-%COMP%]{font-family:Lato,sans-serif;outline:0}@font-face{font-family:ins-icons;src:url(/assets/fonts/icons/ins-icons.ttf?nf14g1) format(\"truetype\"),url(/assets/fonts/icons/ins-icons.woff?nf14g1) format(\"woff\"),url(/assets/fonts/icons/ins-icons.svg?nf14g1#ins-icons) format(\"svg\");font-weight:400;font-style:normal;font-display:block}.ins-icon[_ngcontent-%COMP%], [class*=\" icn-\"][_ngcontent-%COMP%], [class^=icn-][_ngcontent-%COMP%]{font-family:ins-icons!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icn-minus-o[_ngcontent-%COMP%]:before{content:\"\\e93a\"}.icn-disclaimer[_ngcontent-%COMP%]:before{content:\"\\e934\"}.icn-leave-community[_ngcontent-%COMP%]:before{content:\"\\e935\"}.icn-stethoscope[_ngcontent-%COMP%]:before{content:\"\\e936\"}.icn-join-community[_ngcontent-%COMP%]:before{content:\"\\e937\"}.icn-resources[_ngcontent-%COMP%]:before{content:\"\\e938\"}.icn-help[_ngcontent-%COMP%]:before{content:\"\\e939\"}.icn-checked[_ngcontent-%COMP%]:before{content:\"\\e933\"}.icn-plus[_ngcontent-%COMP%]:before{content:\"\\e932\"}.icn-expand[_ngcontent-%COMP%]:before{content:\"\\e931\"}.icn-Invite[_ngcontent-%COMP%]:before{content:\"\\e930\"}.icn-report[_ngcontent-%COMP%]:before{content:\"\\e92f\"}.icn-unfollow[_ngcontent-%COMP%]:before{content:\"\\e92e\"}.icn-block[_ngcontent-%COMP%]:before{content:\"\\e92d\"}.icn-trash[_ngcontent-%COMP%]:before{content:\"\\e92b\"}.icn-follow[_ngcontent-%COMP%]:before{content:\"\\e92c\"}.icn-lock[_ngcontent-%COMP%]:before{content:\"\\e92a\"}.icn-bolt-left[_ngcontent-%COMP%]:before{content:\"\\e925\"}.icn-bolt-right[_ngcontent-%COMP%]:before{content:\"\\e926\"}.icn-bolt-down[_ngcontent-%COMP%]:before{content:\"\\e927\"}.icn-bolt-up[_ngcontent-%COMP%]:before{content:\"\\e928\"}.icn-img-o[_ngcontent-%COMP%]:before{content:\"\\e929\"}.icn-tick[_ngcontent-%COMP%]:before{content:\"\\e924\"}.icn-tick-o[_ngcontent-%COMP%]:before{content:\"\\e923\"}.icn-cross-o[_ngcontent-%COMP%]:before{content:\"\\e922\"}.icn-plus-o[_ngcontent-%COMP%]:before{content:\"\\e921\"}.icn-hide[_ngcontent-%COMP%]:before{content:\"\\e920\"}.icn-menu[_ngcontent-%COMP%]:before{content:\"\\e900\"}.icn-more[_ngcontent-%COMP%]:before{content:\"\\e901\"}.icn-msgs[_ngcontent-%COMP%]:before{content:\"\\e902\"}.icn-pin[_ngcontent-%COMP%]:before{content:\"\\e903\"}.icn-reply[_ngcontent-%COMP%]:before{content:\"\\e904\"}.icn-search[_ngcontent-%COMP%]:before{content:\"\\e905\"}.icn-settings[_ngcontent-%COMP%]:before{content:\"\\e906\"}.icn-treatment[_ngcontent-%COMP%]:before{content:\"\\e907\"}.icn-aid[_ngcontent-%COMP%]:before{content:\"\\e908\"}.icn-apple[_ngcontent-%COMP%]:before{content:\"\\e909\"}.icn-arrow-down[_ngcontent-%COMP%]:before{content:\"\\e90a\"}.icn-arrow-up[_ngcontent-%COMP%]:before{content:\"\\e91d\"}.icn-arrow-left[_ngcontent-%COMP%]:before{content:\"\\e91e\"}.icn-arrow-right[_ngcontent-%COMP%]:before{content:\"\\e91f\"}.icn-bell[_ngcontent-%COMP%]:before{content:\"\\e90b\"}.icn-bookmark-o[_ngcontent-%COMP%]:before{content:\"\\e90c\"}.icn-calendar[_ngcontent-%COMP%]:before{content:\"\\e90d\"}.icn-check[_ngcontent-%COMP%]:before{content:\"\\e90e\"}.icn-community[_ngcontent-%COMP%]:before{content:\"\\e90f\"}.icn-d-arrow-up[_ngcontent-%COMP%]:before{content:\"\\e910\"}.icn-discussion[_ngcontent-%COMP%]:before{content:\"\\e911\"}.icn-edit[_ngcontent-%COMP%]:before{content:\"\\e912\"}.icn-facebook[_ngcontent-%COMP%]:before{content:\"\\e913\"}.icn-filters[_ngcontent-%COMP%]:before{content:\"\\e914\"}.icn-friends[_ngcontent-%COMP%]:before{content:\"\\e915\"}.icn-google[_ngcontent-%COMP%]:before{content:\"\\e916\"}.icn-heart[_ngcontent-%COMP%]:before{content:\"\\e917\"}.icn-home[_ngcontent-%COMP%]:before{content:\"\\e918\"}.icn-img[_ngcontent-%COMP%]:before{content:\"\\e919\"}.icn-inspire[_ngcontent-%COMP%]:before{content:\"\\e91a\"}.icn-journal[_ngcontent-%COMP%]:before{content:\"\\e91b\"}.icn-like[_ngcontent-%COMP%]:before{content:\"\\e91c\"}.widget-pack[_ngcontent-%COMP%]{background:#fff;border-radius:.5rem;padding:.9375rem}.wp-body[_ngcontent-%COMP%], .wp-foot[_ngcontent-%COMP%]{margin-top:.9375rem}.wp-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;color:#061a73;margin:0;font-family:Lato,sans-serif}.wp-link[_ngcontent-%COMP%]{color:#6e6f70;font-size:.875rem;cursor:pointer}.wp-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.photo-slide[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:center}.photo-figure[_ngcontent-%COMP%]{margin:.375rem}.photo-figure[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{display:block;width:6.875rem;height:6.875rem;-o-object-fit:cover;object-fit:cover}.photo-stream[_ngcontent-%COMP%]{position:relative}.photo-nav[_ngcontent-%COMP%]{position:absolute;top:0;color:#000;font-size:.875rem;display:flex;align-items:center;cursor:pointer;height:100%;background:#fff}.icn-arrow-left[_ngcontent-%COMP%]{left:-.1875rem}.icn-arrow-right[_ngcontent-%COMP%]{right:-.1875rem}.neutral-info[_ngcontent-%COMP%]{font-size:.875rem;color:#6e6f70}.neutral-info[_ngcontent-%COMP%]   [class^=icn-][_ngcontent-%COMP%]{font-size:2.5rem;margin-bottom:.625rem;display:block;color:#c6cbc9}"] });
    return PhotoStreamComponent;
}());
export { PhotoStreamComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(PhotoStreamComponent, [{
        type: Component,
        args: [{
                selector: 'ins-photo-stream',
                templateUrl: './photo-stream.component.html',
                styleUrls: ['./photo-stream.component.scss'],
            }]
    }], function () { return []; }, { SlickCarousel: [{
            type: ViewChild,
            args: ['slickModal']
        }], photos: [{
            type: Input
        }], photosPerSlide: [{
            type: Input
        }], viewAll: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 