-
Notifications
You must be signed in to change notification settings - Fork 1
/
8259.9827d0f8f2e8a559.js
1 lines (1 loc) · 12.7 KB
/
8259.9827d0f8f2e8a559.js
1
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8259],{8259:(E,m,r)=>{r.r(m),r.d(m,{HomePageModule:()=>V});var a=r(177),p=r(9417),l=r(915),d=r(1470),h=r(467),n=r(4438);function _(e,c){1&e&&n.nrm(0,"div",5)}let f=(()=>{class e{constructor(t){this.modalController=t,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#n=this.\u0275fac=function(i){return new(i||e)(n.rXU(l.W3))};static#t=this.\u0275cmp=n.VBU({type:e,selectors:[["app-story"]],inputs:{stories:"stories",user:"user"},standalone:!0,features:[n.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&&(n.j41(0,"ion-content",0),n.bIt("click",function(){return o.nextStory()})("drag",function(){return o.dismiss()}),n.j41(1,"div",1),n.DNE(2,_,1,0,"div",2),n.k0s(),n.j41(3,"div",3),n.nrm(4,"img",4),n.k0s()()),2&i&&(n.R7$(2),n.Y8G("ngForOf",o.stories),n.R7$(2),n.Y8G("src",o.stories[o.activeStoryNum].src,n.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 g=r(5694),k=r(6863),w=r(8879),P=r(7984);const y=["instaVideo"],v=()=>["/p/notifications"],b=()=>["/p/conversations"],j=e=>[e];function M(e,c){if(1&e){const t=n.RV6();n.j41(0,"swiper-slide")(1,"ion-col",22),n.bIt("click",function(){const o=n.eBV(t).$implicit,s=n.XpG();return n.Njj(s.openStory(null==o?null:o.id))}),n.nrm(2,"img",23),n.qSk(),n.j41(3,"svg",12),n.nrm(4,"circle",13),n.k0s()(),n.joV(),n.j41(5,"p")(6,"ion-text",14),n.EFF(7),n.k0s()()()}if(2&e){const t=c.$implicit;n.R7$(2),n.Y8G("src",null==t?null:t.src,n.B4B),n.R7$(5),n.SpI(" User ",null==t?null:t.userId," ")}}function R(e,c){if(1&e){const t=n.RV6();n.j41(0,"div",46),n.bIt("dblclick",function(){n.eBV(t);const o=n.XpG().$implicit,s=n.XpG();return n.Njj(s.likePost(o))}),n.nrm(1,"img",47),n.k0s()}if(2&e){const t=n.XpG().$implicit;n.R7$(),n.Y8G("src",null==t?null:t.src,n.B4B)}}function I(e,c){if(1&e){const t=n.RV6();n.j41(0,"div",48),n.bIt("click",function(){n.eBV(t);const o=n.XpG(2);return n.Njj(o.changeVideoVolume())})("dblclick",function(){n.eBV(t);const o=n.XpG().$implicit,s=n.XpG();return n.Njj(s.likePost(o))}),n.j41(1,"video",49,0),n.nrm(3,"source",50),n.k0s()()}if(2&e){const t=n.XpG().$implicit,i=n.XpG();n.R7$(),n.Y8G("muted",i.muteStatus),n.R7$(2),n.Y8G("src",null==t?null:t.src,n.B4B)}}function C(e,c){if(1&e&&(n.j41(0,"strong"),n.EFF(1),n.nI1(2,"translate"),n.k0s()),2&e){const t=n.XpG().$implicit,i=n.XpG();n.R7$(),n.Lme("",i.commonFunctions.nFormatter(t.likes,1)," ",n.bMT(2,2,"Likes"),"")}}function S(e,c){if(1&e&&(n.j41(0,"h4",51),n.EFF(1),n.k0s()),2&e){const t=n.XpG().$implicit;n.R7$(),n.SpI(" ",null==t?null:t.description," ")}}function $(e,c){1&e&&(n.j41(0,"h4",51),n.EFF(1),n.nI1(2,"translate"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"No Description")," "))}function x(e,c){if(1&e){const t=n.RV6();n.j41(0,"ion-note",52),n.bIt("click",function(){n.eBV(t);const o=n.XpG().$implicit,s=n.XpG();return n.Njj(s.toggleWrap(o))}),n.EFF(1),n.nI1(2,"translate"),n.nI1(3,"translate"),n.k0s()}if(2&e){const t=n.XpG().$implicit;n.R7$(),n.SpI(" ",null!=t&&t.wrap?n.bMT(2,1,"Less"):n.bMT(3,3,"More")," ")}}function G(e,c){if(1&e){const t=n.RV6();n.j41(0,"ion-row",24)(1,"ion-col",25)(2,"ion-item",26)(3,"ion-avatar",27),n.nrm(4,"ion-img",28),n.k0s(),n.j41(5,"ion-label")(6,"strong"),n.EFF(7),n.k0s(),n.j41(8,"p")(9,"ion-text"),n.EFF(10),n.k0s()()(),n.j41(11,"ion-button",29),n.nrm(12,"ion-icon",30),n.k0s()(),n.DNE(13,R,2,1,"div",31)(14,I,4,2,"div",32),n.j41(15,"ion-item",33)(16,"aside",34)(17,"ion-button",35),n.bIt("click",function(){const o=n.eBV(t).$implicit,s=n.XpG();return n.Njj(s.likePost(o))}),n.nrm(18,"ion-icon",36),n.k0s(),n.j41(19,"ion-button",37),n.nrm(20,"ion-icon",38),n.k0s(),n.j41(21,"ion-button",37),n.nrm(22,"ion-icon",6),n.k0s()(),n.j41(23,"ion-button",39),n.nrm(24,"ion-icon",40),n.k0s()(),n.j41(25,"ion-item",41)(26,"ion-label"),n.DNE(27,C,3,4,"strong",42),n.j41(28,"p")(29,"ion-text",43)(30,"strong"),n.EFF(31),n.k0s(),n.DNE(32,S,2,1,"h4",44)(33,$,3,3,"h4",44),n.k0s()(),n.DNE(34,x,4,5,"ion-note",45),n.k0s()()()()}if(2&e){const t=c.$implicit;n.R7$(2),n.AVh("video-header",!(null!=t&&t.image)),n.R7$(),n.Y8G("routerLink",n.eq3(17,j,"/p/profile/"+(null==t?null:t.userid))),n.R7$(),n.Y8G("src",null==t?null:t.profile_picture),n.R7$(3),n.JRh(null==t?null:t.username),n.R7$(3),n.JRh(null==t?null:t.location),n.R7$(3),n.Y8G("ngIf",null==t?null:t.image),n.R7$(),n.Y8G("ngIf",!(null!=t&&t.image)),n.R7$(4),n.Y8G("color",null!=t&&t.liked?"danger":"dark")("name",null!=t&&t.liked?"heart":"heart-outline"),n.R7$(9),n.Y8G("ngIf",(null==t?null:t.likes)>0),n.R7$(),n.HbH(null!=t&&t.wrap?"ion-text-wrap":"ion-text-no-wrap"),n.R7$(3),n.JRh(null==t?null:t.username),n.R7$(),n.Y8G("ngIf",null!=(null==t?null:t.description)),n.R7$(),n.Y8G("ngIf",null==(null==t?null:t.description)),n.R7$(),n.Y8G("ngIf",(null==t?null:t.description)&&null!=(null==t?null:t.description)&&t.description.length>5)}}const O=[{path:"",component:(()=>{class e{constructor(t,i,o,s,u){this.modalController=t,this.dataManager=i,this.commonFunctions=o,this.statusExchanger=s,this.changeDetectorRef=u,this.nowPlaying=null,this.muteStatus=!0,this.overlayActivated=!1,this.sliceNum=5,this.stories=[]}ngOnInit(){this.statusExchanger.isModalOpened.subscribe(t=>{this.overlayActivated=t,this.nowPlaying&&(1==t?this.nowPlaying.pause():this.nowPlaying.play())}),this.dataManager.getLoggedInUser(t=>{this.loggedUserInfo=t}),this.dataManager.getStories(t=>{this.stories=t,this.slidesPerView=this.commonFunctions.checkScreen(this.stories.length)}),this.dataManager.getPosts(t=>{this.feeds=t})}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(t){const i=t.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(t=>{if(this.nowPlaying)return;const i=t.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(t){this.dataManager.getStories(i=>{this.stories=i}),this.dataManager.getPosts(i=>{this.feeds=i}),setTimeout(()=>{t.target.complete()},2e3)}toggleWrap(t){t.wrap=!t.wrap}loadData(t){setTimeout(()=>{this.sliceNum+=5,t.target.complete()},500)}toggleInfiniteScroll(){this.infiniteScroll.disabled=!this.infiniteScroll.disabled}likePost(t){1!=t.liked?(t.likes+=1,t.liked=!0):(t.likes-=1,t.liked=!1)}openStory(t){var i=this;return(0,h.A)(function*(){let o=yield i.modalController.create({component:f,componentProps:{stories:i.stories,tapped:t}});return o.onDidDismiss().then(()=>{i.reorderStories()}),yield o.present()})()}reorderStories(){this.stories.sort((t,i)=>t.seen?1:i.seen?-1:0)}static#n=this.\u0275fac=function(i){return new(i||e)(n.rXU(l.W3),n.rXU(k.j),n.rXU(w.k),n.rXU(P.r),n.rXU(n.gRc))};static#t=this.\u0275cmp=n.VBU({type:e,selectors:[["app-home"]],viewQuery:function(i,o){if(1&i&&(n.GBs(l.Ax,5),n.GBs(y,5)),2&i){let s;n.mGM(s=n.lsd())&&(o.infiniteScroll=s.first),n.mGM(s=n.lsd())&&(o.videos=s)}},standalone:!0,features:[n.aNF],decls:31,vars:19,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"],[1,"circle"],["name","add","color","dark"],["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"],["color","dark"],[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,"circle",3,"click"],[1,"story-image",3,"src"],[1,"postClass"],["size","12"],["lines","none","color","none",1,"post-header"],["slot","start",3,"routerLink"],[3,"src"],["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"],["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",1,"details"],[4,"ngIf"],["color","dark",1,"userAndDesc"],["class","description",4,"ngIf"],[3,"click",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"],[1,"description"],[3,"click"]],template:function(i,o){1&i&&(n.j41(0,"ion-header",1)(1,"ion-toolbar")(2,"ion-title",2),n.EFF(3,"Instagram"),n.k0s(),n.j41(4,"ion-buttons",3)(5,"ion-button",4),n.nrm(6,"ion-icon",5),n.k0s(),n.j41(7,"ion-button",4),n.nrm(8,"ion-icon",6),n.k0s()()()(),n.j41(9,"ion-content",7),n.bIt("ionScroll",function(){return o.didScroll()}),n.j41(10,"div",8)(11,"swiper-container",9)(12,"swiper-slide")(13,"ion-col",10),n.nrm(14,"ion-icon",11),n.qSk(),n.j41(15,"svg",12),n.nrm(16,"circle",13),n.k0s()(),n.joV(),n.j41(17,"p")(18,"ion-text",14),n.EFF(19),n.nI1(20,"translate"),n.k0s()()(),n.DNE(21,M,8,2,"swiper-slide",15),n.k0s()(),n.j41(22,"ion-row",16)(23,"ion-col",17)(24,"ion-grid",18)(25,"ion-list"),n.DNE(26,G,35,19,"ion-row",19),n.nI1(27,"slice"),n.k0s(),n.j41(28,"ion-infinite-scroll",20),n.bIt("ionInfinite",function(u){return o.loadData(u)}),n.nrm(29,"ion-infinite-scroll-content",21),n.nI1(30,"translate"),n.k0s()()()()()),2&i&&(n.R7$(5),n.Y8G("routerLink",n.lJ4(17,v)),n.R7$(2),n.Y8G("routerLink",n.lJ4(18,b)),n.R7$(2),n.Y8G("scrollEvents",!0),n.R7$(2),n.Y8G("slides-per-view",o.slidesPerView)("allowSlideNext",o.stories.length>=4),n.R7$(8),n.JRh(n.bMT(20,9,"New")),n.R7$(2),n.Y8G("ngForOf",o.stories),n.R7$(5),n.Y8G("ngForOf",n.brH(27,11,o.feeds,0,o.sliceNum)),n.R7$(3),n.Y8G("loadingText",n.bMT(30,15,"Loading more data...")))},dependencies:[l.bv,l.mC,l.Jm,l.QW,l.hU,l.W9,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,g.h,g.D9],styles:["ion-header[_ngcontent-%COMP%] ion-toolbar[_ngcontent-%COMP%] ion-buttons[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%]{width:40px;height:40px}ion-header[_ngcontent-%COMP%] ion-toolbar[_ngcontent-%COMP%] ion-buttons[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{font-size:25px}ion-header[_ngcontent-%COMP%] ion-toolbar[_ngcontent-%COMP%] ion-buttons[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%]::part(native){padding:0!important}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}ion-content[_ngcontent-%COMP%] ion-grid[_ngcontent-%COMP%] ion-row[_ngcontent-%COMP%]{margin-bottom:5vh}.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 F=(()=>{class e{static#n=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=n.$C({type:e});static#e=this.\u0275inj=n.G2t({imports:[d.iI.forChild(O),d.iI]})}return e})(),V=(()=>{class e{static#n=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=n.$C({type:e});static#e=this.\u0275inj=n.G2t({imports:[a.MD,p.YN,l.bv,F]})}return e})()}}]);