diff --git a/CHANGELOG.md b/CHANGELOG.md index 933bd71dc..aebbd60a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ - Updated RateLimit, add max post edits per hour and day ([51fbfcdc](https://github.com/pixelfed/pixelfed/commit/51fbfcdc)) - Updated Timeline.vue, move announcements from sidebar to top of timeline ([228f5044](https://github.com/pixelfed/pixelfed/commit/228f5044)) - Updated lexer autolinker and extractor, add support for mentioned usernames containing dashes, periods and underscore characters ([f911c96d](https://github.com/pixelfed/pixelfed/commit/f911c96d)) +- Updated Story apis, move FE to v0 and add v1 for oauth clients ([92654fab](https://github.com/pixelfed/pixelfed/commit/92654fab)) +- Updated robots.txt ([25101901](https://github.com/pixelfed/pixelfed/commit/25101901)) ## [v0.10.8 (2020-01-29)](https://github.com/pixelfed/pixelfed/compare/v0.10.7...v0.10.8) ### Added diff --git a/app/Console/Commands/StoryGC.php b/app/Console/Commands/StoryGC.php index f6271bb15..82eda89f9 100644 --- a/app/Console/Commands/StoryGC.php +++ b/app/Console/Commands/StoryGC.php @@ -44,6 +44,47 @@ class StoryGC extends Command * @return mixed */ public function handle() + { + $this->directoryScan(); + $this->deleteViews(); + $this->deleteStories(); + } + + protected function directoryScan() + { + $day = now()->day; + + if($day !== 3) { + return; + } + + $monthHash = substr(hash('sha1', date('Y').date('m')), 0, 12); + + $t1 = Storage::directories('public/_esm.t1'); + $t2 = Storage::directories('public/_esm.t2'); + + $dirs = array_merge($t1, $t2); + + foreach($dirs as $dir) { + $hash = last(explode('/', $dir)); + if($hash != $monthHash) { + $this->info('Found directory to delete: ' . $dir); + $this->deleteDirectory($dir); + } + } + } + + protected function deleteDirectory($path) + { + Storage::deleteDirectory($path); + } + + protected function deleteViews() + { + StoryView::where('created_at', '<', now()->subDays(2))->delete(); + } + + protected function deleteStories() { $stories = Story::where('expires_at', '<', now())->take(50)->get(); diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 442ce41ba..f414dcf91 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -44,7 +44,10 @@ use App\Jobs\VideoPipeline\{ VideoPostProcess, VideoThumbnail }; -use App\Services\NotificationService; +use App\Services\{ + NotificationService, + SearchApiV2Service +}; class ApiV1Controller extends Controller { @@ -367,15 +370,15 @@ class ApiV1Controller extends Controller $user = $request->user(); - $target = Profile::where('id', '!=', $user->id) + $target = Profile::where('id', '!=', $user->profile_id) ->whereNull('status') - ->findOrFail($item); + ->findOrFail($id); $private = (bool) $target->is_private; $remote = (bool) $target->domain; $blocked = UserFilter::whereUserId($target->id) ->whereFilterType('block') - ->whereFilterableId($user->id) + ->whereFilterableId($user->profile_id) ->whereFilterableType('App\Profile') ->exists(); @@ -383,7 +386,7 @@ class ApiV1Controller extends Controller abort(400, 'You cannot follow this user.'); } - $isFollowing = Follower::whereProfileId($user->id) + $isFollowing = Follower::whereProfileId($user->profile_id) ->whereFollowingId($target->id) ->exists(); @@ -396,42 +399,42 @@ class ApiV1Controller extends Controller } // Rate limits, max 7500 followers per account - if($user->following()->count() >= Follower::MAX_FOLLOWING) { + if($user->profile->following()->count() >= Follower::MAX_FOLLOWING) { abort(400, 'You cannot follow more than ' . Follower::MAX_FOLLOWING . ' accounts'); } // Rate limits, follow 30 accounts per hour max - if($user->following()->where('followers.created_at', '>', now()->subHour())->count() >= Follower::FOLLOW_PER_HOUR) { + if($user->profile->following()->where('followers.created_at', '>', now()->subHour())->count() >= Follower::FOLLOW_PER_HOUR) { abort(400, 'You can only follow ' . Follower::FOLLOW_PER_HOUR . ' users per hour'); } if($private == true) { $follow = FollowRequest::firstOrCreate([ - 'follower_id' => $user->id, + 'follower_id' => $user->profile_id, 'following_id' => $target->id ]); if($remote == true && config('federation.activitypub.remoteFollow') == true) { - (new FollowerController())->sendFollow($user, $target); + (new FollowerController())->sendFollow($user->profile, $target); } } else { $follower = new Follower(); - $follower->profile_id = $user->id; + $follower->profile_id = $user->profile_id; $follower->following_id = $target->id; $follower->save(); if($remote == true && config('federation.activitypub.remoteFollow') == true) { - (new FollowerController())->sendFollow($user, $target); + (new FollowerController())->sendFollow($user->profile, $target); } FollowPipeline::dispatch($follower); } Cache::forget('profile:following:'.$target->id); Cache::forget('profile:followers:'.$target->id); - Cache::forget('profile:following:'.$user->id); - Cache::forget('profile:followers:'.$user->id); - Cache::forget('api:local:exp:rec:'.$user->id); + Cache::forget('profile:following:'.$user->profile_id); + Cache::forget('profile:followers:'.$user->profile_id); + Cache::forget('api:local:exp:rec:'.$user->profile_id); Cache::forget('user:account:id:'.$target->user_id); - Cache::forget('user:account:id:'.$user->user_id); + Cache::forget('user:account:id:'.$user->id); $resource = new Fractal\Resource\Item($target, new RelationshipTransformer()); $res = $this->fractal->createData($resource)->toArray(); @@ -452,14 +455,14 @@ class ApiV1Controller extends Controller $user = $request->user(); - $target = Profile::where('id', '!=', $user->id) + $target = Profile::where('id', '!=', $user->profile_id) ->whereNull('status') - ->findOrFail($item); + ->findOrFail($id); $private = (bool) $target->is_private; $remote = (bool) $target->domain; - $isFollowing = Follower::whereProfileId($user->id) + $isFollowing = Follower::whereProfileId($user->profile_id) ->whereFollowingId($target->id) ->exists(); @@ -471,29 +474,29 @@ class ApiV1Controller extends Controller } // Rate limits, follow 30 accounts per hour max - if($user->following()->where('followers.updated_at', '>', now()->subHour())->count() >= Follower::FOLLOW_PER_HOUR) { + if($user->profile->following()->where('followers.updated_at', '>', now()->subHour())->count() >= Follower::FOLLOW_PER_HOUR) { abort(400, 'You can only follow or unfollow ' . Follower::FOLLOW_PER_HOUR . ' users per hour'); } - FollowRequest::whereFollowerId($user->id) + FollowRequest::whereFollowerId($user->profile_id) ->whereFollowingId($target->id) ->delete(); - Follower::whereProfileId($user->id) + Follower::whereProfileId($user->profile_id) ->whereFollowingId($target->id) ->delete(); if($remote == true && config('federation.activitypub.remoteFollow') == true) { - (new FollowerController())->sendUndoFollow($user, $target); + (new FollowerController())->sendUndoFollow($user->profile, $target); } Cache::forget('profile:following:'.$target->id); Cache::forget('profile:followers:'.$target->id); - Cache::forget('profile:following:'.$user->id); - Cache::forget('profile:followers:'.$user->id); - Cache::forget('api:local:exp:rec:'.$user->id); + Cache::forget('profile:following:'.$user->profile_id); + Cache::forget('profile:followers:'.$user->profile_id); + Cache::forget('api:local:exp:rec:'.$user->profile_id); Cache::forget('user:account:id:'.$target->user_id); - Cache::forget('user:account:id:'.$user->user_id); + Cache::forget('user:account:id:'.$user->id); $resource = new Fractal\Resource\Item($target, new RelationshipTransformer()); $res = $this->fractal->createData($resource)->toArray(); @@ -1164,34 +1167,43 @@ class ApiV1Controller extends Controller public function accountNotifications(Request $request) { abort_if(!$request->user(), 403); + $this->validate($request, [ - 'page' => 'nullable|integer|min:1|max:10', 'limit' => 'nullable|integer|min:1|max:80', - 'max_id' => 'nullable|integer|min:1', - 'min_id' => 'nullable|integer|min:0', + 'min_id' => 'nullable|integer|min:1|max:'.PHP_INT_MAX, + 'max_id' => 'nullable|integer|min:1|max:'.PHP_INT_MAX, + 'since_id' => 'nullable|integer|min:1|max:'.PHP_INT_MAX, ]); + $pid = $request->user()->profile_id; - $limit = $request->input('limit') ?? 20; + $limit = $request->input('limit', 20); $timeago = now()->subMonths(6); + + $since = $request->input('since_id'); $min = $request->input('min_id'); $max = $request->input('max_id'); - if($min || $max) { - $dir = $min ? '>' : '<'; - $id = $min ?? $max; - $notifications = Notification::whereProfileId($pid) - ->whereDate('created_at', '>', $timeago) - ->where('id', $dir, $id) - ->orderByDesc('created_at') - ->limit($limit) - ->get(); - } else { - $notifications = Notification::whereProfileId($pid) - ->whereDate('created_at', '>', $timeago) - ->orderByDesc('created_at') - ->simplePaginate($limit); - } - $resource = new Fractal\Resource\Collection($notifications, new NotificationTransformer()); - $res = $this->fractal->createData($resource)->toArray(); + + abort_if(!$since && !$min && !$max, 400); + + $dir = $since ? '>' : ($min ? '>=' : '<'); + $id = $since ?? $min ?? $max; + + $notifications = Notification::whereProfileId($pid) + ->where('id', $dir, $id) + ->whereDate('created_at', '>', $timeago) + ->orderByDesc('id') + ->limit($limit) + ->get(); + + $resource = new Fractal\Resource\Collection( + $notifications, + new NotificationTransformer() + ); + + $res = $this->fractal + ->createData($resource) + ->toArray(); + return response()->json($res); } @@ -1696,4 +1708,30 @@ class ApiV1Controller extends Controller $res = []; return response()->json($res); } + + /** + * GET /api/v2/search + * + * + * @return array + */ + public function searchV2(Request $request) + { + abort_if(!$request->user(), 403); + + $this->validate($request, [ + 'q' => 'required|string|min:1|max:80', + 'account_id' => 'nullable|string', + 'max_id' => 'nullable|string', + 'min_id' => 'nullable|string', + 'type' => 'nullable|in:accounts,hashtags,statuses', + 'exclude_unreviewed' => 'nullable', + 'resolve' => 'nullable', + 'limit' => 'nullable|integer|max:40', + 'offset' => 'nullable|integer', + 'following' => 'nullable' + ]); + + return SearchApiV2Service::query($request); + } } \ No newline at end of file diff --git a/app/Http/Controllers/StoryController.php b/app/Http/Controllers/StoryController.php index caec942d0..a7cfb9717 100644 --- a/app/Http/Controllers/StoryController.php +++ b/app/Http/Controllers/StoryController.php @@ -16,12 +16,6 @@ use App\Services\FollowerService; class StoryController extends Controller { - - public function construct() - { - $this->middleware('auth'); - } - public function apiV1Add(Request $request) { abort_if(!config('instance.stories.enabled') || !$request->user(), 404); @@ -66,8 +60,8 @@ class StoryController extends Controller protected function storePhoto($photo) { $monthHash = substr(hash('sha1', date('Y').date('m')), 0, 12); - $sid = Str::uuid(); - $rid = Str::random(6).'.'.Str::random(9); + $sid = (string) Str::uuid(); + $rid = Str::random(9).'.'.Str::random(9); $mimes = explode(',', config('pixelfed.media_types')); if(in_array($photo->getMimeType(), [ 'image/jpeg', @@ -77,7 +71,7 @@ class StoryController extends Controller return; } - $storagePath = "public/_esm.t1/{$monthHash}/{$sid}/{$rid}"; + $storagePath = "public/_esm.t2/{$monthHash}/{$sid}/{$rid}"; $path = $photo->store($storagePath); $fpath = storage_path('app/' . $path); $img = Intervention::make($fpath); @@ -175,6 +169,39 @@ class StoryController extends Controller return response()->json($stories, 200, [], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); } + public function apiV1Item(Request $request, $id) + { + abort_if(!config('instance.stories.enabled') || !$request->user(), 404); + + $authed = $request->user()->profile; + $story = Story::with('profile') + ->where('expires_at', '>', now()) + ->findOrFail($id); + + $profile = $story->profile; + if($story->profile_id == $authed->id) { + $publicOnly = true; + } else { + $publicOnly = (bool) $profile->followedBy($authed); + } + + abort_if(!$publicOnly, 403); + + $res = [ + 'id' => (string) $story->id, + 'type' => 'photo', + 'length' => 3, + 'src' => url(Storage::url($story->path)), + 'preview' => null, + 'link' => null, + 'linkText' => null, + 'time' => $story->created_at->format('U'), + 'expires_at' => (int) $story->expires_at->format('U'), + 'seen' => $story->seen() + ]; + return response()->json($res, 200, [], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); + } + public function apiV1Profile(Request $request, $id) { abort_if(!config('instance.stories.enabled') || !$request->user(), 404); @@ -232,24 +259,33 @@ class StoryController extends Controller $this->validate($request, [ 'id' => 'required|integer|min:1|exists:stories', ]); + $id = $request->input('id'); + $authed = $request->user()->profile; + $story = Story::with('profile') + ->where('expires_at', '>', now()) + ->orderByDesc('expires_at') + ->findOrFail($id); + + $profile = $story->profile; + if($story->profile_id == $authed->id) { + $publicOnly = true; + } else { + $publicOnly = (bool) $profile->followedBy($authed); + } + + abort_if(!$publicOnly, 403); StoryView::firstOrCreate([ - 'story_id' => $request->input('id'), - 'profile_id' => $request->user()->profile_id + 'story_id' => $id, + 'profile_id' => $authed->id ]); return ['code' => 200]; } - public function compose(Request $request) - { - abort_if(!config('instance.stories.enabled') || !$request->user(), 404); - return view('stories.compose'); - } - public function apiV1Exists(Request $request, $id) { - abort_if(!config('instance.stories.enabled'), 404); + abort_if(!config('instance.stories.enabled') || !$request->user(), 404); $res = (bool) Story::whereProfileId($id) ->where('expires_at', '>', now()) @@ -258,8 +294,54 @@ class StoryController extends Controller return response()->json($res); } + public function apiV1Me(Request $request) + { + abort_if(!config('instance.stories.enabled') || !$request->user(), 404); + + $profile = $request->user()->profile; + $stories = Story::whereProfileId($profile->id) + ->orderBy('expires_at') + ->where('expires_at', '>', now()) + ->get() + ->map(function($s, $k) { + return [ + 'id' => $s->id, + 'type' => 'photo', + 'length' => 3, + 'src' => url(Storage::url($s->path)), + 'preview' => null, + 'link' => null, + 'linkText' => null, + 'time' => $s->created_at->format('U'), + 'expires_at' => (int) $s->expires_at->format('U'), + 'seen' => true + ]; + })->toArray(); + $ts = count($stories) ? last($stories)['time'] : null; + $res = [ + 'id' => (string) $profile->id, + 'photo' => $profile->avatarUrl(), + 'name' => $profile->username, + 'link' => $profile->url(), + 'lastUpdated' => $ts, + 'seen' => true, + 'items' => $stories + ]; + + return response()->json($res, 200, [], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); + } + + public function compose(Request $request) + { + abort_if(!config('instance.stories.enabled') || !$request->user(), 404); + + return view('stories.compose'); + } + public function iRedirect(Request $request) { + abort_if(!config('instance.stories.enabled') || !$request->user(), 404); + $user = $request->user(); abort_if(!$user, 404); $username = $user->username; diff --git a/app/Services/SearchApiV2Service.php b/app/Services/SearchApiV2Service.php new file mode 100644 index 000000000..940812d7f --- /dev/null +++ b/app/Services/SearchApiV2Service.php @@ -0,0 +1,234 @@ +run($query); + } + + protected function run($query) + { + $this->query = $query; + + if($query->has('resolve') && + $query->resolve == true && + Helpers::validateUrl(urldecode($query->input('q'))) + ) { + return $this->resolve(); + } + + if($query->has('type')) { + switch ($query->input('type')) { + case 'accounts': + return [ + 'accounts' => $this->accounts(), + 'hashtags' => [], + 'statuses' => [] + ]; + break; + case 'hashtags': + return [ + 'accounts' => [], + 'hashtags' => $this->hashtags(), + 'statuses' => [] + ]; + break; + case 'statuses': + return [ + 'accounts' => [], + 'hashtags' => [], + 'statuses' => $this->statuses() + ]; + break; + } + } + + if($query->has('account_id')) { + return [ + 'accounts' => [], + 'hashtags' => [], + 'statuses' => $this->statusesById() + ]; + } + + return [ + 'accounts' => $this->accounts(), + 'hashtags' => $this->hashtags(), + 'statuses' => $this->statuses() + ]; + } + + protected function resolve() + { + $query = urldecode($this->query->input('q')); + if(Str::startsWith($query, '@') == true) { + return WebfingerService::lookup($this->query->input('q')); + } else if (Str::startsWith($query, 'https://') == true) { + return $this->resolveQuery(); + } + } + + protected function accounts() + { + $limit = $this->query->input('limit', 20); + $query = '%' . $this->query->input('q') . '%'; + $results = Profile::whereNull('status') + ->where('username', 'like', $query) + ->when($this->query->input('offset') != null, function($q, $offset) { + return $q->offset($offset); + }) + ->limit($limit) + ->get(); + + $fractal = new Fractal\Manager(); + $fractal->setSerializer(new ArraySerializer()); + $resource = new Fractal\Resource\Collection($results, new AccountTransformer()); + return $fractal->createData($resource)->toArray(); + } + + protected function hashtags() + { + $limit = $this->query->input('limit', 20); + $query = '%' . $this->query->input('q') . '%'; + return Hashtag::whereIsBanned(false) + ->where('name', 'like', $query) + ->when($this->query->input('offset') != null, function($q, $offset) { + return $q->offset($offset); + }) + ->limit($limit) + ->get() + ->map(function($tag) { + return [ + 'name' => $tag->name, + 'url' => $tag->url(), + 'history' => [] + ]; + }); + } + + protected function statuses() + { + $limit = $this->query->input('limit', 20); + $query = '%' . $this->query->input('q') . '%'; + $results = Status::where('caption', 'like', $query) + ->whereScope('public') + ->when($this->query->input('offset') != null, function($q, $offset) { + return $q->offset($offset); + }) + ->limit($limit) + ->orderByDesc('created_at') + ->get(); + + $fractal = new Fractal\Manager(); + $fractal->setSerializer(new ArraySerializer()); + $resource = new Fractal\Resource\Collection($results, new StatusTransformer()); + return $fractal->createData($resource)->toArray(); + } + + protected function statusesById() + { + $accountId = $this->query->input('account_id'); + $limit = $this->query->input('limit', 20); + $query = '%' . $this->query->input('q') . '%'; + $results = Status::where('caption', 'like', $query) + ->whereProfileId($accountId) + ->when($this->query->input('offset') != null, function($q, $offset) { + return $q->offset($offset); + }) + ->limit($limit) + ->get(); + + $fractal = new Fractal\Manager(); + $fractal->setSerializer(new ArraySerializer()); + $resource = new Fractal\Resource\Collection($results, new StatusTransformer()); + return $fractal->createData($resource)->toArray(); + } + + protected function resolveQuery() + { + $query = urldecode($this->query->input('q')); + if(Helpers::validateLocalUrl($query)) { + if(Str::contains($query, '/p/')) { + return $this->resolveLocalStatus(); + } else { + return $this->resolveLocalProfile(); + } + } else { + return [ + 'accounts' => [], + 'hashtags' => [], + 'statuses' => [] + ]; + } + } + + protected function resolveLocalStatus() + { + $query = urldecode($this->query->input('q')); + $query = last(explode('/', $query)); + $status = Status::whereNull('uri') + ->whereScope('public') + ->find($query); + + if(!$status) { + return [ + 'accounts' => [], + 'hashtags' => [], + 'statuses' => [] + ]; + } + + $fractal = new Fractal\Manager(); + $fractal->setSerializer(new ArraySerializer()); + $resource = new Fractal\Resource\Item($status, new StatusTransformer()); + return [ + 'accounts' => [], + 'hashtags' => [], + 'statuses' => $fractal->createData($resource)->toArray() + ]; + } + + protected function resolveLocalProfile() + { + $query = urldecode($this->query->input('q')); + $query = last(explode('/', $query)); + $profile = Profile::whereNull('status') + ->whereNull('domain') + ->whereUsername($query) + ->first(); + + if(!$profile) { + return [ + 'accounts' => [], + 'hashtags' => [], + 'statuses' => [] + ]; + } + + $fractal = new Fractal\Manager(); + $fractal->setSerializer(new ArraySerializer()); + $resource = new Fractal\Resource\Item($profile, new AccountTransformer()); + return [ + 'accounts' => $fractal->createData($resource)->toArray(), + 'hashtags' => [], + 'statuses' => [] + ]; + } + +} \ No newline at end of file diff --git a/app/Services/WebfingerService.php b/app/Services/WebfingerService.php new file mode 100644 index 000000000..a50eee19f --- /dev/null +++ b/app/Services/WebfingerService.php @@ -0,0 +1,40 @@ +run($query); + } + + protected function run($query) + { + $url = WebfingerUrl::generateWebfingerUrl($query); + if(!Helpers::validateUrl($url)) { + return []; + } + $res = Zttp::get($url); + $webfinger = $res->json(); + if(!isset($webfinger['links'])) { + return []; + } + $profile = Helpers::profileFetch($webfinger['links'][0]['href']); + $fractal = new Fractal\Manager(); + $fractal->setSerializer(new ArraySerializer()); + $resource = new Fractal\Resource\Item($profile, new AccountTransformer()); + $res = $fractal->createData($resource)->toArray(); + return $res; + } +} \ No newline at end of file diff --git a/public/js/profile.js b/public/js/profile.js index 703644c34..22f98012f 100644 --- a/public/js/profile.js +++ b/public/js/profile.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{"+27z":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.text-lighter[data-v-acffc3f6] {\n\tcolor:#B8C2CC !important;\n}\n.modal-body[data-v-acffc3f6] {\n\tpadding: 0;\n}\n",""])},"03GQ":function(t,e,n){var i=n("luQh");"string"==typeof i&&(i=[[t.i,i,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,s);i.locals&&(t.exports=i.locals)},"2Jpm":function(t,e,n){"use strict";n.r(e);var i={props:["status"],methods:{playOrPause:function(t){var e=t.target;1==e.getAttribute("playing")?(e.removeAttribute("playing"),e.pause()):(e.setAttribute("playing",1),e.play())}}},s=n("KHd+"),o=Object(s.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 1==t.status.sensitive?n("div",[n("details",{staticClass:"details-animated"},[n("summary",[n("p",{staticClass:"mb-0 lead font-weight-bold"},[t._v(t._s(t.status.spoiler_text?t.status.spoiler_text:"CW / NSFW / Hidden Media"))]),t._v(" "),n("p",{staticClass:"font-weight-light"},[t._v("(click to show)")])]),t._v(" "),n("div",{staticClass:"embed-responsive embed-responsive-1by1"},[n("video",{staticClass:"video",attrs:{preload:"none",loop:"",poster:t.status.media_attachments[0].preview_url,"data-id":t.status.id},on:{click:function(e){return t.playOrPause(e)}}},[n("source",{attrs:{src:t.status.media_attachments[0].url,type:t.status.media_attachments[0].mime}})])])])]):n("div",{staticClass:"embed-responsive embed-responsive-16by9"},[n("video",{staticClass:"video",attrs:{controls:"",preload:"metadata",loop:"",poster:t.status.media_attachments[0].preview_url,"data-id":t.status.id}},[n("source",{attrs:{src:t.status.media_attachments[0].url,type:t.status.media_attachments[0].mime}})])])}),[],!1,null,null,null);e.default=o.exports},"2wtg":function(t,e,n){Vue.component("photo-presenter",n("d+I4").default),Vue.component("video-presenter",n("2Jpm").default),Vue.component("photo-album-presenter",n("Mrqh").default),Vue.component("video-album-presenter",n("9wGH").default),Vue.component("mixed-album-presenter",n("exej").default),Vue.component("post-menu",n("yric").default),Vue.component("story-viewer",n("Zhjo").default),Vue.component("profile",n("EHjT").default)},4:function(t,e,n){t.exports=n("2wtg")},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var s,o=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(s=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(s)+")")}))}},"9wGH":function(t,e,n){"use strict";n.r(e);var i={props:["status"]},s=n("KHd+"),o=Object(s.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 1==t.status.sensitive?n("div",[n("details",{staticClass:"details-animated"},[n("summary",[n("p",{staticClass:"mb-0 lead font-weight-bold"},[t._v(t._s(t.status.spoiler_text?t.status.spoiler_text:"CW / NSFW / Hidden Media"))]),t._v(" "),n("p",{staticClass:"font-weight-light"},[t._v("(click to show)")])]),t._v(" "),n("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333","background-color":"#000"},attrs:{id:t.status.id+"-carousel",controls:"","img-blank":"",background:"#ffffff",interval:0}},t._l(t.status.media_attachments,(function(t,e){return n("b-carousel-slide",{key:t.id+"-media"},[n("video",{staticClass:"embed-responsive-item",attrs:{slot:"img",preload:"none",controls:"",loop:"",alt:t.description,width:"100%",height:"100%",poster:t.preview_url},slot:"img"},[n("source",{attrs:{src:t.url,type:t.mime}})])])})),1)],1)]):n("div",[n("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333","background-color":"#000"},attrs:{id:t.status.id+"-carousel",controls:"","img-blank":"",background:"#ffffff",interval:0}},t._l(t.status.media_attachments,(function(t,e){return n("b-carousel-slide",{key:t.id+"-media"},[n("video",{staticClass:"embed-responsive-item",attrs:{slot:"img",preload:"none",controls:"",loop:"",alt:t.description,width:"100%",height:"100%",poster:t.preview_url},slot:"img"},[n("source",{attrs:{src:t.url,type:t.mime}})])])})),1)],1)}),[],!1,null,null,null);e.default=o.exports},B0a3:function(t,e,n){var i=n("QbiE");"string"==typeof i&&(i=[[t.i,i,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,s);i.locals&&(t.exports=i.locals)},EHjT:function(t,e,n){"use strict";n.r(e);var i=n("la7V");function s(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0})),i=n.map((function(t){return t.id}));t.ids=i,t.min_id=Math.max.apply(Math,s(i)),t.max_id=Math.min.apply(Math,s(i)),t.modalStatus=_.first(e.data),t.timeline=n,t.ownerCheck(),t.loading=!1})).catch((function(t){swal("Oops, something went wrong","Please release the page.","error")}))},ownerCheck:function(){0!=$("body").hasClass("loggedIn")?this.owner=this.profile.id===this.user.id:this.owner=!1},infiniteTimeline:function(t){var e=this;if(this.loading||this.timeline.length<9)t.complete();else{var n="/api/pixelfed/v1/accounts/"+this.profileId+"/statuses";axios.get(n,{params:{only_media:!0,max_id:this.max_id}}).then((function(n){if(n.data.length&&0==e.loading){var i=n.data,o=e;i.forEach((function(t){-1==o.ids.indexOf(t.id)&&(o.timeline.push(t),o.ids.push(t.id))})),e.min_id=Math.max.apply(Math,s(e.ids)),e.max_id=Math.min.apply(Math,s(e.ids)),t.loaded(),e.loading=!1}else t.complete()}))}},previewUrl:function(t){return t.sensitive?"/storage/no-preview.png?v="+(new Date).getTime():t.media_attachments[0].preview_url},previewBackground:function(t){return"background-image: url("+this.previewUrl(t)+");"},switchMode:function(t){var e=this;this.mode=_.indexOf(this.modes,t)?t:"grid","bookmarks"==this.mode&&0==this.bookmarks.length&&axios.get("/api/local/bookmarks").then((function(t){e.bookmarks=t.data})),"collections"==this.mode&&0==this.collections.length&&axios.get("/api/local/profile/collections/"+this.profileId).then((function(t){e.collections=t.data}))},reportProfile:function(){var t=this.profile.id;window.location.href="/i/report?type=user&id="+t},reportUrl:function(t){return"/i/report?type="+(t.in_reply_to?"comment":"post")+"&id="+t.id},commentFocus:function(t,e){var n=event.target.parentElement.parentElement.parentElement,i=n.getElementsByClassName("comments")[0];0==i.children.length&&(i.classList.add("mb-2"),this.fetchStatusComments(t,n));var s=n.querySelectorAll(".card-footer")[0],o=n.querySelectorAll(".status-reply-input")[0];1==s.classList.contains("d-none")?(s.classList.remove("d-none"),o.focus()):(s.classList.add("d-none"),o.blur())},likeStatus:function(t,e){0!=$("body").hasClass("loggedIn")&&axios.post("/i/like",{item:t.id}).then((function(e){t.favourites_count=e.data.count,1==t.favourited?t.favourited=!1:t.favourited=!0})).catch((function(t){swal("Error","Something went wrong, please try again later.","error")}))},shareStatus:function(t,e){0!=$("body").hasClass("loggedIn")&&axios.post("/i/share",{item:t.id}).then((function(e){t.reblogs_count=e.data.count,1==t.reblogged?t.reblogged=!1:t.reblogged=!0})).catch((function(t){swal("Error","Something went wrong, please try again later.","error")}))},timestampFormat:function(t){var e=new Date(t);return e.toDateString()+" "+e.toLocaleTimeString()},editUrl:function(t){return t.url+"/edit"},redirect:function(t){window.location.href=t},replyUrl:function(t){return"/p/"+this.profile.username+"/"+(t.account.id==this.profile.id?t.id:t.in_reply_to_id)},mentionUrl:function(t){return"/p/"+t.account.username+"/"+t.id},statusOwner:function(t){return t.account.id==this.profile.id},fetchRelationships:function(){var t=this;0!=document.querySelectorAll("body")[0].classList.contains("loggedIn")&&axios.get("/api/pixelfed/v1/accounts/relationships",{params:{"id[]":this.profileId}}).then((function(e){e.data.length&&(t.relationship=e.data[0],1==e.data[0].blocking&&(t.warning=!0))}))},muteProfile:function(){var t=this;arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0!=$("body").hasClass("loggedIn")){var e=this.profileId;axios.post("/i/mute",{type:"user",item:e}).then((function(e){t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully muted "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))}},unmuteProfile:function(){var t=this;arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0!=$("body").hasClass("loggedIn")){var e=this.profileId;axios.post("/i/unmute",{type:"user",item:e}).then((function(e){t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully unmuted "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))}},blockProfile:function(){var t=this;arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0!=$("body").hasClass("loggedIn")){var e=this.profileId;axios.post("/i/block",{type:"user",item:e}).then((function(e){t.warning=!0,t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully blocked "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))}},unblockProfile:function(){var t=this;arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0!=$("body").hasClass("loggedIn")){var e=this.profileId;axios.post("/i/unblock",{type:"user",item:e}).then((function(e){t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully unblocked "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))}},deletePost:function(t,e){var n=this;0!=$("body").hasClass("loggedIn")&&t.account.id===this.profile.id&&axios.post("/i/delete",{type:"status",item:t.id}).then((function(t){n.timeline.splice(e,1),swal("Success","You have successfully deleted this post","success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))},followProfile:function(){var t=this;0!=$("body").hasClass("loggedIn")&&axios.post("/i/follow",{item:this.profileId}).then((function(e){t.$refs.visitorContextMenu.hide(),t.relationship.following?(t.profile.followers_count--,1==t.profile.locked&&(window.location.href="/")):t.profile.followers_count++,t.relationship.following=!t.relationship.following})).catch((function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")}))},followingModal:function(){var t=this;if(0!=$("body").hasClass("loggedIn")){if(0!=this.profileSettings.following.list)return this.followingCursor>1?void this.$refs.followingModal.show():(axios.get("/api/pixelfed/v1/accounts/"+this.profileId+"/following",{params:{page:this.followingCursor}}).then((function(e){t.following=e.data,t.followingCursor++,e.data.length<10&&(t.followingMore=!1)})),void this.$refs.followingModal.show())}else window.location.href=encodeURI("/login?next=/"+this.profileUsername+"/")},followersModal:function(){var t=this;if(0!=$("body").hasClass("loggedIn")){if(0!=this.profileSettings.followers.list)return this.followerCursor>1?void this.$refs.followerModal.show():(axios.get("/api/pixelfed/v1/accounts/"+this.profileId+"/followers",{params:{page:this.followerCursor}}).then((function(e){var n;(n=t.followers).push.apply(n,s(e.data)),t.followerCursor++,e.data.length<10&&(t.followerMore=!1)})),void this.$refs.followerModal.show())}else window.location.href=encodeURI("/login?next=/"+this.profileUsername+"/")},followingLoadMore:function(){var t=this;0!=$("body").hasClass("loggedIn")?axios.get("/api/pixelfed/v1/accounts/"+this.profile.id+"/following",{params:{page:this.followingCursor}}).then((function(e){var n;e.data.length>0&&((n=t.following).push.apply(n,s(e.data)),t.followingCursor++);e.data.length<10&&(t.followingMore=!1)})):window.location.href=encodeURI("/login?next=/"+this.profile.username+"/")},followersLoadMore:function(){var t=this;0!=$("body").hasClass("loggedIn")&&axios.get("/api/pixelfed/v1/accounts/"+this.profile.id+"/followers",{params:{page:this.followerCursor}}).then((function(e){var n;e.data.length>0&&((n=t.followers).push.apply(n,s(e.data)),t.followerCursor++);e.data.length<10&&(t.followerMore=!1)}))},visitorMenu:function(){this.$refs.visitorContextMenu.show()},followModalAction:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"following";axios.post("/i/follow",{item:t}).then((function(t){"following"==i&&(n.following.splice(e,1),n.profile.following_count--)})).catch((function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")}))},momentBackground:function(){var t="w-100 h-100 mt-n3 ";return this.profile.header_bg?t+="default"==this.profile.header_bg?"bg-pixelfed":"bg-moment-"+this.profile.header_bg:t+="bg-pixelfed",t},loadSponsor:function(){var t=this;axios.get("/api/local/profile/sponsor/"+this.profileId).then((function(e){t.sponsorList=e.data}))},showSponsorModal:function(){this.$refs.sponsorModal.show()},goBack:function(){return window.history.length>2?void window.history.back():void(window.location.href="/")},copyProfileLink:function(){navigator.clipboard.writeText(window.location.href),this.$refs.visitorContextMenu.hide()},formatCount:function(t){return App.util.format.count(t)},statusUrl:function(t){return t.url},profileUrl:function(t){return t.url},showEmbedProfileModal:function(){this.ctxEmbedPayload=window.App.util.embed.profile(this.profile.url),this.$refs.embedModal.show()},ctxCopyEmbed:function(){navigator.clipboard.writeText(this.ctxEmbedPayload),this.$refs.embedModal.hide(),this.$refs.visitorContextMenu.hide()},storyRedirect:function(){window.location.href="/stories/"+this.profileUsername}}},a=(n("HFTX"),n("KHd+")),r=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"w-100 h-100"},[t.isMobile?n("div",{staticClass:"bg-white p-3 border-bottom"},[n("div",{staticClass:"d-flex justify-content-between align-items-center"},[n("div",{staticClass:"cursor-pointer",on:{click:t.goBack}},[n("i",{staticClass:"fas fa-chevron-left fa-lg"})]),t._v(" "),n("div",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t"+t._s(this.profileUsername)+"\t\t\t\t\t\t\t\t\n\n\t\t\t")]),t._v(" "),n("div",[n("a",{staticClass:"fas fa-ellipsis-v fa-lg text-muted text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.visitorMenu(e)}}})])])]):t._e(),t._v(" "),t.relationship&&t.relationship.blocking&&t.warning?n("div",{staticClass:"bg-white pt-3 border-bottom"},[n("div",{staticClass:"container"},[n("p",{staticClass:"text-center font-weight-bold"},[t._v("You are blocking this account")]),t._v(" "),n("p",{staticClass:"text-center font-weight-bold"},[t._v("Click "),n("a",{staticClass:"cursor-pointer",attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.warning=!1}}},[t._v("here")]),t._v(" to view profile")])])]):t._e(),t._v(" "),t.loading?n("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"80vh"}},[n("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})]):t._e(),t._v(" "),t.loading||t.warning?t._e():n("div",["metro"==t.layout?n("div",{staticClass:"container"},[n("div",{class:t.isMobile?"pt-5":"pt-5 border-bottom"},[n("div",{staticClass:"container px-0"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-4 d-md-flex"},[n("div",{staticClass:"profile-avatar mx-md-auto"},[n("div",{staticClass:"d-block d-md-none mt-n3 mb-3"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-4"},[t.hasStory?n("div",{staticClass:"has-story cursor-pointer shadow-sm",on:{click:function(e){return t.storyRedirect()}}},[n("img",{staticClass:"rounded-circle",attrs:{alt:t.profileUsername+"'s profile picture",src:t.profile.avatar,width:"77px",height:"77px"}})]):n("div",[n("img",{staticClass:"rounded-circle border",attrs:{alt:t.profileUsername+"'s profile picture",src:t.profile.avatar,width:"77px",height:"77px"}})])]),t._v(" "),n("div",{staticClass:"col-8"},[n("div",{staticClass:"d-block d-md-none mt-3 py-2"},[n("ul",{staticClass:"nav d-flex justify-content-between"},[n("li",{staticClass:"nav-item"},[n("div",{staticClass:"font-weight-light"},[n("span",{staticClass:"text-dark text-center"},[n("p",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.formatCount(t.profile.statuses_count)))]),t._v(" "),n("p",{staticClass:"text-muted mb-0 small"},[t._v("Posts")])])])]),t._v(" "),n("li",{staticClass:"nav-item"},[t.profileSettings.followers.count?n("div",{staticClass:"font-weight-light"},[n("a",{staticClass:"text-dark cursor-pointer text-center",on:{click:function(e){return t.followersModal()}}},[n("p",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.formatCount(t.profile.followers_count)))]),t._v(" "),n("p",{staticClass:"text-muted mb-0 small"},[t._v("Followers")])])]):t._e()]),t._v(" "),n("li",{staticClass:"nav-item"},[t.profileSettings.following.count?n("div",{staticClass:"font-weight-light"},[n("a",{staticClass:"text-dark cursor-pointer text-center",on:{click:function(e){return t.followingModal()}}},[n("p",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.formatCount(t.profile.following_count)))]),t._v(" "),n("p",{staticClass:"text-muted mb-0 small"},[t._v("Following")])])]):t._e()])])])])])]),t._v(" "),n("div",{staticClass:"d-none d-md-block pb-3"},[t.hasStory?n("div",{staticClass:"has-story-lg cursor-pointer shadow-sm",on:{click:function(e){return t.storyRedirect()}}},[n("img",{staticClass:"rounded-circle box-shadow cursor-pointer",attrs:{alt:t.profileUsername+"'s profile picture",src:t.profile.avatar,width:"150px",height:"150px"}})]):n("div",[n("img",{staticClass:"rounded-circle box-shadow",attrs:{alt:t.profileUsername+"'s profile picture",src:t.profile.avatar,width:"150px",height:"150px"}})]),t._v(" "),t.sponsorList.patreon||t.sponsorList.liberapay||t.sponsorList.opencollective?n("p",{staticClass:"text-center mt-3"},[n("button",{staticClass:"btn btn-outline-secondary font-weight-bold py-0",attrs:{type:"button"},on:{click:t.showSponsorModal}},[n("i",{staticClass:"fas fa-heart text-danger"}),t._v("\n\t\t\t\t\t\t\t\t\t\t\tDonate\n\t\t\t\t\t\t\t\t\t\t")])]):t._e()])])]),t._v(" "),n("div",{staticClass:"col-12 col-md-8 d-flex align-items-center"},[n("div",{staticClass:"profile-details"},[n("div",{staticClass:"d-none d-md-flex username-bar pb-3 align-items-center"},[n("span",{staticClass:"font-weight-ultralight h3 mb-0"},[t._v(t._s(t.profile.username))]),t._v(" "),t.profile.is_admin?n("span",{staticClass:"pl-1 pb-2 fa-stack",attrs:{title:"Admin Account","data-toggle":"tooltip"}},[n("i",{staticClass:"fas fa-certificate fa-lg text-danger fa-stack-1x"}),t._v(" "),n("i",{staticClass:"fas fa-crown text-white fa-sm fa-stack-1x",staticStyle:{"font-size":"9px"}})]):t._e(),t._v(" "),t.profile.id!=t.user.id&&t.user.hasOwnProperty("id")?n("span",[1==t.relationship.following?n("span",{staticClass:"pl-4"},[n("button",{staticClass:"btn btn-outline-secondary font-weight-bold btn-sm py-1",attrs:{type:"button","data-toggle":"tooltip",title:"Unfollow"},on:{click:t.followProfile}},[t._v("FOLLOWING")])]):t._e(),t._v(" "),t.relationship.following?t._e():n("span",{staticClass:"pl-4"},[n("button",{staticClass:"btn btn-primary font-weight-bold btn-sm py-1",attrs:{type:"button","data-toggle":"tooltip",title:"Follow"},on:{click:t.followProfile}},[t._v("FOLLOW")])])]):t._e(),t._v(" "),t.owner&&t.user.hasOwnProperty("id")?n("span",{staticClass:"pl-4"},[n("a",{staticClass:"btn btn-outline-secondary btn-sm",staticStyle:{"font-weight":"600"},attrs:{href:"/settings/home"}},[t._v("Edit Profile")])]):t._e(),t._v(" "),n("span",{staticClass:"pl-4"},[n("a",{staticClass:"fas fa-ellipsis-h fa-lg text-muted text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.visitorMenu(e)}}})])]),t._v(" "),n("div",{staticClass:"font-size-16px"},[n("div",{staticClass:"d-none d-md-inline-flex profile-stats pb-3"},[n("div",{staticClass:"font-weight-light pr-5"},[n("span",{staticClass:"text-dark"},[n("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.statuses_count)))]),t._v("\n\t\t\t\t\t\t\t\t\t\t\t\tPosts\n\t\t\t\t\t\t\t\t\t\t\t")])]),t._v(" "),t.profileSettings.followers.count?n("div",{staticClass:"font-weight-light pr-5"},[n("a",{staticClass:"text-dark cursor-pointer",on:{click:function(e){return t.followersModal()}}},[n("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.followers_count)))]),t._v("\n\t\t\t\t\t\t\t\t\t\t\t\tFollowers\n\t\t\t\t\t\t\t\t\t\t\t")])]):t._e(),t._v(" "),t.profileSettings.following.count?n("div",{staticClass:"font-weight-light"},[n("a",{staticClass:"text-dark cursor-pointer",on:{click:function(e){return t.followingModal()}}},[n("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.following_count)))]),t._v("\n\t\t\t\t\t\t\t\t\t\t\t\tFollowing\n\t\t\t\t\t\t\t\t\t\t\t")])]):t._e()]),t._v(" "),n("p",{staticClass:"mb-0 d-flex align-items-center"},[n("span",{staticClass:"font-weight-bold pr-3"},[t._v(t._s(t.profile.display_name))])]),t._v(" "),t.profile.note?n("div",{staticClass:"mb-0",domProps:{innerHTML:t._s(t.profile.note)}}):t._e(),t._v(" "),t.profile.website?n("p",{},[n("a",{staticClass:"profile-website",attrs:{href:t.profile.website,rel:"me external nofollow noopener",target:"_blank"}},[t._v(t._s(t.profile.website))])]):t._e()])])])])])]),t._v(" "),n("div",{staticClass:"d-block d-md-none my-0 pt-3 border-bottom"},[t.user&&t.user.hasOwnProperty("id")?n("p",{staticClass:"pt-3"},[t.owner?n("button",{staticClass:"btn btn-outline-secondary bg-white btn-sm py-1 btn-block text-center font-weight-bold text-dark border border-lighter",on:{click:function(e){return e.preventDefault(),t.redirect("/settings/home")}}},[t._v("Edit Profile")]):t._e(),t._v(" "),!t.owner&&t.relationship.following?n("button",{staticClass:"btn btn-outline-secondary bg-white btn-sm py-1 px-5 font-weight-bold text-dark border border-lighter",on:{click:t.followProfile}},[t._v("   Unfollow   ")]):t._e(),t._v(" "),t.owner||t.relationship.following?t._e():n("button",{staticClass:"btn btn-primary btn-sm py-1 px-5 font-weight-bold",on:{click:t.followProfile}},[t._v(t._s(t.relationship.followed_by?"Follow Back":"     Follow     "))])]):t._e()]),t._v(" "),n("div",{},[n("ul",{staticClass:"nav nav-topbar d-flex justify-content-center border-0"},[n("li",{staticClass:"nav-item border-top"},[n("a",{class:"grid"==this.mode?"nav-link text-dark":"nav-link",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.switchMode("grid")}}},[n("i",{staticClass:"fas fa-th"}),t._v(" "),n("span",{staticClass:"d-none d-md-inline-block small pl-1"},[t._v("POSTS")])])]),t._v(" "),n("li",{staticClass:"nav-item px-0 border-top"},[n("a",{class:"collections"==this.mode?"nav-link text-dark":"nav-link",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.switchMode("collections")}}},[n("i",{staticClass:"fas fa-images"}),t._v(" "),n("span",{staticClass:"d-none d-md-inline-block small pl-1"},[t._v("COLLECTIONS")])])]),t._v(" "),t.owner?n("li",{staticClass:"nav-item border-top"},[n("a",{class:"bookmarks"==this.mode?"nav-link text-dark":"nav-link",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.switchMode("bookmarks")}}},[n("i",{staticClass:"fas fa-bookmark"})])]):t._e()])]),t._v(" "),n("div",{staticClass:"container px-0"},[n("div",{staticClass:"profile-timeline mt-md-4"},["grid"==t.mode?n("div",{staticClass:"row"},[t._l(t.timeline,(function(e,i){return n("div",{staticClass:"col-4 p-1 p-md-3"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:t.statusUrl(e)}},[n("div",{class:[e.sensitive?"square":"square "+e.media_attachments[0].filter_class]},["photo:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"square-content",style:t.previewBackground(e)}),t._v(" "),n("div",{staticClass:"info-overlay-text"},[n("h5",{staticClass:"text-white m-auto font-weight-bold"},[n("span",[n("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),n("span",{staticClass:"d-flex-inline"},[t._v(t._s(e.favourites_count))])]),t._v(" "),n("span",[n("span",{staticClass:"fas fa-retweet fa-lg p-2 d-flex-inline"}),t._v(" "),n("span",{staticClass:"d-flex-inline"},[t._v(t._s(e.reblogs_count))])])])])])])])})),t._v(" "),0==t.timeline.length?n("div",{staticClass:"col-12"},[t._m(0)]):t._e()],2):t._e(),t._v(" "),t.timeline.length&&"grid"==t.mode?n("div",[n("infinite-loading",{on:{infinite:t.infiniteTimeline}},[n("div",{attrs:{slot:"no-more"},slot:"no-more"}),t._v(" "),n("div",{attrs:{slot:"no-results"},slot:"no-results"})])],1):t._e(),t._v(" "),"bookmarks"==t.mode?n("div",[t.bookmarks.length?n("div",{staticClass:"row"},t._l(t.bookmarks,(function(e,i){return n("div",{staticClass:"col-4 p-1 p-sm-2 p-md-3"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[n("div",{staticClass:"square"},["photo:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"square-content",style:t.previewBackground(e)}),t._v(" "),n("div",{staticClass:"info-overlay-text"},[n("h5",{staticClass:"text-white m-auto font-weight-bold"},[n("span",[n("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),n("span",{staticClass:"d-flex-inline"},[t._v(t._s(e.favourites_count))])]),t._v(" "),n("span",[n("span",{staticClass:"fas fa-retweet fa-lg p-2 d-flex-inline"}),t._v(" "),n("span",{staticClass:"d-flex-inline"},[t._v(t._s(e.reblogs_count))])])])])])])])})),0):n("div",{staticClass:"col-12"},[t._m(1)])]):t._e(),t._v(" "),"collections"==t.mode?n("div",[t.collections.length?n("div",{staticClass:"row"},t._l(t.collections,(function(t,e){return n("div",{staticClass:"col-4 p-1 p-sm-2 p-md-3"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:t.url}},[n("div",{staticClass:"square"},[n("div",{staticClass:"square-content",style:"background-image: url("+t.thumb+");"})])])])})),0):n("div",[t._m(2)])]):t._e()])])]):t._e(),t._v(" "),"moment"==t.layout?n("div",{staticClass:"mt-3"},[n("div",{class:t.momentBackground(),staticStyle:{width:"100%","min-height":"274px"}}),t._v(" "),n("div",{staticClass:"bg-white border-bottom"},[n("div",{staticClass:"container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 row mx-0"},[n("div",{staticClass:"col-4 text-left mt-2"},[t.relationship&&t.relationship.followed_by?n("span",[n("span",{staticClass:"bg-light border border-secondary font-weight-bold small py-1 px-2 text-muted rounded"},[t._v("FOLLOWS YOU")])]):t._e(),t._v(" "),t.profile.is_admin?n("span",[n("span",{staticClass:"bg-light border border-danger font-weight-bold small py-1 px-2 text-danger rounded"},[t._v("ADMIN")])]):t._e()]),t._v(" "),n("div",{staticClass:"col-4 text-center"},[n("div",{staticClass:"d-block d-md-none"},[n("img",{staticClass:"rounded-circle box-shadow",staticStyle:{"margin-top":"-60px",border:"5px solid #fff"},attrs:{src:t.profile.avatar,width:"110px",height:"110px"}})]),t._v(" "),n("div",{staticClass:"d-none d-md-block"},[n("img",{staticClass:"rounded-circle box-shadow",staticStyle:{"margin-top":"-90px",border:"5px solid #fff"},attrs:{src:t.profile.avatar,width:"172px",height:"172px"}})])]),t._v(" "),n("div",{staticClass:"col-4 text-right mt-2"},[n("span",{staticClass:"d-none d-md-inline-block pl-4"},[n("a",{staticClass:"fas fa-rss fa-lg text-muted text-decoration-none",attrs:{href:"/users/"+t.profile.username+".atom"}})]),t._v(" "),t.owner?n("span",{staticClass:"pl-md-4 pl-sm-2"},[n("a",{staticClass:"fas fa-cog fa-lg text-muted text-decoration-none",attrs:{href:"/settings/home"}})]):t._e(),t._v(" "),t.profile.id!=t.user.id&&t.user.hasOwnProperty("id")?n("span",{staticClass:"pl-md-4 pl-sm-2"},[n("a",{staticClass:"fas fa-cog fa-lg text-muted text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.visitorMenu(e)}}})]):t._e(),t._v(" "),t.profile.id!=t.user.id&&t.user.hasOwnProperty("id")?n("span",[1==t.relationship.following?n("span",{staticClass:"pl-md-4 pl-sm-2"},[n("button",{staticClass:"btn btn-outline-secondary font-weight-bold btn-sm",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.followProfile()}}},[t._v("Unfollow")])]):n("span",{staticClass:"pl-md-4 pl-sm-2"},[n("button",{staticClass:"btn btn-primary font-weight-bold btn-sm",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.followProfile()}}},[t._v("Follow")])])]):t._e()])]),t._v(" "),n("div",{staticClass:"col-12 text-center"},[n("div",{staticClass:"profile-details my-3"},[n("p",{staticClass:"font-weight-ultralight h2 text-center"},[t._v(t._s(t.profile.username))]),t._v(" "),t.profile.note?n("div",{staticClass:"text-center text-muted p-3",domProps:{innerHTML:t._s(t.profile.note)}}):t._e(),t._v(" "),n("div",{staticClass:"pb-3 text-muted text-center"},[n("a",{staticClass:"text-lighter",attrs:{href:t.profile.url}},[n("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.statuses_count)))]),t._v("\n\t\t\t\t\t\t\t\t\t\tPosts\n\t\t\t\t\t\t\t\t\t")]),t._v(" "),t.profileSettings.followers.count?n("a",{staticClass:"text-lighter cursor-pointer px-3",on:{click:function(e){return t.followersModal()}}},[n("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.followers_count)))]),t._v("\n\t\t\t\t\t\t\t\t\t\tFollowers\n\t\t\t\t\t\t\t\t\t")]):t._e(),t._v(" "),t.profileSettings.following.count?n("a",{staticClass:"text-lighter cursor-pointer",on:{click:function(e){return t.followingModal()}}},[n("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.following_count)))]),t._v("\n\t\t\t\t\t\t\t\t\t\tFollowing\n\t\t\t\t\t\t\t\t\t")]):t._e()])])])])])]),t._v(" "),n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"profile-timeline mt-md-4"},["grid"==t.mode?n("div",{},[n("masonry",{attrs:{cols:{default:3,700:2,400:1},gutter:{default:"5px"}}},t._l(t.timeline,(function(e,i){return n("div",{staticClass:"p-1"},[n("a",{class:[e.sensitive?"card info-overlay card-md-border-0":e.media_attachments[0].filter_class+" card info-overlay card-md-border-0"],attrs:{href:t.statusUrl(e)}},[n("img",{staticClass:"img-fluid w-100",attrs:{src:t.previewUrl(e)}})])])})),0)],1):t._e(),t._v(" "),t.timeline.length?n("div",[n("infinite-loading",{on:{infinite:t.infiniteTimeline}},[n("div",{attrs:{slot:"no-more"},slot:"no-more"}),t._v(" "),n("div",{attrs:{slot:"no-results"},slot:"no-results"})])],1):t._e()])])]):t._e()]),t._v(" "),n("b-modal",{ref:"followingModal",attrs:{id:"following-modal","hide-footer":"",centered:"",title:"Following","body-class":"list-group-flush p-0"}},[n("div",{staticClass:"list-group"},[t._l(t.following,(function(e,i){return n("div",{key:"following_"+i,staticClass:"list-group-item border-0"},[n("div",{staticClass:"media"},[n("a",{attrs:{href:e.url}},[n("img",{staticClass:"mr-3 rounded-circle box-shadow",attrs:{src:e.avatar,alt:e.username+"’s avatar",width:"30px",loading:"lazy"}})]),t._v(" "),n("div",{staticClass:"media-body"},[n("p",{staticClass:"mb-0",staticStyle:{"font-size":"14px"}},[n("a",{staticClass:"font-weight-bold text-dark",attrs:{href:e.url}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(e.username)+"\n\t\t\t\t\t\t\t")])]),t._v(" "),n("p",{staticClass:"text-muted mb-0",staticStyle:{"font-size":"14px"}},[t._v("\n\t\t\t\t\t\t\t"+t._s(e.display_name)+"\n\t\t\t\t\t\t")])]),t._v(" "),t.owner?n("div",[n("a",{staticClass:"btn btn-outline-secondary btn-sm",attrs:{href:"#"},on:{click:function(n){return n.preventDefault(),t.followModalAction(e.id,i,"following")}}},[t._v("Unfollow")])]):t._e()])])})),t._v(" "),0==t.following.length?n("div",{staticClass:"list-group-item border-0"},[n("div",{staticClass:"list-group-item border-0"},[n("p",{staticClass:"p-3 text-center mb-0 lead"})])]):t._e(),t._v(" "),t.followingMore?n("div",{staticClass:"list-group-item text-center",on:{click:function(e){return t.followingLoadMore()}}},[n("p",{staticClass:"mb-0 small text-muted font-weight-light cursor-pointer"},[t._v("Load more")])]):t._e()],2)]),t._v(" "),n("b-modal",{ref:"followerModal",attrs:{id:"follower-modal","hide-footer":"",centered:"",title:"Followers","body-class":"list-group-flush p-0"}},[n("div",{staticClass:"list-group"},[t._l(t.followers,(function(e,i){return n("div",{key:"follower_"+i,staticClass:"list-group-item border-0"},[n("div",{staticClass:"media"},[n("a",{attrs:{href:e.url}},[n("img",{staticClass:"mr-3 rounded-circle box-shadow",attrs:{src:e.avatar,alt:e.username+"’s avatar",width:"30px",loading:"lazy"}})]),t._v(" "),n("div",{staticClass:"media-body"},[n("p",{staticClass:"mb-0",staticStyle:{"font-size":"14px"}},[n("a",{staticClass:"font-weight-bold text-dark",attrs:{href:e.url}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(e.username)+"\n\t\t\t\t\t\t\t")])]),t._v(" "),n("p",{staticClass:"text-muted mb-0",staticStyle:{"font-size":"14px"}},[t._v("\n\t\t\t\t\t\t\t"+t._s(e.display_name)+"\n\t\t\t\t\t\t")])])])])})),t._v(" "),t.followerMore?n("div",{staticClass:"list-group-item text-center",on:{click:function(e){return t.followersLoadMore()}}},[n("p",{staticClass:"mb-0 small text-muted font-weight-light cursor-pointer"},[t._v("Load more")])]):t._e()],2)]),t._v(" "),n("b-modal",{ref:"visitorContextMenu",attrs:{id:"visitor-context-menu","hide-footer":"","hide-header":"",centered:"",size:"sm","body-class":"list-group-flush p-0"}},[t.relationship?n("div",{staticClass:"list-group"},[n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.copyProfileLink}},[t._v("\n\t\t\t\tCopy Link\n\t\t\t")]),t._v(" "),0==t.profile.locked?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.showEmbedProfileModal}},[t._v("\n\t\t\t\tEmbed\n\t\t\t")]):t._e(),t._v(" "),!t.user||t.owner||t.relationship.following?t._e():n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.followProfile}},[t._v("\n\t\t\t\tFollow\n\t\t\t")]),t._v(" "),t.user&&!t.owner&&t.relationship.following?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded",on:{click:t.followProfile}},[t._v("\n\t\t\t\tUnfollow\n\t\t\t")]):t._e(),t._v(" "),!t.user||t.owner||t.relationship.muting?t._e():n("div",{staticClass:"list-group-item cursor-pointer text-center rounded",on:{click:t.muteProfile}},[t._v("\n\t\t\t\tMute\n\t\t\t")]),t._v(" "),t.user&&!t.owner&&t.relationship.muting?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded",on:{click:t.unmuteProfile}},[t._v("\n\t\t\t\tUnmute\n\t\t\t")]):t._e(),t._v(" "),t.user&&!t.owner?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.reportProfile}},[t._v("\n\t\t\t\tReport User\n\t\t\t")]):t._e(),t._v(" "),!t.user||t.owner||t.relationship.blocking?t._e():n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.blockProfile}},[t._v("\n\t\t\t\tBlock\n\t\t\t")]),t._v(" "),t.user&&!t.owner&&t.relationship.blocking?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.unblockProfile}},[t._v("\n\t\t\t\tUnblock\n\t\t\t")]):t._e(),t._v(" "),t.user&&t.owner?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:function(e){return t.redirect("/settings/home")}}},[t._v("\n\t\t\t\tSettings\n\t\t\t")]):t._e(),t._v(" "),n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-muted",on:{click:function(e){return t.$refs.visitorContextMenu.hide()}}},[t._v("\n\t\t\t\tClose\n\t\t\t")])]):t._e()]),t._v(" "),n("b-modal",{ref:"sponsorModal",attrs:{id:"sponsor-modal","hide-footer":"",title:"Sponsor "+t.profileUsername,centered:"",size:"md","body-class":"px-5"}},[n("div",[n("p",{staticClass:"font-weight-bold"},[t._v("External Links")]),t._v(" "),t.sponsorList.patreon?n("p",{staticClass:"pt-2"},[n("a",{staticClass:"font-weight-bold",attrs:{href:"https://"+t.sponsorList.patreon,rel:"nofollow"}},[t._v(t._s(t.sponsorList.patreon))])]):t._e(),t._v(" "),t.sponsorList.liberapay?n("p",{staticClass:"pt-2"},[n("a",{staticClass:"font-weight-bold",attrs:{href:"https://"+t.sponsorList.liberapay,rel:"nofollow"}},[t._v(t._s(t.sponsorList.liberapay))])]):t._e(),t._v(" "),t.sponsorList.opencollective?n("p",{staticClass:"pt-2"},[n("a",{staticClass:"font-weight-bold",attrs:{href:"https://"+t.sponsorList.opencollective,rel:"nofollow"}},[t._v(t._s(t.sponsorList.opencollective))])]):t._e()])]),t._v(" "),n("b-modal",{ref:"embedModal",attrs:{id:"ctx-embed-modal","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"md","body-class":"p-2 rounded"}},[n("div",[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.ctxEmbedPayload,expression:"ctxEmbedPayload"}],staticClass:"form-control disabled",staticStyle:{border:"1px solid #efefef","font-size":"14px","line-height":"12px",height:"37px",margin:"0 0 7px",resize:"none","white-space":"nowrap"},attrs:{rows:"1"},domProps:{value:t.ctxEmbedPayload},on:{input:function(e){e.target.composing||(t.ctxEmbedPayload=e.target.value)}}}),t._v(" "),n("hr"),t._v(" "),n("button",{class:t.copiedEmbed?"btn btn-primary btn-block btn-sm py-1 font-weight-bold disabed":"btn btn-primary btn-block btn-sm py-1 font-weight-bold",attrs:{disabled:t.copiedEmbed},on:{click:t.ctxCopyEmbed}},[t._v(t._s(t.copiedEmbed?"Embed Code Copied!":"Copy Embed Code"))]),t._v(" "),n("p",{staticClass:"mb-0 px-2 small text-muted"},[t._v("By using this embed, you agree to our "),n("a",{attrs:{href:"/site/terms"}},[t._v("Terms of Use")])])])])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"py-5 text-center text-muted"},[e("p",[e("i",{staticClass:"fas fa-camera-retro fa-2x"})]),this._v(" "),e("p",{staticClass:"h2 font-weight-light pt-3"},[this._v("No posts yet")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"py-5 text-center text-muted"},[e("p",[e("i",{staticClass:"fas fa-bookmark fa-2x"})]),this._v(" "),e("p",{staticClass:"h2 font-weight-light pt-3"},[this._v("No saved bookmarks")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"py-5 text-center text-muted"},[e("p",[e("i",{staticClass:"fas fa-images fa-2x"})]),this._v(" "),e("p",{staticClass:"h2 font-weight-light pt-3"},[this._v("No collections yet")])])}],!1,null,"5ea1f48b",null);e.default=r.exports},GlRX:function(t,e,n){"use strict";var i=n("Kz1s");n.n(i).a},H5vT:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.o-square[data-v-5ea1f48b] {\n\tmax-width: 320px;\n}\n.o-portrait[data-v-5ea1f48b] {\n\tmax-width: 320px;\n}\n.o-landscape[data-v-5ea1f48b] {\n\tmax-width: 320px;\n}\n.post-icon[data-v-5ea1f48b] {\n\tcolor: #fff;\n\tposition:relative;\n\tmargin-top: 10px;\n\tz-index: 9;\n\topacity: 0.6;\n\ttext-shadow: 3px 3px 16px #272634;\n}\n.font-size-16px[data-v-5ea1f48b] {\n\tfont-size: 16px;\n}\n.profile-website[data-v-5ea1f48b] {\n\tcolor: #003569;\n\ttext-decoration: none;\n\tfont-weight: 600;\n}\n.nav-topbar .nav-link[data-v-5ea1f48b] {\n\tcolor: #999;\n}\n.nav-topbar .nav-link .small[data-v-5ea1f48b] {\n\tfont-weight: 600;\n}\n.has-story[data-v-5ea1f48b] {\n\twidth: 84px;\n\theight: 84px;\n\tborder-radius: 50%;\n\tpadding: 4px;\n\tbackground: radial-gradient(ellipse at 70% 70%, #ee583f 8%, #d92d77 42%, #bd3381 58%);\n}\n.has-story img[data-v-5ea1f48b] {\n\twidth: 76px;\n\theight: 76px;\n\tborder-radius: 50%;\n\tpadding: 6px;\n\tbackground: #fff;\n}\n.has-story-lg[data-v-5ea1f48b] {\n\twidth: 159px;\n\theight: 159px;\n\tborder-radius: 50%;\n\tpadding: 4px;\n\tbackground: radial-gradient(ellipse at 70% 70%, #ee583f 8%, #d92d77 42%, #bd3381 58%);\n}\n.has-story-lg img[data-v-5ea1f48b] {\n\twidth: 150px;\n\theight: 150px;\n\tborder-radius: 50%;\n\tpadding: 6px;\n\tbackground:#fff;\n}\n",""])},HFTX:function(t,e,n){"use strict";var i=n("SjwX");n.n(i).a},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var s=(a=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[n].concat(o).concat([s]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},s=0;s