-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path8259.9abaa231e00b6478.js
1 lines (1 loc) · 12.2 KB
/
8259.9abaa231e00b6478.js
1
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8259],{8259:(T,u,r)=>{r.r(u),r.d(u,{HomePageModule:()=>E});var a=r(177),g=r(9417),l=r(375),d=r(1470),p=r(467),t=r(4438);function h(e,c){1&e&&t.nrm(0,"div",5)}let f=(()=>{class e{constructor(n){this.modalController=n,this.activeStoryNum=0}ngOnInit(){}ionViewDidEnter(){}nextStory(){this.stories.length-1>this.activeStoryNum?this.activeStoryNum+=1:this.activeStoryNum=0}dismiss(){this.modalController.dismiss({dismissed:!0})}static{this.\u0275fac=function(i){return new(i||e)(t.rXU(l.W3))}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-story"]],inputs:{stories:"stories",user:"user"},standalone:!0,features:[t.aNF],decls:5,vars:2,consts:[[3,"click","drag"],[1,"storynum"],["class","storyline",4,"ngFor","ngForOf"],[1,"story"],[3,"src"],[1,"storyline"]],template:function(i,o){1&i&&(t.j41(0,"ion-content",0),t.bIt("click",function(){return o.nextStory()})("drag",function(){return o.dismiss()}),t.j41(1,"div",1),t.DNE(2,h,1,0,"div",2),t.k0s(),t.j41(3,"div",3),t.nrm(4,"img",4),t.k0s()()),2&i&&(t.R7$(2),t.Y8G("ngForOf",o.stories),t.R7$(2),t.Y8G("src",o.stories[o.activeStoryNum].src,t.B4B))},dependencies:[l.bv,l.W9,a.pM],styles:[".storynum[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.storyline[_ngcontent-%COMP%]{width:99%;margin-left:5px;height:5px;background-color:#fff}.story[_ngcontent-%COMP%]{height:99%}.story[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:-webkit-fill-available;object-fit:cover}"]})}}return e})();var _=r(7408),k=r(6863),v=r(8879),y=r(7984);const w=["instaVideo"],P=()=>["/p/notifications"],b=()=>["/p/conversations"],R=e=>[e];function j(e,c){if(1&e&&(t.j41(0,"swiper-slide")(1,"div",18)(2,"ion-fab",19)(3,"ion-fab-button",20),t.nrm(4,"ion-icon",21),t.k0s()(),t.nrm(5,"img",22),t.k0s(),t.j41(6,"p",23),t.EFF(7),t.nI1(8,"translate"),t.k0s()()),2&e){const n=t.XpG();t.R7$(5),t.Y8G("src",n.loggedUserInfo.profile_picture,t.B4B),t.R7$(2),t.JRh(t.bMT(8,2,"Your story"))}}function I(e,c){if(1&e){const n=t.RV6();t.j41(0,"swiper-slide")(1,"ion-col",24),t.bIt("click",function(){const o=t.eBV(n).$implicit,s=t.XpG();return t.Njj(s.openStory(null==o?null:o.id))}),t.nrm(2,"img",25),t.qSk(),t.j41(3,"svg",26),t.nrm(4,"circle",27),t.k0s()(),t.joV(),t.j41(5,"p",23),t.EFF(6),t.k0s()()}if(2&e){const n=c.$implicit;t.R7$(2),t.Y8G("src",null==n?null:n.src,t.B4B),t.R7$(4),t.SpI("User ",null==n?null:n.userId,"")}}function G(e,c){if(1&e){const n=t.RV6();t.j41(0,"div",47),t.bIt("dblclick",function(){t.eBV(n);const o=t.XpG().$implicit,s=t.XpG();return t.Njj(s.likePost(o))}),t.nrm(1,"img",48),t.k0s()}if(2&e){const n=t.XpG().$implicit;t.R7$(),t.Y8G("src",null==n?null:n.src,t.B4B)}}function $(e,c){if(1&e){const n=t.RV6();t.j41(0,"div",49),t.bIt("click",function(){t.eBV(n);const o=t.XpG(2);return t.Njj(o.changeVideoVolume())})("dblclick",function(){t.eBV(n);const o=t.XpG().$implicit,s=t.XpG();return t.Njj(s.likePost(o))}),t.j41(1,"video",50,0),t.nrm(3,"source",51),t.k0s()()}if(2&e){const n=t.XpG().$implicit,i=t.XpG();t.R7$(),t.Y8G("muted",i.muteStatus),t.R7$(2),t.Y8G("src",null==n?null:n.src,t.B4B)}}function S(e,c){if(1&e&&(t.j41(0,"ion-text",20),t.EFF(1),t.k0s()),2&e){const n=t.XpG().$implicit,i=t.XpG();t.R7$(),t.JRh(i.commonFunctions.nFormatter(n.likes,1))}}function x(e,c){if(1&e){const n=t.RV6();t.j41(0,"ion-note",56),t.bIt("click",function(){t.eBV(n);const o=t.XpG(2).$implicit,s=t.XpG();return t.Njj(s.toggleWrap(o))}),t.EFF(1),t.nI1(2,"translate"),t.nI1(3,"translate"),t.k0s()}if(2&e){const n=t.XpG(2).$implicit;t.R7$(),t.SpI(" ",null!=n&&n.wrap?t.bMT(2,1,"Less"):t.bMT(3,3,"More")," ")}}function F(e,c){if(1&e&&(t.j41(0,"ion-item",52)(1,"ion-label")(2,"p")(3,"ion-text",53)(4,"strong"),t.EFF(5),t.k0s(),t.j41(6,"h4",54),t.EFF(7),t.k0s()()(),t.DNE(8,x,4,5,"ion-note",55),t.k0s()()),2&e){const n=t.XpG().$implicit;t.R7$(2),t.HbH(null!=n&&n.wrap?"ion-text-wrap":"ion-text-no-wrap"),t.R7$(3),t.JRh(null==n?null:n.username),t.R7$(2),t.JRh(null==n?null:n.description),t.R7$(),t.Y8G("ngIf",(null==n?null:n.description)&&null!=(null==n?null:n.description)&&n.description.length>5)}}function M(e,c){if(1&e){const n=t.RV6();t.j41(0,"div",28)(1,"ion-item",29)(2,"ion-avatar",30),t.nrm(3,"ion-img",22),t.k0s(),t.j41(4,"ion-label")(5,"p",31)(6,"strong"),t.EFF(7),t.k0s()(),t.j41(8,"p",32)(9,"ion-text"),t.EFF(10),t.k0s()()(),t.j41(11,"ion-button",33),t.nrm(12,"ion-icon",34),t.k0s()(),t.DNE(13,G,2,1,"div",35)(14,$,4,2,"div",36),t.j41(15,"ion-item",37)(16,"aside",38)(17,"ion-button",39),t.bIt("click",function(){const o=t.eBV(n).$implicit,s=t.XpG();return t.Njj(s.likePost(o))}),t.nrm(18,"ion-icon",40),t.DNE(19,S,2,1,"ion-text",41),t.k0s(),t.j41(20,"ion-button",42),t.nrm(21,"ion-icon",43),t.k0s(),t.j41(22,"ion-button",42),t.nrm(23,"ion-icon",6),t.k0s()(),t.j41(24,"ion-button",44),t.nrm(25,"ion-icon",45),t.k0s()(),t.DNE(26,F,9,5,"ion-item",46),t.k0s()}if(2&e){const n=c.$implicit;t.R7$(),t.AVh("video-header",!(null!=n&&n.image)),t.R7$(),t.Y8G("routerLink",t.eq3(12,R,"/p/profile/"+(null==n?null:n.userid))),t.R7$(),t.Y8G("src",null==n?null:n.profile_picture),t.R7$(4),t.JRh(null==n?null:n.username),t.R7$(3),t.JRh(null==n?null:n.location),t.R7$(3),t.Y8G("ngIf",null==n?null:n.image),t.R7$(),t.Y8G("ngIf",!(null!=n&&n.image)),t.R7$(4),t.Y8G("color",null!=n&&n.liked?"danger":"dark")("name",null!=n&&n.liked?"heart":"heart-outline"),t.R7$(),t.Y8G("ngIf",(null==n?null:n.likes)>0),t.R7$(7),t.Y8G("ngIf",null!=(null==n?null:n.description))}}const C=[{path:"",component:(()=>{class e{constructor(n,i,o,s,m){this.modalController=n,this.dataManager=i,this.commonFunctions=o,this.statusExchanger=s,this.changeDetectorRef=m,this.nowPlaying=null,this.muteStatus=!0,this.overlayActivated=!1,this.sliceNum=5,this.stories=[]}ngOnInit(){this.statusExchanger.isModalOpened.subscribe(n=>{this.overlayActivated=n,this.nowPlaying&&(1==n?this.nowPlaying.pause():this.nowPlaying.play())}),this.dataManager.getLoggedInUser(n=>{this.loggedUserInfo=n}),this.dataManager.getStories(n=>{this.stories=n,this.slidesPerView=this.commonFunctions.checkScreen(this.stories.length)}),this.dataManager.getPosts(n=>{this.feeds=n})}ngOnDestroy(){this.statusExchanger.isModalOpened.unsubscribe()}ngAfterViewInit(){this.didScroll()}ionViewDidEnter(){this.changeDetectorRef.detectChanges(),null!=this.nowPlaying&&this.nowPlaying.play()}ionViewWillLeave(){this.changeDetectorRef.detach(),null!=this.nowPlaying&&this.nowPlaying.pause()}isElementInViewport(n){const i=n.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&i.right<=(window.innerWidth||document.documentElement.clientWidth)}didScroll(){this.nowPlaying&&this.isElementInViewport(this.nowPlaying)||(this.nowPlaying&&!this.isElementInViewport(this.nowPlaying)&&(this.nowPlaying.pause(),this.nowPlaying=null),this.videos.forEach(n=>{if(this.nowPlaying)return;const i=n.nativeElement;this.isElementInViewport(i)&&(this.nowPlaying=i,this.nowPlaying.play())}))}changeVideoVolume(){null!=this.nowPlaying&&(this.nowPlaying.muted?(this.nowPlaying.muted=!1,this.muteStatus=!1):(this.nowPlaying.muted=!0,this.muteStatus=!0))}doRefresh(n){this.dataManager.getStories(i=>{this.stories=i}),this.dataManager.getPosts(i=>{this.feeds=i}),setTimeout(()=>{n.target.complete()},2e3)}toggleWrap(n){n.wrap=!n.wrap}loadData(n){setTimeout(()=>{this.sliceNum+=5,n.target.complete()},500)}toggleInfiniteScroll(){this.infiniteScroll.disabled=!this.infiniteScroll.disabled}likePost(n){1!=n.liked?(n.likes+=1,n.liked=!0):(n.likes-=1,n.liked=!1)}openStory(n){var i=this;return(0,p.A)(function*(){let o=yield i.modalController.create({component:f,componentProps:{stories:i.stories,tapped:n}});return o.onDidDismiss().then(()=>{i.reorderStories()}),yield o.present()})()}reorderStories(){this.stories.sort((n,i)=>n.seen?1:i.seen?-1:0)}static{this.\u0275fac=function(i){return new(i||e)(t.rXU(l.W3),t.rXU(k.j),t.rXU(v.k),t.rXU(y.r),t.rXU(t.gRc))}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-home"]],viewQuery:function(i,o){if(1&i&&(t.GBs(l.Ax,5),t.GBs(w,5)),2&i){let s;t.mGM(s=t.lsd())&&(o.infiniteScroll=s.first),t.mGM(s=t.lsd())&&(o.videos=s)}},standalone:!0,features:[t.aNF],decls:23,vars:17,consts:[["instaVideo",""],[1,"ion-no-border"],["mode","md","color","dark"],["slot","end"],["button","","fill","clear",3,"routerLink"],["slot","icon-only","name","heart-outline","color","dark"],["slot","icon-only","name","paper-plane-outline","color","dark"],[1,"has-header",3,"ionScroll","scrollEvents"],[1,"stories"],[3,"slides-per-view","allowSlideNext"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"feedRow"],[1,"home-content"],[1,"ion-no-padding",2,"margin-bottom","0px"],["class","postClass",4,"ngFor","ngForOf"],["threshold","50px",3,"ionInfinite"],["loadingSpinner","bubbles",3,"loadingText"],[1,"thumbnail","circle"],["vertical","bottom","horizontal","right"],["color","dark"],["name","add","color","light"],[3,"src"],[1,"story-title"],[1,"circle",3,"click"],[1,"story-image",3,"src"],["viewBox","0 0 100 100","xmlns","http://www.w3.org/2000/svg",0,"xml","space","preserve",2,"enable-background","new -580 439 577.9 194"],["cx","50","cy","50","r","40"],[1,"postClass"],["lines","none","color","none",1,"post-header"],["slot","start",3,"routerLink"],[1,"username"],[1,"location"],["slot","end","fill","clear"],["slot","icon-only","name","ellipsis-vertical","color","dark",2,"font-size","16px"],["class","post",3,"dblclick",4,"ngIf"],["class","videoSize",3,"click","dblclick",4,"ngIf"],["lines","none",1,"actions-bar"],[1,"left"],["slot","start","fill","clear",1,"iconsStart",3,"click"],["slot","icon-only",1,"likeButton",3,"color","name"],["color","dark",4,"ngIf"],["slot","start","fill","clear",1,"iconsStart"],["slot","icon-only","name","chatbubble-outline","color","dark"],["slot","end","fill","clear",1,"iconsStart",2,"--padding-end","0px"],["slot","icon-only","name","bookmark-outline","color","dark"],["lines","none","class","details",4,"ngIf"],[1,"post",3,"dblclick"],["alt","",3,"src"],[1,"videoSize",3,"click","dblclick"],["playsinline","","loop","","preload","auto",3,"muted"],["type","video/mp4",3,"src"],["lines","none",1,"details"],["color","dark",1,"userAndDesc"],[1,"description"],[3,"click",4,"ngIf"],[3,"click"]],template:function(i,o){1&i&&(t.j41(0,"ion-header",1)(1,"ion-toolbar")(2,"ion-title",2),t.EFF(3,"Instagram"),t.k0s(),t.j41(4,"ion-buttons",3)(5,"ion-button",4),t.nrm(6,"ion-icon",5),t.k0s(),t.j41(7,"ion-button",4),t.nrm(8,"ion-icon",6),t.k0s()()()(),t.j41(9,"ion-content",7),t.bIt("ionScroll",function(){return o.didScroll()}),t.j41(10,"div",8)(11,"swiper-container",9),t.DNE(12,j,9,4,"swiper-slide",10)(13,I,7,2,"swiper-slide",11),t.k0s()(),t.j41(14,"ion-row",12)(15,"ion-col",13)(16,"ion-grid",14)(17,"ion-list"),t.DNE(18,M,27,14,"div",15),t.nI1(19,"slice"),t.k0s(),t.j41(20,"ion-infinite-scroll",16),t.bIt("ionInfinite",function(m){return o.loadData(m)}),t.nrm(21,"ion-infinite-scroll-content",17),t.nI1(22,"translate"),t.k0s()()()()()),2&i&&(t.R7$(5),t.Y8G("routerLink",t.lJ4(15,P)),t.R7$(2),t.Y8G("routerLink",t.lJ4(16,b)),t.R7$(2),t.Y8G("scrollEvents",!0),t.R7$(2),t.Y8G("slides-per-view",o.slidesPerView)("allowSlideNext",o.stories.length>=4),t.R7$(),t.Y8G("ngIf",o.loggedUserInfo),t.R7$(),t.Y8G("ngForOf",o.stories),t.R7$(5),t.Y8G("ngForOf",t.brH(19,9,o.feeds,0,o.sliceNum)),t.R7$(3),t.Y8G("loadingText",t.bMT(22,13,"Loading more data...")))},dependencies:[l.bv,l.mC,l.Jm,l.QW,l.hU,l.W9,l.Q8,l.YW,l.lO,l.eU,l.iq,l.KW,l.Ax,l.Hp,l.uz,l.he,l.nf,l.JI,l.ln,l.IO,l.BC,l.ai,l.N7,d.Wk,a.pM,a.bT,a.P9,_.D9],styles:["ion-header[_ngcontent-%COMP%] ion-toolbar[_ngcontent-%COMP%] ion-title[_ngcontent-%COMP%]{font-family:instagram!important;font-size:1.4rem!important;font-weight:400!important;padding-inline:5px}ion-content[_ngcontent-%COMP%] ion-grid[_ngcontent-%COMP%]{width:100%;margin-bottom:10vh}.feedRow[_ngcontent-%COMP%]{width:100%;max-width:935px;padding:0 0 8px;margin:0 auto;display:flex}.home-content[_ngcontent-%COMP%]{width:100%;max-width:614px;margin:0 auto;display:flex;flex-direction:column}.likeButton[_ngcontent-%COMP%]{transition:all .3s ease}"]})}}return e})()}];let V=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=t.$C({type:e})}static{this.\u0275inj=t.G2t({imports:[d.iI.forChild(C),d.iI]})}}return e})(),E=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=t.$C({type:e})}static{this.\u0275inj=t.G2t({imports:[a.MD,g.YN,l.bv,V]})}}return e})()}}]);