diff --git a/.ddev/commands/redis/redis-cli b/.ddev/commands/redis/redis-cli index 27bf575b3..8824c6a6b 100755 --- a/.ddev/commands/redis/redis-cli +++ b/.ddev/commands/redis/redis-cli @@ -4,4 +4,4 @@ ## Usage: redis-cli [flags] [args] ## Example: "redis-cli KEYS *" or "ddev redis-cli INFO" or "ddev redis-cli --version" -redis-cli -p 6379 -h redis $@ +exec redis-cli -p 6379 -h redis "$@" diff --git a/.dockerignore b/.dockerignore index 70376cdf4..757a67a51 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,8 +1,30 @@ -data -Dockerfile -contrib/docker/Dockerfile.* -docker-compose*.yml -.dockerignore -.git -.gitignore -.env +.DS_Store +/.bash_history +/.bash_profile +/.bashrc +/.composer +/.env +/.env.dottie-backup +/.git +/.git-credentials +/.gitconfig +/.gitignore +/.idea +/.vagrant +/bootstrap/cache +/docker-compose-state/ +/Homestead.json +/Homestead.yaml +/node_modules +/npm-debug.log +/public/hot +/public/storage +/public/vendor/horizon +/storage/*.key +/storage/docker +/vendor +/yarn-error.log + +# Exceptions - these *MUST* be last +!/bootstrap/cache/.gitignore +!/public/vendor/horizon/.gitignore diff --git a/.editorconfig b/.editorconfig index 3c44241cc..eff249956 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,21 @@ end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +[*.{sh,envsh,env,env*}] +indent_style = space +indent_size = 4 + +# ShellCheck config +shell_variant = bash # like -ln=bash +binary_next_line = true # like -bn +switch_case_indent = true # like -ci +space_redirects = false # like -sr +keep_padding = false # like -kp +function_next_line = true # like -fn +never_split = true # like -ns +simplify = true diff --git a/.env.docker b/.env.docker index ce4cfe87c..0d5836745 100644 --- a/.env.docker +++ b/.env.docker @@ -1,149 +1,1278 @@ -## Crypto +#!/bin/bash +# -*- mode: bash -*- +# vi: ft=bash +# shellcheck disable=SC2034,SC2148 + +# Use Dottie (https://github.com/jippi/dottie) to manage this .env file easier! +# +# For example: +# +# Run [dottie update] to update your [.env] file with upstream (as part of upgrade) +# Run [dottie validate] to validate youe [.env] file +# +# @dottie/source .env.docker + +################################################################################ +# app +################################################################################ + +# The name/title for your site +# @see https://docs.pixelfed.org/technical-documentation/config/#app_name-1 +# @dottie/example My Pixelfed Site +# @dottie/validate required,ne=My Pixelfed Site +APP_NAME= + +# Application domain used for routing. (e.g., pixelfed.org) +# +# @see https://docs.pixelfed.org/technical-documentation/config/#app_domain +# @dottie/example example.com +# @dottie/validate required,ne=example.com,fqdn +APP_DOMAIN="example.com" + +# This URL is used by the console to properly generate URLs when using the Artisan command line tool. +# You should set this to the root of your application so that it is used when running Artisan tasks. +# +# @see https://docs.pixelfed.org/technical-documentation/config/#app_url +# @dottie/validate required,http_url +APP_URL="https://${APP_DOMAIN}" + +# Application domains used for routing. +# +# @see https://docs.pixelfed.org/technical-documentation/config/#admin_domain +# @dottie/validate required,fqdn +ADMIN_DOMAIN="${APP_DOMAIN}" + +# This value determines the “environment” your application is currently running in. +# This may determine how you prefer to configure various services your application utilizes. +# +# @default "production" +# @see https://docs.pixelfed.org/technical-documentation/config/#app_env +# @dottie/validate required,oneof=production dev staging +#APP_ENV="production" + +# When your application is in debug mode, detailed error messages with stack traces will +# be shown on every error that occurs within your application. +# +# If disabled, a simple generic error page is shown. +# +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#app_debug +# @dottie/validate required,boolean +#APP_DEBUG="false" + +# Enable/disable new local account registrations. +# +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#open_registration +# @dottie/validate required,boolean +#OPEN_REGISTRATION="true" + +# Require email verification before a new user can do anything. +# +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#enforce_email_verification +# @dottie/validate required,boolean +#ENFORCE_EMAIL_VERIFICATION="true" + +# Allow a maximum number of user accounts. +# +# @default "1000" +# @see https://docs.pixelfed.org/technical-documentation/config/#pf_max_users +# @dottie/validate required,number +#PF_MAX_USERS="1000" + +# Enforce the maximum number of user accounts +# +# @default "true" +# @dottie/validate boolean +#PF_ENFORCE_MAX_USERS="true" + +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#oauth_enabled +# @dottie/validate required,boolean +#OAUTH_ENABLED="false" + +# ! Do not edit your timezone once the service is running - or things will break! +# +# @default "UTC" +# @see https://docs.pixelfed.org/technical-documentation/config/#app_timezone +# @see https://www.php.net/manual/en/timezones.php +# @dottie/validate required,timezone +APP_TIMEZONE="UTC" + +# The application locale determines the default locale that will be used by the translation service provider. +# You are free to set this value to any of the locales which will be supported by the application. +# +# @default "en" +# @see https://docs.pixelfed.org/technical-documentation/config/#app_locale +# @dottie/validate required +#APP_LOCALE="en" + +# The fallback locale determines the locale to use when the current one is not available. +# +# You may change the value to correspond to any of the language folders that are provided through your application. +# +# @default "en" +# @see https://docs.pixelfed.org/technical-documentation/config/#app_fallback_locale +# @dottie/validate required +#APP_FALLBACK_LOCALE="en" + +# @see https://docs.pixelfed.org/technical-documentation/config/#limit_account_size +# @dottie/validate required,boolean +#LIMIT_ACCOUNT_SIZE="true" + +# Update the max account size, the per user limit of files in kB. +# +# @default "1000000" (1GB) +# @see https://docs.pixelfed.org/technical-documentation/config/#max_account_size-kb +# @dottie/validate required,number +#MAX_ACCOUNT_SIZE="1000000" + +# Update the max photo size, in kB. +# +# @default "15000" (15MB) +# @see https://docs.pixelfed.org/technical-documentation/config/#max_photo_size-kb +# @dottie/validate required,number +#MAX_PHOTO_SIZE="15000" + +# The max number of photos allowed per post. +# +# @default "4" +# @see https://docs.pixelfed.org/technical-documentation/config/#max_album_length +# @dottie/validate required,number +#MAX_ALBUM_LENGTH="4" + +# Update the max avatar size, in kB. +# +# @default "2000" (2MB). +# @see https://docs.pixelfed.org/technical-documentation/config/#max_avatar_size-kb +# @dottie/validate required,number +#MAX_AVATAR_SIZE="2000" + +# Change the caption length limit for new local posts. +# +# @default "500" +# @see https://docs.pixelfed.org/technical-documentation/config/#max_caption_length +# @dottie/validate required,number +#MAX_CAPTION_LENGTH="500" + +# Change the bio length limit for user profiles. +# +# @default "125" +# @see https://docs.pixelfed.org/technical-documentation/config/#max_bio_length +# @dottie/validate required,number +#MAX_BIO_LENGTH="125" + +# Change the length limit for user names. +# +# @default "30" +# @see https://docs.pixelfed.org/technical-documentation/config/#max_name_length +# @dottie/validate required,number +#MAX_NAME_LENGTH="30" + +# Resize and optimize image uploads. +# +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#pf_optimize_images +# @dottie/validate required,boolean +#PF_OPTIMIZE_IMAGES="true" + +# Set the image optimization quality, must be a value between 1-100. +# +# @default "80" +# @see https://docs.pixelfed.org/technical-documentation/config/#image_quality +# @dottie/validate required,number +#IMAGE_QUALITY="80" + +# Resize and optimize video uploads. +# +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#pf_optimize_videos +# @dottie/validate required,boolean +#PF_OPTIMIZE_VIDEOS="true" + +# Enable account deletion. +# +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#account_deletion +# @dottie/validate required,boolean +#ACCOUNT_DELETION="true" + +# Set account deletion queue after X days, set to false to delete accounts immediately. +# +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#account_delete_after +# @dottie/validate required,boolean|number +#ACCOUNT_DELETE_AFTER="false" + +# @default "Pixelfed - Photo sharing for everyone" +# @see https://docs.pixelfed.org/technical-documentation/config/#instance_description +# @dottie/validate required +#INSTANCE_DESCRIPTION="" + +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#instance_public_hashtags +# @dottie/validate required,boolean +#INSTANCE_PUBLIC_HASHTAGS="false" + +# The public e-mail address people can use to contact you by +# +# @default "" +# @see https://docs.pixelfed.org/technical-documentation/config/#instance_contact_email +# @dottie/validate required,ne=__CHANGE_ME__,email +INSTANCE_CONTACT_EMAIL="__CHANGE_ME__" + +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#instance_public_local_timeline +# @dottie/validate required,boolean +#INSTANCE_PUBLIC_LOCAL_TIMELINE="false" + +# @default "" +# @see https://docs.pixelfed.org/technical-documentation/config/#banned_usernames +#BANNED_USERNAMES="" + +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#stories_enabled +# @dottie/validate required,boolean +#STORIES_ENABLED="false" + +# Level is hardcoded to 1. +# +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#restricted_instance +# @dottie/validate required,boolean +#RESTRICTED_INSTANCE="false" + +# @default false +# @see https://docs.pixelfed.org/technical-documentation/config/#media_exif_database +# @dottie/validate required,boolean +#MEDIA_EXIF_DATABASE="false" + +# Pixelfed supports GD or ImageMagick to process images. +# +# Possible values: +# - "gd" (default) +# - "imagick" +# +# @default "gd" +# @see https://docs.pixelfed.org/technical-documentation/config/#image_driver +# @dottie/validate required,oneof=gd imagick +#IMAGE_DRIVER="gd" + +# Set trusted proxy IP addresses. +# +# Both IPv4 and IPv6 addresses are supported, along with CIDR notation. +# +# The “*” character is syntactic sugar within TrustedProxy to trust any +# proxy that connects directly to your server, a requirement when you cannot +# know the address of your proxy (e.g. if using Rackspace balancers). +# +# The “**” character is syntactic sugar within TrustedProxy to trust not just any +# proxy that connects directly to your server, but also proxies that connect to those proxies, +# and all the way back until you reach the original source IP. It will mean that +# $request->getClientIp() always gets the originating client IP, no matter how many proxies +# that client’s request has subsequently passed through. +# +# @default "*" +# @see https://docs.pixelfed.org/technical-documentation/config/#trust_proxies +# @dottie/validate required +#TRUST_PROXIES="*" + +# This option controls the default cache connection that gets used while using this caching library. +# +# This connection is used when another is not explicitly specified when executing a given caching function. +# +# Possible values: +# - "apc" +# - "array" +# - "database" +# - "file" (default) +# - "memcached" +# - "redis" +# +# @default "file" +# @see https://docs.pixelfed.org/technical-documentation/config/#cache_driver +# @dottie/validate required,oneof=apc array database file memcached redis +CACHE_DRIVER="redis" + +# @default ${APP_NAME}_cache, or laravel_cache if no APP_NAME is set. +# @see https://docs.pixelfed.org/technical-documentation/config/#cache_prefix +# @dottie/validate required +#CACHE_PREFIX="{APP_NAME}_cache" + +# This option controls the default broadcaster that will be used by the framework when an event needs to be broadcast. +# +# Possible values: +# - "pusher" +# - "redis" +# - "log" +# - "null" (default) +# +# @default null +# @see https://docs.pixelfed.org/technical-documentation/config/#broadcast_driver +# @dottie/validate required,oneof=pusher redis log null +BROADCAST_DRIVER="redis" + +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#restrict_html_types +# @dottie/validate required,boolean +#RESTRICT_HTML_TYPES="true" + +# Passport uses encryption keys while generating secure access tokens +# for your application. +# +# By default, the keys are stored as local files but can be set via environment +# variables when that is more convenient. + +# @see https://docs.pixelfed.org/technical-documentation/config/#passport_private_key +# @dottie/validate required +#PASSPORT_PRIVATE_KEY="" + +# @see https://docs.pixelfed.org/technical-documentation/config/#passport_public_key +# @dottie/validate required +#PASSPORT_PUBLIC_KEY="" + +################################################################################ +# database +################################################################################ + +# Database version to use (as Docker tag) +# +# @see https://hub.docker.com/_/mariadb +# @dottie/validate required +DB_VERSION="11.2" + +# Here you may specify which of the database connections below +# you wish to use as your default connection for all database work. +# +# Of course you may use many connections at once using the database library. +# +# Possible values: +# +# - "sqlite" +# - "mysql" (default) +# - "pgsql" +# - "sqlsrv" +# +# @see https://docs.pixelfed.org/technical-documentation/config/#db_connection +# @dottie/validate required,oneof=sqlite mysql pgsql sqlsrv +DB_CONNECTION="mysql" + +# @see https://docs.pixelfed.org/technical-documentation/config/#db_host +# @dottie/validate required,hostname +DB_HOST="db" + +# @see https://docs.pixelfed.org/technical-documentation/config/#db_username +# @dottie/validate required +DB_USERNAME="pixelfed" + +# The password to your database. Please make it secure. +# Use a site like https://pwgen.io/ to generate it +# +# @see https://docs.pixelfed.org/technical-documentation/config/#db_password +# @dottie/validate required +DB_PASSWORD= + +# @see https://docs.pixelfed.org/technical-documentation/config/#db_database +# @dottie/validate required +DB_DATABASE="pixelfed_prod" + +# Use "3306" for MySQL/MariaDB and "5432" for PostgreeSQL +# +# @see https://docs.pixelfed.org/technical-documentation/config/#db_port +# @dottie/validate required,number +DB_PORT="3306" + +# Automatically run [artisan migrate --force] if new migrations are detected. +# @dottie/validate required,boolean +DB_APPLY_NEW_MIGRATIONS_AUTOMATICALLY="false" + +################################################################################ +# mail +################################################################################ + +# Laravel supports both SMTP and PHP’s “mail” function as drivers for the sending of e-mail. +# You may specify which one you’re using throughout your application here. +# +# Possible values: +# +# "smtp" (default) +# "sendmail" +# "mailgun" +# "mandrill" +# "ses" +# "sparkpost" +# "log" +# "array" +# +# @default "smtp" +# @see https://docs.pixelfed.org/technical-documentation/config/#mail_driver +# @dottie/validate required,oneof=smtp sendmail mailgun mandrill ses sparkpost log array +#MAIL_DRIVER="smtp" + +# The host address of the SMTP server used by your applications. +# +# A default option is provided that is compatible with the Mailgun mail service which will provide reliable deliveries. +# +# @default "smtp.mailgun.org" +# @see https://docs.pixelfed.org/technical-documentation/config/#mail_host +# @dottie/validate required_with=MAIL_DRIVER,fqdn +#MAIL_HOST="smtp.mailgun.org" + +# This is the SMTP port used by your application to deliver e-mails to users of the application. +# +# Like the host we have set this value to stay compatible with the Mailgun e-mail application by default. +# +# @default 587. +# @see https://docs.pixelfed.org/technical-documentation/config/#mail_port +# @dottie/validate required_with=MAIL_DRIVER,number +#MAIL_PORT="587" + +# Here, you may specify a name and address that is used globally for all e-mails that are sent by your application. +# +# You may wish for all e-mails sent by your application to be sent from the same address. +# +# @default "bot@example.com" +# @see https://docs.pixelfed.org/technical-documentation/config/#mail_from_address +# @dottie/validate required_with=MAIL_DRIVER,email,ne=__CHANGE_ME__ +#MAIL_FROM_ADDRESS="__CHANGE_ME__" + +# The 'name' you send e-mail from +# +# @default "Example" +# @see https://docs.pixelfed.org/technical-documentation/config/#mail_from_name +# @dottie/validate required_with=MAIL_DRIVER +#MAIL_FROM_NAME="${APP_NAME}" + +# If your SMTP server requires a username for authentication, you should set it here. +# +# This will get used to authenticate with your server on connection. +# You may also set the “password” value below this one. +# +# @default "" +# @see https://docs.pixelfed.org/technical-documentation/config/#mail_username +# @dottie/validate required_with=MAIL_DRIVER +#MAIL_USERNAME="" + +# @default "" +# @see https://docs.pixelfed.org/technical-documentation/config/#mail_password +# @dottie/validate required_with=MAIL_DRIVER +#MAIL_PASSWORD="" + +# Here you may specify the encryption protocol that should be used when the application send e-mail messages. +# +# A sensible default using the transport layer security protocol should provide great security. +# +# @default "tls" +# @see https://docs.pixelfed.org/technical-documentation/config/#mail_encryption +# @dottie/validate required_with=MAIL_DRIVER +#MAIL_ENCRYPTION="tls" + +################################################################################ +# redis +################################################################################ + +# @default "phpredis" +# @see https://docs.pixelfed.org/technical-documentation/config/#redis_client +# @dottie/validate required +#REDIS_CLIENT="phpredis" + +# @default "tcp" +# @see https://docs.pixelfed.org/technical-documentation/config/#redis_scheme +# @dottie/validate required +#REDIS_SCHEME="tcp" + +# @default "localhost" +# @see https://docs.pixelfed.org/technical-documentation/config/#redis_host +# @dottie/validate required +REDIS_HOST="redis" + +# @default "null" (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#redis_password +# @dottie/validate omitempty +#REDIS_PASSWORD= + +# @default "6379" +# @see https://docs.pixelfed.org/technical-documentation/config/#redis_port +# @dottie/validate required,number +REDIS_PORT="6379" + +# @default "0" +# @see https://docs.pixelfed.org/technical-documentation/config/#redis_database +# @dottie/validate required,number +#REDIS_DATABASE="0" + +################################################################################ +# experiments +################################################################################ + +# Text only posts (alpha). +# +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#exp_top +# @dottie/validate required,boolean +#EXP_TOP="false" + +# Poll statuses (alpha). +# +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#exp_polls +# @dottie/validate required,boolean +#EXP_POLLS="false" + +# Cached public timeline for larger instances (beta). +# +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#exp_cpt +# @dottie/validate required,boolean +#EXP_CPT="false" + +# Enforce Mastodon API Compatibility (alpha). +# +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#exp_emc +# @dottie/validate required,boolean +#EXP_EMC="true" + +################################################################################ +# ActivityPub +################################################################################ + +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#activity_pub +# @dottie/validate required,boolean +#ACTIVITY_PUB="true" + +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#ap_remote_follow +# @dottie/validate required,boolean +#AP_REMOTE_FOLLOW="true" + +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#ap_sharedinbox +# @dottie/validate required,boolean +#AP_SHAREDINBOX="true" + +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#ap_inbox +# @dottie/validate required,boolean +#AP_INBOX="true" + +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#ap_outbox +# @dottie/validate required,boolean +#AP_OUTBOX="true" + +################################################################################ +# Federation +################################################################################ + +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#atom_feeds +# @dottie/validate required,boolean +#ATOM_FEEDS="true" + +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#nodeinfo +# @dottie/validate required,boolean +#NODEINFO="true" + +# @default "true" +# @see https://docs.pixelfed.org/technical-documentation/config/#webfinger +# @dottie/validate required,boolean +#WEBFINGER="true" + +################################################################################ +# Storage +################################################################################ + +# Store media on object storage like S3, Digital Ocean Spaces, Rackspace +# +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#pf_enable_cloud +# @dottie/validate required,boolean +#PF_ENABLE_CLOUD="false" + +# Many applications store files both locally and in the cloud. +# +# For this reason, you may specify a default “cloud” driver here. +# This driver will be bound as the Cloud disk implementation in the container. +# +# @default "s3" +# @see https://docs.pixelfed.org/technical-documentation/config/#filesystem_cloud +# @dottie/validate required_with=PF_ENABLE_CLOUD +#FILESYSTEM_CLOUD="s3" + +# @default true. +# @see https://docs.pixelfed.org/technical-documentation/config/#media_delete_local_after_cloud +# @dottie/validate required_with=PF_ENABLE_CLOUD,boolean +#MEDIA_DELETE_LOCAL_AFTER_CLOUD="true" + +# @see https://docs.pixelfed.org/technical-documentation/config/#aws_access_key_id +# @dottie/validate required_if=FILESYSTEM_CLOUD s3 +#AWS_ACCESS_KEY_ID="" + +# @see https://docs.pixelfed.org/technical-documentation/config/#aws_secret_access_key +# @dottie/validate required_if=FILESYSTEM_CLOUD s3 +#AWS_SECRET_ACCESS_KEY="" + +# @see https://docs.pixelfed.org/technical-documentation/config/#aws_default_region +# @dottie/validate required_if=FILESYSTEM_CLOUD s3 +#AWS_DEFAULT_REGION="" + +# @see https://docs.pixelfed.org/technical-documentation/config/#aws_bucket +# @dottie/validate required_if=FILESYSTEM_CLOUD s3 +#AWS_BUCKET="" + +# @see https://docs.pixelfed.org/technical-documentation/config/#aws_url +# @dottie/validate required_if=FILESYSTEM_CLOUD s3 +#AWS_URL="" + +# @see https://docs.pixelfed.org/technical-documentation/config/#aws_endpoint +# @dottie/validate required_if=FILESYSTEM_CLOUD s3 +#AWS_ENDPOINT="" + +# @see https://docs.pixelfed.org/technical-documentation/config/#aws_use_path_style_endpoint +# @dottie/validate required_if=FILESYSTEM_CLOUD s3 +#AWS_USE_PATH_STYLE_ENDPOINT="false" + +################################################################################ +# COSTAR +################################################################################ + +# Comma-separated list of domains to block. +# +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_blocked_domains +# @dottie/validate +#CS_BLOCKED_DOMAINS="" + +# Comma-separated list of domains to add warnings. +# +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_cw_domains +# @dottie/validate +#CS_CW_DOMAINS="" + +# Comma-separated list of domains to remove from public timelines. +# +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_unlisted_domains +# @dottie/validate +#CS_UNLISTED_DOMAINS="" + +# Comma-separated list of keywords to block. +# +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_blocked_keywords +# @dottie/validate +#CS_BLOCKED_KEYWORDS="" + +# Comma-separated list of keywords to add warnings. +# +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_cw_keywords +# @dottie/validate +#CS_CW_KEYWORDS="" + +# Comma-separated list of keywords to remove from public timelines. +# +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_unlisted_keywords +# @dottie/validate +#CS_UNLISTED_KEYWORDS="" + +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_blocked_actor +# @dottie/validate +#CS_BLOCKED_ACTOR="" + +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_cw_actor +# @dottie/validate +#CS_CW_ACTOR="" + +# @default null (not set/commented out). +# @see https://docs.pixelfed.org/technical-documentation/config/#cs_unlisted_actor +# @dottie/validate +#CS_UNLISTED_ACTOR="" + +################################################################################ +# logging +################################################################################ + +# Possible values: +# +# - "stack" (default) +# - "single" +# - "daily" +# - "slack" +# - "stderr" +# - "syslog" +# - "errorlog" +# - "null" +# - "emergency" +# - "media" +# +# @default "stack" +# @dottie/validate required,oneof=stack single daily slack stderr syslog errorlog null emergency media +LOG_CHANNEL="stderr" + +# Used by single, stderr and syslog. +# +# @default "debug" +# @see https://docs.pixelfed.org/technical-documentation/config/#log_level +# @dottie/validate required,oneof=debug info notice warning error critical alert emergency +#LOG_LEVEL="debug" + +# Used by stderr. +# +# @default "" +# @see https://docs.pixelfed.org/technical-documentation/config/#log_stderr_formatter +#LOG_STDERR_FORMATTER="" + +# Used by slack. +# +# @default "" +# @see https://docs.pixelfed.org/technical-documentation/config/#log_slack_webhook_url +# @dottie/validate required,http_url +#LOG_SLACK_WEBHOOK_URL="" + +################################################################################ +# queue +################################################################################ + +# Possible values: +# - "sync" (default) +# - "database" +# - "beanstalkd" +# - "sqs" +# - "redis" +# - "null" +# +# @default "sync" +# @see https://docs.pixelfed.org/technical-documentation/config/#queue_driver +# @dottie/validate required,oneof=sync database beanstalkd sqs redis null +QUEUE_DRIVER="redis" + +# @default "your-public-key" +# @see https://docs.pixelfed.org/technical-documentation/config/#sqs_key +# @dottie/validate required_if=QUEUE_DRIVER sqs +#SQS_KEY="your-public-key" + +# @default "your-secret-key" +# @see https://docs.pixelfed.org/technical-documentation/config/#sqs_secret +# @dottie/validate required_if=QUEUE_DRIVER sqs +#SQS_SECRET="your-secret-key" + +# @default "https://sqs.us-east-1.amazonaws.com/your-account-id" +# @see https://docs.pixelfed.org/technical-documentation/config/#sqs_prefix +# @dottie/validate required_if=QUEUE_DRIVER sqs +#SQS_PREFIX="" + +# @default "your-queue-name" +# @see https://docs.pixelfed.org/technical-documentation/config/#sqs_queue +# @dottie/validate required_if=QUEUE_DRIVER sqs +#SQS_QUEUE="your-queue-name" + +# @default "us-east-1" +# @see https://docs.pixelfed.org/technical-documentation/config/#sqs_region +# @dottie/validate required_if=QUEUE_DRIVER sqs +#SQS_REGION="us-east-1" + +################################################################################ +# session +################################################################################ + +# This option controls the default session “driver” that will be used on requests. +# +# By default, we will use the lightweight native driver but you may specify any of the other wonderful drivers provided here. +# +# Possible values: +# - "file" +# - "cookie" +# - "database" (default) +# - "apc" +# - "memcached" +# - "redis" +# - "array" +# +# @default "database" +# @dottie/validate required,oneof=file cookie database apc memcached redis array +SESSION_DRIVER="redis" + +# Here you may specify the number of minutes that you wish the session to be allowed to remain idle before it expires. +# +# If you want them to immediately expire on the browser closing, set that option. +# +# @default 86400. +# @see https://docs.pixelfed.org/technical-documentation/config/#session_lifetime +# @dottie/validate required,number +#SESSION_LIFETIME="86400" + +# Here you may change the domain of the cookie used to identify a session in your application. +# +# This will determine which domains the cookie is available to in your application. +# +# A sensible default has been set. +# +# @default the value of APP_DOMAIN, or null. +# @see https://docs.pixelfed.org/technical-documentation/config/#session_domain +# @dottie/validate required,hostname +#SESSION_DOMAIN="${APP_DOMAIN}" + +################################################################################ +# horizon +################################################################################ + +# This prefix will be used when storing all Horizon data in Redis. +# +# You may modify the prefix when you are running multiple installations +# of Horizon on the same server so that they don’t have problems. +# +# @default "horizon-" +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_prefix +# @dottie/validate required +#HORIZON_PREFIX="horizon-" + +# @default "false" +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_darkmode +# @dottie/validate required,boolean +#HORIZON_DARKMODE="false" + +# This value (in MB) describes the maximum amount of memory (in MB) the Horizon worker +# may consume before it is terminated and restarted. +# +# You should set this value according to the resources available to your server. +# +# @default "64" +# @dottie/validate required,number +#HORIZON_MEMORY_LIMIT="64" + +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_balance_strategy +# @dottie/validate required +#HORIZON_BALANCE_STRATEGY="auto" + +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_min_processes +# @dottie/validate required,number +#HORIZON_MIN_PROCESSES="1" + +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_max_processes +# @dottie/validate required,number +#HORIZON_MAX_PROCESSES="20" + +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_supervisor_memory +# @dottie/validate required,number +#HORIZON_SUPERVISOR_MEMORY="64" + +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_supervisor_tries +# @dottie/validate required,number +#HORIZON_SUPERVISOR_TRIES="3" + +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_supervisor_nice +# @dottie/validate required,number +#HORIZON_SUPERVISOR_NICE="0" + +# @see https://docs.pixelfed.org/technical-documentation/config/#horizon_supervisor_timeout +# @dottie/validate required,number +#HORIZON_SUPERVISOR_TIMEOUT="300" + +################################################################################ +# docker shared +################################################################################ + +# A random 32-character string to be used as an encryption key. +# +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# ! NOTE: This will be auto-generated by Docker during bootstrap +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# +# This key is used by the Illuminate encrypter service and should be set to a random, +# 32 character string, otherwise these encrypted strings will not be safe. +# +# @see https://docs.pixelfed.org/technical-documentation/config/#app_key +# @dottie/validate required APP_KEY= -## General Settings -APP_NAME="Pixelfed Prod" -APP_ENV=production -APP_DEBUG=false -APP_URL=https://real.domain -APP_DOMAIN="real.domain" -ADMIN_DOMAIN="real.domain" -SESSION_DOMAIN="real.domain" +# Prefix for container names (without any dash at the end) +# @dottie/validate required +DOCKER_ALL_CONTAINER_NAME_PREFIX="${APP_DOMAIN}" -OPEN_REGISTRATION=true -ENFORCE_EMAIL_VERIFICATION=false -PF_MAX_USERS=1000 -OAUTH_ENABLED=true +# How often Docker health check should run for all services +# +# Can be overridden by individual [DOCKER_*_HEALTHCHECK_INTERVAL] settings further down +# +# @default "10s" +# @dottie/validate required +DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL="10s" -APP_TIMEZONE=UTC -APP_LOCALE=en +# Path (relative to the docker-compose.yml) or absolute (/some/other/path) where containers will *all* data +# will be stored (data, config, overrides) +# +# @default "./docker-compose-state" +# @dottie/validate required,dir +DOCKER_ALL_HOST_ROOT_PATH="./docker-compose-state" -## Pixelfed Tweaks -LIMIT_ACCOUNT_SIZE=true -MAX_ACCOUNT_SIZE=1000000 -MAX_PHOTO_SIZE=15000 -MAX_AVATAR_SIZE=2000 -MAX_CAPTION_LENGTH=500 -MAX_BIO_LENGTH=125 -MAX_NAME_LENGTH=30 -MAX_ALBUM_LENGTH=4 -IMAGE_QUALITY=80 -PF_OPTIMIZE_IMAGES=true -PF_OPTIMIZE_VIDEOS=true -ADMIN_ENV_EDITOR=false -ACCOUNT_DELETION=true -ACCOUNT_DELETE_AFTER=false -MAX_LINKS_PER_POST=0 +# Path (relative to the docker-compose.yml) or absolute (/some/other/path) where containers will store their data +# +# @default "${DOCKER_ALL_HOST_ROOT_PATH}/data" +# @dottie/validate required,dir +DOCKER_ALL_HOST_DATA_ROOT_PATH="${DOCKER_ALL_HOST_ROOT_PATH:?error}/data" -## Instance -#INSTANCE_DESCRIPTION= -INSTANCE_PUBLIC_HASHTAGS=false -#INSTANCE_CONTACT_EMAIL= -INSTANCE_PUBLIC_LOCAL_TIMELINE=false -#BANNED_USERNAMES= -STORIES_ENABLED=false -RESTRICTED_INSTANCE=false +# Path (relative to the docker-compose.yml) or absolute (/some/other/path) where containers will store their confguration +# +# @default "${DOCKER_ALL_HOST_ROOT_PATH}/config" +# @dottie/validate required,dir +DOCKER_ALL_HOST_CONFIG_ROOT_PATH="${DOCKER_ALL_HOST_ROOT_PATH:?error}/config" -## Mail -MAIL_DRIVER=log -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_FROM_ADDRESS="pixelfed@example.com" -MAIL_FROM_NAME="Pixelfed" -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null +# Path (relative to the docker-compose.yml) or absolute (/some/other/path) where containers will store overrides +# +# @default "${DOCKER_ALL_HOST_ROOT_PATH}/overrides" +# @dottie/validate required,dir +DOCKER_APP_HOST_OVERRIDES_PATH="${DOCKER_ALL_HOST_ROOT_PATH:?error}/overrides" -## Databases (MySQL) -DB_CONNECTION=mysql -DB_DATABASE=pixelfed_prod -DB_HOST=db -DB_PASSWORD=pixelfed_db_pass -DB_PORT=3306 -DB_USERNAME=pixelfed -# pass the same values to the db itself -MYSQL_DATABASE=pixelfed_prod -MYSQL_PASSWORD=pixelfed_db_pass -MYSQL_RANDOM_ROOT_PASSWORD=true -MYSQL_USER=pixelfed +# Set timezone used by *all* containers - these must be in sync. +# +# ! Do not edit your timezone once the service is running - or things will break! +# +# @see https://www.php.net/manual/en/timezones.php +# @dottie/validate required,timezone +TZ="${APP_TIMEZONE}" -## Databases (Postgres) -#DB_CONNECTION=pgsql -#DB_HOST=postgres -#DB_PORT=5432 -#DB_DATABASE=pixelfed -#DB_USERNAME=postgres -#DB_PASSWORD=postgres +################################################################################ +# docker app +################################################################################ -## Cache (Redis) -REDIS_CLIENT=phpredis -REDIS_SCHEME=tcp -REDIS_HOST=redis -REDIS_PASSWORD=redis_password -REDIS_PORT=6379 -REDIS_DATABASE=0 +# The docker tag prefix to use for pulling images, can be one of +# +# * latest +# * +# * staging +# * edge +# * branch- +# * pr- +# +# Combined with [DOCKER_APP_RUNTIME] and [PHP_VERSION] configured +# elsewhere in this file, the final Docker tag is computed. +# @dottie/validate required +DOCKER_APP_RELEASE="branch-jippi-fork" -HORIZON_PREFIX="horizon-" +# The PHP version to use for [web] and [worker] container +# +# Any version published on https://hub.docker.com/_/php should work +# +# Example: +# +# * 8.1 +# * 8.2 +# * 8.2.14 +# * latest +# +# Do *NOT* use the full Docker tag (e.g. "8.3.2RC1-fpm-bullseye") +# *only* the version part. The rest of the full tag is derived from +# the [DOCKER_APP_RUNTIME] and [PHP_DEBIAN_RELEASE] settings +# @dottie/validate required +DOCKER_APP_PHP_VERSION="8.2" -## EXPERIMENTS -EXP_LC=false -EXP_REC=false -EXP_LOOPS=false +# The container runtime to use. +# +# @see https://docs.pixelfed.org/running-pixelfed/docker/runtimes.html +# @dottie/validate required,oneof=apache nginx fpm +DOCKER_APP_RUNTIME="apache" -## ActivityPub Federation -ACTIVITY_PUB=false -AP_REMOTE_FOLLOW=false -AP_SHAREDINBOX=false -AP_INBOX=false -AP_OUTBOX=false -ATOM_FEEDS=true -NODEINFO=true -WEBFINGER=true +# The Debian release variant to use of the [php] Docker image +# +# Examlpe: [bookworm] or [bullseye] +# @dottie/validate required,oneof=bookworm bullseye +DOCKER_APP_DEBIAN_RELEASE="bullseye" -## S3 -FILESYSTEM_CLOUD=s3 -PF_ENABLE_CLOUD=false -#AWS_ACCESS_KEY_ID= -#AWS_SECRET_ACCESS_KEY= -#AWS_DEFAULT_REGION= -#AWS_BUCKET= -#AWS_URL= -#AWS_ENDPOINT= -#AWS_USE_PATH_STYLE_ENDPOINT=false +# The [php] Docker image base type +# +# @see https://docs.pixelfed.org/running-pixelfed/docker/runtimes.html +# @dottie/validate required,oneof=apache fpm cli +DOCKER_APP_BASE_TYPE="apache" -## Horizon -HORIZON_DARKMODE=false +# Image to pull the Pixelfed Docker images from. +# +# Example values: +# +# * "ghcr.io/pixelfed/pixelfed" to pull from GitHub +# * "pixelfed/pixelfed" to pull from DockerHub +# * "your/fork" to pull from a custom fork +# +# @dottie/validate required +DOCKER_APP_IMAGE="ghcr.io/jippi/pixelfed" -## COSTAR - Confirm Object Sentiment Transform and Reduce -PF_COSTAR_ENABLED=false +# Pixelfed version (image tag) to pull from the registry. +# +# @see https://github.com/pixelfed/pixelfed/pkgs/container/pixelfed +# @dottie/validate required +DOCKER_APP_TAG="${DOCKER_APP_RELEASE:?error}-${DOCKER_APP_RUNTIME:?error}-${DOCKER_APP_PHP_VERSION:?error}" -# Media -MEDIA_EXIF_DATABASE=false +# Path (on host system) where the [app] + [worker] container will write +# its [storage] data (e.g uploads/images/profile pictures etc.). +# +# Path is relative (./some/other/path) to the docker-compose.yml or absolute (/some/other/path) +# @dottie/validate required,dir +DOCKER_APP_HOST_STORAGE_PATH="${DOCKER_ALL_HOST_DATA_ROOT_PATH:?error}/pixelfed/storage" -## Logging -LOG_CHANNEL=stderr +# Path (on host system) where the [app] + [worker] container will write +# its [cache] data. +# +# Path is relative (./some/other/path) to the docker-compose.yml or absolute (/some/other/path) +# @dottie/validate required,dir +DOCKER_APP_HOST_CACHE_PATH="${DOCKER_ALL_HOST_DATA_ROOT_PATH:?error}/pixelfed/cache" -## Image -IMAGE_DRIVER=imagick +# Automatically run "One-time setup tasks" commands. +# +# If you are migrating to this docker-compose setup or have manually run the "One time seutp" +# tasks (https://docs.pixelfed.org/running-pixelfed/installation/#setting-up-services) +# you can set this to "0" to prevent them from running. +# +# Otherwise, leave it at "1" to have them run *once*. +# @dottie/validate required,boolean +#DOCKER_APP_RUN_ONE_TIME_SETUP_TASKS="1" -## Broadcasting: log driver for local development -BROADCAST_DRIVER=log +# A space-seperated list of paths (inside the container) to *recursively* [chown] +# to the container user/group id (UID/GID) in case of permission issues. +# +# ! You should *not* leave this on permanently, at it can significantly slow down startup +# ! time for the container, and during normal operations there should never be permission +# ! issues. Please report a bug if you see behavior requiring this to be permanently on +# +# Example: "/var/www/storage /var/www/bootstrap/cache" +# @dottie/validate required +#DOCKER_APP_ENSURE_OWNERSHIP_PATHS="" -## Cache -CACHE_DRIVER=redis +# Enable Docker Entrypoint debug mode (will call [set -x] in bash scripts) +# by setting this to "1" +# @dottie/validate required,boolean +#DOCKER_APP_ENTRYPOINT_DEBUG="0" -## Purify -RESTRICT_HTML_TYPES=true +# Show the "diff" when applying templating to files +# +# @default "1" +# @dottie/validate required,boolean +#DOCKER_APP_ENTRYPOINT_SHOW_TEMPLATE_DIFF="1" -## Queue -QUEUE_DRIVER=redis +# Docker entrypoints that should be skipped on startup +# @default "" +#ENTRYPOINT_SKIP_SCRIPTS="" -## Session -SESSION_DRIVER=redis +# List of extra APT packages (separated by space) to install when building +# locally using [docker compose build]. +# +# @see https://github.com/pixelfed/pixelfed/blob/dev/docker/customizing.md +# @dottie/validate required +#DOCKER_APP_APT_PACKAGES_EXTRA="" -## Trusted Proxy -TRUST_PROXIES="*" +# List of *extra* PECL extensions (separated by space) to install when +# building locally using [docker compose build]. +# +# @see https://github.com/pixelfed/pixelfed/blob/dev/docker/customizing.md +# @dottie/validate required +#DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA="" -## Passport -#PASSPORT_PRIVATE_KEY= -#PASSPORT_PUBLIC_KEY= +# List of *extra* PHP extensions (separated by space) to install when +# building locally using [docker compose build]. +# +# @see https://github.com/pixelfed/pixelfed/blob/dev/docker/customizing.md +# @dottie/validate required +#DOCKER_APP_PHP_EXTENSIONS_EXTRA="" + +# @default "128M" +# @see https://www.php.net/manual/en/ini.core.php#ini.memory-limit +# @dottie/validate required +#DOCKER_APP_PHP_MEMORY_LIMIT="128M" + +# @default "E_ALL & ~E_DEPRECATED & ~E_STRICT" +# @see http://php.net/error-reporting +# @dottie/validate required +#DOCKER_APP_PHP_ERROR_REPORTING="E_ALL & ~E_DEPRECATED & ~E_STRICT" + +# @default "off" +# @see http://php.net/display-errors +# @dottie/validate required,oneof=on off +#DOCKER_APP_PHP_DISPLAY_ERRORS="off" + +# Enables the opcode cache. +# +# When disabled, code is not optimised or cached. +# +# @default "1" +# @see https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.enable +# @dottie/validate required,oneof=0 1 +#DOCKER_APP_PHP_OPCACHE_ENABLE="1" + +# If enabled, OPcache will check for updated scripts every [opcache.revalidate_freq] seconds. +# +# When this directive is disabled, you must reset OPcache manually via opcache_reset(), +# opcache_invalidate() or by restarting the Web server for changes to the filesystem to take effect. +# +# @default "0" +# @see https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.validate-timestamps +# @dottie/validate required,oneof=0 1 +#DOCKER_APP_PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" + +# How often to check script timestamps for updates, in seconds. +# 0 will result in OPcache checking for updates on every request. +# +# @default "2" +# @see https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq +# @dottie/validate required,oneof=0 1 2 +#DOCKER_APP_PHP_OPCACHE_REVALIDATE_FREQ="2" + +################################################################################ +# docker redis +################################################################################ + +# Set this to a non-empty value (e.g. "disabled") to disable the [redis] service +#DOCKER_REDIS_PROFILE= + +# Redis version to use as Docker tag +# +# @see https://hub.docker.com/_/redis +# @dottie/validate required +DOCKER_REDIS_VERSION="7.2" + +# Path (on host system) where the [redis] container will store its data +# +# Path is relative (./some/other/path) to the docker-compose.yml or absolute (/some/other/path) +# @dottie/validate required,dir +DOCKER_REDIS_HOST_DATA_PATH="${DOCKER_ALL_HOST_DATA_ROOT_PATH:?error}/redis" + +# Port that Redis will listen on *outside* the container (e.g. the host machine) +# @dottie/validate required,number +DOCKER_REDIS_HOST_PORT="${REDIS_PORT:?error}" + +# The filename that Redis should store its config file within +# +# NOTE: The file *MUST* exists (even empty) before enabling this setting! +# +# Use a command like [touch "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/redis/redis.conf"] to create it. +# +# @default "" +# @dottie/validate required +#DOCKER_REDIS_CONFIG_FILE="/etc/redis/redis.conf" +# How often Docker health check should run for [redis] service +# +# @default "10s" +# @dottie/validate required +DOCKER_REDIS_HEALTHCHECK_INTERVAL="${DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL:?error}" + +################################################################################ +# docker db +################################################################################ + +# Set this to a non-empty value (e.g. "disabled") to disable the [db] service +#DOCKER_DB_PROFILE= + +# Docker image for the DB service +# @dottie/validate required +DOCKER_DB_IMAGE="mariadb:${DB_VERSION}" + +# Command to pass to the [db] server container +# @dottie/validate required +DOCKER_DB_COMMAND="--default-authentication-plugin=mysql_native_password" + +# Path (on host system) where the [db] container will store its data +# +# Path is relative (./some/other/path) to the docker-compose.yml or absolute (/some/other/path) +# @dottie/validate required,dir +DOCKER_DB_HOST_DATA_PATH="${DOCKER_ALL_HOST_DATA_ROOT_PATH:?error}/db" + +# Path (inside the container) where the [db] will store its data. +# +# Path MUST be absolute. +# +# For MySQL this should be [/var/lib/mysql] +# For PostgreSQL this should be [/var/lib/postgresql/data] +# @dottie/validate required +DOCKER_DB_CONTAINER_DATA_PATH="/var/lib/mysql" + +# Port that the database will listen on *OUTSIDE* the container (e.g. the host machine) +# +# Use "3306" for MySQL/MariaDB and "5432" for PostgreeSQL +# @dottie/validate required,number +DOCKER_DB_HOST_PORT="${DB_PORT:?error}" + +# Port that the database will listen on *INSIDE* the container +# +# Use "3306" for MySQL/MariaDB and "5432" for PostgreeSQL +# @dottie/validate required,number +DOCKER_DB_CONTAINER_PORT="${DB_PORT:?error}" + +# How often Docker health check should run for [db] service +# @dottie/validate required +DOCKER_DB_HEALTHCHECK_INTERVAL="${DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL:?error}" + +################################################################################ +# docker web +################################################################################ + +# Set this to a non-empty value (e.g. "disabled") to disable the [web] service +#DOCKER_WEB_PROFILE="" + +# Port to expose [web] container will listen on *outside* the container (e.g. the host machine) for *HTTP* traffic only +# @dottie/validate required,number +DOCKER_WEB_PORT_EXTERNAL_HTTP="8080" + +# How often Docker health check should run for [web] service +# @dottie/validate required +DOCKER_WEB_HEALTHCHECK_INTERVAL="${DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL:?error}" + +################################################################################ +# docker worker +################################################################################ + +# Set this to a non-empty value (e.g. "disabled") to disable the [worker] service +#DOCKER_WORKER_PROFILE="" + +# How often Docker health check should run for [worker] service +# @dottie/validate required +DOCKER_WORKER_HEALTHCHECK_INTERVAL="${DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL:?error}" + +################################################################################ +# docker proxy +################################################################################ + +# Set this to a non-empty value (e.g. "disabled") to disable the [proxy] and [proxy-acme] service +#DOCKER_PROXY_PROFILE= + +# Set this to a non-empty value (e.g. "disabled") to disable the [proxy-acme] service +#DOCKER_PROXY_ACME_PROFILE="${DOCKER_PROXY_PROFILE:-}" + +# The version of nginx-proxy to use +# +# @see https://hub.docker.com/r/nginxproxy/nginx-proxy +# @dottie/validate required +DOCKER_PROXY_VERSION="1.4" + +# How often Docker health check should run for [proxy] service +# @dottie/validate required +DOCKER_PROXY_HEALTHCHECK_INTERVAL="${DOCKER_ALL_DEFAULT_HEALTHCHECK_INTERVAL:?error}" + +# Port that the [proxy] will listen on *outside* the container (e.g. the host machine) for HTTP traffic +# @dottie/validate required,number +DOCKER_PROXY_HOST_PORT_HTTP="80" + +# Port that the [proxy] will listen on *outside* the container (e.g. the host machine) for HTTPS traffic +# @dottie/validate required,number +DOCKER_PROXY_HOST_PORT_HTTPS="443" + +# Path to the Docker socket on the *host* +# @dottie/validate required,file +DOCKER_PROXY_HOST_DOCKER_SOCKET_PATH="/var/run/docker.sock" + +# The host to request LetsEncrypt certificate for +# @dottie/validate required,fqdn +DOCKER_PROXY_LETSENCRYPT_HOST="${APP_DOMAIN}" + +# The e-mail to use for Lets Encrypt certificate requests. +# @dottie/validate required,email +DOCKER_PROXY_LETSENCRYPT_EMAIL="${INSTANCE_CONTACT_EMAIL:?error}" + +# Lets Encrypt staging/test servers for certificate requests. +# +# Setting this to any value will change to letsencrypt test servers. +#DOCKER_PROXY_LETSENCRYPT_TEST="1" diff --git a/.env.example b/.env.example deleted file mode 100644 index d4d7228d1..000000000 --- a/.env.example +++ /dev/null @@ -1,78 +0,0 @@ -APP_NAME="Pixelfed" -APP_ENV="production" -APP_KEY= -APP_DEBUG="false" - -# Instance Configuration -OPEN_REGISTRATION="false" -ENFORCE_EMAIL_VERIFICATION="false" -PF_MAX_USERS="1000" -OAUTH_ENABLED="true" - -# Media Configuration -PF_OPTIMIZE_IMAGES="true" -IMAGE_QUALITY="80" -MAX_PHOTO_SIZE="15000" -MAX_CAPTION_LENGTH="500" -MAX_ALBUM_LENGTH="4" - -# Instance URL Configuration -APP_URL="http://localhost" -APP_DOMAIN="localhost" -ADMIN_DOMAIN="localhost" -SESSION_DOMAIN="localhost" -TRUST_PROXIES="*" - -# Database Configuration -DB_CONNECTION="mysql" -DB_HOST="127.0.0.1" -DB_PORT="3306" -DB_DATABASE="pixelfed" -DB_USERNAME="pixelfed" -DB_PASSWORD="pixelfed" - -# Redis Configuration -REDIS_CLIENT="predis" -REDIS_SCHEME="tcp" -REDIS_HOST="127.0.0.1" -REDIS_PASSWORD="null" -REDIS_PORT="6379" - -# Laravel Configuration -SESSION_DRIVER="database" -CACHE_DRIVER="redis" -QUEUE_DRIVER="redis" -BROADCAST_DRIVER="log" -LOG_CHANNEL="stack" -HORIZON_PREFIX="horizon-" - -# ActivityPub Configuration -ACTIVITY_PUB="false" -AP_REMOTE_FOLLOW="false" -AP_INBOX="false" -AP_OUTBOX="false" -AP_SHAREDINBOX="false" - -# Experimental Configuration -EXP_EMC="true" - -## Mail Configuration (Post-Installer) -MAIL_DRIVER=log -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS="pixelfed@example.com" -MAIL_FROM_NAME="Pixelfed" - -## S3 Configuration (Post-Installer) -PF_ENABLE_CLOUD=false -FILESYSTEM_CLOUD=s3 -#AWS_ACCESS_KEY_ID= -#AWS_SECRET_ACCESS_KEY= -#AWS_DEFAULT_REGION= -#AWS_BUCKET= -#AWS_URL= -#AWS_ENDPOINT= -#AWS_USE_PATH_STYLE_ENDPOINT=false diff --git a/.env.testing b/.env.testing index 258d8d740..63209d91b 100644 --- a/.env.testing +++ b/.env.testing @@ -1,3 +1,5 @@ +# shellcheck disable=SC2034,SC2148 + APP_NAME="Pixelfed Test" APP_ENV=local APP_KEY=base64:lwX95GbNWX3XsucdMe0XwtOKECta3h/B+p9NbH2jd0E= @@ -62,8 +64,8 @@ CS_BLOCKED_DOMAINS='example.org,example.net,example.com' CS_CW_DOMAINS='example.org,example.net,example.com' CS_UNLISTED_DOMAINS='example.org,example.net,example.com' -## Optional +## Optional #HORIZON_DARKMODE=false # Horizon theme darkmode -#HORIZON_EMBED=false # Single Docker Container mode +#HORIZON_EMBED=false # Single Docker Container mode ENABLE_CONFIG_CACHE=false diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml deleted file mode 100644 index 34f31cf08..000000000 --- a/.github/workflows/build-docker.yml +++ /dev/null @@ -1,125 +0,0 @@ ---- -name: Build Docker image - -on: - workflow_dispatch: - push: - branches: - - dev - tags: - - '*' - pull_request: - paths: - - .github/workflows/build-docker.yml - - contrib/docker/Dockerfile.apache - - contrib/docker/Dockerfile.fpm -permissions: - contents: read - -jobs: - build-docker-apache: - runs-on: ubuntu-latest - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Docker Lint - uses: hadolint/hadolint-action@v3.0.0 - with: - dockerfile: contrib/docker/Dockerfile.apache - failure-threshold: error - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - secrets: inherit - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} - if: github.event_name != 'pull_request' - - - name: Fetch tags - uses: docker/metadata-action@v4 - secrets: inherit - id: meta - with: - images: ${{ secrets.DOCKER_HUB_ORGANISATION }}/pixelfed - flavor: | - latest=auto - suffix=-apache - tags: | - type=edge,branch=dev - type=pep440,pattern={{raw}} - type=pep440,pattern=v{{major}}.{{minor}} - type=ref,event=pr - - - name: Build and push Docker image - uses: docker/build-push-action@v3 - with: - context: . - file: contrib/docker/Dockerfile.apache - platforms: linux/amd64,linux/arm64 - builder: ${{ steps.buildx.outputs.name }} - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max - - build-docker-fpm: - runs-on: ubuntu-latest - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Docker Lint - uses: hadolint/hadolint-action@v3.0.0 - with: - dockerfile: contrib/docker/Dockerfile.fpm - failure-threshold: error - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - secrets: inherit - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} - if: github.event_name != 'pull_request' - - - name: Fetch tags - uses: docker/metadata-action@v4 - secrets: inherit - id: meta - with: - images: ${{ secrets.DOCKER_HUB_ORGANISATION }}/pixelfed - flavor: | - suffix=-fpm - tags: | - type=edge,branch=dev - type=pep440,pattern={{raw}} - type=pep440,pattern=v{{major}}.{{minor}} - type=ref,event=pr - - - name: Build and push Docker image - uses: docker/build-push-action@v3 - with: - context: . - file: contrib/docker/Dockerfile.fpm - platforms: linux/amd64,linux/arm64 - builder: ${{ steps.buildx.outputs.name }} - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..8fdea53a1 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,230 @@ +--- +name: Docker + +on: + # See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + + # See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push + push: + branches: + - dev + - staging + tags: + - "*" + + # See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request + pull_request: + types: + - opened + - reopened + - synchronize + +jobs: + lint: + name: hadolint + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Docker Lint + uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + failure-threshold: error + + shellcheck: + name: ShellCheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + env: + SHELLCHECK_OPTS: --shell=bash --external-sources + with: + version: v0.9.0 + additional_files: "*.envsh .env .env.docker .env.example .env.testing" + + bats: + name: Bats Testing + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run bats + run: docker run -v "$PWD:/var/www" bats/bats:latest /var/www/tests/bats + + build: + name: Build, Test, and Push + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + # See: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs + matrix: + php_version: + - 8.2 + - 8.3 + target_runtime: + - apache + - fpm + - nginx + php_base: + - apache + - fpm + + # See: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#excluding-matrix-configurations + # See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixexclude + exclude: + # targeting [apache] runtime with [fpm] base type doesn't make sense + - target_runtime: apache + php_base: fpm + + # targeting [fpm] runtime with [apache] base type doesn't make sense + - target_runtime: fpm + php_base: apache + + # targeting [nginx] runtime with [apache] base type doesn't make sense + - target_runtime: nginx + php_base: apache + + # See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-concurrency-and-the-default-behavior + concurrency: + group: docker-build-${{ github.ref }}-${{ matrix.php_base }}-${{ matrix.php_version }}-${{ matrix.target_runtime }} + cancel-in-progress: true + + permissions: + contents: read + packages: write + + env: + # Set the repo variable [DOCKER_HUB_USERNAME] to override the default + # at https://github.com///settings/variables/actions + DOCKER_HUB_USERNAME: ${{ vars.DOCKER_HUB_USERNAME || 'pixelfed' }} + + # Set the repo variable [DOCKER_HUB_ORGANISATION] to override the default + # at https://github.com///settings/variables/actions + DOCKER_HUB_ORGANISATION: ${{ vars.DOCKER_HUB_ORGANISATION || 'pixelfed' }} + + # Set the repo variable [DOCKER_HUB_REPO] to override the default + # at https://github.com///settings/variables/actions + DOCKER_HUB_REPO: ${{ vars.DOCKER_HUB_REPO || 'pixelfed' }} + + # For Docker Hub pushing to work, you need the secret [DOCKER_HUB_TOKEN] + # set to your Personal Access Token at https://github.com///settings/secrets/actions + # + # ! NOTE: no [login] or [push] will happen to Docker Hub until this secret is set! + HAS_DOCKER_HUB_CONFIGURED: ${{ secrets.DOCKER_HUB_TOKEN != '' }} + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + id: buildx + with: + version: v0.12.0 # *or* newer, needed for annotations to work + + # See: https://github.com/docker/login-action?tab=readme-ov-file#github-container-registry + - name: Log in to the GitHub Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # See: https://github.com/docker/login-action?tab=readme-ov-file#docker-hub + - name: Login to Docker Hub registry (conditionally) + if: ${{ env.HAS_DOCKER_HUB_CONFIGURED == true }} + uses: docker/login-action@v3 + with: + username: ${{ env.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Docker meta + uses: docker/metadata-action@v5 + id: meta + with: + images: | + name=ghcr.io/${{ github.repository }},enable=true + name=${{ env.DOCKER_HUB_ORGANISATION }}/${{ env.DOCKER_HUB_REPO }},enable=${{ env.HAS_DOCKER_HUB_CONFIGURED }} + flavor: | + latest=auto + suffix=-${{ matrix.target_runtime }}-${{ matrix.php_version }} + tags: | + type=raw,value=dev,enable=${{ github.ref == format('refs/heads/{0}', 'dev') }} + type=raw,value=staging,enable=${{ github.ref == format('refs/heads/{0}', 'staging') }} + type=pep440,pattern={{raw}} + type=pep440,pattern=v{{major}}.{{minor}} + type=ref,event=branch,prefix=branch- + type=ref,event=pr,prefix=pr- + type=ref,event=tag + env: + DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index + + - name: Docker meta (Cache) + uses: docker/metadata-action@v5 + id: cache + with: + images: | + name=ghcr.io/${{ github.repository }}-cache,enable=true + name=${{ env.DOCKER_HUB_ORGANISATION }}/${{ env.DOCKER_HUB_REPO }}-cache,enable=${{ env.HAS_DOCKER_HUB_CONFIGURED }} + flavor: | + latest=auto + suffix=-${{ matrix.target_runtime }}-${{ matrix.php_version }} + tags: | + type=raw,value=dev,enable=${{ github.ref == format('refs/heads/{0}', 'dev') }} + type=raw,value=staging,enable=${{ github.ref == format('refs/heads/{0}', 'staging') }} + type=pep440,pattern={{raw}} + type=pep440,pattern=v{{major}}.{{minor}} + type=ref,event=branch,prefix=branch- + type=ref,event=pr,prefix=pr- + type=ref,event=tag + env: + DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile + target: ${{ matrix.target_runtime }}-runtime + platforms: linux/amd64,linux/arm64 + builder: ${{ steps.buildx.outputs.name }} + tags: ${{ steps.meta.outputs.tags }} + annotations: ${{ steps.meta.outputs.annotations }} + push: true + sbom: true + provenance: true + build-args: | + PHP_VERSION=${{ matrix.php_version }} + PHP_BASE_TYPE=${{ matrix.php_base }} + cache-from: | + type=gha,scope=${{ matrix.target_runtime }}-${{ matrix.php_base }}-${{ matrix.php_version }} + cache-to: | + type=gha,mode=max,scope=${{ matrix.target_runtime }}-${{ matrix.php_base }}-${{ matrix.php_version }} + ${{ steps.cache.outputs.tags }} + + # goss validate the image + # + # See: https://github.com/goss-org/goss + - uses: e1himself/goss-installation-action@v1 + with: + version: "v0.4.4" + - name: Execute Goss tests + run: | + dgoss run \ + -v "./.env.testing:/var/www/.env" \ + -e "EXPECTED_PHP_VERSION=${{ matrix.php_version }}" \ + -e "PHP_BASE_TYPE=${{ matrix.php_base }}" \ + ${{ steps.meta.outputs.tags }} diff --git a/.gitignore b/.gitignore index 0494cee10..8a37ec621 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,31 @@ +.DS_Store +/.bash_history +/.bash_profile +/.bashrc +/.composer +/.env +/.env.dottie-backup +#/.git +/.git-credentials +/.gitconfig +#/.gitignore +/.idea +/.vagrant +/bootstrap/cache +/docker-compose-state/ +/Homestead.json +/Homestead.yaml /node_modules +/npm-debug.log /public/hot /public/storage +/public/vendor/horizon /storage/*.key +/storage/docker /vendor -/.idea -/.vscode -/.vagrant -/docker-volumes -Homestead.json -Homestead.yaml -npm-debug.log -yarn-error.log -.env -.DS_Store -.bash_profile -.bash_history -.bashrc -.gitconfig -.git-credentials -/.composer/ -/nginx.conf +/yarn-error.log +/public/build + +# Exceptions - these *MUST* be last +!/bootstrap/cache/.gitignore +!/public/vendor/horizon/.gitignore diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 000000000..cbb62ca47 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,5 @@ +ignored: + - DL3002 # warning: Last USER should not be root + - DL3008 # warning: Pin versions in apt get install. Instead of `apt-get install ` use `apt-get install =` + - SC2046 # warning: Quote this to prevent word splitting. + - SC2086 # info: Double quote to prevent globbing and word splitting. diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 000000000..cf98a0902 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD013": false, + "MD014": false +} diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 000000000..be92f81fc --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,12 @@ +# See: https://github.com/koalaman/shellcheck/blob/master/shellcheck.1.md#rc-files + +source-path=SCRIPTDIR + +# Allow opening any 'source'd file, even if not specified as input +external-sources=true + +# Turn on warnings for unquoted variables with safe values +enable=quote-safe-variables + +# Turn on warnings for unassigned uppercase variables +enable=check-unassigned-uppercase diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..128e0a295 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,14 @@ +{ + "recommendations": [ + "foxundermoon.shell-format", + "timonwong.shellcheck", + "jetmartin.bats", + "aaron-bond.better-comments", + "streetsidesoftware.code-spell-checker", + "editorconfig.editorconfig", + "github.vscode-github-actions", + "bmewburn.vscode-intelephense-client", + "redhat.vscode-yaml", + "ms-azuretools.vscode-docker" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..6446fb6f5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,21 @@ +{ + "shellformat.useEditorConfig": true, + "[shellscript]": { + "files.eol": "\n", + "editor.defaultFormatter": "foxundermoon.shell-format" + }, + "[yaml]": { + "editor.defaultFormatter": "redhat.vscode-yaml" + }, + "[dockercompose]": { + "editor.defaultFormatter": "redhat.vscode-yaml", + "editor.autoIndent": "advanced", + }, + "yaml.schemas": { + "https://json.schemastore.org/composer": "https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json" + }, + "files.associations": { + ".env": "shellscript", + ".env.*": "shellscript" + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index ab228964f..401d67041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,17 @@ # Release Notes -## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.11.12...dev) +## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.11.13...dev) +- ([](https://github.com/pixelfed/pixelfed/commit/)) + +## [v0.11.13 (2024-03-05)](https://github.com/pixelfed/pixelfed/compare/v0.11.12...v0.11.13) ### Features +- Account Migrations ([#4968](https://github.com/pixelfed/pixelfed/pull/4968)) ([4a6be6212](https://github.com/pixelfed/pixelfed/pull/4968/commits/4a6be6212)) - Curated Onboarding ([#4946](https://github.com/pixelfed/pixelfed/pull/4946)) ([8dac2caf](https://github.com/pixelfed/pixelfed/commit/8dac2caf)) - Add Curated Onboarding Templates ([071163b4](https://github.com/pixelfed/pixelfed/commit/071163b4)) - Add Remote Reports to Admin Dashboard Reports page ([ef0ff78e](https://github.com/pixelfed/pixelfed/commit/ef0ff78e)) +- Improved Docker Support ([#4844](https://github.com/pixelfed/pixelfed/pull/4844)) ([d92cf7f](https://github.com/pixelfed/pixelfed/commit/d92cf7f)) ### Updates @@ -31,8 +36,9 @@ - Update ApiV1Controller, fix public timeline scope, properly support both local + remote parameters ([d6eac655](https://github.com/pixelfed/pixelfed/commit/d6eac655)) - Update ApiV1Controller, handle public feed parameter bug to gracefully fallback to min_id=1 when max_id=0 ([e3826c58](https://github.com/pixelfed/pixelfed/commit/e3826c58)) - Update ApiV1Controller, fix hashtag feed to include private posts from accounts you follow or your own, and your own unlisted posts ([3b5500b3](https://github.com/pixelfed/pixelfed/commit/3b5500b3)) -- ([](https://github.com/pixelfed/pixelfed/commit/)) -- ([](https://github.com/pixelfed/pixelfed/commit/)) +- Update checkpoint view, improve input autocomplete. Fixes ([#4959](https://github.com/pixelfed/pixelfed/pull/4959)) ([d18824e7](https://github.com/pixelfed/pixelfed/commit/d18824e7)) +- Update navbar.vue, removes the 50px limit ([#4969](https://github.com/pixelfed/pixelfed/pull/4969)) ([7fd5599](https://github.com/pixelfed/pixelfed/commit/7fd5599)) +- Update ComposeModal.vue, add an informative UI error message when trying to create a mixed media album ([#4886](https://github.com/pixelfed/pixelfed/pull/4886)) ([fd4f41a](https://github.com/pixelfed/pixelfed/commit/fd4f41a)) ## [v0.11.12 (2024-02-16)](https://github.com/pixelfed/pixelfed/compare/v0.11.11...v0.11.12) diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 000000000..69a06cf87 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,18 @@ +# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners + +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +* @dansup + +# Docker related files +.editorconfig @jippi @dansup +.env @jippi @dansup +.env.* @jippi @dansup +.hadolint.yaml @jippi @dansup +.shellcheckrc @jippi @dansup +/.github/ @jippi @dansup +/docker/ @jippi @dansup +/tests/ @jippi @dansup +docker-compose.migrate.yml @jippi @dansup +docker-compose.yml @jippi @dansup +goss.yaml @jippi @dansup diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..a6ad884b8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,307 @@ +# syntax=docker/dockerfile:1 +# See https://hub.docker.com/r/docker/dockerfile + +####################################################### +# Configuration +####################################################### + +# See: https://github.com/mlocati/docker-php-extension-installer +ARG DOCKER_PHP_EXTENSION_INSTALLER_VERSION="2.1.80" + +# See: https://github.com/composer/composer +ARG COMPOSER_VERSION="2.6" + +# See: https://nginx.org/ +ARG NGINX_VERSION="1.25.3" + +# See: https://github.com/ddollar/forego +ARG FOREGO_VERSION="0.17.2" + +# See: https://github.com/hairyhenderson/gomplate +ARG GOMPLATE_VERSION="v3.11.6" + +# See: https://github.com/jippi/dottie +ARG DOTTIE_VERSION="v0.9.5" + +### +# PHP base configuration +### + +# See: https://hub.docker.com/_/php/tags +ARG PHP_VERSION="8.1" + +# See: https://github.com/docker-library/docs/blob/master/php/README.md#image-variants +ARG PHP_BASE_TYPE="apache" +ARG PHP_DEBIAN_RELEASE="bullseye" + +ARG RUNTIME_UID=33 # often called 'www-data' +ARG RUNTIME_GID=33 # often called 'www-data' + +# APT extra packages +ARG APT_PACKAGES_EXTRA= + +# Extensions installed via [pecl install] +# ! NOTE: imagick is installed from [master] branch on GitHub due to 8.3 bug on ARM that haven't +# ! been released yet (after +10 months)! +# ! See: https://github.com/Imagick/imagick/pull/641 +ARG PHP_PECL_EXTENSIONS="redis https://codeload.github.com/Imagick/imagick/tar.gz/28f27044e435a2b203e32675e942eb8de620ee58" +ARG PHP_PECL_EXTENSIONS_EXTRA= + +# Extensions installed via [docker-php-ext-install] +ARG PHP_EXTENSIONS="intl bcmath zip pcntl exif curl gd" +ARG PHP_EXTENSIONS_EXTRA="" +ARG PHP_EXTENSIONS_DATABASE="pdo_pgsql pdo_mysql pdo_sqlite" + +# GPG key for nginx apt repository +ARG NGINX_GPGKEY="573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62" + +# GPP key path for nginx apt repository +ARG NGINX_GPGKEY_PATH="/usr/share/keyrings/nginx-archive-keyring.gpg" + +####################################################### +# Docker "copy from" images +####################################################### + +# Composer docker image from Docker Hub +# +# NOTE: Docker will *not* pull this image unless it's referenced (via build target) +FROM composer:${COMPOSER_VERSION} AS composer-image + +# php-extension-installer image from Docker Hub +# +# NOTE: Docker will *not* pull this image unless it's referenced (via build target) +FROM mlocati/php-extension-installer:${DOCKER_PHP_EXTENSION_INSTALLER_VERSION} AS php-extension-installer + +# nginx webserver from Docker Hub. +# Used to copy some docker-entrypoint files for [nginx-runtime] +# +# NOTE: Docker will *not* pull this image unless it's referenced (via build target) +FROM nginx:${NGINX_VERSION} AS nginx-image + +# Forego is a Procfile "runner" that makes it trival to run multiple +# processes under a simple init / PID 1 process. +# +# NOTE: Docker will *not* pull this image unless it's referenced (via build target) +# +# See: https://github.com/nginx-proxy/forego +FROM nginxproxy/forego:${FOREGO_VERSION}-debian AS forego-image + +# Dottie makes working with .env files easier and safer +# +# NOTE: Docker will *not* pull this image unless it's referenced (via build target) +# +# See: https://github.com/jippi/dottie +FROM ghcr.io/jippi/dottie:${DOTTIE_VERSION} AS dottie-image + +# gomplate-image grabs the gomplate binary from GitHub releases +# +# It's in its own layer so it can be fetched in parallel with other build steps +FROM php:${PHP_VERSION}-${PHP_BASE_TYPE}-${PHP_DEBIAN_RELEASE} AS gomplate-image + +ARG TARGETARCH +ARG TARGETOS +ARG GOMPLATE_VERSION + +RUN set -ex \ + && curl \ + --silent \ + --show-error \ + --location \ + --output /usr/local/bin/gomplate \ + https://github.com/hairyhenderson/gomplate/releases/download/${GOMPLATE_VERSION}/gomplate_${TARGETOS}-${TARGETARCH} \ + && chmod +x /usr/local/bin/gomplate \ + && /usr/local/bin/gomplate --version + +####################################################### +# Base image +####################################################### + +FROM php:${PHP_VERSION}-${PHP_BASE_TYPE}-${PHP_DEBIAN_RELEASE} AS base + +ARG BUILDKIT_SBOM_SCAN_STAGE="true" + +ARG APT_PACKAGES_EXTRA +ARG PHP_DEBIAN_RELEASE +ARG PHP_VERSION +ARG RUNTIME_GID +ARG RUNTIME_UID +ARG TARGETPLATFORM + +ENV DEBIAN_FRONTEND="noninteractive" + +# Ensure we run all scripts through 'bash' rather than 'sh' +SHELL ["/bin/bash", "-c"] + +RUN set -ex \ + && mkdir -pv /var/www/ \ + && chown -R ${RUNTIME_UID}:${RUNTIME_GID} /var/www + +WORKDIR /var/www/ + +ENV APT_PACKAGES_EXTRA=${APT_PACKAGES_EXTRA} + +# Install and configure base layer +COPY docker/shared/root/docker/install/base.sh /docker/install/base.sh + +RUN --mount=type=cache,id=pixelfed-apt-${PHP_VERSION}-${PHP_DEBIAN_RELEASE}-${TARGETPLATFORM},sharing=locked,target=/var/lib/apt \ + --mount=type=cache,id=pixelfed-apt-cache-${PHP_VERSION}-${PHP_DEBIAN_RELEASE}-${TARGETPLATFORM},sharing=locked,target=/var/cache/apt \ + /docker/install/base.sh + +####################################################### +# PHP: extensions +####################################################### + +FROM base AS php-extensions + +ARG PHP_DEBIAN_RELEASE +ARG PHP_EXTENSIONS +ARG PHP_EXTENSIONS_DATABASE +ARG PHP_EXTENSIONS_EXTRA +ARG PHP_PECL_EXTENSIONS +ARG PHP_PECL_EXTENSIONS_EXTRA +ARG PHP_VERSION +ARG TARGETPLATFORM + +COPY --from=php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ + +COPY docker/shared/root/docker/install/php-extensions.sh /docker/install/php-extensions.sh + +RUN --mount=type=cache,id=pixelfed-pear-${PHP_VERSION}-${PHP_DEBIAN_RELEASE}-${TARGETPLATFORM},sharing=locked,target=/tmp/pear \ + --mount=type=cache,id=pixelfed-apt-${PHP_VERSION}-${PHP_DEBIAN_RELEASE}-${TARGETPLATFORM},sharing=locked,target=/var/lib/apt \ + --mount=type=cache,id=pixelfed-apt-cache-${PHP_VERSION}-${PHP_DEBIAN_RELEASE}-${TARGETPLATFORM},sharing=locked,target=/var/cache/apt \ + PHP_EXTENSIONS=${PHP_EXTENSIONS} \ + PHP_EXTENSIONS_DATABASE=${PHP_EXTENSIONS_DATABASE} \ + PHP_EXTENSIONS_EXTRA=${PHP_EXTENSIONS_EXTRA} \ + PHP_PECL_EXTENSIONS=${PHP_PECL_EXTENSIONS} \ + PHP_PECL_EXTENSIONS_EXTRA=${PHP_PECL_EXTENSIONS_EXTRA} \ + /docker/install/php-extensions.sh + +####################################################### +# PHP: composer and source code +####################################################### + +FROM php-extensions AS composer-and-src + +ARG PHP_VERSION +ARG PHP_DEBIAN_RELEASE +ARG RUNTIME_UID +ARG RUNTIME_GID +ARG TARGETPLATFORM + +# Make sure composer cache is targeting our cache mount later +ENV COMPOSER_CACHE_DIR="/cache/composer" + +# Don't enforce any memory limits for composer +ENV COMPOSER_MEMORY_LIMIT=-1 + +# Disable interactvitity from composer +ENV COMPOSER_NO_INTERACTION=1 + +# Copy composer from https://hub.docker.com/_/composer +COPY --link --from=composer-image /usr/bin/composer /usr/bin/composer + +#! Changing user to runtime user +USER ${RUNTIME_UID}:${RUNTIME_GID} + +# Install composer dependencies +# NOTE: we skip the autoloader generation here since we don't have all files avaliable (yet) +RUN --mount=type=cache,id=pixelfed-composer-${PHP_VERSION},sharing=locked,target=/cache/composer \ + --mount=type=bind,source=composer.json,target=/var/www/composer.json \ + --mount=type=bind,source=composer.lock,target=/var/www/composer.lock \ + set -ex \ + && composer install --prefer-dist --no-autoloader --ignore-platform-reqs + +# Copy all other files over +COPY --chown=${RUNTIME_UID}:${RUNTIME_GID} . /var/www/ + +####################################################### +# Runtime: base +####################################################### + +FROM php-extensions AS shared-runtime + +ARG RUNTIME_GID +ARG RUNTIME_UID + +ENV RUNTIME_UID=${RUNTIME_UID} +ENV RUNTIME_GID=${RUNTIME_GID} + +COPY --link --from=forego-image /usr/local/bin/forego /usr/local/bin/forego +COPY --link --from=dottie-image /dottie /usr/local/bin/dottie +COPY --link --from=gomplate-image /usr/local/bin/gomplate /usr/local/bin/gomplate +COPY --link --from=composer-image /usr/bin/composer /usr/bin/composer +COPY --link --from=composer-and-src --chown=${RUNTIME_UID}:${RUNTIME_GID} /var/www /var/www + +#! Changing user to runtime user +USER ${RUNTIME_UID}:${RUNTIME_GID} + +# Generate optimized autoloader now that we have all files around +RUN set -ex \ + && composer dump-autoload --optimize + +USER root + +# for detail why storage is copied this way, pls refer to https://github.com/pixelfed/pixelfed/pull/2137#discussion_r434468862 +RUN set -ex \ + && cp --recursive --link --preserve=all storage storage.skel \ + && rm -rf html && ln -s public html + +COPY docker/shared/root / + +ENTRYPOINT ["/docker/entrypoint.sh"] + +####################################################### +# Runtime: apache +####################################################### + +FROM shared-runtime AS apache-runtime + +COPY docker/apache/root / + +RUN set -ex \ + && a2enmod rewrite remoteip proxy proxy_http \ + && a2enconf remoteip + +CMD ["apache2-foreground"] + +####################################################### +# Runtime: fpm +####################################################### + +FROM shared-runtime AS fpm-runtime + +COPY docker/fpm/root / + +CMD ["php-fpm"] + +####################################################### +# Runtime: nginx +####################################################### + +FROM shared-runtime AS nginx-runtime + +ARG NGINX_GPGKEY +ARG NGINX_GPGKEY_PATH +ARG NGINX_VERSION +ARG PHP_DEBIAN_RELEASE +ARG PHP_VERSION +ARG TARGETPLATFORM + +# Install nginx dependencies +RUN --mount=type=cache,id=pixelfed-apt-lists-${PHP_VERSION}-${PHP_DEBIAN_RELEASE}-${TARGETPLATFORM},sharing=locked,target=/var/lib/apt/lists \ + --mount=type=cache,id=pixelfed-apt-cache-${PHP_VERSION}-${PHP_DEBIAN_RELEASE}-${TARGETPLATFORM},sharing=locked,target=/var/cache/apt \ + set -ex \ + && gpg1 --keyserver "hkp://keyserver.ubuntu.com:80" --keyserver-options timeout=10 --recv-keys "${NGINX_GPGKEY}" \ + && gpg1 --export "$NGINX_GPGKEY" > "$NGINX_GPGKEY_PATH" \ + && echo "deb [signed-by=${NGINX_GPGKEY_PATH}] https://nginx.org/packages/mainline/debian/ ${PHP_DEBIAN_RELEASE} nginx" >> /etc/apt/sources.list.d/nginx.list \ + && apt-get update \ + && apt-get install -y --no-install-recommends nginx=${NGINX_VERSION}* + +# copy docker entrypoints from the *real* nginx image directly +COPY --link --from=nginx-image /docker-entrypoint.d /docker/entrypoint.d/ +COPY docker/nginx/root / +COPY docker/nginx/Procfile . + +STOPSIGNAL SIGQUIT + +CMD ["forego", "start", "-r"] diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 7953ea783..dcee73ee1 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -25,31 +25,32 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - $schedule->command('media:optimize')->hourlyAt(40); - $schedule->command('media:gc')->hourlyAt(5); - $schedule->command('horizon:snapshot')->everyFiveMinutes(); - $schedule->command('story:gc')->everyFiveMinutes(); - $schedule->command('gc:failedjobs')->dailyAt(3); - $schedule->command('gc:passwordreset')->dailyAt('09:41'); - $schedule->command('gc:sessions')->twiceDaily(13, 23); + $schedule->command('media:optimize')->hourlyAt(40)->onOneServer(); + $schedule->command('media:gc')->hourlyAt(5)->onOneServer(); + $schedule->command('horizon:snapshot')->everyFiveMinutes()->onOneServer(); + $schedule->command('story:gc')->everyFiveMinutes()->onOneServer(); + $schedule->command('gc:failedjobs')->dailyAt(3)->onOneServer(); + $schedule->command('gc:passwordreset')->dailyAt('09:41')->onOneServer(); + $schedule->command('gc:sessions')->twiceDaily(13, 23)->onOneServer(); - if(in_array(config_cache('pixelfed.cloud_storage'), ['1', true, 'true']) && config('media.delete_local_after_cloud')) { + if (in_array(config_cache('pixelfed.cloud_storage'), ['1', true, 'true']) && config('media.delete_local_after_cloud')) { $schedule->command('media:s3gc')->hourlyAt(15); } - if(config('import.instagram.enabled')) { - $schedule->command('app:transform-imports')->everyTenMinutes(); - $schedule->command('app:import-upload-garbage-collection')->hourlyAt(51); - $schedule->command('app:import-remove-deleted-accounts')->hourlyAt(37); - $schedule->command('app:import-upload-clean-storage')->twiceDailyAt(1, 13, 32); + if (config('import.instagram.enabled')) { + $schedule->command('app:transform-imports')->everyTenMinutes()->onOneServer(); + $schedule->command('app:import-upload-garbage-collection')->hourlyAt(51)->onOneServer(); + $schedule->command('app:import-remove-deleted-accounts')->hourlyAt(37)->onOneServer(); + $schedule->command('app:import-upload-clean-storage')->twiceDailyAt(1, 13, 32)->onOneServer(); - if(config('import.instagram.storage.cloud.enabled') && (bool) config_cache('pixelfed.cloud_storage')) { - $schedule->command('app:import-upload-media-to-cloud-storage')->hourlyAt(39); + if (config('import.instagram.storage.cloud.enabled') && (bool) config_cache('pixelfed.cloud_storage')) { + $schedule->command('app:import-upload-media-to-cloud-storage')->hourlyAt(39)->onOneServer(); } } - $schedule->command('app:notification-epoch-update')->weeklyOn(1, '2:21'); - $schedule->command('app:hashtag-cached-count-update')->hourlyAt(25); - $schedule->command('app:account-post-count-stat-update')->everySixHours(25); + + $schedule->command('app:notification-epoch-update')->weeklyOn(1, '2:21')->onOneServer(); + $schedule->command('app:hashtag-cached-count-update')->hourlyAt(25)->onOneServer(); + $schedule->command('app:account-post-count-stat-update')->everySixHours(25)->onOneServer(); } /** @@ -59,7 +60,7 @@ class Kernel extends ConsoleKernel */ protected function commands() { - $this->load(__DIR__.'/Commands'); + $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } diff --git a/composer.json b/composer.json index 08c0af239..a1adcf9e9 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "bacon/bacon-qr-code": "^2.0.3", "beyondcode/laravel-websockets": "^1.13", "brick/math": "^0.9.3", - "buzz/laravel-h-captcha": "1.0.4", + "buzz/laravel-h-captcha": "^1.0.4", "doctrine/dbal": "^3.0", "intervention/image": "^2.4", "jenssegers/agent": "^2.6", @@ -46,6 +46,7 @@ "require-dev": { "brianium/paratest": "^6.1", "fakerphp/faker": "^1.20", + "laravel/pint": "^1.14", "laravel/telescope": "^4.14", "mockery/mockery": "^1.0", "nunomaduro/collision": "^6.1", diff --git a/composer.lock b/composer.lock index bfd4b920b..df57a6b03 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "00f283796faf6517a8d98f9080440b7f", + "content-hash": "e166bdd0755f5304899546c97d9b7d4c", "packages": [ { "name": "aws/aws-crt-php", @@ -62,16 +62,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.299.1", + "version": "3.300.10", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "a0f87b8e8bfb9afd0ffd702fcda556b465eee457" + "reference": "b24bf7882fed0ef029996dcdcba6c273b69db8fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a0f87b8e8bfb9afd0ffd702fcda556b465eee457", - "reference": "a0f87b8e8bfb9afd0ffd702fcda556b465eee457", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b24bf7882fed0ef029996dcdcba6c273b69db8fe", + "reference": "b24bf7882fed0ef029996dcdcba6c273b69db8fe", "shasum": "" }, "require": { @@ -151,9 +151,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.299.1" + "source": "https://github.com/aws/aws-sdk-php/tree/3.300.10" }, - "time": "2024-02-16T19:08:34+00:00" + "time": "2024-03-04T19:06:07+00:00" }, { "name": "bacon/bacon-qr-code", @@ -353,21 +353,21 @@ }, { "name": "buzz/laravel-h-captcha", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/thinhbuzz/laravel-h-captcha.git", - "reference": "f2db3734203876ef1f69ba4dc0f4d9d71462f534" + "reference": "53435b15cf2094306d65584e68d4ed63dee1b9b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thinhbuzz/laravel-h-captcha/zipball/f2db3734203876ef1f69ba4dc0f4d9d71462f534", - "reference": "f2db3734203876ef1f69ba4dc0f4d9d71462f534", + "url": "https://api.github.com/repos/thinhbuzz/laravel-h-captcha/zipball/53435b15cf2094306d65584e68d4ed63dee1b9b9", + "reference": "53435b15cf2094306d65584e68d4ed63dee1b9b9", "shasum": "" }, "require": { "guzzlehttp/guzzle": "6.*|7.*", - "illuminate/support": "5.*|6.*|7.*|8.*|9.*|10.*", + "illuminate/support": "5.*|6.*|7.*|8.*|9.*|10.*|11.*", "php": ">=5.4.0" }, "type": "library", @@ -401,28 +401,22 @@ "homepage": "https://github.com/thinhbuzz/laravel-h-captcha", "keywords": [ "captcha", - "h captcha", "h-captcha", "hcaptcha", "laravel", "laravel 10", + "laravel 11", "laravel 5", "laravel 6", "laravel 7", "laravel 8", - "laravel 9", - "laravel10", - "laravel5", - "laravel6", - "laravel7", - "laravel8", - "laravel9" + "laravel 9" ], "support": { "issues": "https://github.com/thinhbuzz/laravel-h-captcha/issues", - "source": "https://github.com/thinhbuzz/laravel-h-captcha/tree/v1.0.4" + "source": "https://github.com/thinhbuzz/laravel-h-captcha/tree/v1.0.5" }, - "time": "2023-03-10T05:38:55+00:00" + "time": "2024-03-04T11:23:51+00:00" }, { "name": "carbonphp/carbon-doctrine-types", @@ -843,16 +837,16 @@ }, { "name": "doctrine/dbal", - "version": "3.8.2", + "version": "3.8.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "a19a1d05ca211f41089dffcc387733a6875196cb" + "reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/a19a1d05ca211f41089dffcc387733a6875196cb", - "reference": "a19a1d05ca211f41089dffcc387733a6875196cb", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/db922ba9436b7b18a23d1653a0b41ff2369ca41c", + "reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c", "shasum": "" }, "require": { @@ -868,12 +862,12 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.10.57", + "phpstan/phpstan": "1.10.58", "phpstan/phpstan-strict-rules": "^1.5", "phpunit/phpunit": "9.6.16", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", - "squizlabs/php_codesniffer": "3.8.1", + "squizlabs/php_codesniffer": "3.9.0", "symfony/cache": "^5.4|^6.0|^7.0", "symfony/console": "^4.4|^5.4|^6.0|^7.0", "vimeo/psalm": "4.30.0" @@ -936,7 +930,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.8.2" + "source": "https://github.com/doctrine/dbal/tree/3.8.3" }, "funding": [ { @@ -952,7 +946,7 @@ "type": "tidelift" } ], - "time": "2024-02-12T18:36:36+00:00" + "time": "2024-03-03T15:55:06+00:00" }, { "name": "doctrine/deprecations", @@ -2567,16 +2561,16 @@ }, { "name": "laravel/framework", - "version": "v10.44.0", + "version": "v10.46.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "1199dbe361787bbe9648131a79f53921b4148cf6" + "reference": "5e95946a8283a8d5c015035793f9c61c297e937f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/1199dbe361787bbe9648131a79f53921b4148cf6", - "reference": "1199dbe361787bbe9648131a79f53921b4148cf6", + "url": "https://api.github.com/repos/laravel/framework/zipball/5e95946a8283a8d5c015035793f9c61c297e937f", + "reference": "5e95946a8283a8d5c015035793f9c61c297e937f", "shasum": "" }, "require": { @@ -2769,7 +2763,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-02-13T16:01:16+00:00" + "time": "2024-02-27T16:46:54+00:00" }, { "name": "laravel/helpers", @@ -2830,16 +2824,16 @@ }, { "name": "laravel/horizon", - "version": "v5.23.0", + "version": "v5.23.1", "source": { "type": "git", "url": "https://github.com/laravel/horizon.git", - "reference": "0b1bf46b21c397fdbe80b1ab54451fd227934508" + "reference": "7475de7eb5b465c2da84218002fe1a62b8175da0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/horizon/zipball/0b1bf46b21c397fdbe80b1ab54451fd227934508", - "reference": "0b1bf46b21c397fdbe80b1ab54451fd227934508", + "url": "https://api.github.com/repos/laravel/horizon/zipball/7475de7eb5b465c2da84218002fe1a62b8175da0", + "reference": "7475de7eb5b465c2da84218002fe1a62b8175da0", "shasum": "" }, "require": { @@ -2902,9 +2896,9 @@ ], "support": { "issues": "https://github.com/laravel/horizon/issues", - "source": "https://github.com/laravel/horizon/tree/v5.23.0" + "source": "https://github.com/laravel/horizon/tree/v5.23.1" }, - "time": "2024-02-12T18:36:34+00:00" + "time": "2024-02-20T15:14:10+00:00" }, { "name": "laravel/passport", @@ -2986,16 +2980,16 @@ }, { "name": "laravel/prompts", - "version": "v0.1.15", + "version": "v0.1.16", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "d814a27514d99b03c85aa42b22cfd946568636c1" + "reference": "ca6872ab6aec3ab61db3a61f83a6caf764ec7781" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/d814a27514d99b03c85aa42b22cfd946568636c1", - "reference": "d814a27514d99b03c85aa42b22cfd946568636c1", + "url": "https://api.github.com/repos/laravel/prompts/zipball/ca6872ab6aec3ab61db3a61f83a6caf764ec7781", + "reference": "ca6872ab6aec3ab61db3a61f83a6caf764ec7781", "shasum": "" }, "require": { @@ -3037,9 +3031,9 @@ ], "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.1.15" + "source": "https://github.com/laravel/prompts/tree/v0.1.16" }, - "time": "2023-12-29T22:37:42+00:00" + "time": "2024-02-21T19:25:27+00:00" }, { "name": "laravel/serializable-closure", @@ -4752,16 +4746,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.0.0", + "version": "v5.0.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc" + "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc", - "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2218c2252c874a4624ab2f613d86ac32d227bc69", + "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69", "shasum": "" }, "require": { @@ -4804,9 +4798,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.1" }, - "time": "2024-01-07T17:17:35+00:00" + "time": "2024-02-21T19:24:10+00:00" }, { "name": "nunomaduro/termwind", @@ -5419,16 +5413,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.46", + "version": "2.0.47", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "498e67a0c82bd5791fda9b0dd0f4ec8e8aebb02d" + "reference": "b7d7d90ee7df7f33a664b4aea32d50a305d35adb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/498e67a0c82bd5791fda9b0dd0f4ec8e8aebb02d", - "reference": "498e67a0c82bd5791fda9b0dd0f4ec8e8aebb02d", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/b7d7d90ee7df7f33a664b4aea32d50a305d35adb", + "reference": "b7d7d90ee7df7f33a664b4aea32d50a305d35adb", "shasum": "" }, "require": { @@ -5509,7 +5503,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/2.0.46" + "source": "https://github.com/phpseclib/phpseclib/tree/2.0.47" }, "funding": [ { @@ -5525,7 +5519,7 @@ "type": "tidelift" } ], - "time": "2023-12-29T01:52:43+00:00" + "time": "2024-02-26T04:55:38+00:00" }, { "name": "pixelfed/fractal", @@ -7521,26 +7515,26 @@ }, { "name": "spatie/laravel-image-optimizer", - "version": "1.7.1", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-image-optimizer.git", - "reference": "cd8945e47b9fd01bc7b770eecd57c56f46c47422" + "reference": "024752cba691fee3cd1800000b6aa3da3b8b2474" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-image-optimizer/zipball/cd8945e47b9fd01bc7b770eecd57c56f46c47422", - "reference": "cd8945e47b9fd01bc7b770eecd57c56f46c47422", + "url": "https://api.github.com/repos/spatie/laravel-image-optimizer/zipball/024752cba691fee3cd1800000b6aa3da3b8b2474", + "reference": "024752cba691fee3cd1800000b6aa3da3b8b2474", "shasum": "" }, "require": { - "laravel/framework": "^8.0|^9.0|^10.0", + "laravel/framework": "^8.0|^9.0|^10.0|^11.0", "php": "^8.0", "spatie/image-optimizer": "^1.2.0" }, "require-dev": { - "orchestra/testbench": "^6.23|^7.0|^8.0", - "phpunit/phpunit": "^9.4" + "orchestra/testbench": "^6.23|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.4|^10.5" }, "type": "library", "extra": { @@ -7577,7 +7571,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/laravel-image-optimizer/tree/1.7.1" + "source": "https://github.com/spatie/laravel-image-optimizer/tree/1.8.0" }, "funding": [ { @@ -7585,7 +7579,7 @@ "type": "custom" } ], - "time": "2023-01-24T23:44:33+00:00" + "time": "2024-02-29T10:55:08+00:00" }, { "name": "spatie/laravel-package-tools", @@ -7915,16 +7909,16 @@ }, { "name": "symfony/cache", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "49f8cdee544a621a621cd21b6cda32a38926d310" + "reference": "0ef36534694c572ff526d91c7181f3edede176e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/49f8cdee544a621a621cd21b6cda32a38926d310", - "reference": "49f8cdee544a621a621cd21b6cda32a38926d310", + "url": "https://api.github.com/repos/symfony/cache/zipball/0ef36534694c572ff526d91c7181f3edede176e7", + "reference": "0ef36534694c572ff526d91c7181f3edede176e7", "shasum": "" }, "require": { @@ -7991,7 +7985,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.4.3" + "source": "https://github.com/symfony/cache/tree/v6.4.4" }, "funding": [ { @@ -8007,7 +8001,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-02-22T20:27:10+00:00" }, { "name": "symfony/cache-contracts", @@ -8087,16 +8081,16 @@ }, { "name": "symfony/console", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "2aaf83b4de5b9d43b93e4aec6f2f8b676f7c567e" + "reference": "0d9e4eb5ad413075624378f474c4167ea202de78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2aaf83b4de5b9d43b93e4aec6f2f8b676f7c567e", - "reference": "2aaf83b4de5b9d43b93e4aec6f2f8b676f7c567e", + "url": "https://api.github.com/repos/symfony/console/zipball/0d9e4eb5ad413075624378f474c4167ea202de78", + "reference": "0d9e4eb5ad413075624378f474c4167ea202de78", "shasum": "" }, "require": { @@ -8161,7 +8155,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.3" + "source": "https://github.com/symfony/console/tree/v6.4.4" }, "funding": [ { @@ -8177,7 +8171,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-02-22T20:27:10+00:00" }, { "name": "symfony/css-selector", @@ -8313,16 +8307,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "6dc3c76a278b77f01d864a6005d640822c6f26a6" + "reference": "c725219bdf2afc59423c32793d5019d2a904e13a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/6dc3c76a278b77f01d864a6005d640822c6f26a6", - "reference": "6dc3c76a278b77f01d864a6005d640822c6f26a6", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/c725219bdf2afc59423c32793d5019d2a904e13a", + "reference": "c725219bdf2afc59423c32793d5019d2a904e13a", "shasum": "" }, "require": { @@ -8368,7 +8362,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.4.3" + "source": "https://github.com/symfony/error-handler/tree/v6.4.4" }, "funding": [ { @@ -8384,7 +8378,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T15:40:36+00:00" + "time": "2024-02-22T20:27:10+00:00" }, { "name": "symfony/event-dispatcher", @@ -8608,16 +8602,16 @@ }, { "name": "symfony/http-client", - "version": "v6.4.3", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "a9034bc119fab8238f76cf49c770f3135f3ead86" + "reference": "f3c86a60a3615f466333a11fd42010d4382a82c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/a9034bc119fab8238f76cf49c770f3135f3ead86", - "reference": "a9034bc119fab8238f76cf49c770f3135f3ead86", + "url": "https://api.github.com/repos/symfony/http-client/zipball/f3c86a60a3615f466333a11fd42010d4382a82c7", + "reference": "f3c86a60a3615f466333a11fd42010d4382a82c7", "shasum": "" }, "require": { @@ -8681,7 +8675,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.3" + "source": "https://github.com/symfony/http-client/tree/v6.4.5" }, "funding": [ { @@ -8697,7 +8691,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T15:01:07+00:00" + "time": "2024-03-02T12:45:30+00:00" }, { "name": "symfony/http-client-contracts", @@ -8779,16 +8773,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "5677bdf7cade4619cb17fc9e1e7b31ec392244a9" + "reference": "ebc713bc6e6f4b53f46539fc158be85dfcd77304" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5677bdf7cade4619cb17fc9e1e7b31ec392244a9", - "reference": "5677bdf7cade4619cb17fc9e1e7b31ec392244a9", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ebc713bc6e6f4b53f46539fc158be85dfcd77304", + "reference": "ebc713bc6e6f4b53f46539fc158be85dfcd77304", "shasum": "" }, "require": { @@ -8836,7 +8830,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.3" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.4" }, "funding": [ { @@ -8852,20 +8846,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-02-08T15:01:18+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.4.3", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "9c6ec4e543044f7568a53a76ab1484ecd30637a2" + "reference": "f6947cb939d8efee137797382cb4db1af653ef75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9c6ec4e543044f7568a53a76ab1484ecd30637a2", - "reference": "9c6ec4e543044f7568a53a76ab1484ecd30637a2", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f6947cb939d8efee137797382cb4db1af653ef75", + "reference": "f6947cb939d8efee137797382cb4db1af653ef75", "shasum": "" }, "require": { @@ -8914,7 +8908,7 @@ "symfony/process": "^5.4|^6.0|^7.0", "symfony/property-access": "^5.4.5|^6.0.5|^7.0", "symfony/routing": "^5.4|^6.0|^7.0", - "symfony/serializer": "^6.3|^7.0", + "symfony/serializer": "^6.4.4|^7.0.4", "symfony/stopwatch": "^5.4|^6.0|^7.0", "symfony/translation": "^5.4|^6.0|^7.0", "symfony/translation-contracts": "^2.5|^3", @@ -8949,7 +8943,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.3" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.5" }, "funding": [ { @@ -8965,20 +8959,20 @@ "type": "tidelift" } ], - "time": "2024-01-31T07:21:29+00:00" + "time": "2024-03-04T21:00:47+00:00" }, { "name": "symfony/mailer", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "74412c62f88a85a41b61f0b71ab0afcaad6f03ee" + "reference": "791c5d31a8204cf3db0c66faab70282307f4376b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/74412c62f88a85a41b61f0b71ab0afcaad6f03ee", - "reference": "74412c62f88a85a41b61f0b71ab0afcaad6f03ee", + "url": "https://api.github.com/repos/symfony/mailer/zipball/791c5d31a8204cf3db0c66faab70282307f4376b", + "reference": "791c5d31a8204cf3db0c66faab70282307f4376b", "shasum": "" }, "require": { @@ -9029,7 +9023,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.4.3" + "source": "https://github.com/symfony/mailer/tree/v6.4.4" }, "funding": [ { @@ -9045,20 +9039,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T15:01:07+00:00" + "time": "2024-02-03T21:33:47+00:00" }, { "name": "symfony/mailgun-mailer", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/mailgun-mailer.git", - "reference": "96d23bb0e773ecfc3fb8d21cdabfbb3f4d6abf04" + "reference": "8c018872b40ce050590b6d18cf741db0c8313435" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/96d23bb0e773ecfc3fb8d21cdabfbb3f4d6abf04", - "reference": "96d23bb0e773ecfc3fb8d21cdabfbb3f4d6abf04", + "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/8c018872b40ce050590b6d18cf741db0c8313435", + "reference": "8c018872b40ce050590b6d18cf741db0c8313435", "shasum": "" }, "require": { @@ -9098,7 +9092,7 @@ "description": "Symfony Mailgun Mailer Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailgun-mailer/tree/v6.4.3" + "source": "https://github.com/symfony/mailgun-mailer/tree/v6.4.4" }, "funding": [ { @@ -9114,7 +9108,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T15:01:07+00:00" + "time": "2024-02-14T06:31:46+00:00" }, { "name": "symfony/mime", @@ -9913,16 +9907,16 @@ }, { "name": "symfony/process", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "31642b0818bfcff85930344ef93193f8c607e0a3" + "reference": "710e27879e9be3395de2b98da3f52a946039f297" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/31642b0818bfcff85930344ef93193f8c607e0a3", - "reference": "31642b0818bfcff85930344ef93193f8c607e0a3", + "url": "https://api.github.com/repos/symfony/process/zipball/710e27879e9be3395de2b98da3f52a946039f297", + "reference": "710e27879e9be3395de2b98da3f52a946039f297", "shasum": "" }, "require": { @@ -9954,7 +9948,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.3" + "source": "https://github.com/symfony/process/tree/v6.4.4" }, "funding": [ { @@ -9970,7 +9964,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-02-20T12:31:00+00:00" }, { "name": "symfony/psr-http-message-bridge", @@ -10063,16 +10057,16 @@ }, { "name": "symfony/routing", - "version": "v6.4.3", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842" + "reference": "7fe30068e207d9c31c0138501ab40358eb2d49a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/3b2957ad54902f0f544df83e3d58b38d7e8e5842", - "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842", + "url": "https://api.github.com/repos/symfony/routing/zipball/7fe30068e207d9c31c0138501ab40358eb2d49a4", + "reference": "7fe30068e207d9c31c0138501ab40358eb2d49a4", "shasum": "" }, "require": { @@ -10126,7 +10120,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.3" + "source": "https://github.com/symfony/routing/tree/v6.4.5" }, "funding": [ { @@ -10142,7 +10136,7 @@ "type": "tidelift" } ], - "time": "2024-01-30T13:55:02+00:00" + "time": "2024-02-27T12:33:30+00:00" }, { "name": "symfony/service-contracts", @@ -10228,16 +10222,16 @@ }, { "name": "symfony/string", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "7a14736fb179876575464e4658fce0c304e8c15b" + "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/7a14736fb179876575464e4658fce0c304e8c15b", - "reference": "7a14736fb179876575464e4658fce0c304e8c15b", + "url": "https://api.github.com/repos/symfony/string/zipball/4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9", + "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9", "shasum": "" }, "require": { @@ -10294,7 +10288,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.3" + "source": "https://github.com/symfony/string/tree/v6.4.4" }, "funding": [ { @@ -10310,20 +10304,20 @@ "type": "tidelift" } ], - "time": "2024-01-25T09:26:29+00:00" + "time": "2024-02-01T13:16:41+00:00" }, { "name": "symfony/translation", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "637c51191b6b184184bbf98937702bcf554f7d04" + "reference": "bce6a5a78e94566641b2594d17e48b0da3184a8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/637c51191b6b184184bbf98937702bcf554f7d04", - "reference": "637c51191b6b184184bbf98937702bcf554f7d04", + "url": "https://api.github.com/repos/symfony/translation/zipball/bce6a5a78e94566641b2594d17e48b0da3184a8e", + "reference": "bce6a5a78e94566641b2594d17e48b0da3184a8e", "shasum": "" }, "require": { @@ -10389,7 +10383,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.3" + "source": "https://github.com/symfony/translation/tree/v6.4.4" }, "funding": [ { @@ -10405,7 +10399,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T13:11:52+00:00" + "time": "2024-02-20T13:16:58+00:00" }, { "name": "symfony/translation-contracts", @@ -10561,16 +10555,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "0435a08f69125535336177c29d56af3abc1f69da" + "reference": "b439823f04c98b84d4366c79507e9da6230944b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0435a08f69125535336177c29d56af3abc1f69da", - "reference": "0435a08f69125535336177c29d56af3abc1f69da", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/b439823f04c98b84d4366c79507e9da6230944b1", + "reference": "b439823f04c98b84d4366c79507e9da6230944b1", "shasum": "" }, "require": { @@ -10626,7 +10620,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.4.3" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.4" }, "funding": [ { @@ -10642,20 +10636,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:53:30+00:00" + "time": "2024-02-15T11:23:52+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.4.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "a8c12b5448a5ac685347f5eeb2abf6a571ec16b8" + "reference": "0bd342e24aef49fc82a21bd4eedd3e665d177e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/a8c12b5448a5ac685347f5eeb2abf6a571ec16b8", - "reference": "a8c12b5448a5ac685347f5eeb2abf6a571ec16b8", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/0bd342e24aef49fc82a21bd4eedd3e665d177e5b", + "reference": "0bd342e24aef49fc82a21bd4eedd3e665d177e5b", "shasum": "" }, "require": { @@ -10701,7 +10695,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.4.3" + "source": "https://github.com/symfony/var-exporter/tree/v6.4.4" }, "funding": [ { @@ -10717,7 +10711,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-02-26T08:37:45+00:00" }, { "name": "tightenco/collect", @@ -11058,6 +11052,7 @@ "type": "patreon" } ], + "abandoned": "web-token/jwt-library", "time": "2022-08-04T21:04:09+00:00" }, { @@ -11136,6 +11131,7 @@ "type": "patreon" } ], + "abandoned": "web-token/jwt-library", "time": "2023-02-02T17:25:26+00:00" }, { @@ -11213,6 +11209,7 @@ "type": "patreon" } ], + "abandoned": "web-token/jwt-library", "time": "2023-02-02T17:25:26+00:00" }, { @@ -11283,6 +11280,7 @@ "type": "patreon" } ], + "abandoned": "web-token/jwt-library", "time": "2022-08-04T21:04:09+00:00" }, { @@ -11356,6 +11354,7 @@ "type": "patreon" } ], + "abandoned": "web-token/jwt-library", "time": "2024-01-02T17:55:33+00:00" }, { @@ -11885,6 +11884,72 @@ }, "time": "2021-10-08T21:21:46+00:00" }, + { + "name": "laravel/pint", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "6b127276e3f263f7bb17d5077e9e0269e61b2a0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/6b127276e3f263f7bb17d5077e9e0269e61b2a0e", + "reference": "6b127276e3f263f7bb17d5077e9e0269e61b2a0e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.49.0", + "illuminate/view": "^10.43.0", + "larastan/larastan": "^2.8.1", + "laravel-zero/framework": "^10.3.0", + "mockery/mockery": "^1.6.7", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^2.33.6" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2024-02-20T17:38:05+00:00" + }, { "name": "laravel/telescope", "version": "v4.17.6", @@ -12188,20 +12253,21 @@ }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -12242,9 +12308,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -12299,16 +12371,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.30", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca2bd87d2f9215904682a9cb9bb37dda98e76089", - "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { @@ -12365,7 +12437,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.30" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { @@ -12373,7 +12445,7 @@ "type": "github" } ], - "time": "2023-12-22T06:47:57+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", @@ -12618,16 +12690,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.16", + "version": "9.6.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3767b2c56ce02d01e3491046f33466a1ae60a37f" + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3767b2c56ce02d01e3491046f33466a1ae60a37f", - "reference": "3767b2c56ce02d01e3491046f33466a1ae60a37f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", "shasum": "" }, "require": { @@ -12701,7 +12773,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.16" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" }, "funding": [ { @@ -12717,20 +12789,20 @@ "type": "tidelift" } ], - "time": "2024-01-19T07:03:14+00:00" + "time": "2024-02-23T13:14:51+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { @@ -12765,7 +12837,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -12773,7 +12845,7 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", @@ -13019,16 +13091,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -13073,7 +13145,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -13081,7 +13153,7 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", @@ -13148,16 +13220,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -13213,7 +13285,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -13221,20 +13293,20 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -13277,7 +13349,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -13285,7 +13357,7 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", @@ -13685,16 +13757,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -13723,7 +13795,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -13731,7 +13803,7 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], diff --git a/config/filesystems.php b/config/filesystems.php index 80e63ed99..00254e938 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -72,7 +72,7 @@ return [ 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), - 'visibility' => 'public', + 'visibility' => env('AWS_VISIBILITY', 'public'), 'url' => env('AWS_URL'), 'endpoint' => env('AWS_ENDPOINT'), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), diff --git a/config/pixelfed.php b/config/pixelfed.php index 50164218c..9da274434 100644 --- a/config/pixelfed.php +++ b/config/pixelfed.php @@ -23,7 +23,7 @@ return [ | This value is the version of your Pixelfed instance. | */ - 'version' => '0.11.12', + 'version' => '0.11.13', /* |-------------------------------------------------------------------------- diff --git a/contrib/docker-nginx.conf b/contrib/docker-nginx.conf deleted file mode 100644 index 9d0a199e6..000000000 --- a/contrib/docker-nginx.conf +++ /dev/null @@ -1,35 +0,0 @@ -upstream fe { - server 127.0.0.1:8080; -} - -server { - server_name real.domain; - listen [::]:443 ssl ipv6only=on; - listen 443 ssl; - ssl_certificate /etc/letsencrypt/live/real.domain/fullchain.pem; # managed by Certbot - ssl_certificate_key /etc/letsencrypt/live/real.domain/privkey.pem; # managed by Certbot - include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot - - location / { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $http_x_forwarded_host; - proxy_set_header X-Forwarded-Port $http_x_forwarded_port; - proxy_redirect off; - proxy_pass http://fe/; - } -} - -server { - if ($host = real.domain) { - return 301 https://$host$request_uri; - } - - listen 80; - listen [::]:80; - server_name real.domain; - return 404; -} \ No newline at end of file diff --git a/contrib/docker/Dockerfile.apache b/contrib/docker/Dockerfile.apache deleted file mode 100644 index a400f8797..000000000 --- a/contrib/docker/Dockerfile.apache +++ /dev/null @@ -1,100 +0,0 @@ -FROM php:8.1-apache-bullseye - -ENV COMPOSER_MEMORY_LIMIT=-1 -ARG DEBIAN_FRONTEND=noninteractive -WORKDIR /var/www/ - -# Get Composer binary -COPY --from=composer:2.4.4 /usr/bin/composer /usr/bin/composer - -# Install package dependencies -RUN apt-get update \ - && apt-get upgrade -y \ -# && apt-get install -y --no-install-recommends apt-utils \ - && apt-get install -y --no-install-recommends \ -## Standard - locales \ - locales-all \ - git \ - gosu \ - zip \ - unzip \ - libzip-dev \ - libcurl4-openssl-dev \ -## Image Optimization - optipng \ - pngquant \ - jpegoptim \ - gifsicle \ -## Image Processing - libjpeg62-turbo-dev \ - libpng-dev \ - libmagickwand-dev \ -# Required for GD - libxpm4 \ - libxpm-dev \ - libwebp7 \ - libwebp-dev \ -## Video Processing - ffmpeg \ -## Database -# libpq-dev \ -# libsqlite3-dev \ - mariadb-client \ -# Locales Update - && sed -i '/en_US/s/^#//g' /etc/locale.gen \ - && locale-gen \ - && update-locale \ -# Install PHP extensions - && docker-php-source extract \ -#PHP Imagemagick extensions - && pecl install imagick \ - && docker-php-ext-enable imagick \ -# PHP GD extensions - && docker-php-ext-configure gd \ - --with-freetype \ - --with-jpeg \ - --with-webp \ - --with-xpm \ - && docker-php-ext-install -j$(nproc) gd \ -#PHP Redis extensions - && pecl install redis \ - && docker-php-ext-enable redis \ -#PHP Database extensions - && docker-php-ext-install pdo_mysql \ -#pdo_pgsql pdo_sqlite \ -#PHP extensions (dependencies) - && docker-php-ext-configure intl \ - && docker-php-ext-install -j$(nproc) intl bcmath zip pcntl exif curl \ -#APACHE Bootstrap - && a2enmod rewrite remoteip \ - && {\ - echo RemoteIPHeader X-Real-IP ;\ - echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ - echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ - echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ - echo SetEnvIf X-Forwarded-Proto "https" HTTPS=on ;\ - } > /etc/apache2/conf-available/remoteip.conf \ - && a2enconf remoteip \ -#Cleanup - && docker-php-source delete \ - && apt-get autoremove --purge -y \ - && apt-get clean \ - && rm -rf /var/cache/apt \ - && rm -rf /var/lib/apt/lists/ - -# Use the default production configuration -COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini" - -COPY . /var/www/ -# for detail why storage is copied this way, pls refer to https://github.com/pixelfed/pixelfed/pull/2137#discussion_r434468862 -RUN cp -r storage storage.skel \ - && composer install --prefer-dist --no-interaction --no-ansi --optimize-autoloader \ - && rm -rf html && ln -s public html \ - && chown -R www-data:www-data /var/www - -RUN php artisan horizon:publish - -VOLUME /var/www/storage /var/www/bootstrap - -CMD ["/var/www/contrib/docker/start.apache.sh"] diff --git a/contrib/docker/Dockerfile.fpm b/contrib/docker/Dockerfile.fpm deleted file mode 100644 index 1bb0a15f7..000000000 --- a/contrib/docker/Dockerfile.fpm +++ /dev/null @@ -1,90 +0,0 @@ -FROM php:8.1-fpm-bullseye - -ENV COMPOSER_MEMORY_LIMIT=-1 -ARG DEBIAN_FRONTEND=noninteractive -WORKDIR /var/www/ - -# Get Composer binary -COPY --from=composer:2.4.4 /usr/bin/composer /usr/bin/composer - -# Install package dependencies -RUN apt-get update \ - && apt-get upgrade -y \ -# && apt-get install -y --no-install-recommends apt-utils \ - && apt-get install -y --no-install-recommends \ -## Standard - locales \ - locales-all \ - git \ - gosu \ - zip \ - unzip \ - libzip-dev \ - libcurl4-openssl-dev \ -## Image Optimization - optipng \ - pngquant \ - jpegoptim \ - gifsicle \ -## Image Processing - libjpeg62-turbo-dev \ - libpng-dev \ - libmagickwand-dev \ -# Required for GD - libxpm4 \ - libxpm-dev \ - libwebp7 \ - libwebp-dev \ -## Video Processing - ffmpeg \ -## Database -# libpq-dev \ -# libsqlite3-dev \ - mariadb-client \ -# Locales Update - && sed -i '/en_US/s/^#//g' /etc/locale.gen \ - && locale-gen \ - && update-locale \ -# Install PHP extensions - && docker-php-source extract \ -#PHP Imagemagick extensions - && pecl install imagick \ - && docker-php-ext-enable imagick \ -# PHP GD extensions - && docker-php-ext-configure gd \ - --with-freetype \ - --with-jpeg \ - --with-webp \ - --with-xpm \ - && docker-php-ext-install -j$(nproc) gd \ -#PHP Redis extensions - && pecl install redis \ - && docker-php-ext-enable redis \ -#PHP Database extensions - && docker-php-ext-install pdo_mysql \ -#pdo_pgsql pdo_sqlite \ -#PHP extensions (dependencies) - && docker-php-ext-configure intl \ - && docker-php-ext-install -j$(nproc) intl bcmath zip pcntl exif curl \ -#Cleanup - && docker-php-source delete \ - && apt-get autoremove --purge -y \ - && apt-get clean \ - && rm -rf /var/cache/apt \ - && rm -rf /var/lib/apt/lists/ - -# Use the default production configuration -COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini" - -COPY . /var/www/ -# for detail why storage is copied this way, pls refer to https://github.com/pixelfed/pixelfed/pull/2137#discussion_r434468862 -RUN cp -r storage storage.skel \ - && composer install --prefer-dist --no-interaction --no-ansi --optimize-autoloader \ - && rm -rf html && ln -s public html \ - && chown -R www-data:www-data /var/www - -RUN php artisan horizon:publish - -VOLUME /var/www/storage /var/www/bootstrap - -CMD ["/var/www/contrib/docker/start.fpm.sh"] diff --git a/contrib/docker/start.apache.sh b/contrib/docker/start.apache.sh deleted file mode 100755 index 4fb19e476..000000000 --- a/contrib/docker/start.apache.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Create the storage tree if needed and fix permissions -cp -r storage.skel/* storage/ -chown -R www-data:www-data storage/ bootstrap/ - -# Refresh the environment -php artisan config:cache -php artisan storage:link -php artisan horizon:publish -php artisan route:cache -php artisan view:cache - -# Finally run Apache -apache2-foreground diff --git a/contrib/docker/start.fpm.sh b/contrib/docker/start.fpm.sh deleted file mode 100755 index 199489fc6..000000000 --- a/contrib/docker/start.fpm.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Create the storage tree if needed and fix permissions -cp -r storage.skel/* storage/ -chown -R www-data:www-data storage/ bootstrap/ - -# Refresh the environment -php artisan config:cache -php artisan storage:link -php artisan horizon:publish -php artisan route:cache -php artisan view:cache - -# Finally run FPM -php-fpm diff --git a/contrib/nginx.conf b/contrib/nginx.conf deleted file mode 100644 index 0f86ea9e7..000000000 --- a/contrib/nginx.conf +++ /dev/null @@ -1,67 +0,0 @@ -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name pixelfed.example; # change this to your fqdn - root /home/pixelfed/public; # path to repo/public - - ssl_certificate /etc/nginx/ssl/server.crt; # generate your own - ssl_certificate_key /etc/nginx/ssl/server.key; # or use letsencrypt - - ssl_protocols TLSv1.2; - ssl_ciphers EECDH+AESGCM:EECDH+CHACHA20:EECDH+AES; - ssl_prefer_server_ciphers on; - - #add_header X-Frame-Options "SAMEORIGIN"; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Content-Type-Options "nosniff"; - - index index.php; - - charset utf-8; - client_max_body_size 15M; - - location / { - try_files $uri $uri/ /index.php?$query_string; - } - - location = /favicon.ico { access_log off; log_not_found off; } - location = /robots.txt { access_log off; log_not_found off; } - - error_page 404 /index.php; - - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; - fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; - fastcgi_param QUERY_STRING $query_string; - fastcgi_param REQUEST_METHOD $request_method; - fastcgi_param CONTENT_TYPE $content_type; - fastcgi_param CONTENT_LENGTH $content_length; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_param REQUEST_URI $request_uri; - fastcgi_param DOCUMENT_URI $document_uri; - fastcgi_param DOCUMENT_ROOT $document_root; - fastcgi_param SERVER_PROTOCOL $server_protocol; - fastcgi_param GATEWAY_INTERFACE CGI/1.1; - fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; - fastcgi_param REMOTE_ADDR $remote_addr; - fastcgi_param REMOTE_PORT $remote_port; - fastcgi_param SERVER_ADDR $server_addr; - fastcgi_param SERVER_PORT $server_port; - fastcgi_param SERVER_NAME $server_name; - fastcgi_param HTTPS $https if_not_empty; - fastcgi_param REDIRECT_STATUS 200; - fastcgi_param HTTP_PROXY ""; - } - - location ~ /\.(?!well-known).* { - deny all; - } -} - -server { # Redirect http to https - server_name pixelfed.example; # change this to your fqdn - listen 80; - listen [::]:80; - return 301 https://$host$request_uri; -} diff --git a/docker-compose.migrate.yml b/docker-compose.migrate.yml new file mode 100644 index 000000000..b31771f27 --- /dev/null +++ b/docker-compose.migrate.yml @@ -0,0 +1,42 @@ +--- +version: "3" + +services: + migrate: + image: "secoresearch/rsync" + entrypoint: "" + working_dir: /migrate + command: 'bash -c "exit 1"' + restart: never + volumes: + ################################ + # Storage volume + ################################ + # OLD + - "app-storage:/migrate/app-storage/old" + # NEW + - "${DOCKER_APP_HOST_STORAGE_PATH}:/migrate/app-storage/new" + + ################################ + # MySQL/DB volume + ################################ + # OLD + - "db-data:/migrate/db-data/old" + # NEW + - "${DOCKER_DB_HOST_DATA_PATH}:/migrate/db-data/new" + + ################################ + # Redis volume + ################################ + # OLD + - "redis-data:/migrate/redis-data/old" + # NEW + - "${DOCKER_REDIS_HOST_DATA_PATH}:/migrate/redis-data/new" + +# Volumes from the old [docker-compose.yml] file +# https://github.com/pixelfed/pixelfed/blob/b1ff44ca2f75c088a11576fb03b5bad2fbed4d5c/docker-compose.yml#L72-L76 +volumes: + db-data: + redis-data: + app-storage: + app-bootstrap: diff --git a/docker-compose.yml b/docker-compose.yml index 6fca2eeb3..5df433c83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,82 +1,218 @@ --- -version: '3' +# Require 3.8 to ensure people use a recent version of Docker + Compose +version: "3.8" -# In order to set configuration, please use a .env file in -# your compose project directory (the same directory as your -# docker-compose.yml), and set database options, application -# name, key, and other settings there. -# A list of available settings is available in .env.example -# -# The services should scale properly across a swarm cluster -# if the volumes are properly shared between cluster members. +############################################################### +# Please see docker/README.md for usage information +############################################################### services: -## App and Worker - app: - # Comment to use dockerhub image - image: pixelfed/pixelfed:latest + # HTTP/HTTPS proxy + # + # Sits in front of the *real* webserver and manages SSL and (optionally) + # load-balancing between multiple web servers + # + # You can disable this service by setting [DOCKER_PROXY_PROFILE="disabled"] + # in your [.env] file - the setting is near the bottom of the file. + # + # This also disables the [proxy-acme] service, if this is not desired, change the + # [DOCKER_PROXY_ACME_PROFILE] setting to an empty string [""] + # + # See: https://github.com/nginx-proxy/nginx-proxy/tree/main/docs + proxy: + image: nginxproxy/nginx-proxy:1.4 + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy" restart: unless-stopped - env_file: - - .env.docker + profiles: + - ${DOCKER_PROXY_PROFILE:-} + environment: + DOCKER_SERVICE_NAME: "proxy" volumes: - - app-storage:/var/www/storage - - app-bootstrap:/var/www/bootstrap - - "./.env.docker:/var/www/.env" - networks: - - external - - internal + - "${DOCKER_PROXY_HOST_DOCKER_SOCKET_PATH}:/tmp/docker.sock:ro" + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/etc/nginx/conf.d" + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/vhost.d:/etc/nginx/vhost.d" + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/certs:/etc/nginx/certs" + - "${DOCKER_ALL_HOST_DATA_ROOT_PATH}/proxy/html:/usr/share/nginx/html" ports: - - "8080:80" + - "${DOCKER_PROXY_HOST_PORT_HTTP}:80" + - "${DOCKER_PROXY_HOST_PORT_HTTPS}:443" + healthcheck: + test: "curl --fail https://${APP_DOMAIN}/api/service/health-check" + interval: "${DOCKER_PROXY_HEALTHCHECK_INTERVAL}" + retries: 2 + timeout: 5s + + # Proxy companion for managing letsencrypt SSL certificates + # + # You can disable this service by setting [DOCKER_PROXY_ACME_PROFILE="disabled"] + # in your [.env] file - the setting is near the bottom of the file. + # + # See: https://github.com/nginx-proxy/acme-companion/tree/main/docs + proxy-acme: + image: nginxproxy/acme-companion + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy-acme" + restart: unless-stopped + profiles: + - ${DOCKER_PROXY_ACME_PROFILE:-} + environment: + DEBUG: 0 + DEFAULT_EMAIL: "${DOCKER_PROXY_LETSENCRYPT_EMAIL:?error}" + NGINX_PROXY_CONTAINER: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy" + depends_on: + - proxy + volumes: + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy-acme:/etc/acme.sh" + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/certs:/etc/nginx/certs" + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/etc/nginx/conf.d" + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/vhost.d:/etc/nginx/vhost.d" + - "${DOCKER_ALL_HOST_DATA_ROOT_PATH}/proxy/html:/usr/share/nginx/html" + - "${DOCKER_PROXY_HOST_DOCKER_SOCKET_PATH}:/var/run/docker.sock:ro" + + web: + image: "${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}" + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-web" + restart: unless-stopped + profiles: + - ${DOCKER_WEB_PROFILE:-} + build: + target: ${DOCKER_APP_RUNTIME}-runtime + cache_from: + - "type=registry,ref=${DOCKER_APP_IMAGE}-cache:${DOCKER_APP_TAG}" + args: + APT_PACKAGES_EXTRA: "${DOCKER_APP_APT_PACKAGES_EXTRA:-}" + PHP_BASE_TYPE: "${DOCKER_APP_BASE_TYPE}" + PHP_DEBIAN_RELEASE: "${DOCKER_APP_DEBIAN_RELEASE}" + PHP_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_EXTENSIONS_EXTRA:-}" + PHP_PECL_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA:-}" + PHP_VERSION: "${DOCKER_APP_PHP_VERSION:?error}" + environment: + # Used by Pixelfed Docker init script + DOCKER_SERVICE_NAME: "web" + DOCKER_APP_ENTRYPOINT_DEBUG: ${DOCKER_APP_ENTRYPOINT_DEBUG:-0} + ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-} + # Used by [proxy] service + LETSENCRYPT_HOST: "${DOCKER_PROXY_LETSENCRYPT_HOST:?error}" + LETSENCRYPT_EMAIL: "${DOCKER_PROXY_LETSENCRYPT_EMAIL:?error}" + LETSENCRYPT_TEST: "${DOCKER_PROXY_LETSENCRYPT_TEST:-}" + VIRTUAL_HOST: "${APP_DOMAIN}" + VIRTUAL_PORT: "80" + volumes: + - "./.env:/var/www/.env" + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/shared/proxy/conf.d" + - "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache" + - "${DOCKER_APP_HOST_OVERRIDES_PATH}:/docker/overrides:ro" + - "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage" + labels: + com.github.nginx-proxy.nginx-proxy.keepalive: 30 + com.github.nginx-proxy.nginx-proxy.http2.enable: true + com.github.nginx-proxy.nginx-proxy.http3.enable: true + ports: + - "${DOCKER_WEB_PORT_EXTERNAL_HTTP}:80" depends_on: - db - redis + healthcheck: + test: 'curl --header "Host: ${APP_DOMAIN}" --fail http://localhost/api/service/health-check' + interval: "${DOCKER_WEB_HEALTHCHECK_INTERVAL}" + retries: 2 + timeout: 5s worker: - image: pixelfed/pixelfed:latest - restart: unless-stopped - env_file: - - .env.docker - volumes: - - app-storage:/var/www/storage - - app-bootstrap:/var/www/bootstrap - networks: - - external - - internal + image: "${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}" + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-worker" command: gosu www-data php artisan horizon + restart: unless-stopped + stop_signal: SIGTERM + profiles: + - ${DOCKER_WORKER_PROFILE:-} + build: + target: ${DOCKER_APP_RUNTIME}-runtime + cache_from: + - "type=registry,ref=${DOCKER_APP_IMAGE}-cache:${DOCKER_APP_TAG}" + args: + APT_PACKAGES_EXTRA: "${DOCKER_APP_APT_PACKAGES_EXTRA:-}" + PHP_BASE_TYPE: "${DOCKER_APP_BASE_TYPE}" + PHP_DEBIAN_RELEASE: "${DOCKER_APP_DEBIAN_RELEASE}" + PHP_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_EXTENSIONS_EXTRA:-}" + PHP_PECL_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA:-}" + PHP_VERSION: "${DOCKER_APP_PHP_VERSION:?error}" + environment: + # Used by Pixelfed Docker init script + DOCKER_SERVICE_NAME: "worker" + DOCKER_APP_ENTRYPOINT_DEBUG: ${DOCKER_APP_ENTRYPOINT_DEBUG:-0} + ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-} + volumes: + - "./.env:/var/www/.env" + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/shared/proxy/conf.d" + - "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache" + - "${DOCKER_APP_HOST_OVERRIDES_PATH}:/docker/overrides:ro" + - "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage" depends_on: - db - redis + healthcheck: + test: gosu www-data php artisan horizon:status | grep running + interval: "${DOCKER_WORKER_HEALTHCHECK_INTERVAL:?error}" + timeout: 5s + retries: 2 -## DB and Cache db: - image: mariadb:jammy + image: ${DOCKER_DB_IMAGE:?error} + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-db" + command: ${DOCKER_DB_COMMAND:-} restart: unless-stopped - networks: - - internal - command: --default-authentication-plugin=mysql_native_password - env_file: - - .env.docker + profiles: + - ${DOCKER_DB_PROFILE:-} + environment: + TZ: "${TZ:?error}" + # MySQL (Oracle) - "Environment Variables" at https://hub.docker.com/_/mysql + MYSQL_ROOT_PASSWORD: "${DB_PASSWORD:?error}" + MYSQL_USER: "${DB_USERNAME:?error}" + MYSQL_PASSWORD: "${DB_PASSWORD:?error}" + MYSQL_DATABASE: "${DB_DATABASE:?error}" + # MySQL (MariaDB) - "Start a mariadb server instance with user, password and database" at https://hub.docker.com/_/mariadb + MARIADB_ROOT_PASSWORD: "${DB_PASSWORD:?error}" + MARIADB_USER: "${DB_USERNAME:?error}" + MARIADB_PASSWORD: "${DB_PASSWORD:?error}" + MARIADB_DATABASE: "${DB_DATABASE:?error}" + # PostgreSQL - "Environment Variables" at https://hub.docker.com/_/postgres + POSTGRES_USER: "${DB_USERNAME:?error}" + POSTGRES_PASSWORD: "${DB_PASSWORD:?error}" + POSTGRES_DB: "${DB_DATABASE:?error}" volumes: - - "db-data:/var/lib/mysql" + - "${DOCKER_DB_HOST_DATA_PATH:?error}:${DOCKER_DB_CONTAINER_DATA_PATH:?error}" + ports: + - "${DOCKER_DB_HOST_PORT:?error}:${DOCKER_DB_CONTAINER_PORT:?error}" + healthcheck: + test: + [ + "CMD", + "healthcheck.sh", + "--su-mysql", + "--connect", + "--innodb_initialized", + ] + interval: "${DOCKER_DB_HEALTHCHECK_INTERVAL:?error}" + retries: 2 + timeout: 5s redis: - image: redis:5-alpine + image: redis:${DOCKER_REDIS_VERSION} + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-redis" restart: unless-stopped - env_file: - - .env.docker + command: "${DOCKER_REDIS_CONFIG_FILE:-} --requirepass '${REDIS_PASSWORD:-}'" + profiles: + - ${DOCKER_REDIS_PROFILE:-} + environment: + TZ: "${TZ:?error}" + REDISCLI_AUTH: ${REDIS_PASSWORD:-} volumes: - - "redis-data:/data" - networks: - - internal - -volumes: - db-data: - redis-data: - app-storage: - app-bootstrap: - -networks: - internal: - internal: true - external: - driver: bridge + - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/redis:/etc/redis" + - "${DOCKER_REDIS_HOST_DATA_PATH}:/data" + ports: + - "${DOCKER_REDIS_HOST_PORT}:6379" + healthcheck: + test: ["CMD", "redis-cli", "-p", "6379", "ping"] + interval: "${DOCKER_REDIS_HEALTHCHECK_INTERVAL:?error}" + retries: 2 + timeout: 5s diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..5230f60fd --- /dev/null +++ b/docker/README.md @@ -0,0 +1,5 @@ +# Pixelfed + Docker + Docker Compose + +Please see the [Pixelfed Docs (Next)](https://jippi.github.io/pixelfed-docs-next/pr-preview/pr-1/running-pixelfed/) for current documentation on Docker usage. + +The docs can be [reviewed in the pixelfed/docs-next](https://github.com/pixelfed/docs-next/pull/1) repository. diff --git a/docker/apache/root/etc/apache2/conf-available/remoteip.conf b/docker/apache/root/etc/apache2/conf-available/remoteip.conf new file mode 100644 index 000000000..516da9f5d --- /dev/null +++ b/docker/apache/root/etc/apache2/conf-available/remoteip.conf @@ -0,0 +1,8 @@ +RemoteIPHeader X-Real-IP + +# All private IPs as outlined in rfc1918 +# +# See: https://datatracker.ietf.org/doc/html/rfc1918 +RemoteIPTrustedProxy 10.0.0.0/8 +RemoteIPTrustedProxy 172.16.0.0/12 +RemoteIPTrustedProxy 192.168.0.0/16 diff --git a/docker/artisan b/docker/artisan new file mode 100755 index 000000000..3bbf58aea --- /dev/null +++ b/docker/artisan @@ -0,0 +1,11 @@ +#!/bin/bash + +declare service="${PF_SERVICE:=worker}" +declare user="${PF_USER:=www-data}" + +exec docker compose exec \ + --user "${user}" \ + --env TERM \ + --env COLORTERM \ + "${service}" \ + php artisan "${@}" diff --git a/docker/dottie b/docker/dottie new file mode 100755 index 000000000..8bd304a03 --- /dev/null +++ b/docker/dottie @@ -0,0 +1,45 @@ +#!/bin/bash + +set -e -o errexit -o nounset -o pipefail + +declare project_root="${PWD}" +declare user="${PF_USER:=www-data}" + +if command -v git &>/dev/null; then + project_root=$(git rev-parse --show-toplevel) +fi + +declare -r release="${DOTTIE_VERSION:-latest}" + +declare -r update_check_file="/tmp/.dottie-update-check" # file to check age of since last update +declare -i update_check_max_age=$((8 * 60 * 60)) # 8 hours between checking for dottie version +declare -i update_check_cur_age=$((update_check_max_age + 1)) # by default the "update" event should happen + +# default [docker run] flags +declare -a flags=( + --rm + --interactive + --tty + --user "${user}" + --env TERM + --env COLORTERM + --volume "${project_root}:/var/www" + --workdir /var/www +) + +# if update file exists, find its age since last modification +if [[ -f "${update_check_file}" ]]; then + now=$(date +%s) + changed=$(date -r "${update_check_file}" +%s) + update_check_cur_age=$((now - changed)) +fi + +# if update file is older than max allowed poll for new version of dottie +if [[ $update_check_cur_age -gt $update_check_max_age ]]; then + flags+=(--pull always) + + touch "${update_check_file}" +fi + +# run dottie +exec docker run "${flags[@]}" "ghcr.io/jippi/dottie:${release}" "$@" diff --git a/docker/fpm/root/.gitkeep b/docker/fpm/root/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/nginx/Procfile b/docker/nginx/Procfile new file mode 100644 index 000000000..bd375bf6a --- /dev/null +++ b/docker/nginx/Procfile @@ -0,0 +1,2 @@ +fpm: php-fpm +nginx: nginx -g "daemon off;" diff --git a/docker/nginx/root/docker/templates/etc/nginx/conf.d/default.conf b/docker/nginx/root/docker/templates/etc/nginx/conf.d/default.conf new file mode 100644 index 000000000..15bf17beb --- /dev/null +++ b/docker/nginx/root/docker/templates/etc/nginx/conf.d/default.conf @@ -0,0 +1,49 @@ +server { + listen 80 default_server; + + server_name {{ getenv "APP_DOMAIN" }}; + root /var/www/public; + + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Content-Type-Options "nosniff"; + + access_log /dev/stdout; + error_log /dev/stderr warn; + + index index.html index.htm index.php; + + charset utf-8; + client_max_body_size {{ getenv "POST_MAX_SIZE" "61M" }}; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location = /favicon.ico { + access_log off; + log_not_found off; + } + + location = /robots.txt { + access_log off; + log_not_found off; + } + + error_page 404 /index.php; + + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + + include fastcgi_params; + + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + + location ~ /\.(?!well-known).* { + deny all; + } +} diff --git a/docker/nginx/root/docker/templates/etc/nginx/nginx.conf b/docker/nginx/root/docker/templates/etc/nginx/nginx.conf new file mode 100644 index 000000000..4e87a4565 --- /dev/null +++ b/docker/nginx/root/docker/templates/etc/nginx/nginx.conf @@ -0,0 +1,41 @@ +# This is changed from the original "nginx" in upstream to work properly +# with permissions within pixelfed when serving static files. +user www-data; + +worker_processes auto; + +# Ensure the PID is writable +# Lifted from: https://hub.docker.com/r/nginxinc/nginx-unprivileged +pid /tmp/nginx.pid; + +# Write error log to stderr (/proc/self/fd/2 -> /dev/stderr) +error_log /proc/self/fd/2 notice; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'; + + # Write error log to stdout (/proc/self/fd/1 -> /dev/stdout) + access_log /proc/self/fd/1 main; + + sendfile on; + tcp_nopush on; + keepalive_timeout 65; + gzip on; + + # Ensure all temp paths are in a writable by "www-data" user. + # Lifted from: https://hub.docker.com/r/nginxinc/nginx-unprivileged + client_body_temp_path /tmp/client_temp; + proxy_temp_path /tmp/proxy_temp_path; + fastcgi_temp_path /tmp/fastcgi_temp; + uwsgi_temp_path /tmp/uwsgi_temp; + scgi_temp_path /tmp/scgi_temp; + + include /etc/nginx/conf.d/*.conf; +} diff --git a/docker/shared/root/docker/entrypoint.d/01-permissions.sh b/docker/shared/root/docker/entrypoint.d/01-permissions.sh new file mode 100755 index 000000000..efff58110 --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/01-permissions.sh @@ -0,0 +1,31 @@ +#!/bin/bash +: "${ENTRYPOINT_ROOT:="/docker"}" + +# shellcheck source=SCRIPTDIR/../helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +entrypoint-set-script-name "$0" + +# Ensure the Docker volumes and required files are owned by the runtime user as other scripts +# will be writing to these +run-as-current-user chown --verbose "${RUNTIME_UID}:${RUNTIME_GID}" "./.env" +run-as-current-user chown --verbose "${RUNTIME_UID}:${RUNTIME_GID}" "./bootstrap/cache" +run-as-current-user chown --verbose "${RUNTIME_UID}:${RUNTIME_GID}" "./storage" +run-as-current-user chown --verbose --recursive "${RUNTIME_UID}:${RUNTIME_GID}" "./storage/docker" + +# Optionally fix ownership of configured paths +: "${DOCKER_APP_ENSURE_OWNERSHIP_PATHS:=""}" + +declare -a ensure_ownership_paths=() +IFS=' ' read -ar ensure_ownership_paths <<<"${DOCKER_APP_ENSURE_OWNERSHIP_PATHS}" + +if [[ ${#ensure_ownership_paths[@]} == 0 ]]; then + log-info "No paths has been configured for ownership fixes via [\$DOCKER_APP_ENSURE_OWNERSHIP_PATHS]." + + exit 0 +fi + +for path in "${ensure_ownership_paths[@]}"; do + log-info "Ensure ownership of [${path}] is correct" + stream-prefix-command-output run-as-current-user chown --recursive "${RUNTIME_UID}:${RUNTIME_GID}" "${path}" +done diff --git a/docker/shared/root/docker/entrypoint.d/02-check-config.sh b/docker/shared/root/docker/entrypoint.d/02-check-config.sh new file mode 100755 index 000000000..627960352 --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/02-check-config.sh @@ -0,0 +1,21 @@ +#!/bin/bash +: "${ENTRYPOINT_ROOT:="/docker"}" + +# shellcheck source=SCRIPTDIR/../helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +entrypoint-set-script-name "$0" + +# Validating dot-env files for any issues +for file in "${dot_env_files[@]}"; do + if ! file-exists "${file}"; then + log-warning "Could not source file [${file}]: does not exists" + continue + fi + + # We ignore 'dir' + 'file' rules since they are validate *host* paths + # which do not (and should not) exists inside the container + # + # We disable fixer since its not interactive anyway + run-as-current-user dottie validate --file "${file}" --ignore-rule dir,file --exclude-prefix APP_KEY --no-fix +done diff --git a/docker/shared/root/docker/entrypoint.d/04-defaults.envsh b/docker/shared/root/docker/entrypoint.d/04-defaults.envsh new file mode 100755 index 000000000..a55a56e6c --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/04-defaults.envsh @@ -0,0 +1,33 @@ +#!/bin/bash + +# NOTE: +# +# This file is *sourced* not run by the entrypoint runner +# so any environment values set here will be accessible to all sub-processes +# and future entrypoint.d scripts +# +# We also don't need to source `helpers.sh` since it's already available + +entrypoint-set-script-name "${BASH_SOURCE[0]}" + +load-config-files + +: "${MAX_PHOTO_SIZE:=15000}" +: "${MAX_ALBUM_LENGTH:=4}" + +# We assign a 1MB buffer to the just-in-time calculated max post size to allow for fields and overhead +: "${POST_MAX_SIZE_BUFFER:=1M}" +log-info "POST_MAX_SIZE_BUFFER is set to [${POST_MAX_SIZE_BUFFER}]" +buffer=$(numfmt --invalid=fail --from=auto --to=none --to-unit=K "${POST_MAX_SIZE_BUFFER}") +log-info "POST_MAX_SIZE_BUFFER converted to KB is [${buffer}]" + +# Automatically calculate the [post_max_size] value for [php.ini] and [nginx] +log-info "POST_MAX_SIZE will be calculated by [({MAX_PHOTO_SIZE} * {MAX_ALBUM_LENGTH}) + {POST_MAX_SIZE_BUFFER}]" +log-info " MAX_PHOTO_SIZE=${MAX_PHOTO_SIZE}" +log-info " MAX_ALBUM_LENGTH=${MAX_ALBUM_LENGTH}" +log-info " POST_MAX_SIZE_BUFFER=${buffer}" +: "${POST_MAX_SIZE:=$(numfmt --invalid=fail --from=auto --from-unit=K --to=si $(((MAX_PHOTO_SIZE * MAX_ALBUM_LENGTH) + buffer)))}" +log-info "POST_MAX_SIZE was calculated to [${POST_MAX_SIZE}]" + +# NOTE: must export the value so it's available in other scripts! +export POST_MAX_SIZE diff --git a/docker/shared/root/docker/entrypoint.d/05-templating.sh b/docker/shared/root/docker/entrypoint.d/05-templating.sh new file mode 100755 index 000000000..4d229b11c --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/05-templating.sh @@ -0,0 +1,60 @@ +#!/bin/bash +: "${ENTRYPOINT_ROOT:="/docker"}" + +# shellcheck source=SCRIPTDIR/../helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +entrypoint-set-script-name "$0" + +# Show [git diff] of templates being rendered (will help verify output) +: "${ENTRYPOINT_SHOW_TEMPLATE_DIFF:=1}" +# Directory where templates can be found +: "${ENTRYPOINT_TEMPLATE_DIR:=/docker/templates/}" +# Root path to write template template_files to (default is '', meaning it will be written to /) +: "${ENTRYPOINT_TEMPLATE_OUTPUT_PREFIX:=}" + +declare template_file relative_template_file_path output_file_dir + +# load all dot-env config files +load-config-files + +# export all dot-env variables so they are available in templating +# +# shellcheck disable=SC2068 +export ${seen_dot_env_variables[@]} + +find "${ENTRYPOINT_TEMPLATE_DIR}" -follow -type f -print | while read -r template_file; do + # Example: template_file=/docker/templates/usr/local/etc/php/php.ini + + # The file path without the template dir prefix ($ENTRYPOINT_TEMPLATE_DIR) + # + # Example: /usr/local/etc/php/php.ini + relative_template_file_path="${template_file#"${ENTRYPOINT_TEMPLATE_DIR}"}" + + # Adds optional prefix to the output file path + # + # Example: /usr/local/etc/php/php.ini + output_file_path="${ENTRYPOINT_TEMPLATE_OUTPUT_PREFIX}/${relative_template_file_path}" + + # Remove the file from the path + # + # Example: /usr/local/etc/php + output_file_dir=$(dirname "${output_file_path}") + + # Ensure the output directory is writable + if ! is-writable "${output_file_dir}"; then + log-error-and-exit "${output_file_dir} is not writable" + fi + + # Create the output directory if it doesn't exists + ensure-directory-exists "${output_file_dir}" + + # Render the template + log-info "Running [gomplate] on [${template_file}] --> [${output_file_path}]" + gomplate <"${template_file}" >"${output_file_path}" + + # Show the diff from the envsubst command + if is-true "${ENTRYPOINT_SHOW_TEMPLATE_DIFF}"; then + git --no-pager diff --color=always "${template_file}" "${output_file_path}" || : # ignore diff exit code + fi +done diff --git a/docker/shared/root/docker/entrypoint.d/10-storage.sh b/docker/shared/root/docker/entrypoint.d/10-storage.sh new file mode 100755 index 000000000..54145a365 --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/10-storage.sh @@ -0,0 +1,13 @@ +#!/bin/bash +: "${ENTRYPOINT_ROOT:="/docker"}" + +# shellcheck source=SCRIPTDIR/../helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +entrypoint-set-script-name "$0" + +# Copy the [storage/] skeleton files over the "real" [storage/] directory so assets are updated between versions +run-as-runtime-user cp --force --recursive storage.skel/. ./storage/ + +# Ensure storage linkk are correctly configured +run-as-runtime-user php artisan storage:link diff --git a/docker/shared/root/docker/entrypoint.d/11-first-time-setup.sh b/docker/shared/root/docker/entrypoint.d/11-first-time-setup.sh new file mode 100755 index 000000000..fb5c86a39 --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/11-first-time-setup.sh @@ -0,0 +1,38 @@ +#!/bin/bash +: "${ENTRYPOINT_ROOT:="/docker"}" + +# shellcheck source=SCRIPTDIR/../helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +entrypoint-set-script-name "$0" + +load-config-files + +# Allow automatic applying of outstanding/new migrations on startup +: "${DOCKER_APP_RUN_ONE_TIME_SETUP_TASKS:=1}" + +if is-false "${DOCKER_APP_RUN_ONE_TIME_SETUP_TASKS}"; then + log-warning "Automatic run of the 'One-time setup tasks' is disabled." + log-warning "Please set [DOCKER_APP_RUN_ONE_TIME_SETUP_TASKS=1] in your [.env] file to enable this." + + exit 0 +fi + +await-database-ready + +# Following https://docs.pixelfed.org/running-pixelfed/installation/#one-time-setup-tasks +# +# NOTE: Caches happens in [30-cache.sh] + +only-once "key:generate" run-as-runtime-user php artisan key:generate +only-once "storage:link" run-as-runtime-user php artisan storage:link +only-once "initial:migrate" run-as-runtime-user php artisan migrate --force +only-once "import:cities" run-as-runtime-user php artisan import:cities + +if is-true "${ACTIVITY_PUB:-false}"; then + only-once "instance:actor" run-as-runtime-user php artisan instance:actor +fi + +if is-true "${OAUTH_ENABLED:-false}"; then + only-once "passport:keys" run-as-runtime-user php artisan passport:keys +fi diff --git a/docker/shared/root/docker/entrypoint.d/12-migrations.sh b/docker/shared/root/docker/entrypoint.d/12-migrations.sh new file mode 100755 index 000000000..3b87daf1f --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/12-migrations.sh @@ -0,0 +1,42 @@ +#!/bin/bash +: "${ENTRYPOINT_ROOT:="/docker"}" + +# shellcheck source=SCRIPTDIR/../helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +entrypoint-set-script-name "$0" + +# Allow automatic applying of outstanding/new migrations on startup +: "${DB_APPLY_NEW_MIGRATIONS_AUTOMATICALLY:=0}" + +# Wait for the database to be ready +await-database-ready + +# Run the migrate:status command and capture output +output=$(run-as-runtime-user php artisan migrate:status || :) + +# By default we have no new migrations +declare -i new_migrations=0 + +# Detect if any new migrations are available by checking for "No" in the output +echo "$output" | grep No && new_migrations=1 + +if is-false "${new_migrations}"; then + log-info "No new migrations detected" + + exit 0 +fi + +log-warning "New migrations available" + +# Print the output +echo "$output" + +if is-false "${DB_APPLY_NEW_MIGRATIONS_AUTOMATICALLY}"; then + log-info "Automatic applying of new database migrations is disabled" + log-info "Please set [DB_APPLY_NEW_MIGRATIONS_AUTOMATICALLY=1] in your [.env] file to enable this." + + exit 0 +fi + +run-as-runtime-user php artisan migrate --force diff --git a/docker/shared/root/docker/entrypoint.d/20-horizon.sh b/docker/shared/root/docker/entrypoint.d/20-horizon.sh new file mode 100755 index 000000000..55efd768d --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/20-horizon.sh @@ -0,0 +1,9 @@ +#!/bin/bash +: "${ENTRYPOINT_ROOT:="/docker"}" + +# shellcheck source=SCRIPTDIR/../helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +entrypoint-set-script-name "$0" + +run-as-runtime-user php artisan horizon:publish diff --git a/docker/shared/root/docker/entrypoint.d/30-cache.sh b/docker/shared/root/docker/entrypoint.d/30-cache.sh new file mode 100755 index 000000000..c970db60b --- /dev/null +++ b/docker/shared/root/docker/entrypoint.d/30-cache.sh @@ -0,0 +1,11 @@ +#!/bin/bash +: "${ENTRYPOINT_ROOT:="/docker"}" + +# shellcheck source=SCRIPTDIR/../helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +entrypoint-set-script-name "$0" + +run-as-runtime-user php artisan config:cache +run-as-runtime-user php artisan route:cache +run-as-runtime-user php artisan view:cache diff --git a/docker/shared/root/docker/entrypoint.sh b/docker/shared/root/docker/entrypoint.sh new file mode 100755 index 000000000..73f6a4f3e --- /dev/null +++ b/docker/shared/root/docker/entrypoint.sh @@ -0,0 +1,105 @@ +#!/bin/bash +# short curcuit the entrypoint if $ENTRYPOINT_SKIP isn't set to 0 +if [[ ${ENTRYPOINT_SKIP:=0} != 0 ]]; then + exec "$@" +fi + +: "${ENTRYPOINT_ROOT:="/docker"}" +export ENTRYPOINT_ROOT + +# Directory where entrypoint scripts lives +: "${ENTRYPOINT_D_ROOT:="${ENTRYPOINT_ROOT}/entrypoint.d/"}" +export ENTRYPOINT_D_ROOT + +: "${DOCKER_APP_HOST_OVERRIDES_PATH:="${ENTRYPOINT_ROOT}/overrides"}" +export DOCKER_APP_HOST_OVERRIDES_PATH + +# Space separated list of scripts the entrypoint runner should skip +: "${ENTRYPOINT_SKIP_SCRIPTS:=""}" + +# Load helper scripts +# +# shellcheck source=SCRIPTDIR/helpers.sh +source "${ENTRYPOINT_ROOT}/helpers.sh" + +# Set the entrypoint name for logging +entrypoint-set-script-name "entrypoint.sh" + +# Convert ENTRYPOINT_SKIP_SCRIPTS into a native bash array for easier lookup +declare -a skip_scripts +# shellcheck disable=SC2034 +IFS=' ' read -ar skip_scripts <<< "$ENTRYPOINT_SKIP_SCRIPTS" + +# Ensure the entrypoint root folder exists +mkdir -p "${ENTRYPOINT_D_ROOT}" + +# If ENTRYPOINT_D_ROOT directory is empty, warn and run the regular command +if directory-is-empty "${ENTRYPOINT_D_ROOT}"; then + log-warning "No files found in ${ENTRYPOINT_D_ROOT}, skipping configuration" + + exec "$@" +fi + +# If the overridess directory exists, then copy all files into the container +if ! directory-is-empty "${DOCKER_APP_HOST_OVERRIDES_PATH}"; then + log-info "Overrides directory is not empty, copying files" + run-as-current-user cp --verbose --recursive "${DOCKER_APP_HOST_OVERRIDES_PATH}/." / +fi + +acquire-lock "entrypoint.sh" + +# Start scanning for entrypoint.d files to source or run +log-info "looking for shell scripts in [${ENTRYPOINT_D_ROOT}]" + +find "${ENTRYPOINT_D_ROOT}" -follow -type f -print | sort -V | while read -r file; do + # Skip the script if it's in the skip-script list + if in-array "$(get-entrypoint-script-name "${file}")" skip_scripts; then + log-warning "Skipping script [${file}] since it's in the skip list (\$ENTRYPOINT_SKIP_SCRIPTS)" + + continue + fi + + # Inspect the file extension of the file we're processing + case "${file}" in + *.envsh) + if ! is-executable "${file}"; then + # warn on shell scripts without exec bit + log-error-and-exit "File [${file}] is not executable (please 'chmod +x' it)" + fi + + log-info "${section_message_color}============================================================${color_clear}" + log-info "${section_message_color}Sourcing [${file}]${color_clear}" + log-info "${section_message_color}============================================================${color_clear}" + + # shellcheck disable=SC1090 + source "${file}" + + # the sourced file will (should) than the log prefix, so this restores our own + # "global" log prefix once the file is done being sourced + entrypoint-restore-script-name + ;; + + *.sh) + if ! is-executable "${file}"; then + # warn on shell scripts without exec bit + log-error-and-exit "File [${file}] is not executable (please 'chmod +x' it)" + fi + + log-info "${section_message_color}============================================================${color_clear}" + log-info "${section_message_color}Executing [${file}]${color_clear}" + log-info "${section_message_color}============================================================${color_clear}" + + "${file}" + ;; + + *) + log-warning "Ignoring unrecognized file [${file}]" + ;; + esac +done + +release-lock "entrypoint.sh" + +log-info "Configuration complete; ready for start up" + +exec "$@" diff --git a/docker/shared/root/docker/helpers.sh b/docker/shared/root/docker/helpers.sh new file mode 100644 index 000000000..3a21ee89e --- /dev/null +++ b/docker/shared/root/docker/helpers.sh @@ -0,0 +1,593 @@ +#!/bin/bash +set -e -o errexit -o nounset -o pipefail + +[[ ${DOCKER_APP_ENTRYPOINT_DEBUG:=0} == 1 ]] && set -x + +: "${RUNTIME_UID:="33"}" +: "${RUNTIME_GID:="33"}" + +# Some splash of color for important messages +declare -g error_message_color="\033[1;31m" +declare -g warn_message_color="\033[1;33m" +declare -g notice_message_color="\033[1;34m" +declare -g success_message_color="\033[1;32m" +# shellcheck disable=SC2034 +declare -g section_message_color="\033[1;35m" +declare -g color_clear="\033[1;0m" + +# Current and previous log prefix +declare -g script_name= +declare -g script_name_previous= +declare -g log_prefix= + +declare -Ag lock_fds=() + +# dot-env files to source when reading config +declare -a dot_env_files=( + /var/www/.env +) + +# environment keys seen when source dot files (so we can [export] them) +declare -ga seen_dot_env_variables=() + +declare -g docker_state_path +docker_state_path="$(readlink -f ./storage/docker)" + +declare -g docker_locks_path="${docker_state_path}/lock" +declare -g docker_once_path="${docker_state_path}/once" + +declare -g runtime_username +runtime_username=$(id -un "${RUNTIME_UID}") + +# We should already be in /var/www, but just to be explicit +cd /var/www || log-error-and-exit "could not change to /var/www" + +# @description Restore the log prefix to the previous value that was captured in [entrypoint-set-script-name ] +# @arg $1 string The name (or path) of the entrypoint script being run +function entrypoint-set-script-name() +{ + script_name_previous="${script_name}" + script_name="${1}" + + log_prefix="[entrypoint / $(get-entrypoint-script-name "$1")] - " +} + +# @description Restore the log prefix to the previous value that was captured in [entrypoint-set-script-name ] +function entrypoint-restore-script-name() +{ + entrypoint-set-script-name "${script_name_previous}" +} + +# @description Run a command as the [runtime user] +# @arg $@ string The command to run +# @exitcode 0 if the command succeeeds +# @exitcode 1 if the command fails +function run-as-runtime-user() +{ + run-command-as "${runtime_username}" "${@}" +} + +# @description Run a command as the [runtime user] +# @arg $@ string The command to run +# @exitcode 0 if the command succeeeds +# @exitcode 1 if the command fails +function run-as-current-user() +{ + run-command-as "$(id -un)" "${@}" +} + +# @description Run a command as the a named user +# @arg $1 string The user to run the command as +# @arg $@ string The command to run +# @exitcode 0 If the command succeeeds +# @exitcode 1 If the command fails +function run-command-as() +{ + local -i exit_code + local target_user + + target_user=${1} + shift + + log-info-stderr "${notice_message_color}👷 Running [${*}] as [${target_user}]${color_clear}" + + # disable error on exit behavior temporarily while we run the command + set +e + + if [[ ${target_user} != "root" ]]; then + stream-prefix-command-output su --preserve-environment "${target_user}" --shell /bin/bash --command "${*}" + else + stream-prefix-command-output "${@}" + fi + + # capture exit code + exit_code=$? + + # re-enable exit code handling + set -e + + if [[ $exit_code != 0 ]]; then + log-error "${error_message_color}❌ Error!${color_clear}" + + return "$exit_code" + fi + + log-info-stderr "${success_message_color}✅ OK!${color_clear}" + + return "$exit_code" +} + +# @description Streams stdout from the command and echo it +# with log prefixing. +# @see stream-prefix-command-output +function stream-stdout-handler() +{ + while read -r line; do + log-info "(stdout) ${line}" + done +} + +# @description Streams stderr from the command and echo it +# with a bit of color and log prefixing. +# @see stream-prefix-command-output +function stream-stderr-handler() +{ + while read -r line; do + log-info-stderr "(${error_message_color}stderr${color_clear}) ${line}" + done +} + +# @description Steam stdout and stderr from a command with log prefix +# and stdout/stderr prefix. If stdout or stderr is being piped/redirected +# it will automatically fall back to non-prefixed output. +# @arg $@ string The command to run +function stream-prefix-command-output() +{ + local stdout=stream-stdout-handler + local stderr=stream-stderr-handler + + # if stdout is being piped, print it like normal with echo + if [ ! -t 1 ]; then + # shellcheck disable=SC1007 + stdout= echo >&1 -ne + fi + + # if stderr is being piped, print it like normal with echo + if [ ! -t 2 ]; then + # shellcheck disable=SC1007 + stderr= echo >&2 -ne + fi + + "$@" > >($stdout) 2> >($stderr) +} + +# @description Print the given error message to stderr +# @arg $message string A error message. +# @stderr The error message provided with log prefix +function log-error() +{ + local msg + + if [[ $# -gt 0 ]]; then + msg="$*" + elif [[ ! -t 0 ]]; then + read -r msg || log-error-and-exit "[${FUNCNAME[0]}] could not read from stdin" + else + log-error-and-exit "[${FUNCNAME[0]}] did not receive any input arguments and STDIN is empty" + fi + + echo -e "${error_message_color}${log_prefix}ERROR -${color_clear} ${msg}" >/dev/stderr +} + +# @description Print the given error message to stderr and exit 1 +# @arg $@ string A error message. +# @stderr The error message provided with log prefix +# @exitcode 1 +function log-error-and-exit() +{ + log-error "$@" + + show-call-stack + + exit 1 +} + +# @description Print the given warning message to stderr +# @arg $@ string A warning message. +# @stderr The warning message provided with log prefix +function log-warning() +{ + local msg + + if [[ $# -gt 0 ]]; then + msg="$*" + elif [[ ! -t 0 ]]; then + read -r msg || log-error-and-exit "[${FUNCNAME[0]}] could not read from stdin" + else + log-error-and-exit "[${FUNCNAME[0]}] did not receive any input arguments and STDIN is empty" + fi + + echo -e "${warn_message_color}${log_prefix}WARNING -${color_clear} ${msg}" >/dev/stderr +} + +# @description Print the given message to stdout unless [ENTRYPOINT_QUIET_LOGS] is set +# @arg $@ string A info message. +# @stdout The info message provided with log prefix unless $ENTRYPOINT_QUIET_LOGS +function log-info() +{ + local msg + + if [[ $# -gt 0 ]]; then + msg="$*" + elif [[ ! -t 0 ]]; then + read -r msg || log-error-and-exit "[${FUNCNAME[0]}] could not read from stdin" + else + log-error-and-exit "[${FUNCNAME[0]}] did not receive any input arguments and STDIN is empty" + fi + + if [ -z "${ENTRYPOINT_QUIET_LOGS:-}" ]; then + echo -e "${notice_message_color}${log_prefix}${color_clear}${msg}" + fi +} + +# @description Print the given message to stderr unless [ENTRYPOINT_QUIET_LOGS] is set +# @arg $@ string A info message. +# @stderr The info message provided with log prefix unless $ENTRYPOINT_QUIET_LOGS +function log-info-stderr() +{ + local msg + + if [[ $# -gt 0 ]]; then + msg="$*" + elif [[ ! -t 0 ]]; then + read -r msg || log-error-and-exit "[${FUNCNAME[0]}] could not read from stdin" + else + log-error-and-exit "[${FUNCNAME[0]}] did not receive any input arguments and STDIN is empty" + fi + + if [ -z "${ENTRYPOINT_QUIET_LOGS:-}" ]; then + echo -e "${notice_message_color}${log_prefix}${color_clear}${msg}" >/dev/stderr + fi +} + +# @description Loads the dot-env files used by Docker and track the keys present in the configuration. +# @sets seen_dot_env_variables array List of config keys discovered during loading +function load-config-files() +{ + # Associative array (aka map/dictionary) holding the unique keys found in dot-env files + local -A _tmp_dot_env_keys + + for file in "${dot_env_files[@]}"; do + if ! file-exists "${file}"; then + log-warning "Could not source file [${file}]: does not exists" + continue + fi + + log-info "Sourcing ${file}" + # shellcheck disable=SC1090 + source "${file}" + + # find all keys in the dot-env file and store them in our temp associative array + for k in $(grep -v '^#' "${file}" | cut -d"=" -f1 | xargs); do + _tmp_dot_env_keys[$k]=1 + done + done + + # Used in other scripts (like templating) for [export]-ing the values + # + # shellcheck disable=SC2034 + seen_dot_env_variables=("${!_tmp_dot_env_keys[@]}") +} + +# @description Checks if $needle exists in $haystack +# @arg $1 string The needle (value) to search for +# @arg $2 array The haystack (array) to search in +# @exitcode 0 If $needle was found in $haystack +# @exitcode 1 If $needle was *NOT* found in $haystack +function in-array() +{ + local -r needle="\<${1}\>" + local -nr haystack=$2 + + [[ ${haystack[*]} =~ $needle ]] +} + +# @description Checks if $1 has executable bit set or not +# @arg $1 string The path to check +# @exitcode 0 If $1 has executable bit +# @exitcode 1 If $1 does *NOT* have executable bit +function is-executable() +{ + [[ -x "$1" ]] +} + +# @description Checks if $1 is writable or not +# @arg $1 string The path to check +# @exitcode 0 If $1 is writable +# @exitcode 1 If $1 is *NOT* writable +function is-writable() +{ + [[ -w "$1" ]] +} + +# @description Checks if $1 exists (directory or file) +# @arg $1 string The path to check +# @exitcode 0 If $1 exists +# @exitcode 1 If $1 does *NOT* exists +function path-exists() +{ + [[ -e "$1" ]] +} + +# @description Checks if $1 exists (file only) +# @arg $1 string The path to check +# @exitcode 0 If $1 exists +# @exitcode 1 If $1 does *NOT* exists +function file-exists() +{ + [[ -f "$1" ]] +} + +# @description Checks if $1 contains any files or not +# @arg $1 string The path to check +# @exitcode 0 If $1 contains files +# @exitcode 1 If $1 does *NOT* contain files +function directory-is-empty() +{ + ! path-exists "${1}" || [[ -z "$(ls -A "${1}")" ]] +} + +# @description Ensures a directory exists (via mkdir) +# @arg $1 string The path to create +# @exitcode 0 If $1 If the path exists *or* was created +# @exitcode 1 If $1 If the path does *NOT* exists and could *NOT* be created +function ensure-directory-exists() +{ + stream-prefix-command-output mkdir -pv "$@" +} + +# @description Find the relative path for a entrypoint script by removing the ENTRYPOINT_D_ROOT prefix +# @arg $1 string The path to manipulate +# @stdout The relative path to the entrypoint script +function get-entrypoint-script-name() +{ + echo "${1#"$ENTRYPOINT_D_ROOT"}" +} + +# @description Ensure a command is only run once (via a 'lock' file) in the storage directory. +# The 'lock' is only written if the passed in command ($2) successfully ran. +# @arg $1 string The name of the lock file +# @arg $@ string The command to run +function only-once() +{ + local name="${1:-$script_name}" + local file="${docker_once_path}/${name}" + shift + + if [[ -e "${file}" ]]; then + log-info "Command [${*}] has already run once before (remove file [${file}] to run it again)" + + return 0 + fi + + ensure-directory-exists "$(dirname "${file}")" + + if ! "$@"; then + return 1 + fi + + stream-prefix-command-output touch "${file}" + return 0 +} + +# @description Best effort file lock to ensure *something* is not running in multiple containers. +# The script uses "trap" to clean up after itself if the script crashes +# @arg $1 string The lock identifier +function acquire-lock() +{ + local name="${1:-$script_name}" + local file="${docker_locks_path}/${name}" + local lock_fd + + ensure-directory-exists "$(dirname "${file}")" + + exec {lock_fd}>"$file" + + log-info "🔑 Trying to acquire lock: ${file}: " + while ! ([[ -v lock_fds[$name] ]] || flock -n -x "$lock_fd"); do + log-info "🔒 Waiting on lock ${file}" + + staggered-sleep + done + + [[ -v lock_fds[$name] ]] || lock_fds[$name]=$lock_fd + + log-info "🔐 Lock acquired [${file}]" + + on-trap "release-lock ${name}" EXIT INT QUIT TERM +} + +# @description Release a lock aquired by [acquire-lock] +# @arg $1 string The lock identifier +function release-lock() +{ + local name="${1:-$script_name}" + local file="${docker_locks_path}/${name}" + + log-info "🔓 Releasing lock [${file}]" + + [[ -v lock_fds[$name] ]] || return + + # shellcheck disable=SC1083,SC2086 + flock --unlock ${lock_fds[$name]} + unset 'lock_fds[$name]' +} + +# @description Helper function to append multiple actions onto +# the bash [trap] logic +# @arg $1 string The command to run +# @arg $@ string The list of trap signals to register +function on-trap() +{ + local trap_add_cmd=$1 + shift || log-error-and-exit "${FUNCNAME[0]} usage error" + + for trap_add_name in "$@"; do + trap -- "$( + # helper fn to get existing trap command from output + # of trap -p + # + # shellcheck disable=SC2317 + extract_trap_cmd() + { + printf '%s\n' "${3:-}" + } + # print existing trap command with newline + eval "extract_trap_cmd $(trap -p "${trap_add_name}")" + # print the new trap command + printf '%s\n' "${trap_add_cmd}" + )" "${trap_add_name}" \ + || log-error-and-exit "unable to add to trap ${trap_add_name}" + done +} + +# Set the trace attribute for the above function. +# +# This is required to modify DEBUG or RETURN traps because functions don't +# inherit them unless the trace attribute is set +declare -f -t on-trap + +# @description Waits for the database to be healthy and responsive +function await-database-ready() +{ + log-info "❓ Waiting for database to be ready" + + load-config-files + + case "${DB_CONNECTION:-}" in + mysql) + # shellcheck disable=SC2154 + while ! echo "SELECT 1" | mysql --user="${DB_USERNAME}" --password="${DB_PASSWORD}" --host="${DB_HOST}" "${DB_DATABASE}" --silent >/dev/null; do + staggered-sleep + done + ;; + + pgsql) + # shellcheck disable=SC2154 + while ! echo "SELECT 1" | PGPASSWORD="${DB_PASSWORD}" psql --user="${DB_USERNAME}" --host="${DB_HOST}" "${DB_DATABASE}" >/dev/null; do + staggered-sleep + done + ;; + + sqlsrv) + log-warning "Don't know how to check if SQLServer is *truely* ready or not - so will just check if we're able to connect to it" + + # shellcheck disable=SC2154 + while ! timeout 1 bash -c "cat < /dev/null > /dev/tcp/${DB_HOST}/${DB_PORT}"; do + staggered-sleep + done + ;; + + sqlite) + log-info "${success_message_color}sqlite is always ready${color_clear}" + ;; + + *) + log-error-and-exit "Unknown database type: [${DB_CONNECTION:-}]" + ;; + esac + + log-info "${success_message_color}✅ Successfully connected to database${color_clear}" +} + +# @description sleeps between 1 and 3 seconds to ensure a bit of randomness +# in multiple scripts/containers doing work almost at the same time. +function staggered-sleep() +{ + sleep "$(get-random-number-between 1 3)" +} + +# @description Helper function to get a random number between $1 and $2 +# @arg $1 int Minimum number in the range (inclusive) +# @arg $2 int Maximum number in the range (inclusive) +function get-random-number-between() +{ + local -i from=${1:-1} + local -i to="${2:-10}" + + shuf -i "${from}-${to}" -n 1 +} + +# @description Helper function to show the bask call stack when something +# goes wrong. Is super useful when needing to debug an issue +function show-call-stack() +{ + local stack_size=${#FUNCNAME[@]} + local func + local lineno + local src + + # to avoid noise we start with 1 to skip the get_stack function + for ((i = 1; i < stack_size; i++)); do + func="${FUNCNAME[$i]}" + [ -z "$func" ] && func="MAIN" + + lineno="${BASH_LINENO[$((i - 1))]}" + src="${BASH_SOURCE[$i]}" + [ -z "$src" ] && src="non_file_source" + + log-error " at: ${func} ${src}:${lineno}" + done +} + +# @description Helper function see if $1 could be considered truthy +# returns [0] if input is truthy, otherwise [1] +# @arg $1 string The string to evaluate +# @see as-boolean +function is-true() +{ + as-boolean "${1:-}" && return 0 + + return 1 +} + +# @description Helper function see if $1 could be considered falsey +# returns [0] if input is falsey, otherwise [1] +# @arg $1 string The string to evaluate +# @see as-boolean +function is-false() +{ + as-boolean "${1:-}" && return 1 + + return 0 +} + +# @description Helper function see if $1 could be truethy or falsey. +# since this is a bash context, returning 0 is true and 1 is false +# so it works with [if is-false $input; then .... fi] +# +# This is a bit confusing, *especially* in a PHP world where [1] would be truthy and +# [0] would be falsely as return values +# @arg $1 string The string to evaluate +function as-boolean() +{ + local input="${1:-}" + local var="${input,,}" # convert input to lower-case + + case "$var" in + 1 | true) + return 0 + ;; + + 0 | false) + return 1 + ;; + + *) + log-warning "[as-boolean] variable [${var}] could not be detected as true or false, returning [1] (false) as default" + + return 1 + ;; + + esac +} diff --git a/docker/shared/root/docker/install/base.sh b/docker/shared/root/docker/install/base.sh new file mode 100755 index 000000000..a1a32a003 --- /dev/null +++ b/docker/shared/root/docker/install/base.sh @@ -0,0 +1,61 @@ +#!/bin/bash +set -ex -o errexit -o nounset -o pipefail + +# Ensure we keep apt cache around in a Docker environment +rm -f /etc/apt/apt.conf.d/docker-clean +echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache + +# Don't install recommended packages by default +echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf + +# Don't install suggested packages by default +echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf + +declare -a packages=() + +# Standard packages +packages+=( + apt-utils + ca-certificates + curl + git + gnupg1 + gosu + locales + locales-all + moreutils + nano + procps + software-properties-common + unzip + wget + zip +) + +# Image Optimization +packages+=( + gifsicle + jpegoptim + optipng + pngquant +) + +# Video Processing +packages+=( + ffmpeg +) + +# Database +packages+=( + mariadb-client + postgresql-client +) + +readarray -d ' ' -t -O "${#packages[@]}" packages < <(echo -n "${APT_PACKAGES_EXTRA:-}") + +apt-get update +apt-get upgrade -y +apt-get install -y "${packages[@]}" + +locale-gen +update-locale diff --git a/docker/shared/root/docker/install/php-extensions.sh b/docker/shared/root/docker/install/php-extensions.sh new file mode 100755 index 000000000..222f2374d --- /dev/null +++ b/docker/shared/root/docker/install/php-extensions.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -ex -o errexit -o nounset -o pipefail + +declare -a pecl_extensions=() + +readarray -d ' ' -t pecl_extensions < <(echo -n "${PHP_PECL_EXTENSIONS:-}") +readarray -d ' ' -t -O "${#pecl_extensions[@]}" pecl_extensions < <(echo -n "${PHP_PECL_EXTENSIONS_EXTRA:-}") + +declare -a php_extensions=() +readarray -d ' ' -t php_extensions < <(echo -n "${PHP_EXTENSIONS:-}") +readarray -d ' ' -t -O "${#php_extensions[@]}" php_extensions < <(echo -n "${PHP_EXTENSIONS_EXTRA:-}") +readarray -d ' ' -t -O "${#php_extensions[@]}" php_extensions < <(echo -n "${PHP_EXTENSIONS_DATABASE:-}") + +# Optional script folks can copy into their image to do any [docker-php-ext-configure] work before the [docker-php-ext-install] +# this can also overwirte the [gd] configure above by simply running it again +declare -r custom_pre_configure_script="" +if [[ -e "${custom_pre_configure_script}" ]]; then + if [ ! -x "${custom_pre_configure_script}" ]; then + echo >&2 "ERROR: found ${custom_pre_configure_script} but its not executable - please [chmod +x] the file!" + exit 1 + fi + + "${custom_pre_configure_script}" +fi + +# PECL + PHP extensions +IPE_KEEP_SYSPKG_CACHE=1 install-php-extensions "${pecl_extensions[@]}" "${php_extensions[@]}" diff --git a/docker/shared/root/docker/templates/shared/proxy/conf.d/docker-pixelfed.conf b/docker/shared/root/docker/templates/shared/proxy/conf.d/docker-pixelfed.conf new file mode 100644 index 000000000..0b221e604 --- /dev/null +++ b/docker/shared/root/docker/templates/shared/proxy/conf.d/docker-pixelfed.conf @@ -0,0 +1,16 @@ +########################################################### +# DO NOT CHANGE +########################################################### +# This file is generated by the Pixelfed Docker setup, and +# will be rewritten on every container start +# +# You can put any [.conf] file in this directory +# (docker-compose-state/config/proxy/conf.d) and it will +# be loaded by nginx on startup. +# +# Run [docker compose exec proxy bash -c 'nginx -t && nginx -s reload'] +# to test your config and reload the proxy +# +# See: https://github.com/nginx-proxy/nginx-proxy/blob/main/docs/README.md#custom-nginx-configuration + +client_max_body_size {{ getenv "POST_MAX_SIZE" "61M" }}; diff --git a/contrib/docker/php.production.ini b/docker/shared/root/docker/templates/usr/local/etc/php/php.ini similarity index 98% rename from contrib/docker/php.production.ini rename to docker/shared/root/docker/templates/usr/local/etc/php/php.ini index b84839ff5..130166e80 100644 --- a/contrib/docker/php.production.ini +++ b/docker/shared/root/docker/templates/usr/local/etc/php/php.ini @@ -363,7 +363,7 @@ zend.enable_gc = On ; Allows to include or exclude arguments from stack traces generated for exceptions ; Default: Off -; In production, it is recommended to turn this setting on to prohibit the output +; In production, it is recommended to turn this setting on to prohibit the output ; of sensitive information in stack traces zend.exception_ignore_args = On @@ -376,7 +376,7 @@ zend.exception_ignore_args = On ; threat in any way, but it makes it possible to determine whether you use PHP ; on your server or not. ; http://php.net/expose-php -expose_php = On +expose_php = Off ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; @@ -406,7 +406,7 @@ max_input_time = 60 ; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit -memory_limit = 128M +memory_limit = {{ getenv "DOCKER_APP_PHP_MEMORY_LIMIT" "128M" }} ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Error handling and logging ; @@ -462,7 +462,7 @@ memory_limit = 128M ; Development Value: E_ALL ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; http://php.net/error-reporting -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT +error_reporting = {{ getenv "DOCKER_APP_PHP_ERROR_REPORTING" "E_ALL & ~E_DEPRECATED & ~E_STRICT" }} ; This directive controls whether or not and where PHP will output errors, ; notices and warnings too. Error output is very useful during development, but @@ -479,7 +479,7 @@ error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT ; Development Value: On ; Production Value: Off ; http://php.net/display-errors -display_errors = Off +display_errors = {{ getenv "DOCKER_APP_PHP_DISPLAY_ERRORS" "off" }} ; The display of errors which occur during PHP's startup sequence are handled ; separately from display_errors. We strongly recommend you set this to 'off' @@ -488,7 +488,7 @@ display_errors = Off ; Development Value: On ; Production Value: Off ; http://php.net/display-startup-errors -display_startup_errors = Off +display_startup_errors = {{ getenv "DOCKER_APP_PHP_DISPLAY_ERRORS" "off" }} ; Besides displaying errors, PHP can also log errors to locations such as a ; server-specific log, STDERR, or a location specified by the error_log @@ -570,8 +570,9 @@ report_memleaks = On ; Log errors to specified file. PHP's default behavior is to leave this value ; empty. ; http://php.net/error-log -; Example: -;error_log = php_errors.log +; +; NOTE: Write error log to stderr (/proc/self/fd/2 -> /dev/stderr) +error_log = /proc/self/fd/2 ; Log errors to syslog (Event Log on Windows). ;error_log = syslog @@ -679,7 +680,7 @@ auto_globals_jit = On ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. ; http://php.net/post-max-size -post_max_size = 64M +post_max_size = {{ getenv "POST_MAX_SIZE" "61M" }} ; Automatically add files before PHP document. ; http://php.net/auto-prepend-file @@ -831,10 +832,10 @@ file_uploads = On ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize -upload_max_filesize = 64M +upload_max_filesize = {{ getenv "POST_MAX_SIZE" "61M" }} ; Maximum number of files that can be uploaded via a single request -max_file_uploads = 20 +max_file_uploads = {{ getenv "MAX_ALBUM_LENGTH" "4" }} ;;;;;;;;;;;;;;;;;; ; Fopen wrappers ; @@ -947,7 +948,7 @@ cli_server.color = On [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone -;date.timezone = +date.timezone = {{ getenv "TZ" "UTC" }} ; http://php.net/date.default-latitude ;date.default_latitude = 31.7667 @@ -1735,7 +1736,7 @@ ldap.max_links = -1 [opcache] ; Determines if Zend OPCache is enabled -;opcache.enable=1 +opcache.enable={{ getenv "DOCKER_APP_PHP_OPCACHE_ENABLE" "1" }} ; Determines if Zend OPCache is enabled for the CLI version of PHP ;opcache.enable_cli=0 @@ -1761,12 +1762,12 @@ ldap.max_links = -1 ; When disabled, you must reset the OPcache manually or restart the ; webserver for changes to the filesystem to take effect. -;opcache.validate_timestamps=1 +opcache.validate_timestamps={{ getenv "DOCKER_APP_PHP_OPCACHE_VALIDATE_TIMESTAMPS" "0" }} ; How often (in seconds) to check file timestamps for changes to the shared ; memory storage allocation. ("1" means validate once per second, but only ; once per request. "0" means always validate) -;opcache.revalidate_freq=2 +opcache.revalidate_freq={{ getenv "DOCKER_APP_PHP_OPCACHE_REVALIDATE_FREQ" "2" }} ; Enables or disables file search in include_path optimization ;opcache.revalidate_path=0 diff --git a/docker/shared/root/shared/proxy/conf.d/.gitignore b/docker/shared/root/shared/proxy/conf.d/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docker/shell b/docker/shell new file mode 100755 index 000000000..7b725e1b0 --- /dev/null +++ b/docker/shell @@ -0,0 +1,17 @@ +#!/bin/bash + +declare service="${PF_SERVICE:=worker}" +declare user="${PF_USER:=www-data}" + +declare -a command=("bash") + +if [[ $# -ge 1 ]]; then + command=("$@") +fi + +exec docker compose exec \ + --user "${user}" \ + --env TERM \ + --env COLORTERM \ + "${service}" \ + "${command[@]}" diff --git a/goss.yaml b/goss.yaml new file mode 100644 index 000000000..73f245c64 --- /dev/null +++ b/goss.yaml @@ -0,0 +1,123 @@ +# See: https://github.com/goss-org/goss/blob/master/docs/manual.md#goss-manual + +package: + curl: { installed: true } + ffmpeg: { installed: true } + gifsicle: { installed: true } + gosu: { installed: true } + jpegoptim: { installed: true } + locales-all: { installed: true } + locales: { installed: true } + mariadb-client: { installed: true } + nano: { installed: true } + optipng: { installed: true } + pngquant: { installed: true } + postgresql-client: { installed: true } + unzip: { installed: true } + wget: { installed: true } + zip: { installed: true } + +user: + www-data: + exists: true + uid: 33 + gid: 33 + groups: + - www-data + home: /var/www + shell: /usr/sbin/nologin + +command: + php-version: + exit-status: 0 + exec: 'php -v' + stdout: + - PHP {{ .Env.EXPECTED_PHP_VERSION }} + stderr: [] + + php-extensions: + exit-status: 0 + exec: 'php -m' + stdout: + - bcmath + - Core + - ctype + - curl + - date + - dom + - exif + - fileinfo + - filter + - gd + - hash + - iconv + - imagick + - intl + - json + - libxml + - mbstring + - mysqlnd + - openssl + - pcntl + - pcre + - PDO + - pdo_mysql + - pdo_pgsql + - pdo_sqlite + - Phar + - posix + - readline + - redis + - Reflection + - session + - SimpleXML + - sodium + - SPL + - sqlite3 + - standard + - tokenizer + - xml + - xmlreader + - xmlwriter + - zip + - zlib + stderr: [] + + forego-version: + exit-status: 0 + exec: 'forego version' + stdout: + - dev + stderr: [] + + gomplate-version: + exit-status: 0 + exec: 'gomplate -v' + stdout: + - gomplate version + stderr: [] + + gosu-version: + exit-status: 0 + exec: 'gosu -v' + stdout: + - '1.12' + stderr: [] + +{{ if eq .Env.PHP_BASE_TYPE "nginx" }} + nginx-version: + exit-status: 0 + exec: 'nginx -v' + stdout: [] + stderr: + - 'nginx version: nginx' +{{ end }} + +{{ if eq .Env.PHP_BASE_TYPE "apache" }} + apache-version: + exit-status: 0 + exec: 'apachectl -v' + stdout: + - 'Server version: Apache/' + stderr: [] +{{ end }} diff --git a/public/js/compose.chunk.a0cfdf07f5062445.js b/public/js/compose.chunk.a0cfdf07f5062445.js new file mode 100644 index 000000000..e3069dc9f --- /dev/null +++ b/public/js/compose.chunk.a0cfdf07f5062445.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[9124],{66517:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(5787),s=a(28772),o=a(19324);const n={components:{drawer:i.default,sidebar:s.default,"compose-modal":o.default},data:function(){return{isLoaded:!1,profile:void 0}},mounted:function(){this.profile=window._sharedData.user,this.isLoaded=!0},methods:{closeModal:function(){this.$router.push("/i/web")}}}},50371:(t,e,a)=>{a.r(e),a.d(e,{default:()=>i});const i={data:function(){return{user:window._sharedData.user}}}},84154:(t,e,a)=>{a.r(e),a.d(e,{default:()=>i});const i={props:["user"],data:function(){return{loaded:!1,avatarUpdateIndex:0,avatarUpdateFile:void 0,avatarUpdatePreview:void 0}},methods:{open:function(){this.$refs.avatarUpdateModal.show()},avatarUpdateClose:function(){this.$refs.avatarUpdateModal.hide(),this.avatarUpdateIndex=0,this.avatarUpdateFile=void 0},avatarUpdateClear:function(){this.avatarUpdateIndex=0,this.avatarUpdateFile=void 0},avatarUpdateStep:function(t){this.$refs.avatarUpdateRef.click(),this.avatarUpdateIndex=t},handleAvatarUpdate:function(){var t=this,e=event.target.files;Array.prototype.forEach.call(e,(function(e,a){t.avatarUpdateFile=e,t.avatarUpdatePreview=URL.createObjectURL(e),t.avatarUpdateIndex=1}))},handleDrop:function(t){t.preventDefault();var e=this;if(t.dataTransfer.items){for(var a=0;a{a.r(e),a.d(e,{default:()=>l});var i=a(95353),s=a(90414);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function n(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function r(t,e,a){var i;return i=function(t,e){if("object"!=o(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==o(i)?i:String(i))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const l={props:{user:{type:Object,default:function(){return{avatar:"/storage/avatars/default.jpg",username:!1,display_name:"",following_count:0,followers_count:0}}},links:{type:Array,default:function(){return[{name:"Discover",path:"/i/web/discover",icon:"fas fa-compass"},{name:"Groups",path:"/i/web/groups",icon:"far fa-user-friends"},{name:"Videos",path:"/i/web/videos",icon:"far fa-video"}]}}},components:{UpdateAvatar:s.default},computed:function(t){for(var e=1;e)?/g,(function(e){var a=e.slice(1,e.length-1),i=t.getCustomEmoji.filter((function(t){return t.shortcode==a}));return i.length?''.concat(i[0].shortcode,''):e}))}return a},gotoMyProfile:function(){var t=this.user;this.$router.push({name:"profile",path:"/i/web/profile/".concat(t.id),params:{id:t.id,cachedProfile:t,cachedUser:t}})},formatCount:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-GB",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compact";return new Intl.NumberFormat(e,{notation:a,compactDisplay:"short"}).format(t)},updateAvatar:function(){event.currentTarget.blur(),this.$refs.avatarUpdate.open()},createNewPost:function(){this.$refs.createPostModal.show()},goToFeed:function(t){var e=this.$route.path;switch(t){case"home":"/i/web"==e?this.$emit("refresh"):this.$router.push("/i/web");break;case"local":"/i/web/timeline/local"==e?this.$emit("refresh"):this.$router.push({name:"timeline",params:{scope:"local"}});break;case"global":"/i/web/timeline/global"==e?this.$emit("refresh"):this.$router.push({name:"timeline",params:{scope:"global"}})}}}}},28320:(t,e,a)=>{a.r(e),a.d(e,{default:()=>c});var i=a(91584),s=(a(77333),a(2e4)),o=(a(87980),a(79288)),n=a(74692);function r(t){return function(t){if(Array.isArray(t))return l(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)return;if("string"==typeof t)return l(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return l(t,e)}(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 l(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a10&&(t.licenseTitle=t.availableLicenses.filter((function(e){return e.id==t.licenseId})).map((function(t){return t.title}))[0]),t.fetchProfile()}))},mounted:function(){this.mediaWatcher()},methods:{timeAgo:function(t){return App.util.format.timeAgo(t)},formatBytes:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+t)return"0 Bytes";var a=e<0?0:e,i=Math.floor(Math.log(t)/Math.log(1024));return"".concat(parseFloat((t/Math.pow(1024,i)).toFixed(a))," ").concat(["Bytes","KB","MB","GB","TB"][i])},defineErrorMessage:function(t){if(t.response)t.response.data.message&&t.response.data.message;else t.message;return swal("Oops, something went wrong!",msg,"error")},fetchProfile:function(){var t=this,e={public:"Public",private:"Followers Only",unlisted:"Unlisted"};if(window._sharedData.curUser.id){if(this.profile=window._sharedData.curUser,this.composeSettings&&this.composeSettings.hasOwnProperty("default_scope")&&this.composeSettings.default_scope){var a=this.composeSettings.default_scope;this.visibility=a,this.visibilityTag=e[a]}1==this.profile.locked&&(this.visibility="private",this.visibilityTag="Followers Only")}else axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(a){if(window._sharedData.currentUser=a.data,t.profile=a.data,t.composeSettings&&t.composeSettings.hasOwnProperty("default_scope")&&t.composeSettings.default_scope){var i=t.composeSettings.default_scope;t.visibility=i,t.visibilityTag=e[i]}1==t.profile.locked&&(t.visibility="private",t.visibilityTag="Followers Only")})).catch((function(t){}))},addMedia:function(t){var e=n(t.target);e.attr("disabled",""),n('.file-input[name="media"]').trigger("click"),e.blur(),e.removeAttr("disabled")},addText:function(t){this.pageTitle="New Text Post",this.page="addText",this.textMode=!0,this.mode="text"},mediaWatcher:function(){var t=this;n(document).on("change","#pf-dz",(function(e){t.mediaUpload()}))},mediaUpload:function(){var t=this;t.uploading=!0;var e=document.querySelector("#pf-dz");e.files.length||(t.uploading=!1),Array.prototype.forEach.call(e.files,(function(e,a){if(t.media&&t.media.length+a>=t.config.uploader.album_limit)return swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error"),t.uploading=!1,void(t.page=2);var i=e.type,s=t.config.uploader.media_types.split(",");if(-1==n.inArray(i,s))return swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.config.uploader.media_types+" only.","error"),t.uploading=!1,void(t.page=2);var o=new FormData;o.append("file",e);var r={onUploadProgress:function(e){var a=Math.round(100*e.loaded/e.total);t.uploadProgress=a}};axios.post("/api/compose/v0/media/upload",o,r).then((function(e){t.uploadProgress=100,t.ids.push(e.data.id),t.media.push(e.data),t.uploading=!1,setTimeout((function(){t.page=3}),300)})).catch((function(a){switch(a.response.status){case 403:t.uploading=!1,e.value=null,swal("Account size limit reached","Contact your admin for assistance.","error"),t.page=2;break;case 413:t.uploading=!1,e.value=null,swal("File is too large","The file you uploaded has the size of "+t.formatBytes(e.size)+". Unfortunately, only images up to "+t.formatBytes(1024*t.config.uploader.max_photo_size)+" are supported.\nPlease resize the file and try again.","error"),t.page=2;break;case 451:t.uploading=!1,e.value=null,swal("Banned Content","This content has been banned and cannot be uploaded.","error"),t.page=2;break;case 429:t.uploading=!1,e.value=null,swal("Limit Reached","You can upload up to 250 photos or videos per day and you've reached that limit. Please try again later.","error"),t.page=2;break;case 500:t.uploading=!1,e.value=null,swal("Error",a.response.data.message,"error"),t.page=2;break;default:t.uploading=!1,e.value=null,swal("Oops, something went wrong!","An unexpected error occurred.","error"),t.page=2}})),e.value=null,t.uploadProgress=0}))},toggleFilter:function(t,e){this.media[this.carouselCursor].filter_class=e,this.currentFilter=e},deleteMedia:function(){var t=this;if(0!=window.confirm("Are you sure you want to delete this media?")){var e=this.media[this.carouselCursor].id;axios.delete("/api/compose/v0/media/delete",{params:{id:e}}).then((function(e){t.ids.splice(t.carouselCursor,1),t.media.splice(t.carouselCursor,1),0==t.media.length?(t.ids=[],t.media=[],t.carouselCursor=0):t.carouselCursor=0})).catch((function(t){swal("Whoops!","An error occured when attempting to delete this, please try again","error")}))}},mediaReorder:function(t){var e=this,a=this.media,i=this.carouselCursor,s=a[i],o=[],n=0;if("prev"==t)if(0==i){for(var r=n;r=0&&e=0&&athis.config.uploader.max_caption_length)swal("Error","Caption is too long","error");else switch(e){case"publish":if(this.isPosting=!0,this.media.filter((function(t){return t.filter_class&&!t.hasOwnProperty("is_filtered")})).length)return void this.applyFilterToMedia();if(!0===this.composeSettings.media_descriptions)if(this.media.filter((function(t){return!t.hasOwnProperty("alt")||t.alt.length<2})).length)return swal("Missing media descriptions","You have enabled mandatory media descriptions. Please add media descriptions under Advanced settings to proceed. For more information, please see the media settings page.","warning"),void(this.isPosting=!1);if(0==this.media.length)return void swal("Whoops!","You need to add media before you can save this!","warning");"Add optional caption..."==this.composeText&&(this.composeText="");var a={media:this.media,caption:this.composeText,visibility:this.visibility,cw:this.nsfw,comments_disabled:this.commentsDisabled,place:this.place,tagged:this.taggedUsernames,optimize_media:this.optimizeMedia,license:this.licenseId,video:this.video,spoiler_text:this.spoilerText};return this.collectionsSelected.length&&(a.collections=this.collectionsSelected.map((function(e){return t.collections[e].id}))),void axios.post("/api/compose/v0/publish",a).then((function(t){"/i/web/compose"===location.pathname&&t.data&&t.data.length?location.href="/i/web/post/"+t.data.split("/").slice(-1)[0]:location.href=t.data})).catch((function(e){if(400===e.response.status)"Must contain a single photo or video or multiple photos."==e.response.data.error?swal("Wrong types of mixed media","The album must contain a single photo or video or multiple photos.","error"):t.defineErrorMessage(e);else t.defineErrorMessage(e)}));case"delete":return this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void n("#composeModal").modal("hide")}},composeTextPost:function(){var t=this.composeState;if(this.composeText.length>this.config.uploader.max_caption_length)swal("Error","Caption is too long","error");else switch(t){case"publish":var e={caption:this.composeText,visibility:this.visibility,cw:this.nsfw,comments_disabled:this.commentsDisabled,place:this.place,tagged:this.taggedUsernames};return void axios.post("/api/compose/v0/publish/text",e).then((function(t){var e=t.data;window.location.href=e})).catch((function(t){var e=t.response.data.message?t.response.data.message:"An unexpected error occured.";swal("Oops, something went wrong!",e,"error")}));case"delete":return this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void n("#composeModal").modal("hide")}},closeModal:function(){n("#composeModal").modal("hide"),this.$emit("close")},goBack:function(){switch(this.pageTitle="",this.mode){case"photo":switch(this.page){case"filteringMedia":case"cropPhoto":case"editMedia":this.page=2;break;case"addText":case"video-2":this.page=1;break;case"textOptions":this.page="addText";break;case"tagPeopleHelp":this.showTagCard();break;case"licensePicker":this.page=3;break;default:-1!=this.namedPages.indexOf(this.page)?this.page=3:this.page--}break;case"video":if("filteringMedia"===this.page)this.page=2;else this.page="video-2";break;default:switch(this.page){case"addText":case"video-2":this.page=1;break;case"filteringMedia":case"cropPhoto":case"editMedia":this.page=2;break;case"textOptions":this.page="addText";break;case"tagPeopleHelp":this.showTagCard();break;case"licensePicker":this.page=3;break;default:-1!=this.namedPages.indexOf(this.page)?this.page="text"==this.mode?"addText":3:"text"==this.mode||this.page--}}},nextPage:function(){switch(this.pageTitle="",this.page){case 1:this.page=2;break;case"filteringMedia":break;case"cropPhoto":this.pageLoading=!0;var t=this;this.$refs.cropper.getCroppedCanvas({maxWidth:4096,maxHeight:4096,fillColor:"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((function(e){t.mediaCropped=!0;var a=new FormData;a.append("file",e),a.append("id",t.ids[t.carouselCursor]);axios.post("/api/compose/v0/media/update",a).then((function(e){t.media[t.carouselCursor].url=e.data.url,t.pageLoading=!1,t.page=2})).catch((function(t){}))}));break;case 2:case 3:this.page++}},rotate:function(){this.$refs.cropper.rotate(90)},changeAspect:function(t){this.cropper.aspectRatio=t,this.$refs.cropper.setAspectRatio(t)},showTagCard:function(){this.pageTitle="Tag People",this.page="tagPeople"},showTagHelpCard:function(){this.pageTitle="About Tag People",this.page="tagPeopleHelp"},showLocationCard:function(){this.pageTitle="Add Location",this.page="addLocation"},showAdvancedSettingsCard:function(){this.pageTitle="Advanced Settings",this.page="advancedSettings"},locationSearch:function(t){if(t.length<1)return[];return axios.get("/api/compose/v0/search/location",{params:{q:t}}).then((function(t){return t.data}))},getResultValue:function(t){return t.name+", "+t.country},onSubmitLocation:function(t){switch(this.place=t,this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},showVisibilityCard:function(){this.pageTitle="Post Visibility",this.page="visibility"},showAddToStoryCard:function(){this.pageTitle="Add to Story",this.page="addToStory"},showCropPhotoCard:function(){this.pageTitle="Edit Photo",this.page="cropPhoto"},toggleVisibility:function(t){switch(this.visibility=t,this.visibilityTag={public:"Public",private:"Followers Only",unlisted:"Unlisted"}[t],this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},showMediaDescriptionsCard:function(){this.pageTitle="Media Descriptions",this.page="altText"},showAddToCollectionsCard:function(){this.pageTitle="Add to Collection",this.page="addToCollection"},showSchedulePostCard:function(){this.pageTitle="Schedule Post",this.page="schedulePost"},showEditMediaCard:function(){this.pageTitle="Edit Media",this.page="editMedia"},fetchCameraRollDrafts:function(){var t=this;axios.get("/api/pixelfed/local/drafts").then((function(e){t.cameraRollMedia=e.data}))},applyFilterToMedia:function(){var t=this,e=navigator.userAgent.toLowerCase();if(-1==e.indexOf("firefox")&&-1==e.indexOf("chrome"))return this.isPosting=!1,swal("Oops!","Your browser does not support the filter feature.","error"),void(this.page=3);var a=this.media.filter((function(t){return t.filter_class})).length;a?(this.page="filteringMedia",this.filteringRemainingCount=a,this.$nextTick((function(){t.isFilteringMedia=!0,t.media.forEach((function(e,a){return t.applyFilterToMediaSave(e,a)}))}))):this.page=3},applyFilterToMediaSave:function(t,e){if(t.filter_class){var a=this,i=null,s=document.createElement("canvas"),o=s.getContext("2d"),n=document.createElement("img");n.src=t.url,n.addEventListener("load",(function(r){s.width=n.width,s.height=n.height,o.filter=App.util.filterCss[t.filter_class],o.drawImage(n,0,0,n.width,n.height),o.save(),s.toBlob((function(s){(i=new FormData).append("file",s),i.append("id",t.id),axios.post("/api/compose/v0/media/update",i).then((function(t){a.media[e].is_filtered=!0,a.updateFilteringMedia()})).catch((function(t){}))}))}),t.mime,.9),o.clearRect(0,0,n.width,n.height)}},updateFilteringMedia:function(){var t=this;this.filteringRemainingCount--,this.filteringMediaTimeout=setTimeout((function(){return t.filteringMediaTimeoutJob()}),500)},filteringMediaTimeoutJob:function(){var t=this;0===this.filteringRemainingCount?(this.isFilteringMedia=!1,clearTimeout(this.filteringMediaTimeout),setTimeout((function(){return t.compose()}),500)):(clearTimeout(this.filteringMediaTimeout),this.filteringMediaTimeout=setTimeout((function(){return t.filteringMediaTimeoutJob()}),1e3))},tagSearch:function(t){if(t.length<1)return[];var e=this;return axios.get("/api/compose/v0/search/tag",{params:{q:t}}).then((function(t){if(t.data.length)return t.data.filter((function(t){return 0==e.taggedUsernames.filter((function(e){return e.id==t.id})).length}))}))},getTagResultValue:function(t){return"@"+t.name},onTagSubmitLocation:function(t){this.taggedUsernames.filter((function(e){return e.id==t.id})).length||(this.taggedUsernames.push(t),this.$refs.autocomplete.value="")},untagUsername:function(t){this.taggedUsernames.splice(t,1)},showTextOptions:function(){this.page="textOptions",this.pageTitle="Text Post Options"},showLicenseCard:function(){this.pageTitle="Select a License",this.page="licensePicker"},toggleLicense:function(t){var e=this;switch(this.licenseId=t.id,this.licenseId>10?this.licenseTitle=this.availableLicenses.filter((function(t){return t.id==e.licenseId})).map((function(t){return t.title}))[0]:this.licenseTitle=null,this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},newPoll:function(){this.page="poll"},savePollOption:function(){-1==this.pollOptions.indexOf(this.pollOptionModel)?(this.pollOptions.push(this.pollOptionModel),this.pollOptionModel=null):this.pollOptionModel=null},deletePollOption:function(t){this.pollOptions.splice(t,1)},postNewPoll:function(){var t=this;this.postingPoll=!0,axios.post("/api/compose/v0/poll",{caption:this.composeText,cw:!1,visibility:this.visibility,comments_disabled:!1,expiry:this.pollExpiry,pollOptions:this.pollOptions}).then((function(e){if(!e.data.hasOwnProperty("url"))return swal("Oops!","An error occured while attempting to create this poll. Please refresh the page and try again.","error"),void(t.postingPoll=!1);window.location.href=e.data.url})).catch((function(e){if(e.response.data.hasOwnProperty("error")&&"Duplicate detected."==e.response.data.error)return t.postingPoll=!1,void swal("Oops!","The poll you are trying to create is similar to an existing poll you created. Please make the poll question (caption) unique.","error");t.postingPoll=!1,swal("Oops!","An error occured while attempting to create this poll. Please refresh the page and try again.","error")}))},filesize:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return filesize(1024*t,{round:0})})),showCollectionCard:function(){this.pageTitle="Add to Collection(s)",this.page="addToCollection",this.collectionsLoaded||this.fetchCollections()},fetchCollections:function(){var t=this;axios.get("/api/local/profile/collections/".concat(this.profile.id)).then((function(e){t.collections=e.data,t.collectionsLoaded=!0,t.collectionsCanLoadMore=9==e.data.length,t.collectionsPage++}))},toggleCollectionItem:function(t){if(this.collectionsSelected.includes(t))this.collectionsSelected=this.collectionsSelected.filter((function(e){return e!=t}));else{if(7==this.collectionsSelected.length)return void swal("Oops!","You can only share to 5 collections.","info");this.collectionsSelected.push(t)}},clearSelectedCollections:function(){this.collectionsSelected=[],this.pageTitle="Compose",this.page=3},loadMoreCollections:function(){var t=this;this.collectionsCanLoadMore=!1,axios.get("/api/local/profile/collections/".concat(this.profile.id),{params:{page:this.collectionsPage}}).then((function(e){var a,i=t.collections.map((function(t){return t.id})),s=e.data.filter((function(t){return!i.includes(t.id)}));s&&s.length&&((a=t.collections).push.apply(a,r(s)),t.collectionsPage++,t.collectionsCanLoadMore=!0)}))}}}},32463:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"web-wrapper"},[t.isLoaded?e("div",{staticClass:"container-fluid mt-3"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-3 d-md-block"},[e("sidebar",{attrs:{user:t.profile}})],1),t._v(" "),e("div",{staticClass:"col-md-8"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-12 col-md-8 offset-md-1"},[e("compose-modal",{on:{close:t.closeModal}})],1)])])]),t._v(" "),e("drawer")],1):t._e()])},s=[]},69831:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"app-drawer-component"},[e("div",{staticClass:"mobile-footer-spacer d-block d-sm-none mt-5"}),t._v(" "),e("div",{staticClass:"mobile-footer d-block d-sm-none fixed-bottom"},[e("div",{staticClass:"card card-body rounded-0 px-0 pt-2 pb-3 box-shadow",staticStyle:{"border-top":"1px solid var(--border-color)"}},[e("ul",{staticClass:"nav nav-pills nav-fill d-flex align-items-middle"},[e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web"}},[e("p",[e("i",{staticClass:"far fa-home fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("Home")])])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web/timeline/local"}},[e("p",[e("i",{staticClass:"far fa-stream fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("Local")])])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web/compose"}},[e("p",[e("i",{staticClass:"far fa-plus-circle fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("New")])])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web/notifications"}},[e("p",[e("i",{staticClass:"far fa-bell fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("Alerts")])])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web/profile/"+t.user.id}},[e("p",[e("i",{staticClass:"far fa-user fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("Profile")])])])],1)])])])])},s=[]},67153:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("b-modal",{ref:"avatarUpdateModal",attrs:{centered:"","hide-footer":"","header-class":"py-2","body-class":"p-0","title-class":"w-100 text-center pl-4 font-weight-bold","title-tag":"p",title:"Upload Avatar"}},[e("input",{ref:"avatarUpdateRef",staticClass:"d-none",attrs:{type:"file",accept:"image/jpg,image/png"},on:{change:function(e){return t.handleAvatarUpdate()}}}),t._v(" "),e("div",{staticClass:"d-flex align-items-center justify-content-center"},[0===t.avatarUpdateIndex?e("div",{staticClass:"py-5 user-select-none cursor-pointer",on:{drop:t.handleDrop,dragover:t.handleDrop,click:function(e){return t.avatarUpdateStep(0)}}},[e("p",{staticClass:"text-center primary"},[e("i",{staticClass:"fal fa-cloud-upload fa-3x"})]),t._v(" "),e("p",{staticClass:"text-center lead"},[t._v("Drag photo here or click here")]),t._v(" "),e("p",{staticClass:"text-center small text-muted mb-0"},[t._v("Must be a "),e("strong",[t._v("png")]),t._v(" or "),e("strong",[t._v("jpg")]),t._v(" image up to 2MB")])]):1===t.avatarUpdateIndex?e("div",{staticClass:"w-100 p-5"},[e("div",{staticClass:"d-md-flex justify-content-between align-items-center"},[e("div",{staticClass:"text-center mb-4"},[e("p",{staticClass:"small font-weight-bold",staticStyle:{opacity:"0.7"}},[t._v("Current")]),t._v(" "),e("img",{staticClass:"shadow",staticStyle:{width:"150px",height:"150px","object-fit":"cover","border-radius":"18px",opacity:"0.7"},attrs:{src:t.user.avatar}})]),t._v(" "),e("div",{staticClass:"text-center mb-4"},[e("p",{staticClass:"font-weight-bold"},[t._v("New")]),t._v(" "),e("img",{staticClass:"shadow",staticStyle:{width:"220px",height:"220px","object-fit":"cover","border-radius":"18px"},attrs:{src:t.avatarUpdatePreview}})])]),t._v(" "),e("hr"),t._v(" "),e("div",{staticClass:"d-flex justify-content-between"},[e("button",{staticClass:"btn btn-light font-weight-bold btn-block mr-3",on:{click:function(e){return t.avatarUpdateClear()}}},[t._v("Clear")]),t._v(" "),e("button",{staticClass:"btn btn-primary primary font-weight-bold btn-block mt-0",on:{click:function(e){return t.confirmUpload()}}},[t._v("Upload")])])]):t._e()])])},s=[]},67725:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"sidebar-component sticky-top d-none d-md-block"},[e("div",{staticClass:"card shadow-sm mb-3",staticStyle:{"border-radius":"15px"}},[e("div",{staticClass:"card-body p-2"},[e("div",{staticClass:"media user-card user-select-none"},[e("div",{staticStyle:{position:"relative"}},[e("img",{staticClass:"avatar shadow cursor-pointer",attrs:{src:t.user.avatar,draggable:"false",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=0';"},on:{click:function(e){return t.gotoMyProfile()}}}),t._v(" "),e("button",{staticClass:"btn btn-light btn-sm avatar-update-btn",on:{click:function(e){return t.updateAvatar()}}},[e("span",{staticClass:"avatar-update-btn-icon"})])]),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"display-name",domProps:{innerHTML:t._s(t.getDisplayName())}}),t._v(" "),e("p",{staticClass:"username primary"},[t._v("@"+t._s(t.user.username))]),t._v(" "),e("p",{staticClass:"stats"},[e("span",{staticClass:"stats-following"},[e("span",{staticClass:"following-count"},[t._v(t._s(t.formatCount(t.user.following_count)))]),t._v(" Following\n\t\t\t\t\t\t\t")]),t._v(" "),e("span",{staticClass:"stats-followers"},[e("span",{staticClass:"followers-count"},[t._v(t._s(t.formatCount(t.user.followers_count)))]),t._v(" Followers\n\t\t\t\t\t\t\t")])])])])])]),t._v(" "),e("div",{staticClass:"btn-group btn-group-lg btn-block mb-4"},[e("router-link",{staticClass:"btn btn-primary btn-block font-weight-bold",attrs:{to:"/i/web/compose"}},[e("i",{staticClass:"fal fa-arrow-circle-up mr-1"}),t._v(" "+t._s(t.$t("navmenu.compose"))+" Post\n\t\t\t")]),t._v(" "),t._m(0),t._v(" "),e("div",{staticClass:"dropdown-menu dropdown-menu-right"},[e("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:"/i/collections/create"}},[t._v("Create Collection")]),t._v(" "),t.hasStories?e("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:"/i/stories/new"}},[t._v("Create Story")]):t._e(),t._v(" "),e("div",{staticClass:"dropdown-divider"}),t._v(" "),e("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:"/settings/home"}},[t._v("Account Settings")])])],1),t._v(" "),e("div",{staticClass:"sidebar-sticky shadow-sm"},[e("ul",{staticClass:"nav flex-column"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"d-flex justify-content-between align-items-center"},[e("a",{staticClass:"nav-link text-center",class:["/i/web"==t.$route.path?"router-link-exact-active active":""],attrs:{href:"/i/web"},on:{click:function(e){return e.preventDefault(),t.goToFeed("home")}}},[t._m(1),t._v(" "),e("div",{staticClass:"small"},[t._v(t._s(t.$t("navmenu.homeFeed")))])]),t._v(" "),t.hasLocalTimeline?e("a",{staticClass:"nav-link text-center",class:["/i/web/timeline/local"==t.$route.path?"router-link-exact-active active":""],attrs:{href:"/i/web/timeline/local"},on:{click:function(e){return e.preventDefault(),t.goToFeed("local")}}},[t._m(2),t._v(" "),e("div",{staticClass:"small"},[t._v(t._s(t.$t("navmenu.localFeed")))])]):t._e(),t._v(" "),t.hasNetworkTimeline?e("a",{staticClass:"nav-link text-center",class:["/i/web/timeline/global"==t.$route.path?"router-link-exact-active active":""],attrs:{href:"/i/web/timeline/global"},on:{click:function(e){return e.preventDefault(),t.goToFeed("global")}}},[t._m(3),t._v(" "),e("div",{staticClass:"small"},[t._v(t._s(t.$t("navmenu.globalFeed")))])]):t._e()]),t._v(" "),e("hr",{staticClass:"mb-0",staticStyle:{"margin-top":"-5px",opacity:"0.4"}})]),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link",attrs:{to:"/i/web/discover"}},[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-compass"})]),t._v("\n\t\t\t\t\t\t"+t._s(t.$t("navmenu.discover"))+"\n\t\t\t\t\t")])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link d-flex justify-content-between align-items-center",attrs:{to:"/i/web/direct"}},[e("span",[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-envelope"})]),t._v("\n\t\t\t\t\t\t\t"+t._s(t.$t("navmenu.directMessages"))+"\n\t\t\t\t\t\t")])])],1),t._v(" "),t.hasLiveStreams?e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link d-flex justify-content-between align-items-center",attrs:{to:"/i/web/livestreams"}},[e("span",[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-record-vinyl"})]),t._v("\n\t\t\t\t\t\t\tLivestreams\n\t\t\t\t\t\t")])])],1):t._e(),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link d-flex justify-content-between align-items-center",attrs:{to:"/i/web/notifications"}},[e("span",[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-bell"})]),t._v("\n\t\t\t\t\t\t\t"+t._s(t.$t("navmenu.notifications"))+"\n\t\t\t\t\t\t")])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),t._v(" "),e("router-link",{staticClass:"nav-link",attrs:{to:"/i/web/profile/"+t.user.id}},[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-user"})]),t._v("\n\t\t\t\t\t\t"+t._s(t.$t("navmenu.profile"))+"\n\t\t\t\t\t")])],1),t._v(" "),t.user.is_admin?e("li",{staticClass:"nav-item"},[e("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),t._v(" "),e("a",{staticClass:"nav-link",attrs:{href:"/i/admin/dashboard"}},[t._m(4),t._v("\n\t\t\t\t\t\t"+t._s(t.$t("navmenu.admin"))+"\n\t\t\t\t\t")])]):t._e(),t._v(" "),e("li",{staticClass:"nav-item"},[e("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),t._v(" "),e("a",{staticClass:"nav-link",attrs:{href:"/?force_old_ui=1"}},[t._m(5),t._v("\n\t\t\t\t\t\t"+t._s(t.$t("navmenu.backToPreviousDesign"))+"\n\t\t\t\t\t")])])])]),t._v(" "),e("div",{staticClass:"sidebar-attribution pr-3 d-flex justify-content-between align-items-center"},[e("router-link",{attrs:{to:"/i/web/language"}},[e("i",{staticClass:"fal fa-language fa-2x",attrs:{alt:"Select a language"}})]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/site/help"}},[t._v(t._s(t.$t("navmenu.help")))]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/site/privacy"}},[t._v(t._s(t.$t("navmenu.privacy")))]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/site/terms"}},[t._v(t._s(t.$t("navmenu.terms")))]),t._v(" "),e("a",{staticClass:"font-weight-bold powered-by",attrs:{href:"https://pixelfed.org"}},[t._v("Powered by Pixelfed")])],1),t._v(" "),e("update-avatar",{ref:"avatarUpdate",attrs:{user:t.user}})],1)},s=[function(){var t=this._self._c;return t("button",{staticClass:"btn btn-outline-primary dropdown-toggle dropdown-toggle-split",attrs:{type:"button","data-toggle":"dropdown","aria-expanded":"false"}},[t("span",{staticClass:"sr-only"},[this._v("Toggle Dropdown")])])},function(){var t=this._self._c;return t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-home fa-lg"})])},function(){var t=this._self._c;return t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"fas fa-stream fa-lg"})])},function(){var t=this._self._c;return t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-globe fa-lg"})])},function(){var t=this._self._c;return t("span",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-tools"})])},function(){var t=this._self._c;return t("span",{staticClass:"icon text-lighter"},[t("i",{staticClass:"fas fa-chevron-left"})])}]},2383:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"compose-modal-component"},[e("input",{staticClass:"w-100 h-100 d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",multiple:"",accept:t.config.uploader.media_types}}),t._v(" "),e("canvas",{staticClass:"d-none",attrs:{id:"pr_canvas"}}),t._v(" "),e("img",{staticClass:"d-none",attrs:{id:"pr_img"}}),t._v(" "),e("div",{staticClass:"timeline"},[t.uploading?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100 bg-light py-3",staticStyle:{"border-bottom":"1px solid #f1f1f1"}},[e("div",{staticClass:"p-5 mt-2"},[e("b-progress",{attrs:{value:t.uploadProgress,max:100,striped:"",animated:!0}}),t._v(" "),e("p",{staticClass:"text-center mb-0 font-weight-bold"},[t._v("Uploading ... ("+t._s(t.uploadProgress)+"%)")])],1)])]):"cameraRoll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[t._m(0),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[t.cameraRollMedia.length>0?e("div",{staticClass:"row p-0 m-0"},t._l(t.cameraRollMedia,(function(t,a){return e("div",{class:[0==a?"col-12 p-0":"col-3 p-0"]},[e("div",{staticClass:"card info-overlay p-0 rounded-0 shadow-none border"},[e("div",{staticClass:"square"},[e("img",{staticClass:"square-content",attrs:{src:t.preview_url}})])])])})),0):e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[e("span",{staticClass:"w-100 h-100"},[e("button",{staticClass:"btn btn-primary",attrs:{type:"button"}},[t._v("Upload")]),t._v(" "),e("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(e){return t.fetchCameraRollDrafts()}}},[t._v("Load Camera Roll")])])])])])]):"poll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[t._m(1),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tNew Poll\n\t\t\t\t\t")]),t._v(" "),t.postingPoll?e("span",[t._m(2)]):!t.postingPoll&&t.pollOptions.length>1&&t.composeText.length?e("button",{staticClass:"btn btn-primary btn-sm font-weight-bold",on:{click:t.postNewPoll}},[e("span",[t._v("Create Poll")])]):e("span",{staticClass:"font-weight-bold text-lighter"},[t._v("\n\t\t\t\t\t\tCreate Poll\n\t\t\t\t\t")])]),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{staticClass:"rounded-circle",attrs:{src:t.profile.avatar,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a poll question..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\tPoll Options\n\t\t\t\t\t\t")]),t._v(" "),t.pollOptions.length<4?e("div",{staticClass:"form-group mb-4"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.pollOptionModel,expression:"pollOptionModel"}],staticClass:"form-control rounded-pill",attrs:{type:"text",placeholder:"Add a poll option, press enter to save"},domProps:{value:t.pollOptionModel},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.savePollOption.apply(null,arguments)},input:function(e){e.target.composing||(t.pollOptionModel=e.target.value)}}})]):t._e(),t._v(" "),t._l(t.pollOptions,(function(a,i){return e("div",{staticClass:"form-group mb-4 d-flex align-items-center",staticStyle:{"max-width":"400px",position:"relative"}},[e("span",{staticClass:"font-weight-bold mr-2",staticStyle:{position:"absolute",left:"10px"}},[t._v(t._s(i+1)+".")]),t._v(" "),t.pollOptions[i].length<50?e("input",{directives:[{name:"model",rawName:"v-model",value:t.pollOptions[i],expression:"pollOptions[index]"}],staticClass:"form-control rounded-pill",staticStyle:{"padding-left":"30px","padding-right":"90px"},attrs:{type:"text",placeholder:"Add a poll option, press enter to save"},domProps:{value:t.pollOptions[i]},on:{input:function(e){e.target.composing||t.$set(t.pollOptions,i,e.target.value)}}}):e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.pollOptions[i],expression:"pollOptions[index]"}],staticClass:"form-control",staticStyle:{"padding-left":"30px","padding-right":"90px"},attrs:{placeholder:"Add a poll option, press enter to save",rows:"3"},domProps:{value:t.pollOptions[i]},on:{input:function(e){e.target.composing||t.$set(t.pollOptions,i,e.target.value)}}}),t._v(" "),e("button",{staticClass:"btn btn-danger btn-sm rounded-pill font-weight-bold",staticStyle:{position:"absolute",right:"5px"},on:{click:function(e){return t.deletePollOption(i)}}},[e("i",{staticClass:"fas fa-trash"}),t._v(" Delete\n\t\t\t\t\t\t\t")])])})),t._v(" "),e("hr"),t._v(" "),e("div",{staticClass:"d-flex justify-content-between"},[e("div",[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\t\t\tPoll Expiry\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"form-group"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.pollExpiry,expression:"pollExpiry"}],staticClass:"form-control rounded-pill",staticStyle:{width:"200px"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.pollExpiry=e.target.multiple?a:a[0]}}},[e("option",{attrs:{value:"60"}},[t._v("1 hour")]),t._v(" "),e("option",{attrs:{value:"360"}},[t._v("6 hours")]),t._v(" "),e("option",{attrs:{value:"1440",selected:""}},[t._v("24 hours")]),t._v(" "),e("option",{attrs:{value:"10080"}},[t._v("7 days")])])])]),t._v(" "),e("div",[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\t\t\tPoll Visibility\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"form-group"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.visibility,expression:"visibility"}],staticClass:"form-control rounded-pill",staticStyle:{"max-width":"200px"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.visibility=e.target.multiple?a:a[0]}}},[e("option",{attrs:{value:"public"}},[t._v("Public")]),t._v(" "),e("option",{attrs:{value:"private"}},[t._v("Followers Only")])])])])])],2)])])]):e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[e("div",[1==t.page?e("a",{staticClass:"font-weight-bold text-decoration-none text-muted",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.closeModal()}}},[e("i",{staticClass:"fas fa-times fa-lg"}),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]):2==t.page?e("span",[t.config.uploader.album_limit>t.media.length?e("button",{staticClass:"btn btn-outline-primary btn-sm font-weight-bold",attrs:{id:"cm-add-media-btn"},on:{click:function(e){return e.preventDefault(),t.addMedia.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-plus"})]):e("button",{staticClass:"btn btn-outline-secondary btn-sm font-weight-bold",attrs:{disabled:""}},[e("i",{staticClass:"fas fa-plus"})]),t._v(" "),e("b-tooltip",{attrs:{target:"cm-add-media-btn",triggers:"hover"}},[t._v("\n\t\t\t\t\t\t\t\tUpload another photo or video\n\t\t\t\t\t\t\t")])],1):3==t.page?e("span",[e("a",{staticClass:"text-lighter text-decoration-none mr-3 d-flex align-items-center",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goBack()}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left fa-lg mr-2"}),t._v(" "),e("span",{staticClass:"btn btn-outline-secondary btn-sm px-2 py-0 disabled",attrs:{disabled:""}},[t._v(t._s(t.media.length))])]),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]):e("span",[e("a",{staticClass:"text-lighter text-decoration-none mr-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goBack()}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left fa-lg"})])]),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]),t._v(" "),2==t.page?e("div",[1==t.media.length?e("a",{staticClass:"text-center text-dark",attrs:{href:"#",title:"Crop & Resize",id:"cm-crop-btn"},on:{click:function(e){return e.preventDefault(),t.showCropPhotoCard.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-crop-alt fa-lg"})]):t._e(),t._v(" "),e("b-tooltip",{attrs:{target:"cm-crop-btn",triggers:"hover"}},[t._v("\n\t\t\t\t\t\t\tCrop & Resize\n\t\t\t\t\t\t")])],1):t._e(),t._v(" "),e("div",[t.pageLoading?e("span",[t._m(3)]):e("span",[!t.pageLoading&&t.page>1&&t.page<=2||1==t.page&&0!=t.ids.length||"cropPhoto"==t.page?e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.nextPage.apply(null,arguments)}}},[t._v("Next")]):t._e(),t._v(" "),t.pageLoading||3!=t.page?t._e():[t.isPosting?e("b-spinner",{attrs:{small:""}}):e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.compose()}}},[t._v("Post")])],t._v(" "),t.pageLoading||"addText"!=t.page?t._e():e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.composeTextPost()}}},[t._v("Post")]),t._v(" "),t.pageLoading||"video-2"!=t.page?t._e():e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.compose()}}},[t._v("Post")]),t._v(" "),t.pageLoading||"filteringMedia"!=t.page?t._e():e("span",{staticClass:"font-weight-bold text-decoration-none text-muted"},[t._v("Next")])],2)])]),t._v(" "),e("div",{staticClass:"card-body p-0 border-top"},["licensePicker"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}},[e("div",{staticClass:"list-group list-group-flush"},t._l(t.availableLicenses,(function(a,i){return e("div",{staticClass:"list-group-item cursor-pointer",class:{"text-primary":t.licenseId===a.id,"font-weight-bold":t.licenseId===a.id},on:{click:function(e){return t.toggleLicense(a)}}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(a.name)+"\n\t\t\t\t\t\t\t")])})),0)]):"textOptions"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}}):"addText"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}},[e("div",{staticClass:"mt-2"},[e("div",{staticClass:"media px-3"},[e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Body")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",staticStyle:{"font-size":"18px",resize:"none"},attrs:{rows:"7",placeholder:"What's happening?"},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}}),t._v(" "),e("div",{staticClass:"border-bottom"}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0 font-weight-bold"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))]),t._v(" "),e("p",{staticClass:"mb-0 mt-2"},[e("a",{staticClass:"btn btn-primary rounded-pill mr-2",staticStyle:{height:"37px"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showTextOptions()}}},[e("i",{staticClass:"fas fa-palette px-3 text-white"})]),t._v(" "),e("a",{staticClass:"btn rounded-pill mx-3 d-inline-flex align-items-center",class:[t.nsfw?"btn-danger":"btn-outline-lighter"],staticStyle:{height:"37px"},attrs:{href:"#",title:"Mark as sensitive/not safe for work"},on:{click:function(e){e.preventDefault(),t.nsfw=!t.nsfw}}},[e("i",{staticClass:"far fa-flag px-3"}),t._v(" "),e("span",{staticClass:"text-muted small font-weight-bold"})]),t._v(" "),e("a",{staticClass:"btn btn-outline-lighter rounded-pill d-inline-flex align-items-center",staticStyle:{height:"37px"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-eye mr-2"}),t._v(" "),e("span",{staticClass:"text-muted small font-weight-bold"},[t._v(t._s(t.visibilityTag))])])])])])])])]):1==t.page?e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center",staticStyle:{"min-height":"400px"}},[e("div",{staticClass:"text-center"},[0==t.media.length?e("div",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark"},[e("div",{staticClass:"card-body py-2",on:{click:function(e){return e.preventDefault(),t.addMedia.apply(null,arguments)}}},[e("div",{staticClass:"media"},[t._m(4),t._v(" "),e("div",{staticClass:"media-body text-left"},[t._m(5),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Share up to "+t._s(t.config.uploader.album_limit)+" photos or videos")]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.config.uploader.media_types.split(",").map((function(t){return t.split("/")[1]})).join(", ")))]),t._v(" allowed up to "),e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.filesize(t.config.uploader.max_photo_size)))])])])])])]):t._e(),t._v(" "),t._e(),t._v(" "),1==t.config.features.stories?e("a",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark",attrs:{href:"/i/stories/new"}},[t._m(7)]):t._e(),t._v(" "),t._e(),t._v(" "),t._m(9),t._v(" "),t._m(10)])]):"cropPhoto"==t.page?e("div",{staticClass:"w-100 h-100"},[t.ids.length>0?e("div",[e("vue-cropper",{ref:"cropper",attrs:{relativeZoom:t.cropper.zoom,aspectRatio:t.cropper.aspectRatio,viewMode:t.cropper.viewMode,zoomable:t.cropper.zoomable,rotatable:!0,src:t.media[t.carouselCursor].url}})],1):t._e()]):2==t.page?e("div",{staticClass:"w-100 h-100"},[1==t.media.length?e("div",[e("div",{staticStyle:{display:"flex","min-height":"420px","align-items":"center"},attrs:{slot:"img"},slot:"img"},[e("img",{class:"d-block img-fluid w-100 "+[t.media[t.carouselCursor].filter_class?t.media[t.carouselCursor].filter_class:""],attrs:{src:t.media[t.carouselCursor].url,alt:t.media[t.carouselCursor].description,title:t.media[t.carouselCursor].description}})]),t._v(" "),e("hr"),t._v(" "),t.ids.length>0&&"image"==t.media[t.carouselCursor].type?e("div",{staticClass:"align-items-center px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),e("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,(function(a,i){return e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("div",{staticClass:"rounded",class:a[1]},[e("img",{attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,a[1])}}})])]),t._v(" "),e("a",{class:[t.media[t.carouselCursor].filter_class==a[1]?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,a[1])}}},[t._v(t._s(a[0]))])])}))],2)]):t._e()]):t.media.length>1?e("div",{staticClass:"d-flex-inline px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center pb-3"},[e("li",{staticClass:"nav-item mx-md-4"},[t._v(" ")]),t._v(" "),t._l(t.media,(function(a,i){return e("li",{key:a.id+":"+t.carouselCursor,staticClass:"nav-item mx-md-4"},[e("div",{staticClass:"nav-link",staticStyle:{display:"block",width:"300px",height:"300px"},on:{click:function(e){t.carouselCursor=i}}},[e("div",{class:[a.filter_class?a.filter_class:""],staticStyle:{width:"100%",height:"100%",display:"block"}},[e("div",{class:"rounded "+[i==t.carouselCursor?" border border-primary shadow":""],style:"display:block;width:100%;height:100%;background-image: url("+a.url+");background-size:cover;"})])]),t._v(" "),i==t.carouselCursor?e("div",{staticClass:"text-center mb-0 small text-lighter font-weight-bold pt-2"},[e("button",{staticClass:"btn btn-link",on:{click:function(e){return t.mediaReorder("prev")}}},[e("i",{staticClass:"far fa-chevron-circle-left"})]),t._v(" "),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return e.preventDefault(),t.showCropPhotoCard.apply(null,arguments)}}},[t._v("Crop")]),t._v(" "),e("span",{staticClass:"cursor-pointer px-3",on:{click:function(e){return e.preventDefault(),t.showEditMediaCard()}}},[t._v("Edit")]),t._v(" "),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return t.deleteMedia()}}},[t._v("Delete")]),t._v(" "),e("button",{staticClass:"btn btn-link",on:{click:function(e){return t.mediaReorder("next")}}},[e("i",{staticClass:"far fa-chevron-circle-right"})])]):t._e()])})),t._v(" "),e("li",{staticClass:"nav-item mx-md-4"},[t._v(" ")])],2),t._v(" "),e("hr"),t._v(" "),t.ids.length>0&&"image"==t.media[t.carouselCursor].type?e("div",{staticClass:"align-items-center px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),e("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,(function(a,i){return e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{class:a[1],attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,a[1])}}})]),t._v(" "),e("a",{class:[t.media[t.carouselCursor].filter_class==a[1]?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,a[1])}}},[t._v(t._s(a[0]))])])}))],2)]):t._e()]):e("div",[e("p",{staticClass:"mb-0 p-5 text-center font-weight-bold"},[t._v("An error occured, please refresh the page.")])])]):3==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{class:[t.media[0].filter_class?"mr-2 "+t.media[0].filter_class:"mr-2"],attrs:{src:t.media[0].url,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a caption..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer d-flex justify-content-between",on:{click:function(e){return t.showMediaDescriptionsCard()}}},[e("span",[t._v("Alt Text")]),t._v(" "),e("span",[t.media&&t.media.filter((function(t){return t.alt})).length==t.media.length?e("i",{staticClass:"fas fa-check-circle fa-lg text-success"}):e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])]),t._v(" "),e("div",{staticClass:"border-bottom px-4 mb-0 py-2"},[e("div",{staticClass:"d-flex justify-content-between"},[t._m(11),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asnsfw"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var a=t.nsfw,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=t._i(a,null);i.checked?o<0&&(t.nsfw=a.concat([null])):o>-1&&(t.nsfw=a.slice(0,o).concat(a.slice(o+1)))}else t.nsfw=s}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asnsfw"}})])])]),t._v(" "),t.nsfw?e("div",[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.spoilerText,expression:"spoilerText"}],staticClass:"form-control mt-3",attrs:{placeholder:"Add an optional content warning or spoiler text",maxlength:"140"},domProps:{value:t.spoilerText},on:{input:function(e){e.target.composing||(t.spoilerText=e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.spoilerTextLength)+"/140")])]):t._e()]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showTagCard()}}},[t._v("Tag people")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showCollectionCard()}}},[t._m(12),t._v(" "),e("span",{staticClass:"float-right"},[t.collectionsSelected.length?e("span",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px 5px","text-transform":"uppercase"},attrs:{href:"#",disabled:""}},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.collectionsSelected.length)+"\n\t\t\t\t\t\t\t\t\t")]):t._e(),t._v(" "),t._m(13)])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLicenseCard()}}},[e("span",[t._v("Add license")]),t._v(" "),e("span",{staticClass:"float-right"},[t.licenseTitle?e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showLicenseCard()}}},[t._v(t._s(t.licenseTitle))]):t._e(),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showLicenseCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[t.place?e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",{staticClass:"text-lighter"},[t._v("Location:")]),t._v(" "+t._s(t.place.name)+", "+t._s(t.place.country)+"\n\t\t\t\t\t\t\t\t"),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-2",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showLocationCard()}}},[t._v("Edit")]),t._v(" "),e("a",{staticClass:"btn btn-outline-secondary btn-sm small",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.place=!1}}},[t._v("Remove")])])]):e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLocationCard()}}},[t._v("Add location")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",[t._v("Audience")]),t._v(" "),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[t._v(t._s(t.visibilityTag))]),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticStyle:{"min-height":"200px"}},[e("p",{staticClass:"px-4 mb-0 py-2 small font-weight-bold text-muted cursor-pointer",on:{click:function(e){return t.showAdvancedSettingsCard()}}},[t._v("Advanced settings")])])]):"tagPeople"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("autocomplete",{directives:[{name:"show",rawName:"v-show",value:t.taggedUsernames.length<10,expression:"taggedUsernames.length < 10"}],ref:"autocomplete",attrs:{search:t.tagSearch,placeholder:"@pixelfed","aria-label":"Search usernames","get-result-value":t.getTagResultValue},on:{submit:t.onTagSubmitLocation}}),t._v(" "),e("p",{directives:[{name:"show",rawName:"v-show",value:t.taggedUsernames.length<10,expression:"taggedUsernames.length < 10"}],staticClass:"font-weight-bold text-muted small"},[t._v("You can tag "+t._s(10-t.taggedUsernames.length)+" more "+t._s(9==t.taggedUsernames.length?"person":"people")+"!")]),t._v(" "),e("p",{staticClass:"font-weight-bold text-center mt-3"},[t._v("Tagged People")]),t._v(" "),e("div",{staticClass:"list-group"},[t._l(t.taggedUsernames,(function(a,i){return e("div",{staticClass:"list-group-item d-flex justify-content-between"},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-2 rounded-circle border",attrs:{src:a.avatar,width:"24px",height:"24px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(a.name))])])]),t._v(" "),e("div",{staticClass:"custom-control custom-switch"},[e("input",{directives:[{name:"model",rawName:"v-model",value:a.privacy,expression:"tag.privacy"}],staticClass:"custom-control-input disabled",attrs:{type:"checkbox",id:"cci-tagged-privacy-switch"+i,disabled:""},domProps:{checked:Array.isArray(a.privacy)?t._i(a.privacy,null)>-1:a.privacy},on:{change:function(e){var i=a.privacy,s=e.target,o=!!s.checked;if(Array.isArray(i)){var n=t._i(i,null);s.checked?n<0&&t.$set(a,"privacy",i.concat([null])):n>-1&&t.$set(a,"privacy",i.slice(0,n).concat(i.slice(n+1)))}else t.$set(a,"privacy",o)}}}),t._v(" "),e("label",{staticClass:"custom-control-label font-weight-bold text-lighter",attrs:{for:"cci-tagged-privacy-switch"+i}},[t._v(t._s(a.privacy?"Public":"Private"))]),t._v(" "),e("a",{staticClass:"ml-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.untagUsername(i)}}},[e("i",{staticClass:"fas fa-times text-muted"})])])])})),t._v(" "),0==t.taggedUsernames.length?e("div",{staticClass:"list-group-item p-3"},[e("p",{staticClass:"text-center mb-0 font-weight-bold text-lighter"},[t._v("Search usernames to tag.")])]):t._e()],2),t._v(" "),e("p",{staticClass:"font-weight-bold text-center small text-muted pt-3 mb-0"},[t._v("When you tag someone, they are sent a notification."),e("br"),t._v("For more information on tagging, "),e("a",{staticClass:"text-primary",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showTagHelpCard()}}},[t._v("click here")]),t._v(".")])],1):"tagPeopleHelp"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"mb-0 text-center py-3 px-2 lead"},[t._v("Tagging someone is like mentioning them, with the option to make it private between you.")]),t._v(" "),e("p",{staticClass:"mb-3 py-3 px-2 font-weight-lighter"},[t._v("\n\t\t\t\t\t\t\tYou can choose to tag someone in public or private mode. Public mode will allow others to see who you tagged in the post and private mode tagged users will not be shown to others.\n\t\t\t\t\t\t")])]):"addLocation"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"mb-0"},[t._v("Add Location")]),t._v(" "),e("autocomplete",{attrs:{search:t.locationSearch,placeholder:"Search locations ...","aria-label":"Search locations ...","get-result-value":t.getResultValue},on:{submit:t.onSubmitLocation}})],1):"advancedSettings"==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"list-group list-group-flush"},[e("div",{staticClass:"list-group-item d-flex justify-content-between"},[t._m(14),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.commentsDisabled,expression:"commentsDisabled"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asdisablecomments"},domProps:{checked:Array.isArray(t.commentsDisabled)?t._i(t.commentsDisabled,null)>-1:t.commentsDisabled},on:{change:function(e){var a=t.commentsDisabled,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=t._i(a,null);i.checked?o<0&&(t.commentsDisabled=a.concat([null])):o>-1&&(t.commentsDisabled=a.slice(0,o).concat(a.slice(o+1)))}else t.commentsDisabled=s}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asdisablecomments"}})])])]),t._v(" "),e("a",{staticClass:"list-group-item",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showMediaDescriptionsCard()}}},[t._m(15)])])]):"visibility"==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"list-group list-group-flush"},[t.profile.locked?t._e():e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"public"==t.visibility},on:{click:function(e){return t.toggleVisibility("public")}}},[t._v("\n\t\t\t\t\t\t\t\tPublic\n\t\t\t\t\t\t\t")]),t._v(" "),t.profile.locked?t._e():e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"unlisted"==t.visibility},on:{click:function(e){return t.toggleVisibility("unlisted")}}},[t._v("\n\t\t\t\t\t\t\t\tUnlisted\n\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"private"==t.visibility},on:{click:function(e){return t.toggleVisibility("private")}}},[t._v("\n\t\t\t\t\t\t\t\tFollowers Only\n\t\t\t\t\t\t\t")])])]):"altText"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[t._l(t.media,(function(a,i){return e("div",[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:a.preview_url,width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:a.alt,expression:"m.alt"}],staticClass:"form-control",attrs:{placeholder:"Add a media description here...",maxlength:t.maxAltTextLength,rows:"4"},domProps:{value:a.alt},on:{input:function(e){e.target.composing||t.$set(a,"alt",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(a.alt?a.alt.length:0)+"/"+t._s(t.maxAltTextLength))])])]),t._v(" "),e("hr")])})),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Cancel")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])],2):"addToCollection"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[t.collectionsLoaded&&t.collections.length?e("div",{staticClass:"list-group mb-3 collections-list-group"},[t._l(t.collections,(function(a,i){return e("div",{staticClass:"list-group-item cursor-pointer compose-action border",class:{active:t.collectionsSelected.includes(i)},on:{click:function(e){return t.toggleCollectionItem(i)}}},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:a.thumb,alt:"",width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("h5",{staticClass:"mt-0"},[t._v(t._s(a.title))]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[t._v(t._s(a.post_count)+" Posts - Created "+t._s(t.timeAgo(a.published_at))+" ago")])])])])})),t._v(" "),t.collectionsCanLoadMore?e("button",{staticClass:"btn btn-light btn-block font-weight-bold mt-3",on:{click:t.loadMoreCollections}},[t._v("\n\t\t\t\t\t\t\t\tLoad more\n\t\t\t\t\t\t\t")]):t._e()],2):t._e(),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.clearSelectedCollections()}}},[t._v("Clear")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])]):"schedulePost"==t.page||"mediaMetadata"==t.page||"addToStory"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"text-center lead text-muted mb-0 py-5"},[t._v("This feature is not available yet.")])]):"editMedia"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:t.media[t.carouselCursor].preview_url,width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small"},[t._v("Media Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.media[t.carouselCursor].alt,expression:"media[carouselCursor].alt"}],staticClass:"form-control",attrs:{placeholder:"Add a media description here...",maxlength:"140"},domProps:{value:t.media[t.carouselCursor].alt},on:{input:function(e){e.target.composing||t.$set(t.media[t.carouselCursor],"alt",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-muted mb-0 d-flex justify-content-between"},[e("span",[t._v("Describe your photo for people with visual impairments.")]),t._v(" "),e("span",[t._v(t._s(t.media[t.carouselCursor].alt?t.media[t.carouselCursor].alt.length:0)+"/140")])])]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small"},[t._v("License")]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.licenseId,expression:"licenseId"}],staticClass:"form-control",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.licenseId=e.target.multiple?a:a[0]}}},t._l(t.availableLicenses,(function(a,i){return e("option",{domProps:{value:a.id,selected:a.id==t.licenseId}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t"+t._s(a.name)+"\n\t\t\t\t\t\t\t\t\t\t")])})),0)])])]),t._v(" "),e("hr"),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Cancel")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])]):"video-2"==t.page?e("div",{staticClass:"w-100 h-100"},[t.video.title.length?e("div",{staticClass:"border-bottom"},[e("div",{staticClass:"media p-3"},[e("img",{class:[t.media[0].filter_class?"mr-2 "+t.media[0].filter_class:"mr-2"],attrs:{src:t.media[0].url,width:"100px",height:"70px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"font-weight-bold mb-1"},[t._v(t._s(t.video.title?t.video.title.slice(0,70):"Untitled"))]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[t._v(t._s(t.video.description?t.video.description.slice(0,90):"No description"))])])])]):t._e(),t._v(" "),e("div",{staticClass:"border-bottom d-flex justify-content-between px-4 mb-0 py-2"},[t._m(16),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asnsfw"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var a=t.nsfw,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=t._i(a,null);i.checked?o<0&&(t.nsfw=a.concat([null])):o>-1&&(t.nsfw=a.slice(0,o).concat(a.slice(o+1)))}else t.nsfw=s}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asnsfw"}})])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLicenseCard()}}},[t._v("Add license")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",[t._v("Audience")]),t._v(" "),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[t._v(t._s(t.visibilityTag))]),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("div",{staticClass:"form-group"},[e("p",{staticClass:"small font-weight-bold text-muted mb-0"},[t._v("Title")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.video.title,expression:"video.title"}],staticClass:"form-control",attrs:{placeholder:"Add a good title"},domProps:{value:t.video.title},on:{input:function(e){e.target.composing||t.$set(t.video,"title",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text mb-0 small text-muted"},[t._v(t._s(t.video.title.length)+"/70")])]),t._v(" "),e("div",{staticClass:"form-group mb-0"},[e("p",{staticClass:"small font-weight-bold text-muted mb-0"},[t._v("Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.video.description,expression:"video.description"}],staticClass:"form-control",attrs:{placeholder:"Add an optional description",maxlength:"5000",rows:"5"},domProps:{value:t.video.description},on:{input:function(e){e.target.composing||t.$set(t.video,"description",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text mb-0 small text-muted"},[t._v(t._s(t.video.description.length)+"/5000")])])])]):"filteringMedia"==t.page?e("div",{staticClass:"w-100 h-100 py-5"},[e("div",{staticClass:"d-flex flex-column align-items-center justify-content-center py-5"},[e("b-spinner",{attrs:{small:""}}),t._v(" "),e("p",{staticClass:"font-weight-bold mt-3"},[t._v("Applying filters...")])],1)]):t._e()]),t._v(" "),"cropPhoto"==t.page?e("div",{staticClass:"card-footer bg-white d-flex justify-content-between"},[e("div",[e("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"},on:{click:t.rotate}},[e("i",{staticClass:"fas fa-redo"})])]),t._v(" "),e("div",[e("div",{staticClass:"d-inline-block button-group"},[e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==16/9?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(16/9)}}},[t._v("16:9")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==4/3?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(4/3)}}},[t._v("4:3")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[1.5==t.cropper.aspectRatio?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(1.5)}}},[t._v("3:2")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[1==t.cropper.aspectRatio?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(1)}}},[t._v("1:1")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==2/3?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(2/3)}}},[t._v("2:3")])])])]):t._e()])])])])},s=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[e("span",{staticClass:"pr-3"},[e("i",{staticClass:"fas fa-cog fa-lg text-muted"})]),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tCamera Roll\n\t\t\t\t\t")]),t._v(" "),e("span",{staticClass:"text-primary font-weight-bold"},[t._v("Upload")])])},function(){var t=this._self._c;return t("span",{staticClass:"pr-3"},[t("i",{staticClass:"fas fa-info-circle fa-lg text-primary"})])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%","background-color":"#008DF5"}},[t("i",{staticClass:"fal fa-bolt text-white fa-lg"})])},function(){var t=this._self._c;return t("p",{staticClass:"mb-0"},[t("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[this._v("New Post")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"2px solid #008DF5"}},[e("i",{staticClass:"far fa-edit text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Text Post")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Share a text only post")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"1px solid #008DF5"}},[e("i",{staticClass:"fas fa-history text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Story")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Add to your story")])])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"2px solid #008DF5"}},[e("i",{staticClass:"fas fa-poll-h text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Poll")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Create a poll")])])])])},function(){var t=this,e=t._self._c;return e("a",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark",attrs:{href:"/i/collections/create"}},[e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"1px solid #008DF5"}},[e("i",{staticClass:"fal fa-images text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Collection")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("New collection of posts")])])])])])},function(){var t=this._self._c;return t("p",{staticClass:"py-3"},[t("a",{staticClass:"font-weight-bold",attrs:{href:"/site/help"}},[this._v("Help")])])},function(){var t=this._self._c;return t("div",[t("div",{staticClass:"text-dark"},[this._v("Sensitive/NSFW Media")])])},function(){var t=this,e=t._self._c;return e("span",[t._v("Add to Collection "),e("span",{staticClass:"ml-2 badge badge-primary"},[t._v("NEW")])])},function(){var t=this._self._c;return t("span",{staticClass:"text-decoration-none"},[t("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])},function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"text-dark"},[t._v("Turn off commenting")]),t._v(" "),e("p",{staticClass:"text-muted small mb-0"},[t._v("Disables comments for this post, you can change this later.")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"d-flex justify-content-between align-items-center"},[e("div",[e("div",{staticClass:"text-dark"},[t._v("Media Descriptions")]),t._v(" "),e("p",{staticClass:"text-muted small mb-0"},[t._v("Describe your photos for people with visual impairments.")])]),t._v(" "),e("div",[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])},function(){var t=this._self._c;return t("div",[t("div",{staticClass:"text-dark"},[this._v("Contains NSFW Media")])])}]},35518:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(76798),s=a.n(i)()((function(t){return t[1]}));s.push([t.id,".app-drawer-component .nav-link{padding:.5rem .1rem}.app-drawer-component .nav-link.active{background-color:transparent}.app-drawer-component .nav-link.router-link-exact-active{background-color:transparent;color:var(--primary)!important}.app-drawer-component .nav-link p{margin-bottom:0}.app-drawer-component .nav-link-label{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:10px;font-weight:700;margin-top:0;opacity:.6;text-transform:uppercase}",""]);const o=s},54788:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(76798),s=a.n(i)()((function(t){return t[1]}));s.push([t.id,'.sidebar-component .sidebar-sticky{background-color:var(--card-bg);border-radius:15px}.sidebar-component.sticky-top{top:90px}.sidebar-component .nav{overflow:auto}.sidebar-component .nav-item .nav-link{color:#9ca3af;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-weight:500;margin-bottom:5px;padding-left:14px}.sidebar-component .nav-item .nav-link:hover{background-color:var(--light-hover-bg)}.sidebar-component .nav-item .nav-link .icon{display:inline-block;text-align:center;width:40px}.sidebar-component .nav-item .router-link-exact-active{color:var(--primary);font-weight:700;padding-left:14px}.sidebar-component .nav-item .router-link-exact-active:not(.text-center){border-left:4px solid var(--primary);padding-left:10px}.sidebar-component .nav-item .router-link-exact-active .icon{color:var(--primary)!important}.sidebar-component .nav-item:first-child .nav-link .small{font-weight:700}.sidebar-component .nav-item:first-child .nav-link:first-child{border-top-left-radius:15px}.sidebar-component .nav-item:first-child .nav-link:last-child{border-top-right-radius:15px}.sidebar-component .nav-item:is(:last-child) .nav-link{border-bottom-left-radius:15px;border-bottom-right-radius:15px;margin-bottom:0}.sidebar-component .sidebar-heading{font-size:.75rem;text-transform:uppercase}.sidebar-component .user-card{align-items:center}.sidebar-component .user-card .avatar{border:1px solid var(--border-color);border-radius:15px;height:75px;margin-right:.8rem;width:75px}.sidebar-component .user-card .avatar-update-btn{background:hsla(0,0%,100%,.9);border:1px solid #dee2e6!important;border-radius:50rem;bottom:0;height:20px;padding:0;position:absolute;right:12px;width:20px}.sidebar-component .user-card .avatar-update-btn-icon{-webkit-font-smoothing:antialiased;display:inline-block;font-family:Font Awesome\\ 5 Free;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-rendering:auto}.sidebar-component .user-card .avatar-update-btn-icon:before{content:"\\f013"}.sidebar-component .user-card .username{font-size:13px;font-weight:600;margin-bottom:0}.sidebar-component .user-card .display-name{color:var(--body-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:14px;font-weight:800!important;line-height:.8;margin-bottom:0;-webkit-user-select:all;-moz-user-select:all;user-select:all;word-break:break-all}.sidebar-component .user-card .stats{font-size:12px;margin-bottom:0;margin-top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-component .user-card .stats .stats-following{margin-right:.8rem}.sidebar-component .user-card .stats .followers-count,.sidebar-component .user-card .stats .following-count{font-weight:800}.sidebar-component .btn-primary{background-color:var(--primary)}.sidebar-component .btn-primary.router-link-exact-active{cursor:unset;opacity:.5;pointer-events:none}.sidebar-component .sidebar-sitelinks{display:flex;justify-content:space-between;margin-top:1rem;padding:0 2rem}.sidebar-component .sidebar-sitelinks a{color:#b8c2cc;font-size:12px}.sidebar-component .sidebar-sitelinks .active{color:#212529;font-weight:600}.sidebar-component .sidebar-attribution{color:#b8c2cc;font-size:10px;margin-top:.5rem;padding-left:2rem}.sidebar-component .sidebar-attribution a{color:#b8c2cc!important}.sidebar-component .sidebar-attribution a.powered-by{opacity:.5}',""]);const o=s},63996:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(76798),s=a.n(i)()((function(t){return t[1]}));s.push([t.id,".compose-modal-component .media-drawer-filters{flex-wrap:unset;overflow-x:auto}.compose-modal-component .media-drawer-filters .nav-link{min-width:100px;padding-bottom:1rem;padding-top:1rem}.compose-modal-component .media-drawer-filters .active{color:#fff;font-weight:700}@media (hover:none) and (pointer:coarse){.compose-modal-component .media-drawer-filters::-webkit-scrollbar{display:none}}.compose-modal-component .no-focus{border-color:none;box-shadow:none;outline:0}.compose-modal-component a.list-group-item{text-decoration:none}.compose-modal-component a.list-group-item:hover{background-color:#f8f9fa;text-decoration:none}.compose-modal-component .compose-action:hover{background-color:#f8f9fa;cursor:pointer}.compose-modal-component .collections-list-group{max-height:500px;overflow-y:auto}.compose-modal-component .collections-list-group .list-group-item.active{background-color:#dbeafe!important;border-color:#60a5fa!important;color:#212529}",""]);const o=s},96259:(t,e,a)=>{a.r(e),a.d(e,{default:()=>r});var i=a(85072),s=a.n(i),o=a(35518),n={insert:"head",singleton:!1};s()(o.default,n);const r=o.default.locals||{}},5323:(t,e,a)=>{a.r(e),a.d(e,{default:()=>r});var i=a(85072),s=a.n(i),o=a(54788),n={insert:"head",singleton:!1};s()(o.default,n);const r=o.default.locals||{}},57893:(t,e,a)=>{a.r(e),a.d(e,{default:()=>r});var i=a(85072),s=a.n(i),o=a(63996),n={insert:"head",singleton:!1};s()(o.default,n);const r=o.default.locals||{}},46537:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(22358),s=a(6422),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},5787:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(16286),s=a(80260),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);a(68840);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},90414:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(82704),s=a(55597),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},28772:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(75754),s=a(75223),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);a(68338);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},19324:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(87310),s=a(50427),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);a(17774);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},6422:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(66517),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},80260:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(50371),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},55597:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(84154),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},75223:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(79318),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},50427:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(28320),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},22358:(t,e,a)=>{a.r(e);var i=a(32463),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},16286:(t,e,a)=>{a.r(e);var i=a(69831),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},82704:(t,e,a)=>{a.r(e);var i=a(67153),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},75754:(t,e,a)=>{a.r(e);var i=a(67725),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},87310:(t,e,a)=>{a.r(e);var i=a(2383),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},68840:(t,e,a)=>{a.r(e);var i=a(96259),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},68338:(t,e,a)=>{a.r(e);var i=a(5323),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},17774:(t,e,a)=>{a.r(e);var i=a(57893),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)}}]); \ No newline at end of file diff --git a/public/js/compose.chunk.ffae318db42f1072.js b/public/js/compose.chunk.ffae318db42f1072.js deleted file mode 100644 index 4c9c21f2d..000000000 --- a/public/js/compose.chunk.ffae318db42f1072.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[9124],{66517:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(5787),s=a(28772),o=a(19324);const n={components:{drawer:i.default,sidebar:s.default,"compose-modal":o.default},data:function(){return{isLoaded:!1,profile:void 0}},mounted:function(){this.profile=window._sharedData.user,this.isLoaded=!0},methods:{closeModal:function(){this.$router.push("/i/web")}}}},50371:(t,e,a)=>{a.r(e),a.d(e,{default:()=>i});const i={data:function(){return{user:window._sharedData.user}}}},84154:(t,e,a)=>{a.r(e),a.d(e,{default:()=>i});const i={props:["user"],data:function(){return{loaded:!1,avatarUpdateIndex:0,avatarUpdateFile:void 0,avatarUpdatePreview:void 0}},methods:{open:function(){this.$refs.avatarUpdateModal.show()},avatarUpdateClose:function(){this.$refs.avatarUpdateModal.hide(),this.avatarUpdateIndex=0,this.avatarUpdateFile=void 0},avatarUpdateClear:function(){this.avatarUpdateIndex=0,this.avatarUpdateFile=void 0},avatarUpdateStep:function(t){this.$refs.avatarUpdateRef.click(),this.avatarUpdateIndex=t},handleAvatarUpdate:function(){var t=this,e=event.target.files;Array.prototype.forEach.call(e,(function(e,a){t.avatarUpdateFile=e,t.avatarUpdatePreview=URL.createObjectURL(e),t.avatarUpdateIndex=1}))},handleDrop:function(t){t.preventDefault();var e=this;if(t.dataTransfer.items){for(var a=0;a{a.r(e),a.d(e,{default:()=>l});var i=a(95353),s=a(90414);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function n(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function r(t,e,a){var i;return i=function(t,e){if("object"!=o(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==o(i)?i:String(i))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const l={props:{user:{type:Object,default:function(){return{avatar:"/storage/avatars/default.jpg",username:!1,display_name:"",following_count:0,followers_count:0}}},links:{type:Array,default:function(){return[{name:"Discover",path:"/i/web/discover",icon:"fas fa-compass"},{name:"Groups",path:"/i/web/groups",icon:"far fa-user-friends"},{name:"Videos",path:"/i/web/videos",icon:"far fa-video"}]}}},components:{UpdateAvatar:s.default},computed:function(t){for(var e=1;e)?/g,(function(e){var a=e.slice(1,e.length-1),i=t.getCustomEmoji.filter((function(t){return t.shortcode==a}));return i.length?''.concat(i[0].shortcode,''):e}))}return a},gotoMyProfile:function(){var t=this.user;this.$router.push({name:"profile",path:"/i/web/profile/".concat(t.id),params:{id:t.id,cachedProfile:t,cachedUser:t}})},formatCount:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-GB",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compact";return new Intl.NumberFormat(e,{notation:a,compactDisplay:"short"}).format(t)},updateAvatar:function(){event.currentTarget.blur(),this.$refs.avatarUpdate.open()},createNewPost:function(){this.$refs.createPostModal.show()},goToFeed:function(t){var e=this.$route.path;switch(t){case"home":"/i/web"==e?this.$emit("refresh"):this.$router.push("/i/web");break;case"local":"/i/web/timeline/local"==e?this.$emit("refresh"):this.$router.push({name:"timeline",params:{scope:"local"}});break;case"global":"/i/web/timeline/global"==e?this.$emit("refresh"):this.$router.push({name:"timeline",params:{scope:"global"}})}}}}},28320:(t,e,a)=>{a.r(e),a.d(e,{default:()=>c});var i=a(91584),s=(a(77333),a(2e4)),o=(a(87980),a(79288)),n=a(74692);function r(t){return function(t){if(Array.isArray(t))return l(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)return;if("string"==typeof t)return l(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return l(t,e)}(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 l(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a10&&(t.licenseTitle=t.availableLicenses.filter((function(e){return e.id==t.licenseId})).map((function(t){return t.title}))[0]),t.fetchProfile()}))},mounted:function(){this.mediaWatcher()},methods:{timeAgo:function(t){return App.util.format.timeAgo(t)},formatBytes:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+t)return"0 Bytes";var a=e<0?0:e,i=Math.floor(Math.log(t)/Math.log(1024));return"".concat(parseFloat((t/Math.pow(1024,i)).toFixed(a))," ").concat(["Bytes","KB","MB","GB","TB"][i])},fetchProfile:function(){var t=this,e={public:"Public",private:"Followers Only",unlisted:"Unlisted"};if(window._sharedData.curUser.id){if(this.profile=window._sharedData.curUser,this.composeSettings&&this.composeSettings.hasOwnProperty("default_scope")&&this.composeSettings.default_scope){var a=this.composeSettings.default_scope;this.visibility=a,this.visibilityTag=e[a]}1==this.profile.locked&&(this.visibility="private",this.visibilityTag="Followers Only")}else axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(a){if(window._sharedData.currentUser=a.data,t.profile=a.data,t.composeSettings&&t.composeSettings.hasOwnProperty("default_scope")&&t.composeSettings.default_scope){var i=t.composeSettings.default_scope;t.visibility=i,t.visibilityTag=e[i]}1==t.profile.locked&&(t.visibility="private",t.visibilityTag="Followers Only")})).catch((function(t){}))},addMedia:function(t){var e=n(t.target);e.attr("disabled",""),n('.file-input[name="media"]').trigger("click"),e.blur(),e.removeAttr("disabled")},addText:function(t){this.pageTitle="New Text Post",this.page="addText",this.textMode=!0,this.mode="text"},mediaWatcher:function(){var t=this;n(document).on("change","#pf-dz",(function(e){t.mediaUpload()}))},mediaUpload:function(){var t=this;t.uploading=!0;var e=document.querySelector("#pf-dz");e.files.length||(t.uploading=!1),Array.prototype.forEach.call(e.files,(function(e,a){if(t.media&&t.media.length+a>=t.config.uploader.album_limit)return swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error"),t.uploading=!1,void(t.page=2);var i=e.type,s=t.config.uploader.media_types.split(",");if(-1==n.inArray(i,s))return swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.config.uploader.media_types+" only.","error"),t.uploading=!1,void(t.page=2);var o=new FormData;o.append("file",e);var r={onUploadProgress:function(e){var a=Math.round(100*e.loaded/e.total);t.uploadProgress=a}};axios.post("/api/compose/v0/media/upload",o,r).then((function(e){t.uploadProgress=100,t.ids.push(e.data.id),t.media.push(e.data),t.uploading=!1,setTimeout((function(){t.page=3}),300)})).catch((function(a){switch(a.response.status){case 403:t.uploading=!1,e.value=null,swal("Account size limit reached","Contact your admin for assistance.","error"),t.page=2;break;case 413:t.uploading=!1,e.value=null,swal("File is too large","The file you uploaded has the size of "+t.formatBytes(e.size)+". Unfortunately, only images up to "+t.formatBytes(1024*t.config.uploader.max_photo_size)+" are supported.\nPlease resize the file and try again.","error"),t.page=2;break;case 451:t.uploading=!1,e.value=null,swal("Banned Content","This content has been banned and cannot be uploaded.","error"),t.page=2;break;case 429:t.uploading=!1,e.value=null,swal("Limit Reached","You can upload up to 250 photos or videos per day and you've reached that limit. Please try again later.","error"),t.page=2;break;case 500:t.uploading=!1,e.value=null,swal("Error",a.response.data.message,"error"),t.page=2;break;default:t.uploading=!1,e.value=null,swal("Oops, something went wrong!","An unexpected error occurred.","error"),t.page=2}})),e.value=null,t.uploadProgress=0}))},toggleFilter:function(t,e){this.media[this.carouselCursor].filter_class=e,this.currentFilter=e},deleteMedia:function(){var t=this;if(0!=window.confirm("Are you sure you want to delete this media?")){var e=this.media[this.carouselCursor].id;axios.delete("/api/compose/v0/media/delete",{params:{id:e}}).then((function(e){t.ids.splice(t.carouselCursor,1),t.media.splice(t.carouselCursor,1),0==t.media.length?(t.ids=[],t.media=[],t.carouselCursor=0):t.carouselCursor=0})).catch((function(t){swal("Whoops!","An error occured when attempting to delete this, please try again","error")}))}},mediaReorder:function(t){var e=this,a=this.media,i=this.carouselCursor,s=a[i],o=[],n=0;if("prev"==t)if(0==i){for(var r=n;r=0&&e=0&&athis.config.uploader.max_caption_length)swal("Error","Caption is too long","error");else switch(e){case"publish":if(this.isPosting=!0,this.media.filter((function(t){return t.filter_class&&!t.hasOwnProperty("is_filtered")})).length)return void this.applyFilterToMedia();if(!0===this.composeSettings.media_descriptions)if(this.media.filter((function(t){return!t.hasOwnProperty("alt")||t.alt.length<2})).length)return swal("Missing media descriptions","You have enabled mandatory media descriptions. Please add media descriptions under Advanced settings to proceed. For more information, please see the media settings page.","warning"),void(this.isPosting=!1);if(0==this.media.length)return void swal("Whoops!","You need to add media before you can save this!","warning");"Add optional caption..."==this.composeText&&(this.composeText="");var a={media:this.media,caption:this.composeText,visibility:this.visibility,cw:this.nsfw,comments_disabled:this.commentsDisabled,place:this.place,tagged:this.taggedUsernames,optimize_media:this.optimizeMedia,license:this.licenseId,video:this.video,spoiler_text:this.spoilerText};return this.collectionsSelected.length&&(a.collections=this.collectionsSelected.map((function(e){return t.collections[e].id}))),void axios.post("/api/compose/v0/publish",a).then((function(t){"/i/web/compose"===location.pathname&&t.data&&t.data.length?location.href="/i/web/post/"+t.data.split("/").slice(-1)[0]:location.href=t.data})).catch((function(t){if(t.response){var e=t.response.data.message?t.response.data.message:"An unexpected error occured.";swal("Oops, something went wrong!",e,"error")}else swal("Oops, something went wrong!",t.message,"error")}));case"delete":return this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void n("#composeModal").modal("hide")}},composeTextPost:function(){var t=this.composeState;if(this.composeText.length>this.config.uploader.max_caption_length)swal("Error","Caption is too long","error");else switch(t){case"publish":var e={caption:this.composeText,visibility:this.visibility,cw:this.nsfw,comments_disabled:this.commentsDisabled,place:this.place,tagged:this.taggedUsernames};return void axios.post("/api/compose/v0/publish/text",e).then((function(t){var e=t.data;window.location.href=e})).catch((function(t){var e=t.response.data.message?t.response.data.message:"An unexpected error occured.";swal("Oops, something went wrong!",e,"error")}));case"delete":return this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void n("#composeModal").modal("hide")}},closeModal:function(){n("#composeModal").modal("hide"),this.$emit("close")},goBack:function(){switch(this.pageTitle="",this.mode){case"photo":switch(this.page){case"filteringMedia":case"cropPhoto":case"editMedia":this.page=2;break;case"addText":case"video-2":this.page=1;break;case"textOptions":this.page="addText";break;case"tagPeopleHelp":this.showTagCard();break;case"licensePicker":this.page=3;break;default:-1!=this.namedPages.indexOf(this.page)?this.page=3:this.page--}break;case"video":if("filteringMedia"===this.page)this.page=2;else this.page="video-2";break;default:switch(this.page){case"addText":case"video-2":this.page=1;break;case"filteringMedia":case"cropPhoto":case"editMedia":this.page=2;break;case"textOptions":this.page="addText";break;case"tagPeopleHelp":this.showTagCard();break;case"licensePicker":this.page=3;break;default:-1!=this.namedPages.indexOf(this.page)?this.page="text"==this.mode?"addText":3:"text"==this.mode||this.page--}}},nextPage:function(){switch(this.pageTitle="",this.page){case 1:this.page=2;break;case"filteringMedia":break;case"cropPhoto":this.pageLoading=!0;var t=this;this.$refs.cropper.getCroppedCanvas({maxWidth:4096,maxHeight:4096,fillColor:"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((function(e){t.mediaCropped=!0;var a=new FormData;a.append("file",e),a.append("id",t.ids[t.carouselCursor]);axios.post("/api/compose/v0/media/update",a).then((function(e){t.media[t.carouselCursor].url=e.data.url,t.pageLoading=!1,t.page=2})).catch((function(t){}))}));break;case 2:case 3:this.page++}},rotate:function(){this.$refs.cropper.rotate(90)},changeAspect:function(t){this.cropper.aspectRatio=t,this.$refs.cropper.setAspectRatio(t)},showTagCard:function(){this.pageTitle="Tag People",this.page="tagPeople"},showTagHelpCard:function(){this.pageTitle="About Tag People",this.page="tagPeopleHelp"},showLocationCard:function(){this.pageTitle="Add Location",this.page="addLocation"},showAdvancedSettingsCard:function(){this.pageTitle="Advanced Settings",this.page="advancedSettings"},locationSearch:function(t){if(t.length<1)return[];return axios.get("/api/compose/v0/search/location",{params:{q:t}}).then((function(t){return t.data}))},getResultValue:function(t){return t.name+", "+t.country},onSubmitLocation:function(t){switch(this.place=t,this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},showVisibilityCard:function(){this.pageTitle="Post Visibility",this.page="visibility"},showAddToStoryCard:function(){this.pageTitle="Add to Story",this.page="addToStory"},showCropPhotoCard:function(){this.pageTitle="Edit Photo",this.page="cropPhoto"},toggleVisibility:function(t){switch(this.visibility=t,this.visibilityTag={public:"Public",private:"Followers Only",unlisted:"Unlisted"}[t],this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},showMediaDescriptionsCard:function(){this.pageTitle="Media Descriptions",this.page="altText"},showAddToCollectionsCard:function(){this.pageTitle="Add to Collection",this.page="addToCollection"},showSchedulePostCard:function(){this.pageTitle="Schedule Post",this.page="schedulePost"},showEditMediaCard:function(){this.pageTitle="Edit Media",this.page="editMedia"},fetchCameraRollDrafts:function(){var t=this;axios.get("/api/pixelfed/local/drafts").then((function(e){t.cameraRollMedia=e.data}))},applyFilterToMedia:function(){var t=this,e=navigator.userAgent.toLowerCase();if(-1==e.indexOf("firefox")&&-1==e.indexOf("chrome"))return this.isPosting=!1,swal("Oops!","Your browser does not support the filter feature.","error"),void(this.page=3);var a=this.media.filter((function(t){return t.filter_class})).length;a?(this.page="filteringMedia",this.filteringRemainingCount=a,this.$nextTick((function(){t.isFilteringMedia=!0,t.media.forEach((function(e,a){return t.applyFilterToMediaSave(e,a)}))}))):this.page=3},applyFilterToMediaSave:function(t,e){if(t.filter_class){var a=this,i=null,s=document.createElement("canvas"),o=s.getContext("2d"),n=document.createElement("img");n.src=t.url,n.addEventListener("load",(function(r){s.width=n.width,s.height=n.height,o.filter=App.util.filterCss[t.filter_class],o.drawImage(n,0,0,n.width,n.height),o.save(),s.toBlob((function(s){(i=new FormData).append("file",s),i.append("id",t.id),axios.post("/api/compose/v0/media/update",i).then((function(t){a.media[e].is_filtered=!0,a.updateFilteringMedia()})).catch((function(t){}))}))}),t.mime,.9),o.clearRect(0,0,n.width,n.height)}},updateFilteringMedia:function(){var t=this;this.filteringRemainingCount--,this.filteringMediaTimeout=setTimeout((function(){return t.filteringMediaTimeoutJob()}),500)},filteringMediaTimeoutJob:function(){var t=this;0===this.filteringRemainingCount?(this.isFilteringMedia=!1,clearTimeout(this.filteringMediaTimeout),setTimeout((function(){return t.compose()}),500)):(clearTimeout(this.filteringMediaTimeout),this.filteringMediaTimeout=setTimeout((function(){return t.filteringMediaTimeoutJob()}),1e3))},tagSearch:function(t){if(t.length<1)return[];var e=this;return axios.get("/api/compose/v0/search/tag",{params:{q:t}}).then((function(t){if(t.data.length)return t.data.filter((function(t){return 0==e.taggedUsernames.filter((function(e){return e.id==t.id})).length}))}))},getTagResultValue:function(t){return"@"+t.name},onTagSubmitLocation:function(t){this.taggedUsernames.filter((function(e){return e.id==t.id})).length||(this.taggedUsernames.push(t),this.$refs.autocomplete.value="")},untagUsername:function(t){this.taggedUsernames.splice(t,1)},showTextOptions:function(){this.page="textOptions",this.pageTitle="Text Post Options"},showLicenseCard:function(){this.pageTitle="Select a License",this.page="licensePicker"},toggleLicense:function(t){var e=this;switch(this.licenseId=t.id,this.licenseId>10?this.licenseTitle=this.availableLicenses.filter((function(t){return t.id==e.licenseId})).map((function(t){return t.title}))[0]:this.licenseTitle=null,this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},newPoll:function(){this.page="poll"},savePollOption:function(){-1==this.pollOptions.indexOf(this.pollOptionModel)?(this.pollOptions.push(this.pollOptionModel),this.pollOptionModel=null):this.pollOptionModel=null},deletePollOption:function(t){this.pollOptions.splice(t,1)},postNewPoll:function(){var t=this;this.postingPoll=!0,axios.post("/api/compose/v0/poll",{caption:this.composeText,cw:!1,visibility:this.visibility,comments_disabled:!1,expiry:this.pollExpiry,pollOptions:this.pollOptions}).then((function(e){if(!e.data.hasOwnProperty("url"))return swal("Oops!","An error occured while attempting to create this poll. Please refresh the page and try again.","error"),void(t.postingPoll=!1);window.location.href=e.data.url})).catch((function(e){if(e.response.data.hasOwnProperty("error")&&"Duplicate detected."==e.response.data.error)return t.postingPoll=!1,void swal("Oops!","The poll you are trying to create is similar to an existing poll you created. Please make the poll question (caption) unique.","error");t.postingPoll=!1,swal("Oops!","An error occured while attempting to create this poll. Please refresh the page and try again.","error")}))},filesize:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return filesize(1024*t,{round:0})})),showCollectionCard:function(){this.pageTitle="Add to Collection(s)",this.page="addToCollection",this.collectionsLoaded||this.fetchCollections()},fetchCollections:function(){var t=this;axios.get("/api/local/profile/collections/".concat(this.profile.id)).then((function(e){t.collections=e.data,t.collectionsLoaded=!0,t.collectionsCanLoadMore=9==e.data.length,t.collectionsPage++}))},toggleCollectionItem:function(t){if(this.collectionsSelected.includes(t))this.collectionsSelected=this.collectionsSelected.filter((function(e){return e!=t}));else{if(7==this.collectionsSelected.length)return void swal("Oops!","You can only share to 5 collections.","info");this.collectionsSelected.push(t)}},clearSelectedCollections:function(){this.collectionsSelected=[],this.pageTitle="Compose",this.page=3},loadMoreCollections:function(){var t=this;this.collectionsCanLoadMore=!1,axios.get("/api/local/profile/collections/".concat(this.profile.id),{params:{page:this.collectionsPage}}).then((function(e){var a,i=t.collections.map((function(t){return t.id})),s=e.data.filter((function(t){return!i.includes(t.id)}));s&&s.length&&((a=t.collections).push.apply(a,r(s)),t.collectionsPage++,t.collectionsCanLoadMore=!0)}))}}}},32463:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"web-wrapper"},[t.isLoaded?e("div",{staticClass:"container-fluid mt-3"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-3 d-md-block"},[e("sidebar",{attrs:{user:t.profile}})],1),t._v(" "),e("div",{staticClass:"col-md-8"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-12 col-md-8 offset-md-1"},[e("compose-modal",{on:{close:t.closeModal}})],1)])])]),t._v(" "),e("drawer")],1):t._e()])},s=[]},69831:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"app-drawer-component"},[e("div",{staticClass:"mobile-footer-spacer d-block d-sm-none mt-5"}),t._v(" "),e("div",{staticClass:"mobile-footer d-block d-sm-none fixed-bottom"},[e("div",{staticClass:"card card-body rounded-0 px-0 pt-2 pb-3 box-shadow",staticStyle:{"border-top":"1px solid var(--border-color)"}},[e("ul",{staticClass:"nav nav-pills nav-fill d-flex align-items-middle"},[e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web"}},[e("p",[e("i",{staticClass:"far fa-home fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("Home")])])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web/timeline/local"}},[e("p",[e("i",{staticClass:"far fa-stream fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("Local")])])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web/compose"}},[e("p",[e("i",{staticClass:"far fa-plus-circle fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("New")])])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web/notifications"}},[e("p",[e("i",{staticClass:"far fa-bell fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("Alerts")])])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link text-dark",attrs:{to:"/i/web/profile/"+t.user.id}},[e("p",[e("i",{staticClass:"far fa-user fa-lg"})]),t._v(" "),e("p",{staticClass:"nav-link-label"},[e("span",[t._v("Profile")])])])],1)])])])])},s=[]},67153:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("b-modal",{ref:"avatarUpdateModal",attrs:{centered:"","hide-footer":"","header-class":"py-2","body-class":"p-0","title-class":"w-100 text-center pl-4 font-weight-bold","title-tag":"p",title:"Upload Avatar"}},[e("input",{ref:"avatarUpdateRef",staticClass:"d-none",attrs:{type:"file",accept:"image/jpg,image/png"},on:{change:function(e){return t.handleAvatarUpdate()}}}),t._v(" "),e("div",{staticClass:"d-flex align-items-center justify-content-center"},[0===t.avatarUpdateIndex?e("div",{staticClass:"py-5 user-select-none cursor-pointer",on:{drop:t.handleDrop,dragover:t.handleDrop,click:function(e){return t.avatarUpdateStep(0)}}},[e("p",{staticClass:"text-center primary"},[e("i",{staticClass:"fal fa-cloud-upload fa-3x"})]),t._v(" "),e("p",{staticClass:"text-center lead"},[t._v("Drag photo here or click here")]),t._v(" "),e("p",{staticClass:"text-center small text-muted mb-0"},[t._v("Must be a "),e("strong",[t._v("png")]),t._v(" or "),e("strong",[t._v("jpg")]),t._v(" image up to 2MB")])]):1===t.avatarUpdateIndex?e("div",{staticClass:"w-100 p-5"},[e("div",{staticClass:"d-md-flex justify-content-between align-items-center"},[e("div",{staticClass:"text-center mb-4"},[e("p",{staticClass:"small font-weight-bold",staticStyle:{opacity:"0.7"}},[t._v("Current")]),t._v(" "),e("img",{staticClass:"shadow",staticStyle:{width:"150px",height:"150px","object-fit":"cover","border-radius":"18px",opacity:"0.7"},attrs:{src:t.user.avatar}})]),t._v(" "),e("div",{staticClass:"text-center mb-4"},[e("p",{staticClass:"font-weight-bold"},[t._v("New")]),t._v(" "),e("img",{staticClass:"shadow",staticStyle:{width:"220px",height:"220px","object-fit":"cover","border-radius":"18px"},attrs:{src:t.avatarUpdatePreview}})])]),t._v(" "),e("hr"),t._v(" "),e("div",{staticClass:"d-flex justify-content-between"},[e("button",{staticClass:"btn btn-light font-weight-bold btn-block mr-3",on:{click:function(e){return t.avatarUpdateClear()}}},[t._v("Clear")]),t._v(" "),e("button",{staticClass:"btn btn-primary primary font-weight-bold btn-block mt-0",on:{click:function(e){return t.confirmUpload()}}},[t._v("Upload")])])]):t._e()])])},s=[]},67725:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"sidebar-component sticky-top d-none d-md-block"},[e("div",{staticClass:"card shadow-sm mb-3",staticStyle:{"border-radius":"15px"}},[e("div",{staticClass:"card-body p-2"},[e("div",{staticClass:"media user-card user-select-none"},[e("div",{staticStyle:{position:"relative"}},[e("img",{staticClass:"avatar shadow cursor-pointer",attrs:{src:t.user.avatar,draggable:"false",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=0';"},on:{click:function(e){return t.gotoMyProfile()}}}),t._v(" "),e("button",{staticClass:"btn btn-light btn-sm avatar-update-btn",on:{click:function(e){return t.updateAvatar()}}},[e("span",{staticClass:"avatar-update-btn-icon"})])]),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"display-name",domProps:{innerHTML:t._s(t.getDisplayName())}}),t._v(" "),e("p",{staticClass:"username primary"},[t._v("@"+t._s(t.user.username))]),t._v(" "),e("p",{staticClass:"stats"},[e("span",{staticClass:"stats-following"},[e("span",{staticClass:"following-count"},[t._v(t._s(t.formatCount(t.user.following_count)))]),t._v(" Following\n\t\t\t\t\t\t\t")]),t._v(" "),e("span",{staticClass:"stats-followers"},[e("span",{staticClass:"followers-count"},[t._v(t._s(t.formatCount(t.user.followers_count)))]),t._v(" Followers\n\t\t\t\t\t\t\t")])])])])])]),t._v(" "),e("div",{staticClass:"btn-group btn-group-lg btn-block mb-4"},[e("router-link",{staticClass:"btn btn-primary btn-block font-weight-bold",attrs:{to:"/i/web/compose"}},[e("i",{staticClass:"fal fa-arrow-circle-up mr-1"}),t._v(" "+t._s(t.$t("navmenu.compose"))+" Post\n\t\t\t")]),t._v(" "),t._m(0),t._v(" "),e("div",{staticClass:"dropdown-menu dropdown-menu-right"},[e("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:"/i/collections/create"}},[t._v("Create Collection")]),t._v(" "),t.hasStories?e("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:"/i/stories/new"}},[t._v("Create Story")]):t._e(),t._v(" "),e("div",{staticClass:"dropdown-divider"}),t._v(" "),e("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:"/settings/home"}},[t._v("Account Settings")])])],1),t._v(" "),e("div",{staticClass:"sidebar-sticky shadow-sm"},[e("ul",{staticClass:"nav flex-column"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"d-flex justify-content-between align-items-center"},[e("a",{staticClass:"nav-link text-center",class:["/i/web"==t.$route.path?"router-link-exact-active active":""],attrs:{href:"/i/web"},on:{click:function(e){return e.preventDefault(),t.goToFeed("home")}}},[t._m(1),t._v(" "),e("div",{staticClass:"small"},[t._v(t._s(t.$t("navmenu.homeFeed")))])]),t._v(" "),t.hasLocalTimeline?e("a",{staticClass:"nav-link text-center",class:["/i/web/timeline/local"==t.$route.path?"router-link-exact-active active":""],attrs:{href:"/i/web/timeline/local"},on:{click:function(e){return e.preventDefault(),t.goToFeed("local")}}},[t._m(2),t._v(" "),e("div",{staticClass:"small"},[t._v(t._s(t.$t("navmenu.localFeed")))])]):t._e(),t._v(" "),t.hasNetworkTimeline?e("a",{staticClass:"nav-link text-center",class:["/i/web/timeline/global"==t.$route.path?"router-link-exact-active active":""],attrs:{href:"/i/web/timeline/global"},on:{click:function(e){return e.preventDefault(),t.goToFeed("global")}}},[t._m(3),t._v(" "),e("div",{staticClass:"small"},[t._v(t._s(t.$t("navmenu.globalFeed")))])]):t._e()]),t._v(" "),e("hr",{staticClass:"mb-0",staticStyle:{"margin-top":"-5px",opacity:"0.4"}})]),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link",attrs:{to:"/i/web/discover"}},[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-compass"})]),t._v("\n\t\t\t\t\t\t"+t._s(t.$t("navmenu.discover"))+"\n\t\t\t\t\t")])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link d-flex justify-content-between align-items-center",attrs:{to:"/i/web/direct"}},[e("span",[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-envelope"})]),t._v("\n\t\t\t\t\t\t\t"+t._s(t.$t("navmenu.directMessages"))+"\n\t\t\t\t\t\t")])])],1),t._v(" "),t.hasLiveStreams?e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link d-flex justify-content-between align-items-center",attrs:{to:"/i/web/livestreams"}},[e("span",[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-record-vinyl"})]),t._v("\n\t\t\t\t\t\t\tLivestreams\n\t\t\t\t\t\t")])])],1):t._e(),t._v(" "),e("li",{staticClass:"nav-item"},[e("router-link",{staticClass:"nav-link d-flex justify-content-between align-items-center",attrs:{to:"/i/web/notifications"}},[e("span",[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-bell"})]),t._v("\n\t\t\t\t\t\t\t"+t._s(t.$t("navmenu.notifications"))+"\n\t\t\t\t\t\t")])])],1),t._v(" "),e("li",{staticClass:"nav-item"},[e("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),t._v(" "),e("router-link",{staticClass:"nav-link",attrs:{to:"/i/web/profile/"+t.user.id}},[e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-user"})]),t._v("\n\t\t\t\t\t\t"+t._s(t.$t("navmenu.profile"))+"\n\t\t\t\t\t")])],1),t._v(" "),t.user.is_admin?e("li",{staticClass:"nav-item"},[e("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),t._v(" "),e("a",{staticClass:"nav-link",attrs:{href:"/i/admin/dashboard"}},[t._m(4),t._v("\n\t\t\t\t\t\t"+t._s(t.$t("navmenu.admin"))+"\n\t\t\t\t\t")])]):t._e(),t._v(" "),e("li",{staticClass:"nav-item"},[e("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),t._v(" "),e("a",{staticClass:"nav-link",attrs:{href:"/?force_old_ui=1"}},[t._m(5),t._v("\n\t\t\t\t\t\t"+t._s(t.$t("navmenu.backToPreviousDesign"))+"\n\t\t\t\t\t")])])])]),t._v(" "),e("div",{staticClass:"sidebar-attribution pr-3 d-flex justify-content-between align-items-center"},[e("router-link",{attrs:{to:"/i/web/language"}},[e("i",{staticClass:"fal fa-language fa-2x",attrs:{alt:"Select a language"}})]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/site/help"}},[t._v(t._s(t.$t("navmenu.help")))]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/site/privacy"}},[t._v(t._s(t.$t("navmenu.privacy")))]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/site/terms"}},[t._v(t._s(t.$t("navmenu.terms")))]),t._v(" "),e("a",{staticClass:"font-weight-bold powered-by",attrs:{href:"https://pixelfed.org"}},[t._v("Powered by Pixelfed")])],1),t._v(" "),e("update-avatar",{ref:"avatarUpdate",attrs:{user:t.user}})],1)},s=[function(){var t=this._self._c;return t("button",{staticClass:"btn btn-outline-primary dropdown-toggle dropdown-toggle-split",attrs:{type:"button","data-toggle":"dropdown","aria-expanded":"false"}},[t("span",{staticClass:"sr-only"},[this._v("Toggle Dropdown")])])},function(){var t=this._self._c;return t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-home fa-lg"})])},function(){var t=this._self._c;return t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"fas fa-stream fa-lg"})])},function(){var t=this._self._c;return t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-globe fa-lg"})])},function(){var t=this._self._c;return t("span",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-tools"})])},function(){var t=this._self._c;return t("span",{staticClass:"icon text-lighter"},[t("i",{staticClass:"fas fa-chevron-left"})])}]},1131:(t,e,a)=>{a.r(e),a.d(e,{render:()=>i,staticRenderFns:()=>s});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"compose-modal-component"},[e("input",{staticClass:"w-100 h-100 d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",multiple:"",accept:t.config.uploader.media_types}}),t._v(" "),e("canvas",{staticClass:"d-none",attrs:{id:"pr_canvas"}}),t._v(" "),e("img",{staticClass:"d-none",attrs:{id:"pr_img"}}),t._v(" "),e("div",{staticClass:"timeline"},[t.uploading?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100 bg-light py-3",staticStyle:{"border-bottom":"1px solid #f1f1f1"}},[e("div",{staticClass:"p-5 mt-2"},[e("b-progress",{attrs:{value:t.uploadProgress,max:100,striped:"",animated:!0}}),t._v(" "),e("p",{staticClass:"text-center mb-0 font-weight-bold"},[t._v("Uploading ... ("+t._s(t.uploadProgress)+"%)")])],1)])]):"cameraRoll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[t._m(0),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[t.cameraRollMedia.length>0?e("div",{staticClass:"row p-0 m-0"},t._l(t.cameraRollMedia,(function(t,a){return e("div",{class:[0==a?"col-12 p-0":"col-3 p-0"]},[e("div",{staticClass:"card info-overlay p-0 rounded-0 shadow-none border"},[e("div",{staticClass:"square"},[e("img",{staticClass:"square-content",attrs:{src:t.preview_url}})])])])})),0):e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[e("span",{staticClass:"w-100 h-100"},[e("button",{staticClass:"btn btn-primary",attrs:{type:"button"}},[t._v("Upload")]),t._v(" "),e("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(e){return t.fetchCameraRollDrafts()}}},[t._v("Load Camera Roll")])])])])])]):"poll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[t._m(1),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tNew Poll\n\t\t\t\t\t")]),t._v(" "),t.postingPoll?e("span",[t._m(2)]):!t.postingPoll&&t.pollOptions.length>1&&t.composeText.length?e("button",{staticClass:"btn btn-primary btn-sm font-weight-bold",on:{click:t.postNewPoll}},[e("span",[t._v("Create Poll")])]):e("span",{staticClass:"font-weight-bold text-lighter"},[t._v("\n\t\t\t\t\t\tCreate Poll\n\t\t\t\t\t")])]),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{staticClass:"rounded-circle",attrs:{src:t.profile.avatar,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a poll question..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\tPoll Options\n\t\t\t\t\t\t")]),t._v(" "),t.pollOptions.length<4?e("div",{staticClass:"form-group mb-4"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.pollOptionModel,expression:"pollOptionModel"}],staticClass:"form-control rounded-pill",attrs:{type:"text",placeholder:"Add a poll option, press enter to save"},domProps:{value:t.pollOptionModel},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.savePollOption.apply(null,arguments)},input:function(e){e.target.composing||(t.pollOptionModel=e.target.value)}}})]):t._e(),t._v(" "),t._l(t.pollOptions,(function(a,i){return e("div",{staticClass:"form-group mb-4 d-flex align-items-center",staticStyle:{"max-width":"400px",position:"relative"}},[e("span",{staticClass:"font-weight-bold mr-2",staticStyle:{position:"absolute",left:"10px"}},[t._v(t._s(i+1)+".")]),t._v(" "),t.pollOptions[i].length<50?e("input",{directives:[{name:"model",rawName:"v-model",value:t.pollOptions[i],expression:"pollOptions[index]"}],staticClass:"form-control rounded-pill",staticStyle:{"padding-left":"30px","padding-right":"90px"},attrs:{type:"text",placeholder:"Add a poll option, press enter to save"},domProps:{value:t.pollOptions[i]},on:{input:function(e){e.target.composing||t.$set(t.pollOptions,i,e.target.value)}}}):e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.pollOptions[i],expression:"pollOptions[index]"}],staticClass:"form-control",staticStyle:{"padding-left":"30px","padding-right":"90px"},attrs:{placeholder:"Add a poll option, press enter to save",rows:"3"},domProps:{value:t.pollOptions[i]},on:{input:function(e){e.target.composing||t.$set(t.pollOptions,i,e.target.value)}}}),t._v(" "),e("button",{staticClass:"btn btn-danger btn-sm rounded-pill font-weight-bold",staticStyle:{position:"absolute",right:"5px"},on:{click:function(e){return t.deletePollOption(i)}}},[e("i",{staticClass:"fas fa-trash"}),t._v(" Delete\n\t\t\t\t\t\t\t")])])})),t._v(" "),e("hr"),t._v(" "),e("div",{staticClass:"d-flex justify-content-between"},[e("div",[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\t\t\tPoll Expiry\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"form-group"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.pollExpiry,expression:"pollExpiry"}],staticClass:"form-control rounded-pill",staticStyle:{width:"200px"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.pollExpiry=e.target.multiple?a:a[0]}}},[e("option",{attrs:{value:"60"}},[t._v("1 hour")]),t._v(" "),e("option",{attrs:{value:"360"}},[t._v("6 hours")]),t._v(" "),e("option",{attrs:{value:"1440",selected:""}},[t._v("24 hours")]),t._v(" "),e("option",{attrs:{value:"10080"}},[t._v("7 days")])])])]),t._v(" "),e("div",[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\t\t\tPoll Visibility\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"form-group"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.visibility,expression:"visibility"}],staticClass:"form-control rounded-pill",staticStyle:{"max-width":"200px"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.visibility=e.target.multiple?a:a[0]}}},[e("option",{attrs:{value:"public"}},[t._v("Public")]),t._v(" "),e("option",{attrs:{value:"private"}},[t._v("Followers Only")])])])])])],2)])])]):e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[e("div",[1==t.page?e("a",{staticClass:"font-weight-bold text-decoration-none text-muted",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.closeModal()}}},[e("i",{staticClass:"fas fa-times fa-lg"}),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]):2==t.page?e("span",[t.config.uploader.album_limit>t.media.length?e("button",{staticClass:"btn btn-outline-primary btn-sm font-weight-bold",attrs:{id:"cm-add-media-btn"},on:{click:function(e){return e.preventDefault(),t.addMedia.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-plus"})]):e("button",{staticClass:"btn btn-outline-secondary btn-sm font-weight-bold",attrs:{disabled:""}},[e("i",{staticClass:"fas fa-plus"})]),t._v(" "),e("b-tooltip",{attrs:{target:"cm-add-media-btn",triggers:"hover"}},[t._v("\n\t\t\t\t\t\t\t\tUpload another photo or video\n\t\t\t\t\t\t\t")])],1):3==t.page?e("span",[e("a",{staticClass:"text-lighter text-decoration-none mr-3 d-flex align-items-center",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goBack()}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left fa-lg mr-2"}),t._v(" "),e("span",{staticClass:"btn btn-outline-secondary btn-sm px-2 py-0 disabled",attrs:{disabled:""}},[t._v(t._s(t.media.length))])]),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]):e("span",[e("a",{staticClass:"text-lighter text-decoration-none mr-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goBack()}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left fa-lg"})])]),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]),t._v(" "),2==t.page?e("div",[1==t.media.length?e("a",{staticClass:"text-center text-dark",attrs:{href:"#",title:"Crop & Resize",id:"cm-crop-btn"},on:{click:function(e){return e.preventDefault(),t.showCropPhotoCard.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-crop-alt fa-lg"})]):t._e(),t._v(" "),e("b-tooltip",{attrs:{target:"cm-crop-btn",triggers:"hover"}},[t._v("\n\t\t\t\t\t\t\tCrop & Resize\n\t\t\t\t\t\t")])],1):t._e(),t._v(" "),e("div",[t.pageLoading?e("span",[t._m(3)]):e("span",[!t.pageLoading&&t.page>1&&t.page<=2||1==t.page&&0!=t.ids.length||"cropPhoto"==t.page?e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.nextPage.apply(null,arguments)}}},[t._v("Next")]):t._e(),t._v(" "),t.pageLoading||3!=t.page?t._e():[t.isPosting?e("b-spinner",{attrs:{small:""}}):e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.compose()}}},[t._v("Post")])],t._v(" "),t.pageLoading||"addText"!=t.page?t._e():e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.composeTextPost()}}},[t._v("Post")]),t._v(" "),t.pageLoading||"video-2"!=t.page?t._e():e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.compose()}}},[t._v("Post")]),t._v(" "),t.pageLoading||"filteringMedia"!=t.page?t._e():e("span",{staticClass:"font-weight-bold text-decoration-none text-muted"},[t._v("Next")])],2)])]),t._v(" "),e("div",{staticClass:"card-body p-0 border-top"},["licensePicker"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}},[e("div",{staticClass:"list-group list-group-flush"},t._l(t.availableLicenses,(function(a,i){return e("div",{staticClass:"list-group-item cursor-pointer",class:{"text-primary":t.licenseId===a.id,"font-weight-bold":t.licenseId===a.id},on:{click:function(e){return t.toggleLicense(a)}}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(a.name)+"\n\t\t\t\t\t\t\t")])})),0)]):"textOptions"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}}):"addText"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}},[e("div",{staticClass:"mt-2"},[e("div",{staticClass:"media px-3"},[e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Body")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",staticStyle:{"font-size":"18px",resize:"none"},attrs:{rows:"7",placeholder:"What's happening?"},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}}),t._v(" "),e("div",{staticClass:"border-bottom"}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0 font-weight-bold"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))]),t._v(" "),e("p",{staticClass:"mb-0 mt-2"},[e("a",{staticClass:"btn btn-primary rounded-pill mr-2",staticStyle:{height:"37px"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showTextOptions()}}},[e("i",{staticClass:"fas fa-palette px-3 text-white"})]),t._v(" "),e("a",{staticClass:"btn rounded-pill mx-3 d-inline-flex align-items-center",class:[t.nsfw?"btn-danger":"btn-outline-lighter"],staticStyle:{height:"37px"},attrs:{href:"#",title:"Mark as sensitive/not safe for work"},on:{click:function(e){e.preventDefault(),t.nsfw=!t.nsfw}}},[e("i",{staticClass:"far fa-flag px-3"}),t._v(" "),e("span",{staticClass:"text-muted small font-weight-bold"})]),t._v(" "),e("a",{staticClass:"btn btn-outline-lighter rounded-pill d-inline-flex align-items-center",staticStyle:{height:"37px"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-eye mr-2"}),t._v(" "),e("span",{staticClass:"text-muted small font-weight-bold"},[t._v(t._s(t.visibilityTag))])])])])])])])]):1==t.page?e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center",staticStyle:{"min-height":"400px"}},[e("div",{staticClass:"text-center"},[0==t.media.length?e("div",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark"},[e("div",{staticClass:"card-body py-2",on:{click:function(e){return e.preventDefault(),t.addMedia.apply(null,arguments)}}},[e("div",{staticClass:"media"},[t._m(4),t._v(" "),e("div",{staticClass:"media-body text-left"},[t._m(5),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Share up to "+t._s(t.config.uploader.album_limit)+" photos or videos")]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.config.uploader.media_types.split(",").map((function(t){return t.split("/")[1]})).join(", ")))]),t._v(" allowed up to "),e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.filesize(t.config.uploader.max_photo_size)))])])])])])]):t._e(),t._v(" "),t._e(),t._v(" "),1==t.config.features.stories?e("a",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark",attrs:{href:"/i/stories/new"}},[t._m(7)]):t._e(),t._v(" "),t._e(),t._v(" "),t._m(9),t._v(" "),t._m(10)])]):"cropPhoto"==t.page?e("div",{staticClass:"w-100 h-100"},[t.ids.length>0?e("div",[e("vue-cropper",{ref:"cropper",attrs:{relativeZoom:t.cropper.zoom,aspectRatio:t.cropper.aspectRatio,viewMode:t.cropper.viewMode,zoomable:t.cropper.zoomable,rotatable:!0,src:t.media[t.carouselCursor].url}})],1):t._e()]):2==t.page?e("div",{staticClass:"w-100 h-100"},[1==t.media.length?e("div",[e("div",{staticStyle:{display:"flex","min-height":"420px","align-items":"center"},attrs:{slot:"img"},slot:"img"},[e("img",{class:"d-block img-fluid w-100 "+[t.media[t.carouselCursor].filter_class?t.media[t.carouselCursor].filter_class:""],attrs:{src:t.media[t.carouselCursor].url,alt:t.media[t.carouselCursor].description,title:t.media[t.carouselCursor].description}})]),t._v(" "),e("hr"),t._v(" "),t.ids.length>0&&"image"==t.media[t.carouselCursor].type?e("div",{staticClass:"align-items-center px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),e("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,(function(a,i){return e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("div",{staticClass:"rounded",class:a[1]},[e("img",{attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,a[1])}}})])]),t._v(" "),e("a",{class:[t.media[t.carouselCursor].filter_class==a[1]?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,a[1])}}},[t._v(t._s(a[0]))])])}))],2)]):t._e()]):t.media.length>1?e("div",{staticClass:"d-flex-inline px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center pb-3"},[e("li",{staticClass:"nav-item mx-md-4"},[t._v(" ")]),t._v(" "),t._l(t.media,(function(a,i){return e("li",{key:a.id+":"+t.carouselCursor,staticClass:"nav-item mx-md-4"},[e("div",{staticClass:"nav-link",staticStyle:{display:"block",width:"300px",height:"300px"},on:{click:function(e){t.carouselCursor=i}}},[e("div",{class:[a.filter_class?a.filter_class:""],staticStyle:{width:"100%",height:"100%",display:"block"}},[e("div",{class:"rounded "+[i==t.carouselCursor?" border border-primary shadow":""],style:"display:block;width:100%;height:100%;background-image: url("+a.url+");background-size:cover;"})])]),t._v(" "),i==t.carouselCursor?e("div",{staticClass:"text-center mb-0 small text-lighter font-weight-bold pt-2"},[e("button",{staticClass:"btn btn-link",on:{click:function(e){return t.mediaReorder("prev")}}},[e("i",{staticClass:"far fa-chevron-circle-left"})]),t._v(" "),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return e.preventDefault(),t.showCropPhotoCard.apply(null,arguments)}}},[t._v("Crop")]),t._v(" "),e("span",{staticClass:"cursor-pointer px-3",on:{click:function(e){return e.preventDefault(),t.showEditMediaCard()}}},[t._v("Edit")]),t._v(" "),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return t.deleteMedia()}}},[t._v("Delete")]),t._v(" "),e("button",{staticClass:"btn btn-link",on:{click:function(e){return t.mediaReorder("next")}}},[e("i",{staticClass:"far fa-chevron-circle-right"})])]):t._e()])})),t._v(" "),e("li",{staticClass:"nav-item mx-md-4"},[t._v(" ")])],2),t._v(" "),e("hr"),t._v(" "),t.ids.length>0&&"image"==t.media[t.carouselCursor].type?e("div",{staticClass:"align-items-center px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),e("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,(function(a,i){return e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{class:a[1],attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,a[1])}}})]),t._v(" "),e("a",{class:[t.media[t.carouselCursor].filter_class==a[1]?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,a[1])}}},[t._v(t._s(a[0]))])])}))],2)]):t._e()]):e("div",[e("p",{staticClass:"mb-0 p-5 text-center font-weight-bold"},[t._v("An error occured, please refresh the page.")])])]):3==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{class:[t.media[0].filter_class?"mr-2 "+t.media[0].filter_class:"mr-2"],attrs:{src:t.media[0].url,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a caption..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer d-flex justify-content-between",on:{click:function(e){return t.showMediaDescriptionsCard()}}},[e("span",[t._v("Alt Text")]),t._v(" "),e("span",[t.media&&t.media.filter((function(t){return t.alt})).length==t.media.length?e("i",{staticClass:"fas fa-check-circle fa-lg text-success"}):e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])]),t._v(" "),e("div",{staticClass:"border-bottom px-4 mb-0 py-2"},[e("div",{staticClass:"d-flex justify-content-between"},[t._m(11),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asnsfw"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var a=t.nsfw,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=t._i(a,null);i.checked?o<0&&(t.nsfw=a.concat([null])):o>-1&&(t.nsfw=a.slice(0,o).concat(a.slice(o+1)))}else t.nsfw=s}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asnsfw"}})])])]),t._v(" "),t.nsfw?e("div",[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.spoilerText,expression:"spoilerText"}],staticClass:"form-control mt-3",attrs:{placeholder:"Add an optional content warning or spoiler text",maxlength:"140"},domProps:{value:t.spoilerText},on:{input:function(e){e.target.composing||(t.spoilerText=e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.spoilerTextLength)+"/140")])]):t._e()]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showTagCard()}}},[t._v("Tag people")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showCollectionCard()}}},[t._m(12),t._v(" "),e("span",{staticClass:"float-right"},[t.collectionsSelected.length?e("span",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px 5px","text-transform":"uppercase"},attrs:{href:"#",disabled:""}},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.collectionsSelected.length)+"\n\t\t\t\t\t\t\t\t\t")]):t._e(),t._v(" "),t._m(13)])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLicenseCard()}}},[e("span",[t._v("Add license")]),t._v(" "),e("span",{staticClass:"float-right"},[t.licenseTitle?e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showLicenseCard()}}},[t._v(t._s(t.licenseTitle))]):t._e(),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showLicenseCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[t.place?e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",{staticClass:"text-lighter"},[t._v("Location:")]),t._v(" "+t._s(t.place.name)+", "+t._s(t.place.country)+"\n\t\t\t\t\t\t\t\t"),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-2",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showLocationCard()}}},[t._v("Edit")]),t._v(" "),e("a",{staticClass:"btn btn-outline-secondary btn-sm small",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.place=!1}}},[t._v("Remove")])])]):e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLocationCard()}}},[t._v("Add location")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",[t._v("Audience")]),t._v(" "),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[t._v(t._s(t.visibilityTag))]),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticStyle:{"min-height":"200px"}},[e("p",{staticClass:"px-4 mb-0 py-2 small font-weight-bold text-muted cursor-pointer",on:{click:function(e){return t.showAdvancedSettingsCard()}}},[t._v("Advanced settings")])])]):"tagPeople"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("autocomplete",{directives:[{name:"show",rawName:"v-show",value:t.taggedUsernames.length<10,expression:"taggedUsernames.length < 10"}],ref:"autocomplete",attrs:{search:t.tagSearch,placeholder:"@pixelfed","aria-label":"Search usernames","get-result-value":t.getTagResultValue},on:{submit:t.onTagSubmitLocation}}),t._v(" "),e("p",{directives:[{name:"show",rawName:"v-show",value:t.taggedUsernames.length<10,expression:"taggedUsernames.length < 10"}],staticClass:"font-weight-bold text-muted small"},[t._v("You can tag "+t._s(10-t.taggedUsernames.length)+" more "+t._s(9==t.taggedUsernames.length?"person":"people")+"!")]),t._v(" "),e("p",{staticClass:"font-weight-bold text-center mt-3"},[t._v("Tagged People")]),t._v(" "),e("div",{staticClass:"list-group"},[t._l(t.taggedUsernames,(function(a,i){return e("div",{staticClass:"list-group-item d-flex justify-content-between"},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-2 rounded-circle border",attrs:{src:a.avatar,width:"24px",height:"24px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(a.name))])])]),t._v(" "),e("div",{staticClass:"custom-control custom-switch"},[e("input",{directives:[{name:"model",rawName:"v-model",value:a.privacy,expression:"tag.privacy"}],staticClass:"custom-control-input disabled",attrs:{type:"checkbox",id:"cci-tagged-privacy-switch"+i,disabled:""},domProps:{checked:Array.isArray(a.privacy)?t._i(a.privacy,null)>-1:a.privacy},on:{change:function(e){var i=a.privacy,s=e.target,o=!!s.checked;if(Array.isArray(i)){var n=t._i(i,null);s.checked?n<0&&t.$set(a,"privacy",i.concat([null])):n>-1&&t.$set(a,"privacy",i.slice(0,n).concat(i.slice(n+1)))}else t.$set(a,"privacy",o)}}}),t._v(" "),e("label",{staticClass:"custom-control-label font-weight-bold text-lighter",attrs:{for:"cci-tagged-privacy-switch"+i}},[t._v(t._s(a.privacy?"Public":"Private"))]),t._v(" "),e("a",{staticClass:"ml-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.untagUsername(i)}}},[e("i",{staticClass:"fas fa-times text-muted"})])])])})),t._v(" "),0==t.taggedUsernames.length?e("div",{staticClass:"list-group-item p-3"},[e("p",{staticClass:"text-center mb-0 font-weight-bold text-lighter"},[t._v("Search usernames to tag.")])]):t._e()],2),t._v(" "),e("p",{staticClass:"font-weight-bold text-center small text-muted pt-3 mb-0"},[t._v("When you tag someone, they are sent a notification."),e("br"),t._v("For more information on tagging, "),e("a",{staticClass:"text-primary",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showTagHelpCard()}}},[t._v("click here")]),t._v(".")])],1):"tagPeopleHelp"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"mb-0 text-center py-3 px-2 lead"},[t._v("Tagging someone is like mentioning them, with the option to make it private between you.")]),t._v(" "),e("p",{staticClass:"mb-3 py-3 px-2 font-weight-lighter"},[t._v("\n\t\t\t\t\t\t\tYou can choose to tag someone in public or private mode. Public mode will allow others to see who you tagged in the post and private mode tagged users will not be shown to others.\n\t\t\t\t\t\t")])]):"addLocation"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"mb-0"},[t._v("Add Location")]),t._v(" "),e("autocomplete",{attrs:{search:t.locationSearch,placeholder:"Search locations ...","aria-label":"Search locations ...","get-result-value":t.getResultValue},on:{submit:t.onSubmitLocation}})],1):"advancedSettings"==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"list-group list-group-flush"},[e("div",{staticClass:"list-group-item d-flex justify-content-between"},[t._m(14),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.commentsDisabled,expression:"commentsDisabled"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asdisablecomments"},domProps:{checked:Array.isArray(t.commentsDisabled)?t._i(t.commentsDisabled,null)>-1:t.commentsDisabled},on:{change:function(e){var a=t.commentsDisabled,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=t._i(a,null);i.checked?o<0&&(t.commentsDisabled=a.concat([null])):o>-1&&(t.commentsDisabled=a.slice(0,o).concat(a.slice(o+1)))}else t.commentsDisabled=s}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asdisablecomments"}})])])]),t._v(" "),e("a",{staticClass:"list-group-item",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showMediaDescriptionsCard()}}},[t._m(15)])])]):"visibility"==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"list-group list-group-flush"},[t.profile.locked?t._e():e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"public"==t.visibility},on:{click:function(e){return t.toggleVisibility("public")}}},[t._v("\n\t\t\t\t\t\t\t\tPublic\n\t\t\t\t\t\t\t")]),t._v(" "),t.profile.locked?t._e():e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"unlisted"==t.visibility},on:{click:function(e){return t.toggleVisibility("unlisted")}}},[t._v("\n\t\t\t\t\t\t\t\tUnlisted\n\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"private"==t.visibility},on:{click:function(e){return t.toggleVisibility("private")}}},[t._v("\n\t\t\t\t\t\t\t\tFollowers Only\n\t\t\t\t\t\t\t")])])]):"altText"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[t._l(t.media,(function(a,i){return e("div",[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:a.preview_url,width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:a.alt,expression:"m.alt"}],staticClass:"form-control",attrs:{placeholder:"Add a media description here...",maxlength:t.maxAltTextLength,rows:"4"},domProps:{value:a.alt},on:{input:function(e){e.target.composing||t.$set(a,"alt",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(a.alt?a.alt.length:0)+"/"+t._s(t.maxAltTextLength))])])]),t._v(" "),e("hr")])})),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Cancel")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])],2):"addToCollection"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[t.collectionsLoaded&&t.collections.length?e("div",{staticClass:"list-group mb-3 collections-list-group"},[t._l(t.collections,(function(a,i){return e("div",{staticClass:"list-group-item cursor-pointer compose-action border",class:{active:t.collectionsSelected.includes(i)},on:{click:function(e){return t.toggleCollectionItem(i)}}},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:a.thumb,alt:"",width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("h5",{staticClass:"mt-0"},[t._v(t._s(a.title))]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[t._v(t._s(a.post_count)+" Posts - Created "+t._s(t.timeAgo(a.published_at))+" ago")])])])])})),t._v(" "),t.collectionsCanLoadMore?e("button",{staticClass:"btn btn-light btn-block font-weight-bold mt-3",on:{click:t.loadMoreCollections}},[t._v("\n\t\t\t\t\t\t\t\tLoad more\n\t\t\t\t\t\t\t")]):t._e()],2):t._e(),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.clearSelectedCollections()}}},[t._v("Clear")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])]):"schedulePost"==t.page||"mediaMetadata"==t.page||"addToStory"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"text-center lead text-muted mb-0 py-5"},[t._v("This feature is not available yet.")])]):"editMedia"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:t.media[t.carouselCursor].preview_url,width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small"},[t._v("Media Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.media[t.carouselCursor].alt,expression:"media[carouselCursor].alt"}],staticClass:"form-control",attrs:{placeholder:"Add a media description here...",maxlength:"140"},domProps:{value:t.media[t.carouselCursor].alt},on:{input:function(e){e.target.composing||t.$set(t.media[t.carouselCursor],"alt",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-muted mb-0 d-flex justify-content-between"},[e("span",[t._v("Describe your photo for people with visual impairments.")]),t._v(" "),e("span",[t._v(t._s(t.media[t.carouselCursor].alt?t.media[t.carouselCursor].alt.length:0)+"/140")])])]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small"},[t._v("License")]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.licenseId,expression:"licenseId"}],staticClass:"form-control",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.licenseId=e.target.multiple?a:a[0]}}},t._l(t.availableLicenses,(function(a,i){return e("option",{domProps:{value:a.id,selected:a.id==t.licenseId}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t"+t._s(a.name)+"\n\t\t\t\t\t\t\t\t\t\t")])})),0)])])]),t._v(" "),e("hr"),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Cancel")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])]):"video-2"==t.page?e("div",{staticClass:"w-100 h-100"},[t.video.title.length?e("div",{staticClass:"border-bottom"},[e("div",{staticClass:"media p-3"},[e("img",{class:[t.media[0].filter_class?"mr-2 "+t.media[0].filter_class:"mr-2"],attrs:{src:t.media[0].url,width:"100px",height:"70px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"font-weight-bold mb-1"},[t._v(t._s(t.video.title?t.video.title.slice(0,70):"Untitled"))]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[t._v(t._s(t.video.description?t.video.description.slice(0,90):"No description"))])])])]):t._e(),t._v(" "),e("div",{staticClass:"border-bottom d-flex justify-content-between px-4 mb-0 py-2"},[t._m(16),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asnsfw"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var a=t.nsfw,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=t._i(a,null);i.checked?o<0&&(t.nsfw=a.concat([null])):o>-1&&(t.nsfw=a.slice(0,o).concat(a.slice(o+1)))}else t.nsfw=s}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asnsfw"}})])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLicenseCard()}}},[t._v("Add license")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",[t._v("Audience")]),t._v(" "),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[t._v(t._s(t.visibilityTag))]),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("div",{staticClass:"form-group"},[e("p",{staticClass:"small font-weight-bold text-muted mb-0"},[t._v("Title")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.video.title,expression:"video.title"}],staticClass:"form-control",attrs:{placeholder:"Add a good title"},domProps:{value:t.video.title},on:{input:function(e){e.target.composing||t.$set(t.video,"title",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text mb-0 small text-muted"},[t._v(t._s(t.video.title.length)+"/70")])]),t._v(" "),e("div",{staticClass:"form-group mb-0"},[e("p",{staticClass:"small font-weight-bold text-muted mb-0"},[t._v("Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.video.description,expression:"video.description"}],staticClass:"form-control",attrs:{placeholder:"Add an optional description",maxlength:"5000",rows:"5"},domProps:{value:t.video.description},on:{input:function(e){e.target.composing||t.$set(t.video,"description",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text mb-0 small text-muted"},[t._v(t._s(t.video.description.length)+"/5000")])])])]):"filteringMedia"==t.page?e("div",{staticClass:"w-100 h-100 py-5"},[e("div",{staticClass:"d-flex flex-column align-items-center justify-content-center py-5"},[e("b-spinner",{attrs:{small:""}}),t._v(" "),e("p",{staticClass:"font-weight-bold mt-3"},[t._v("Applying filters...")])],1)]):t._e()]),t._v(" "),"cropPhoto"==t.page?e("div",{staticClass:"card-footer bg-white d-flex justify-content-between"},[e("div",[e("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"},on:{click:t.rotate}},[e("i",{staticClass:"fas fa-redo"})])]),t._v(" "),e("div",[e("div",{staticClass:"d-inline-block button-group"},[e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==16/9?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(16/9)}}},[t._v("16:9")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==4/3?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(4/3)}}},[t._v("4:3")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[1.5==t.cropper.aspectRatio?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(1.5)}}},[t._v("3:2")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[1==t.cropper.aspectRatio?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(1)}}},[t._v("1:1")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==2/3?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(2/3)}}},[t._v("2:3")])])])]):t._e()])])])])},s=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[e("span",{staticClass:"pr-3"},[e("i",{staticClass:"fas fa-cog fa-lg text-muted"})]),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tCamera Roll\n\t\t\t\t\t")]),t._v(" "),e("span",{staticClass:"text-primary font-weight-bold"},[t._v("Upload")])])},function(){var t=this._self._c;return t("span",{staticClass:"pr-3"},[t("i",{staticClass:"fas fa-info-circle fa-lg text-primary"})])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%","background-color":"#008DF5"}},[t("i",{staticClass:"fal fa-bolt text-white fa-lg"})])},function(){var t=this._self._c;return t("p",{staticClass:"mb-0"},[t("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[this._v("New Post")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"2px solid #008DF5"}},[e("i",{staticClass:"far fa-edit text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Text Post")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Share a text only post")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"1px solid #008DF5"}},[e("i",{staticClass:"fas fa-history text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Story")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Add to your story")])])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"2px solid #008DF5"}},[e("i",{staticClass:"fas fa-poll-h text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Poll")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Create a poll")])])])])},function(){var t=this,e=t._self._c;return e("a",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark",attrs:{href:"/i/collections/create"}},[e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"1px solid #008DF5"}},[e("i",{staticClass:"fal fa-images text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Collection")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("New collection of posts")])])])])])},function(){var t=this._self._c;return t("p",{staticClass:"py-3"},[t("a",{staticClass:"font-weight-bold",attrs:{href:"/site/help"}},[this._v("Help")])])},function(){var t=this._self._c;return t("div",[t("div",{staticClass:"text-dark"},[this._v("Sensitive/NSFW Media")])])},function(){var t=this,e=t._self._c;return e("span",[t._v("Add to Collection "),e("span",{staticClass:"ml-2 badge badge-primary"},[t._v("NEW")])])},function(){var t=this._self._c;return t("span",{staticClass:"text-decoration-none"},[t("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])},function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"text-dark"},[t._v("Turn off commenting")]),t._v(" "),e("p",{staticClass:"text-muted small mb-0"},[t._v("Disables comments for this post, you can change this later.")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"d-flex justify-content-between align-items-center"},[e("div",[e("div",{staticClass:"text-dark"},[t._v("Media Descriptions")]),t._v(" "),e("p",{staticClass:"text-muted small mb-0"},[t._v("Describe your photos for people with visual impairments.")])]),t._v(" "),e("div",[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])},function(){var t=this._self._c;return t("div",[t("div",{staticClass:"text-dark"},[this._v("Contains NSFW Media")])])}]},35518:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(76798),s=a.n(i)()((function(t){return t[1]}));s.push([t.id,".app-drawer-component .nav-link{padding:.5rem .1rem}.app-drawer-component .nav-link.active{background-color:transparent}.app-drawer-component .nav-link.router-link-exact-active{background-color:transparent;color:var(--primary)!important}.app-drawer-component .nav-link p{margin-bottom:0}.app-drawer-component .nav-link-label{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:10px;font-weight:700;margin-top:0;opacity:.6;text-transform:uppercase}",""]);const o=s},54788:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(76798),s=a.n(i)()((function(t){return t[1]}));s.push([t.id,'.sidebar-component .sidebar-sticky{background-color:var(--card-bg);border-radius:15px}.sidebar-component.sticky-top{top:90px}.sidebar-component .nav{overflow:auto}.sidebar-component .nav-item .nav-link{color:#9ca3af;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-weight:500;margin-bottom:5px;padding-left:14px}.sidebar-component .nav-item .nav-link:hover{background-color:var(--light-hover-bg)}.sidebar-component .nav-item .nav-link .icon{display:inline-block;text-align:center;width:40px}.sidebar-component .nav-item .router-link-exact-active{color:var(--primary);font-weight:700;padding-left:14px}.sidebar-component .nav-item .router-link-exact-active:not(.text-center){border-left:4px solid var(--primary);padding-left:10px}.sidebar-component .nav-item .router-link-exact-active .icon{color:var(--primary)!important}.sidebar-component .nav-item:first-child .nav-link .small{font-weight:700}.sidebar-component .nav-item:first-child .nav-link:first-child{border-top-left-radius:15px}.sidebar-component .nav-item:first-child .nav-link:last-child{border-top-right-radius:15px}.sidebar-component .nav-item:is(:last-child) .nav-link{border-bottom-left-radius:15px;border-bottom-right-radius:15px;margin-bottom:0}.sidebar-component .sidebar-heading{font-size:.75rem;text-transform:uppercase}.sidebar-component .user-card{align-items:center}.sidebar-component .user-card .avatar{border:1px solid var(--border-color);border-radius:15px;height:75px;margin-right:.8rem;width:75px}.sidebar-component .user-card .avatar-update-btn{background:hsla(0,0%,100%,.9);border:1px solid #dee2e6!important;border-radius:50rem;bottom:0;height:20px;padding:0;position:absolute;right:12px;width:20px}.sidebar-component .user-card .avatar-update-btn-icon{-webkit-font-smoothing:antialiased;display:inline-block;font-family:Font Awesome\\ 5 Free;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-rendering:auto}.sidebar-component .user-card .avatar-update-btn-icon:before{content:"\\f013"}.sidebar-component .user-card .username{font-size:13px;font-weight:600;margin-bottom:0}.sidebar-component .user-card .display-name{color:var(--body-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:14px;font-weight:800!important;line-height:.8;margin-bottom:0;-webkit-user-select:all;-moz-user-select:all;user-select:all;word-break:break-all}.sidebar-component .user-card .stats{font-size:12px;margin-bottom:0;margin-top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-component .user-card .stats .stats-following{margin-right:.8rem}.sidebar-component .user-card .stats .followers-count,.sidebar-component .user-card .stats .following-count{font-weight:800}.sidebar-component .btn-primary{background-color:var(--primary)}.sidebar-component .btn-primary.router-link-exact-active{cursor:unset;opacity:.5;pointer-events:none}.sidebar-component .sidebar-sitelinks{display:flex;justify-content:space-between;margin-top:1rem;padding:0 2rem}.sidebar-component .sidebar-sitelinks a{color:#b8c2cc;font-size:12px}.sidebar-component .sidebar-sitelinks .active{color:#212529;font-weight:600}.sidebar-component .sidebar-attribution{color:#b8c2cc;font-size:10px;margin-top:.5rem;padding-left:2rem}.sidebar-component .sidebar-attribution a{color:#b8c2cc!important}.sidebar-component .sidebar-attribution a.powered-by{opacity:.5}',""]);const o=s},67264:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(76798),s=a.n(i)()((function(t){return t[1]}));s.push([t.id,".compose-modal-component .media-drawer-filters{flex-wrap:unset;overflow-x:auto}.compose-modal-component .media-drawer-filters .nav-link{min-width:100px;padding-bottom:1rem;padding-top:1rem}.compose-modal-component .media-drawer-filters .active{color:#fff;font-weight:700}@media (hover:none) and (pointer:coarse){.compose-modal-component .media-drawer-filters::-webkit-scrollbar{display:none}}.compose-modal-component .no-focus{border-color:none;box-shadow:none;outline:0}.compose-modal-component a.list-group-item{text-decoration:none}.compose-modal-component a.list-group-item:hover{background-color:#f8f9fa;text-decoration:none}.compose-modal-component .compose-action:hover{background-color:#f8f9fa;cursor:pointer}.compose-modal-component .collections-list-group{max-height:500px;overflow-y:auto}.compose-modal-component .collections-list-group .list-group-item.active{background-color:#dbeafe!important;border-color:#60a5fa!important;color:#212529}",""]);const o=s},96259:(t,e,a)=>{a.r(e),a.d(e,{default:()=>r});var i=a(85072),s=a.n(i),o=a(35518),n={insert:"head",singleton:!1};s()(o.default,n);const r=o.default.locals||{}},5323:(t,e,a)=>{a.r(e),a.d(e,{default:()=>r});var i=a(85072),s=a.n(i),o=a(54788),n={insert:"head",singleton:!1};s()(o.default,n);const r=o.default.locals||{}},87877:(t,e,a)=>{a.r(e),a.d(e,{default:()=>r});var i=a(85072),s=a.n(i),o=a(67264),n={insert:"head",singleton:!1};s()(o.default,n);const r=o.default.locals||{}},46537:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(22358),s=a(6422),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},5787:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(16286),s=a(80260),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);a(68840);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},90414:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(82704),s=a(55597),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},28772:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(75754),s=a(75223),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);a(68338);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},19324:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});var i=a(81274),s=a(50427),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);a.d(e,o);a(21710);const n=(0,a(14486).default)(s.default,i.render,i.staticRenderFns,!1,null,null,null).exports},6422:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(66517),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},80260:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(50371),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},55597:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(84154),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},75223:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(79318),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},50427:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var i=a(28320),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s);const o=i.default},22358:(t,e,a)=>{a.r(e);var i=a(32463),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},16286:(t,e,a)=>{a.r(e);var i=a(69831),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},82704:(t,e,a)=>{a.r(e);var i=a(67153),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},75754:(t,e,a)=>{a.r(e);var i=a(67725),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},81274:(t,e,a)=>{a.r(e);var i=a(1131),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},68840:(t,e,a)=>{a.r(e);var i=a(96259),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},68338:(t,e,a)=>{a.r(e);var i=a(5323),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)},21710:(t,e,a)=>{a.r(e);var i=a(87877),s={};for(const t in i)"default"!==t&&(s[t]=()=>i[t]);a.d(e,s)}}]); \ No newline at end of file diff --git a/public/js/compose.js b/public/js/compose.js index 13cdd5693..a402ba9fe 100644 --- a/public/js/compose.js +++ b/public/js/compose.js @@ -1 +1 @@ -(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[5666],{28320:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>c});var s=i(91584),a=(i(77333),i(2e4)),o=(i(87980),i(79288)),n=i(74692);function l(t){return function(t){if(Array.isArray(t))return r(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)return;if("string"==typeof t)return r(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(t,e)}(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i10&&(t.licenseTitle=t.availableLicenses.filter((function(e){return e.id==t.licenseId})).map((function(t){return t.title}))[0]),t.fetchProfile()}))},mounted:function(){this.mediaWatcher()},methods:{timeAgo:function(t){return App.util.format.timeAgo(t)},formatBytes:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+t)return"0 Bytes";var i=e<0?0:e,s=Math.floor(Math.log(t)/Math.log(1024));return"".concat(parseFloat((t/Math.pow(1024,s)).toFixed(i))," ").concat(["Bytes","KB","MB","GB","TB"][s])},fetchProfile:function(){var t=this,e={public:"Public",private:"Followers Only",unlisted:"Unlisted"};if(window._sharedData.curUser.id){if(this.profile=window._sharedData.curUser,this.composeSettings&&this.composeSettings.hasOwnProperty("default_scope")&&this.composeSettings.default_scope){var i=this.composeSettings.default_scope;this.visibility=i,this.visibilityTag=e[i]}1==this.profile.locked&&(this.visibility="private",this.visibilityTag="Followers Only")}else axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(i){if(window._sharedData.currentUser=i.data,t.profile=i.data,t.composeSettings&&t.composeSettings.hasOwnProperty("default_scope")&&t.composeSettings.default_scope){var s=t.composeSettings.default_scope;t.visibility=s,t.visibilityTag=e[s]}1==t.profile.locked&&(t.visibility="private",t.visibilityTag="Followers Only")})).catch((function(t){}))},addMedia:function(t){var e=n(t.target);e.attr("disabled",""),n('.file-input[name="media"]').trigger("click"),e.blur(),e.removeAttr("disabled")},addText:function(t){this.pageTitle="New Text Post",this.page="addText",this.textMode=!0,this.mode="text"},mediaWatcher:function(){var t=this;n(document).on("change","#pf-dz",(function(e){t.mediaUpload()}))},mediaUpload:function(){var t=this;t.uploading=!0;var e=document.querySelector("#pf-dz");e.files.length||(t.uploading=!1),Array.prototype.forEach.call(e.files,(function(e,i){if(t.media&&t.media.length+i>=t.config.uploader.album_limit)return swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error"),t.uploading=!1,void(t.page=2);var s=e.type,a=t.config.uploader.media_types.split(",");if(-1==n.inArray(s,a))return swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.config.uploader.media_types+" only.","error"),t.uploading=!1,void(t.page=2);var o=new FormData;o.append("file",e);var l={onUploadProgress:function(e){var i=Math.round(100*e.loaded/e.total);t.uploadProgress=i}};axios.post("/api/compose/v0/media/upload",o,l).then((function(e){t.uploadProgress=100,t.ids.push(e.data.id),t.media.push(e.data),t.uploading=!1,setTimeout((function(){t.page=3}),300)})).catch((function(i){switch(i.response.status){case 403:t.uploading=!1,e.value=null,swal("Account size limit reached","Contact your admin for assistance.","error"),t.page=2;break;case 413:t.uploading=!1,e.value=null,swal("File is too large","The file you uploaded has the size of "+t.formatBytes(e.size)+". Unfortunately, only images up to "+t.formatBytes(1024*t.config.uploader.max_photo_size)+" are supported.\nPlease resize the file and try again.","error"),t.page=2;break;case 451:t.uploading=!1,e.value=null,swal("Banned Content","This content has been banned and cannot be uploaded.","error"),t.page=2;break;case 429:t.uploading=!1,e.value=null,swal("Limit Reached","You can upload up to 250 photos or videos per day and you've reached that limit. Please try again later.","error"),t.page=2;break;case 500:t.uploading=!1,e.value=null,swal("Error",i.response.data.message,"error"),t.page=2;break;default:t.uploading=!1,e.value=null,swal("Oops, something went wrong!","An unexpected error occurred.","error"),t.page=2}})),e.value=null,t.uploadProgress=0}))},toggleFilter:function(t,e){this.media[this.carouselCursor].filter_class=e,this.currentFilter=e},deleteMedia:function(){var t=this;if(0!=window.confirm("Are you sure you want to delete this media?")){var e=this.media[this.carouselCursor].id;axios.delete("/api/compose/v0/media/delete",{params:{id:e}}).then((function(e){t.ids.splice(t.carouselCursor,1),t.media.splice(t.carouselCursor,1),0==t.media.length?(t.ids=[],t.media=[],t.carouselCursor=0):t.carouselCursor=0})).catch((function(t){swal("Whoops!","An error occured when attempting to delete this, please try again","error")}))}},mediaReorder:function(t){var e=this,i=this.media,s=this.carouselCursor,a=i[s],o=[],n=0;if("prev"==t)if(0==s){for(var l=n;l=0&&e=0&&ithis.config.uploader.max_caption_length)swal("Error","Caption is too long","error");else switch(e){case"publish":if(this.isPosting=!0,this.media.filter((function(t){return t.filter_class&&!t.hasOwnProperty("is_filtered")})).length)return void this.applyFilterToMedia();if(!0===this.composeSettings.media_descriptions)if(this.media.filter((function(t){return!t.hasOwnProperty("alt")||t.alt.length<2})).length)return swal("Missing media descriptions","You have enabled mandatory media descriptions. Please add media descriptions under Advanced settings to proceed. For more information, please see the media settings page.","warning"),void(this.isPosting=!1);if(0==this.media.length)return void swal("Whoops!","You need to add media before you can save this!","warning");"Add optional caption..."==this.composeText&&(this.composeText="");var i={media:this.media,caption:this.composeText,visibility:this.visibility,cw:this.nsfw,comments_disabled:this.commentsDisabled,place:this.place,tagged:this.taggedUsernames,optimize_media:this.optimizeMedia,license:this.licenseId,video:this.video,spoiler_text:this.spoilerText};return this.collectionsSelected.length&&(i.collections=this.collectionsSelected.map((function(e){return t.collections[e].id}))),void axios.post("/api/compose/v0/publish",i).then((function(t){"/i/web/compose"===location.pathname&&t.data&&t.data.length?location.href="/i/web/post/"+t.data.split("/").slice(-1)[0]:location.href=t.data})).catch((function(t){if(t.response){var e=t.response.data.message?t.response.data.message:"An unexpected error occured.";swal("Oops, something went wrong!",e,"error")}else swal("Oops, something went wrong!",t.message,"error")}));case"delete":return this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void n("#composeModal").modal("hide")}},composeTextPost:function(){var t=this.composeState;if(this.composeText.length>this.config.uploader.max_caption_length)swal("Error","Caption is too long","error");else switch(t){case"publish":var e={caption:this.composeText,visibility:this.visibility,cw:this.nsfw,comments_disabled:this.commentsDisabled,place:this.place,tagged:this.taggedUsernames};return void axios.post("/api/compose/v0/publish/text",e).then((function(t){var e=t.data;window.location.href=e})).catch((function(t){var e=t.response.data.message?t.response.data.message:"An unexpected error occured.";swal("Oops, something went wrong!",e,"error")}));case"delete":return this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void n("#composeModal").modal("hide")}},closeModal:function(){n("#composeModal").modal("hide"),this.$emit("close")},goBack:function(){switch(this.pageTitle="",this.mode){case"photo":switch(this.page){case"filteringMedia":case"cropPhoto":case"editMedia":this.page=2;break;case"addText":case"video-2":this.page=1;break;case"textOptions":this.page="addText";break;case"tagPeopleHelp":this.showTagCard();break;case"licensePicker":this.page=3;break;default:-1!=this.namedPages.indexOf(this.page)?this.page=3:this.page--}break;case"video":if("filteringMedia"===this.page)this.page=2;else this.page="video-2";break;default:switch(this.page){case"addText":case"video-2":this.page=1;break;case"filteringMedia":case"cropPhoto":case"editMedia":this.page=2;break;case"textOptions":this.page="addText";break;case"tagPeopleHelp":this.showTagCard();break;case"licensePicker":this.page=3;break;default:-1!=this.namedPages.indexOf(this.page)?this.page="text"==this.mode?"addText":3:"text"==this.mode||this.page--}}},nextPage:function(){switch(this.pageTitle="",this.page){case 1:this.page=2;break;case"filteringMedia":break;case"cropPhoto":this.pageLoading=!0;var t=this;this.$refs.cropper.getCroppedCanvas({maxWidth:4096,maxHeight:4096,fillColor:"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((function(e){t.mediaCropped=!0;var i=new FormData;i.append("file",e),i.append("id",t.ids[t.carouselCursor]);axios.post("/api/compose/v0/media/update",i).then((function(e){t.media[t.carouselCursor].url=e.data.url,t.pageLoading=!1,t.page=2})).catch((function(t){}))}));break;case 2:case 3:this.page++}},rotate:function(){this.$refs.cropper.rotate(90)},changeAspect:function(t){this.cropper.aspectRatio=t,this.$refs.cropper.setAspectRatio(t)},showTagCard:function(){this.pageTitle="Tag People",this.page="tagPeople"},showTagHelpCard:function(){this.pageTitle="About Tag People",this.page="tagPeopleHelp"},showLocationCard:function(){this.pageTitle="Add Location",this.page="addLocation"},showAdvancedSettingsCard:function(){this.pageTitle="Advanced Settings",this.page="advancedSettings"},locationSearch:function(t){if(t.length<1)return[];return axios.get("/api/compose/v0/search/location",{params:{q:t}}).then((function(t){return t.data}))},getResultValue:function(t){return t.name+", "+t.country},onSubmitLocation:function(t){switch(this.place=t,this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},showVisibilityCard:function(){this.pageTitle="Post Visibility",this.page="visibility"},showAddToStoryCard:function(){this.pageTitle="Add to Story",this.page="addToStory"},showCropPhotoCard:function(){this.pageTitle="Edit Photo",this.page="cropPhoto"},toggleVisibility:function(t){switch(this.visibility=t,this.visibilityTag={public:"Public",private:"Followers Only",unlisted:"Unlisted"}[t],this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},showMediaDescriptionsCard:function(){this.pageTitle="Media Descriptions",this.page="altText"},showAddToCollectionsCard:function(){this.pageTitle="Add to Collection",this.page="addToCollection"},showSchedulePostCard:function(){this.pageTitle="Schedule Post",this.page="schedulePost"},showEditMediaCard:function(){this.pageTitle="Edit Media",this.page="editMedia"},fetchCameraRollDrafts:function(){var t=this;axios.get("/api/pixelfed/local/drafts").then((function(e){t.cameraRollMedia=e.data}))},applyFilterToMedia:function(){var t=this,e=navigator.userAgent.toLowerCase();if(-1==e.indexOf("firefox")&&-1==e.indexOf("chrome"))return this.isPosting=!1,swal("Oops!","Your browser does not support the filter feature.","error"),void(this.page=3);var i=this.media.filter((function(t){return t.filter_class})).length;i?(this.page="filteringMedia",this.filteringRemainingCount=i,this.$nextTick((function(){t.isFilteringMedia=!0,t.media.forEach((function(e,i){return t.applyFilterToMediaSave(e,i)}))}))):this.page=3},applyFilterToMediaSave:function(t,e){if(t.filter_class){var i=this,s=null,a=document.createElement("canvas"),o=a.getContext("2d"),n=document.createElement("img");n.src=t.url,n.addEventListener("load",(function(l){a.width=n.width,a.height=n.height,o.filter=App.util.filterCss[t.filter_class],o.drawImage(n,0,0,n.width,n.height),o.save(),a.toBlob((function(a){(s=new FormData).append("file",a),s.append("id",t.id),axios.post("/api/compose/v0/media/update",s).then((function(t){i.media[e].is_filtered=!0,i.updateFilteringMedia()})).catch((function(t){}))}))}),t.mime,.9),o.clearRect(0,0,n.width,n.height)}},updateFilteringMedia:function(){var t=this;this.filteringRemainingCount--,this.filteringMediaTimeout=setTimeout((function(){return t.filteringMediaTimeoutJob()}),500)},filteringMediaTimeoutJob:function(){var t=this;0===this.filteringRemainingCount?(this.isFilteringMedia=!1,clearTimeout(this.filteringMediaTimeout),setTimeout((function(){return t.compose()}),500)):(clearTimeout(this.filteringMediaTimeout),this.filteringMediaTimeout=setTimeout((function(){return t.filteringMediaTimeoutJob()}),1e3))},tagSearch:function(t){if(t.length<1)return[];var e=this;return axios.get("/api/compose/v0/search/tag",{params:{q:t}}).then((function(t){if(t.data.length)return t.data.filter((function(t){return 0==e.taggedUsernames.filter((function(e){return e.id==t.id})).length}))}))},getTagResultValue:function(t){return"@"+t.name},onTagSubmitLocation:function(t){this.taggedUsernames.filter((function(e){return e.id==t.id})).length||(this.taggedUsernames.push(t),this.$refs.autocomplete.value="")},untagUsername:function(t){this.taggedUsernames.splice(t,1)},showTextOptions:function(){this.page="textOptions",this.pageTitle="Text Post Options"},showLicenseCard:function(){this.pageTitle="Select a License",this.page="licensePicker"},toggleLicense:function(t){var e=this;switch(this.licenseId=t.id,this.licenseId>10?this.licenseTitle=this.availableLicenses.filter((function(t){return t.id==e.licenseId})).map((function(t){return t.title}))[0]:this.licenseTitle=null,this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},newPoll:function(){this.page="poll"},savePollOption:function(){-1==this.pollOptions.indexOf(this.pollOptionModel)?(this.pollOptions.push(this.pollOptionModel),this.pollOptionModel=null):this.pollOptionModel=null},deletePollOption:function(t){this.pollOptions.splice(t,1)},postNewPoll:function(){var t=this;this.postingPoll=!0,axios.post("/api/compose/v0/poll",{caption:this.composeText,cw:!1,visibility:this.visibility,comments_disabled:!1,expiry:this.pollExpiry,pollOptions:this.pollOptions}).then((function(e){if(!e.data.hasOwnProperty("url"))return swal("Oops!","An error occured while attempting to create this poll. Please refresh the page and try again.","error"),void(t.postingPoll=!1);window.location.href=e.data.url})).catch((function(e){if(e.response.data.hasOwnProperty("error")&&"Duplicate detected."==e.response.data.error)return t.postingPoll=!1,void swal("Oops!","The poll you are trying to create is similar to an existing poll you created. Please make the poll question (caption) unique.","error");t.postingPoll=!1,swal("Oops!","An error occured while attempting to create this poll. Please refresh the page and try again.","error")}))},filesize:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return filesize(1024*t,{round:0})})),showCollectionCard:function(){this.pageTitle="Add to Collection(s)",this.page="addToCollection",this.collectionsLoaded||this.fetchCollections()},fetchCollections:function(){var t=this;axios.get("/api/local/profile/collections/".concat(this.profile.id)).then((function(e){t.collections=e.data,t.collectionsLoaded=!0,t.collectionsCanLoadMore=9==e.data.length,t.collectionsPage++}))},toggleCollectionItem:function(t){if(this.collectionsSelected.includes(t))this.collectionsSelected=this.collectionsSelected.filter((function(e){return e!=t}));else{if(7==this.collectionsSelected.length)return void swal("Oops!","You can only share to 5 collections.","info");this.collectionsSelected.push(t)}},clearSelectedCollections:function(){this.collectionsSelected=[],this.pageTitle="Compose",this.page=3},loadMoreCollections:function(){var t=this;this.collectionsCanLoadMore=!1,axios.get("/api/local/profile/collections/".concat(this.profile.id),{params:{page:this.collectionsPage}}).then((function(e){var i,s=t.collections.map((function(t){return t.id})),a=e.data.filter((function(t){return!s.includes(t.id)}));a&&a.length&&((i=t.collections).push.apply(i,l(a)),t.collectionsPage++,t.collectionsCanLoadMore=!0)}))}}}},1131:(t,e,i)=>{"use strict";i.r(e),i.d(e,{render:()=>s,staticRenderFns:()=>a});var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"compose-modal-component"},[e("input",{staticClass:"w-100 h-100 d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",multiple:"",accept:t.config.uploader.media_types}}),t._v(" "),e("canvas",{staticClass:"d-none",attrs:{id:"pr_canvas"}}),t._v(" "),e("img",{staticClass:"d-none",attrs:{id:"pr_img"}}),t._v(" "),e("div",{staticClass:"timeline"},[t.uploading?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100 bg-light py-3",staticStyle:{"border-bottom":"1px solid #f1f1f1"}},[e("div",{staticClass:"p-5 mt-2"},[e("b-progress",{attrs:{value:t.uploadProgress,max:100,striped:"",animated:!0}}),t._v(" "),e("p",{staticClass:"text-center mb-0 font-weight-bold"},[t._v("Uploading ... ("+t._s(t.uploadProgress)+"%)")])],1)])]):"cameraRoll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[t._m(0),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[t.cameraRollMedia.length>0?e("div",{staticClass:"row p-0 m-0"},t._l(t.cameraRollMedia,(function(t,i){return e("div",{class:[0==i?"col-12 p-0":"col-3 p-0"]},[e("div",{staticClass:"card info-overlay p-0 rounded-0 shadow-none border"},[e("div",{staticClass:"square"},[e("img",{staticClass:"square-content",attrs:{src:t.preview_url}})])])])})),0):e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[e("span",{staticClass:"w-100 h-100"},[e("button",{staticClass:"btn btn-primary",attrs:{type:"button"}},[t._v("Upload")]),t._v(" "),e("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(e){return t.fetchCameraRollDrafts()}}},[t._v("Load Camera Roll")])])])])])]):"poll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[t._m(1),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tNew Poll\n\t\t\t\t\t")]),t._v(" "),t.postingPoll?e("span",[t._m(2)]):!t.postingPoll&&t.pollOptions.length>1&&t.composeText.length?e("button",{staticClass:"btn btn-primary btn-sm font-weight-bold",on:{click:t.postNewPoll}},[e("span",[t._v("Create Poll")])]):e("span",{staticClass:"font-weight-bold text-lighter"},[t._v("\n\t\t\t\t\t\tCreate Poll\n\t\t\t\t\t")])]),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{staticClass:"rounded-circle",attrs:{src:t.profile.avatar,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a poll question..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\tPoll Options\n\t\t\t\t\t\t")]),t._v(" "),t.pollOptions.length<4?e("div",{staticClass:"form-group mb-4"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.pollOptionModel,expression:"pollOptionModel"}],staticClass:"form-control rounded-pill",attrs:{type:"text",placeholder:"Add a poll option, press enter to save"},domProps:{value:t.pollOptionModel},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.savePollOption.apply(null,arguments)},input:function(e){e.target.composing||(t.pollOptionModel=e.target.value)}}})]):t._e(),t._v(" "),t._l(t.pollOptions,(function(i,s){return e("div",{staticClass:"form-group mb-4 d-flex align-items-center",staticStyle:{"max-width":"400px",position:"relative"}},[e("span",{staticClass:"font-weight-bold mr-2",staticStyle:{position:"absolute",left:"10px"}},[t._v(t._s(s+1)+".")]),t._v(" "),t.pollOptions[s].length<50?e("input",{directives:[{name:"model",rawName:"v-model",value:t.pollOptions[s],expression:"pollOptions[index]"}],staticClass:"form-control rounded-pill",staticStyle:{"padding-left":"30px","padding-right":"90px"},attrs:{type:"text",placeholder:"Add a poll option, press enter to save"},domProps:{value:t.pollOptions[s]},on:{input:function(e){e.target.composing||t.$set(t.pollOptions,s,e.target.value)}}}):e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.pollOptions[s],expression:"pollOptions[index]"}],staticClass:"form-control",staticStyle:{"padding-left":"30px","padding-right":"90px"},attrs:{placeholder:"Add a poll option, press enter to save",rows:"3"},domProps:{value:t.pollOptions[s]},on:{input:function(e){e.target.composing||t.$set(t.pollOptions,s,e.target.value)}}}),t._v(" "),e("button",{staticClass:"btn btn-danger btn-sm rounded-pill font-weight-bold",staticStyle:{position:"absolute",right:"5px"},on:{click:function(e){return t.deletePollOption(s)}}},[e("i",{staticClass:"fas fa-trash"}),t._v(" Delete\n\t\t\t\t\t\t\t")])])})),t._v(" "),e("hr"),t._v(" "),e("div",{staticClass:"d-flex justify-content-between"},[e("div",[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\t\t\tPoll Expiry\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"form-group"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.pollExpiry,expression:"pollExpiry"}],staticClass:"form-control rounded-pill",staticStyle:{width:"200px"},on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.pollExpiry=e.target.multiple?i:i[0]}}},[e("option",{attrs:{value:"60"}},[t._v("1 hour")]),t._v(" "),e("option",{attrs:{value:"360"}},[t._v("6 hours")]),t._v(" "),e("option",{attrs:{value:"1440",selected:""}},[t._v("24 hours")]),t._v(" "),e("option",{attrs:{value:"10080"}},[t._v("7 days")])])])]),t._v(" "),e("div",[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\t\t\tPoll Visibility\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"form-group"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.visibility,expression:"visibility"}],staticClass:"form-control rounded-pill",staticStyle:{"max-width":"200px"},on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.visibility=e.target.multiple?i:i[0]}}},[e("option",{attrs:{value:"public"}},[t._v("Public")]),t._v(" "),e("option",{attrs:{value:"private"}},[t._v("Followers Only")])])])])])],2)])])]):e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[e("div",[1==t.page?e("a",{staticClass:"font-weight-bold text-decoration-none text-muted",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.closeModal()}}},[e("i",{staticClass:"fas fa-times fa-lg"}),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]):2==t.page?e("span",[t.config.uploader.album_limit>t.media.length?e("button",{staticClass:"btn btn-outline-primary btn-sm font-weight-bold",attrs:{id:"cm-add-media-btn"},on:{click:function(e){return e.preventDefault(),t.addMedia.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-plus"})]):e("button",{staticClass:"btn btn-outline-secondary btn-sm font-weight-bold",attrs:{disabled:""}},[e("i",{staticClass:"fas fa-plus"})]),t._v(" "),e("b-tooltip",{attrs:{target:"cm-add-media-btn",triggers:"hover"}},[t._v("\n\t\t\t\t\t\t\t\tUpload another photo or video\n\t\t\t\t\t\t\t")])],1):3==t.page?e("span",[e("a",{staticClass:"text-lighter text-decoration-none mr-3 d-flex align-items-center",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goBack()}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left fa-lg mr-2"}),t._v(" "),e("span",{staticClass:"btn btn-outline-secondary btn-sm px-2 py-0 disabled",attrs:{disabled:""}},[t._v(t._s(t.media.length))])]),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]):e("span",[e("a",{staticClass:"text-lighter text-decoration-none mr-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goBack()}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left fa-lg"})])]),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]),t._v(" "),2==t.page?e("div",[1==t.media.length?e("a",{staticClass:"text-center text-dark",attrs:{href:"#",title:"Crop & Resize",id:"cm-crop-btn"},on:{click:function(e){return e.preventDefault(),t.showCropPhotoCard.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-crop-alt fa-lg"})]):t._e(),t._v(" "),e("b-tooltip",{attrs:{target:"cm-crop-btn",triggers:"hover"}},[t._v("\n\t\t\t\t\t\t\tCrop & Resize\n\t\t\t\t\t\t")])],1):t._e(),t._v(" "),e("div",[t.pageLoading?e("span",[t._m(3)]):e("span",[!t.pageLoading&&t.page>1&&t.page<=2||1==t.page&&0!=t.ids.length||"cropPhoto"==t.page?e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.nextPage.apply(null,arguments)}}},[t._v("Next")]):t._e(),t._v(" "),t.pageLoading||3!=t.page?t._e():[t.isPosting?e("b-spinner",{attrs:{small:""}}):e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.compose()}}},[t._v("Post")])],t._v(" "),t.pageLoading||"addText"!=t.page?t._e():e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.composeTextPost()}}},[t._v("Post")]),t._v(" "),t.pageLoading||"video-2"!=t.page?t._e():e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.compose()}}},[t._v("Post")]),t._v(" "),t.pageLoading||"filteringMedia"!=t.page?t._e():e("span",{staticClass:"font-weight-bold text-decoration-none text-muted"},[t._v("Next")])],2)])]),t._v(" "),e("div",{staticClass:"card-body p-0 border-top"},["licensePicker"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}},[e("div",{staticClass:"list-group list-group-flush"},t._l(t.availableLicenses,(function(i,s){return e("div",{staticClass:"list-group-item cursor-pointer",class:{"text-primary":t.licenseId===i.id,"font-weight-bold":t.licenseId===i.id},on:{click:function(e){return t.toggleLicense(i)}}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(i.name)+"\n\t\t\t\t\t\t\t")])})),0)]):"textOptions"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}}):"addText"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}},[e("div",{staticClass:"mt-2"},[e("div",{staticClass:"media px-3"},[e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Body")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",staticStyle:{"font-size":"18px",resize:"none"},attrs:{rows:"7",placeholder:"What's happening?"},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}}),t._v(" "),e("div",{staticClass:"border-bottom"}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0 font-weight-bold"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))]),t._v(" "),e("p",{staticClass:"mb-0 mt-2"},[e("a",{staticClass:"btn btn-primary rounded-pill mr-2",staticStyle:{height:"37px"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showTextOptions()}}},[e("i",{staticClass:"fas fa-palette px-3 text-white"})]),t._v(" "),e("a",{staticClass:"btn rounded-pill mx-3 d-inline-flex align-items-center",class:[t.nsfw?"btn-danger":"btn-outline-lighter"],staticStyle:{height:"37px"},attrs:{href:"#",title:"Mark as sensitive/not safe for work"},on:{click:function(e){e.preventDefault(),t.nsfw=!t.nsfw}}},[e("i",{staticClass:"far fa-flag px-3"}),t._v(" "),e("span",{staticClass:"text-muted small font-weight-bold"})]),t._v(" "),e("a",{staticClass:"btn btn-outline-lighter rounded-pill d-inline-flex align-items-center",staticStyle:{height:"37px"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-eye mr-2"}),t._v(" "),e("span",{staticClass:"text-muted small font-weight-bold"},[t._v(t._s(t.visibilityTag))])])])])])])])]):1==t.page?e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center",staticStyle:{"min-height":"400px"}},[e("div",{staticClass:"text-center"},[0==t.media.length?e("div",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark"},[e("div",{staticClass:"card-body py-2",on:{click:function(e){return e.preventDefault(),t.addMedia.apply(null,arguments)}}},[e("div",{staticClass:"media"},[t._m(4),t._v(" "),e("div",{staticClass:"media-body text-left"},[t._m(5),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Share up to "+t._s(t.config.uploader.album_limit)+" photos or videos")]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.config.uploader.media_types.split(",").map((function(t){return t.split("/")[1]})).join(", ")))]),t._v(" allowed up to "),e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.filesize(t.config.uploader.max_photo_size)))])])])])])]):t._e(),t._v(" "),t._e(),t._v(" "),1==t.config.features.stories?e("a",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark",attrs:{href:"/i/stories/new"}},[t._m(7)]):t._e(),t._v(" "),t._e(),t._v(" "),t._m(9),t._v(" "),t._m(10)])]):"cropPhoto"==t.page?e("div",{staticClass:"w-100 h-100"},[t.ids.length>0?e("div",[e("vue-cropper",{ref:"cropper",attrs:{relativeZoom:t.cropper.zoom,aspectRatio:t.cropper.aspectRatio,viewMode:t.cropper.viewMode,zoomable:t.cropper.zoomable,rotatable:!0,src:t.media[t.carouselCursor].url}})],1):t._e()]):2==t.page?e("div",{staticClass:"w-100 h-100"},[1==t.media.length?e("div",[e("div",{staticStyle:{display:"flex","min-height":"420px","align-items":"center"},attrs:{slot:"img"},slot:"img"},[e("img",{class:"d-block img-fluid w-100 "+[t.media[t.carouselCursor].filter_class?t.media[t.carouselCursor].filter_class:""],attrs:{src:t.media[t.carouselCursor].url,alt:t.media[t.carouselCursor].description,title:t.media[t.carouselCursor].description}})]),t._v(" "),e("hr"),t._v(" "),t.ids.length>0&&"image"==t.media[t.carouselCursor].type?e("div",{staticClass:"align-items-center px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),e("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,(function(i,s){return e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("div",{staticClass:"rounded",class:i[1]},[e("img",{attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,i[1])}}})])]),t._v(" "),e("a",{class:[t.media[t.carouselCursor].filter_class==i[1]?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,i[1])}}},[t._v(t._s(i[0]))])])}))],2)]):t._e()]):t.media.length>1?e("div",{staticClass:"d-flex-inline px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center pb-3"},[e("li",{staticClass:"nav-item mx-md-4"},[t._v(" ")]),t._v(" "),t._l(t.media,(function(i,s){return e("li",{key:i.id+":"+t.carouselCursor,staticClass:"nav-item mx-md-4"},[e("div",{staticClass:"nav-link",staticStyle:{display:"block",width:"300px",height:"300px"},on:{click:function(e){t.carouselCursor=s}}},[e("div",{class:[i.filter_class?i.filter_class:""],staticStyle:{width:"100%",height:"100%",display:"block"}},[e("div",{class:"rounded "+[s==t.carouselCursor?" border border-primary shadow":""],style:"display:block;width:100%;height:100%;background-image: url("+i.url+");background-size:cover;"})])]),t._v(" "),s==t.carouselCursor?e("div",{staticClass:"text-center mb-0 small text-lighter font-weight-bold pt-2"},[e("button",{staticClass:"btn btn-link",on:{click:function(e){return t.mediaReorder("prev")}}},[e("i",{staticClass:"far fa-chevron-circle-left"})]),t._v(" "),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return e.preventDefault(),t.showCropPhotoCard.apply(null,arguments)}}},[t._v("Crop")]),t._v(" "),e("span",{staticClass:"cursor-pointer px-3",on:{click:function(e){return e.preventDefault(),t.showEditMediaCard()}}},[t._v("Edit")]),t._v(" "),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return t.deleteMedia()}}},[t._v("Delete")]),t._v(" "),e("button",{staticClass:"btn btn-link",on:{click:function(e){return t.mediaReorder("next")}}},[e("i",{staticClass:"far fa-chevron-circle-right"})])]):t._e()])})),t._v(" "),e("li",{staticClass:"nav-item mx-md-4"},[t._v(" ")])],2),t._v(" "),e("hr"),t._v(" "),t.ids.length>0&&"image"==t.media[t.carouselCursor].type?e("div",{staticClass:"align-items-center px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),e("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,(function(i,s){return e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{class:i[1],attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,i[1])}}})]),t._v(" "),e("a",{class:[t.media[t.carouselCursor].filter_class==i[1]?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,i[1])}}},[t._v(t._s(i[0]))])])}))],2)]):t._e()]):e("div",[e("p",{staticClass:"mb-0 p-5 text-center font-weight-bold"},[t._v("An error occured, please refresh the page.")])])]):3==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{class:[t.media[0].filter_class?"mr-2 "+t.media[0].filter_class:"mr-2"],attrs:{src:t.media[0].url,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a caption..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer d-flex justify-content-between",on:{click:function(e){return t.showMediaDescriptionsCard()}}},[e("span",[t._v("Alt Text")]),t._v(" "),e("span",[t.media&&t.media.filter((function(t){return t.alt})).length==t.media.length?e("i",{staticClass:"fas fa-check-circle fa-lg text-success"}):e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])]),t._v(" "),e("div",{staticClass:"border-bottom px-4 mb-0 py-2"},[e("div",{staticClass:"d-flex justify-content-between"},[t._m(11),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asnsfw"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var i=t.nsfw,s=e.target,a=!!s.checked;if(Array.isArray(i)){var o=t._i(i,null);s.checked?o<0&&(t.nsfw=i.concat([null])):o>-1&&(t.nsfw=i.slice(0,o).concat(i.slice(o+1)))}else t.nsfw=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asnsfw"}})])])]),t._v(" "),t.nsfw?e("div",[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.spoilerText,expression:"spoilerText"}],staticClass:"form-control mt-3",attrs:{placeholder:"Add an optional content warning or spoiler text",maxlength:"140"},domProps:{value:t.spoilerText},on:{input:function(e){e.target.composing||(t.spoilerText=e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.spoilerTextLength)+"/140")])]):t._e()]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showTagCard()}}},[t._v("Tag people")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showCollectionCard()}}},[t._m(12),t._v(" "),e("span",{staticClass:"float-right"},[t.collectionsSelected.length?e("span",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px 5px","text-transform":"uppercase"},attrs:{href:"#",disabled:""}},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.collectionsSelected.length)+"\n\t\t\t\t\t\t\t\t\t")]):t._e(),t._v(" "),t._m(13)])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLicenseCard()}}},[e("span",[t._v("Add license")]),t._v(" "),e("span",{staticClass:"float-right"},[t.licenseTitle?e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showLicenseCard()}}},[t._v(t._s(t.licenseTitle))]):t._e(),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showLicenseCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[t.place?e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",{staticClass:"text-lighter"},[t._v("Location:")]),t._v(" "+t._s(t.place.name)+", "+t._s(t.place.country)+"\n\t\t\t\t\t\t\t\t"),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-2",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showLocationCard()}}},[t._v("Edit")]),t._v(" "),e("a",{staticClass:"btn btn-outline-secondary btn-sm small",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.place=!1}}},[t._v("Remove")])])]):e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLocationCard()}}},[t._v("Add location")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",[t._v("Audience")]),t._v(" "),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[t._v(t._s(t.visibilityTag))]),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticStyle:{"min-height":"200px"}},[e("p",{staticClass:"px-4 mb-0 py-2 small font-weight-bold text-muted cursor-pointer",on:{click:function(e){return t.showAdvancedSettingsCard()}}},[t._v("Advanced settings")])])]):"tagPeople"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("autocomplete",{directives:[{name:"show",rawName:"v-show",value:t.taggedUsernames.length<10,expression:"taggedUsernames.length < 10"}],ref:"autocomplete",attrs:{search:t.tagSearch,placeholder:"@pixelfed","aria-label":"Search usernames","get-result-value":t.getTagResultValue},on:{submit:t.onTagSubmitLocation}}),t._v(" "),e("p",{directives:[{name:"show",rawName:"v-show",value:t.taggedUsernames.length<10,expression:"taggedUsernames.length < 10"}],staticClass:"font-weight-bold text-muted small"},[t._v("You can tag "+t._s(10-t.taggedUsernames.length)+" more "+t._s(9==t.taggedUsernames.length?"person":"people")+"!")]),t._v(" "),e("p",{staticClass:"font-weight-bold text-center mt-3"},[t._v("Tagged People")]),t._v(" "),e("div",{staticClass:"list-group"},[t._l(t.taggedUsernames,(function(i,s){return e("div",{staticClass:"list-group-item d-flex justify-content-between"},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-2 rounded-circle border",attrs:{src:i.avatar,width:"24px",height:"24px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(i.name))])])]),t._v(" "),e("div",{staticClass:"custom-control custom-switch"},[e("input",{directives:[{name:"model",rawName:"v-model",value:i.privacy,expression:"tag.privacy"}],staticClass:"custom-control-input disabled",attrs:{type:"checkbox",id:"cci-tagged-privacy-switch"+s,disabled:""},domProps:{checked:Array.isArray(i.privacy)?t._i(i.privacy,null)>-1:i.privacy},on:{change:function(e){var s=i.privacy,a=e.target,o=!!a.checked;if(Array.isArray(s)){var n=t._i(s,null);a.checked?n<0&&t.$set(i,"privacy",s.concat([null])):n>-1&&t.$set(i,"privacy",s.slice(0,n).concat(s.slice(n+1)))}else t.$set(i,"privacy",o)}}}),t._v(" "),e("label",{staticClass:"custom-control-label font-weight-bold text-lighter",attrs:{for:"cci-tagged-privacy-switch"+s}},[t._v(t._s(i.privacy?"Public":"Private"))]),t._v(" "),e("a",{staticClass:"ml-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.untagUsername(s)}}},[e("i",{staticClass:"fas fa-times text-muted"})])])])})),t._v(" "),0==t.taggedUsernames.length?e("div",{staticClass:"list-group-item p-3"},[e("p",{staticClass:"text-center mb-0 font-weight-bold text-lighter"},[t._v("Search usernames to tag.")])]):t._e()],2),t._v(" "),e("p",{staticClass:"font-weight-bold text-center small text-muted pt-3 mb-0"},[t._v("When you tag someone, they are sent a notification."),e("br"),t._v("For more information on tagging, "),e("a",{staticClass:"text-primary",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showTagHelpCard()}}},[t._v("click here")]),t._v(".")])],1):"tagPeopleHelp"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"mb-0 text-center py-3 px-2 lead"},[t._v("Tagging someone is like mentioning them, with the option to make it private between you.")]),t._v(" "),e("p",{staticClass:"mb-3 py-3 px-2 font-weight-lighter"},[t._v("\n\t\t\t\t\t\t\tYou can choose to tag someone in public or private mode. Public mode will allow others to see who you tagged in the post and private mode tagged users will not be shown to others.\n\t\t\t\t\t\t")])]):"addLocation"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"mb-0"},[t._v("Add Location")]),t._v(" "),e("autocomplete",{attrs:{search:t.locationSearch,placeholder:"Search locations ...","aria-label":"Search locations ...","get-result-value":t.getResultValue},on:{submit:t.onSubmitLocation}})],1):"advancedSettings"==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"list-group list-group-flush"},[e("div",{staticClass:"list-group-item d-flex justify-content-between"},[t._m(14),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.commentsDisabled,expression:"commentsDisabled"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asdisablecomments"},domProps:{checked:Array.isArray(t.commentsDisabled)?t._i(t.commentsDisabled,null)>-1:t.commentsDisabled},on:{change:function(e){var i=t.commentsDisabled,s=e.target,a=!!s.checked;if(Array.isArray(i)){var o=t._i(i,null);s.checked?o<0&&(t.commentsDisabled=i.concat([null])):o>-1&&(t.commentsDisabled=i.slice(0,o).concat(i.slice(o+1)))}else t.commentsDisabled=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asdisablecomments"}})])])]),t._v(" "),e("a",{staticClass:"list-group-item",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showMediaDescriptionsCard()}}},[t._m(15)])])]):"visibility"==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"list-group list-group-flush"},[t.profile.locked?t._e():e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"public"==t.visibility},on:{click:function(e){return t.toggleVisibility("public")}}},[t._v("\n\t\t\t\t\t\t\t\tPublic\n\t\t\t\t\t\t\t")]),t._v(" "),t.profile.locked?t._e():e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"unlisted"==t.visibility},on:{click:function(e){return t.toggleVisibility("unlisted")}}},[t._v("\n\t\t\t\t\t\t\t\tUnlisted\n\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"private"==t.visibility},on:{click:function(e){return t.toggleVisibility("private")}}},[t._v("\n\t\t\t\t\t\t\t\tFollowers Only\n\t\t\t\t\t\t\t")])])]):"altText"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[t._l(t.media,(function(i,s){return e("div",[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:i.preview_url,width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:i.alt,expression:"m.alt"}],staticClass:"form-control",attrs:{placeholder:"Add a media description here...",maxlength:t.maxAltTextLength,rows:"4"},domProps:{value:i.alt},on:{input:function(e){e.target.composing||t.$set(i,"alt",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(i.alt?i.alt.length:0)+"/"+t._s(t.maxAltTextLength))])])]),t._v(" "),e("hr")])})),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Cancel")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])],2):"addToCollection"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[t.collectionsLoaded&&t.collections.length?e("div",{staticClass:"list-group mb-3 collections-list-group"},[t._l(t.collections,(function(i,s){return e("div",{staticClass:"list-group-item cursor-pointer compose-action border",class:{active:t.collectionsSelected.includes(s)},on:{click:function(e){return t.toggleCollectionItem(s)}}},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:i.thumb,alt:"",width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("h5",{staticClass:"mt-0"},[t._v(t._s(i.title))]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[t._v(t._s(i.post_count)+" Posts - Created "+t._s(t.timeAgo(i.published_at))+" ago")])])])])})),t._v(" "),t.collectionsCanLoadMore?e("button",{staticClass:"btn btn-light btn-block font-weight-bold mt-3",on:{click:t.loadMoreCollections}},[t._v("\n\t\t\t\t\t\t\t\tLoad more\n\t\t\t\t\t\t\t")]):t._e()],2):t._e(),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.clearSelectedCollections()}}},[t._v("Clear")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])]):"schedulePost"==t.page||"mediaMetadata"==t.page||"addToStory"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"text-center lead text-muted mb-0 py-5"},[t._v("This feature is not available yet.")])]):"editMedia"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:t.media[t.carouselCursor].preview_url,width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small"},[t._v("Media Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.media[t.carouselCursor].alt,expression:"media[carouselCursor].alt"}],staticClass:"form-control",attrs:{placeholder:"Add a media description here...",maxlength:"140"},domProps:{value:t.media[t.carouselCursor].alt},on:{input:function(e){e.target.composing||t.$set(t.media[t.carouselCursor],"alt",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-muted mb-0 d-flex justify-content-between"},[e("span",[t._v("Describe your photo for people with visual impairments.")]),t._v(" "),e("span",[t._v(t._s(t.media[t.carouselCursor].alt?t.media[t.carouselCursor].alt.length:0)+"/140")])])]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small"},[t._v("License")]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.licenseId,expression:"licenseId"}],staticClass:"form-control",on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.licenseId=e.target.multiple?i:i[0]}}},t._l(t.availableLicenses,(function(i,s){return e("option",{domProps:{value:i.id,selected:i.id==t.licenseId}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t"+t._s(i.name)+"\n\t\t\t\t\t\t\t\t\t\t")])})),0)])])]),t._v(" "),e("hr"),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Cancel")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])]):"video-2"==t.page?e("div",{staticClass:"w-100 h-100"},[t.video.title.length?e("div",{staticClass:"border-bottom"},[e("div",{staticClass:"media p-3"},[e("img",{class:[t.media[0].filter_class?"mr-2 "+t.media[0].filter_class:"mr-2"],attrs:{src:t.media[0].url,width:"100px",height:"70px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"font-weight-bold mb-1"},[t._v(t._s(t.video.title?t.video.title.slice(0,70):"Untitled"))]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[t._v(t._s(t.video.description?t.video.description.slice(0,90):"No description"))])])])]):t._e(),t._v(" "),e("div",{staticClass:"border-bottom d-flex justify-content-between px-4 mb-0 py-2"},[t._m(16),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asnsfw"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var i=t.nsfw,s=e.target,a=!!s.checked;if(Array.isArray(i)){var o=t._i(i,null);s.checked?o<0&&(t.nsfw=i.concat([null])):o>-1&&(t.nsfw=i.slice(0,o).concat(i.slice(o+1)))}else t.nsfw=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asnsfw"}})])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLicenseCard()}}},[t._v("Add license")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",[t._v("Audience")]),t._v(" "),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[t._v(t._s(t.visibilityTag))]),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("div",{staticClass:"form-group"},[e("p",{staticClass:"small font-weight-bold text-muted mb-0"},[t._v("Title")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.video.title,expression:"video.title"}],staticClass:"form-control",attrs:{placeholder:"Add a good title"},domProps:{value:t.video.title},on:{input:function(e){e.target.composing||t.$set(t.video,"title",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text mb-0 small text-muted"},[t._v(t._s(t.video.title.length)+"/70")])]),t._v(" "),e("div",{staticClass:"form-group mb-0"},[e("p",{staticClass:"small font-weight-bold text-muted mb-0"},[t._v("Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.video.description,expression:"video.description"}],staticClass:"form-control",attrs:{placeholder:"Add an optional description",maxlength:"5000",rows:"5"},domProps:{value:t.video.description},on:{input:function(e){e.target.composing||t.$set(t.video,"description",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text mb-0 small text-muted"},[t._v(t._s(t.video.description.length)+"/5000")])])])]):"filteringMedia"==t.page?e("div",{staticClass:"w-100 h-100 py-5"},[e("div",{staticClass:"d-flex flex-column align-items-center justify-content-center py-5"},[e("b-spinner",{attrs:{small:""}}),t._v(" "),e("p",{staticClass:"font-weight-bold mt-3"},[t._v("Applying filters...")])],1)]):t._e()]),t._v(" "),"cropPhoto"==t.page?e("div",{staticClass:"card-footer bg-white d-flex justify-content-between"},[e("div",[e("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"},on:{click:t.rotate}},[e("i",{staticClass:"fas fa-redo"})])]),t._v(" "),e("div",[e("div",{staticClass:"d-inline-block button-group"},[e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==16/9?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(16/9)}}},[t._v("16:9")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==4/3?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(4/3)}}},[t._v("4:3")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[1.5==t.cropper.aspectRatio?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(1.5)}}},[t._v("3:2")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[1==t.cropper.aspectRatio?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(1)}}},[t._v("1:1")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==2/3?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(2/3)}}},[t._v("2:3")])])])]):t._e()])])])])},a=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[e("span",{staticClass:"pr-3"},[e("i",{staticClass:"fas fa-cog fa-lg text-muted"})]),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tCamera Roll\n\t\t\t\t\t")]),t._v(" "),e("span",{staticClass:"text-primary font-weight-bold"},[t._v("Upload")])])},function(){var t=this._self._c;return t("span",{staticClass:"pr-3"},[t("i",{staticClass:"fas fa-info-circle fa-lg text-primary"})])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%","background-color":"#008DF5"}},[t("i",{staticClass:"fal fa-bolt text-white fa-lg"})])},function(){var t=this._self._c;return t("p",{staticClass:"mb-0"},[t("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[this._v("New Post")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"2px solid #008DF5"}},[e("i",{staticClass:"far fa-edit text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Text Post")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Share a text only post")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"1px solid #008DF5"}},[e("i",{staticClass:"fas fa-history text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Story")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Add to your story")])])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"2px solid #008DF5"}},[e("i",{staticClass:"fas fa-poll-h text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Poll")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Create a poll")])])])])},function(){var t=this,e=t._self._c;return e("a",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark",attrs:{href:"/i/collections/create"}},[e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"1px solid #008DF5"}},[e("i",{staticClass:"fal fa-images text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Collection")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("New collection of posts")])])])])])},function(){var t=this._self._c;return t("p",{staticClass:"py-3"},[t("a",{staticClass:"font-weight-bold",attrs:{href:"/site/help"}},[this._v("Help")])])},function(){var t=this._self._c;return t("div",[t("div",{staticClass:"text-dark"},[this._v("Sensitive/NSFW Media")])])},function(){var t=this,e=t._self._c;return e("span",[t._v("Add to Collection "),e("span",{staticClass:"ml-2 badge badge-primary"},[t._v("NEW")])])},function(){var t=this._self._c;return t("span",{staticClass:"text-decoration-none"},[t("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])},function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"text-dark"},[t._v("Turn off commenting")]),t._v(" "),e("p",{staticClass:"text-muted small mb-0"},[t._v("Disables comments for this post, you can change this later.")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"d-flex justify-content-between align-items-center"},[e("div",[e("div",{staticClass:"text-dark"},[t._v("Media Descriptions")]),t._v(" "),e("p",{staticClass:"text-muted small mb-0"},[t._v("Describe your photos for people with visual impairments.")])]),t._v(" "),e("div",[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])},function(){var t=this._self._c;return t("div",[t("div",{staticClass:"text-dark"},[this._v("Contains NSFW Media")])])}]},43532:(t,e,i)=>{Vue.component("compose-modal",i(19324).default)},67264:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>o});var s=i(76798),a=i.n(s)()((function(t){return t[1]}));a.push([t.id,".compose-modal-component .media-drawer-filters{flex-wrap:unset;overflow-x:auto}.compose-modal-component .media-drawer-filters .nav-link{min-width:100px;padding-bottom:1rem;padding-top:1rem}.compose-modal-component .media-drawer-filters .active{color:#fff;font-weight:700}@media (hover:none) and (pointer:coarse){.compose-modal-component .media-drawer-filters::-webkit-scrollbar{display:none}}.compose-modal-component .no-focus{border-color:none;box-shadow:none;outline:0}.compose-modal-component a.list-group-item{text-decoration:none}.compose-modal-component a.list-group-item:hover{background-color:#f8f9fa;text-decoration:none}.compose-modal-component .compose-action:hover{background-color:#f8f9fa;cursor:pointer}.compose-modal-component .collections-list-group{max-height:500px;overflow-y:auto}.compose-modal-component .collections-list-group .list-group-item.active{background-color:#dbeafe!important;border-color:#60a5fa!important;color:#212529}",""]);const o=a},87877:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>l});var s=i(85072),a=i.n(s),o=i(67264),n={insert:"head",singleton:!1};a()(o.default,n);const l=o.default.locals||{}},19324:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>n});var s=i(81274),a=i(50427),o={};for(const t in a)"default"!==t&&(o[t]=()=>a[t]);i.d(e,o);i(21710);const n=(0,i(14486).default)(a.default,s.render,s.staticRenderFns,!1,null,null,null).exports},50427:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>o});var s=i(28320),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);i.d(e,a);const o=s.default},81274:(t,e,i)=>{"use strict";i.r(e);var s=i(1131),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);i.d(e,a)},21710:(t,e,i)=>{"use strict";i.r(e);var s=i(87877),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);i.d(e,a)}},t=>{t.O(0,[3660],(()=>{return e=43532,t(t.s=e);var e}));t.O()}]); \ No newline at end of file +(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[5666],{28320:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>c});var s=i(91584),a=(i(77333),i(2e4)),o=(i(87980),i(79288)),n=i(74692);function l(t){return function(t){if(Array.isArray(t))return r(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)return;if("string"==typeof t)return r(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(t,e)}(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i10&&(t.licenseTitle=t.availableLicenses.filter((function(e){return e.id==t.licenseId})).map((function(t){return t.title}))[0]),t.fetchProfile()}))},mounted:function(){this.mediaWatcher()},methods:{timeAgo:function(t){return App.util.format.timeAgo(t)},formatBytes:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+t)return"0 Bytes";var i=e<0?0:e,s=Math.floor(Math.log(t)/Math.log(1024));return"".concat(parseFloat((t/Math.pow(1024,s)).toFixed(i))," ").concat(["Bytes","KB","MB","GB","TB"][s])},defineErrorMessage:function(t){if(t.response)t.response.data.message&&t.response.data.message;else t.message;return swal("Oops, something went wrong!",msg,"error")},fetchProfile:function(){var t=this,e={public:"Public",private:"Followers Only",unlisted:"Unlisted"};if(window._sharedData.curUser.id){if(this.profile=window._sharedData.curUser,this.composeSettings&&this.composeSettings.hasOwnProperty("default_scope")&&this.composeSettings.default_scope){var i=this.composeSettings.default_scope;this.visibility=i,this.visibilityTag=e[i]}1==this.profile.locked&&(this.visibility="private",this.visibilityTag="Followers Only")}else axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(i){if(window._sharedData.currentUser=i.data,t.profile=i.data,t.composeSettings&&t.composeSettings.hasOwnProperty("default_scope")&&t.composeSettings.default_scope){var s=t.composeSettings.default_scope;t.visibility=s,t.visibilityTag=e[s]}1==t.profile.locked&&(t.visibility="private",t.visibilityTag="Followers Only")})).catch((function(t){}))},addMedia:function(t){var e=n(t.target);e.attr("disabled",""),n('.file-input[name="media"]').trigger("click"),e.blur(),e.removeAttr("disabled")},addText:function(t){this.pageTitle="New Text Post",this.page="addText",this.textMode=!0,this.mode="text"},mediaWatcher:function(){var t=this;n(document).on("change","#pf-dz",(function(e){t.mediaUpload()}))},mediaUpload:function(){var t=this;t.uploading=!0;var e=document.querySelector("#pf-dz");e.files.length||(t.uploading=!1),Array.prototype.forEach.call(e.files,(function(e,i){if(t.media&&t.media.length+i>=t.config.uploader.album_limit)return swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error"),t.uploading=!1,void(t.page=2);var s=e.type,a=t.config.uploader.media_types.split(",");if(-1==n.inArray(s,a))return swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.config.uploader.media_types+" only.","error"),t.uploading=!1,void(t.page=2);var o=new FormData;o.append("file",e);var l={onUploadProgress:function(e){var i=Math.round(100*e.loaded/e.total);t.uploadProgress=i}};axios.post("/api/compose/v0/media/upload",o,l).then((function(e){t.uploadProgress=100,t.ids.push(e.data.id),t.media.push(e.data),t.uploading=!1,setTimeout((function(){t.page=3}),300)})).catch((function(i){switch(i.response.status){case 403:t.uploading=!1,e.value=null,swal("Account size limit reached","Contact your admin for assistance.","error"),t.page=2;break;case 413:t.uploading=!1,e.value=null,swal("File is too large","The file you uploaded has the size of "+t.formatBytes(e.size)+". Unfortunately, only images up to "+t.formatBytes(1024*t.config.uploader.max_photo_size)+" are supported.\nPlease resize the file and try again.","error"),t.page=2;break;case 451:t.uploading=!1,e.value=null,swal("Banned Content","This content has been banned and cannot be uploaded.","error"),t.page=2;break;case 429:t.uploading=!1,e.value=null,swal("Limit Reached","You can upload up to 250 photos or videos per day and you've reached that limit. Please try again later.","error"),t.page=2;break;case 500:t.uploading=!1,e.value=null,swal("Error",i.response.data.message,"error"),t.page=2;break;default:t.uploading=!1,e.value=null,swal("Oops, something went wrong!","An unexpected error occurred.","error"),t.page=2}})),e.value=null,t.uploadProgress=0}))},toggleFilter:function(t,e){this.media[this.carouselCursor].filter_class=e,this.currentFilter=e},deleteMedia:function(){var t=this;if(0!=window.confirm("Are you sure you want to delete this media?")){var e=this.media[this.carouselCursor].id;axios.delete("/api/compose/v0/media/delete",{params:{id:e}}).then((function(e){t.ids.splice(t.carouselCursor,1),t.media.splice(t.carouselCursor,1),0==t.media.length?(t.ids=[],t.media=[],t.carouselCursor=0):t.carouselCursor=0})).catch((function(t){swal("Whoops!","An error occured when attempting to delete this, please try again","error")}))}},mediaReorder:function(t){var e=this,i=this.media,s=this.carouselCursor,a=i[s],o=[],n=0;if("prev"==t)if(0==s){for(var l=n;l=0&&e=0&&ithis.config.uploader.max_caption_length)swal("Error","Caption is too long","error");else switch(e){case"publish":if(this.isPosting=!0,this.media.filter((function(t){return t.filter_class&&!t.hasOwnProperty("is_filtered")})).length)return void this.applyFilterToMedia();if(!0===this.composeSettings.media_descriptions)if(this.media.filter((function(t){return!t.hasOwnProperty("alt")||t.alt.length<2})).length)return swal("Missing media descriptions","You have enabled mandatory media descriptions. Please add media descriptions under Advanced settings to proceed. For more information, please see the media settings page.","warning"),void(this.isPosting=!1);if(0==this.media.length)return void swal("Whoops!","You need to add media before you can save this!","warning");"Add optional caption..."==this.composeText&&(this.composeText="");var i={media:this.media,caption:this.composeText,visibility:this.visibility,cw:this.nsfw,comments_disabled:this.commentsDisabled,place:this.place,tagged:this.taggedUsernames,optimize_media:this.optimizeMedia,license:this.licenseId,video:this.video,spoiler_text:this.spoilerText};return this.collectionsSelected.length&&(i.collections=this.collectionsSelected.map((function(e){return t.collections[e].id}))),void axios.post("/api/compose/v0/publish",i).then((function(t){"/i/web/compose"===location.pathname&&t.data&&t.data.length?location.href="/i/web/post/"+t.data.split("/").slice(-1)[0]:location.href=t.data})).catch((function(e){if(400===e.response.status)"Must contain a single photo or video or multiple photos."==e.response.data.error?swal("Wrong types of mixed media","The album must contain a single photo or video or multiple photos.","error"):t.defineErrorMessage(e);else t.defineErrorMessage(e)}));case"delete":return this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void n("#composeModal").modal("hide")}},composeTextPost:function(){var t=this.composeState;if(this.composeText.length>this.config.uploader.max_caption_length)swal("Error","Caption is too long","error");else switch(t){case"publish":var e={caption:this.composeText,visibility:this.visibility,cw:this.nsfw,comments_disabled:this.commentsDisabled,place:this.place,tagged:this.taggedUsernames};return void axios.post("/api/compose/v0/publish/text",e).then((function(t){var e=t.data;window.location.href=e})).catch((function(t){var e=t.response.data.message?t.response.data.message:"An unexpected error occured.";swal("Oops, something went wrong!",e,"error")}));case"delete":return this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void n("#composeModal").modal("hide")}},closeModal:function(){n("#composeModal").modal("hide"),this.$emit("close")},goBack:function(){switch(this.pageTitle="",this.mode){case"photo":switch(this.page){case"filteringMedia":case"cropPhoto":case"editMedia":this.page=2;break;case"addText":case"video-2":this.page=1;break;case"textOptions":this.page="addText";break;case"tagPeopleHelp":this.showTagCard();break;case"licensePicker":this.page=3;break;default:-1!=this.namedPages.indexOf(this.page)?this.page=3:this.page--}break;case"video":if("filteringMedia"===this.page)this.page=2;else this.page="video-2";break;default:switch(this.page){case"addText":case"video-2":this.page=1;break;case"filteringMedia":case"cropPhoto":case"editMedia":this.page=2;break;case"textOptions":this.page="addText";break;case"tagPeopleHelp":this.showTagCard();break;case"licensePicker":this.page=3;break;default:-1!=this.namedPages.indexOf(this.page)?this.page="text"==this.mode?"addText":3:"text"==this.mode||this.page--}}},nextPage:function(){switch(this.pageTitle="",this.page){case 1:this.page=2;break;case"filteringMedia":break;case"cropPhoto":this.pageLoading=!0;var t=this;this.$refs.cropper.getCroppedCanvas({maxWidth:4096,maxHeight:4096,fillColor:"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((function(e){t.mediaCropped=!0;var i=new FormData;i.append("file",e),i.append("id",t.ids[t.carouselCursor]);axios.post("/api/compose/v0/media/update",i).then((function(e){t.media[t.carouselCursor].url=e.data.url,t.pageLoading=!1,t.page=2})).catch((function(t){}))}));break;case 2:case 3:this.page++}},rotate:function(){this.$refs.cropper.rotate(90)},changeAspect:function(t){this.cropper.aspectRatio=t,this.$refs.cropper.setAspectRatio(t)},showTagCard:function(){this.pageTitle="Tag People",this.page="tagPeople"},showTagHelpCard:function(){this.pageTitle="About Tag People",this.page="tagPeopleHelp"},showLocationCard:function(){this.pageTitle="Add Location",this.page="addLocation"},showAdvancedSettingsCard:function(){this.pageTitle="Advanced Settings",this.page="advancedSettings"},locationSearch:function(t){if(t.length<1)return[];return axios.get("/api/compose/v0/search/location",{params:{q:t}}).then((function(t){return t.data}))},getResultValue:function(t){return t.name+", "+t.country},onSubmitLocation:function(t){switch(this.place=t,this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},showVisibilityCard:function(){this.pageTitle="Post Visibility",this.page="visibility"},showAddToStoryCard:function(){this.pageTitle="Add to Story",this.page="addToStory"},showCropPhotoCard:function(){this.pageTitle="Edit Photo",this.page="cropPhoto"},toggleVisibility:function(t){switch(this.visibility=t,this.visibilityTag={public:"Public",private:"Followers Only",unlisted:"Unlisted"}[t],this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},showMediaDescriptionsCard:function(){this.pageTitle="Media Descriptions",this.page="altText"},showAddToCollectionsCard:function(){this.pageTitle="Add to Collection",this.page="addToCollection"},showSchedulePostCard:function(){this.pageTitle="Schedule Post",this.page="schedulePost"},showEditMediaCard:function(){this.pageTitle="Edit Media",this.page="editMedia"},fetchCameraRollDrafts:function(){var t=this;axios.get("/api/pixelfed/local/drafts").then((function(e){t.cameraRollMedia=e.data}))},applyFilterToMedia:function(){var t=this,e=navigator.userAgent.toLowerCase();if(-1==e.indexOf("firefox")&&-1==e.indexOf("chrome"))return this.isPosting=!1,swal("Oops!","Your browser does not support the filter feature.","error"),void(this.page=3);var i=this.media.filter((function(t){return t.filter_class})).length;i?(this.page="filteringMedia",this.filteringRemainingCount=i,this.$nextTick((function(){t.isFilteringMedia=!0,t.media.forEach((function(e,i){return t.applyFilterToMediaSave(e,i)}))}))):this.page=3},applyFilterToMediaSave:function(t,e){if(t.filter_class){var i=this,s=null,a=document.createElement("canvas"),o=a.getContext("2d"),n=document.createElement("img");n.src=t.url,n.addEventListener("load",(function(l){a.width=n.width,a.height=n.height,o.filter=App.util.filterCss[t.filter_class],o.drawImage(n,0,0,n.width,n.height),o.save(),a.toBlob((function(a){(s=new FormData).append("file",a),s.append("id",t.id),axios.post("/api/compose/v0/media/update",s).then((function(t){i.media[e].is_filtered=!0,i.updateFilteringMedia()})).catch((function(t){}))}))}),t.mime,.9),o.clearRect(0,0,n.width,n.height)}},updateFilteringMedia:function(){var t=this;this.filteringRemainingCount--,this.filteringMediaTimeout=setTimeout((function(){return t.filteringMediaTimeoutJob()}),500)},filteringMediaTimeoutJob:function(){var t=this;0===this.filteringRemainingCount?(this.isFilteringMedia=!1,clearTimeout(this.filteringMediaTimeout),setTimeout((function(){return t.compose()}),500)):(clearTimeout(this.filteringMediaTimeout),this.filteringMediaTimeout=setTimeout((function(){return t.filteringMediaTimeoutJob()}),1e3))},tagSearch:function(t){if(t.length<1)return[];var e=this;return axios.get("/api/compose/v0/search/tag",{params:{q:t}}).then((function(t){if(t.data.length)return t.data.filter((function(t){return 0==e.taggedUsernames.filter((function(e){return e.id==t.id})).length}))}))},getTagResultValue:function(t){return"@"+t.name},onTagSubmitLocation:function(t){this.taggedUsernames.filter((function(e){return e.id==t.id})).length||(this.taggedUsernames.push(t),this.$refs.autocomplete.value="")},untagUsername:function(t){this.taggedUsernames.splice(t,1)},showTextOptions:function(){this.page="textOptions",this.pageTitle="Text Post Options"},showLicenseCard:function(){this.pageTitle="Select a License",this.page="licensePicker"},toggleLicense:function(t){var e=this;switch(this.licenseId=t.id,this.licenseId>10?this.licenseTitle=this.availableLicenses.filter((function(t){return t.id==e.licenseId})).map((function(t){return t.title}))[0]:this.licenseTitle=null,this.mode){case"photo":this.pageTitle="",this.page=3;break;case"video":this.pageTitle="Edit Video Details",this.page="video-2";break;case"text":this.pageTitle="New Text Post",this.page="addText"}},newPoll:function(){this.page="poll"},savePollOption:function(){-1==this.pollOptions.indexOf(this.pollOptionModel)?(this.pollOptions.push(this.pollOptionModel),this.pollOptionModel=null):this.pollOptionModel=null},deletePollOption:function(t){this.pollOptions.splice(t,1)},postNewPoll:function(){var t=this;this.postingPoll=!0,axios.post("/api/compose/v0/poll",{caption:this.composeText,cw:!1,visibility:this.visibility,comments_disabled:!1,expiry:this.pollExpiry,pollOptions:this.pollOptions}).then((function(e){if(!e.data.hasOwnProperty("url"))return swal("Oops!","An error occured while attempting to create this poll. Please refresh the page and try again.","error"),void(t.postingPoll=!1);window.location.href=e.data.url})).catch((function(e){if(e.response.data.hasOwnProperty("error")&&"Duplicate detected."==e.response.data.error)return t.postingPoll=!1,void swal("Oops!","The poll you are trying to create is similar to an existing poll you created. Please make the poll question (caption) unique.","error");t.postingPoll=!1,swal("Oops!","An error occured while attempting to create this poll. Please refresh the page and try again.","error")}))},filesize:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return filesize(1024*t,{round:0})})),showCollectionCard:function(){this.pageTitle="Add to Collection(s)",this.page="addToCollection",this.collectionsLoaded||this.fetchCollections()},fetchCollections:function(){var t=this;axios.get("/api/local/profile/collections/".concat(this.profile.id)).then((function(e){t.collections=e.data,t.collectionsLoaded=!0,t.collectionsCanLoadMore=9==e.data.length,t.collectionsPage++}))},toggleCollectionItem:function(t){if(this.collectionsSelected.includes(t))this.collectionsSelected=this.collectionsSelected.filter((function(e){return e!=t}));else{if(7==this.collectionsSelected.length)return void swal("Oops!","You can only share to 5 collections.","info");this.collectionsSelected.push(t)}},clearSelectedCollections:function(){this.collectionsSelected=[],this.pageTitle="Compose",this.page=3},loadMoreCollections:function(){var t=this;this.collectionsCanLoadMore=!1,axios.get("/api/local/profile/collections/".concat(this.profile.id),{params:{page:this.collectionsPage}}).then((function(e){var i,s=t.collections.map((function(t){return t.id})),a=e.data.filter((function(t){return!s.includes(t.id)}));a&&a.length&&((i=t.collections).push.apply(i,l(a)),t.collectionsPage++,t.collectionsCanLoadMore=!0)}))}}}},2383:(t,e,i)=>{"use strict";i.r(e),i.d(e,{render:()=>s,staticRenderFns:()=>a});var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"compose-modal-component"},[e("input",{staticClass:"w-100 h-100 d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",multiple:"",accept:t.config.uploader.media_types}}),t._v(" "),e("canvas",{staticClass:"d-none",attrs:{id:"pr_canvas"}}),t._v(" "),e("img",{staticClass:"d-none",attrs:{id:"pr_img"}}),t._v(" "),e("div",{staticClass:"timeline"},[t.uploading?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100 bg-light py-3",staticStyle:{"border-bottom":"1px solid #f1f1f1"}},[e("div",{staticClass:"p-5 mt-2"},[e("b-progress",{attrs:{value:t.uploadProgress,max:100,striped:"",animated:!0}}),t._v(" "),e("p",{staticClass:"text-center mb-0 font-weight-bold"},[t._v("Uploading ... ("+t._s(t.uploadProgress)+"%)")])],1)])]):"cameraRoll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[t._m(0),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[t.cameraRollMedia.length>0?e("div",{staticClass:"row p-0 m-0"},t._l(t.cameraRollMedia,(function(t,i){return e("div",{class:[0==i?"col-12 p-0":"col-3 p-0"]},[e("div",{staticClass:"card info-overlay p-0 rounded-0 shadow-none border"},[e("div",{staticClass:"square"},[e("img",{staticClass:"square-content",attrs:{src:t.preview_url}})])])])})),0):e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[e("span",{staticClass:"w-100 h-100"},[e("button",{staticClass:"btn btn-primary",attrs:{type:"button"}},[t._v("Upload")]),t._v(" "),e("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(e){return t.fetchCameraRollDrafts()}}},[t._v("Load Camera Roll")])])])])])]):"poll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[t._m(1),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tNew Poll\n\t\t\t\t\t")]),t._v(" "),t.postingPoll?e("span",[t._m(2)]):!t.postingPoll&&t.pollOptions.length>1&&t.composeText.length?e("button",{staticClass:"btn btn-primary btn-sm font-weight-bold",on:{click:t.postNewPoll}},[e("span",[t._v("Create Poll")])]):e("span",{staticClass:"font-weight-bold text-lighter"},[t._v("\n\t\t\t\t\t\tCreate Poll\n\t\t\t\t\t")])]),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{staticClass:"rounded-circle",attrs:{src:t.profile.avatar,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a poll question..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\tPoll Options\n\t\t\t\t\t\t")]),t._v(" "),t.pollOptions.length<4?e("div",{staticClass:"form-group mb-4"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.pollOptionModel,expression:"pollOptionModel"}],staticClass:"form-control rounded-pill",attrs:{type:"text",placeholder:"Add a poll option, press enter to save"},domProps:{value:t.pollOptionModel},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.savePollOption.apply(null,arguments)},input:function(e){e.target.composing||(t.pollOptionModel=e.target.value)}}})]):t._e(),t._v(" "),t._l(t.pollOptions,(function(i,s){return e("div",{staticClass:"form-group mb-4 d-flex align-items-center",staticStyle:{"max-width":"400px",position:"relative"}},[e("span",{staticClass:"font-weight-bold mr-2",staticStyle:{position:"absolute",left:"10px"}},[t._v(t._s(s+1)+".")]),t._v(" "),t.pollOptions[s].length<50?e("input",{directives:[{name:"model",rawName:"v-model",value:t.pollOptions[s],expression:"pollOptions[index]"}],staticClass:"form-control rounded-pill",staticStyle:{"padding-left":"30px","padding-right":"90px"},attrs:{type:"text",placeholder:"Add a poll option, press enter to save"},domProps:{value:t.pollOptions[s]},on:{input:function(e){e.target.composing||t.$set(t.pollOptions,s,e.target.value)}}}):e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.pollOptions[s],expression:"pollOptions[index]"}],staticClass:"form-control",staticStyle:{"padding-left":"30px","padding-right":"90px"},attrs:{placeholder:"Add a poll option, press enter to save",rows:"3"},domProps:{value:t.pollOptions[s]},on:{input:function(e){e.target.composing||t.$set(t.pollOptions,s,e.target.value)}}}),t._v(" "),e("button",{staticClass:"btn btn-danger btn-sm rounded-pill font-weight-bold",staticStyle:{position:"absolute",right:"5px"},on:{click:function(e){return t.deletePollOption(s)}}},[e("i",{staticClass:"fas fa-trash"}),t._v(" Delete\n\t\t\t\t\t\t\t")])])})),t._v(" "),e("hr"),t._v(" "),e("div",{staticClass:"d-flex justify-content-between"},[e("div",[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\t\t\tPoll Expiry\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"form-group"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.pollExpiry,expression:"pollExpiry"}],staticClass:"form-control rounded-pill",staticStyle:{width:"200px"},on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.pollExpiry=e.target.multiple?i:i[0]}}},[e("option",{attrs:{value:"60"}},[t._v("1 hour")]),t._v(" "),e("option",{attrs:{value:"360"}},[t._v("6 hours")]),t._v(" "),e("option",{attrs:{value:"1440",selected:""}},[t._v("24 hours")]),t._v(" "),e("option",{attrs:{value:"10080"}},[t._v("7 days")])])])]),t._v(" "),e("div",[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\t\t\tPoll Visibility\n\t\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"form-group"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.visibility,expression:"visibility"}],staticClass:"form-control rounded-pill",staticStyle:{"max-width":"200px"},on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.visibility=e.target.multiple?i:i[0]}}},[e("option",{attrs:{value:"public"}},[t._v("Public")]),t._v(" "),e("option",{attrs:{value:"private"}},[t._v("Followers Only")])])])])])],2)])])]):e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[e("div",[1==t.page?e("a",{staticClass:"font-weight-bold text-decoration-none text-muted",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.closeModal()}}},[e("i",{staticClass:"fas fa-times fa-lg"}),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]):2==t.page?e("span",[t.config.uploader.album_limit>t.media.length?e("button",{staticClass:"btn btn-outline-primary btn-sm font-weight-bold",attrs:{id:"cm-add-media-btn"},on:{click:function(e){return e.preventDefault(),t.addMedia.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-plus"})]):e("button",{staticClass:"btn btn-outline-secondary btn-sm font-weight-bold",attrs:{disabled:""}},[e("i",{staticClass:"fas fa-plus"})]),t._v(" "),e("b-tooltip",{attrs:{target:"cm-add-media-btn",triggers:"hover"}},[t._v("\n\t\t\t\t\t\t\t\tUpload another photo or video\n\t\t\t\t\t\t\t")])],1):3==t.page?e("span",[e("a",{staticClass:"text-lighter text-decoration-none mr-3 d-flex align-items-center",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goBack()}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left fa-lg mr-2"}),t._v(" "),e("span",{staticClass:"btn btn-outline-secondary btn-sm px-2 py-0 disabled",attrs:{disabled:""}},[t._v(t._s(t.media.length))])]),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]):e("span",[e("a",{staticClass:"text-lighter text-decoration-none mr-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goBack()}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left fa-lg"})])]),t._v(" "),e("span",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(t.pageTitle))])]),t._v(" "),2==t.page?e("div",[1==t.media.length?e("a",{staticClass:"text-center text-dark",attrs:{href:"#",title:"Crop & Resize",id:"cm-crop-btn"},on:{click:function(e){return e.preventDefault(),t.showCropPhotoCard.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-crop-alt fa-lg"})]):t._e(),t._v(" "),e("b-tooltip",{attrs:{target:"cm-crop-btn",triggers:"hover"}},[t._v("\n\t\t\t\t\t\t\tCrop & Resize\n\t\t\t\t\t\t")])],1):t._e(),t._v(" "),e("div",[t.pageLoading?e("span",[t._m(3)]):e("span",[!t.pageLoading&&t.page>1&&t.page<=2||1==t.page&&0!=t.ids.length||"cropPhoto"==t.page?e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.nextPage.apply(null,arguments)}}},[t._v("Next")]):t._e(),t._v(" "),t.pageLoading||3!=t.page?t._e():[t.isPosting?e("b-spinner",{attrs:{small:""}}):e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.compose()}}},[t._v("Post")])],t._v(" "),t.pageLoading||"addText"!=t.page?t._e():e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.composeTextPost()}}},[t._v("Post")]),t._v(" "),t.pageLoading||"video-2"!=t.page?t._e():e("a",{staticClass:"font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.compose()}}},[t._v("Post")]),t._v(" "),t.pageLoading||"filteringMedia"!=t.page?t._e():e("span",{staticClass:"font-weight-bold text-decoration-none text-muted"},[t._v("Next")])],2)])]),t._v(" "),e("div",{staticClass:"card-body p-0 border-top"},["licensePicker"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}},[e("div",{staticClass:"list-group list-group-flush"},t._l(t.availableLicenses,(function(i,s){return e("div",{staticClass:"list-group-item cursor-pointer",class:{"text-primary":t.licenseId===i.id,"font-weight-bold":t.licenseId===i.id},on:{click:function(e){return t.toggleLicense(i)}}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(i.name)+"\n\t\t\t\t\t\t\t")])})),0)]):"textOptions"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}}):"addText"==t.page?e("div",{staticClass:"w-100 h-100",staticStyle:{"min-height":"280px"}},[e("div",{staticClass:"mt-2"},[e("div",{staticClass:"media px-3"},[e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Body")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",staticStyle:{"font-size":"18px",resize:"none"},attrs:{rows:"7",placeholder:"What's happening?"},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}}),t._v(" "),e("div",{staticClass:"border-bottom"}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0 font-weight-bold"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))]),t._v(" "),e("p",{staticClass:"mb-0 mt-2"},[e("a",{staticClass:"btn btn-primary rounded-pill mr-2",staticStyle:{height:"37px"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showTextOptions()}}},[e("i",{staticClass:"fas fa-palette px-3 text-white"})]),t._v(" "),e("a",{staticClass:"btn rounded-pill mx-3 d-inline-flex align-items-center",class:[t.nsfw?"btn-danger":"btn-outline-lighter"],staticStyle:{height:"37px"},attrs:{href:"#",title:"Mark as sensitive/not safe for work"},on:{click:function(e){e.preventDefault(),t.nsfw=!t.nsfw}}},[e("i",{staticClass:"far fa-flag px-3"}),t._v(" "),e("span",{staticClass:"text-muted small font-weight-bold"})]),t._v(" "),e("a",{staticClass:"btn btn-outline-lighter rounded-pill d-inline-flex align-items-center",staticStyle:{height:"37px"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-eye mr-2"}),t._v(" "),e("span",{staticClass:"text-muted small font-weight-bold"},[t._v(t._s(t.visibilityTag))])])])])])])])]):1==t.page?e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center",staticStyle:{"min-height":"400px"}},[e("div",{staticClass:"text-center"},[0==t.media.length?e("div",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark"},[e("div",{staticClass:"card-body py-2",on:{click:function(e){return e.preventDefault(),t.addMedia.apply(null,arguments)}}},[e("div",{staticClass:"media"},[t._m(4),t._v(" "),e("div",{staticClass:"media-body text-left"},[t._m(5),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Share up to "+t._s(t.config.uploader.album_limit)+" photos or videos")]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.config.uploader.media_types.split(",").map((function(t){return t.split("/")[1]})).join(", ")))]),t._v(" allowed up to "),e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.filesize(t.config.uploader.max_photo_size)))])])])])])]):t._e(),t._v(" "),t._e(),t._v(" "),1==t.config.features.stories?e("a",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark",attrs:{href:"/i/stories/new"}},[t._m(7)]):t._e(),t._v(" "),t._e(),t._v(" "),t._m(9),t._v(" "),t._m(10)])]):"cropPhoto"==t.page?e("div",{staticClass:"w-100 h-100"},[t.ids.length>0?e("div",[e("vue-cropper",{ref:"cropper",attrs:{relativeZoom:t.cropper.zoom,aspectRatio:t.cropper.aspectRatio,viewMode:t.cropper.viewMode,zoomable:t.cropper.zoomable,rotatable:!0,src:t.media[t.carouselCursor].url}})],1):t._e()]):2==t.page?e("div",{staticClass:"w-100 h-100"},[1==t.media.length?e("div",[e("div",{staticStyle:{display:"flex","min-height":"420px","align-items":"center"},attrs:{slot:"img"},slot:"img"},[e("img",{class:"d-block img-fluid w-100 "+[t.media[t.carouselCursor].filter_class?t.media[t.carouselCursor].filter_class:""],attrs:{src:t.media[t.carouselCursor].url,alt:t.media[t.carouselCursor].description,title:t.media[t.carouselCursor].description}})]),t._v(" "),e("hr"),t._v(" "),t.ids.length>0&&"image"==t.media[t.carouselCursor].type?e("div",{staticClass:"align-items-center px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),e("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,(function(i,s){return e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("div",{staticClass:"rounded",class:i[1]},[e("img",{attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,i[1])}}})])]),t._v(" "),e("a",{class:[t.media[t.carouselCursor].filter_class==i[1]?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,i[1])}}},[t._v(t._s(i[0]))])])}))],2)]):t._e()]):t.media.length>1?e("div",{staticClass:"d-flex-inline px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center pb-3"},[e("li",{staticClass:"nav-item mx-md-4"},[t._v(" ")]),t._v(" "),t._l(t.media,(function(i,s){return e("li",{key:i.id+":"+t.carouselCursor,staticClass:"nav-item mx-md-4"},[e("div",{staticClass:"nav-link",staticStyle:{display:"block",width:"300px",height:"300px"},on:{click:function(e){t.carouselCursor=s}}},[e("div",{class:[i.filter_class?i.filter_class:""],staticStyle:{width:"100%",height:"100%",display:"block"}},[e("div",{class:"rounded "+[s==t.carouselCursor?" border border-primary shadow":""],style:"display:block;width:100%;height:100%;background-image: url("+i.url+");background-size:cover;"})])]),t._v(" "),s==t.carouselCursor?e("div",{staticClass:"text-center mb-0 small text-lighter font-weight-bold pt-2"},[e("button",{staticClass:"btn btn-link",on:{click:function(e){return t.mediaReorder("prev")}}},[e("i",{staticClass:"far fa-chevron-circle-left"})]),t._v(" "),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return e.preventDefault(),t.showCropPhotoCard.apply(null,arguments)}}},[t._v("Crop")]),t._v(" "),e("span",{staticClass:"cursor-pointer px-3",on:{click:function(e){return e.preventDefault(),t.showEditMediaCard()}}},[t._v("Edit")]),t._v(" "),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return t.deleteMedia()}}},[t._v("Delete")]),t._v(" "),e("button",{staticClass:"btn btn-link",on:{click:function(e){return t.mediaReorder("next")}}},[e("i",{staticClass:"far fa-chevron-circle-right"})])]):t._e()])})),t._v(" "),e("li",{staticClass:"nav-item mx-md-4"},[t._v(" ")])],2),t._v(" "),e("hr"),t._v(" "),t.ids.length>0&&"image"==t.media[t.carouselCursor].type?e("div",{staticClass:"align-items-center px-2 pt-2"},[e("ul",{staticClass:"nav media-drawer-filters text-center"},[e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),e("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,(function(i,s){return e("li",{staticClass:"nav-item"},[e("div",{staticClass:"p-1 pt-3"},[e("img",{class:i[1],attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,i[1])}}})]),t._v(" "),e("a",{class:[t.media[t.carouselCursor].filter_class==i[1]?"nav-link text-primary active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,i[1])}}},[t._v(t._s(i[0]))])])}))],2)]):t._e()]):e("div",[e("p",{staticClass:"mb-0 p-5 text-center font-weight-bold"},[t._v("An error occured, please refresh the page.")])])]):3==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{class:[t.media[0].filter_class?"mr-2 "+t.media[0].filter_class:"mr-2"],attrs:{src:t.media[0].url,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a caption..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer d-flex justify-content-between",on:{click:function(e){return t.showMediaDescriptionsCard()}}},[e("span",[t._v("Alt Text")]),t._v(" "),e("span",[t.media&&t.media.filter((function(t){return t.alt})).length==t.media.length?e("i",{staticClass:"fas fa-check-circle fa-lg text-success"}):e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])]),t._v(" "),e("div",{staticClass:"border-bottom px-4 mb-0 py-2"},[e("div",{staticClass:"d-flex justify-content-between"},[t._m(11),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asnsfw"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var i=t.nsfw,s=e.target,a=!!s.checked;if(Array.isArray(i)){var o=t._i(i,null);s.checked?o<0&&(t.nsfw=i.concat([null])):o>-1&&(t.nsfw=i.slice(0,o).concat(i.slice(o+1)))}else t.nsfw=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asnsfw"}})])])]),t._v(" "),t.nsfw?e("div",[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.spoilerText,expression:"spoilerText"}],staticClass:"form-control mt-3",attrs:{placeholder:"Add an optional content warning or spoiler text",maxlength:"140"},domProps:{value:t.spoilerText},on:{input:function(e){e.target.composing||(t.spoilerText=e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.spoilerTextLength)+"/140")])]):t._e()]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showTagCard()}}},[t._v("Tag people")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showCollectionCard()}}},[t._m(12),t._v(" "),e("span",{staticClass:"float-right"},[t.collectionsSelected.length?e("span",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px 5px","text-transform":"uppercase"},attrs:{href:"#",disabled:""}},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.collectionsSelected.length)+"\n\t\t\t\t\t\t\t\t\t")]):t._e(),t._v(" "),t._m(13)])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLicenseCard()}}},[e("span",[t._v("Add license")]),t._v(" "),e("span",{staticClass:"float-right"},[t.licenseTitle?e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showLicenseCard()}}},[t._v(t._s(t.licenseTitle))]):t._e(),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showLicenseCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[t.place?e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",{staticClass:"text-lighter"},[t._v("Location:")]),t._v(" "+t._s(t.place.name)+", "+t._s(t.place.country)+"\n\t\t\t\t\t\t\t\t"),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-2",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showLocationCard()}}},[t._v("Edit")]),t._v(" "),e("a",{staticClass:"btn btn-outline-secondary btn-sm small",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.place=!1}}},[t._v("Remove")])])]):e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLocationCard()}}},[t._v("Add location")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",[t._v("Audience")]),t._v(" "),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[t._v(t._s(t.visibilityTag))]),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticStyle:{"min-height":"200px"}},[e("p",{staticClass:"px-4 mb-0 py-2 small font-weight-bold text-muted cursor-pointer",on:{click:function(e){return t.showAdvancedSettingsCard()}}},[t._v("Advanced settings")])])]):"tagPeople"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("autocomplete",{directives:[{name:"show",rawName:"v-show",value:t.taggedUsernames.length<10,expression:"taggedUsernames.length < 10"}],ref:"autocomplete",attrs:{search:t.tagSearch,placeholder:"@pixelfed","aria-label":"Search usernames","get-result-value":t.getTagResultValue},on:{submit:t.onTagSubmitLocation}}),t._v(" "),e("p",{directives:[{name:"show",rawName:"v-show",value:t.taggedUsernames.length<10,expression:"taggedUsernames.length < 10"}],staticClass:"font-weight-bold text-muted small"},[t._v("You can tag "+t._s(10-t.taggedUsernames.length)+" more "+t._s(9==t.taggedUsernames.length?"person":"people")+"!")]),t._v(" "),e("p",{staticClass:"font-weight-bold text-center mt-3"},[t._v("Tagged People")]),t._v(" "),e("div",{staticClass:"list-group"},[t._l(t.taggedUsernames,(function(i,s){return e("div",{staticClass:"list-group-item d-flex justify-content-between"},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-2 rounded-circle border",attrs:{src:i.avatar,width:"24px",height:"24px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(i.name))])])]),t._v(" "),e("div",{staticClass:"custom-control custom-switch"},[e("input",{directives:[{name:"model",rawName:"v-model",value:i.privacy,expression:"tag.privacy"}],staticClass:"custom-control-input disabled",attrs:{type:"checkbox",id:"cci-tagged-privacy-switch"+s,disabled:""},domProps:{checked:Array.isArray(i.privacy)?t._i(i.privacy,null)>-1:i.privacy},on:{change:function(e){var s=i.privacy,a=e.target,o=!!a.checked;if(Array.isArray(s)){var n=t._i(s,null);a.checked?n<0&&t.$set(i,"privacy",s.concat([null])):n>-1&&t.$set(i,"privacy",s.slice(0,n).concat(s.slice(n+1)))}else t.$set(i,"privacy",o)}}}),t._v(" "),e("label",{staticClass:"custom-control-label font-weight-bold text-lighter",attrs:{for:"cci-tagged-privacy-switch"+s}},[t._v(t._s(i.privacy?"Public":"Private"))]),t._v(" "),e("a",{staticClass:"ml-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.untagUsername(s)}}},[e("i",{staticClass:"fas fa-times text-muted"})])])])})),t._v(" "),0==t.taggedUsernames.length?e("div",{staticClass:"list-group-item p-3"},[e("p",{staticClass:"text-center mb-0 font-weight-bold text-lighter"},[t._v("Search usernames to tag.")])]):t._e()],2),t._v(" "),e("p",{staticClass:"font-weight-bold text-center small text-muted pt-3 mb-0"},[t._v("When you tag someone, they are sent a notification."),e("br"),t._v("For more information on tagging, "),e("a",{staticClass:"text-primary",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showTagHelpCard()}}},[t._v("click here")]),t._v(".")])],1):"tagPeopleHelp"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"mb-0 text-center py-3 px-2 lead"},[t._v("Tagging someone is like mentioning them, with the option to make it private between you.")]),t._v(" "),e("p",{staticClass:"mb-3 py-3 px-2 font-weight-lighter"},[t._v("\n\t\t\t\t\t\t\tYou can choose to tag someone in public or private mode. Public mode will allow others to see who you tagged in the post and private mode tagged users will not be shown to others.\n\t\t\t\t\t\t")])]):"addLocation"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"mb-0"},[t._v("Add Location")]),t._v(" "),e("autocomplete",{attrs:{search:t.locationSearch,placeholder:"Search locations ...","aria-label":"Search locations ...","get-result-value":t.getResultValue},on:{submit:t.onSubmitLocation}})],1):"advancedSettings"==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"list-group list-group-flush"},[e("div",{staticClass:"list-group-item d-flex justify-content-between"},[t._m(14),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.commentsDisabled,expression:"commentsDisabled"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asdisablecomments"},domProps:{checked:Array.isArray(t.commentsDisabled)?t._i(t.commentsDisabled,null)>-1:t.commentsDisabled},on:{change:function(e){var i=t.commentsDisabled,s=e.target,a=!!s.checked;if(Array.isArray(i)){var o=t._i(i,null);s.checked?o<0&&(t.commentsDisabled=i.concat([null])):o>-1&&(t.commentsDisabled=i.slice(0,o).concat(i.slice(o+1)))}else t.commentsDisabled=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asdisablecomments"}})])])]),t._v(" "),e("a",{staticClass:"list-group-item",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showMediaDescriptionsCard()}}},[t._m(15)])])]):"visibility"==t.page?e("div",{staticClass:"w-100 h-100"},[e("div",{staticClass:"list-group list-group-flush"},[t.profile.locked?t._e():e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"public"==t.visibility},on:{click:function(e){return t.toggleVisibility("public")}}},[t._v("\n\t\t\t\t\t\t\t\tPublic\n\t\t\t\t\t\t\t")]),t._v(" "),t.profile.locked?t._e():e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"unlisted"==t.visibility},on:{click:function(e){return t.toggleVisibility("unlisted")}}},[t._v("\n\t\t\t\t\t\t\t\tUnlisted\n\t\t\t\t\t\t\t")]),t._v(" "),e("div",{staticClass:"list-group-item lead cursor-pointer",class:{"text-primary":"private"==t.visibility},on:{click:function(e){return t.toggleVisibility("private")}}},[t._v("\n\t\t\t\t\t\t\t\tFollowers Only\n\t\t\t\t\t\t\t")])])]):"altText"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[t._l(t.media,(function(i,s){return e("div",[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:i.preview_url,width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:i.alt,expression:"m.alt"}],staticClass:"form-control",attrs:{placeholder:"Add a media description here...",maxlength:t.maxAltTextLength,rows:"4"},domProps:{value:i.alt},on:{input:function(e){e.target.composing||t.$set(i,"alt",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(i.alt?i.alt.length:0)+"/"+t._s(t.maxAltTextLength))])])]),t._v(" "),e("hr")])})),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Cancel")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])],2):"addToCollection"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[t.collectionsLoaded&&t.collections.length?e("div",{staticClass:"list-group mb-3 collections-list-group"},[t._l(t.collections,(function(i,s){return e("div",{staticClass:"list-group-item cursor-pointer compose-action border",class:{active:t.collectionsSelected.includes(s)},on:{click:function(e){return t.toggleCollectionItem(s)}}},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:i.thumb,alt:"",width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("h5",{staticClass:"mt-0"},[t._v(t._s(i.title))]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[t._v(t._s(i.post_count)+" Posts - Created "+t._s(t.timeAgo(i.published_at))+" ago")])])])])})),t._v(" "),t.collectionsCanLoadMore?e("button",{staticClass:"btn btn-light btn-block font-weight-bold mt-3",on:{click:t.loadMoreCollections}},[t._v("\n\t\t\t\t\t\t\t\tLoad more\n\t\t\t\t\t\t\t")]):t._e()],2):t._e(),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.clearSelectedCollections()}}},[t._v("Clear")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])]):"schedulePost"==t.page||"mediaMetadata"==t.page||"addToStory"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("p",{staticClass:"text-center lead text-muted mb-0 py-5"},[t._v("This feature is not available yet.")])]):"editMedia"==t.page?e("div",{staticClass:"w-100 h-100 p-3"},[e("div",{staticClass:"media"},[e("img",{staticClass:"mr-3",attrs:{src:t.media[t.carouselCursor].preview_url,width:"50px",height:"50px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small"},[t._v("Media Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.media[t.carouselCursor].alt,expression:"media[carouselCursor].alt"}],staticClass:"form-control",attrs:{placeholder:"Add a media description here...",maxlength:"140"},domProps:{value:t.media[t.carouselCursor].alt},on:{input:function(e){e.target.composing||t.$set(t.media[t.carouselCursor],"alt",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-muted mb-0 d-flex justify-content-between"},[e("span",[t._v("Describe your photo for people with visual impairments.")]),t._v(" "),e("span",[t._v(t._s(t.media[t.carouselCursor].alt?t.media[t.carouselCursor].alt.length:0)+"/140")])])]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small"},[t._v("License")]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.licenseId,expression:"licenseId"}],staticClass:"form-control",on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.licenseId=e.target.multiple?i:i[0]}}},t._l(t.availableLicenses,(function(i,s){return e("option",{domProps:{value:i.id,selected:i.id==t.licenseId}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t"+t._s(i.name)+"\n\t\t\t\t\t\t\t\t\t\t")])})),0)])])]),t._v(" "),e("hr"),t._v(" "),e("p",{staticClass:"d-flex justify-content-between mb-0"},[e("button",{staticClass:"btn btn-link text-muted font-weight-bold text-decoration-none",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Cancel")]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.goBack()}}},[t._v("Save")])])]):"video-2"==t.page?e("div",{staticClass:"w-100 h-100"},[t.video.title.length?e("div",{staticClass:"border-bottom"},[e("div",{staticClass:"media p-3"},[e("img",{class:[t.media[0].filter_class?"mr-2 "+t.media[0].filter_class:"mr-2"],attrs:{src:t.media[0].url,width:"100px",height:"70px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"font-weight-bold mb-1"},[t._v(t._s(t.video.title?t.video.title.slice(0,70):"Untitled"))]),t._v(" "),e("p",{staticClass:"mb-0 text-muted small"},[t._v(t._s(t.video.description?t.video.description.slice(0,90):"No description"))])])])]):t._e(),t._v(" "),e("div",{staticClass:"border-bottom d-flex justify-content-between px-4 mb-0 py-2"},[t._m(16),t._v(" "),e("div",[e("div",{staticClass:"custom-control custom-switch",staticStyle:{"z-index":"9999"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"asnsfw"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var i=t.nsfw,s=e.target,a=!!s.checked;if(Array.isArray(i)){var o=t._i(i,null);s.checked?o<0&&(t.nsfw=i.concat([null])):o>-1&&(t.nsfw=i.slice(0,o).concat(i.slice(o+1)))}else t.nsfw=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"asnsfw"}})])])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2 cursor-pointer",on:{click:function(e){return t.showLicenseCard()}}},[t._v("Add license")])]),t._v(" "),e("div",{staticClass:"border-bottom"},[e("p",{staticClass:"px-4 mb-0 py-2"},[e("span",[t._v("Audience")]),t._v(" "),e("span",{staticClass:"float-right"},[e("a",{staticClass:"btn btn-outline-secondary btn-sm small mr-3 mt-n1 disabled",staticStyle:{"font-size":"10px",padding:"3px","text-transform":"uppercase"},attrs:{href:"#",disabled:""},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[t._v(t._s(t.visibilityTag))]),t._v(" "),e("a",{staticClass:"text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showVisibilityCard()}}},[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("div",{staticClass:"form-group"},[e("p",{staticClass:"small font-weight-bold text-muted mb-0"},[t._v("Title")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.video.title,expression:"video.title"}],staticClass:"form-control",attrs:{placeholder:"Add a good title"},domProps:{value:t.video.title},on:{input:function(e){e.target.composing||t.$set(t.video,"title",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text mb-0 small text-muted"},[t._v(t._s(t.video.title.length)+"/70")])]),t._v(" "),e("div",{staticClass:"form-group mb-0"},[e("p",{staticClass:"small font-weight-bold text-muted mb-0"},[t._v("Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.video.description,expression:"video.description"}],staticClass:"form-control",attrs:{placeholder:"Add an optional description",maxlength:"5000",rows:"5"},domProps:{value:t.video.description},on:{input:function(e){e.target.composing||t.$set(t.video,"description",e.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text mb-0 small text-muted"},[t._v(t._s(t.video.description.length)+"/5000")])])])]):"filteringMedia"==t.page?e("div",{staticClass:"w-100 h-100 py-5"},[e("div",{staticClass:"d-flex flex-column align-items-center justify-content-center py-5"},[e("b-spinner",{attrs:{small:""}}),t._v(" "),e("p",{staticClass:"font-weight-bold mt-3"},[t._v("Applying filters...")])],1)]):t._e()]),t._v(" "),"cropPhoto"==t.page?e("div",{staticClass:"card-footer bg-white d-flex justify-content-between"},[e("div",[e("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"},on:{click:t.rotate}},[e("i",{staticClass:"fas fa-redo"})])]),t._v(" "),e("div",[e("div",{staticClass:"d-inline-block button-group"},[e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==16/9?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(16/9)}}},[t._v("16:9")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==4/3?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(4/3)}}},[t._v("4:3")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[1.5==t.cropper.aspectRatio?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(1.5)}}},[t._v("3:2")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[1==t.cropper.aspectRatio?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(1)}}},[t._v("1:1")]),t._v(" "),e("button",{class:"btn font-weight-bold "+[t.cropper.aspectRatio==2/3?"btn-primary":"btn-light"],on:{click:function(e){return e.preventDefault(),t.changeAspect(2/3)}}},[t._v("2:3")])])])]):t._e()])])])])},a=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[e("span",{staticClass:"pr-3"},[e("i",{staticClass:"fas fa-cog fa-lg text-muted"})]),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tCamera Roll\n\t\t\t\t\t")]),t._v(" "),e("span",{staticClass:"text-primary font-weight-bold"},[t._v("Upload")])])},function(){var t=this._self._c;return t("span",{staticClass:"pr-3"},[t("i",{staticClass:"fas fa-info-circle fa-lg text-primary"})])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%","background-color":"#008DF5"}},[t("i",{staticClass:"fal fa-bolt text-white fa-lg"})])},function(){var t=this._self._c;return t("p",{staticClass:"mb-0"},[t("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[this._v("New Post")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"2px solid #008DF5"}},[e("i",{staticClass:"far fa-edit text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Text Post")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Share a text only post")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"1px solid #008DF5"}},[e("i",{staticClass:"fas fa-history text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Story")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Add to your story")])])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"2px solid #008DF5"}},[e("i",{staticClass:"fas fa-poll-h text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Poll")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("Create a poll")])])])])},function(){var t=this,e=t._self._c;return e("a",{staticClass:"card my-md-3 shadow-none border compose-action text-decoration-none text-dark",attrs:{href:"/i/collections/create"}},[e("div",{staticClass:"card-body py-2"},[e("div",{staticClass:"media"},[e("div",{staticClass:"mr-3 align-items-center justify-content-center",staticStyle:{display:"inline-flex",width:"40px",height:"40px","border-radius":"100%",border:"1px solid #008DF5"}},[e("i",{staticClass:"fal fa-images text-primary fa-lg"})]),t._v(" "),e("div",{staticClass:"media-body text-left"},[e("p",{staticClass:"mb-0"},[e("span",{staticClass:"h5 mt-0 font-weight-bold text-primary"},[t._v("New Collection")]),t._v(" "),e("sup",{staticClass:"float-right mt-2"},[e("span",{staticClass:"btn btn-outline-lighter p-1 btn-sm font-weight-bold py-0",staticStyle:{"font-size":"10px","line-height":"0.6"}},[t._v("BETA")])])]),t._v(" "),e("p",{staticClass:"mb-0 text-muted"},[t._v("New collection of posts")])])])])])},function(){var t=this._self._c;return t("p",{staticClass:"py-3"},[t("a",{staticClass:"font-weight-bold",attrs:{href:"/site/help"}},[this._v("Help")])])},function(){var t=this._self._c;return t("div",[t("div",{staticClass:"text-dark"},[this._v("Sensitive/NSFW Media")])])},function(){var t=this,e=t._self._c;return e("span",[t._v("Add to Collection "),e("span",{staticClass:"ml-2 badge badge-primary"},[t._v("NEW")])])},function(){var t=this._self._c;return t("span",{staticClass:"text-decoration-none"},[t("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])},function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"text-dark"},[t._v("Turn off commenting")]),t._v(" "),e("p",{staticClass:"text-muted small mb-0"},[t._v("Disables comments for this post, you can change this later.")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"d-flex justify-content-between align-items-center"},[e("div",[e("div",{staticClass:"text-dark"},[t._v("Media Descriptions")]),t._v(" "),e("p",{staticClass:"text-muted small mb-0"},[t._v("Describe your photos for people with visual impairments.")])]),t._v(" "),e("div",[e("i",{staticClass:"fas fa-chevron-right fa-lg text-lighter"})])])},function(){var t=this._self._c;return t("div",[t("div",{staticClass:"text-dark"},[this._v("Contains NSFW Media")])])}]},43532:(t,e,i)=>{Vue.component("compose-modal",i(19324).default)},63996:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>o});var s=i(76798),a=i.n(s)()((function(t){return t[1]}));a.push([t.id,".compose-modal-component .media-drawer-filters{flex-wrap:unset;overflow-x:auto}.compose-modal-component .media-drawer-filters .nav-link{min-width:100px;padding-bottom:1rem;padding-top:1rem}.compose-modal-component .media-drawer-filters .active{color:#fff;font-weight:700}@media (hover:none) and (pointer:coarse){.compose-modal-component .media-drawer-filters::-webkit-scrollbar{display:none}}.compose-modal-component .no-focus{border-color:none;box-shadow:none;outline:0}.compose-modal-component a.list-group-item{text-decoration:none}.compose-modal-component a.list-group-item:hover{background-color:#f8f9fa;text-decoration:none}.compose-modal-component .compose-action:hover{background-color:#f8f9fa;cursor:pointer}.compose-modal-component .collections-list-group{max-height:500px;overflow-y:auto}.compose-modal-component .collections-list-group .list-group-item.active{background-color:#dbeafe!important;border-color:#60a5fa!important;color:#212529}",""]);const o=a},57893:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>l});var s=i(85072),a=i.n(s),o=i(63996),n={insert:"head",singleton:!1};a()(o.default,n);const l=o.default.locals||{}},19324:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>n});var s=i(87310),a=i(50427),o={};for(const t in a)"default"!==t&&(o[t]=()=>a[t]);i.d(e,o);i(17774);const n=(0,i(14486).default)(a.default,s.render,s.staticRenderFns,!1,null,null,null).exports},50427:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>o});var s=i(28320),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);i.d(e,a);const o=s.default},87310:(t,e,i)=>{"use strict";i.r(e);var s=i(2383),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);i.d(e,a)},17774:(t,e,i)=>{"use strict";i.r(e);var s=i(57893),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);i.d(e,a)}},t=>{t.O(0,[3660],(()=>{return e=43532,t(t.s=e);var e}));t.O()}]); \ No newline at end of file diff --git a/public/js/manifest.js b/public/js/manifest.js index 00c405853..e6d9470f3 100644 --- a/public/js/manifest.js +++ b/public/js/manifest.js @@ -1 +1 @@ -(()=>{"use strict";var e,r,n,o={},t={};function a(e){var r=t[e];if(void 0!==r)return r.exports;var n=t[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=o,e=[],a.O=(r,n,o,t)=>{if(!n){var d=1/0;for(f=0;f=t)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(i=!1,t0&&e[f-1][2]>t;f--)e[f]=e[f-1];e[f]=[n,o,t]},a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var n in r)a.o(r,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,n)=>(a.f[n](e,r),r)),[])),a.u=e=>"js/"+{1179:"daci.chunk",1240:"discover~myhashtags.chunk",1645:"profile~following.bundle",2156:"dms.chunk",2966:"discover~hashtag.bundle",3688:"discover~serverfeed.chunk",4951:"home.chunk",6250:"discover~settings.chunk",6535:"discover.chunk",6740:"discover~memories.chunk",7399:"dms~message.chunk",7413:"error404.bundle",7521:"discover~findfriends.chunk",7744:"notifications.chunk",8087:"profile.chunk",8119:"i18n.bundle",8408:"post.chunk",8977:"profile~followers.bundle",9124:"compose.chunk",9919:"changelog.bundle"}[e]+"."+{1179:"34dc7bad3a0792cc",1240:"8886fc0d4736d819",1645:"7ca7cfa5aaae75e2",2156:"2b55effc0e8ba89f",2966:"a0f00fc7df1f313c",3688:"262bf7e3bce843c3",4951:"264eeb47bfac56c1",6250:"65d6f3cbe5323ed4",6535:"c2229e1d15bd3ada",6740:"37e0c325f900e163",7399:"976f7edaa6f71137",7413:"b397483e3991ab20",7521:"b1858bea66d9723b",7744:"0c5151643e4534aa",8087:"f74967e7910990ca",8119:"93a02e275ac1a708",8408:"5ff16664f9adb901",8977:"5d796e79f32d066c",9124:"ffae318db42f1072",9919:"bf44edbbfa14bd53"}[e]+".js",a.miniCssF=e=>({2305:"css/portfolio",2540:"css/landing",3364:"css/admin",6952:"css/appdark",8252:"css/app",8759:"css/spa"}[e]+".css"),a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},n="pixelfed:",a.l=(e,o,t,d)=>{if(r[e])r[e].push(o);else{var i,c;if(void 0!==t)for(var s=document.getElementsByTagName("script"),f=0;f{i.onerror=i.onload=null,clearTimeout(b);var t=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),t&&t.forEach((e=>e(o))),n)return n(o)},b=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),c&&document.head.appendChild(i)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="/",(()=>{var e={461:0,6952:0,8252:0,2305:0,3364:0,2540:0,8759:0};a.f.j=(r,n)=>{var o=a.o(e,r)?e[r]:void 0;if(0!==o)if(o)n.push(o[2]);else if(/^((69|82)52|2305|2540|3364|461|8759)$/.test(r))e[r]=0;else{var t=new Promise(((n,t)=>o=e[r]=[n,t]));n.push(o[2]=t);var d=a.p+a.u(r),i=new Error;a.l(d,(n=>{if(a.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var t=n&&("load"===n.type?"missing":n.type),d=n&&n.target&&n.target.src;i.message="Loading chunk "+r+" failed.\n("+t+": "+d+")",i.name="ChunkLoadError",i.type=t,i.request=d,o[1](i)}}),"chunk-"+r,r)}},a.O.j=r=>0===e[r];var r=(r,n)=>{var o,t,[d,i,c]=n,s=0;if(d.some((r=>0!==e[r]))){for(o in i)a.o(i,o)&&(a.m[o]=i[o]);if(c)var f=c(a)}for(r&&r(n);s{"use strict";var e,r,n,o={},t={};function a(e){var r=t[e];if(void 0!==r)return r.exports;var n=t[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=o,e=[],a.O=(r,n,o,t)=>{if(!n){var c=1/0;for(f=0;f=t)&&Object.keys(a.O).every((e=>a.O[e](n[i])))?n.splice(i--,1):(d=!1,t0&&e[f-1][2]>t;f--)e[f]=e[f-1];e[f]=[n,o,t]},a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var n in r)a.o(r,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,n)=>(a.f[n](e,r),r)),[])),a.u=e=>"js/"+{1179:"daci.chunk",1240:"discover~myhashtags.chunk",1645:"profile~following.bundle",2156:"dms.chunk",2966:"discover~hashtag.bundle",3688:"discover~serverfeed.chunk",4951:"home.chunk",6250:"discover~settings.chunk",6535:"discover.chunk",6740:"discover~memories.chunk",7399:"dms~message.chunk",7413:"error404.bundle",7521:"discover~findfriends.chunk",7744:"notifications.chunk",8087:"profile.chunk",8119:"i18n.bundle",8408:"post.chunk",8977:"profile~followers.bundle",9124:"compose.chunk",9919:"changelog.bundle"}[e]+"."+{1179:"34dc7bad3a0792cc",1240:"8886fc0d4736d819",1645:"7ca7cfa5aaae75e2",2156:"2b55effc0e8ba89f",2966:"a0f00fc7df1f313c",3688:"262bf7e3bce843c3",4951:"264eeb47bfac56c1",6250:"65d6f3cbe5323ed4",6535:"c2229e1d15bd3ada",6740:"37e0c325f900e163",7399:"976f7edaa6f71137",7413:"b397483e3991ab20",7521:"b1858bea66d9723b",7744:"0c5151643e4534aa",8087:"f74967e7910990ca",8119:"93a02e275ac1a708",8408:"5ff16664f9adb901",8977:"5d796e79f32d066c",9124:"a0cfdf07f5062445",9919:"bf44edbbfa14bd53"}[e]+".js",a.miniCssF=e=>({2305:"css/portfolio",2540:"css/landing",3364:"css/admin",6952:"css/appdark",8252:"css/app",8759:"css/spa"}[e]+".css"),a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},n="pixelfed:",a.l=(e,o,t,c)=>{if(r[e])r[e].push(o);else{var d,i;if(void 0!==t)for(var s=document.getElementsByTagName("script"),f=0;f{d.onerror=d.onload=null,clearTimeout(b);var t=r[e];if(delete r[e],d.parentNode&&d.parentNode.removeChild(d),t&&t.forEach((e=>e(o))),n)return n(o)},b=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),i&&document.head.appendChild(d)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="/",(()=>{var e={461:0,6952:0,8252:0,2305:0,3364:0,2540:0,8759:0};a.f.j=(r,n)=>{var o=a.o(e,r)?e[r]:void 0;if(0!==o)if(o)n.push(o[2]);else if(/^((69|82)52|2305|2540|3364|461|8759)$/.test(r))e[r]=0;else{var t=new Promise(((n,t)=>o=e[r]=[n,t]));n.push(o[2]=t);var c=a.p+a.u(r),d=new Error;a.l(c,(n=>{if(a.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var t=n&&("load"===n.type?"missing":n.type),c=n&&n.target&&n.target.src;d.message="Loading chunk "+r+" failed.\n("+t+": "+c+")",d.name="ChunkLoadError",d.type=t,d.request=c,o[1](d)}}),"chunk-"+r,r)}},a.O.j=r=>0===e[r];var r=(r,n)=>{var o,t,[c,d,i]=n,s=0;if(c.some((r=>0!==e[r]))){for(o in d)a.o(d,o)&&(a.m[o]=d[o]);if(i)var f=i(a)}for(r&&r(n);s{"use strict";o.r(t),o.d(t,{default:()=>n});var a=o(2e4);o(87980);function i(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return s(e,t)}(e)||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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o1&&void 0!==arguments[1]?arguments[1]:30;return e.length<=t?e:e.slice(0,t)+"..."},timeAgo:function(e){return window.App.util.format.timeAgo(e)},formatCount:function(e){return e?new Intl.NumberFormat("en-CA",{notation:"compact",compactDisplay:"short"}).format(e):0},logout:function(){axios.post("/logout").then((function(e){location.href="/"})).catch((function(e){location.href="/"}))},openUserInterfaceSettings:function(){event.currentTarget.blur(),this.$refs.uis.show()},toggleUi:function(e){event.currentTarget.blur(),this.uiColorScheme=e},toggleProfileLayout:function(e){event.currentTarget.blur(),this.profileLayout=e}}}},45076:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>n});var a=o(74692);function i(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return s(e,t)}(e)||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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o5?e.complete():axios.get("/api/pixelfed/v1/notifications",{params:{max_id:this.notificationMaxId}}).then((function(o){if(o.data.length){var a,s=o.data.filter((function(e){return!("share"==e.type&&!e.status)&&(!("comment"==e.type&&!e.status)&&(!("mention"==e.type&&!e.status)&&(!("favourite"==e.type&&!e.status)&&(!("follow"==e.type&&!e.account)&&!_.find(t.notifications,{id:e.id})))))})),n=s.map((function(e){return e.id}));t.notificationMaxId=Math.min.apply(Math,i(n)),(a=t.notifications).push.apply(a,i(s)),t.notificationCursor++,e.loaded()}else e.complete()}))},truncate:function(e){return e.length<=15?e:e.slice(0,15)+"..."},timeAgo:function(e){return window.App.util.format.timeAgo(e)},mentionUrl:function(e){return"/p/"+e.account.username+"/"+e.id},notificationPoll:function(){var e=this.notifications.length>5?15e3:12e4,t=this;setInterval((function(){axios.get("/api/pixelfed/v1/notifications").then((function(e){var o=e.data.filter((function(e){return!("share"==e.type||t.notificationMaxId>=e.id)}));if(o.length){var s,n=o.map((function(e){return e.id}));t.notificationMaxId=Math.max.apply(Math,i(n)),(s=t.notifications).unshift.apply(s,i(o));var r=new Audio("/static/beep.mp3");r.volume=.7,r.play(),a(".notification-card .far.fa-bell").addClass("fas text-danger").removeClass("far text-muted")}}))}),e)},fetchFollowRequests:function(){var e=this;1==window._sharedData.curUser.locked&&axios.get("/account/follow-requests.json").then((function(t){e.followRequests=t.data}))},redirect:function(e){window.location.href=e},notificationPreview:function(e){return e.status&&e.status.hasOwnProperty("media_attachments")&&e.status.media_attachments.length?e.status.media_attachments[0].preview_url:"/storage/no-preview.png"},getProfileUrl:function(e){return 1==e.local?e.url:"/i/web/profile/_/"+e.id},getPostUrl:function(e){if(e)return e.hasOwnProperty("local")&&1!=e.local?"/i/web/post/_/"+e.account.id+"/"+e.id:e.url},refreshNotifications:function(){this.loading=!0,this.attemptedRefresh=!0,this.fetchNotifications()}}}},59488:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>i});var a=o(74692);const i={props:["feed","status","profile","size","modal"],data:function(){return{activeSession:!1}},mounted:function(){var e=document.querySelector("body");this.activeSession=!!e.classList.contains("loggedIn")},methods:{reportUrl:function(e){return"/i/report?type="+(e.in_reply_to?"comment":"post")+"&id="+e.id},timestampFormat:function(e){var t=new Date(e);return t.toDateString()+" "+t.toLocaleTimeString()},editUrl:function(e){return e.url+"/edit"},redirect:function(e){window.location.href=e},replyUrl:function(e){return"/p/"+this.profile.username+"/"+(e.account.id==this.profile.id?e.id:e.in_reply_to_id)},mentionUrl:function(e){return"/p/"+e.account.username+"/"+e.id},statusOwner:function(e){return parseInt(e.account.id)==parseInt(this.profile.id)},deletePost:function(){this.$emit("deletePost"),a("#mt_pid_"+this.status.id).modal("hide")},hidePost:function(e){e.sensitive=!0,a("#mt_pid_"+e.id).modal("hide")},moderatePost:function(e,t,o){var a=e.account.username;switch(t){case"autocw":var i="Are you sure you want to enforce CW for "+a+" ?";swal({title:"Confirm",text:i,icon:"warning",buttons:!0,dangerMode:!0});break;case"suspend":i="Are you sure you want to suspend the account of "+a+" ?",swal({title:"Confirm",text:i,icon:"warning",buttons:!0,dangerMode:!0})}},muteProfile:function(e){0!=a("body").hasClass("loggedIn")&&axios.post("/i/mute",{type:"user",item:e.account.id}).then((function(t){swal("Success","You have successfully muted "+e.account.acct,"success")})).catch((function(e){swal("Error","Something went wrong. Please try again later.","error")}))},blockProfile:function(e){0!=a("body").hasClass("loggedIn")&&axios.post("/i/block",{type:"user",item:e.account.id}).then((function(t){swal("Success","You have successfully blocked "+e.account.acct,"success")})).catch((function(e){swal("Error","Something went wrong. Please try again later.","error")}))},statusUrl:function(e){return 1==e.local?e.url:"/i/web/post/_/"+e.account.id+"/"+e.id},profileUrl:function(e){return 1==e.local?e.account.url:"/i/web/profile/_/"+e.account.id},closeModal:function(){a("#mt_pid_"+this.status.id).modal("hide")}}}},81504:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>a});const a={props:["list","scope"],data:function(){return{loading:!0,show:!0,stories:{}}},mounted:function(){this.fetchStories()},methods:{fetchStories:function(){var e=this;axios.get("/api/web/stories/v1/recent").then((function(t){t.data;t.data.length?(e.stories=t.data,e.loading=!1):e.show=!1})).catch((function(t){e.loading=!1,e.$bvToast.toast("Cannot load stories. Please try again later.",{title:"Error",variant:"danger",autoHideDelay:5e3}),e.show=!1}))},showStory:function(e){var t;switch(this.scope){case"home":t="/?t=1";break;case"local":t="/?t=2";break;case"network":t="/?t=3"}window.location.href=this.stories[e].url+t},systemStory:function(){window.location.href="/i/_platform/stories/whats-new"}}}},78788:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>a});const a={props:["status"]}},40669:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>i});var a=o(18634);const i={props:["status"],data:function(){return{sensitive:this.status.sensitive,cursor:0}},created:function(){},beforeDestroy:function(){},methods:{toggleContentWarning:function(e){this.$emit("togglecw")},toggleLightbox:function(e){(0,a.default)({el:e.target,gallery:"#carousel-"+this.status.id,position:this.$refs.carousel.currentPage})},altText:function(e){var t=e.description;return t||"Photo was not tagged with any alt text."},keypressNavigation:function(e){var t=this.$refs.carousel;if("37"==e.keyCode){e.preventDefault();var o="backward";t.advancePage(o),t.$emit("navigation-click",o)}if("39"==e.keyCode){e.preventDefault();var a="forward";t.advancePage(a),t.$emit("navigation-click",a)}}}}},96504:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>i});var a=o(18634);const i={props:["status"],data:function(){return{sensitive:this.status.sensitive}},mounted:function(){},methods:{altText:function(e){var t=e.media_attachments[0].description;return t||"Photo was not tagged with any alt text."},toggleContentWarning:function(e){this.$emit("togglecw")},toggleLightbox:function(e){(0,a.default)({el:e.target})},width:function(){if(this.status.media_attachments[0].meta&&this.status.media_attachments[0].meta.original&&this.status.media_attachments[0].meta.original.width)return this.status.media_attachments[0].meta.original.width},height:function(){if(this.status.media_attachments[0].meta&&this.status.media_attachments[0].meta.original&&this.status.media_attachments[0].meta.original.height)return this.status.media_attachments[0].meta.original.height}}}},36104:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>a});const a={props:["status"]}},89379:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>a});const a={props:["status"],methods:{altText:function(e){var t=e.media_attachments[0].description;return t||"Video was not tagged with any alt text."},playOrPause:function(e){var t=e.target;1==t.getAttribute("playing")?(t.removeAttribute("playing"),t.pause()):(t.setAttribute("playing",1),t.play())},toggleContentWarning:function(e){this.$emit("togglecw")},poster:function(){var e=this.status.media_attachments[0].preview_url;if(!e.endsWith("no-preview.jpg")&&!e.endsWith("no-preview.png"))return e}}}},12747:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return t("nav",{staticClass:"metro-nav navbar navbar-expand navbar-light navbar-laravel sticky-top shadow-none py-1"},[t("div",{staticClass:"container-fluid"},[t("a",{staticClass:"navbar-brand d-flex align-items-center",staticStyle:{width:"50px"},attrs:{href:"/i/web",title:"Logo"}},[t("img",{staticClass:"px-2",attrs:{src:"/img/pixelfed-icon-color.svg",height:"30px",loading:"eager",alt:"Pixelfed logo"}}),e._v(" "),t("span",{staticClass:"font-weight-bold mb-0 d-none d-sm-block",staticStyle:{"font-size":"20px"}},[e._v("\n\t\t\t\t\t"+e._s(e.brandName)+"\n\t\t\t\t")])]),e._v(" "),t("div",{staticClass:"collapse navbar-collapse"},[t("div",{staticClass:"navbar-nav ml-auto"},[t("autocomplete",{ref:"autocomplete",staticClass:"searchbox",attrs:{search:e.autocompleteSearch,placeholder:e.$t("navmenu.search"),"aria-label":"Search","get-result-value":e.getSearchResultValue,debounceTime:700},on:{submit:e.onSearchSubmit},scopedSlots:e._u([{key:"result",fn:function(o){var a=o.result,i=o.props;return[t("li",e._b({staticClass:"autocomplete-result sr"},"li",i,!1),["account"===a.s_type?t("div",{staticClass:"media align-items-center my-0"},[t("img",{staticClass:"sr-avatar",staticStyle:{"border-radius":"40px"},attrs:{src:a.avatar,width:"40",height:"40",onerror:"this.src='/storage/avatars/default.png?v=0';this.onerror=null;"}}),e._v(" "),t("div",{staticClass:"media-body sr-account"},[t("div",{staticClass:"sr-account-acct",class:{compact:a.acct&&a.acct.length>24}},[e._v("\n\t\t\t\t\t\t\t\t\t\t\t@"+e._s(a.acct)+"\n\t\t\t\t\t\t\t\t\t\t\t"),a.locked?t("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.html",modifiers:{html:!0}}],staticClass:"p-0",attrs:{title:"Private Account",variant:"link",size:"sm"}},[t("i",{staticClass:"far fa-lock fa-sm text-lighter ml-1"})]):e._e()],1),e._v(" "),a.is_admin?[t("div",{staticClass:"sr-account-stats"},[t("div",{staticClass:"sr-account-stats-followers text-danger font-weight-bold"},[e._v("\n\t\t\t\t\t\t\t\t\t\t\t\t\tAdmin\n\t\t\t\t\t\t\t\t\t\t\t\t")]),e._v(" "),t("div",[e._v("·")]),e._v(" "),t("div",{staticClass:"sr-account-stats-followers font-weight-bold"},[t("span",[e._v(e._s(e.formatCount(a.followers_count)))]),e._v(" "),t("span",[e._v("Followers")])])])]:[a.local?[t("div",{staticClass:"sr-account-stats"},[a.followers_count?t("div",{staticClass:"sr-account-stats-followers font-weight-bold"},[t("span",[e._v(e._s(e.formatCount(a.followers_count)))]),e._v(" "),t("span",[e._v("Followers")])]):e._e(),e._v(" "),a.followers_count&&a.statuses_count?t("div",[e._v("·")]):e._e(),e._v(" "),a.statuses_count?t("div",{staticClass:"sr-account-stats-statuses font-weight-bold"},[t("span",[e._v(e._s(e.formatCount(a.statuses_count)))]),e._v(" "),t("span",[e._v("Posts")])]):e._e(),e._v(" "),!a.followers_count&&a.statuses_count?t("div",[e._v("·")]):e._e(),e._v(" "),t("div",{staticClass:"sr-account-stats-statuses font-weight-bold"},[t("i",{staticClass:"far fa-clock fa-sm"}),e._v(" "),t("span",[e._v(e._s(e.timeAgo(a.created_at)))])])])]:[t("div",{staticClass:"sr-account-stats"},[a.followers_count?t("div",{staticClass:"sr-account-stats-followers font-weight-bold"},[t("span",[e._v(e._s(e.formatCount(a.followers_count)))]),e._v(" "),t("span",[e._v("Followers")])]):e._e(),e._v(" "),a.followers_count&&a.statuses_count?t("div",[e._v("·")]):e._e(),e._v(" "),a.statuses_count?t("div",{staticClass:"sr-account-stats-statuses font-weight-bold"},[t("span",[e._v(e._s(e.formatCount(a.statuses_count)))]),e._v(" "),t("span",[e._v("Posts")])]):e._e(),e._v(" "),!a.followers_count&&a.statuses_count?t("div",[e._v("·")]):e._e(),e._v(" "),a.followers_count||a.statuses_count?e._e():t("div",{staticClass:"sr-account-stats-statuses font-weight-bold"},[e._v("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRemote Account\n\t\t\t\t\t\t\t\t\t\t\t\t\t")]),e._v(" "),a.followers_count||a.statuses_count?e._e():t("div",[e._v("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t·\n\t\t\t\t\t\t\t\t\t\t\t\t\t")]),e._v(" "),t("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.html",modifiers:{html:!0}}],staticClass:"sr-account-stats-statuses p-0",attrs:{title:"Joined "+e.timeAgo(a.created_at)+" ago",variant:"link",size:"sm"}},[t("i",{staticClass:"far fa-clock fa-sm"}),e._v(" "),t("span",{staticClass:"font-weight-bold"},[e._v(e._s(e.timeAgo(a.created_at)))])])],1)]]],2)]):"hashtag"===a.s_type?t("div",{staticClass:"media align-items-center my-0"},[t("div",{staticClass:"media-icon"},[t("i",{staticClass:"far fa-hashtag fa-large"})]),e._v(" "),t("div",{staticClass:"media-body sr-tag"},[t("div",{staticClass:"sr-tag-name",class:{compact:a.name&&a.name.length>26}},[e._v("\n\t\t\t\t\t\t\t\t\t\t\t#"+e._s(a.name)+"\n\t\t\t\t\t\t\t\t\t\t")]),e._v(" "),a.count&&a.count>100?t("div",{staticClass:"sr-tag-count"},[e._v("\n\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.formatCount(a.count))+" "+e._s(1==a.count?"Post":"Posts")+"\n\t\t\t\t\t\t\t\t\t\t")]):e._e()])]):"status"===a.s_type?t("div",{staticClass:"media align-items-center my-0"},[t("img",{staticClass:"sr-avatar",staticStyle:{"border-radius":"40px"},attrs:{src:a.account.avatar,width:"40",height:"40",onerror:"this.src='/storage/avatars/default.png?v=0';this.onerror=null;"}}),e._v(" "),t("div",{staticClass:"media-body sr-post"},[t("div",{staticClass:"sr-post-acct",class:{compact:a.acct&&a.acct.length>26}},[e._v("\n\t\t\t\t\t\t\t\t\t\t\t@"+e._s(e.truncate(a.account.acct,20))+"\n\t\t\t\t\t\t\t\t\t\t\t"),a.locked?t("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.html",modifiers:{html:!0}}],staticClass:"p-0",attrs:{title:"Private Account",variant:"link",size:"sm"}},[t("i",{staticClass:"far fa-lock fa-sm text-lighter ml-1"})]):e._e()],1),e._v(" "),t("div",{staticClass:"sr-post-action"},[t("div",{staticClass:"sr-post-action-timestamp"},[t("i",{staticClass:"far fa-clock fa-sm"}),e._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.timeAgo(a.created_at))+"\n\t\t\t\t\t\t\t\t\t\t\t")]),e._v(" "),t("div",[e._v("·")]),e._v(" "),t("div",{staticClass:"sr-post-action-label"},[e._v("\n\t\t\t\t\t\t\t\t\t\t\t\tTap to view post\n\t\t\t\t\t\t\t\t\t\t\t")])])])]):e._e()])]}}])})],1),e._v(" "),t("div",{staticClass:"ml-auto"},[t("ul",{staticClass:"navbar-nav align-items-center"},[t("li",{staticClass:"nav-item dropdown ml-2"},[t("a",{staticClass:"nav-link dropdown-toggle",attrs:{id:"navbarDropdown",href:"#",role:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",title:"User Menu"}},[t("i",{staticClass:"d-none far fa-user fa-lg text-dark"}),e._v(" "),t("span",{staticClass:"sr-only"},[e._v("User Menu")]),e._v(" "),t("img",{staticClass:"nav-avatar rounded-circle border shadow",attrs:{src:e.user.avatar,width:"30",height:"30",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=0';"}})]),e._v(" "),t("div",{staticClass:"dropdown-menu dropdown-menu-right shadow",attrs:{"aria-labelledby":"navbarDropdown"}},[t("ul",{staticClass:"nav flex-column"},[t("li",{staticClass:"nav-item nav-icons"},[t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("router-link",{staticClass:"nav-link text-center",attrs:{to:"/i/web"}},[t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-home fa-lg"})]),e._v(" "),t("div",{staticClass:"small"},[e._v(e._s(e.$t("navmenu.homeFeed")))])]),e._v(" "),e.hasLocalTimeline?t("router-link",{staticClass:"nav-link text-center",attrs:{to:{name:"timeline",params:{scope:"local"}}}},[t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"fas fa-stream fa-lg"})]),e._v(" "),t("div",{staticClass:"small"},[e._v(e._s(e.$t("navmenu.localFeed")))])]):e._e(),e._v(" "),e.hasNetworkTimeline?t("router-link",{staticClass:"nav-link text-center",attrs:{to:{name:"timeline",params:{scope:"global"}}}},[t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-globe fa-lg"})]),e._v(" "),t("div",{staticClass:"small"},[e._v(e._s(e.$t("navmenu.globalFeed")))])]):e._e()],1)]),e._v(" "),t("li",{staticClass:"nav-item nav-icons"},[t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("router-link",{staticClass:"nav-link text-center",attrs:{to:"/i/web/discover"}},[t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-compass"})]),e._v(" "),t("div",{staticClass:"small"},[e._v(e._s(e.$t("navmenu.discover")))])]),e._v(" "),t("router-link",{staticClass:"nav-link text-center",attrs:{to:"/i/web/notifications"}},[t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-bell"})]),e._v(" "),t("div",{staticClass:"small"},[e._v("\n\t\t\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("navmenu.notifications"))+"\n\t\t\t\t\t\t\t\t\t\t\t\t")])]),e._v(" "),t("router-link",{staticClass:"nav-link text-center px-3",attrs:{to:"/i/web/profile/"+e.user.id}},[t("div",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-user"})]),e._v(" "),t("div",{staticClass:"small"},[e._v(e._s(e.$t("navmenu.profile")))])])],1),e._v(" "),t("hr",{staticClass:"mb-0",staticStyle:{"margin-top":"-5px",opacity:"0.4"}})]),e._v(" "),t("li",{staticClass:"nav-item"},[t("router-link",{staticClass:"nav-link",attrs:{to:"/i/web/compose"}},[t("span",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-plus-square"})]),e._v("\n\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("navmenu.compose"))+"\n\t\t\t\t\t\t\t\t\t\t")])],1),e._v(" "),t("li",{staticClass:"nav-item"},[t("router-link",{staticClass:"nav-link d-flex justify-content-between align-items-center",attrs:{to:"/i/web/direct"}},[t("span",[t("span",{staticClass:"icon text-lighter"},[t("i",{staticClass:"far fa-envelope"})]),e._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("navmenu.directMessages"))+"\n\t\t\t\t\t\t\t\t\t\t\t")])])],1),e._v(" "),t("li",{staticClass:"nav-item"},[t("a",{staticClass:"nav-link",attrs:{href:"/i/web"},on:{click:function(t){return t.preventDefault(),e.openUserInterfaceSettings.apply(null,arguments)}}},[e._m(0),e._v("\n\t\t\t\t\t\t\t\t\t\t\tUI Settings\n\t\t\t\t\t\t\t\t\t\t")])]),e._v(" "),e.user.is_admin?t("li",{staticClass:"nav-item"},[t("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),e._v(" "),t("a",{staticClass:"nav-link",attrs:{href:"/i/admin/dashboard"}},[e._m(1),e._v("\n\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("navmenu.admin"))+"\n\t\t\t\t\t\t\t\t\t\t")])]):e._e(),e._v(" "),t("li",{staticClass:"nav-item"},[t("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),e._v(" "),t("a",{staticClass:"nav-link",attrs:{href:"/"}},[e._m(2),e._v("\n\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("navmenu.backToPreviousDesign"))+"\n\t\t\t\t\t\t\t\t\t\t")])]),e._v(" "),t("li",{staticClass:"nav-item"},[t("hr",{staticClass:"mt-n1",staticStyle:{opacity:"0.4","margin-bottom":"0"}}),e._v(" "),t("a",{staticClass:"nav-link",attrs:{href:"/"},on:{click:function(t){return t.preventDefault(),e.logout()}}},[e._m(3),e._v("\n\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("navmenu.logout"))+"\n\t\t\t\t\t\t\t\t\t\t")])])])])])])])])]),e._v(" "),t("b-modal",{ref:"uis",attrs:{"hide-footer":"",centered:"","body-class":"p-0 ui-menu",title:"UI Settings"}},[t("div",{staticClass:"list-group list-group-flush"},[t("div",{staticClass:"list-group-item px-3"},[t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("div",[t("p",{staticClass:"font-weight-bold mb-1"},[e._v("Theme")]),e._v(" "),t("p",{staticClass:"small text-muted mb-0"})]),e._v(" "),t("div",{staticClass:"btn-group btn-group-sm"},[t("button",{staticClass:"btn",class:["system"==e.uiColorScheme?"btn-primary":"btn-outline-primary"],on:{click:function(t){return e.toggleUi("system")}}},[e._v("\n\t\t\t\t\t\t\tAuto\n\t\t\t\t\t\t")]),e._v(" "),t("button",{staticClass:"btn",class:["light"==e.uiColorScheme?"btn-primary":"btn-outline-primary"],on:{click:function(t){return e.toggleUi("light")}}},[e._v("\n\t\t\t\t\t\t\tLight mode\n\t\t\t\t\t\t")]),e._v(" "),t("button",{staticClass:"btn",class:["dark"==e.uiColorScheme?"btn-primary":"btn-outline-primary"],on:{click:function(t){return e.toggleUi("dark")}}},[e._v("\n\t\t\t\t\t\t\tDark mode\n\t\t\t\t\t\t")])])])]),e._v(" "),t("div",{staticClass:"list-group-item px-3"},[t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("div",[t("p",{staticClass:"font-weight-bold mb-1"},[e._v("Profile Layout")]),e._v(" "),t("p",{staticClass:"small text-muted mb-0"})]),e._v(" "),t("div",{staticClass:"btn-group btn-group-sm"},[t("button",{staticClass:"btn",class:["grid"==e.profileLayout?"btn-primary":"btn-outline-primary"],on:{click:function(t){return e.toggleProfileLayout("grid")}}},[e._v("\n\t\t\t\t\t\t\tGrid\n\t\t\t\t\t\t")]),e._v(" "),t("button",{staticClass:"btn",class:["masonry"==e.profileLayout?"btn-primary":"btn-outline-primary"],on:{click:function(t){return e.toggleProfileLayout("masonry")}}},[e._v("\n\t\t\t\t\t\t\tMasonry\n\t\t\t\t\t\t")]),e._v(" "),t("button",{staticClass:"btn",class:["feed"==e.profileLayout?"btn-primary":"btn-outline-primary"],on:{click:function(t){return e.toggleProfileLayout("feed")}}},[e._v("\n\t\t\t\t\t\t\tFeed\n\t\t\t\t\t\t")])])])]),e._v(" "),t("div",{staticClass:"list-group-item px-3"},[t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("div",[t("p",{staticClass:"font-weight-bold mb-0"},[e._v("Compact Media Previews")])]),e._v(" "),t("b-form-checkbox",{attrs:{switch:"",size:"lg"},model:{value:e.fixedHeight,callback:function(t){e.fixedHeight=t},expression:"fixedHeight"}})],1)]),e._v(" "),t("div",{staticClass:"list-group-item px-3"},[t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("div",[t("p",{staticClass:"font-weight-bold mb-0"},[e._v("Load Comments")])]),e._v(" "),t("b-form-checkbox",{attrs:{switch:"",size:"lg"},model:{value:e.autoloadComments,callback:function(t){e.autoloadComments=t},expression:"autoloadComments"}})],1)]),e._v(" "),t("div",{staticClass:"list-group-item px-3"},[t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("div",[t("p",{staticClass:"font-weight-bold mb-0"},[e._v("Hide Counts & Stats")])]),e._v(" "),t("b-form-checkbox",{attrs:{switch:"",size:"lg"},model:{value:e.hideCounts,callback:function(t){e.hideCounts=t},expression:"hideCounts"}})],1)])])])],1)},i=[function(){var e=this._self._c;return e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-brush"})])},function(){var e=this._self._c;return e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-tools"})])},function(){var e=this._self._c;return e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"fas fa-chevron-left"})])},function(){var e=this._self._c;return e("span",{staticClass:"icon text-lighter"},[e("i",{staticClass:"far fa-sign-out"})])}]},6426:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return t("div",[t("transition",{attrs:{name:"fade"}},[t("div",{staticClass:"card notification-card shadow-none border"},[e.loading?t("div",{staticClass:"card-body loader text-center",staticStyle:{height:"240px"}},[t("div",{staticClass:"spinner-border",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[e._v("Loading...")])])]):e._e(),e._v(" "),!e.loading&&e.notifications.length>0?t("div",{staticClass:"card-body px-0 py-0 contents",staticStyle:{height:"240px","overflow-y":"scroll"}},[e.profile.locked?t("div",{staticClass:"media align-items-center mt-n2 px-3 py-2 border-bottom border-lighter bg-light cursor-pointer",on:{click:function(t){return e.redirect("/account/follow-requests")}}},[t("div",{staticClass:"media-body font-weight-light pt-2 small d-flex align-items-center justify-content-between"},[t("p",{staticClass:"mb-0 text-lighter"},[t("i",{staticClass:"fas fa-cog text-light"})]),e._v(" "),t("p",{staticClass:"text-center pt-1 mb-1 text-dark font-weight-bold"},[t("strong",[e._v(e._s(e.followRequests&&e.followRequests.hasOwnProperty("count")?e.followRequests.count:0))]),e._v(" Follow Requests")]),e._v(" "),t("p",{staticClass:"mb-0 text-lighter"},[t("i",{staticClass:"fas fa-chevron-right"})])])]):e._e(),e._v(" "),e._l(e.notifications,(function(o,a){return e.notifications.length>0?t("div",{staticClass:"media align-items-center px-3 py-2 border-bottom border-light"},[t("img",{staticClass:"mr-2 rounded-circle",staticStyle:{border:"1px solid #ccc"},attrs:{src:o.account.avatar,alt:"",width:"32px",height:"32px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png';"}}),e._v(" "),t("div",{staticClass:"media-body font-weight-light small"},["favourite"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" liked your\n\t\t\t\t\t\t\t\t"),o.status&&o.status.hasOwnProperty("media_attachments")?t("span",[t("a",{staticClass:"font-weight-bold",attrs:{href:e.getPostUrl(o.status),id:"fvn-"+o.id}},[e._v("post")]),e._v(".\n\t\t\t\t\t\t\t\t\t"),t("b-popover",{attrs:{target:"fvn-"+o.id,title:"",triggers:"hover",placement:"top",boundary:"window"}},[t("img",{staticStyle:{"object-fit":"cover"},attrs:{src:e.notificationPreview(o),width:"100px",height:"100px"}})])],1):t("span",[t("a",{staticClass:"font-weight-bold",attrs:{href:e.getPostUrl(o.status)}},[e._v("post")]),e._v(".\n\t\t\t\t\t\t\t\t")])])]):"comment"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" commented on your\n\t\t\t\t\t\t\t\t"),o.status&&o.status.hasOwnProperty("media_attachments")?t("span",[t("a",{staticClass:"font-weight-bold",attrs:{href:e.getPostUrl(o.status),id:"fvn-"+o.id}},[e._v("post")]),e._v(".\n\t\t\t\t\t\t\t\t\t"),t("b-popover",{attrs:{target:"fvn-"+o.id,title:"",triggers:"hover",placement:"top",boundary:"window"}},[t("img",{staticStyle:{"object-fit":"cover"},attrs:{src:e.notificationPreview(o),width:"100px",height:"100px"}})])],1):t("span",[t("a",{staticClass:"font-weight-bold",attrs:{href:e.getPostUrl(o.status)}},[e._v("post")]),e._v(".\n\t\t\t\t\t\t\t\t")])])]):"group:comment"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" commented on your "),t("a",{staticClass:"font-weight-bold",attrs:{href:o.group_post_url}},[e._v("group post")]),e._v(".\n\t\t\t\t\t\t\t")])]):"story:react"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" reacted to your "),t("a",{staticClass:"font-weight-bold",attrs:{href:"/account/direct/t/"+o.account.id}},[e._v("story")]),e._v(".\n\t\t\t\t\t\t\t")])]):"story:comment"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" commented on your "),t("a",{staticClass:"font-weight-bold",attrs:{href:"/account/direct/t/"+o.account.id}},[e._v("story")]),e._v(".\n\t\t\t\t\t\t\t")])]):"mention"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" "),t("a",{staticClass:"font-weight-bold",attrs:{href:e.mentionUrl(o.status)}},[e._v("mentioned")]),e._v(" you.\n\t\t\t\t\t\t\t")])]):"follow"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" followed you.\n\t\t\t\t\t\t\t")])]):"share"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" shared your\n\t\t\t\t\t\t\t\t"),o.status&&o.status.hasOwnProperty("media_attachments")?t("span",[t("a",{staticClass:"font-weight-bold",attrs:{href:e.getPostUrl(o.status),id:"fvn-"+o.id}},[e._v("post")]),e._v(".\n\t\t\t\t\t\t\t\t\t"),t("b-popover",{attrs:{target:"fvn-"+o.id,title:"",triggers:"hover",placement:"top",boundary:"window"}},[t("img",{staticStyle:{"object-fit":"cover"},attrs:{src:e.notificationPreview(o),width:"100px",height:"100px"}})])],1):t("span",[t("a",{staticClass:"font-weight-bold",attrs:{href:e.getPostUrl(o.status)}},[e._v("post")]),e._v(".\n\t\t\t\t\t\t\t\t")])])]):"modlog"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(e.truncate(o.account.username)))]),e._v(" updated a "),t("a",{staticClass:"font-weight-bold",attrs:{href:o.modlog.url}},[e._v("modlog")]),e._v(".\n\t\t\t\t\t\t\t")])]):"tagged"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" tagged you in a "),t("a",{staticClass:"font-weight-bold",attrs:{href:o.tagged.post_url}},[e._v("post")]),e._v(".\n\t\t\t\t\t\t\t")])]):"direct"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" sent a "),t("a",{staticClass:"font-weight-bold",attrs:{href:"/account/direct/t/"+o.account.id}},[e._v("dm")]),e._v(".\n\t\t\t\t\t\t\t")])]):"group.join.approved"==o.type?t("div",[t("p",{staticClass:"my-0"},[e._v("\n\t\t\t\t\t\t\t\tYour application to join the "),t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:o.group.url,title:o.group.name}},[e._v(e._s(e.truncate(o.group.name)))]),e._v(" group was approved!\n\t\t\t\t\t\t\t")])]):"group.join.rejected"==o.type?t("div",[t("p",{staticClass:"my-0"},[e._v("\n\t\t\t\t\t\t\t\tYour application to join "),t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:o.group.url,title:o.group.name}},[e._v(e._s(e.truncate(o.group.name)))]),e._v(" was rejected.\n\t\t\t\t\t\t\t")])]):"group:invite"==o.type?t("div",[t("p",{staticClass:"my-0"},[t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.getProfileUrl(o.account),title:o.account.username}},[e._v(e._s(0==o.account.local?"@":"")+e._s(e.truncate(o.account.username)))]),e._v(" invited you to join "),t("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:o.group.url+"/invite/claim",title:o.group.name}},[e._v(e._s(o.group.name))]),e._v(".\n\t\t\t\t\t\t\t")])]):t("div",[t("p",{staticClass:"my-0"},[e._v("\n\t\t\t\t\t\t\t\tWe cannot display this notification at this time.\n\t\t\t\t\t\t\t")])])]),e._v(" "),t("div",{staticClass:"small text-muted font-weight-bold",attrs:{title:o.created_at}},[e._v(e._s(e.timeAgo(o.created_at)))])]):e._e()})),e._v(" "),e.notifications.length?t("div",[t("infinite-loading",{on:{infinite:e.infiniteNotifications}},[t("div",{staticClass:"font-weight-bold",attrs:{slot:"no-results"},slot:"no-results"}),e._v(" "),t("div",{staticClass:"font-weight-bold",attrs:{slot:"no-more"},slot:"no-more"})])],1):e._e(),e._v(" "),0==e.notifications.length?t("div",{staticClass:"text-lighter text-center py-3"},[t("p",{staticClass:"mb-0"},[t("i",{staticClass:"fas fa-inbox fa-3x"})]),e._v(" "),t("p",{staticClass:"mb-0 small font-weight-bold"},[e._v("0 Notifications!")])]):e._e()],2):e._e(),e._v(" "),e.loading||e.notifications.length?e._e():t("div",{staticClass:"card-body px-0 py-0",staticStyle:{height:"240px"}},[t("div",{staticClass:"text-lighter text-center py-3"},[t("p",{staticClass:"mb-0"},[t("i",{staticClass:"fas fa-inbox fa-3x"})]),e._v(" "),t("p",{staticClass:"mb-0 small font-weight-bold"},[e._v("No notifications yet")]),e._v(" "),e.showRefresh&&!e.attemptedRefresh?t("p",{staticClass:"mt-2 small font-weight-bold text-primary cursor-pointer",on:{click:e.refreshNotifications}},[t("i",{staticClass:"fas fa-redo"}),e._v(" Refresh")]):e._e()])])])])],1)},i=[]},81739:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return t("div",["true"!=e.modal?t("div",{staticClass:"dropdown"},[t("button",{staticClass:"btn btn-link text-dark no-caret dropdown-toggle py-0",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",title:"Post options"}},[t("span",{class:["lg"==e.size?"fas fa-ellipsis-v fa-lg text-muted":"fas fa-ellipsis-v fa-sm text-lighter"]})]),e._v(" "),t("div",{staticClass:"dropdown-menu dropdown-menu-right"},[t("a",{staticClass:"dropdown-item font-weight-bold text-decoration-none",attrs:{href:e.status.url}},[e._v("Go to post")]),e._v(" "),1==e.activeSession&&0==e.statusOwner(e.status)?t("span",[t("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:e.reportUrl(e.status)}},[e._v("Report")])]):e._e(),e._v(" "),1==e.activeSession&&1==e.statusOwner(e.status)?t("span",[t("a",{staticClass:"dropdown-item font-weight-bold text-decoration-none",on:{click:function(t){return t.preventDefault(),e.muteProfile(e.status)}}},[e._v("Mute Profile")]),e._v(" "),t("a",{staticClass:"dropdown-item font-weight-bold text-decoration-none",on:{click:function(t){return t.preventDefault(),e.blockProfile(e.status)}}},[e._v("Block Profile")])]):e._e(),e._v(" "),1==e.activeSession&&1==e.profile.is_admin?t("span",[t("div",{staticClass:"dropdown-divider"}),e._v(" "),t("a",{staticClass:"dropdown-item font-weight-bold text-danger text-decoration-none",on:{click:function(t){return e.deletePost(e.status)}}},[e._v("Delete")]),e._v(" "),t("div",{staticClass:"dropdown-divider"}),e._v(" "),t("h6",{staticClass:"dropdown-header"},[e._v("Mod Tools")]),e._v(" "),t("a",{staticClass:"dropdown-item font-weight-bold text-decoration-none",on:{click:function(t){return e.moderatePost(e.status,"autocw")}}},[t("p",{staticClass:"mb-0"},[e._v("Enforce CW")]),e._v(" "),e._m(0)]),e._v(" "),t("a",{staticClass:"dropdown-item font-weight-bold text-decoration-none",on:{click:function(t){return e.moderatePost(e.status,"noautolink")}}},[t("p",{staticClass:"mb-0"},[e._v("No Autolinking")]),e._v(" "),e._m(1)]),e._v(" "),t("a",{staticClass:"dropdown-item font-weight-bold text-decoration-none",on:{click:function(t){return e.moderatePost(e.status,"unlisted")}}},[t("p",{staticClass:"mb-0"},[e._v("Unlisted Posts")]),e._v(" "),e._m(2)]),e._v(" "),t("a",{staticClass:"dropdown-item font-weight-bold text-decoration-none",on:{click:function(t){return e.moderatePost(e.status,"disable")}}},[t("p",{staticClass:"mb-0"},[e._v("Disable Account")]),e._v(" "),e._m(3)]),e._v(" "),t("a",{staticClass:"dropdown-item font-weight-bold text-decoration-none",on:{click:function(t){return e.moderatePost(e.status,"suspend")}}},[t("p",{staticClass:"mb-0"},[e._v("Suspend Account")]),e._v(" "),e._m(4)])]):e._e()])]):e._e(),e._v(" "),"true"==e.modal?t("div",[t("span",{attrs:{"data-toggle":"modal","data-target":"#mt_pid_"+e.status.id}},[t("span",{class:["lg"==e.size?"fas fa-ellipsis-v fa-lg text-muted":"fas fa-ellipsis-v fa-sm text-lighter"]})]),e._v(" "),t("div",{staticClass:"modal",attrs:{tabindex:"-1",role:"dialog",id:"mt_pid_"+e.status.id}},[t("div",{staticClass:"modal-dialog modal-sm modal-dialog-centered",attrs:{role:"document"}},[t("div",{staticClass:"modal-content"},[t("div",{staticClass:"modal-body text-center"},[t("div",{staticClass:"list-group"},[t("a",{staticClass:"list-group-item text-dark text-decoration-none",attrs:{href:e.statusUrl(e.status)}},[e._v("Go to post")]),e._v(" "),t("a",{staticClass:"list-group-item text-dark text-decoration-none",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.hidePost(e.status)}}},[e._v("Hide")]),e._v(" "),1!=e.activeSession||e.statusOwner(e.status)?e._e():t("a",{staticClass:"list-group-item text-danger font-weight-bold text-decoration-none",attrs:{href:e.reportUrl(e.status)}},[e._v("Report")]),e._v(" "),1==e.activeSession&&1==e.statusOwner(e.status)||1==e.profile.is_admin?t("div",{staticClass:"list-group-item text-danger font-weight-bold cursor-pointer",on:{click:function(t){return t.preventDefault(),e.deletePost.apply(null,arguments)}}},[e._v("Delete")]):e._e(),e._v(" "),t("a",{staticClass:"list-group-item text-lighter text-decoration-none",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.closeModal()}}},[e._v("Close")])])])])])])]):e._e()])},i=[function(){var e=this,t=e._self._c;return t("p",{staticClass:"mb-0 small text-muted"},[e._v("Adds a CW to every post "),t("br"),e._v(" made by this account.")])},function(){var e=this,t=e._self._c;return t("p",{staticClass:"mb-0 small text-muted"},[e._v("Do not transform mentions, "),t("br"),e._v(" hashtags or urls into HTML.")])},function(){var e=this,t=e._self._c;return t("p",{staticClass:"mb-0 small text-muted"},[e._v("Removes account from "),t("br"),e._v(" public/network timelines.")])},function(){var e=this,t=e._self._c;return t("p",{staticClass:"mb-0 small text-muted"},[e._v("Temporarily disable account "),t("br"),e._v(" until next time user log in.")])},function(){var e=this,t=e._self._c;return t("p",{staticClass:"mb-0 small text-muted"},[e._v("This prevents any new interactions, "),t("br"),e._v(" without deleting existing data.")])}]},25051:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return t("div",[e.show?t("div",{staticClass:"card card-body p-0 border mt-md-4 mb-md-3 shadow-none"},[e.loading?t("div",{staticClass:"w-100 h-100 d-flex align-items-center justify-content-center"},[e._m(0)]):t("div",{staticClass:"d-flex align-items-center justify-content-start scrolly"},e._l(e.stories,(function(o,a){return t("div",{staticClass:"px-3 pt-3 text-center cursor-pointer",class:{seen:o.seen},on:{click:function(t){return e.showStory(a)}}},[t("span",{staticClass:"mb-1 ring",class:[o.seen?"not-seen":"",o.local?"":"remote"]},[t("img",{staticClass:"rounded-circle border",attrs:{src:o.avatar,width:"60",height:"60",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'"}})]),e._v(" "),t("p",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"small font-weight-bold text-truncate",class:{"text-lighter":o.seen},staticStyle:{"max-width":"69px"},attrs:{placement:"bottom",title:o.username}},[e._v("\n\t\t\t\t\t"+e._s(o.username)+"\n\t\t\t\t")])])})),0)]):e._e()])},i=[function(){var e=this._self._c;return e("div",{staticClass:"spinner-border spinner-border-sm text-lighter",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[this._v("Loading...")])])}]},77261:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return 1==e.status.sensitive?t("div",[t("details",{staticClass:"details-animated"},[t("summary",[t("p",{staticClass:"mb-0 lead font-weight-bold"},[e._v(e._s(e.status.spoiler_text?e.status.spoiler_text:"CW / NSFW / Hidden Media"))]),e._v(" "),t("p",{staticClass:"font-weight-light"},[e._v("(click to show)")])]),e._v(" "),t("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333","background-color":"#000"},attrs:{id:e.status.id+"-carousel",controls:"","img-blank":"",background:"#ffffff",interval:0}},e._l(e.status.media_attachments,(function(o,a){return t("b-carousel-slide",{key:o.id+"-media"},["video"==o.type?t("video",{staticClass:"embed-responsive-item",attrs:{slot:"img",preload:"none",controls:"",playsinline:"",loop:"",alt:o.description,width:"100%",height:"100%"},slot:"img"},[t("source",{attrs:{src:o.url,type:o.mime}})]):"image"==o.type?t("div",{attrs:{slot:"img",title:o.description},slot:"img"},[t("img",{class:o.filter_class+" d-block img-fluid w-100",attrs:{src:o.url,alt:o.description,loading:"lazy",onerror:"this.onerror=null;this.src='/storage/no-preview.png'"}})]):t("p",{staticClass:"text-center p-0 font-weight-bold text-white"},[e._v("Error: Problem rendering preview.")])])})),1)],1)]):t("div",{staticClass:"w-100 h-100 p-0"},[t("carousel",{ref:"carousel",staticClass:"p-0 m-0",attrs:{centerMode:!0,loop:!1,"per-page":1,paginationPosition:"bottom-overlay",paginationActiveColor:"#3897f0",paginationColor:"#dbdbdb"}},e._l(e.status.media_attachments,(function(o,a){return t("slide",{key:"px-carousel-"+o.id+"-"+a,staticClass:"w-100 h-100 d-block mx-auto text-center",staticStyle:{background:"#000",display:"flex","align-items":"center"}},["video"==o.type?t("video",{staticClass:"embed-responsive-item",attrs:{preload:"none",controls:"",loop:"",title:o.description,width:"100%",height:"100%"}},[t("source",{attrs:{src:o.url,type:o.mime}})]):"image"==o.type?t("div",{attrs:{title:o.description}},[t("img",{class:o.filter_class+" img-fluid w-100",attrs:{src:o.url,alt:o.description,loading:"lazy",onerror:"this.onerror=null;this.src='/storage/no-preview.png'"}})]):t("p",{staticClass:"text-center p-0 font-weight-bold text-white"},[e._v("Error: Problem rendering preview.")])])})),1)],1)},i=[]},9129:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return 1==e.status.sensitive?t("div",{staticClass:"content-label-wrapper"},[t("div",{staticClass:"text-light content-label"},[e._m(0),e._v(" "),t("p",{staticClass:"h4 font-weight-bold text-center"},[e._v("\n\t\t\tSensitive Content\n\t\t")]),e._v(" "),t("p",{staticClass:"text-center py-2 content-label-text"},[e._v("\n\t\t\t"+e._s(e.status.spoiler_text?e.status.spoiler_text:"This album may contain sensitive content.")+"\n\t\t")]),e._v(" "),t("p",{staticClass:"mb-0"},[t("button",{staticClass:"btn btn-outline-light btn-block btn-sm font-weight-bold",on:{click:function(t){return e.toggleContentWarning()}}},[e._v("See Post")])])]),e._v(" "),t("blur-hash-image",{attrs:{width:"32",height:"32",punch:1,hash:e.status.media_attachments[0].blurhash,alt:e.altText(e.status)}})],1):t("div",{staticClass:"w-100 h-100 p-0 album-wrapper"},[t("carousel",{ref:"carousel",staticClass:"p-0 m-0",attrs:{centerMode:!0,loop:!1,"per-page":1,paginationPosition:"bottom-overlay",paginationActiveColor:"#3897f0",paginationColor:"#dbdbdb",id:"carousel-"+e.status.id}},e._l(e.status.media_attachments,(function(o,a){return t("slide",{key:"px-carousel-"+o.id+"-"+a,staticStyle:{background:"#000",display:"flex","align-items":"center"},attrs:{title:o.description}},[t("img",{staticClass:"img-fluid w-100 p-0",attrs:{src:o.url,alt:e.altText(o),loading:"lazy","data-bp":o.url,onerror:"this.onerror=null;this.src='/storage/no-preview.png'"}})])})),1),e._v(" "),t("div",{staticClass:"album-overlay"},[!e.status.sensitive&&e.sensitive?t("p",{staticStyle:{"margin-top":"0",padding:"10px",color:"#fff","font-size":"10px","text-align":"right",position:"absolute",top:"0",right:"0","border-top-left-radius":"5px",cursor:"pointer",background:"linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.5))"},on:{click:function(t){e.status.sensitive=!0}}},[t("i",{staticClass:"fas fa-eye-slash fa-lg"})]):e._e(),e._v(" "),t("p",{staticStyle:{"margin-top":"0",padding:"10px",color:"#fff","font-size":"10px","text-align":"right",position:"absolute",left:"0",top:"0","border-bottom-right-radius":"5px",cursor:"pointer",background:"linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.5))"},on:{click:function(t){return t.preventDefault(),e.toggleLightbox.apply(null,arguments)}}},[t("i",{staticClass:"fas fa-expand fa-lg"})]),e._v(" "),e.status.media_attachments[0].license?t("p",{staticStyle:{"margin-bottom":"0",padding:"0 5px",color:"#fff","font-size":"10px","text-align":"right",position:"absolute",bottom:"0",right:"0","border-top-left-radius":"5px",background:"linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.5))"}},[t("a",{staticClass:"font-weight-bold text-light",attrs:{href:e.status.url}},[e._v("Photo")]),e._v(" by "),t("a",{staticClass:"font-weight-bold text-light",attrs:{href:e.status.account.url}},[e._v("@"+e._s(e.status.account.username))]),e._v(" licensed under "),t("a",{staticClass:"font-weight-bold text-light",attrs:{href:e.status.media_attachments[0].license.url}},[e._v(e._s(e.status.media_attachments[0].license.title))])]):e._e()])],1)},i=[function(){var e=this._self._c;return e("p",{staticClass:"text-center"},[e("i",{staticClass:"far fa-eye-slash fa-2x"})])}]},67619:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return 1==e.status.sensitive?t("div",{staticClass:"content-label-wrapper"},[t("div",{staticClass:"text-light content-label"},[e._m(0),e._v(" "),t("p",{staticClass:"h4 font-weight-bold text-center"},[e._v("\n\t\t\tSensitive Content\n\t\t")]),e._v(" "),t("p",{staticClass:"text-center py-2 content-label-text"},[e._v("\n\t\t\t"+e._s(e.status.spoiler_text?e.status.spoiler_text:"This post may contain sensitive content.")+"\n\t\t")]),e._v(" "),t("p",{staticClass:"mb-0"},[t("button",{staticClass:"btn btn-outline-light btn-block btn-sm font-weight-bold",on:{click:function(t){return e.toggleContentWarning()}}},[e._v("See Post")])])]),e._v(" "),t("blur-hash-image",{attrs:{width:"32",height:"32",punch:1,hash:e.status.media_attachments[0].blurhash,alt:e.altText(e.status)}})],1):t("div",[t("div",{staticStyle:{position:"relative"},attrs:{title:e.status.media_attachments[0].description}},[t("img",{staticClass:"card-img-top",attrs:{src:e.status.media_attachments[0].url,loading:"lazy",alt:e.altText(e.status),width:e.width(),height:e.height(),onerror:"this.onerror=null;this.src='/storage/no-preview.png'"},on:{click:function(t){return t.preventDefault(),e.toggleLightbox.apply(null,arguments)}}}),e._v(" "),!e.status.sensitive&&e.sensitive?t("p",{staticStyle:{"margin-top":"0",padding:"10px",color:"#fff","font-size":"10px","text-align":"right",position:"absolute",top:"0",right:"0","border-top-left-radius":"5px",cursor:"pointer",background:"linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.5))"},on:{click:function(t){e.status.sensitive=!0}}},[t("i",{staticClass:"fas fa-eye-slash fa-lg"})]):e._e(),e._v(" "),e.status.media_attachments[0].license?t("p",{staticStyle:{"margin-bottom":"0",padding:"0 5px",color:"#fff","font-size":"10px","text-align":"right",position:"absolute",bottom:"0",right:"0","border-top-left-radius":"5px",background:"linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.5))"}},[t("a",{staticClass:"font-weight-bold text-light",attrs:{href:e.status.url}},[e._v("Photo")]),e._v(" by "),t("a",{staticClass:"font-weight-bold text-light",attrs:{href:e.status.account.url}},[e._v("@"+e._s(e.status.account.username))]),e._v(" licensed under "),t("a",{staticClass:"font-weight-bold text-light",attrs:{href:e.status.media_attachments[0].license.url}},[e._v(e._s(e.status.media_attachments[0].license.title))])]):e._e()])])},i=[function(){var e=this._self._c;return e("p",{staticClass:"text-center"},[e("i",{staticClass:"far fa-eye-slash fa-2x"})])}]},10304:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return 1==e.status.sensitive?t("div",[t("details",{staticClass:"details-animated"},[t("summary",[t("p",{staticClass:"mb-0 lead font-weight-bold"},[e._v(e._s(e.status.spoiler_text?e.status.spoiler_text:"CW / NSFW / Hidden Media"))]),e._v(" "),t("p",{staticClass:"font-weight-light"},[e._v("(click to show)")])]),e._v(" "),t("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333","background-color":"#000"},attrs:{id:e.status.id+"-carousel",controls:"","img-blank":"",background:"#ffffff",interval:0}},e._l(e.status.media_attachments,(function(e,o){return t("b-carousel-slide",{key:e.id+"-media"},[t("video",{staticClass:"embed-responsive-item",attrs:{slot:"img",preload:"none",controls:"",playsinline:"",loop:"",alt:e.description,width:"100%",height:"100%"},slot:"img"},[t("source",{attrs:{src:e.url,type:e.mime}})])])})),1)],1)]):t("div",[t("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333","background-color":"#000"},attrs:{id:e.status.id+"-carousel",controls:"","img-blank":"",background:"#ffffff",interval:0}},e._l(e.status.media_attachments,(function(e,o){return t("b-carousel-slide",{key:e.id+"-media"},[t("video",{staticClass:"embed-responsive-item",attrs:{slot:"img",preload:"none",controls:"",playsinline:"",loop:"",alt:e.description,width:"100%",height:"100%"},slot:"img"},[t("source",{attrs:{src:e.url,type:e.mime}})])])})),1)],1)},i=[]},14932:(e,t,o)=>{"use strict";o.r(t),o.d(t,{render:()=>a,staticRenderFns:()=>i});var a=function(){var e=this,t=e._self._c;return 1==e.status.sensitive?t("div",{staticClass:"content-label-wrapper"},[t("div",{staticClass:"text-light content-label"},[e._m(0),e._v(" "),t("p",{staticClass:"h4 font-weight-bold text-center"},[e._v("\n\t\t\tSensitive Content\n\t\t")]),e._v(" "),t("p",{staticClass:"text-center py-2 content-label-text"},[e._v("\n\t\t\t"+e._s(e.status.spoiler_text?e.status.spoiler_text:"This post may contain sensitive content.")+"\n\t\t")]),e._v(" "),t("p",{staticClass:"mb-0"},[t("button",{staticClass:"btn btn-outline-light btn-block btn-sm font-weight-bold",on:{click:function(t){return e.toggleContentWarning()}}},[e._v("See Post")])])]),e._v(" "),t("blur-hash-image",{attrs:{width:"32",height:"32",punch:1,hash:e.status.media_attachments[0].blurhash,alt:e.altText(e.status)}})],1):t("div",{staticClass:"embed-responsive embed-responsive-16by9"},[t("video",{staticClass:"video",attrs:{controls:"",playsinline:"",preload:"metadata",loop:"","data-id":e.status.id,poster:e.poster()}},[t("source",{attrs:{src:e.status.media_attachments[0].url,type:e.status.media_attachments[0].mime}})])])},i=[function(){var e=this._self._c;return e("p",{staticClass:"text-center"},[e("i",{staticClass:"far fa-eye-slash fa-2x"})])}]},9901:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}!function(){var t="object"===("undefined"==typeof window?"undefined":e(window))?window:"object"===("undefined"==typeof self?"undefined":e(self))?self:this,o=t.BlobBuilder||t.WebKitBlobBuilder||t.MSBlobBuilder||t.MozBlobBuilder;t.URL=t.URL||t.webkitURL||function(e,t){return(t=document.createElement("a")).href=e,t};var a=t.Blob,i=URL.createObjectURL,s=URL.revokeObjectURL,n=t.Symbol&&t.Symbol.toStringTag,r=!1,c=!1,d=!!t.ArrayBuffer,u=o&&o.prototype.append&&o.prototype.getBlob;try{r=2===new Blob(["ä"]).size,c=2===new Blob([new Uint8Array([1,2])]).size}catch(e){}function m(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var o=new Uint8Array(e.byteLength);o.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=o.buffer}return t}return e}))}function p(e,t){t=t||{};var a=new o;return m(e).forEach((function(e){a.append(e)})),t.type?a.getBlob(t.type):a.getBlob()}function f(e,t){return new a(m(e),t||{})}t.Blob&&(p.prototype=Blob.prototype,f.prototype=Blob.prototype);var h="function"==typeof TextEncoder?TextEncoder.prototype.encode.bind(new TextEncoder):function(e){for(var o=0,a=e.length,i=t.Uint8Array||Array,s=0,n=Math.max(32,a+(a>>1)+7),r=new i(n>>3<<3);o=55296&&l<=56319){if(o=55296&&l<=56319)continue}if(s+4>r.length){n+=8,n=(n*=1+o/e.length*2)>>3<<3;var d=new Uint8Array(n);d.set(r),r=d}if(0!=(4294967168&l)){if(0==(4294965248&l))r[s++]=l>>6&31|192;else if(0==(4294901760&l))r[s++]=l>>12&15|224,r[s++]=l>>6&63|128;else{if(0!=(4292870144&l))continue;r[s++]=l>>18&7|240,r[s++]=l>>12&63|128,r[s++]=l>>6&63|128}r[s++]=63&l|128}else r[s++]=l}return r.slice(0,s)},g="function"==typeof TextDecoder?TextDecoder.prototype.decode.bind(new TextDecoder):function(e){for(var t=e.length,o=[],a=0;a239?4:l>223?3:l>191?2:1;if(a+d<=t)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[a+1]))&&(r=(31&l)<<6|63&i)>127&&(c=r);break;case 3:i=e[a+1],s=e[a+2],128==(192&i)&&128==(192&s)&&(r=(15&l)<<12|(63&i)<<6|63&s)>2047&&(r<55296||r>57343)&&(c=r);break;case 4:i=e[a+1],s=e[a+2],n=e[a+3],128==(192&i)&&128==(192&s)&&128==(192&n)&&(r=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&n)>65535&&r<1114112&&(c=r)}null===c?(c=65533,d=1):c>65535&&(c-=65536,o.push(c>>>10&1023|55296),c=56320|1023&c),o.push(c),a+=d}var u=o.length,m="";for(a=0;a>2,d=(3&i)<<4|n>>4,u=(15&n)<<2|l>>6,m=63&l;r||(m=64,s||(u=64)),o.push(t[c],t[d],t[u],t[m])}return o.join("")}var a=Object.create||function(e){function t(){}return t.prototype=e,new t};if(d)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function c(o,a){a=null==a?{}:a;for(var i=0,s=(o=o||[]).length;i=t.size&&o.close()}))}})}}catch(e){try{new ReadableStream({}),b=function(e){var t=0;e=this;return new ReadableStream({pull:function(o){return e.slice(t,t+524288).arrayBuffer().then((function(a){t+=a.byteLength;var i=new Uint8Array(a);o.enqueue(i),t==e.size&&o.close()}))}})}}catch(e){try{new Response("").body.getReader().read(),b=function(){return new Response(this).body}}catch(e){b=function(){throw new Error("Include https://github.com/MattiasBuelens/web-streams-polyfill")}}}}w.arrayBuffer||(w.arrayBuffer=function(){var e=new FileReader;return e.readAsArrayBuffer(this),y(e)}),w.text||(w.text=function(){var e=new FileReader;return e.readAsText(this),y(e)}),w.stream||(w.stream=b)}(),function(e){"use strict";var t,o=e.Uint8Array,a=e.HTMLCanvasElement,i=a&&a.prototype,s=/\s*;\s*base64\s*(?:;|$)/i,n="toDataURL",r=function(e){for(var a,i,s=e.length,n=new o(s/4*3|0),r=0,l=0,c=[0,0],d=0,u=0;s--;)i=e.charCodeAt(r++),255!==(a=t[i-43])&&undefined!==a&&(c[1]=c[0],c[0]=i,u=u<<6|a,4===++d&&(n[l++]=u>>>16,61!==c[1]&&(n[l++]=u>>>8),61!==c[0]&&(n[l++]=u),d=0));return n};o&&(t=new o([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])),!a||i.toBlob&&i.toBlobHD||(i.toBlob||(i.toBlob=function(e,t){if(t||(t="image/png"),this.mozGetAsFile)e(this.mozGetAsFile("canvas",t));else if(this.msToBlob&&/^\s*image\/png\s*(?:$|;)/i.test(t))e(this.msToBlob());else{var a,i=Array.prototype.slice.call(arguments,1),l=this[n].apply(this,i),c=l.indexOf(","),d=l.substring(c+1),u=s.test(l.substring(0,c));Blob.fake?((a=new Blob).encoding=u?"base64":"URI",a.data=d,a.size=d.length):o&&(a=u?new Blob([r(d)],{type:t}):new Blob([decodeURIComponent(d)],{type:t})),e(a)}}),!i.toBlobHD&&i.toDataURLHD?i.toBlobHD=function(){n="toDataURLHD";var e=this.toBlob();return n="toDataURL",e}:i.toBlobHD=i.toBlob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this)},33258:(e,t,o)=>{"use strict";o.r(t);var a=o(62893),i=o(40173),s=o(95353),n=o(58723),r=o(63288),l=o(32252),c=o.n(l),d=o(65201),u=o.n(d),m=o(24786),p=o(57742),f=o.n(p),h=o(89829),g=o.n(h),v=o(58942),b=o(64765),w=(o(34352),o(80158),o(74692),o(74692));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}o(9901),window.Vue=a.default,window.pftxt=o(93934),window.filesize=o(91139),window._=o(2543),window.Popper=o(48851).default,window.pixelfed=window.pixelfed||{},window.$=o(74692),o(52754),window.axios=o(86425),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",o(63899),window.blurhash=o(95341),w('[data-toggle="tooltip"]').tooltip();var C=document.head.querySelector('meta[name="csrf-token"]');C?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=C.content:console.error("CSRF token not found."),a.default.use(i.default),a.default.use(s.default),a.default.use(g()),a.default.use(f()),a.default.use(r.default),a.default.use(c()),a.default.use(u()),a.default.use(v.default),a.default.use(b.default),a.default.use(m.default,{name:"Timeago",locale:"en"}),a.default.component("navbar",o(11838).default),a.default.component("notification-card",o(50592).default),a.default.component("photo-presenter",o(20384).default),a.default.component("video-presenter",o(74027).default),a.default.component("photo-album-presenter",o(53099).default),a.default.component("video-album-presenter",o(62630).default),a.default.component("mixed-album-presenter",o(41378).default),a.default.component("post-menu",o(60072).default),a.default.component("story-component",o(98916).default);var k=function(){return Promise.all([o.e(3660),o.e(4951)]).then(o.bind(o,75050))},x=new i.default({mode:"history",linkActiveClass:"active",routes:[{path:"/i/web/timeline/:scope",name:"timeline",component:k,props:!0},{path:"/i/web/post/:id",name:"post",component:function(){return Promise.all([o.e(3660),o.e(8408)]).then(o.bind(o,19833))},props:!0},{path:"/i/web/profile/:id/followers",name:"profile-followers",component:function(){return Promise.all([o.e(3660),o.e(8977)]).then(o.bind(o,8755))},props:!0},{path:"/i/web/profile/:id/following",name:"profile-following",component:function(){return Promise.all([o.e(3660),o.e(1645)]).then(o.bind(o,10935))},props:!0},{path:"/i/web/profile/:id",name:"profile",component:function(){return Promise.all([o.e(3660),o.e(8087)]).then(o.bind(o,85566))},props:!0},{path:"/i/web/discover",component:function(){return Promise.all([o.e(3660),o.e(6535)]).then(o.bind(o,57330))}},{path:"/i/web/compose",component:function(){return Promise.all([o.e(3660),o.e(9124)]).then(o.bind(o,46537))}},{path:"/i/web/notifications",component:function(){return Promise.all([o.e(3660),o.e(7744)]).then(o.bind(o,55297))}},{path:"/i/web/direct/thread/:accountId",component:function(){return Promise.all([o.e(3660),o.e(7399)]).then(o.bind(o,95301))},props:!0},{path:"/i/web/direct",component:function(){return Promise.all([o.e(3660),o.e(2156)]).then(o.bind(o,61040))}},{path:"/i/web/hashtag/:id",name:"hashtag",component:function(){return Promise.all([o.e(3660),o.e(2966)]).then(o.bind(o,917))},props:!0},{path:"/i/web/language",component:function(){return o.e(8119).then(o.bind(o,55545))}},{path:"/i/web/whats-new",component:function(){return o.e(9919).then(o.bind(o,97775))}},{path:"/i/web/discover/my-memories",component:function(){return Promise.all([o.e(3660),o.e(6740)]).then(o.bind(o,82212))}},{path:"/i/web/discover/my-hashtags",component:function(){return Promise.all([o.e(3660),o.e(1240)]).then(o.bind(o,57326))}},{path:"/i/web/discover/account-insights",component:function(){return Promise.all([o.e(3660),o.e(1179)]).then(o.bind(o,71610))}},{path:"/i/web/discover/find-friends",component:function(){return Promise.all([o.e(3660),o.e(7521)]).then(o.bind(o,96663))}},{path:"/i/web/discover/server-timelines",component:function(){return Promise.all([o.e(3660),o.e(3688)]).then(o.bind(o,55232))}},{path:"/i/web/discover/settings",component:function(){return Promise.all([o.e(3660),o.e(6250)]).then(o.bind(o,75658))}},{path:"/i/web",component:k,props:!0},{path:"/i/web/*",component:function(){return o.e(7413).then(o.bind(o,13978))},props:!0}],scrollBehavior:function(e,t,o){return e.hash?{selector:"[id='".concat(e.hash.slice(1),"']")}:{x:0,y:0}}});function S(e,t){var o="pf_m2s."+e,a=window.localStorage;if(a.getItem(o)){var i=a.getItem(o);return["pl","color-scheme"].includes(e)?i:["true",!0].includes(i)}return t}var _=new s.default.Store({state:{version:1,hideCounts:S("hc",!1),autoloadComments:S("ac",!0),newReactions:S("nr",!0),fixedHeight:S("fh",!1),profileLayout:S("pl","grid"),showDMPrivacyWarning:S("dmpwarn",!0),relationships:{},emoji:[],colorScheme:S("color-scheme","system")},getters:{getVersion:function(e){return e.version},getHideCounts:function(e){return e.hideCounts},getAutoloadComments:function(e){return e.autoloadComments},getNewReactions:function(e){return e.newReactions},getFixedHeight:function(e){return e.fixedHeight},getProfileLayout:function(e){return e.profileLayout},getRelationship:function(e){return function(t){return e.relationships[t]}},getCustomEmoji:function(e){return e.emoji},getColorScheme:function(e){return e.colorScheme},getShowDMPrivacyWarning:function(e){return e.showDMPrivacyWarning}},mutations:{setVersion:function(e,t){e.version=t},setHideCounts:function(e,t){localStorage.setItem("pf_m2s.hc",t),e.hideCounts=t},setAutoloadComments:function(e,t){localStorage.setItem("pf_m2s.ac",t),e.autoloadComments=t},setNewReactions:function(e,t){localStorage.setItem("pf_m2s.nr",t),e.newReactions=t},setFixedHeight:function(e,t){localStorage.setItem("pf_m2s.fh",t),e.fixedHeight=t},setProfileLayout:function(e,t){localStorage.setItem("pf_m2s.pl",t),e.profileLayout=t},updateRelationship:function(e,t){t.forEach((function(t){a.default.set(e.relationships,t.id,t)}))},updateCustomEmoji:function(e,t){e.emoji=t},setColorScheme:function(e,t){if(e.colorScheme!=t){localStorage.setItem("pf_m2s.color-scheme",t),e.colorScheme=t;var o="system"==t?"":"light"==t?"force-light-mode":"force-dark-mode";if(document.querySelector("body").className=o,"system"!=o){var a="force-dark-mode"==o?{dark_mode:"on"}:{};axios.post("/settings/labs",a)}}},setShowDMPrivacyWarning:function(e,t){localStorage.setItem("pf_m2s.dmpwarn",t),e.showDMPrivacyWarning=t}}}),A={en:o(57048),ar:o(60224),ca:o(89023),de:o(89996),el:o(25098),es:o(31583),eu:o(48973),fr:o(15883),he:o(61344),gd:o(12900),gl:o(34860),id:o(91302),it:o(52950),ja:o(87286),nl:o(66849),pl:o(70707),pt:o(85147),ru:o(20466),uk:o(44215),vi:o(97346)},P=document.querySelector("html").getAttribute("lang"),z=new b.default({locale:P,fallbackLocale:"en",messages:A});(0,n.sync)(_,x);new a.default({el:"#content",i18n:z,router:x,store:_});if(axios.get("/api/v1/custom_emojis").then((function(e){e&&e.data&&e.data.length&&_.commit("updateCustomEmoji",e.data)})),_.state.colorScheme){var M="system"==_.state.colorScheme?"":"light"==_.state.colorScheme?"force-light-mode":"force-dark-mode";"system"!=M&&(document.querySelector("body").className=M)}pixelfed.readmore=function(){w(".read-more").each((function(e,t){var o=w(this),a=o.attr("data-readmore");"undefined"!==y(a)&&!1!==a||o.readmore({collapsedHeight:45,heightMargin:48,moreLink:'Show more',lessLink:'Show less'})}))};try{document.createEvent("TouchEvent"),w("body").addClass("touch")}catch(e){}window.App=window.App||{},window.App.util={compose:{post:function(){var e=window.location.pathname;["/","/timeline/public"].includes(e)?w("#composeModal").modal("show"):window.location.href="/?a=co"},circle:function(){console.log("Unsupported method.")},collection:function(){console.log("Unsupported method.")},loop:function(){console.log("Unsupported method.")},story:function(){console.log("Unsupported method.")}},time:function(){return new Date},version:1,format:{count:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-GB",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compact";return e<1?0:new Intl.NumberFormat(t,{notation:o,compactDisplay:"short"}).format(e)},timeAgo:function(e){var t=Date.parse(e),o=Math.floor((new Date-t)/1e3),a=Math.floor(o/63072e3);return a<0?"0s":a>=1?a+"y":(a=Math.floor(o/604800))>=1?a+"w":(a=Math.floor(o/86400))>=1?a+"d":(a=Math.floor(o/3600))>=1?a+"h":(a=Math.floor(o/60))>=1?a+"m":Math.floor(o)+"s"},timeAhead:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=Date.parse(e)-Date.parse(new Date),a=Math.floor(o/1e3),i=Math.floor(a/63072e3);return i>=1?i+(t?"y":" years"):(i=Math.floor(a/604800))>=1?i+(t?"w":" weeks"):(i=Math.floor(a/86400))>=1?i+(t?"d":" days"):(i=Math.floor(a/3600))>=1?i+(t?"h":" hours"):(i=Math.floor(a/60))>=1?i+(t?"m":" minutes"):Math.floor(a)+(t?"s":" seconds")},rewriteLinks:function(e){var t=e.innerText;return e.href.startsWith(window.location.origin)?e.href:t=1==t.startsWith("#")?"/discover/tags/"+t.substr(1)+"?src=rph":1==t.startsWith("@")?"/"+e.innerText+"?src=rpp":"/i/redirect?url="+encodeURIComponent(t)}},filters:[["1984","filter-1977"],["Azen","filter-aden"],["Astairo","filter-amaro"],["Grassbee","filter-ashby"],["Bookrun","filter-brannan"],["Borough","filter-brooklyn"],["Farms","filter-charmes"],["Hairsadone","filter-clarendon"],["Cleana ","filter-crema"],["Catpatch","filter-dogpatch"],["Earlyworm","filter-earlybird"],["Plaid","filter-gingham"],["Kyo","filter-ginza"],["Yefe","filter-hefe"],["Goddess","filter-helena"],["Yards","filter-hudson"],["Quill","filter-inkwell"],["Rankine","filter-kelvin"],["Juno","filter-juno"],["Mark","filter-lark"],["Chill","filter-lofi"],["Van","filter-ludwig"],["Apache","filter-maven"],["May","filter-mayfair"],["Ceres","filter-moon"],["Knoxville","filter-nashville"],["Felicity","filter-perpetua"],["Sandblast","filter-poprocket"],["Daisy","filter-reyes"],["Elevate","filter-rise"],["Nevada","filter-sierra"],["Futura","filter-skyline"],["Sleepy","filter-slumber"],["Steward","filter-stinson"],["Savoy","filter-sutro"],["Blaze","filter-toaster"],["Apricot","filter-valencia"],["Gloming","filter-vesper"],["Walter","filter-walden"],["Poplar","filter-willow"],["Xenon","filter-xpro-ii"]],filterCss:{"filter-1977":"sepia(.5) hue-rotate(-30deg) saturate(1.4)","filter-aden":"sepia(.2) brightness(1.15) saturate(1.4)","filter-amaro":"sepia(.35) contrast(1.1) brightness(1.2) saturate(1.3)","filter-ashby":"sepia(.5) contrast(1.2) saturate(1.8)","filter-brannan":"sepia(.4) contrast(1.25) brightness(1.1) saturate(.9) hue-rotate(-2deg)","filter-brooklyn":"sepia(.25) contrast(1.25) brightness(1.25) hue-rotate(5deg)","filter-charmes":"sepia(.25) contrast(1.25) brightness(1.25) saturate(1.35) hue-rotate(-5deg)","filter-clarendon":"sepia(.15) contrast(1.25) brightness(1.25) hue-rotate(5deg)","filter-crema":"sepia(.5) contrast(1.25) brightness(1.15) saturate(.9) hue-rotate(-2deg)","filter-dogpatch":"sepia(.35) saturate(1.1) contrast(1.5)","filter-earlybird":"sepia(.25) contrast(1.25) brightness(1.15) saturate(.9) hue-rotate(-5deg)","filter-gingham":"contrast(1.1) brightness(1.1)","filter-ginza":"sepia(.25) contrast(1.15) brightness(1.2) saturate(1.35) hue-rotate(-5deg)","filter-hefe":"sepia(.4) contrast(1.5) brightness(1.2) saturate(1.4) hue-rotate(-10deg)","filter-helena":"sepia(.5) contrast(1.05) brightness(1.05) saturate(1.35)","filter-hudson":"sepia(.25) contrast(1.2) brightness(1.2) saturate(1.05) hue-rotate(-15deg)","filter-inkwell":"brightness(1.25) contrast(.85) grayscale(1)","filter-kelvin":"sepia(.15) contrast(1.5) brightness(1.1) hue-rotate(-10deg)","filter-juno":"sepia(.35) contrast(1.15) brightness(1.15) saturate(1.8)","filter-lark":"sepia(.25) contrast(1.2) brightness(1.3) saturate(1.25)","filter-lofi":"saturate(1.1) contrast(1.5)","filter-ludwig":"sepia(.25) contrast(1.05) brightness(1.05) saturate(2)","filter-maven":"sepia(.35) contrast(1.05) brightness(1.05) saturate(1.75)","filter-mayfair":"contrast(1.1) brightness(1.15) saturate(1.1)","filter-moon":"brightness(1.4) contrast(.95) saturate(0) sepia(.35)","filter-nashville":"sepia(.25) contrast(1.5) brightness(.9) hue-rotate(-15deg)","filter-perpetua":"contrast(1.1) brightness(1.25) saturate(1.1)","filter-poprocket":"sepia(.15) brightness(1.2)","filter-reyes":"sepia(.75) contrast(.75) brightness(1.25) saturate(1.4)","filter-rise":"sepia(.25) contrast(1.25) brightness(1.2) saturate(.9)","filter-sierra":"sepia(.25) contrast(1.5) brightness(.9) hue-rotate(-15deg)","filter-skyline":"sepia(.15) contrast(1.25) brightness(1.25) saturate(1.2)","filter-slumber":"sepia(.35) contrast(1.25) saturate(1.25)","filter-stinson":"sepia(.35) contrast(1.25) brightness(1.1) saturate(1.25)","filter-sutro":"sepia(.4) contrast(1.2) brightness(.9) saturate(1.4) hue-rotate(-10deg)","filter-toaster":"sepia(.25) contrast(1.5) brightness(.95) hue-rotate(-15deg)","filter-valencia":"sepia(.25) contrast(1.1) brightness(1.1)","filter-vesper":"sepia(.35) contrast(1.15) brightness(1.2) saturate(1.3)","filter-walden":"sepia(.35) contrast(.8) brightness(1.25) saturate(1.4)","filter-willow":"brightness(1.2) contrast(.85) saturate(.05) sepia(.2)","filter-xpro-ii":"sepia(.45) contrast(1.25) brightness(1.75) saturate(1.3) hue-rotate(-5deg)"},emoji:["😂","💯","❤️","🙌","👏","👌","😍","😯","😢","😅","😁","🙂","😎","😀","🤣","😃","😄","😆","😉","😊","😋","😘","😗","😙","😚","🤗","🤩","🤔","🤨","😐","😑","😶","🙄","😏","😣","😥","😮","🤐","😪","😫","😴","😌","😛","😜","😝","🤤","😒","😓","😔","😕","🙃","🤑","😲","🙁","😖","😞","😟","😤","😭","😦","😧","😨","😩","🤯","😬","😰","😱","😳","🤪","😵","😡","😠","🤬","😷","🤒","🤕","🤢","🤮","🤧","😇","🤠","🤡","🤥","🤫","🤭","🧐","🤓","😈","👿","👹","👺","💀","👻","👽","🤖","💩","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🤲","👐","🤝","👍","👎","👊","✊","🤛","🤜","🤞","✌️","🤟","🤘","👈","👉","👆","👇","☝️","✋","🤚","🖐","🖖","👋","🤙","💪","🖕","✍️","🙏","💍","💄","💋","👄","👅","👂","👃","👣","👁","👀","🧠","🗣","👤","👥"],embed:{post:function(e){var t=e+"/embed?";return t+=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?"caption=true&":"caption=false&",t+=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"likes=true&":"likes=false&",'