You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/public/js/profile.js

2 lines
130 KiB
JavaScript

/*! For license information please see profile.js.LICENSE.txt */
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[2737],{40300(t,e,s){"use strict";s.r(e),s.d(e,{default:()=>i});var a=s(76777);const i={props:{feed:{type:Array,required:!0},canLoadMore:{type:Boolean,default:!1},withLinks:{type:Boolean,default:!1},withOverlay:{type:Boolean,default:!0},autoPlay:{type:Boolean,default:!1},autoPlayInterval:{type:Number,default:function(){return 5e3}}},data:function(){return{glideInstance:null}},mounted:function(){this.initGlide()},computed:{webfinger:{get:function(){if(this.feed&&this.feed.length){var t=this.feed[0].account,e=new URL(t.url).host;return"@".concat(t.username,"@").concat(e)}return""}}},methods:{initGlide:function(){this.glideInstance=new a.default(this.$refs.glide,{type:"carousel",startAt:0,perView:1,gap:0,hoverpause:!1,autoplay:!!this.autoPlay&&this.autoPlayInterval,keyboard:!0}),this.glideInstance.on("run.after",this.checkForPagination),this.glideInstance.mount()},checkForPagination:function(){this.glideInstance.index===this.feed.length-1&&this.canLoadMore&&this.$emit("load-more")},loadMore:function(){this.$emit("load-more")},formatDate:function(t){var e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:navigator.language;if("string"==typeof t){if(e=new Date(t),isNaN(e.getTime()))throw new Error("Invalid date string. Please provide a valid ISO 8601 format.")}else{if(!(t instanceof Date))throw new Error("Invalid input. Please provide a Date object or an ISO 8601 string.");e=t}return new Intl.DateTimeFormat(s,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}).format(e)},updateGlide:function(){var t=this;this.$nextTick(function(){t.glideInstance&&t.glideInstance.update()})}},watch:{feed:function(){this.updateGlide()}}}},86052(t,e,s){"use strict";s.r(e),s.d(e,{default:()=>u});var a=s(84498),i=s(342);function o(t){return function(t){if(Array.isArray(t))return n(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 n(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)?n(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 n(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,a=Array(e);s<e;s++)a[s]=t[s];return a}function r(){var t,e,s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",i=s.toStringTag||"@@toStringTag";function o(s,a,i,o){var r=a&&a.prototype instanceof c?a:c,d=Object.create(r.prototype);return l(d,"_invoke",function(s,a,i){var o,r,l,c=0,d=i||[],u=!1,f={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,s){return o=e,r=0,l=t,f.n=s,n}};function p(s,a){for(r=s,l=a,e=0;!u&&c&&!i&&e<d.length;e++){var i,o=d[e],p=f.p,h=o[2];s>3?(i=h===a)&&(l=o[(r=o[4])?5:(r=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=s<2&&p<o[1])?(r=0,f.v=a,f.n=o[1]):p<h&&(i=s<3||o[0]>a||a>h)&&(o[4]=s,o[5]=a,f.n=h,r=0))}if(i||s>1)return n;throw u=!0,a}return function(i,d,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===d&&p(d,h),r=d,l=h;(e=r<2?t:l)||!u;){o||(r?r<3?(r>1&&(f.n=-1),p(r,l)):f.n=l:f.v=l);try{if(c=2,o){if(r||(i="next"),e=o[i]){if(!(e=e.call(o,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,r<2&&(r=0)}else 1===r&&(e=o.return)&&e.call(o),r<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),r=1);o=t}else if((e=(u=f.n<0)?l:s.call(a,f))!==n)break}catch(e){o=t,r=1,l=e}finally{c=1}}return{value:e,done:u}}}(s,i,o),!0),d}var n={};function c(){}function d(){}function u(){}e=Object.getPrototypeOf;var f=[][a]?e(e([][a]())):(l(e={},a,function(){return this}),e),p=u.prototype=c.prototype=Object.create(f);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,l(t,i,"GeneratorFunction")),t.prototype=Object.create(p),t}return d.prototype=u,l(p,"constru