(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[5273],{52098:(t,e,s)=>{"use strict";function i(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var s={}.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?o(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,i=Array(e);sr});const r={props:{pid:{type:String},selfProfile:{type:Object},redirectUrl:{type:String,default:"/"}},data:function(){return{loading:!0,profile:null,account:{local:!1},owner:!1,stories:[],username:"loading...",avatar:"/storage/avatars/default.jpg",storyIndex:0,progress:0,constInterval:383,progressInterval:void 0,composeText:null,paused:!1,muted:!0,reactionEmoji:["❤️","🔥","💯","😂","😎","👀"],activeReactionEmoji:!1,activeReply:!1,showProgress:!1,redirectOnEnd:"/",viewerSid:!1,viewerPage:1,loadingViewers:!1,viewersHasMore:!0,viewers:[],viewWarning:!1,showingPollResults:!1,loadingPollResults:!1,pollResults:[],pollTotalVotes:0}},watch:{composeText:function(t){0==t.length?this.paused&&this.pause():this.paused||this.pause(),event.currentTarget.focus()}},beforeMount:function(){this.redirectOnEnd=this.redirectUrl},mounted:function(){var t=this,e=new URLSearchParams(window.location.search);if(e.has("t"))switch(e.get("t")){case"1":this.redirectOnEnd="/";break;case"2":this.redirectOnEnd="/timeline/public";break;case"3":this.redirectOnEnd="/timeline/network";break;case"4":this.redirectOnEnd="/"+window.location.pathname.split("/").slice(-1).pop()}else this.viewWarning=!0;this.selfProfile&&this.selfProfile.hasOwnProperty("avatar")?this.profile=this.selfProfile:axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(e){t.profile=e.data,t.fetchStories()}));var s=document.querySelector("body");s.style.width="100%",s.style.height="100vh !important",s.style.overflow="hidden",s.style.backgroundColor="#262626"},methods:{init:function(){var t=this;clearInterval(this.progressInterval),this.loading=!1,this.constInterval=Math.ceil(38.3*this.stories[this.storyIndex].duration),this.progressInterval=setInterval((function(){t.do()}),this.constInterval)},do:function(){this.loading=!1,100!=this.stories[this.storyIndex].progress?this.stories[this.storyIndex].progress=this.stories[this.storyIndex].progress+4:(clearInterval(this.progressInterval),this.next())},prev:function(){0!=this.storyIndex&&(this.pollResults=[],this.progress=0,this.gotoSlide(this.storyIndex-1))},next:function(){if(axios.post("/api/web/stories/v1/viewed",{id:this.stories[this.storyIndex].id}),this.stories[this.storyIndex].progress=100,this.storyIndex!=this.stories.length-1)this.pollResults=[],this.progress=0,this.muted=!0,this.storyIndex=this.storyIndex+1,this.init();else{if(this.composeText&&this.composeText.length)return;window.location.href=this.redirectOnEnd}},pause:function(){if(event&&event.currentTarget.blur(),this.paused){if(this.paused=!1,"video"==this.stories[this.storyIndex].type)document.getElementById("playr").play();this.init()}else{if(clearInterval(this.progressInterval),"video"==this.stories[this.storyIndex].type)document.getElementById("playr").pause();this.paused=!0}},toggleMute:function(){(event&&event.currentTarget.blur(),"video"==this.stories[this.storyIndex].type)&&(this.muted=!this.muted,document.getElementById("playr").muted=this.muted)},gotoSlide:function(t){this.paused=!1,clearInterval(this.progressInterval),this.progressInterval=null,this.stories=this.stories.map((function(e,s){return e.progress=s{"use strict";s.r(e),s.d(e,{render:()=>i,staticRenderFns:()=>o});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"story-viewer-component container mt-0 mt-md-5 bg-black"},[e("button",{staticClass:"d-none d-md-block btn btn-link fixed-top",staticStyle:{left:"auto",right:"0"},attrs:{type:"button"},on:{click:t.backToFeed}},[e("i",{staticClass:"fal fa-times-circle fa-2x text-lighter"})]),t._v(" "),t.viewWarning?e("div",{staticClass:"row d-flex justify-content-center align-items-center"},[t.loading?t._e():e("div",{staticClass:"col-12 col-md-6 rounded-lg p-0"},["photo"==t.stories[t.storyIndex].type?e("div",{key:"msl:"+t.storyIndex,staticClass:"media-slot rounded-lg",style:{backgroundImage:"url("+t.stories[t.storyIndex].url+")"}}):t._e(),t._v(" "),e("div",{staticClass:"story-viewer-component-card card bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{"backdrop-filter":"blur(40px) brightness(0.3)","-webkit-backdrop-filter":"blur(10px)"}},[e("div",{staticClass:"card-body"},[e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[e("div",{staticClass:"text-center"},[e("img",{staticClass:"rounded-circle border mb-3 shadow",attrs:{src:t.profile.avatar,width:"120",height:"120"}}),t._v(" "),e("p",{staticClass:"lead text-lighter mb-1"},[t._v("View as "),e("span",{staticClass:"text-white"},[t._v(t._s(t.profile.username))])]),t._v(" "),e("p",{staticClass:"text-lighter font-weight-lighter px-md-5 py-3"},[e("span",{staticClass:"text-white font-weight-bold"},[t._v(t._s(t.account.acct))]),t._v(" will be able to see that you viewed their story.\n\t\t\t\t\t\t\t")]),t._v(" "),e("button",{staticClass:"btn btn-outline-lighter rounded-pill py-1 font-weight-bold",on:{click:t.confirmViewStory}},[t._v("View Story")]),t._v(" "),e("button",{staticClass:"btn btn-outline-lighter rounded-pill py-1 font-weight-bold",on:{click:t.cancelViewStory}},[t._v("Cancel")])])])])])])]):e("div",{staticClass:"row d-flex justify-content-center align-items-center"},[e("div",{staticClass:"d-none d-md-block col-md-1 cursor-pointer text-center",on:{click:t.prev}},[t.storyIndex>0?e("div",[e("i",{staticClass:"fas fa-chevron-circle-left text-muted fa-2x"})]):t._e()]),t._v(" "),t.loading?t._e():e("div",{staticClass:"col-12 col-md-6 rounded-lg"},[t.activeReactionEmoji?e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center",staticStyle:{position:"absolute","z-index":"999"}},[t._m(0)]):t._e(),t._v(" "),t.activeReply?e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center",staticStyle:{position:"absolute","z-index":"999"}},[t._m(1)]):t._e(),t._v(" "),e("transition",{attrs:{name:"fade"}},["photo"==t.stories[t.storyIndex].type?e("div",{key:"msl:"+t.storyIndex,staticClass:"media-slot rounded-lg",style:{background:"url("+t.stories[t.storyIndex].url+")"}}):"poll"==t.stories[t.storyIndex].type?e("div",{key:"msl:"+t.storyIndex,staticClass:"media-slot rounded-lg",style:{background:"linear-gradient(to right, #F27121, #E94057, #8A2387)"}}):"video"==t.stories[t.storyIndex].type?e("video",{key:"plyr"+t.stories[t.storyIndex].id,staticClass:"media-slot rounded-lg",staticStyle:{"object-fit":"contain"},attrs:{id:"playr",loop:"",autoplay:"","no-controls":""},domProps:{muted:t.muted}},[e("source",{attrs:{src:t.stories[t.storyIndex].url,type:"video/mp4"}})]):t._e()]),t._v(" "),e("div",{staticClass:"story-viewer-component-card card bg-transparent border-0 shadow-none d-flex justify-content-center"},[e("div",{staticClass:"card-body"},[e("div",{staticClass:"px-0 top-overlay"},[e("div",{staticClass:"pt-4 pt-md-3 px-4 d-flex"},[e("div",{staticClass:"d-none bg-muted",staticStyle:{width:"100%",height:"5px"}}),t._v(" "),t._l(t.stories,(function(s,i){return e("div",{key:"sp:s"+i,staticClass:"w-100 cursor-pointer",class:{"mr-2":i!=t.stories.length-1},on:{click:function(e){return t.gotoSlide(i)}}},[e("div",{staticClass:"progress w-100",staticStyle:{"z-index":"3",height:"4px"},style:{opacity:0==s.progress?.7:.8}},[e("div",{key:"sp:si"+i,staticClass:"progress-bar bg-light",style:{width:s.progress+"%",transition:"none !important"},attrs:{role:"progressbar","aria-valuenow":s.progress,"aria-valuemin":"0","aria-valuemax":"100"}})])])}))],2),t._v(" "),e("div",{staticClass:"pt-4 px-4 media align-items-center"},[e("img",{staticClass:"rounded-circle mr-2",attrs:{src:t.avatar,width:"32",height:"32",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'"}}),t._v(" "),e("div",{staticClass:"media-body d-flex justify-content-between align-items-center"},[e("div",{staticClass:"user-select-none d-flex align-items-center"},[t.account.local?e("span",{staticClass:"text-white font-weight-bold mr-2"},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.username)+"\n\t\t\t\t\t\t\t\t\t")]):e("span",{staticClass:"text-white font-weight-bold mr-3 text-truncate",staticStyle:{"max-width":"200px"}},[e("span",{staticClass:"d-block mb-n2"},[t._v(t._s(t.account.username))]),t._v(" "),e("span",{staticClass:"small"},[t._v(t._s(t.account.domain))])]),t._v(" "),e("span",{staticClass:"text-white font-weight-light",staticStyle:{"font-size":"14px"}},[t._v(t._s(t.timeago(t.stories[t.storyIndex].created_at)))]),t._v(" "),"poll"==t.stories[t.storyIndex].type?e("span",[e("span",{staticClass:"btn btn-outline-light font-weight-light btn-sm px-1 rounded py-0 ml-2"},[t._v("POLL")])]):t._e()]),t._v(" "),e("div",[e("button",{staticClass:"btn btn-link btn-sm text-white mr-0 px-1",on:{click:function(e){return e.preventDefault(),t.pause.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-lg",class:[t.paused?"fa-play":"fa-pause"]})]),t._v(" "),"video"==t.stories[t.storyIndex].type?e("button",{staticClass:"btn btn-link text-white px-2",on:{click:t.toggleMute}},[e("i",{staticClass:"fas fa-lg",class:[t.muted?"fa-volume-mute":"fa-volume-up"]})]):t._e(),t._v(" "),e("button",{staticClass:"btn btn-link text-white px-1",on:{click:t.showMenu}},[e("i",{staticClass:"fas fa-ellipsis-h fa-lg"})]),t._v(" "),e("button",{staticClass:"d-inline-block d-md-none btn btn-link text-white pl-1 pr-0",on:{click:t.backToFeed}},[e("i",{staticClass:"far fa-times-circle fa-lg"})])])])])]),t._v(" "),e("div",{staticStyle:{height:"70vh"},on:{click:t.pause}},["poll"==t.stories[t.storyIndex].type?e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[e("div",[e("p",{staticClass:"text-white pb-5 text-break font-weight-lighter",class:[t.stories[t.storyIndex].question.length<60?"h1":"h3"]},[t._v("\n\t\t\t\t\t\t\t\t\t"+t._s(t.stories[t.storyIndex].question)+"\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"text-center mt-3"},t._l(t.stories[t.storyIndex].options,(function(s,i){return e("div",{staticClass:"mb-3"},[e("button",{staticClass:"btn border px-4 py-3 text-uppercase btn-block",class:[s.length<14?"btn-lg":"",i==t.stories[t.storyIndex].voted_index?"btn-light":"btn-outline-light"],staticStyle:{"min-width":"300px"},attrs:{disabled:t.stories[t.storyIndex].voted||t.owner},on:{click:function(e){return t.selectPollOption(i)}}},[e("span",{staticClass:"text-break",class:[i==t.stories[t.storyIndex].voted_index?"option-red":""]},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+t._s(s)+"\n\t\t\t\t\t\t\t\t\t\t\t")])]),t._v(" "),t.owner&&t.pollResults.length?e("p",{staticClass:"small text-left mt-1 text-light"},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+t._s(t.pollPercent(i))+"% - "+t._s(t.pollResults[i])+" "+t._s(1==t.pollResults[i]?"vote":"votes")+"\n\t\t\t\t\t\t\t\t\t\t")]):t._e()])})),0),t._v(" "),t.owner&&!t.showingPollResults&&0==t.pollResults.length?e("div",{staticClass:"mt-3 text-center"},[e("button",{staticClass:"btn btn-light font-weight-bold",attrs:{disabled:t.loadingPollResults},on:{click:t.showPollResults}},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.loadingPollResults?"Loading...":"View Results")+"\n\t\t\t\t\t\t\t\t\t")])]):t._e()])]):t._e()])]),t._v(" "),!t.owner&&t.stories[t.storyIndex]&&t.stories[t.storyIndex].can_reply?e("div",{staticClass:"card-footer bg-transparent border-0"},[e("div",{staticClass:"px-0 bottom-overlay"},[e("div",{staticClass:"px-3 form-group d-flex"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control bg-transparent border border-white rounded-pill text-white",attrs:{placeholder:"Reply to "+t.username+"..."},domProps:{value:t.composeText},on:{input:function(e){e.target.composing||(t.composeText=e.target.value)}}}),t._v(" "),e("button",{staticClass:"btn btn-outline-light rounded-pill ml-2",on:{click:t.comment}},[t._v("\n\t\t\t\t\t\t\t\tSEND\n\t\t\t\t\t\t\t")])])])]):t._e()])],1),t._v(" "),e("div",{staticClass:"d-none d-md-block col-md-1 cursor-pointer text-center"},[t.storyIndex+1{Vue.component("story-viewer",s(72632).default)},63783:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>r});var i=s(76798),o=s.n(i)()((function(t){return t[1]}));o.push([t.id,"#content[data-v-60571088]{background-color:#262626;height:100vh!important;overflow:hidden;width:100%}.story-viewer-component-card[data-v-60571088]{height:100vh}@media (min-width:768px){.story-viewer-component-card[data-v-60571088]{height:90vh}}.story-viewer-component.bg-black[data-v-60571088]{background-color:#262626}.story-viewer-component .option-green[data-v-60571088]{-webkit-text-fill-color:transparent;background:#11998e;background:linear-gradient(180deg,#38ef7d,#11998e);-webkit-background-clip:text;font-size:20px;font-weight:600}.story-viewer-component .option-red[data-v-60571088]{-webkit-text-fill-color:transparent;background:linear-gradient(90deg,#f27121,#e94057,#8a2387);-webkit-background-clip:text;font-weight:600}.story-viewer-component .bg-black[data-v-60571088]{background-color:#262626}.story-viewer-component .fade-enter-active[data-v-60571088],.story-viewer-component .fade-leave-active[data-v-60571088]{transition:opacity .5s}.story-viewer-component .fade-enter[data-v-60571088],.story-viewer-component .fade-leave-to[data-v-60571088]{opacity:0}.story-viewer-component .progress[data-v-60571088]{background-color:#979a9a}.story-viewer-component .media-slot[data-v-60571088]{background:#000;background-size:cover!important;border-radius:0;height:100%;left:0;position:absolute;top:0;width:100%;z-index:0}.story-viewer-component .card-body .top-overlay[data-v-60571088]{background:linear-gradient(180deg,rgba(38,38,38,.8),rgba(38,38,38,0));border-radius:5px;height:100px;margin-left:-35px;margin-right:-35px;margin-top:-20px;padding-bottom:20px}.story-viewer-component .card-footer[data-v-60571088] ::-moz-placeholder{color:#fff;opacity:1}.story-viewer-component .card-footer[data-v-60571088] ::placeholder{color:#fff;opacity:1}.story-viewer-component .card-footer .bottom-overlay[data-v-60571088]{background:linear-gradient(0deg,rgba(38,38,38,.8),rgba(38,38,38,0));border-radius:5px;margin-bottom:-20px;margin-left:-35px;margin-right:-35px}.story-viewer-component .card-footer .bottom-overlay .form-group[data-v-60571088]{margin-bottom:0;padding-bottom:20px;padding-top:40px}",""]);const r=o},42600:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>a});var i=s(85072),o=s.n(i),r=s(63783),n={insert:"head",singleton:!1};o()(r.default,n);const a=r.default.locals||{}},72632:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>n});var i=s(61341),o=s(34943),r={};for(const t in o)"default"!==t&&(r[t]=()=>o[t]);s.d(e,r);s(71385);const n=(0,s(14486).default)(o.default,i.render,i.staticRenderFns,!1,null,"60571088",null).exports},34943:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>r});var i=s(52098),o={};for(const t in i)"default"!==t&&(o[t]=()=>i[t]);s.d(e,o);const r=i.default},61341:(t,e,s)=>{"use strict";s.r(e);var i=s(14614),o={};for(const t in i)"default"!==t&&(o[t]=()=>i[t]);s.d(e,o)},71385:(t,e,s)=>{"use strict";s.r(e);var i=s(42600),o={};for(const t in i)"default"!==t&&(o[t]=()=>i[t]);s.d(e,o)}},t=>{t.O(0,[3660],(()=>{return e=63353,t(t.s=e);var e}));t.O()}]);