text
stringlengths 3
1.05M
|
|---|
import os
import time
from core import execute
from core import slack
from core import utils
class DirBrute(object):
"""docstring for DirbBrute"""
def __init__(self, options):
utils.print_banner("Scanning Directory")
utils.make_directory(options['WORKSPACE'] + '/directory')
utils.make_directory(options['WORKSPACE'] + '/directory/quick')
utils.make_directory(options['WORKSPACE'] + '/directory/full')
self.module_name = self.__class__.__name__
self.options = options
self.options['CURRENT_MODULE'] = self.module_name
self.options['SPEED'] = utils.custom_speed(self.options)
if utils.resume(self.options, self.module_name):
utils.print_info("It's already done. use '-f' options to force rerun the module")
return
self.is_direct = utils.is_direct_mode(options, require_input=True)
slack.slack_noti('status', self.options, mess={
'title': "{0} | {1}".format(self.options['TARGET'], self.module_name),
'content': 'Start Scanning Directory for {0}'.format(self.options['TARGET'])
})
self.initial()
slack.slack_noti('good', self.options, mess={
'title': "{0} | {1}".format(self.options['TARGET'], self.module_name),
'content': 'Start Scanning Directory for {0}'.format(self.options['TARGET'])
})
utils.print_line()
def initial(self):
domains = self.prepare_input()
self.dirb_all(domains)
self.parsing_ouput()
self.screenshots()
def prepare_input(self):
if self.is_direct:
# if direct input was file just read it
if utils.not_empty_file(self.is_direct):
domains = utils.just_read(self.is_direct).splitlines()
# get input string
else:
domains = [self.is_direct.strip()]
else:
# matching IP with subdomain
main_json = utils.reading_json(utils.replace_argument(
self.options, '$WORKSPACE/$COMPANY.json'))
domains = [x.get('Domain') for x in main_json['Subdomains']]
return domains
def dirb_all(self, domains):
for domain in domains:
# passing domain to content directory tools
self.dirsearch(domain.strip())
self.wfuzz(domain.strip())
self.gobuster(domain.strip())
# just wait couple seconds and continue but not completely stop the routine
time.sleep(60)
# brute with 3 tools
utils.force_done(self.options, self.module_name)
# just save commands
logfile = utils.replace_argument(self.options, '$WORKSPACE/log.json')
utils.save_all_cmd(self.options, logfile)
# checking if it's done and get all found path
def parsing_ouput(self):
utils.print_good('Parsing result found to a file')
final_result = utils.replace_argument(
self.options, '$WORKSPACE/directory/$OUTPUT-summary.txt')
# dirsearch part
dirsearch_files = utils.list_files(self.options['WORKSPACE'] +'/directory/quick', pattern='*-dirsearch.txt')
for file in dirsearch_files:
data = utils.just_read(file)
if data:
utils.just_append(final_result, data)
# wfuzz part
wfuzz_files = utils.list_files(
self.options['WORKSPACE'] + '/directory/quick', pattern='*-wfuzz.json')
for file in wfuzz_files:
data_json = utils.reading_json(file)
if data_json:
data = "\n".join([x.get("url") for x in data_json])
utils.just_append(final_result, data)
# final_result
utils.clean_up(final_result)
utils.check_output(final_result)
# screenshots all result found
def screenshots(self):
utils.print_good('Starting Screenshot from found result')
final_result = utils.replace_argument(self.options, '$WORKSPACE/directory/$OUTPUT-summary.txt')
if utils.not_empty_file(final_result):
# screenshot found path at the end
cmd = "cat {0} | $GO_PATH/aquatone -threads 20 -out $WORKSPACE/directory/$OUTPUT-screenshots".format(
final_result)
cmd = utils.replace_argument(self.options, cmd)
std_path = utils.replace_argument(self.options, '$WORKSPACE/directory/$OUTPUT-screenshots/std-aquatone_report.std')
output_path = utils.replace_argument(self.options, '$WORKSPACE/directory/$OUTPUT-screenshots/aquatone_report.html')
execute.send_cmd(self.options, cmd, std_path, output_path, self.module_name)
if utils.not_empty_file(output_path):
utils.check_output(output_path)
# Just boring replicate similar command for content directory tools
def dirsearch(self, domain):
strip_domain = utils.get_domain(domain)
utils.print_good('Starting dirsearch')
cmd = "python3 $PLUGINS_PATH/dirsearch/dirsearch.py -b -e php,zip,aspx,js --wordlist=$PLUGINS_PATH/wordlists/really-quick.txt -x '302,404' --simple-report=$WORKSPACE/directory/quick/{1}-dirsearch.txt -t 50 -u {0}".format(domain, strip_domain)
cmd = utils.replace_argument(self.options, cmd)
output_path = utils.replace_argument(
self.options, '$WORKSPACE/directory/quick/{0}-dirsearch.txt'.format(strip_domain))
std_path = utils.replace_argument(
self.options, '$WORKSPACE/directory/quick/std-{0}-dirsearch.std'.format(strip_domain))
execute.send_cmd(self.options, cmd, output_path, std_path, self.module_name)
def wfuzz(self, domain):
strip_domain = utils.get_domain(domain)
utils.print_good('Starting wfuzz')
cmd = "wfuzz -f $WORKSPACE/directory/quick/{1}-wfuzz.json,json -c -w $PLUGINS_PATH/wordlists/quick-content-discovery.txt -t 100 --sc 200,307 -u '{0}/FUZZ' | tee $WORKSPACE/directory/quick/std-{1}-wfuzz.std".format(domain, strip_domain)
cmd = utils.replace_argument(self.options, cmd)
output_path = utils.replace_argument(
self.options, '$WORKSPACE/directory/quick/{0}-wfuzz.json'.format(strip_domain))
std_path = utils.replace_argument(
self.options, '$WORKSPACE/directory/quick/std-{0}-wfuzz.std'.format(strip_domain))
execute.send_cmd(self.options, cmd, output_path, std_path, self.module_name)
def gobuster(self, domain):
utils.print_good('Starting gobuster')
if self.options['SPEED'] != 'slow':
utils.print_good("Skipping gobuster in quick mode")
return
strip_domain = utils.get_domain(domain)
cmd = '$GO_PATH/gobuster dir -k -q -e -fw -x php,jsp,aspx,html,json -w $PLUGINS_PATH/wordlists/dir-all.txt -t 100 -o $WORKSPACE/directory/{1}-gobuster.txt -s 200,301,307 -u "{0}" '.format(
domain, strip_domain)
cmd = utils.replace_argument(self.options, cmd)
output_path = utils.replace_argument(
self.options, '$WORKSPACE/directory/full/{0}-gobuster.json'.format(domain))
std_path = utils.replace_argument(
self.options, '$WORKSPACE/directory/full/std-{0}-gobuster.std'.format(domain))
execute.send_cmd(self.options, cmd, output_path, std_path, self.module_name, nolog=True)
|
"""
Django settings for cocina_unicach project.
Generated by 'django-admin startproject' using Django 3.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'y21i0zi=ej31in%8jwm$q33pl$a77)vl(r13e*th^ugs%!xw#r'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'apps.materiales',
'apps.materias',
'apps.profesores',
'apps.solicitudes',
'apps.usuarios',
'rest_framework',
'crispy_forms',
'tempus_dominus',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'corsheaders.middleware.CorsMiddleware',
]
ROOT_URLCONF = 'cocina_unicach.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates/')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
AUTH_USER_MODEL = 'usuarios.User'
WSGI_APPLICATION = 'cocina_unicach.wsgi.application'
TEMPUS_DOMINUS_LOCALIZE = True
TEMPUS_DOMINUS_INCLUDE_ASSETS = True
CRISPY_TEMPLATE_PACK = 'bootstrap4'
# Gmail SMTP Server
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'unicachlaboratorios@gmail.com'
EMAIL_HOST_PASSWORD = 'Unicachlaboratorios01'
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'inventario',
'USER': 'root',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
LANGUAGE_CODE = 'es-mx'
TIME_ZONE = 'America/Mexico_City'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = '/static/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
from django.urls import reverse_lazy
LOGIN_URL = reverse_lazy('login')
LOGIN_REDIRECT_URL= reverse_lazy('login')
LOGOUT_URL = reverse_lazy('login')
LOGOUT_REDIRECT_URL= reverse_lazy('login')
|
const { verify } = require("jsonwebtoken");
module.exports = {
checkToken: (req, res, next) => {
let token = req.get("authorization");
if (token) {
token = token.slice(7);
verify(token, "123456token", (err, decoded) => {
if (err) {
res.json({
success: 0,
message: "Invalid token",
});
} else {
next();
}
});
} else {
res.json({
success: 0,
message: "Access denied! Unauthorized user",
});
}
},
};
|
# -*- coding: utf-8 -*-
'''
:codeauthor: `Nitin Madhok <nmadhok@clemson.edu>`
tests.unit.cloud.clouds.vmware_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
from copy import deepcopy
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.mock import MagicMock, NO_MOCK, NO_MOCK_REASON, patch
# Import Salt Libs
from salt import config
from salt.cloud.clouds import vmware
from salt.exceptions import SaltCloudSystemExit
# Attempt to import pyVim and pyVmomi libs
HAS_LIBS = True
# pylint: disable=import-error,no-name-in-module,unused-import
try:
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim, vmodl
except ImportError:
HAS_LIBS = False
# pylint: enable=import-error,no-name-in-module,unused-import
# Global Variables
PROVIDER_CONFIG = {
'vcenter01': {
'vmware': {
'driver': 'vmware',
'url': 'vcenter01.domain.com',
'user': 'DOMAIN\\user',
'password': 'verybadpass',
}
}
}
VM_NAME = 'test-vm'
PROFILE = {
'base-gold': {
'provider': 'vcenter01:vmware',
'datastore': 'Datastore1',
'resourcepool': 'Resources',
'folder': 'vm'
}
}
class ExtendedTestCase(TestCase, LoaderModuleMockMixin):
'''
Extended TestCase class containing additional helper methods.
'''
def setup_loader_modules(self):
return {
vmware: {
'__virtual__': MagicMock(return_value='vmware'),
'__active_provider_name__': ''
}
}
def assertRaisesWithMessage(self, exc_type, exc_msg, func, *args, **kwargs):
try:
func(*args, **kwargs)
self.assertFail()
except Exception as exc:
self.assertEqual(type(exc), exc_type)
self.assertEqual(exc.message, exc_msg)
@skipIf(NO_MOCK, NO_MOCK_REASON)
@skipIf(not HAS_LIBS, 'Install pyVmomi to be able to run this test.')
class VMwareTestCase(ExtendedTestCase):
'''
Unit TestCase for salt.cloud.clouds.vmware module.
'''
def test_test_vcenter_connection_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call test_vcenter_connection
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.test_vcenter_connection,
call='action'
)
def test_get_vcenter_version_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call get_vcenter_version
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.get_vcenter_version,
call='action'
)
def test_avail_images_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call avail_images
with --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.avail_images,
call='action'
)
def test_avail_locations_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call avail_locations
with --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.avail_locations,
call='action'
)
def test_avail_sizes_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call avail_sizes
with --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.avail_sizes,
call='action'
)
def test_list_datacenters_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_datacenters
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_datacenters,
call='action'
)
def test_list_clusters_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_clusters
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_clusters,
call='action'
)
def test_list_datastore_clusters_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_datastore_clusters
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_datastore_clusters,
call='action'
)
def test_list_datastores_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_datastores
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_datastores,
call='action'
)
def test_list_hosts_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_hosts
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_hosts,
call='action'
)
def test_list_resourcepools_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_resourcepools
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_resourcepools,
call='action'
)
def test_list_networks_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_networks
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_networks,
call='action'
)
def test_list_nodes_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_nodes
with --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_nodes,
call='action'
)
def test_list_nodes_min_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_nodes_min
with --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_nodes_min,
call='action'
)
def test_list_nodes_full_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_nodes_full
with --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_nodes_full,
call='action'
)
def test_list_nodes_select_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_nodes_full
with --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_nodes_select,
call='action'
)
def test_list_folders_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_folders
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_folders,
call='action'
)
def test_list_snapshots_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_snapshots
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_snapshots,
call='action'
)
def test_list_hosts_by_cluster_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_hosts_by_cluster
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_hosts_by_cluster,
call='action'
)
def test_list_clusters_by_datacenter_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_clusters_by_datacenter
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_clusters_by_datacenter,
call='action'
)
def test_list_hosts_by_datacenter_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_hosts_by_datacenter
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_hosts_by_datacenter,
call='action'
)
def test_list_hbas_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_hbas
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_hbas,
call='action'
)
def test_list_dvs_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_dvs
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_dvs,
call='action'
)
def test_list_vapps_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_vapps
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_vapps,
call='action'
)
def test_list_templates_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call list_templates
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.list_templates,
call='action'
)
def test_create_datacenter_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call create_datacenter
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datacenter,
call='action'
)
def test_create_cluster_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call create_cluster
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_cluster,
call='action'
)
def test_rescan_hba_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call rescan_hba
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.rescan_hba,
call='action'
)
def test_upgrade_tools_all_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call upgrade_tools_all
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.upgrade_tools_all,
call='action'
)
def test_enter_maintenance_mode_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call enter_maintenance_mode
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.enter_maintenance_mode,
call='action'
)
def test_exit_maintenance_mode_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call exit_maintenance_mode
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.exit_maintenance_mode,
call='action'
)
def test_create_folder_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call create_folder
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_folder,
call='action'
)
def test_add_host_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call add_host
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.add_host,
call='action'
)
def test_remove_host_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call remove_host
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.remove_host,
call='action'
)
def test_connect_host_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call connect_host
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.connect_host,
call='action'
)
def test_disconnect_host_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call disconnect_host
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.disconnect_host,
call='action'
)
def test_reboot_host_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call reboot_host
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.reboot_host,
call='action'
)
def test_create_datastore_cluster_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call create_datastore_cluster
with anything other than --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datastore_cluster,
call='action'
)
def test_show_instance_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call show_instance
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.show_instance,
name=VM_NAME,
call='function'
)
def test_start_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call start
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.start,
name=VM_NAME,
call='function'
)
def test_stop_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call stop
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.stop,
name=VM_NAME,
call='function'
)
def test_suspend_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call suspend
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.suspend,
name=VM_NAME,
call='function'
)
def test_reset_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call reset
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.reset,
name=VM_NAME,
call='function'
)
def test_terminate_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call terminate
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.terminate,
name=VM_NAME,
call='function'
)
def test_destroy_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call destroy
with --function or -f.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.destroy,
name=VM_NAME,
call='function'
)
def test_upgrade_tools_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call upgrade_tools
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.upgrade_tools,
name=VM_NAME,
call='function'
)
def test_create_snapshot_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call create_snapshot
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_snapshot,
name=VM_NAME,
call='function'
)
def test_revert_to_snapshot_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call revert_to_snapshot
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.revert_to_snapshot,
name=VM_NAME,
call='function'
)
def test_remove_all_snapshots_call(self):
'''
Tests that a SaltCloudSystemExit is raised when trying to call remove_all_snapshots
with anything other than --action or -a.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.remove_all_snapshots,
name=VM_NAME,
call='function'
)
def test_avail_sizes(self):
'''
Tests that avail_sizes returns an empty dictionary.
'''
self.assertEqual(
vmware.avail_sizes(call='foo'),
{}
)
def test_create_datacenter_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
create_datacenter.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datacenter,
kwargs=None,
call='function')
def test_create_datacenter_no_name_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when name is not present in
kwargs that are provided to create_datacenter.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datacenter,
kwargs={'foo': 'bar'},
call='function')
def test_create_datacenter_name_too_short(self):
'''
Tests that a SaltCloudSystemExit is raised when name is present in kwargs
that are provided to create_datacenter but is an empty string.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datacenter,
kwargs={'name': ''},
call='function')
def test_create_datacenter_name_too_long(self):
'''
Tests that a SaltCloudSystemExit is raised when name is present in kwargs
that are provided to create_datacenter but is a string with length <= 80.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datacenter,
kwargs={'name': 'cCD2GgJGPG1DUnPeFBoPeqtdmUxIWxDoVFbA14vIG0BPoUECkgbRMnnY6gaUPBvIDCcsZ5HU48ubgQu5c'},
call='function')
def test_create_cluster_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
create_cluster.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_cluster,
kwargs=None,
call='function')
def test_create_cluster_no_name_no_datacenter_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when neither the name nor the
datacenter is present in kwargs that are provided to create_cluster.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_cluster,
kwargs={'foo': 'bar'},
call='function')
def test_create_cluster_no_datacenter_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when the name is present but the
datacenter is not present in kwargs that are provided to create_cluster.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_cluster,
kwargs={'name': 'my-cluster'},
call='function')
def test_create_cluster_no_name_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when the datacenter is present
but the name is not present in kwargs that are provided to create_cluster.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_cluster,
kwargs={'datacenter': 'my-datacenter'},
call='function')
def test_rescan_hba_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
rescan_hba.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.rescan_hba,
kwargs=None,
call='function')
def test_rescan_hba_no_host_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when host is not present in
kwargs that are provided to rescan_hba.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.rescan_hba,
kwargs={'foo': 'bar'},
call='function')
def test_create_snapshot_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
create_snapshot.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_snapshot,
name=VM_NAME,
kwargs=None,
call='action')
def test_create_snapshot_no_snapshot_name_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when snapshot_name is not present
in kwargs that are provided to create_snapshot.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_snapshot,
name=VM_NAME,
kwargs={'foo': 'bar'},
call='action')
def test_add_host_no_esxi_host_user_in_config(self):
'''
Tests that a SaltCloudSystemExit is raised when esxi_host_user is not
specified in the cloud provider configuration when calling add_host.
'''
with patch.dict(vmware.__opts__, {'providers': PROVIDER_CONFIG}, clean=True):
self.assertRaisesWithMessage(
SaltCloudSystemExit,
'You must specify the ESXi host username in your providers config.',
vmware.add_host,
kwargs=None,
call='function')
def test_add_host_no_esxi_host_password_in_config(self):
'''
Tests that a SaltCloudSystemExit is raised when esxi_host_password is not
specified in the cloud provider configuration when calling add_host.
'''
provider_config_additions = {
'esxi_host_user': 'root',
}
provider_config = deepcopy(PROVIDER_CONFIG)
provider_config['vcenter01']['vmware'].update(provider_config_additions)
with patch.dict(vmware.__opts__, {'providers': provider_config}, clean=True):
self.assertRaisesWithMessage(
SaltCloudSystemExit,
'You must specify the ESXi host password in your providers config.',
vmware.add_host,
kwargs=None,
call='function')
def test_no_clonefrom_just_image(self):
'''
Tests that the profile is configured correctly when deploying using an image
'''
profile_additions = {
'image': 'some-image.iso'
}
provider_config = deepcopy(PROVIDER_CONFIG)
profile = deepcopy(PROFILE)
profile['base-gold'].update(profile_additions)
provider_config_additions = {
'profiles': profile
}
provider_config['vcenter01']['vmware'].update(provider_config_additions)
vm_ = {'profile': profile}
with patch.dict(vmware.__opts__, {'providers': provider_config}, clean=True):
self.assertEqual(config.is_profile_configured(vmware.__opts__, 'vcenter01:vmware',
'base-gold', vm_=vm_), True)
def test_just_clonefrom(self):
'''
Tests that the profile is configured correctly when deploying by cloning from a template
'''
profile_additions = {
'clonefrom': 'test-template',
'image': 'should ignore image'
}
provider_config = deepcopy(PROVIDER_CONFIG)
profile = deepcopy(PROFILE)
profile['base-gold'].update(profile_additions)
provider_config_additions = {
'profiles': profile
}
provider_config['vcenter01']['vmware'].update(provider_config_additions)
vm_ = {'profile': profile}
with patch.dict(vmware.__opts__, {'providers': provider_config}, clean=True):
self.assertEqual(config.is_profile_configured(vmware.__opts__, 'vcenter01:vmware',
'base-gold', vm_=vm_), True)
def test_add_new_ide_controller_helper(self):
'''
Tests that creating a new controller, ensuring that it will generate a controller key
if one is not provided
'''
with patch('salt.cloud.clouds.vmware.randint', return_value=101) as randint_mock:
controller_label = 'Some label'
bus_number = 1
spec = vmware._add_new_ide_controller_helper(controller_label, None, bus_number)
self.assertEqual(spec.device.key, randint_mock.return_value)
spec = vmware._add_new_ide_controller_helper(controller_label, 200, bus_number)
self.assertEqual(spec.device.key, 200)
self.assertEqual(spec.device.busNumber, bus_number)
self.assertEqual(spec.device.deviceInfo.label, controller_label)
self.assertEqual(spec.device.deviceInfo.summary, controller_label)
def test_manage_devices_just_cd(self):
'''
Tests that when adding IDE/CD drives, controller keys will be in the apparent
safe-range on ESX 5.5 but randomly generated on other versions (i.e. 6)
'''
device_map = {
'ide': {
'IDE 0': {},
'IDE 1': {}
},
'cd': {
'CD/DVD Drive 1': {'controller': 'IDE 0'}
}
}
with patch('salt.cloud.clouds.vmware.get_vcenter_version', return_value='VMware ESXi 5.5.0'):
specs = vmware._manage_devices(device_map, vm=None)['device_specs']
self.assertEqual(specs[0].device.key, vmware.SAFE_ESX_5_5_CONTROLLER_KEY_INDEX)
self.assertEqual(specs[1].device.key, vmware.SAFE_ESX_5_5_CONTROLLER_KEY_INDEX+1)
self.assertEqual(specs[2].device.controllerKey, vmware.SAFE_ESX_5_5_CONTROLLER_KEY_INDEX)
with patch('salt.cloud.clouds.vmware.get_vcenter_version', return_value='VMware ESXi 6'):
with patch('salt.cloud.clouds.vmware.randint', return_value=100) as first_key:
specs = vmware._manage_devices(device_map, vm=None)['device_specs']
self.assertEqual(specs[0].device.key, first_key.return_value)
self.assertEqual(specs[2].device.controllerKey, first_key.return_value)
def test_add_host_no_host_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when host is not present in
kwargs that are provided to add_host.
'''
provider_config_additions = {
'esxi_host_user': 'root',
'esxi_host_password': 'myhostpassword'
}
provider_config = deepcopy(PROVIDER_CONFIG)
provider_config['vcenter01']['vmware'].update(provider_config_additions)
with patch.dict(vmware.__opts__, {'providers': provider_config}, clean=True):
self.assertRaisesWithMessage(
SaltCloudSystemExit,
'You must specify either the IP or DNS name of the host system.',
vmware.add_host,
kwargs={'foo': 'bar'},
call='function')
def test_add_host_both_cluster_and_datacenter_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when both cluster and datacenter
are present in kwargs that are provided to add_host.
'''
provider_config_additions = {
'esxi_host_user': 'root',
'esxi_host_password': 'myhostpassword'
}
provider_config = deepcopy(PROVIDER_CONFIG)
provider_config['vcenter01']['vmware'].update(provider_config_additions)
with patch.dict(vmware.__opts__, {'providers': provider_config}, clean=True):
self.assertRaisesWithMessage(
SaltCloudSystemExit,
'You must specify either the cluster name or the datacenter name.',
vmware.add_host,
kwargs={'host': 'my-esxi-host', 'datacenter': 'my-datacenter', 'cluster': 'my-cluster'},
call='function')
def test_add_host_neither_cluster_nor_datacenter_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when neither cluster nor
datacenter is present in kwargs that are provided to add_host.
'''
provider_config_additions = {
'esxi_host_user': 'root',
'esxi_host_password': 'myhostpassword'
}
provider_config = deepcopy(PROVIDER_CONFIG)
provider_config['vcenter01']['vmware'].update(provider_config_additions)
with patch.dict(vmware.__opts__, {'providers': provider_config}, clean=True):
self.assertRaisesWithMessage(
SaltCloudSystemExit,
'You must specify either the cluster name or the datacenter name.',
vmware.add_host,
kwargs={'host': 'my-esxi-host'},
call='function')
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_add_host_cluster_not_exists(self):
'''
Tests that a SaltCloudSystemExit is raised when the specified cluster present
in kwargs that are provided to add_host does not exist in the VMware
environment.
'''
with patch('salt.cloud.clouds.vmware._get_si', MagicMock(return_value=None)):
with patch('salt.utils.vmware.get_mor_by_property', MagicMock(return_value=None)):
provider_config_additions = {
'esxi_host_user': 'root',
'esxi_host_password': 'myhostpassword'
}
provider_config = deepcopy(PROVIDER_CONFIG)
provider_config['vcenter01']['vmware'].update(provider_config_additions)
with patch.dict(vmware.__opts__, {'providers': provider_config}, clean=True):
self.assertRaisesWithMessage(
SaltCloudSystemExit,
'Specified cluster does not exist.',
vmware.add_host,
kwargs={'host': 'my-esxi-host', 'cluster': 'my-cluster'},
call='function')
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_add_host_datacenter_not_exists(self):
'''
Tests that a SaltCloudSystemExit is raised when the specified datacenter
present in kwargs that are provided to add_host does not exist in the VMware
environment.
'''
with patch('salt.cloud.clouds.vmware._get_si', MagicMock(return_value=None)):
with patch('salt.utils.vmware.get_mor_by_property', MagicMock(return_value=None)):
provider_config_additions = {
'esxi_host_user': 'root',
'esxi_host_password': 'myhostpassword'
}
provider_config = deepcopy(PROVIDER_CONFIG)
provider_config['vcenter01']['vmware'].update(provider_config_additions)
with patch.dict(vmware.__opts__, {'providers': provider_config}, clean=True):
self.assertRaisesWithMessage(
SaltCloudSystemExit,
'Specified datacenter does not exist.',
vmware.add_host,
kwargs={'host': 'my-esxi-host', 'datacenter': 'my-datacenter'},
call='function')
def test_remove_host_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
remove_host.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.remove_host,
kwargs=None,
call='function')
def test_remove_host_no_host_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when host is not present in
kwargs that are provided to remove_host.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.remove_host,
kwargs={'foo': 'bar'},
call='function')
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_remove_host_not_exists(self):
'''
Tests that a SaltCloudSystemExit is raised when the specified host present
in kwargs that are provided to remove_host does not exist in the VMware
environment.
'''
with patch('salt.cloud.clouds.vmware._get_si', MagicMock(return_value=None)):
with patch('salt.utils.vmware.get_mor_by_property', MagicMock(return_value=None)):
self.assertRaises(
SaltCloudSystemExit,
vmware.remove_host,
kwargs={'host': 'my-host'},
call='function')
def test_connect_host_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
connect_host.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.connect_host,
kwargs=None,
call='function')
def test_connect_host_no_host_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when host is not present in
kwargs that are provided to connect_host.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.connect_host,
kwargs={'foo': 'bar'},
call='function')
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_connect_host_not_exists(self):
'''
Tests that a SaltCloudSystemExit is raised when the specified host present
in kwargs that are provided to connect_host does not exist in the VMware
environment.
'''
with patch('salt.cloud.clouds.vmware._get_si', MagicMock(return_value=None)):
with patch('salt.utils.vmware.get_mor_by_property', MagicMock(return_value=None)):
self.assertRaises(
SaltCloudSystemExit,
vmware.connect_host,
kwargs={'host': 'my-host'},
call='function')
def test_disconnect_host_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
disconnect_host.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.disconnect_host,
kwargs=None,
call='function')
def test_disconnect_host_no_host_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when host is not present in
kwargs that are provided to disconnect_host.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.disconnect_host,
kwargs={'foo': 'bar'},
call='function')
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_disconnect_host_not_exists(self):
'''
Tests that a SaltCloudSystemExit is raised when the specified host present
in kwargs that are provided to disconnect_host does not exist in the VMware
environment.
'''
with patch('salt.cloud.clouds.vmware._get_si', MagicMock(return_value=None)):
with patch('salt.utils.vmware.get_mor_by_property', MagicMock(return_value=None)):
self.assertRaises(
SaltCloudSystemExit,
vmware.disconnect_host,
kwargs={'host': 'my-host'},
call='function')
def test_reboot_host_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
reboot_host.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.reboot_host,
kwargs=None,
call='function')
def test_reboot_host_no_host_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when host is not present in
kwargs that are provided to reboot_host.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.reboot_host,
kwargs={'foo': 'bar'},
call='function')
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_reboot_host_not_exists(self):
'''
Tests that a SaltCloudSystemExit is raised when the specified host present
in kwargs that are provided to connect_host does not exist in the VMware
environment.
'''
with patch('salt.cloud.clouds.vmware._get_si', MagicMock(return_value=None)):
with patch('salt.utils.vmware.get_mor_by_property', MagicMock(return_value=None)):
self.assertRaises(
SaltCloudSystemExit,
vmware.reboot_host,
kwargs={'host': 'my-host'},
call='function')
def test_create_datastore_cluster_no_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when no kwargs are provided to
create_datastore_cluster.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datastore_cluster,
kwargs=None,
call='function')
def test_create_datastore_cluster_no_name_in_kwargs(self):
'''
Tests that a SaltCloudSystemExit is raised when name is not present in
kwargs that are provided to create_datastore_cluster.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datastore_cluster,
kwargs={'foo': 'bar'},
call='function')
def test_create_datastore_cluster_name_too_short(self):
'''
Tests that a SaltCloudSystemExit is raised when name is present in kwargs
that are provided to create_datastore_cluster but is an empty string.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datastore_cluster,
kwargs={'name': ''},
call='function')
def test_create_datastore_cluster_name_too_long(self):
'''
Tests that a SaltCloudSystemExit is raised when name is present in kwargs
that are provided to create_datastore_cluster but is a string with length <= 80.
'''
self.assertRaises(
SaltCloudSystemExit,
vmware.create_datastore_cluster,
kwargs={'name': 'cCD2GgJGPG1DUnPeFBoPeqtdmUxIWxDoVFbA14vIG0BPoUECkgbRMnnY6gaUPBvIDCcsZ5HU48ubgQu5c'},
call='function')
class CloneFromSnapshotTest(TestCase):
'''
Test functionality to clone from snapshot
'''
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_quick_linked_clone(self):
'''
Test that disk move type is
set to createNewChildDiskBacking
'''
self._test_clone_type(vmware.QUICK_LINKED_CLONE)
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_current_state_linked_clone(self):
'''
Test that disk move type is
set to moveChildMostDiskBacking
'''
self._test_clone_type(vmware.CURRENT_STATE_LINKED_CLONE)
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_copy_all_disks_full_clone(self):
'''
Test that disk move type is
set to moveAllDiskBackingsAndAllowSharing
'''
self._test_clone_type(vmware.COPY_ALL_DISKS_FULL_CLONE)
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_flatten_all_all_disks_full_clone(self):
'''
Test that disk move type is
set to moveAllDiskBackingsAndDisallowSharing
'''
self._test_clone_type(vmware.FLATTEN_DISK_FULL_CLONE)
@skipIf(HAS_LIBS is False, "Install pyVmomi to be able to run this unit test.")
def test_raises_error_for_invalid_disk_move_type(self):
'''
Test that invalid disk move type
raises error
'''
with self.assertRaises(SaltCloudSystemExit):
self._test_clone_type('foobar')
def _test_clone_type(self, clone_type):
'''
Assertions for checking that a certain clone type
works
'''
obj_ref = MagicMock()
obj_ref.snapshot = vim.vm.Snapshot(None, None)
obj_ref.snapshot.currentSnapshot = vim.vm.Snapshot(None, None)
clone_spec = vmware.handle_snapshot(
vim.vm.ConfigSpec(),
obj_ref,
vim.vm.RelocateSpec(),
False,
{'snapshot': {
'disk_move_type': clone_type}})
self.assertEqual(clone_spec.location.diskMoveType, clone_type)
obj_ref2 = MagicMock()
obj_ref2.snapshot = vim.vm.Snapshot(None, None)
obj_ref2.snapshot.currentSnapshot = vim.vm.Snapshot(None, None)
clone_spec2 = vmware.handle_snapshot(
vim.vm.ConfigSpec(),
obj_ref2,
vim.vm.RelocateSpec(),
True,
{'snapshot': {
'disk_move_type': clone_type}})
self.assertEqual(clone_spec2.location.diskMoveType, clone_type)
|
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React, { Component, Fragment } from 'react';
import { EuiIcon } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { createSpatialFilterWithGeometry } from '../../../elasticsearch_geo_utils';
import { GEO_JSON_TYPE } from '../../../../common/constants';
import { GeometryFilterForm } from '../../../components/geometry_filter_form';
import { UrlOverflowService } from 'ui/error_url_overflow';
import rison from 'rison-node';
// over estimated and imprecise value to ensure filter has additional room for any meta keys added when filter is mapped.
const META_OVERHEAD = 100;
const urlOverflow = new UrlOverflowService();
export class FeatureGeometryFilterForm extends Component {
state = {
isLoading: false,
errorMsg: undefined,
}
componentDidMount() {
this._isMounted = true;
}
componentWillUnmount() {
this._isMounted = false;
}
_loadPreIndexedShape = async () => {
this.setState({
isLoading: true,
});
let preIndexedShape;
try {
preIndexedShape = await this.props.loadPreIndexedShape();
} catch (err) {
// ignore error, just fall back to using geometry if preIndexedShape can not be fetched
}
if (this._isMounted) {
this.setState({ isLoading: false });
}
return preIndexedShape;
}
_createFilter = async ({ geometryLabel, indexPatternId, geoFieldName, geoFieldType, relation }) => {
this.setState({ errorMsg: undefined });
const preIndexedShape = await this._loadPreIndexedShape();
if (!this._isMounted) {
// do not create filter if component is unmounted
return;
}
const filter = createSpatialFilterWithGeometry({
preIndexedShape,
geometry: this.props.geometry,
geometryLabel,
indexPatternId,
geoFieldName,
geoFieldType,
relation,
});
// Ensure filter will not overflow URL. Filters that contain geometry can be extremely large.
// No elasticsearch support for pre-indexed shapes and geo_point spatial queries.
if (window.location.href.length + rison.encode(filter).length + META_OVERHEAD > urlOverflow.failLength()) {
this.setState({
errorMsg: i18n.translate('xpack.maps.tooltip.geometryFilterForm.filterTooLargeMessage', {
defaultMessage: 'Cannot create filter. Filters are added to the URL, and this shape has too many vertices to fit in the URL.'
})
});
return;
}
this.props.addFilters([filter]);
this.props.onClose();
}
_renderHeader() {
return (
<button
className="euiContextMenuPanelTitle mapFeatureTooltip_backButton"
type="button"
onClick={this.props.showPropertiesView}
>
<span className="euiContextMenu__itemLayout">
<EuiIcon
type="arrowLeft"
size="m"
className="euiContextMenu__icon"
/>
<span className="euiContextMenu__text">
<FormattedMessage
id="xpack.maps.tooltip.showGeometryFilterViewLinkLabel"
defaultMessage="Filter by geometry"
/>
</span>
</span>
</button>
);
}
_renderForm() {
return (
<GeometryFilterForm
buttonLabel={i18n.translate('xpack.maps.tooltip.geometryFilterForm.createFilterButtonLabel', {
defaultMessage: 'Create filter'
})}
geoFields={this.props.geoFields}
intitialGeometryLabel={this.props.geometry.type.toLowerCase()}
onSubmit={this._createFilter}
isFilterGeometryClosed={this.props.geometry.type !== GEO_JSON_TYPE.LINE_STRING
&& this.props.geometry.type !== GEO_JSON_TYPE.MULTI_LINE_STRING}
isLoading={this.state.isLoading}
errorMsg={this.state.errorMsg}
/>
);
}
render() {
return (
<Fragment>
{this._renderHeader()}
{this._renderForm()}
</Fragment>
);
}
}
|
import React, { cloneElement, Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { withStyles } from '@material-ui/core/styles';
import { linkToRecord } from 'ra-core';
import Link from '../Link';
const styles = {
root: { display: 'flex', flexWrap: 'wrap' },
};
// useful to prevent click bubbling in a datagrid with rowClick
const stopPropagation = e => e.stopPropagation();
const sanitizeRestProps = ({ currentSort, setSort, isLoading, ...props }) =>
props;
/**
* Iterator component to be used to display a list of entities, using a single field
*
* @example Display all the books by the current author
* <ReferenceManyField reference="books" target="author_id">
* <SingleFieldList>
* <ChipField source="title" />
* </SingleFieldList>
* </ReferenceManyField>
*
* By default, it includes a link to the <Edit> page of the related record
* (`/books/:id` in the previous example).
*
* Set the linkType prop to "show" to link to the <Show> page instead.
*
* @example
* <ReferenceManyField reference="books" target="author_id" linkType="show">
* <SingleFieldList>
* <ChipField source="title" />
* </SingleFieldList>
* </ReferenceManyField>
*
* You can also prevent `<SingleFieldList>` from adding link to children by setting
* `linkType` to false.
*
* @example
* <ReferenceManyField reference="books" target="author_id" linkType={false}>
* <SingleFieldList>
* <ChipField source="title" />
* </SingleFieldList>
* </ReferenceManyField>
*/
export class SingleFieldList extends Component {
// Our handleClick does nothing as we wrap the children inside a Link but it is
// required fo ChipField which uses a Chip from material-ui.
// The material-ui Chip requires an onClick handler to behave like a clickable element
handleClick = () => {};
render() {
const {
classes = {},
className,
ids,
data,
resource,
basePath,
children,
linkType,
...rest
} = this.props;
return (
<div
className={classnames(classes.root, className)}
{...sanitizeRestProps(rest)}
>
{ids.map(id => {
const resourceLinkPath = !linkType
? false
: linkToRecord(basePath, id, linkType);
if (resourceLinkPath) {
return (
<Link
className={classnames(classes.link, className)}
key={id}
to={resourceLinkPath}
onClick={stopPropagation}
>
{cloneElement(children, {
record: data[id],
resource,
basePath,
// Workaround to force ChipField to be clickable
onClick: this.handleClick,
})}
</Link>
);
}
return cloneElement(children, {
key: id,
record: data[id],
resource,
basePath,
});
})}
</div>
);
}
}
SingleFieldList.propTypes = {
basePath: PropTypes.string,
children: PropTypes.element.isRequired,
classes: PropTypes.object,
className: PropTypes.string,
data: PropTypes.object,
ids: PropTypes.array,
linkType: PropTypes.oneOfType([PropTypes.string, PropTypes.bool])
.isRequired,
resource: PropTypes.string,
};
SingleFieldList.defaultProps = {
classes: {},
linkType: 'edit',
};
export default withStyles(styles)(SingleFieldList);
|
const mongoose = require('mongoose')
const Consumer = require(__base + 'models/consumer.js').consumer
const applications = (req,res) => {
Consumer.find({}, (err,data) => {
if(err){
console.log(err);
res.status(500).json(err);
}
else {
res.send(data);
}
});
}
module.exports = applications
|
function main(){
//find notice
var allDivs = $$("div,span,form,#dialog")
var cookieJars = []
for(var d of allDivs){
if(isFixed(d)){
d2 = getSimplestChild(d);
//console.log("Fixed:")
//console.log(d.innerText.toLowerCase())
// At this point 'd' is an element that scrolls with the screen
if(containsKeyPhrase(d2)){
//console.log(d2)
if(!cookieJars.includes(d2)){
cookieJars.push(d2)
}
}
}
}
//console.log(cookieJars)
var cookieJars = filterForChildren(cookieJars)
//console.log(cookieJars)
for(var jar of cookieJars){
//console.log(jar)
var gButCount = 0
var bButCount = 0
var goodButton
var badButton
for(var b of getButtons(jar)){
if(isGoodButton(b)){
gButCount += 1
goodButton = b
styleGoodButton(b)
}
else if(isBadButton(b)){
bButCount += 1
badButton = b
styleBadButton(b)
}
}
if(gButCount>0||bButCount>0){
styleCaughtNotice(jar)
}
if(gButCount>0&&bButCount>0){
console.log("Buttons:")
console.log(goodButton.innerText)
console.log(badButton.innerText)
}
}
}
// Detection methods
function isFixed(e){
pos = window.getComputedStyle(e).getPropertyValue("position")
return pos==="fixed" || pos==="absolute" || e.className.toLowerCase().includes("cookie") || e.className.toLowerCase().includes("consent")
}
function getSimplestChild(e){
currentE = e
while(currentE.children.length==1){
currentE = currentE.children[0]
}
return currentE
}
function getButtons(e){
buttonsNL = e.querySelectorAll("button,a,input")
buttons = Array.prototype.slice.call(buttonsNL);
for(var c of e.getElementsByTagName("*")){
if(c.children.length==0 && c.innerText && c.innerText.length<20){
buttons.push(c)
}
}
//console.log(buttons)
return filterForChildren(buttons)
}
function isGoodButton(e){
bText = e.innerText.toLowerCase()
return bText.includes("reject") || bText.includes("manage") || bText.includes("configure") || bText.includes("option") || bText.includes("customi") || bText===("learn more") || bText.includes("setting")
}
function isBadButton(e){
bText = e.innerText.toLowerCase()
return bText.includes("accept") || bText.includes("agree")
}
function containsKeyPhrase(e){
return e.innerText && e.innerText.toLowerCase().includes("cookie")
}
// Mutator methods
function styleCaughtNotice(e){
e.style.boxShadow = "0px 0px 19px 13px #FF0000";
addConditionalPadding(e)
//e.style.backgroundColor = "purple";
}
function styleGoodButton(e){
e.style.borderStyle = "solid";
e.style.borderColor = "green";
e.style.borderWidth = "3px";
e.style.backgroundColor = "green";
e.style.color = "white";
for(var c of e.children){
c.style.color = "white";
}
addConditionalCurves(e)
}
function styleBadButton(e){
e.style.borderStyle = "solid";
e.style.borderColor = "red";
e.style.borderWidth = "3px";
e.style.backgroundColor = "transparent";
e.style.color = "darkgray";
for(var c of e.children){
c.style.color = "darkgray";
}
addConditionalCurves(e)
}
function addConditionalPadding(e){
if (window.getComputedStyle(e).getPropertyValue("padding")==="0px"){
e.style.padding = "2px"
}
}
function addConditionalCurves(e){
if (window.getComputedStyle(e).getPropertyValue("border-radius")==="0px"){
e.style.borderRadius = "2px"
}
}
// Interactor methods
function doClick(node, selector) {
var didSomething = false;
for (var i = 0; i < node.length; i++) {
if (!node[i].dataset.cookieAwayClicked) {
node[i].click();
node[i].dataset.cookieAwayClicked = true;
didSomething = true
}
}
if (didSomething) {
console.log("click", selector)
}
}
// Helper methods
var $$ = function (s) {
return document.querySelectorAll(s)
};
function filterForChildren(es){
var newArr = [...es].filter(function(item) {
for(ele of es){
if(ele!=item && ele.contains(item)){
return false;
}
}
return true;
});
return newArr
}
main()
setTimeout(main, 400);
setTimeout(main, 1000);
//setTimeout(main, 2000);
|
import '../../../node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind'
function LinkableTable ($module) {
this.$module = $module
}
LinkableTable.prototype.init = function (params) {
this.setupOptions(params)
this.data_table = this.$module.querySelector('table')
this.data_table_head = this.data_table.querySelector('thead tr')
this.data_table_body = this.data_table.querySelector('tbody')
this.rows = this.data_table.querySelectorAll('tbody tr')
this.addLinkColumn()
// do I need to delay this?
this.initialSelected()
}
LinkableTable.prototype.setupOptions = function (params) {
params = params || {}
this.idPrefix = params.idPrefix || 'table-x-'
}
LinkableTable.prototype.addLinkColumn = function () {
const firstCell = this.data_table_head.querySelector('th')
this.data_table_head.insertBefore(
this.createCell({ type: 'head' }),
firstCell
)
var rows = this.getTableRowsArray()
rows.forEach((row, idx) => {
console.log(idx)
idx = idx + 1
var href = '#' + this.idPrefix + idx.toString()
if (row.id) {
href = '#' + row.id
}
this.addCellToRow(
row,
this.createCell({ linkIdx: idx.toString(), linkHref: href })
)
})
}
LinkableTable.prototype.createCell = function (params) {
params = params || {}
var boundLinkToRowHandler = this.linkToRowHandler.bind(this)
var cell =
params.type === 'head'
? document.createElement('th')
: document.createElement('td')
cell.classList.add('data-table__row-link')
if (params.linkIdx) {
var _link = document.createElement('a')
_link.setAttribute('href', params.linkHref)
var a11yText = document.createElement('span')
a11yText.classList.add('govuk-visually-hidden')
a11yText.textContent = 'highlight row '
_link.append(a11yText)
var _linkContent = document.createTextNode('#' + params.linkIdx)
_link.append(_linkContent)
_link.addEventListener('click', boundLinkToRowHandler)
cell.append(_link)
}
return cell
}
LinkableTable.prototype.linkToRowHandler = function (e) {
// e.preventDefault();
this.deselectRows()
this.selectRow(e.currentTarget.closest('tr'))
console.log(e.currentTarget)
}
LinkableTable.prototype.addCellToRow = function (row, cell) {
const firstCell = row.querySelector('td')
row.insertBefore(cell, firstCell)
}
LinkableTable.prototype.getTableRowsArray = function () {
var rows = []
var trs = this.data_table_body.querySelectorAll('tr')
console.log(trs)
for (var i = 0; i < trs.length; i++) {
rows.push(trs[i])
}
return rows
}
LinkableTable.prototype.deselectRows = function () {
this.rows.forEach(row => {
row.classList.remove('data-table__row-selected')
})
}
LinkableTable.prototype.selectRow = function (row) {
row.classList.add('data-table__row-selected')
}
LinkableTable.prototype.highlightHashed = function (hash) {
var hashlessHash = hash.replace('#', '')
if (hash.includes(this.idPrefix)) {
const link = document.querySelector(`[href='${hash}']`)
const row = link.closest('tr')
this.selectRow(row)
row.scrollIntoView({ block: 'center' })
} else if (document.getElementById(hashlessHash)) {
// make sure element with id from hash is inside the table
var el = document.getElementById(hashlessHash)
if (this.data_table_body.contains(el)) {
this.selectRow(el)
}
}
}
LinkableTable.prototype.hashChangeHandler = function () {
this.deselectRows()
this.highlightHashed(window.location.hash)
}
LinkableTable.prototype.initialSelected = function () {
if (window.location.hash) {
this.highlightHashed(window.location.hash)
}
// add event listener for URL hash changes
const boundHashChangeHandler = this.hashChangeHandler.bind(this)
window.addEventListener('hashchange', boundHashChangeHandler)
}
export default LinkableTable
|
import vk_orbwalker
from valkyrie import *
from helpers.flags import Orbwalker
from helpers.targeting import *
from helpers.damages import calculate_raw_spell_dmg
from helpers.spells import Slot
import time
target_selector = None
Q_Enabled = True
W_Enabled = True
E_Enabled = True
R_Enabled = True
E_Melee_Range = True
Q_Kill_Steal = True
Q_Jungle_Steal = True
R_Kill_Steal = True
R_Targets = 2
Q_Range = 915 #Safe Distance | Real Range = 1115
W_Range = 1250
R_Range = 600
def calc_r_damage(ctx, target):
r_dmg = calculate_raw_spell_dmg(ctx.player, ctx.player.spells[Slot.R])
return r_dmg.calc_against(ctx, ctx.player, target)
def get_enemy_targets(ctx: Context, range):
return ctx.champs.enemy_to(ctx.player).targetable().near(ctx.player, range).get()
def get_minion_targets(ctx: Context, range):
return ctx.minions.enemy_to(ctx.player).targetable().near(ctx.player, range).get()
def blitz_q(ctx: Context, blitzQ):
target = target_selector.get_target(ctx, get_enemy_targets(ctx, Q_Range))
minions = get_minion_targets(ctx, 1115)
if target is None:
return
if ctx.player.can_cast_spell(blitzQ):
distance = ctx.player.pos.distance(target.pos)
##pos = target.predict_position(blitzQ.static.cast_time + (distance/1800))
ctx.cast_spell_on_unit(blitzQ, target)
def blitz_w(ctx: Context, blitzW):
target = target_selector.get_target(ctx, get_enemy_targets(ctx, W_Range))
if target is None:
return
if ctx.player.can_cast_spell(blitzW):
ctx.cast_spell(blitzW, None)
def blitz_e(ctx: Context, blitzE):
local_range = ctx.player.atk_range
target = target_selector.get_target(ctx, get_enemy_targets(ctx, local_range))
if target is None:
return
if ctx.player.can_cast_spell(blitzE):
ctx.cast_spell(blitzE, None)
def blitz_r(ctx: Context, blitzR):
targets = get_enemy_targets(ctx, R_Range)
if targets is None:
return
if ctx.player.can_cast_spell(blitzR) and len(targets) >= R_Targets:
ctx.cast_spell(blitzR, None)
def valkyrie_menu(ctx: Context):
ui = ctx.ui
global Q_Enabled, W_Enabled, E_Enabled, R_Enabled, W_Range, E_Melee_Range, Q_Kill_Steal, R_Kill_Steal, Q_Jungle_Steal, R_Targets
ui.text('[dBlitzcrank] Doom Blitzcrank Version [0.1]\nDeveloped by Luck#1337')
ui.separator()
if ui.beginmenu("Blitzcrank Core"):
if ui.beginmenu("[Q] Rocket Grab"):
Q_Enabled = ui.checkbox('Enabled [Q]', Q_Enabled)
Q_Kill_Steal = ui.checkbox('[Q] Kill Steal (Waiting for update currently broken)', Q_Kill_Steal)
Q_Jungle_Steal = ui.checkbox('[Q] Jungle Steal (Waiting for update currently broken)', Q_Jungle_Steal)
ui.endmenu()
if ui.beginmenu("[W] Overdrive"):
W_Enabled = ui.checkbox('Enabled [W]', W_Enabled)
W_Range = ui.sliderfloat("If Target in Range", W_Range, 0.0, 2000.0)
ui.endmenu()
if ui.beginmenu("[E] Power Fist"):
E_Enabled = ui.checkbox('Enabled [E]', E_Enabled)
E_Melee_Range = ui.checkbox('Only [E] in AA Range', E_Melee_Range)
ui.endmenu()
if ui.beginmenu("[R] Static Field"):
R_Enabled = ui.checkbox('Enabled [R]', R_Enabled)
R_Targets = ui.sliderint("If Targets >=", R_Targets, 1, 5)
R_Kill_Steal = ui.checkbox('[R] Kill Steal (Waiting for update currently broken)', R_Kill_Steal)
ui.endmenu()
ui.endmenu()
def valkyrie_on_load(ctx: Context):
global target_selector
if not Orbwalker.Present:
target_selector = None
else:
target_selector = Orbwalker.SelectorChampion
cfg = ctx.cfg
cfg.get_bool("Q", Q_Enabled)
cfg.get_bool("Q_KS", Q_Kill_Steal)
cfg.get_bool("W", W_Enabled)
cfg.get_float("W_RNG", W_Range)
cfg.get_bool("E", E_Enabled)
cfg.get_bool("E_MLE", E_Melee_Range)
cfg.get_bool("R", R_Enabled)
cfg.get_bool("R_KS", R_Kill_Steal)
cfg.get_bool("R_TGTS", R_Targets)
def valkyrie_on_save(ctx: Context):
cfg = ctx.cfg
cfg.get_bool("Q", Q_Enabled)
cfg.get_bool("Q_KS", Q_Kill_Steal)
cfg.get_bool("W", W_Enabled)
cfg.get_float("W_RNG", W_Range)
cfg.get_bool("E", E_Enabled)
cfg.get_bool("E_MLE", E_Melee_Range)
cfg.get_bool("R", R_Enabled)
cfg.get_bool("R_KS", R_Kill_Steal)
cfg.get_bool("R_TGTS", R_Targets)
def valkyrie_exec(ctx: Context):
player = ctx.player
blitzQ = ctx.player.spells[Slot.Q]
blitzW = ctx.player.spells[Slot.W]
blitzE = ctx.player.spells[Slot.E]
blitzR = ctx.player.spells[Slot.R]
if R_Kill_Steal:
R_KS_Targets = get_enemy_targets(ctx, R_Range)
for champ in R_KS_Targets:
if calc_r_damage(ctx, champ) > champ.health:
ctx.cast_spell(blitzR, None)
if Orbwalker.CurrentMode == Orbwalker.ModeKite:
blitz_q(ctx, blitzQ)
blitz_w(ctx, blitzW)
blitz_e(ctx, blitzE)
blitz_r(ctx, blitzR)
|
// Server API makes it possible to hook into various parts of Gridsome
// on server-side and add custom data to the GraphQL data layer.
// Learn more: https://gridsome.org/docs/server-api
// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
const axios = require("axios");
const slugify = require("slugify");
const path = require("path");
require("dotenv").config();
const nameRender = (name) => {
const first =
name.match(
/first = ([ A-Za-zäáàâāéëèêēūûùüúīîìïíòóöōáäàâçñ.'ÉÈÊËĒÁÄÀÂĀÃĪÎÌÏÍÕŌÔÒÖÓŪÛÜÚÑ-]+)/
) &&
name.match(
/first = ([ A-Za-zäáàâāéëèêēūûùüúīîìïíòóöōáäàâçñ.'ÉÈÊËĒÁÄÀÂĀÃĪÎÌÏÍÕŌÔÒÖÓŪÛÜÚÑ-]+)/
)[1];
const middle =
name.match(
/middle = ([ A-Za-zäáàâāéëèêēūûùüúīîìïíòóöōáäàâçñ.'ÉÈÊËĒÁÄÀÂĀÃĪÎÌÏÍÕŌÔÒÖÓŪÛÜÚÑ-]+)/
) &&
name.match(
/middle = ([ A-Za-zäáàâāéëèêēūûùüúīîìïíòóöōáäàâçñ.'ÉÈÊËĒÁÄÀÂĀÃĪÎÌÏÍÕŌÔÒÖÓŪÛÜÚÑ-]+)/
)[1];
const last =
name.match(
/last = ([ A-Za-zäáàâāéëèêēūûùüúīîìïíòóöōáäàâçñ.'ÉÈÊËĒÁÄÀÂĀÃĪÎÌÏÍÕŌÔÒÖÓŪÛÜÚÑ-]+)/
) &&
name.match(
/last = ([ A-Za-zäáàâāéëèêēūûùüúīîìïíòóöōáäàâçñ.'ÉÈÊËĒÁÄÀÂĀÃĪÎÌÏÍÕŌÔÒÖÓŪÛÜÚÑ-]+)/
)[1];
const full =
middle === null ? first + " " + last : first + " " + middle + " " + last;
return full;
};
module.exports = function(api) {
// Menu Sidebar
api.loadSource((store) => {
// Use the Data Store API here: https://gridsome.org/docs/data-store-api
const data = require("./data/settings.json");
const Menu = store.addCollection({ typeName: "Menu" });
for (const item of data.sidebar) {
Menu.addNode({
section: item.section,
topics: item.topics,
});
}
});
// Exhibitors and Sponsors
const urlForExhibitors =
"http://www.formstack.com/api/v2/form/3340779/submission.json";
api.loadSource(async (actions) => {
const { data } = await axios.get(urlForExhibitors, {
params: {
data: 1,
},
headers: { Authorization: "Bearer " + process.env.FORMSTACK_API },
});
const { submissions } = data;
const Sponsors = actions.addCollection({
typeName: "Sponsors",
});
for (const item of submissions) {
Sponsors.addNode({
id: item.id || "",
type: item.data["88779197"]
? item.data["88779197"].value.split(/\n/)
: "",
name: item.data["73848747"] ? item.data["73848747"].value : "",
description: item.data["73848753"] ? item.data["73848753"].value : "",
website: item.data["73848845"] ? item.data["73848845"].value : "",
social: {
blog: item.data["73848915"] ? item.data["73848915"].value : "",
twitter: item.data["73848950"] ? item.data["73848950"].value : "",
facebook: item.data["73848986"] ? item.data["73848986"].value : "",
youtube: item.data["73849007"] ? item.data["73849007"].value : "",
instagram: item.data["73849017"] ? item.data["73849017"].value : "",
other: item.data["73849899"] ? item.data["73849899"].value : "",
},
books: {
title1Url: item.data["88952778"] ? item.data["88952778"].value : "",
title2Url: item.data["88952779"] ? item.data["88952779"].value : "",
title3Url: item.data["88952780"] ? item.data["88952780"].value : "",
title1Img: item.data["88952791"] ? item.data["88952791"].value : "",
title2Img: item.data["88952792"] ? item.data["88952792"].value : "",
title3Img: item.data["88952800"] ? item.data["88952800"].value : "",
},
level: item.data["89169540"] ? item.data["89169540"].value : "",
logo: path.resolve(
process.cwd(),
"src/assets/img",
slugify(item.data["73848747"].value) + ".jpg"
),
});
}
});
// Program - Organized Sessions, Roundtables, and Contributed Papers
const urlForProgramData =
"http://www.formstack.com/api/v2/form/3922991/submission.json";
api.loadSource(async (actions) => {
const {
data: { pages },
} = await axios.get(urlForProgramData, {
headers: { Authorization: "Bearer " + process.env.FORMSTACK_API },
});
let programData = [];
for (let i = 1; i <= pages; i++) {
const {
data: { submissions },
} = await axios.get(urlForProgramData, {
params: {
page: i,
data: 1,
},
headers: { Authorization: "Bearer " + process.env.FORMSTACK_API },
});
programData = [...programData, ...submissions];
}
const Program = actions.addCollection({
typeName: "Program",
});
for (const item of programData) {
Program.addNode({
sessionID: item.data["94044973"] && item.data["94044973"].value,
sessionGroup: item.data["94044961"] && item.data["94044961"].value,
date: item.data["94044950"] && item.data["94044950"].value,
startTime: item.data["94044948"] && item.data["94044948"].value,
endTime: item.data["94044947"] && item.data["94044947"].value,
joint: item.data["94044180"] && item.data["94044180"].value,
sponsorship: item.data["94044183"] && item.data["94044183"].value,
sessionType: item.data["94175803"] && item.data["94175803"].value,
sessionTitle: item.data["94044186"] && item.data["94044186"].value,
slug:
item.data["94044186"] &&
slugify(item.data["94044186"].value, {
lower: true,
// remove: /[*+~.()'"!:@,?]/g,
strict: true,
}),
sessionAbstract: item.data["94044187"] && item.data["94044187"].value,
sessionTopic: item.data["94044189"] && item.data["94044189"].value,
sessionChronology: item.data["94044190"] && item.data["94044190"].value,
sessionGeography: item.data["94044191"] && item.data["94044191"].value,
keywords: item.data["94044192"] && item.data["94044192"].value,
organizerName:
item.data["94044194"] && nameRender(item.data["94044194"].value),
organizerEmail: item.data["94044195"] && item.data["94044195"].value,
organizerInstitutionalAffiliation:
item.data["94044479"] && item.data["94044479"].value,
coOrganizerName:
item.data["94044206"] && nameRender(item.data["94044206"].value),
coOrganizerEmail: item.data["94044207"] && item.data["94044207"].value,
coOrganizerInstitutionalAffiliation:
item.data["94044495"] && item.data["94044495"].value,
chairName:
item.data["94044216"] && nameRender(item.data["94044216"].value),
chairEmail: item.data["94044217"] && item.data["94044217"].value,
chairInstitutionalAffiliation:
item.data["94044219"] && item.data["94044219"].value,
abstract1Title: item.data["94044226"] && item.data["94044226"].value,
abstract1: item.data["94044227"] && item.data["94044227"].value,
abstract1Topic: item.data["94044229"] && item.data["94044229"].value,
abstract1Chronology:
item.data["94044230"] && item.data["94044230"].value,
abstract1Geography:
item.data["94044231"] && item.data["94044231"].value,
abstract1SelfDesignatedKeywords:
item.data["94044232"] && item.data["94044232"].value,
author1Name:
item.data["94044234"] && nameRender(item.data["94044234"].value),
author1Email: item.data["94044235"] && item.data["94044235"].value,
author1InstitutionalAffiliation:
item.data["94044238"] && item.data["94044238"].value,
coAuthor1Name:
item.data["94044246"] && nameRender(item.data["94044246"].value),
coAuthor1Email: item.data["94044247"] && item.data["94044247"].value,
coAuthor1InstitutionalAffiliation:
item.data["94044251"] && item.data["94044251"].value,
abstract2Title: item.data["94044258"] && item.data["94044258"].value,
abstract2: item.data["94044259"] && item.data["94044259"].value,
abstract2Topic: item.data["94044261"] && item.data["94044261"].value,
abstract2Chronology:
item.data["94044262"] && item.data["94044262"].value,
abstract2Geography:
item.data["94044263"] && item.data["94044263"].value,
abstract2SelfDesignatedKeywords:
item.data["94044264"] && item.data["94044264"].value,
author2Name:
item.data["94044266"] && nameRender(item.data["94044266"].value),
author2Email: item.data["94044267"] && item.data["94044267"].value,
author2InstitutionalAffiliation:
item.data["94044270"] && item.data["94044270"].value,
coAuthor2Name:
item.data["94044278"] && nameRender(item.data["94044278"].value),
coAuthor2Email: item.data["94044279"] && item.data["94044279"].value,
coAuthor2InstitutionalAffiliation:
item.data["94044283"] && item.data["94044283"].value,
abstract3Title: item.data["94044290"] && item.data["94044290"].value,
abstract3: item.data["94044291"] && item.data["94044291"].value,
abstract3Topic: item.data["94044293"] && item.data["94044293"].value,
abstract3Chronology:
item.data["94044294"] && item.data["94044294"].value,
abstract3Geography:
item.data["94044295"] && item.data["94044295"].value,
abstract3SelfDesignatedKeywords:
item.data["94044296"] && item.data["94044296"].value,
author3Name:
item.data["94044298"] && nameRender(item.data["94044298"].value),
author3Email: item.data["94044299"] && item.data["94044299"].value,
author3InstitutionalAffiliation:
item.data["94044302"] && item.data["94044302"].value,
coAuthor3Name:
item.data["94044310"] && nameRender(item.data["94044310"].value),
coAuthor3Email: item.data["94044311"] && item.data["94044311"].value,
coAuthor3InstitutionalAffiliation:
item.data["94044314"] && item.data["94044314"].value,
abstract4Title: item.data["94044321"] && item.data["94044321"].value,
abstract4: item.data["94044322"] && item.data["94044322"].value,
abstract4Topic: item.data["94044324"] && item.data["94044324"].value,
abstract4Chronology:
item.data["94044325"] && item.data["94044325"].value,
abstract4Geography:
item.data["94044326"] && item.data["94044326"].value,
abstract4SelfDesignatedKeywords:
item.data["94044327"] && item.data["94044327"].value,
author4Name:
item.data["94044329"] && nameRender(item.data["94044329"].value),
author4Email: item.data["94044330"] && item.data["94044330"].value,
author4InstitutionalAffiliation:
item.data["94044333"] && item.data["94044333"].value,
coAuthor4Name:
item.data["94044341"] && nameRender(item.data["94044341"].value),
coAuthor4Email: item.data["94044342"] && item.data["94044342"].value,
coAuthor4InstitutionalAffiliation:
item.data["94044346"] && item.data["94044346"].value,
commentatorName:
item.data["94044353"] && nameRender(item.data["94044353"].value),
commentatorEmail: item.data["94044354"] && item.data["94044354"].value,
commentatorInstitutionalAffiliation:
item.data["94044356"] && item.data["94044356"].value,
abstract5Title: item.data["94446559"] && item.data["94446559"].value,
abstract5: item.data["94446560"] && item.data["94446560"].value,
abstract5Topic: item.data["94446561"] && item.data["94446561"].value,
abstract5Chronology:
item.data["94446562"] && item.data["94446562"].value,
abstract5Geography:
item.data["94446563"] && item.data["94446563"].value,
abstract5SelfDesignatedKeywords:
item.data["94446564"] && item.data["94446564"].value,
author5Name:
item.data["94044662"] && nameRender(item.data["94044662"].value),
author5Email: item.data["94044663"] && item.data["94044663"].value,
author5InstitutionalAffiliation:
item.data["94044664"] && item.data["94044664"].value,
coAuthor5Name:
item.data["94044669"] && nameRender(item.data["94044669"].value),
coAuthor5Email: item.data["94044670"] && item.data["94044670"].value,
coAuthor5InstitutionalAffiliation:
item.data["94044671"] && item.data["94044671"].value,
abstract6Title: item.data["94446578"] && item.data["94446578"].value,
abstract6: item.data["94446579"] && item.data["94446579"].value,
abstract6Topic: item.data["94446580"] && item.data["94446580"].value,
abstract6Chronology:
item.data["94446581"] && item.data["94446581"].value,
abstract6Geography:
item.data["94446582"] && item.data["94446582"].value,
abstract6SelfDesignatedKeywords:
item.data["94446583"] && item.data["94446583"].value,
author6Name:
item.data["94044698"] && nameRender(item.data["94044698"].value),
author6Email: item.data["94044699"] && item.data["94044699"].value,
author6InstitutionalAffiliation:
item.data["94044700"] && item.data["94044700"].value,
coAuthor6Name:
item.data["94044713"] && nameRender(item.data["94044713"].value),
coAuthor6Email: item.data["94044714"] && item.data["94044714"].value,
coAuthor6InstitutionalAffiliation:
item.data["94044715"] && item.data["94044715"].value,
abstract7Title: item.data["94446591"] && item.data["94446591"].value,
abstract7: item.data["94446592"] && item.data["94446592"].value,
abstract7Topic: item.data["94446593"] && item.data["94446593"].value,
abstract7Chronology:
item.data["94446594"] && item.data["94446594"].value,
abstract7Geography:
item.data["94446595"] && item.data["94446595"].value,
abstract7SelfDesignatedKeywords:
item.data["94446596"] && item.data["94446596"].value,
author7Name:
item.data["94044748"] && nameRender(item.data["94044748"].value),
author7Email: item.data["94044749"] && item.data["94044749"].value,
author7InstitutionalAffiliation:
item.data["94044750"] && item.data["94044750"].value,
coAuthor7Name:
item.data["94044758"] && nameRender(item.data["94044758"].value),
coAuthor7Email: item.data["94044759"] && item.data["94044759"].value,
coAuthor7InstitutionalAffiliation:
item.data["94044760"] && item.data["94044760"].value,
abstract8Title: item.data["94446610"] && item.data["94446610"].value,
abstract8: item.data["94446611"] && item.data["94446611"].value,
abstract8Topic: item.data["94446612"] && item.data["94446612"].value,
abstract8Chronology:
item.data["94446613"] && item.data["94446613"].value,
abstract8Geography:
item.data["94446614"] && item.data["94446614"].value,
abstract8SelfDesignatedKeywords:
item.data["94446615"] && item.data["94446615"].value,
author8Name:
item.data["94044768"] && nameRender(item.data["94044768"].value),
author8Email: item.data["94044769"] && item.data["94044769"].value,
author8InstitutionalAffiliation:
item.data["94044770"] && item.data["94044770"].value,
coAuthor8Name:
item.data["94044874"] && nameRender(item.data["94044874"].value),
coAuthor8Email: item.data["94044875"] && item.data["94044875"].value,
coAuthor8InstitutionalAffiliation:
item.data["94044876"] && item.data["94044876"].value,
abstract9Title: item.data["94446718"] && item.data["94446718"].value,
abstract9: item.data["94446719"] && item.data["94446719"].value,
abstract9Topic: item.data["94446720"] && item.data["94446720"].value,
abstract9Chronology:
item.data["94446721"] && item.data["94446721"].value,
abstract9Geography:
item.data["94446722"] && item.data["94446722"].value,
abstract9SelfDesignatedKeywords:
item.data["94446723"] && item.data["94446723"].value,
author9Name:
item.data["94446652"] && nameRender(item.data["94446652"].value),
author9Email: item.data["94446653"] && item.data["94446653"].value,
author9InstitutionalAffiliation:
item.data["94446654"] && item.data["94446654"].value,
});
}
});
api.createPages(async ({ graphql, createPage }) => {
const { data } = await graphql(
`
{
allProgram {
edges {
node {
id
slug
}
}
}
}
`
);
data.allProgram.edges.forEach(({ node }) => {
createPage({
path: `/program/${node.slug}`,
component: "./src/templates/Abstract.vue",
context: {
id: node.id,
},
});
});
});
};
|
$().ready(function() {
validateRule();
});
$.validator.setDefaults({
submitHandler : function() {
update();
}
});
function update() {
$.ajax({
cache : true,
type : "POST",
url : "/system/config/update",
data : {configItem:"pay_audit_auto_acp",
configValue:$(":radio:checked").val(),
parentItem:"payAuditConfig"
},// 你的formid
async : false,
error : function(request) {
parent.layer.alert("Connection error");
},
success : function(data) {
if (data.code == 0) {
parent.layer.msg("操作成功");
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
} else {
parent.layer.alert(data.msg)
}
}
});
}
function validateRule() {
var icon = "<i class='fa fa-times-circle'></i> ";
$("#signupForm").validate({
rules : {
},
messages : {
}
})
}
|
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------
from unittest import main
from qiita_pet.test.tornado_test_base import TestHandlerBase
from mock import Mock
from qiita_db.user import User
from qiita_pet.handlers.base_handlers import BaseHandler
class TestSoftware(TestHandlerBase):
def test_get(self):
response = self.get('/software/')
self.assertEqual(response.code, 200)
body = response.body.decode('ascii')
self.assertNotEqual(body, "")
# checking that this software is not displayed
self.assertNotIn('Target Gene', body)
BaseHandler.get_current_user = Mock(return_value=User("admin@foo.bar"))
response = self.get('/software/')
self.assertEqual(response.code, 200)
body = response.body.decode('ascii')
self.assertNotEqual(body, "")
# checking that this software is displayed
self.assertIn('Target Gene', body)
if __name__ == "__main__":
main()
|
"use strict";
var _mocha = require("mocha");
var _chai = require("chai");
var _user_code_runner = _interopRequireDefault(require("./user_code_runner"));
var _bluebird = _interopRequireDefault(require("bluebird"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(0, _mocha.describe)('UserCodeRunner', () => {
(0, _mocha.describe)('run()', () => {
(0, _mocha.beforeEach)(function () {
this.options = {
argsArray: [],
thisArg: {},
timeoutInMilliseconds: 100
};
});
(0, _mocha.describe)('function uses synchronous interface', () => {
(0, _mocha.describe)('function throws serializable error', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function () {
throw 'error'; // eslint-disable-line no-throw-literal
};
});
(0, _mocha.it)('returns the error', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceOf(Error);
(0, _chai.expect)(error.message).to.eql('error');
(0, _chai.expect)(result).to.eql(undefined);
});
});
(0, _mocha.describe)('function throws non-serializable error', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function () {
const error = {};
error.error = error;
throw error;
};
});
(0, _mocha.it)('returns the error', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceOf(Error);
(0, _chai.expect)(error.message).to.eql('{ error: [Circular] }');
(0, _chai.expect)(result).to.eql(undefined);
});
});
(0, _mocha.describe)('function returns', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function () {
return 'result';
};
});
(0, _mocha.it)('returns the return value of the function', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.eql(undefined);
(0, _chai.expect)(result).to.eql('result');
});
});
});
(0, _mocha.describe)('function uses callback interface', () => {
(0, _mocha.describe)('function asynchronously throws', () => {// Cannot unit test because mocha also sets an uncaught exception handler
});
(0, _mocha.describe)('function calls back with serializable error', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function (callback) {
setTimeout(() => {
callback('error'); // eslint-disable-line standard/no-callback-literal
}, 25);
};
});
(0, _mocha.it)('returns the error', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceOf(Error);
(0, _chai.expect)(error.message).to.eql('error');
(0, _chai.expect)(result).to.eql(undefined);
});
});
(0, _mocha.describe)('function calls back with non-serializable rror', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function (callback) {
const error = {};
error.error = error;
setTimeout(() => {
callback(error);
}, 25);
};
});
(0, _mocha.it)('returns the error', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceOf(Error);
(0, _chai.expect)(error.message).to.eql('{ error: [Circular] }');
(0, _chai.expect)(result).to.eql(undefined);
});
});
(0, _mocha.describe)('function calls back with result', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function (callback) {
setTimeout(() => {
callback(null, 'result');
}, 25);
};
});
(0, _mocha.it)('returns the what the function calls back with', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.eql(undefined);
(0, _chai.expect)(result).to.eql('result');
});
});
(0, _mocha.describe)('function times out', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function (callback) {
setTimeout(() => {
callback(null, 'result');
}, 200);
};
});
(0, _mocha.it)('returns timeout as an error', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceof(Error);
(0, _chai.expect)(error.message).to.eql('function timed out, ensure the callback is executed within 100 milliseconds');
(0, _chai.expect)(result).to.eql(undefined);
});
});
(0, _mocha.describe)('timeout of -1', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function (callback) {
setTimeout(() => {
callback(null, 'result');
}, 200);
};
this.options.timeoutInMilliseconds = -1;
});
(0, _mocha.it)('disables timeout protection', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.eql(undefined);
(0, _chai.expect)(result).to.eql('result');
});
});
});
(0, _mocha.describe)('function uses promise interface', () => {
(0, _mocha.describe)('function asynchronously throws', () => {// Cannot unit test because mocha also sets an uncaught exception handler
});
(0, _mocha.describe)('promise resolves', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function () {
return _bluebird.default.resolve('result');
};
});
(0, _mocha.it)('returns what the promise resolves to', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.eql(undefined);
(0, _chai.expect)(result).to.eql('result');
});
});
(0, _mocha.describe)('promise rejects with reason', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function () {
return _bluebird.default.reject('error'); // eslint-disable-line prefer-promise-reject-errors
};
});
(0, _mocha.it)('returns what the promise rejects as an error', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceOf(Error);
(0, _chai.expect)(error.message).to.eql('error');
(0, _chai.expect)(result).to.eql(undefined);
});
});
(0, _mocha.describe)('promise rejects without reason', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function () {
return _bluebird.default.reject(); // eslint-disable-line prefer-promise-reject-errors
};
});
(0, _mocha.it)('returns a helpful error message', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceOf(Error);
(0, _chai.expect)(error.message).to.eql('Promise rejected without a reason');
(0, _chai.expect)(result).to.eql(undefined);
});
});
(0, _mocha.describe)('promise times out', function () {
(0, _mocha.beforeEach)(function () {
this.options.fn = function () {
return _bluebird.default.resolve('result').delay(200);
};
});
(0, _mocha.it)('returns timeout as an error', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceof(Error);
(0, _chai.expect)(error.message).to.eql('function timed out, ensure the promise resolves within 100 milliseconds');
(0, _chai.expect)(result).to.eql(undefined);
});
});
(0, _mocha.describe)('timeout of -1', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function () {
return _bluebird.default.resolve('result').delay(200);
};
this.options.timeoutInMilliseconds = -1;
});
(0, _mocha.it)('disables timeout protection', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.eql(undefined);
(0, _chai.expect)(result).to.eql('result');
});
});
});
(0, _mocha.describe)('function uses multiple asynchronous interfaces: callback and promise', () => {
(0, _mocha.beforeEach)(function () {
this.options.fn = function (callback) {
callback();
return _bluebird.default.resolve();
};
});
(0, _mocha.it)('returns an error that multiple interface are used', async function () {
const {
error: error,
result: result
} = await _user_code_runner.default.run(this.options);
(0, _chai.expect)(error).to.be.instanceof(Error);
(0, _chai.expect)(error.message).to.eql('function uses multiple asynchronous interfaces: callback and promise\n' + 'to use the callback interface: do not return a promise\n' + 'to use the promise interface: remove the last argument to the function');
(0, _chai.expect)(result).to.eql(undefined);
});
});
});
});
|
var searchData=
[
['receiver_8368',['Receiver',['../class_quant_ext_1_1_average_o_i_s.html#a1d1cfd8ffb84e947f82999c682b666a7a7928a668954c57bb64a7a9d98994cbaa',1,'QuantExt::AverageOIS::Receiver()'],['../class_quant_ext_1_1_cross_ccy_fix_float_swap.html#a1d1cfd8ffb84e947f82999c682b666a7a7928a668954c57bb64a7a9d98994cbaa',1,'QuantExt::CrossCcyFixFloatSwap::Receiver()'],['../class_quant_ext_1_1_fixed_b_m_a_swap.html#a1d1cfd8ffb84e947f82999c682b666a7a7928a668954c57bb64a7a9d98994cbaa',1,'QuantExt::FixedBMASwap::Receiver()'],['../class_quant_ext_1_1_overnight_indexed_basis_swap.html#a1d1cfd8ffb84e947f82999c682b666a7a7928a668954c57bb64a7a9d98994cbaa',1,'QuantExt::OvernightIndexedBasisSwap::Receiver()']]]
];
|
import React from "react";
import PropTypes from "prop-types";
import { Field, reduxForm } from "redux-form";
import {
Paper,
Typography,
withStyles,
Avatar,
Divider,
IconButton
} from "@material-ui/core";
import DefaultInput from "../../../shared/components/DefaultInput";
import styles from "./styles";
import { connect } from "react-redux";
const formName = "userInfo";
const UserCard = ({
classes,
handleSubmit,
user,
isEditing,
editInfo,
saveInfo
}) => {
return (
<Paper className={classes.card}>
<form onSubmit={handleSubmit(saveInfo)}>
<div className={classes.header}>
<div className={classes.title}>
<Avatar className={classes.avatar}>
<i className="material-icons">info</i>
</Avatar>
<Typography variant="subtitle1">User information</Typography>
</div>
{!isEditing && (
<IconButton className={classes.primary} onClick={editInfo}>
<i
className="material-icons"
>
edit
</i>
</IconButton>
)}
{isEditing && (
<IconButton className={classes.secondary} type="submit" onClick={editInfo}>
<i
className="material-icons"
>
save
</i>
</IconButton>
)}
</div>
<Divider />
<div className={classes.body}>
<div className={classes.fields}>
<Field
name="userName"
title="Username"
disabled={!isEditing}
required={false}
component={DefaultInput}
classes={classes}
/>
<Field
name="group"
title="Group"
disabled={!isEditing}
required={false}
component={DefaultInput}
classes={classes}
/>
<Field
name="firstName"
title="First name"
disabled={!isEditing}
required={false}
component={DefaultInput}
classes={classes}
/>
<Field
name="lastName"
title="Last name"
disabled={!isEditing}
required={false}
component={DefaultInput}
classes={classes}
/>
<Field
name="email"
title="Email"
disabled={!isEditing}
required={false}
component={DefaultInput}
classes={classes}
/>
<Field
name="phoneNumber"
title="Phone number"
disabled={!isEditing}
required={false}
component={DefaultInput}
classes={classes}
/>
</div>
</div>
</form>
</Paper>
);
};
UserCard.propTypes = {
classes: PropTypes.object.isRequired,
user: PropTypes.object.isRequired,
editInfo: PropTypes.func.isRequired,
saveInfo: PropTypes.func.isRequired,
isEditing: PropTypes.bool
};
let UserCardForm = withStyles(styles)(UserCard);
UserCardForm = reduxForm({
form: formName,
touchOnChange: false,
touchOnBlur: true,
enableReinitialize: true
})(UserCardForm);
UserCardForm = connect(state => ({
initialValues: {
...state.user,
isEditing: false,
group: state.user.group.name
}
}))(UserCardForm);
export default UserCardForm
|
import React from "react";
import {
StyleSheet,
Text,
View,
TouchableOpacity,
ImageBackground,
} from "react-native";
import DefaultText from "./DefaultText";
const MealItem = (props) => {
return (
<View style={{ ...styles.mealItem, ...props.style }}>
<TouchableOpacity onPress={props.onSelectMeal}>
<View>
<View style={{ ...styles.mealRow, ...styles.mealHeader }}>
<ImageBackground
source={{ uri: props.image }}
style={styles.backgroundImage}
>
<View style={styles.titleContainer}>
<Text style={styles.title} numberOfLines={1}>
{props.title}
</Text>
</View>
</ImageBackground>
</View>
<View style={{ ...styles.mealRow, ...styles.mealDetail }}>
<DefaultText>{props.duration}m</DefaultText>
<DefaultText>{props.complexity}</DefaultText>
<DefaultText>{props.affordability}</DefaultText>
</View>
</View>
</TouchableOpacity>
</View>
);
};
const styles = StyleSheet.create({
mealItem: {
flex: 1,
height: 200,
// width: "100%",
backgroundColor: "#ccc",
borderRadius: 15,
overflow: "hidden",
margin: 10,
},
mealRow: {
flexDirection: "row",
},
mealHeader: {
height: "85%",
},
mealDetail: {
paddingHorizontal: 10,
justifyContent: "space-between",
alignItems: "center",
height: "15%",
},
backgroundImage: {
width: "100%",
height: "100%",
justifyContent: "flex-end",
},
title: {
fontFamily: "open-sans-bold",
fontSize: 20,
color: "white",
},
titleContainer: {
paddingVertical: 5,
paddingHorizontal: 10,
backgroundColor: "rgba(0,0,0,0.5)",
},
});
export default MealItem;
|
#!/usr/bin/env python
import io
import re
from setuptools import find_packages, setup
with io.open('./rubicon/objc/__init__.py', encoding='utf8') as version_file:
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file.read(), re.M)
if version_match:
version = version_match.group(1)
else:
raise RuntimeError("Unable to find version string.")
with io.open('README.rst', encoding='utf8') as readme:
long_description = readme.read()
setup(
name='rubicon-objc',
version=version,
description='A bridge between an Objective C runtime environment and Python.',
long_description=long_description,
author='Russell Keith-Magee',
author_email='russell@keith-magee.com',
url='http://pybee.org/rubicon',
packages=find_packages(exclude=['tests']),
namespace_packages=['rubicon'],
license='New BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Objective C',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development',
],
test_suite='tests',
)
|
import ComponentBase from '../../utils/componentbase/ComponentBase.js';
import {
TextType, TagTextType, BitmapTextType
} from '../../utils/text/GetTextObjectType.js';
import GetTextObjectType from '../../utils/text/GetTextObjectType.js';
import TextToLines from '../../utils/text/TextToLines.js';
import Methods from './methods/Methods.js';
const GetValue = Phaser.Utils.Objects.GetValue;
const Clamp = Phaser.Math.Clamp;
class TextPage extends ComponentBase {
constructor(gameObject, config) {
super(gameObject, { eventEmitter: false });
// No event emitter
// this.parent = gameObject;
this.textObjectType = GetTextObjectType(this.parent);
this.pageStartIndexes = [];
// Text object : array of string
// Tag text object : pens-manager
// Bitmap text object : array of string
this.lines = TextToLines(this.parent, '');
this.sections = [];
this.resetFromJSON(config);
}
resetFromJSON(o) {
this.setMaxLines(GetValue(o, 'maxLines', undefined));
this.setPageBreak(GetValue(o, 'pageBreak', '\f\n'));
this.setText(GetValue(o, 'text', ''));
this.setStartLineIndex(GetValue(o, 'start', 0));
this.setPageIndex(GetValue(o, 'page', -1));
return this;
}
toJSON() {
return {
maxLines: this.maxLines,
text: this.content,
start: this.startLineIndex,
page: this.pageIndex,
pageBreak: this.pageBreak
};
}
shutdown(fromScene) {
// Already shutdown
if (this.isShutdown) {
return;
}
switch (this.textObjectType) {
case TextType:
this.lines.length = 0;
break;
case TagTextType:
this.lines.destroy();
break;
case BitmapTextType:
this.lines.length = 0;
break;
}
this.pageStartIndexes.length = 0;
this.sections.length = 0;
this.lines = undefined;
this.pageStartIndexes = undefined;
this.sections = undefined;
super.shutdown(fromScene);
}
setMaxLines(maxLines) {
this.maxLines = maxLines;
return this;
}
setPageBreak(pageBreak) {
this.pageBreak = pageBreak;
return this;
}
get pageCount() {
return this.pageStartIndexes.length;
}
get isFirstPage() {
return (this.pageIndex <= 0);
}
get isLastPage() {
return (this.pageIndex >= (this.pageCount - 1));
}
get totalLinesCount() {
return (this.lines) ? this.lines.length : 0;
}
get startLineIndex() {
return this._startLineIndex;
}
set startLineIndex(value) {
value = Clamp(value, 0, this.totalLinesCount - 1);
this._startLineIndex = value;
}
setStartLineIndex(idx) {
this.startLineIndex = idx;
return this;
}
get pageLinesCount() {
if (this.maxLines !== undefined) {
return this.maxLines;
} else {
var count;
switch (this.textObjectType) {
case TextType:
case TagTextType:
var maxLines = this.parent.style.maxLines;
if (maxLines > 0) {
count = maxLines;
} else {
count = this.totalLinesCount;
}
break;
case BitmapTextType:
count = this.totalLinesCount;
break;
}
return count;
}
}
get content() {
return this.sections.join(this.pageBreak);
}
}
Object.assign(
TextPage.prototype,
Methods,
);
export default TextPage;
|
/* jqBootstrapValidation
* A plugin for automating validation on Twitter Bootstrap formatted forms.
*
* v1.3.6
*
* License: MIT <http://opensource.org/licenses/mit-license.php> - see LICENSE file
*
* http://ReactiveRaven.github.com/jqBootstrapValidation/
*/
(function ($) {
var createdElements = [];
var defaults = {
options: {
prependExistingHelpBlock: false
, sniffHtml: true, // sniff for 'required', 'maxlength', etc
preventSubmit: true, // stop the form submit event from firing if validation fails
submitError: false, // function called if there is an error when trying to submit
submitSuccess: false, // function called just before a successful submit event is sent to the server
semanticallyStrict: false, // set to true to tidy up generated HTML output
bindEvents: [],
autoAdd: {
helpBlocks: true
}
, filter: function () {
// return $(this).is(":visible"); // only validate elements you can see
return true; // validate everything
}
}
, methods: {
init: function (options) {
var settings = $.extend(true, {}, defaults);
settings.options = $.extend(true, settings.options, options);
var $siblingElements = this;
var uniqueForms = $.unique($siblingElements.map(function () {
return $(this).parents("form")[0];
}).toArray());
$(uniqueForms).bind("submit.validationSubmit", function (e) {
var $form = $(this);
var warningsFound = 0;
var $allInputs = $form.find("input,textarea,select").not("[type=submit],[type=image]").filter(settings.options.filter);
var $allControlGroups = $form.find(".form-group");
var $inputsWithValidators = $allInputs.filter(function () {
return $(this).triggerHandler("getValidatorCount.validation") > 0;
});
$inputsWithValidators.trigger("submit.validation");
$allInputs.trigger("validationLostFocus.validation");
$allControlGroups.each(function (i, el) {
var $controlGroup = $(el);
if ($controlGroup.hasClass("issue") || $controlGroup.hasClass("error")) {
$controlGroup.removeClass("issue").addClass("error");
warningsFound++;
}
});
if (warningsFound) {
if (settings.options.preventSubmit) {
e.preventDefault();
e.stopImmediatePropagation();
}
} else {
$form.removeClass("error");
if ($.isFunction(settings.options.submitSuccess)) {
settings.options.submitSuccess($form, e);
}
}
});
return this.each(function () {
var $this = $(this)
, $controlGroup = $this.parents(".form-group").first()
, $helpBlock = $controlGroup.find(".help-block").first()
, $form = $this.parents("form").first()
, validatorNames = [];
if ($this.attr("disabled") !== undefined) {
$this.removeClass('required');
}
if (!$helpBlock.length && settings.options.autoAdd && settings.options.autoAdd.helpBlocks) {
$helpBlock = $('<div class="help-block" />');
$controlGroup.find('.controls').append($helpBlock);
createdElements.push($helpBlock[0]);
}
if (settings.options.sniffHtml) {
var message;
if ($this.data("validationPatternPattern")) {
$this.attr("pattern", $this.data("validationPatternPattern"));
}
if ($this.attr("pattern") !== undefined) {
message = "Not in the expected format<!-- data-validation-pattern-message to override -->";
if ($this.data("validationPatternMessage")) {
message = $this.data("validationPatternMessage");
}
$this.data("validationPatternMessage", message);
$this.data("validationPatternRegex", $this.attr("pattern"));
}
if ($this.attr("max") !== undefined || $this.attr("aria-valuemax") !== undefined) {
var max = ($this.attr("max") !== undefined ? $this.attr("max") : $this.attr("aria-valuemax"));
message = "Too high: Maximum of '" + max + "'<!-- data-validation-max-message to override -->";
if ($this.data("validationMaxMessage")) {
message = $this.data("validationMaxMessage");
}
$this.data("validationMaxMessage", message);
$this.data("validationMaxMax", max);
}
if ($this.attr("min") !== undefined || $this.attr("aria-valuemin") !== undefined) {
var min = ($this.attr("min") !== undefined ? $this.attr("min") : $this.attr("aria-valuemin"));
message = "Too low: Minimum of '" + min + "'<!-- data-validation-min-message to override -->";
if ($this.data("validationMinMessage")) {
message = $this.data("validationMinMessage");
}
$this.data("validationMinMessage", message);
$this.data("validationMinMin", min);
}
if ($this.attr("maxlength") !== undefined) {
message = "Too long: Maximum of '" + $this.attr("maxlength") + "' characters<!-- data-validation-maxlength-message to override -->";
if ($this.data("validationMaxlengthMessage")) {
message = $this.data("validationMaxlengthMessage");
}
$this.data("validationMaxlengthMessage", message);
$this.data("validationMaxlengthMaxlength", $this.attr("maxlength"));
}
if ($this.attr("minlength") !== undefined) {
message = "Too short: Minimum of '" + $this.attr("minlength") + "' characters<!-- data-validation-minlength-message to override -->";
if ($this.data("validationMinlengthMessage")) {
message = $this.data("validationMinlengthMessage");
}
$this.data("validationMinlengthMessage", message);
$this.data("validationMinlengthMinlength", $this.attr("minlength"));
}
if ($this.attr("required") !== undefined || $this.attr("aria-required") !== undefined) {
message = settings.builtInValidators.required.message;
if ($this.data("validationRequiredMessage")) {
message = $this.data("validationRequiredMessage");
}
$this.data("validationRequiredMessage", message);
}
if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "number") {
message = settings.validatorTypes.number.message;
if ($this.data("validationNumberMessage")) {
message = $this.data("validationNumberMessage");
}
$this.data("validationNumberMessage", message);
var step = settings.validatorTypes.number.step;
if ($this.data("validationNumberStep")) {
step = $this.data("validationNumberStep");
}
$this.data("validationNumberStep", step);
var decimal = settings.validatorTypes.number.decimal;
if ($this.data("validationNumberDecimal")) {
decimal = $this.data("validationNumberDecimal");
}
$this.data("validationNumberDecimal", decimal);
}
if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "email") {
message = "Not a valid email address<!-- data-validation-email-message to override -->";
if ($this.data("validationEmailMessage")) {
message = $this.data("validationEmailMessage");
}
$this.data("validationEmailMessage", message);
}
if ($this.attr("minchecked") !== undefined) {
message = "Not enough options checked; Minimum of '" + $this.attr("minchecked") + "' required<!-- data-validation-minchecked-message to override -->";
if ($this.data("validationMincheckedMessage")) {
message = $this.data("validationMincheckedMessage");
}
$this.data("validationMincheckedMessage", message);
$this.data("validationMincheckedMinchecked", $this.attr("minchecked"));
}
if ($this.attr("maxchecked") !== undefined) {
message = "Too many options checked; Maximum of '" + $this.attr("maxchecked") + "' required<!-- data-validation-maxchecked-message to override -->";
if ($this.data("validationMaxcheckedMessage")) {
message = $this.data("validationMaxcheckedMessage");
}
$this.data("validationMaxcheckedMessage", message);
$this.data("validationMaxcheckedMaxchecked", $this.attr("maxchecked"));
}
}
if ($this.data("validation") !== undefined) {
validatorNames = $this.data("validation").split(",");
}
$.each($this.data(), function (i, el) {
var parts = i.replace(/([A-Z])/g, ",$1").split(",");
if (parts[0] === "validation" && parts[1]) {
validatorNames.push(parts[1]);
}
});
var validatorNamesToInspect = validatorNames;
var newValidatorNamesToInspect = [];
var uppercaseEachValidatorName = function (i, el) {
validatorNames[i] = formatValidatorName(el);
};
var inspectValidators = function (i, el) {
if ($this.data("validation" + el + "Shortcut") !== undefined) {
$.each($this.data("validation" + el + "Shortcut").split(","), function (i2, el2) {
newValidatorNamesToInspect.push(el2);
});
} else if (settings.builtInValidators[el.toLowerCase()]) {
var validator = settings.builtInValidators[el.toLowerCase()];
if (validator.type.toLowerCase() === "shortcut") {
$.each(validator.shortcut.split(","), function (i, el) {
el = formatValidatorName(el);
newValidatorNamesToInspect.push(el);
validatorNames.push(el);
});
}
}
};
do {
$.each(validatorNames, uppercaseEachValidatorName);
validatorNames = $.unique(validatorNames);
newValidatorNamesToInspect = [];
$.each(validatorNamesToInspect, inspectValidators);
validatorNamesToInspect = newValidatorNamesToInspect;
} while (validatorNamesToInspect.length > 0);
var validators = {};
$.each(validatorNames, function (i, el) {
var message = $this.data("validation" + el + "Message");
var hasOverrideMessage = !!message;
var foundValidator = false;
if (!message) {
message = "'" + el + "' validation failed <!-- Add attribute 'data-validation-" + el.toLowerCase() + "-message' to input to change this message -->";
}
$.each(settings.validatorTypes, function (validatorType, validatorTemplate) {
if (validators[validatorType] === undefined) {
validators[validatorType] = [];
}
if (!foundValidator && $this.data("validation" + el + formatValidatorName(validatorTemplate.name)) !== undefined) {
var initted = validatorTemplate.init($this, el);
if (hasOverrideMessage) {
initted.message = message;
}
validators[validatorType].push($.extend(true, {
name: formatValidatorName(validatorTemplate.name)
, message: message
}, initted));
foundValidator = true;
}
});
if (!foundValidator && settings.builtInValidators[el.toLowerCase()]) {
var validator = $.extend(true, {}, settings.builtInValidators[el.toLowerCase()]);
if (hasOverrideMessage) {
validator.message = message;
}
var validatorType = validator.type.toLowerCase();
if (validatorType === "shortcut") {
foundValidator = true;
} else {
$.each(settings.validatorTypes, function (validatorTemplateType, validatorTemplate) {
if (validators[validatorTemplateType] === undefined) {
validators[validatorTemplateType] = [];
}
if (!foundValidator && validatorType === validatorTemplateType.toLowerCase()) {
$this.data("validation" + el + formatValidatorName(validatorTemplate.name), validator[validatorTemplate.name.toLowerCase()]);
validators[validatorType].push($.extend(validator, validatorTemplate.init($this, el)));
foundValidator = true;
}
});
}
}
if (!foundValidator) {
$.error("Cannot find validation info for '" + el + "'");
}
});
$helpBlock.data("original-contents", ($helpBlock.data("original-contents") ? $helpBlock.data("original-contents") : $helpBlock.html()));
$helpBlock.data("original-role", ($helpBlock.data("original-role") ? $helpBlock.data("original-role") : $helpBlock.attr("role")));
$controlGroup.data("original-classes", ($controlGroup.data("original-clases") ? $controlGroup.data("original-classes") : $controlGroup.attr("class")));
$this.data("original-aria-invalid", ($this.data("original-aria-invalid") ? $this.data("original-aria-invalid") : $this.attr("aria-invalid")));
$this.bind("validation.validation", function (event, params) {
var value = getValue($this);
var errorsFound = [];
$.each(validators, function (validatorType, validatorTypeArray) {
if (value || value.length || ((params && params.includeEmpty) || !!settings.validatorTypes[validatorType].includeEmpty) || (!!settings.validatorTypes[validatorType].blockSubmit && params && !!params.submitting)) {
$.each(validatorTypeArray, function (i, validator) {
if (settings.validatorTypes[validatorType].validate($this, value, validator)) {
errorsFound.push(validator.message);
}
});
}
});
return errorsFound;
});
$this.bind("getValidators.validation", function () {
return validators;
});
var numValidators = 0;
$.each(validators, function (i, el) {
numValidators += el.length;
});
$this.bind("getValidatorCount.validation", function () {
return numValidators;
});
$this.bind("submit.validation", function () {
return $this.triggerHandler("change.validation", {
submitting: true
});
});
$this.bind((settings.options.bindEvents.length > 0 ? settings.options.bindEvents : ["keyup", "focus", "blur", "click", "keydown", "keypress", "change"]).concat(["revalidate"]).join(".validation ") + ".validation", function (e, params) {
var value = getValue($this);
var errorsFound = [];
if (params && !!params.submitting) {
$controlGroup.data("jqbvIsSubmitting", true);
} else if (e.type !== "revalidate") {
$controlGroup.data("jqbvIsSubmitting", false);
}
var formIsSubmitting = !!$controlGroup.data("jqbvIsSubmitting");
$controlGroup.find("input,textarea,select").not('[type=submit]').each(function (i, el) {
var oldCount = errorsFound.length;
$.each($(el).triggerHandler("validation.validation", params) || [], function (j, message) {
errorsFound.push(message);
});
if (errorsFound.length > oldCount) {
$(el).attr("aria-invalid", "true");
} else {
var original = $this.data("original-aria-invalid");
$(el).attr("aria-invalid", (original !== undefined ? original : false));
}
});
$form.find("input,select,textarea").not($this).not("[name=\"" + $this.attr("name") + "\"]").trigger("validationLostFocus.validation");
errorsFound = $.unique(errorsFound.sort());
if (errorsFound.length) {
$controlGroup.removeClass("validate error issue").addClass(formIsSubmitting ? "error" : "issue");
if (settings.options.semanticallyStrict && errorsFound.length === 1) {
$helpBlock.html(errorsFound[0] + (settings.options.prependExistingHelpBlock ? $helpBlock.data("original-contents") : ""));
} else {
$helpBlock.html("<ul role=\"alert\"><li>" + errorsFound.join("</li><li>") + "</li></ul>" + (settings.options.prependExistingHelpBlock ? $helpBlock.data("original-contents") : ""));
}
} else {
$controlGroup.removeClass("issue error validate");
if (value.length > 0) {
$controlGroup.addClass("validate");
}
$helpBlock.html($helpBlock.data("original-contents"));
}
if (e.type === "blur") {
if (settings.options.removeSuccess) {
}
}
});
$this.bind("validationLostFocus.validation", function () {
if (settings.options.removeSuccess) {
}
});
});
}
, destroy: function () {
return this.each(function () {
var $this = $(this)
, $controlGroup = $this.parents(".form-group").first()
, $helpBlock = $controlGroup.find(".help-block").first()
, $form = $this.parents("form").first();
$this.unbind('.validation');
$form.unbind(".validationSubmit");
$helpBlock.html($helpBlock.data("original-contents"));
$controlGroup.attr("class", $controlGroup.data("original-classes"));
$this.attr("aria-invalid", $this.data("original-aria-invalid"));
$helpBlock.attr("role", $this.data("original-role"));
if ($.inArray($helpBlock[0], createdElements) > -1) {
$helpBlock.remove();
}
});
}
, collectErrors: function (includeEmpty) {
var errorMessages = {};
this.each(function (i, el) {
var $el = $(el);
var name = $el.attr("name");
var errors = $el.triggerHandler("validation.validation", {
includeEmpty: true
});
errorMessages[name] = $.extend(true, errors, errorMessages[name]);
});
$.each(errorMessages, function (i, el) {
if (el.length === 0) {
delete errorMessages[i];
}
});
return errorMessages;
}
, hasErrors: function () {
var errorMessages = [];
this.find('input,select,textarea').add(this).each(function (i, el) {
errorMessages = errorMessages.concat($(el).triggerHandler("getValidators.validation") ? $(el).triggerHandler("validation.validation", {
submitting: true
}) : []);
});
return (errorMessages.length > 0);
}
, override: function (newDefaults) {
defaults = $.extend(true, defaults, newDefaults);
}
}
, validatorTypes: {
callback: {
name: "callback"
, init: function ($this, name) {
var result = {
validatorName: name
, callback: $this.data("validation" + name + "Callback")
, lastValue: $this.val()
, lastValid: true
, lastFinished: true
};
var message = "Not valid";
if ($this.data("validation" + name + "Message")) {
message = $this.data("validation" + name + "Message");
}
result.message = message;
return result;
}
, validate: function ($this, value, validator) {
if (validator.lastValue === value && validator.lastFinished) {
return !validator.lastValid;
}
if (validator.lastFinished === true) {
validator.lastValue = value;
validator.lastValid = true;
validator.lastFinished = false;
var rrjqbvValidator = validator;
var rrjqbvThis = $this;
executeFunctionByName(validator.callback, window, $this, value, function (data) {
if (rrjqbvValidator.lastValue === data.value) {
rrjqbvValidator.lastValid = data.valid;
if (data.message) {
rrjqbvValidator.message = data.message;
}
rrjqbvValidator.lastFinished = true;
rrjqbvThis.data("validation" + rrjqbvValidator.validatorName + "Message", rrjqbvValidator.message);
setTimeout(function () {
if (!$this.is(":focus") && $this.parents("form").first().data("jqbvIsSubmitting")) {
rrjqbvThis.trigger("blur.validation");
} else {
rrjqbvThis.trigger("revalidate.validation");
}
}, 1);
}
});
}
return false;
}
}
, ajax: {
name: "ajax"
, init: function ($this, name) {
return {
validatorName: name
, url: $this.data("validation" + name + "Ajax")
, lastValue: $this.val()
, lastValid: true
, lastFinished: true
};
}
, validate: function ($this, value, validator) {
if ("" + validator.lastValue === "" + value && validator.lastFinished === true) {
return validator.lastValid === false;
}
if (validator.lastFinished === true) {
validator.lastValue = value;
validator.lastValid = true;
validator.lastFinished = false;
$.ajax({
url: validator.url
, data: "value=" + encodeURIComponent(value) + "&field=" + $this.attr("name")
, dataType: "json"
, success: function (data) {
if ("" + validator.lastValue === "" + data.value) {
validator.lastValid = !!(data.valid);
if (data.message) {
validator.message = data.message;
}
validator.lastFinished = true;
$this.data("validation" + validator.validatorName + "Message", validator.message);
setTimeout(function () {
$this.trigger("revalidate.validation");
}, 1);
}
}
, failure: function () {
validator.lastValid = true;
validator.message = "ajax call failed";
validator.lastFinished = true;
$this.data("validation" + validator.validatorName + "Message", validator.message);
setTimeout(function () {
$this.trigger("revalidate.validation");
}, 1);
}
});
}
return false;
}
}
, regex: {
name: "regex"
, init: function ($this, name) {
var result = {};
var regexString = $this.data("validation" + name + "Regex");
result.regex = regexFromString(regexString);
if (regexString === undefined) {
$.error("Can't find regex for '" + name + "' validator on '" + $this.attr("name") + "'");
}
var message = "Not in the expected format";
if ($this.data("validation" + name + "Message")) {
message = $this.data("validation" + name + "Message");
}
result.message = message;
result.originalName = name;
return result;
}
, validate: function ($this, value, validator) {
return (!validator.regex.test(value) && !validator.negative) || (validator.regex.test(value) && validator.negative);
}
}
, email: {
name: "email"
, init: function ($this, name) {
var result = {};
result.regex = regexFromString('[a-zA-Z0-9.!#$%&\u2019*+/=?^_`{|}~-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}');
var message = "Not a valid email address";
if ($this.data("validation" + name + "Message")) {
message = $this.data("validation" + name + "Message");
}
result.message = message;
result.originalName = name;
return result;
}
, validate: function ($this, value, validator) {
return (!validator.regex.test(value) && !validator.negative) || (validator.regex.test(value) && validator.negative);
}
}
, required: {
name: "required"
, init: function ($this, name) {
var message = "This is required";
if ($this.data("validation" + name + "Message")) {
message = $this.data("validation" + name + "Message");
}
return {
message: message
, includeEmpty: true
};
}
, validate: function ($this, value, validator) {
return !!((value.length === 0 && !validator.negative) || (value.length > 0 && validator.negative));
}
, blockSubmit: true
}
, match: {
name: "match"
, init: function ($this, name) {
var elementName = $this.data("validation" + name + "Match");
var $form = $this.parents("form").first();
var $element = $form.find("[name=\"" + elementName + "\"]").first();
$element.bind("validation.validation", function () {
$this.trigger("revalidate.validation", {
submitting: true
});
});
var result = {};
result.element = $element;
if ($element.length === 0) {
$.error("Can't find field '" + elementName + "' to match '" + $this.attr("name") + "' against in '" + name + "' validator");
}
var message = "Must match";
var $label = null;
if (($label = $form.find("label[for=\"" + elementName + "\"]")).length) {
message += " '" + $label.text() + "'";
} else if (($label = $element.parents(".form-group").first().find("label")).length) {
message += " '" + $label.first().text() + "'";
}
if ($this.data("validation" + name + "Message")) {
message = $this.data("validation" + name + "Message");
}
result.message = message;
return result;
}
, validate: function ($this, value, validator) {
return (value !== validator.element.val() && !validator.negative) || (value === validator.element.val() && validator.negative);
}
, blockSubmit: true
, includeEmpty: true
}
, max: {
name: "max"
, init: function ($this, name) {
var result = {};
result.max = $this.data("validation" + name + "Max");
result.message = "Too high: Maximum of '" + result.max + "'";
if ($this.data("validation" + name + "Message")) {
result.message = $this.data("validation" + name + "Message");
}
return result;
}
, validate: function ($this, value, validator) {
return (parseFloat(value, 10) > parseFloat(validator.max, 10) && !validator.negative) || (parseFloat(value, 10) <= parseFloat(validator.max, 10) && validator.negative);
}
}
, min: {
name: "min"
, init: function ($this, name) {
var result = {};
result.min = $this.data("validation" + name + "Min");
result.message = "Too low: Minimum of '" + result.min + "'";
if ($this.data("validation" + name + "Message")) {
result.message = $this.data("validation" + name + "Message");
}
return result;
}
, validate: function ($this, value, validator) {
return (parseFloat(value) < parseFloat(validator.min) && !validator.negative) || (parseFloat(value) >= parseFloat(validator.min) && validator.negative);
}
}
, maxlength: {
name: "maxlength"
, init: function ($this, name) {
var result = {};
result.maxlength = $this.data("validation" + name + "Maxlength");
result.message = "Too long: Maximum of '" + result.maxlength + "' characters";
if ($this.data("validation" + name + "Message")) {
result.message = $this.data("validation" + name + "Message");
}
return result;
}
, validate: function ($this, value, validator) {
return ((value.length > validator.maxlength) && !validator.negative) || ((value.length <= validator.maxlength) && validator.negative);
}
}
, minlength: {
name: "minlength"
, init: function ($this, name) {
var result = {};
result.minlength = $this.data("validation" + name + "Minlength");
result.message = "Too short: Minimum of '" + result.minlength + "' characters";
if ($this.data("validation" + name + "Message")) {
result.message = $this.data("validation" + name + "Message");
}
return result;
}
, validate: function ($this, value, validator) {
return ((value.length < validator.minlength) && !validator.negative) || ((value.length >= validator.minlength) && validator.negative);
}
}
, maxchecked: {
name: "maxchecked"
, init: function ($this, name) {
var result = {};
var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]");
elements.bind("change.validation click.validation", function () {
$this.trigger("revalidate.validation", {
includeEmpty: true
});
});
result.elements = elements;
result.maxchecked = $this.data("validation" + name + "Maxchecked");
var message = "Too many: Max '" + result.maxchecked + "' checked";
if ($this.data("validation" + name + "Message")) {
message = $this.data("validation" + name + "Message");
}
result.message = message;
return result;
}
, validate: function ($this, value, validator) {
return (validator.elements.filter(":checked").length > validator.maxchecked && !validator.negative) || (validator.elements.filter(":checked").length <= validator.maxchecked && validator.negative);
}
, blockSubmit: true
}
, minchecked: {
name: "minchecked"
, init: function ($this, name) {
var result = {};
var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]");
elements.bind("change.validation click.validation", function () {
$this.trigger("revalidate.validation", {
includeEmpty: true
});
});
result.elements = elements;
result.minchecked = $this.data("validation" + name + "Minchecked");
var message = "Too few: Min '" + result.minchecked + "' checked";
if ($this.data("validation" + name + "Message")) {
message = $this.data("validation" + name + "Message");
}
result.message = message;
return result;
}
, validate: function ($this, value, validator) {
return (validator.elements.filter(":checked").length < validator.minchecked && !validator.negative) || (validator.elements.filter(":checked").length >= validator.minchecked && validator.negative);
}
, blockSubmit: true
, includeEmpty: true
}
, number: {
name: "number"
, init: function ($this, name) {
var result = {};
result.step = 1;
if ($this.attr("step")) {
result.step = $this.attr("step");
}
if ($this.data("validation" + name + "Step")) {
result.step = $this.data("validation" + name + "Step");
}
result.decimal = ".";
if ($this.data("validation" + name + "Decimal")) {
result.decimal = $this.data("validation" + name + "Decimal");
}
result.thousands = "";
if ($this.data("validation" + name + "Thousands")) {
result.thousands = $this.data("validation" + name + "Thousands");
}
result.regex = regexFromString("([+-]?\\d+(\\" + result.decimal + "\\d+)?)?");
result.message = "Must be a number";
var dataMessage = $this.data("validation" + name + "Message");
if (dataMessage) {
result.message = dataMessage;
}
return result;
}
, validate: function ($this, value, validator) {
var globalValue = value.replace(validator.decimal, ".").replace(validator.thousands, "");
var multipliedValue = parseFloat(globalValue);
var multipliedStep = parseFloat(validator.step);
while (multipliedStep % 1 !== 0) {
multipliedStep = parseFloat(multipliedStep.toPrecision(12)) * 10;
multipliedValue = parseFloat(multipliedValue.toPrecision(12)) * 10;
}
var regexResult = validator.regex.test(value);
var stepResult = parseFloat(multipliedValue) % parseFloat(multipliedStep) === 0;
var typeResult = !isNaN(parseFloat(globalValue)) && isFinite(globalValue);
var result = !(regexResult && stepResult && typeResult);
return result;
}
, message: "Must be a number"
}
}
, builtInValidators: {
email: {
name: "Email"
, type: "email"
}
, passwordagain: {
name: "Passwordagain"
, type: "match"
, match: "password"
, message: "Does not match the given password<!-- data-validator-paswordagain-message to override -->"
}
, positive: {
name: "Positive"
, type: "shortcut"
, shortcut: "number,positivenumber"
}
, negative: {
name: "Negative"
, type: "shortcut"
, shortcut: "number,negativenumber"
}
, integer: {
name: "Integer"
, type: "regex"
, regex: "[+-]?\\d+"
, message: "No decimal places allowed<!-- data-validator-integer-message to override -->"
}
, positivenumber: {
name: "Positivenumber"
, type: "min"
, min: 0
, message: "Must be a positive number<!-- data-validator-positivenumber-message to override -->"
}
, negativenumber: {
name: "Negativenumber"
, type: "max"
, max: 0
, message: "Must be a negative number<!-- data-validator-negativenumber-message to override -->"
}
, required: {
name: "Required"
, type: "required"
, message: "This is required<!-- data-validator-required-message to override -->"
}
, checkone: {
name: "Checkone"
, type: "minchecked"
, minchecked: 1
, message: "Check at least one option<!-- data-validation-checkone-message to override -->"
}
, number: {
name: "Number"
, type: "number"
, decimal: "."
, step: "1"
}
, pattern: {
name: "Pattern"
, type: "regex"
, message: "Not in expected format"
}
}
};
var formatValidatorName = function (name) {
return name.toLowerCase().replace(/(^|\s)([a-z])/g, function (m, p1, p2) {
return p1 + p2.toUpperCase();
});
};
var getValue = function ($this) {
var value = null;
var type = $this.attr("type");
if (type === "checkbox") {
value = ($this.is(":checked") ? value : "");
var checkboxParent = $this.parents("form").first() || $this.parents(".form-group").first();
if (checkboxParent) {
value = checkboxParent.find("input[name='" + $this.attr("name") + "']:checked").map(function (i, el) {
return $(el).val();
}).toArray().join(",");
}
} else if (type === "radio") {
value = ($('input[name="' + $this.attr("name") + '"]:checked').length > 0 ? $this.val() : "");
var radioParent = $this.parents("form").first() || $this.parents(".form-group").first();
if (radioParent) {
value = radioParent.find("input[name='" + $this.attr("name") + "']:checked").map(function (i, el) {
return $(el).val();
}).toArray().join(",");
}
} else if (type === "number") {
if ($this[0].validity.valid) {
value = $this.val();
} else {
if ($this[0].validity.badInput || $this[0].validity.stepMismatch) {
value = "NaN";
} else {
value = "";
}
}
} else {
value = $this.val();
}
return value;
};
function regexFromString(inputstring) {
return new RegExp("^" + inputstring + "$");
}
/**
* Thanks to Jason Bunting via StackOverflow.com
*
* http://stackoverflow.com/questions/359788/how-to-execute-a-javascript-function-when-i-have-its-name-as-a-string#answer-359910
* Short link: http://tinyurl.com/executeFunctionByName
**/
function executeFunctionByName(functionName, context) {
var args = Array.prototype.slice.call(arguments, 2);
var namespaces = functionName.split(".");
var func = namespaces.pop();
for (var i = 0; i < namespaces.length; i++) {
context = context[namespaces[i]];
}
return context[func].apply(context, args);
}
$.fn.jqBootstrapValidation = function (method) {
if (defaults.methods[method]) {
return defaults.methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return defaults.methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.jqBootstrapValidation');
return null;
}
};
$.jqBootstrapValidation = function (options) {
$(":input").not("[type=image],[type=submit]").jqBootstrapValidation.apply(this, arguments);
};
})(jQuery);
|
var searchData=
[
['readbwrawimage',['readBWrawImage',['../fileIO_8cpp.html#aa8225a98de056e1fd6659a2acf14b258',1,'readBWrawImage(char filename[], int size): fileIO.cpp'],['../fileIO_8h.html#aa8225a98de056e1fd6659a2acf14b258',1,'readBWrawImage(char filename[], int size): fileIO.cpp']]],
['readrawimage',['readRawImage',['../fileIO_8cpp.html#a7df4e485428654e6c7dcaa176d9e460a',1,'readRawImage(char filename[], int size, int bitsperpixel): fileIO.cpp'],['../fileIO_8h.html#ac531a1f71154d194c672c146a9161834',1,'readRawImage(char filename[], int size, int): fileIO.cpp']]],
['rgb2yuv',['rgb2yuv',['../yuv_8cpp.html#af4b1a3c173145ecca0b6c86c0171d196',1,'rgb2yuv(float ***ImageData, int size): yuv.cpp'],['../yuv_8h.html#af4b1a3c173145ecca0b6c86c0171d196',1,'rgb2yuv(float ***ImageData, int size): yuv.cpp']]],
['rgb2yuvmat',['rgb2yuvMat',['../namespacecolor.html#a6ee39f1b7bd47d9f1a827f307746b643',1,'color']]]
];
|
module.exports = {
assets: {
'label-atlas': {
SpriteFrameTip: 'SpriteFrame',
ItemWidthTip: 'Item Width',
ItemHeightTip: 'Item Height',
StartCharTip: 'Start Char',
FontSizeTip: 'Font Size',
SpriteFrame: 'SpriteFrame',
ItemWidth: 'Item Width',
ItemHeight: 'Item Height',
StartChar: 'Start Char',
FontSize: 'Font Size',
},
particle:{
spriteFrame:'Sprite Frame',
spriteFrameTip:'Sprite Frame',
},
erpTextureCube: {
anisotropy: 'Anisotropy',
minFilter: 'Min Filter',
magFilter: 'Mag Filter',
mipFilter: 'Mip Filter',
wrapModeS: 'Wrap Mode S',
wrapModeT: 'Wrap Mode T',
anisotropyTip: 'Anisotropy',
minFilterTip: 'Min Filter',
magFilterTip: 'Mag Filter',
mipFilterTip: 'Mip Filter',
wrapModeSTip: 'Wrap Mode S',
wrapModeTTip: 'Wrap Mode T',
faceSize: {
name: 'Face Size',
title:
'每个面的尺寸。如果未指定或指定为0,将使用默认尺寸——最接近贴图宽度 / 4 的2次幂。',
},
},
javascript: {
plugin: '导入为插件',
dependencies: '依赖其它',
executionScope: '执行作用域',
global: '顶层',
enclosed: '独立',
loadPluginInWeb: '允许 Web 平台加载',
loadPluginInEditor: '允许编辑器加载',
loadPluginInNative: '允许 Native 平台加载',
simulateGlobals: '模拟全局变量',
executionScopeTip: '不对该插件脚本做任何编译或包装。',
executionScopeEnclosed: '模拟全局变量',
pluginTip: 'Import As Plugin',
dependenciesTip: 'Dependencies',
globalTip: 'Global',
enclosedTip: 'Enclosed',
loadPluginInWebTip: 'Load In Web',
loadPluginInEditorTip: 'Load In Editor',
loadPluginInNativeTip: 'Load In Native',
simulateGlobalsTip: 'Simulate global variables',
},
scene: {
asyncLoadAssets: '异步加载',
},
effect: {
shader: 'Shaders',
shaderTip: 'Shaders',
combinations: 'Precompile Combinations',
combinationsTip: 'Precompile Combinations',
choose: 'Choose all possible branches.',
glsl3: 'GLSL 300 ES Output',
glsl1: 'GLSL 100 Output',
vert: 'Vertex Shader',
frag: 'Fragment Shader',
},
image: {
type: 'Type',
typeTip: 'Type',
flipVertical: 'Flip Vertical',
flipVerticalTip: 'Flip Vertical',
isRGBE: 'Is RGBE',
isRGBETip: 'Is RGBE',
},
spriteFrame: {
packable: 'Packable',
packableTip: 'Packable',
rotated: 'Rotated',
rotatedTip: 'Rotated',
offsetX: 'Offset X',
offsetXTip: 'Offset X',
offsetY: 'Offset Y',
offsetYTip: 'Offset Y',
trimType: 'Trim Type',
trimTypeTip: 'Trim Type',
trimThreshold: 'Trim Threshold',
trimThresholdTip: 'Trim Threshold',
trimX: 'Trim X',
trimXTip: 'Trim X',
trimY: 'Trim Y',
trimYTip: 'Trim Y',
width: 'Trim Width',
widthTip: 'Trim Width',
height: 'Trim Height',
heightTip: 'Trim Height',
borderTop: 'Border Top',
borderTopTip: 'Border Top',
borderBottom: 'Border Bottom',
borderBottomTip: 'Border Bottom',
borderLeft: 'Border Left',
borderLeftTip: 'Border Left',
borderRight: 'Border Right',
borderRightTip: 'Border Right',
edit: '编辑',
},
texture: {
anisotropy: 'Anisotropy',
anisotropyTip: 'Anisotropy',
minfilter: 'Min Filter',
minfilterTip: 'Min Filter',
magfilter: 'Mag Filter',
magfilterTip: 'Mag Filter',
mipfilter: 'Mip Filter',
mipfilterTip: 'Mip Filter',
wrapModeS: 'Wrap Mode S',
wrapModeSTip: 'Wrap Mode S',
wrapModeT: 'Wrap Mode T',
wrapModeTTip: 'Wrap Mode T',
modeWarn:
'警告:WebGL 1.0 平台不支持非 2 次幂贴图的 repeat 过滤模式,运行时会自动改为 clamp-to-edge 模式,这会使材质的 tilingOffset 等属性完全失效。',
},
fbx: {
browse: '更换贴图',
model: '模型',
animation: '动画',
material: '材质',
fbx: 'FBX',
GlTFUserData: {
normals: {
name: '法线',
title: '法线导入设置。',
optional: {
name: '可选',
title: '仅当模型文件中包含法线时导入法线。',
},
exclude: {
name: '排除',
title: '不导入法线。',
},
require: {
name: '仅在必要时重新计算',
title: '导入法线。优先使用模型文件中的法线,若模型文件中不包含法线则计算法线。',
},
recalculate: {
name: '重新计算',
title: '不管模型文件中是否包含法线都直接重新计算并导入。',
},
},
tangents: {
name: '切线',
title: '切线导入设置。',
optional: {
name: '可选',
title: '仅当模型文件中包含切线时导入切线。',
},
exclude: {
name: '排除',
title: '不导入切线。',
},
require: {
name: '仅在必要时重新计算',
title: '导入切线。优先使用模型文件中的切线,若模型文件中不包含切线且纹理坐标存在则计算切线。',
},
recalculate: {
name: '重新计算',
title: '不管模型文件中是否包含切线都直接重新计算并导入。',
},
},
morphNormals: {
name: '形变法线',
title: '形变法线导入设置。',
optional: {
name: '可选',
title: '仅当模型文件中包含形变法线时导入形变法线。',
},
exclude: {
name: '排除',
title: '不导入形变法线。',
},
require: {
name: '仅在必要时重新计算',
title: '导入形变法线。优先使用模型文件中的形变法线,若模型文件中不包含形变法线则计算形变法线。',
},
recalculate: {
name: '重新计算',
title: '不管模型文件中是否包含形变法线都直接重新计算并导入。',
},
},
dumpMaterials: {
name: '提取材质',
title: '开启后,模型文件中的材质将被提取成为可编辑的材质文件,而非作为模型文件资源的只读子资源。',
},
materialDumpDir: {
name: '材质提取目录',
title: '指定材质提取的目标目录。若未指定,材质将提取至 `Materials_${模型文件名(不含后缀)}`。',
},
useVertexColors: {
name: '使用顶点色',
title: '是否使用顶点色。',
},
depthWriteInAlphaModeBlend: {
name: '混合模式下的深度写入',
title: '当 alpha 模式为 "BLEND" 时开启深度写入。',
},
skipValidation: {
name: '跳过验证',
title: '跳过对模型文件的验证。',
},
},
ImageRemap: {
remapAs: '映射为',
original: '原始',
},
limitMaterialDumpDir: '提取的路径需要限定在项目路径范围内',
legacyFbxImporter: {
name: '与 1.* 版本兼容',
title: '此导入器是否应该与其在 Cocos Creator 1.* 之前版本的导入方式兼容。',
warn: '警告:改变此属性可能会影响那些导入后已投入使用或者被引用了的资源。',
},
disableMeshSplit: {
name: '是否禁用 Mesh 拆分',
title:
'为了解决实时骨骼动画系统下 uniform vector 数量限制问题,<br> ' +
'目前在资源导入期会根据骨骼数量做拆分,这会对其他系统也产生影响。<br>' +
'如果确定不会使用实时计算模式 (对应 SkeletalAnimation 组件的 <br> ' +
'useBakedAnimation 选项未勾选时),可以勾选此项以提升性能。<br>' +
'但注意改变此选项会影响生成的 prefab 内容,需要对应更新场景中的引用。<br>' +
'后续重构会移除此流程。',
},
meshOptimizer: {
name: 'Mesh Optimizer',
title: 'Mesh Optimizer',
simplification: {
name: 'Simplification',
title: 'Simplification',
si: {
name: 'Achieve the ratio R',
title: 'Achieve the ratio R',
},
sa: {
name: 'Aggressively simplify',
title: 'Aggressively simplify',
},
},
scene: {
name: 'Scene',
title: 'Scene',
kn: {
name: 'Keep nodes transform',
title: 'Keep nodes transform',
},
ke: {
name: 'Keep extras data',
title: 'Keep extras data',
},
},
miscellaneous: {
name: 'Miscellaneous',
title: 'Miscellaneous',
noq: {
name: 'Disable quantization',
title: 'Disable quantization',
},
v: {
name: 'Verbose output',
title: 'Verbose output',
},
},
},
animationBakeRate: {
name: '动画烘焙速率',
title: '指定动画烘焙速率,单位为帧每秒(FPS)',
},
promoteSingleRootNode: {
name: '提升单一根结点',
title: '若开启并且 FBX 场景仅有一个根节点,那么当转换该 FBX 场景为 Cocos Creator 预制体时,<br>以该根节点作为预制体的根节点,否则以该 FBX 场景的根节点作为预制体的根节点。',
},
},
textureCube: {
anisotropy: 'Anisotropy',
anisotropyTip: 'Anisotropy',
minFilter: 'Min Filter',
minFilterTip: 'Min Filter',
magFilter: 'Mag Filter',
magFilterTip: 'Mag Filter',
mipFilter: 'Mip Filter',
mipFilterTip: 'Mip Filter',
wrapModeS: 'Wrap Mode S',
wrapModeSTip: 'Wrap Mode S',
wrapModeT: 'Wrap Mode T',
wrapModeTTip: 'Wrap Mode T',
modeWarn:
'警告:WebGL 1.0 平台不支持非 2 次幂贴图的 repeat 过滤模式,运行时会自动改为 clamp-to-edge 模式,这会使材质的 tilingOffset 等属性完全失效。',
},
material: {
'fail-to-load-custom-inspector': 'material: 自定义 effect {effect} 的 inspector 加载失败',
'illegal-inspector-url': "Inspector的路径不合法",
},
},
};
|
/*************************************************************
*
* MathJax/jax/output/SVG/fonts/Latin-Modern/Size4/Regular/Main.js
*
* Copyright (c) 2013-2017 The MathJax Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.OutputJax['SVG'].FONTDATA.FONTS['LatinModernMathJax_Size4'] = {
directory: 'Size4/Regular',
family: 'LatinModernMathJax_Size4',
id: 'LATINMODERNSIZE4',
0x20: [0,0,332,0,0,''],
0x28: [1146,646,597,179,539,'539 -632c0 -8 -6 -14 -14 -14c-3 0 -6 1 -9 2c-175 132 -337 475 -337 776v236c0 301 162 644 337 776c3 1 6 2 9 2c8 0 14 -6 14 -14c0 -5 -2 -9 -5 -12c-167 -125 -283 -466 -283 -752v-236c0 -286 116 -627 283 -752c3 -3 5 -7 5 -12'],
0x29: [1146,646,597,58,418,'418 132c0 -301 -162 -644 -337 -776c-3 -1 -6 -2 -9 -2c-8 0 -14 6 -14 14c0 5 2 9 5 12c167 125 283 466 283 752v236c0 286 -116 627 -283 752c-3 3 -5 7 -5 12c0 8 6 14 14 14c3 0 6 -1 9 -2c175 -132 337 -475 337 -776v-236'],
0x2F: [1722,1222,1222,56,1166,'1166 1692c0 -3 -1 -7 -2 -10l-1050 -2885c-4 -11 -15 -19 -28 -19c-17 0 -30 13 -30 30c0 3 1 7 2 10l1050 2885c4 11 15 19 28 19c17 0 30 -13 30 -30'],
0x5B: [1150,650,472,226,448,'448 -624c0 -14 -12 -26 -26 -26h-196v1800h196c14 0 26 -12 26 -26s-12 -26 -26 -26h-144v-1696h144c14 0 26 -12 26 -26'],
0x5C: [1722,1222,1222,56,1166,'1166 -1192c0 -17 -13 -30 -30 -30c-13 0 -24 8 -28 19l-1050 2885c-1 3 -2 7 -2 10c0 17 13 30 30 30c13 0 24 -8 28 -19l1050 -2885c1 -3 2 -7 2 -10'],
0x5D: [1150,650,472,24,246,'246 1150v-1800h-196c-14 0 -26 12 -26 26s12 26 26 26h144v1696h-144c-14 0 -26 12 -26 26s12 26 26 26h196'],
0x7B: [1150,650,667,97,569,'569 -632c0 -10 -8 -18 -18 -18h-4c-136 28 -256 123 -256 225v450c0 87 -74 186 -180 207c-8 2 -14 9 -14 18s6 16 14 18c106 21 180 120 180 207v450c0 102 120 197 256 225h4c10 0 18 -8 18 -18c0 -9 -6 -16 -14 -18c-105 -21 -180 -111 -180 -189v-450 c0 -95 -87 -184 -196 -225c109 -41 196 -130 196 -225v-450c0 -78 75 -168 180 -189c8 -2 14 -9 14 -18'],
0x7C: [1292,792,278,109,169,'169 -762c0 -17 -13 -30 -30 -30s-30 13 -30 30v2024c0 17 13 30 30 30s30 -13 30 -30v-2024'],
0x7D: [1150,650,667,98,570,'570 250c0 -9 -6 -16 -14 -18c-106 -21 -180 -120 -180 -207v-450c0 -102 -120 -197 -256 -225h-4c-10 0 -18 8 -18 18c0 9 6 16 14 18c105 21 180 111 180 189v450c0 95 87 184 196 225c-109 41 -196 130 -196 225v450c0 78 -75 168 -180 189c-8 2 -14 9 -14 18 c0 10 8 18 18 18h4c136 -28 256 -123 256 -225v-450c0 -87 74 -186 180 -207c8 -2 14 -9 14 -18'],
0xA0: [0,0,332,0,0,''],
0x302: [747,-571,1100,0,1100,'1100 597l-6 -26c-182 33 -364 71 -544 114c-180 -43 -361 -81 -544 -114l-6 26c182 56 365 106 550 150c185 -44 369 -94 550 -150'],
0x303: [762,-539,1115,0,1115,'1115 748c0 -3 -1 -6 -3 -9c-64 -78 -137 -135 -261 -157c-23 -5 -45 -6 -67 -6c-79 0 -158 22 -235 45c-71 21 -143 42 -216 42c-19 0 -38 -1 -58 -5c-112 -20 -193 -44 -251 -115c-3 -3 -6 -4 -10 -4c-8 0 -14 6 -14 13c0 3 1 6 3 9c64 78 137 135 261 157 c23 5 45 6 67 6c80 0 158 -22 235 -45c71 -21 143 -42 216 -42c19 0 39 1 58 5c113 20 193 44 251 115c3 3 7 5 11 5c7 0 13 -7 13 -14'],
0x306: [742,-576,1120,0,1120,'1120 734c-53 -158 -335 -158 -560 -158s-507 0 -560 158l26 8c35 -105 323 -105 534 -105c210 0 499 0 534 105'],
0x30C: [741,-565,1100,0,1100,'1100 715c-181 -56 -365 -106 -550 -150c-185 44 -368 94 -550 150l6 26c183 -33 364 -71 544 -114c180 43 362 81 544 114'],
0x311: [759,-592,1120,0,1120,'1120 600l-26 -8c-35 105 -324 106 -534 106c-211 0 -499 -1 -534 -106l-26 8c53 158 335 159 560 159s507 -1 560 -159'],
0x32C: [-96,273,1100,0,1100,'1100 -122c-181 -56 -365 -106 -550 -151c-185 45 -368 95 -550 151l6 26c183 -33 364 -71 544 -114c180 43 362 81 544 114'],
0x32D: [-108,285,1100,0,1100,'1100 -258l-6 -27c-182 33 -364 71 -544 114c-180 -43 -361 -81 -544 -114l-6 27c182 56 365 106 550 150c185 -44 369 -94 550 -150'],
0x32E: [-96,263,1120,0,1120,'1120 -105c-53 -158 -335 -158 -560 -158s-507 0 -560 158l26 9c35 -106 323 -106 534 -106c210 0 499 0 534 106'],
0x32F: [-118,285,1120,0,1120,'1120 -276l-26 -9c-35 106 -324 106 -534 106c-211 0 -499 0 -534 -106l-26 9c53 158 335 158 560 158s507 0 560 -158'],
0x330: [-118,341,1115,0,1115,'1115 -131c0 -4 -1 -7 -3 -9c-64 -78 -137 -136 -261 -158c-23 -4 -45 -6 -67 -6c-79 0 -158 22 -235 45c-71 21 -143 43 -216 43c-19 0 -38 -2 -58 -5c-112 -20 -193 -44 -251 -115c-3 -3 -6 -5 -10 -5c-8 0 -14 6 -14 14c0 3 1 6 3 8c64 78 137 136 261 158 c23 4 45 6 67 6c80 0 158 -22 235 -45c71 -21 143 -43 216 -43c19 0 39 2 58 5c113 20 193 44 251 115c3 3 7 5 11 5c7 0 13 -6 13 -13'],
0x2016: [1292,792,386,56,330,'116 -762c0 -17 -13 -30 -30 -30s-30 13 -30 30v2024c0 17 13 30 30 30s30 -13 30 -30v-2024zM330 -762c0 -17 -13 -30 -30 -30s-30 13 -30 30v2024c0 17 13 30 30 30s30 -13 30 -30v-2024'],
0x2044: [1722,1222,1222,56,1166,'1166 1692c0 -3 -1 -7 -2 -10l-1050 -2885c-4 -11 -15 -19 -28 -19c-17 0 -30 13 -30 30c0 3 1 7 2 10l1050 2885c4 11 15 19 28 19c17 0 30 -13 30 -30'],
0x20E9: [750,-527,1860,0,1860,'1860 553c0 -14 -12 -26 -26 -26s-26 12 -26 26v145h-1756v-145c0 -14 -12 -26 -26 -26s-26 12 -26 26v197h1860v-197'],
0x221A: [1750,1250,1000,111,1020,'1020 1730l-554 -2954c-5 -26 -11 -26 -42 -26l-231 1343l-68 -132s-14 12 -14 16c0 0 1 3 6 13l132 260l216 -1255h1l512 2725c3 17 6 30 22 30c12 0 20 -9 20 -20'],
0x2223: [1292,792,278,109,169,'169 -762c0 -17 -13 -30 -30 -30s-30 13 -30 30v2024c0 17 13 30 30 30s30 -13 30 -30v-2024'],
0x2225: [1292,792,386,56,330,'116 -762c0 -17 -13 -30 -30 -30s-30 13 -30 30v2024c0 17 13 30 30 30s30 -13 30 -30v-2024zM330 -762c0 -17 -13 -30 -30 -30s-30 13 -30 30v2024c0 17 13 30 30 30s30 -13 30 -30v-2024'],
0x2308: [1150,650,528,196,502,'502 1124c0 -14 -12 -26 -26 -26h-228v-1722c0 -14 -12 -26 -26 -26s-26 12 -26 26v1774h280c14 0 26 -12 26 -26'],
0x2309: [1150,650,528,26,332,'332 -624c0 -14 -12 -26 -26 -26s-26 12 -26 26v1722h-228c-14 0 -26 12 -26 26s12 26 26 26h280v-1774'],
0x230A: [1150,650,528,196,502,'502 -624c0 -14 -12 -26 -26 -26h-280v1774c0 14 12 26 26 26s26 -12 26 -26v-1722h228c14 0 26 -12 26 -26'],
0x230B: [1150,650,528,26,332,'332 1124v-1774h-280c-14 0 -26 12 -26 26s12 26 26 26h228v1722c0 14 12 26 26 26s26 -12 26 -26'],
0x2329: [1150,650,611,159,555,'555 -624c0 -14 -12 -26 -26 -26c-11 0 -20 7 -24 16l-344 874c-1 3 -2 7 -2 10s1 7 2 10l344 874c4 9 13 16 24 16c14 0 26 -12 26 -26c0 -3 -1 -7 -2 -10l-340 -864l340 -864c1 -3 2 -7 2 -10'],
0x232A: [1150,650,611,56,452,'452 250c0 -3 -1 -7 -2 -10l-344 -874c-4 -9 -13 -16 -24 -16c-14 0 -26 12 -26 26c0 3 1 7 2 10l340 864l-340 864c-1 3 -2 7 -2 10c0 14 12 26 26 26c11 0 20 -7 24 -16l344 -874c1 -3 2 -7 2 -10'],
0x23B4: [750,-527,1860,0,1860,'1860 553c0 -14 -12 -26 -26 -26s-26 12 -26 26v145h-1756v-145c0 -14 -12 -26 -26 -26s-26 12 -26 26v197h1860v-197'],
0x23B5: [-97,320,1860,0,1860,'1860 -320h-1860v197c0 14 12 26 26 26s26 -12 26 -26v-145h1756v145c0 14 12 26 26 26s26 -12 26 -26v-197'],
0x23DC: [774,-506,2516,0,2516,'2516 524c0 -10 -8 -18 -18 -18c-5 0 -9 2 -13 6c-116 116 -569 190 -1006 190h-442c-437 0 -890 -74 -1006 -190c-4 -4 -8 -6 -13 -6c-10 0 -18 8 -18 18c0 5 2 10 5 13c120 120 580 237 1032 237h442c452 0 912 -117 1032 -237c3 -3 5 -8 5 -13'],
0x23DD: [-76,344,2516,0,2516,'2516 -94c0 -5 -2 -10 -5 -13c-120 -120 -580 -237 -1032 -237h-442c-452 0 -912 117 -1032 237c-3 3 -5 8 -5 13c0 10 8 18 18 18c5 0 9 -2 13 -6c116 -116 569 -190 1006 -190h442c437 0 890 74 1006 190c4 4 8 6 13 6c10 0 18 -8 18 -18'],
0x23DE: [833,-502,2498,0,2498,'2498 511c0 -5 -4 -9 -9 -9c-4 0 -7 2 -8 5c-30 82 -191 124 -346 124h-532c-178 0 -318 74 -354 153c-36 -79 -176 -153 -354 -153h-532c-155 0 -316 -42 -346 -124c-1 -3 -4 -5 -8 -5c-5 0 -9 4 -9 9c0 1 0 2 1 3c33 91 189 189 362 189h532c184 0 345 39 345 121 c0 4 4 9 9 9s9 -5 9 -9c0 -82 161 -121 345 -121h532c173 0 329 -98 362 -189c1 -1 1 -2 1 -3'],
0x23DF: [-71,402,2498,0,2498,'2498 -80c0 -2 0 -3 -1 -4c-33 -91 -189 -189 -362 -189h-532c-184 0 -345 -39 -345 -120c0 -5 -4 -9 -9 -9s-9 4 -9 9c0 81 -161 120 -345 120h-532c-173 0 -329 98 -362 189c-1 1 -1 2 -1 4c0 4 4 9 9 9c4 0 7 -3 8 -6c30 -82 191 -124 346 -124h532 c178 0 318 -74 354 -153c36 79 176 153 354 153h532c155 0 316 42 346 124c1 3 4 6 8 6c5 0 9 -5 9 -9'],
0x23E0: [863,-607,2564,0,2564,'2564 607h-84l-172 172h-2052l-172 -172h-84l256 256h2052'],
0x23E1: [-177,433,2564,0,2564,'2564 -177l-256 -256h-2052l-256 256h84l172 -172h2052l172 172h84'],
0x27E6: [1150,650,660,211,637,'637 -624c0 -14 -12 -26 -26 -26h-400v1800h400c14 0 26 -12 26 -26s-12 -26 -26 -26h-148v-1696h148c14 0 26 -12 26 -26zM411 -598v1696h-148v-1696h148'],
0x27E7: [1150,650,660,23,449,'449 1150v-1800h-400c-14 0 -26 12 -26 26s12 26 26 26h148v1696h-148c-14 0 -26 12 -26 26s12 26 26 26h400zM397 -598v1696h-148v-1696h148'],
0x27E8: [1150,650,611,159,555,'555 -624c0 -14 -12 -26 -26 -26c-11 0 -20 7 -24 16l-344 874c-1 3 -2 7 -2 10s1 7 2 10l344 874c4 9 13 16 24 16c14 0 26 -12 26 -26c0 -3 -1 -7 -2 -10l-340 -864l340 -864c1 -3 2 -7 2 -10'],
0x27E9: [1150,650,611,56,452,'452 250c0 -3 -1 -7 -2 -10l-344 -874c-4 -9 -13 -16 -24 -16c-14 0 -26 12 -26 26c0 3 1 7 2 10l340 864l-340 864c-1 3 -2 7 -2 10c0 14 12 26 26 26c11 0 20 -7 24 -16l344 -874c1 -3 2 -7 2 -10'],
0x27EA: [1150,650,905,159,849,'555 -624c0 -14 -12 -26 -26 -26c-11 0 -20 7 -24 16l-344 874c-1 3 -2 7 -2 10s1 7 2 10l344 874c4 9 13 16 24 16c14 0 26 -12 26 -26c0 -3 -1 -7 -2 -10l-340 -864l340 -864c1 -3 2 -7 2 -10zM849 -624c0 -14 -11 -26 -26 -26c-11 0 -20 7 -24 16l-344 874 c-1 3 -2 7 -2 10s1 7 2 10l344 874c4 9 13 16 24 16c15 0 26 -12 26 -26c0 -3 0 -7 -2 -10l-340 -864l340 -864c2 -3 2 -7 2 -10'],
0x27EB: [1150,650,905,56,746,'746 250c0 -3 0 -7 -2 -10l-344 -874c-3 -9 -13 -16 -24 -16c-14 0 -26 12 -26 26c0 3 1 7 2 10l340 864l-340 864c-1 3 -2 7 -2 10c0 14 12 26 26 26c11 0 21 -7 24 -16l344 -874c2 -3 2 -7 2 -10zM452 250c0 -3 -1 -7 -2 -10l-344 -874c-4 -9 -13 -16 -24 -16 c-14 0 -26 12 -26 26c0 3 1 7 2 10l340 864l-340 864c-1 3 -2 7 -2 10c0 14 12 26 26 26c11 0 20 -7 24 -16l344 -874c1 -3 2 -7 2 -10'],
0x27EE: [1168,668,432,176,376,'376 -650c0 -10 -8 -18 -18 -18c-5 0 -9 2 -13 5c-82 83 -169 398 -169 709v408c0 311 87 626 169 709c4 3 8 5 13 5c10 0 18 -8 18 -18c0 -5 -2 -9 -5 -13c-79 -78 -123 -387 -123 -683v-408c0 -296 44 -605 123 -683c3 -4 5 -8 5 -13'],
0x27EF: [1168,668,432,56,256,'256 46c0 -311 -87 -626 -169 -709c-4 -3 -8 -5 -13 -5c-10 0 -18 8 -18 18c0 5 2 9 5 13c79 78 123 387 123 683v408c0 296 -44 605 -123 683c-3 4 -5 8 -5 13c0 10 8 18 18 18c5 0 9 -2 13 -5c82 -83 169 -398 169 -709v-408']
};
MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Size4/Regular/Main.js");
|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test desitarget.cmx.
"""
import unittest
from pkg_resources import resource_filename
import os.path
from uuid import uuid4
import numbers
import warnings
from astropy.io import fits
from astropy.table import Table
import fitsio
import numpy as np
import healpy as hp
from desitarget import io
from desitarget.cmx import cmx_cuts as cuts
class TestCMX(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.datadir = resource_filename('desitarget.test', 't')
cls.tractorfiles = sorted(io.list_tractorfiles(cls.datadir))
cls.sweepfiles = sorted(io.list_sweepfiles(cls.datadir))
cls.cmxdir = resource_filename('desitarget.test', 't3')
# ADM find which HEALPixels are covered by test sweeps files.
cls.nside = 32
pixlist = []
for fn in cls.sweepfiles:
objs = fitsio.read(fn)
theta, phi = np.radians(90-objs["DEC"]), np.radians(objs["RA"])
pixels = hp.ang2pix(cls.nside, theta, phi, nest=True)
pixlist.append(pixels)
cls.pix = np.unique(pixlist)
# ADM set up the GAIA_DIR environment variable.
cls.gaiadir_orig = os.getenv("GAIA_DIR")
os.environ["GAIA_DIR"] = resource_filename('desitarget.test', 't4')
@classmethod
def tearDownClass(cls):
# ADM reset GAIA_DIR environment variable.
if cls.gaiadir_orig is not None:
os.environ["GAIA_DIR"] = cls.gaiadir_orig
def setUp(self):
# Treat a specific warning as an error (could turn off if this
# becomes problematic)
warnings.filterwarnings('error', '.*Calling nonzero on 0d arrays.*')
def test_cuts_basic(self):
"""Test cuts work with either data or filenames
"""
# ADM test for tractor files.
# ADM No QSO cuts for speed. This doesn't affect coverage.
cmx, pshift = cuts.apply_cuts(self.tractorfiles[0],
cmxdir=self.cmxdir, noqso=True)
data = io.read_tractor(self.tractorfiles[0])
cmx2, pshift2 = cuts.apply_cuts(data,
cmxdir=self.cmxdir, noqso=True)
self.assertTrue(np.all(cmx == cmx2))
self.assertTrue(np.all(pshift == pshift2))
# ADM test for sweeps files.
# ADM No QSO cuts for speed. This doesn't affect coverage.
cmx, pshift = cuts.apply_cuts(self.sweepfiles[0],
cmxdir=self.cmxdir, noqso=True)
data = io.read_tractor(self.sweepfiles[0])
cmx2, pshift2 = cuts.apply_cuts(data,
cmxdir=self.cmxdir, noqso=True)
self.assertTrue(np.all(cmx == cmx2))
self.assertTrue(np.all(pshift == pshift2))
def _test_table_row(self, targets):
"""Test cuts work with tables from several I/O libraries
"""
# ADM add the DR7/DR8 data columns if they aren't there yet.
# ADM can remove this once DR8 is finalized.
if "MASKBITS" not in targets.dtype.names:
targets = io.add_dr8_columns(targets)
cmx, pshift = cuts.apply_cuts(targets,
cmxdir=self.cmxdir)
self.assertEqual(len(cmx), len(targets))
cmx, pshift = cuts.apply_cuts(targets[0],
cmxdir=self.cmxdir)
self.assertTrue(isinstance(cmx, numbers.Integral), 'CMX_TARGET mask not an int')
def test_astropy_fits(self):
"""Test astropy.fits I/O library
"""
targets = fits.getdata(self.tractorfiles[0])
self._test_table_row(targets)
def test_astropy_table(self):
"""Test astropy tables I/O library
"""
targets = Table.read(self.tractorfiles[0])
self._test_table_row(targets)
def test_numpy_ndarray(self):
"""Test fitsio I/O library
"""
targets = fitsio.read(self.tractorfiles[0], upper=True)
self._test_table_row(targets)
def test_select_targets(self):
"""Test select targets works with either data or filenames
"""
# ADM parallelization across pixels only works for sweep files.
for filelist in [self.sweepfiles]:
# ADM No QSO cuts and limit to pixels for speed.
# ADM This doesn't affect coverage.
targets = cuts.select_targets(filelist, numproc=1,
cmxdir=self.cmxdir, noqso=True,
nside=self.nside, pixlist=self.pix)
t1 = cuts.select_targets(filelist[0:1], numproc=1,
cmxdir=self.cmxdir, noqso=True,
nside=self.nside, pixlist=self.pix)
t2 = cuts.select_targets(filelist[0], numproc=1,
cmxdir=self.cmxdir, noqso=True,
nside=self.nside, pixlist=self.pix)
for col in t1.dtype.names:
try:
notNaN = ~np.isnan(t1[col])
except TypeError: # - can't check string columns for NaN
notNaN = np.ones(len(t1), dtype=bool)
self.assertTrue(np.all(t1[col][notNaN] == t2[col][notNaN]))
def test_missing_files(self):
"""Test the code will die gracefully if input files are missing
"""
with self.assertRaises(ValueError):
targets = cuts.select_targets(['blat.foo1234', ], numproc=1)
def test_parallel_select(self):
"""Test multiprocessing parallelization works
"""
for nproc in [1, 2]:
# ADM parallelization across pixels only works for sweep files.
for filelist in [self.sweepfiles]:
# ADM No QSO cuts for speed. Doesn't affect coverage.
targets = cuts.select_targets(filelist, numproc=nproc,
cmxdir=self.cmxdir, noqso=True,
nside=self.nside, pixlist=self.pix)
self.assertTrue('CMX_TARGET' in targets.dtype.names)
self.assertEqual(len(targets), np.count_nonzero(targets['CMX_TARGET']))
if __name__ == '__main__':
unittest.main()
def test_suite():
"""Allows testing of only this module with the command:
python setup.py test -m desitarget.test.test_cmx
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
|
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..registration import scalartransform
def test_scalartransform_inputs():
input_map = dict(
args=dict(argstr='%s', ),
deformation=dict(
argstr='--deformation %s',
extensions=None,
),
environ=dict(
nohash=True,
usedefault=True,
),
h_field=dict(argstr='--h_field ', ),
input_image=dict(
argstr='--input_image %s',
extensions=None,
),
interpolation=dict(argstr='--interpolation %s', ),
invert=dict(argstr='--invert ', ),
output_image=dict(
argstr='--output_image %s',
hash_files=False,
),
transformation=dict(
argstr='--transformation %s',
hash_files=False,
),
)
inputs = scalartransform.input_spec()
for key, metadata in list(input_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(inputs.traits()[key], metakey) == value
def test_scalartransform_outputs():
output_map = dict(
output_image=dict(extensions=None, ),
transformation=dict(extensions=None, ),
)
outputs = scalartransform.output_spec()
for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(outputs.traits()[key], metakey) == value
|
import pygame
from wrapText import drawText
class Question:
def __init__(self, quiz, prompt, answer, category):
self.quiz = quiz
self.prompt = prompt
self.answer = answer
self.category = category
def display_question(self):
self.display_rect = pygame.Rect(0, 0, 550, 300)
self.display_rect.center = self.quiz.screen_rect.center
font = pygame.font.SysFont(None, 36)
drawText(self.quiz.screen, self.prompt, (0, 0, 0), self.display_rect, font, bkg=self.quiz.settings.bg_color)
def check_answer(self, response):
clean_response = response.lower().strip()
clean_answer = self.answer.lower().strip()
return clean_response in clean_answer
def display_answer(self):
self.answer_rect = pygame.Rect(0, 0, 550, 300)
self.answer_rect.centerx = self.quiz.screen_rect.centerx
self.answer_rect.top = self.display_rect.bottom - 50
font = pygame.font.SysFont(None, 36)
drawText(self.quiz.screen, self.answer, (0, 0, 0), self.answer_rect, font, bkg=self.quiz.settings.bg_color)
|
require('es6-shim');
const vows = require('vows');
const assert = require('assert');
const chroma = require('../index');
vows
.describe('Some tests for random colors')
.addBatch({
'random colors': {
topic: chroma.random(),
'valid hex code'(topic) { return assert(/^#[0-9a-f]{6}$/i.test(topic.hex())); }
}}).export(module);
|
/*!
* OS.js - JavaScript Cloud/Web Desktop Platform
*
* Copyright (c) 2011-2016, Anders Evenrud <andersevenrud@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @author Anders Evenrud <andersevenrud@gmail.com>
* @licence Simplified BSD License
*/
(function(DefaultApplication, DefaultApplicationWindow, Application, Window, Utils, API, VFS, GUI) {
'use strict';
/////////////////////////////////////////////////////////////////////////////
// WINDOWS
/////////////////////////////////////////////////////////////////////////////
function ApplicationTextpadWindow(app, metadata, scheme, file) {
DefaultApplicationWindow.apply(this, ['ApplicationTextpadWindow', {
allow_drop: true,
icon: metadata.icon,
title: metadata.name,
width: 450,
height: 300
}, app, scheme, file]);
}
ApplicationTextpadWindow.prototype = Object.create(DefaultApplicationWindow.prototype);
ApplicationTextpadWindow.constructor = DefaultApplicationWindow.prototype;
ApplicationTextpadWindow.prototype.init = function(wmRef, app, scheme) {
var root = DefaultApplicationWindow.prototype.init.apply(this, arguments);
var self = this;
// Load and set up scheme (GUI) here
scheme.render(this, 'TextpadWindow', root);
scheme.find(this, 'Text').on('change', function() {
self.hasChanged = true;
});
return root;
};
ApplicationTextpadWindow.prototype.updateFile = function(file) {
DefaultApplicationWindow.prototype.updateFile.apply(this, arguments);
this._scheme.find(this, 'Text').$element.focus();
};
ApplicationTextpadWindow.prototype.showFile = function(file, content) {
this._scheme.find(this, 'Text').set('value', content || '');
DefaultApplicationWindow.prototype.showFile.apply(this, arguments);
};
ApplicationTextpadWindow.prototype.getFileData = function() {
return this._scheme.find(this, 'Text').get('value');
};
ApplicationTextpadWindow.prototype._focus = function() {
if ( DefaultApplicationWindow.prototype._focus.apply(this, arguments) ) {
if ( this._scheme ) {
var input = this._scheme.find(this, 'Text').$element;
if ( input ) {
input.focus();
}
}
return true;
}
return false;
};
/////////////////////////////////////////////////////////////////////////////
// APPLICATION
/////////////////////////////////////////////////////////////////////////////
var ApplicationTextpad = function(args, metadata) {
DefaultApplication.apply(this, ['ApplicationTextpad', args, metadata, {
extension: 'txt',
mime: 'text/plain',
filename: 'New text file.txt'
}]);
};
ApplicationTextpad.prototype = Object.create(DefaultApplication.prototype);
ApplicationTextpad.constructor = DefaultApplication;
ApplicationTextpad.prototype.init = function(settings, metadata, scheme) {
Application.prototype.init.call(this, settings, metadata, scheme);
var file = this._getArgument('file');
this._addWindow(new ApplicationTextpadWindow(this, metadata, scheme, file));
};
/////////////////////////////////////////////////////////////////////////////
// EXPORTS
/////////////////////////////////////////////////////////////////////////////
OSjs.Applications = OSjs.Applications || {};
OSjs.Applications.ApplicationTextpad = OSjs.Applications.ApplicationTextpad || {};
OSjs.Applications.ApplicationTextpad.Class = Object.seal(ApplicationTextpad);
})(OSjs.Helpers.DefaultApplication, OSjs.Helpers.DefaultApplicationWindow, OSjs.Core.Application, OSjs.Core.Window, OSjs.Utils, OSjs.API, OSjs.VFS, OSjs.GUI);
|
(function(){
"use strict";
let btn = document.querySelectorAll('.btn');
let contentOne = document.querySelectorAll('.contents .content-one');
let btnOne = document.querySelectorAll('.tab .btn-one');
btnOne.forEach(function(el){
el.style.backgroundColor = 'rgb(59, 59, 61';
el.style.color = 'white';
});
contentOne.forEach(function(el){
el.style.display = 'block';
});
btn.forEach(function (el){
el.addEventListener('click' , function(e){
let btnOne = this.parentElement.parentElement.children[0].children[0];
let btnTwo = this.parentElement.parentElement.children[1].children[0];
let btnThree = this.parentElement.parentElement.children[2].children[0];
let btnFour = this.parentElement.parentElement.children[3].children[0];
let btns = [btnOne, btnTwo, btnThree, btnFour];
btns.forEach(function(el){
el.style.backgroundColor = 'beige';
el.style.color = 'rgb(59, 59, 61';
});
this.style.backgroundColor = 'rgb(59, 59, 61';
this.style.color = 'white';
let contents = this.parentElement.parentElement.children[4];
switch(this.classList[0]){
case "btn-one":
contents.children[0].style.display = 'block'
contents.children[1].style.display = 'none'
contents.children[2].style.display = 'none'
contents.children[3].style.display = 'none'
break;
case "btn-two":
contents.children[0].style.display = 'none'
contents.children[1].style.display = 'block'
contents.children[2].style.display = 'none'
contents.children[3].style.display = 'none'
break;
case "btn-three":
contents.children[0].style.display = 'none'
contents.children[1].style.display = 'none'
contents.children[2].style.display = 'block'
contents.children[3].style.display = 'none'
break;
case "btn-four":
contents.children[0].style.display = 'none'
contents.children[1].style.display = 'none'
contents.children[2].style.display = 'none'
contents.children[3].style.display = 'block'
break;
default:
return false;
}
});
})
})();
|
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
# fmt: off
'''
Every template contains an ordered list of TemplateObjects.
TemplateObject is defined in template_objects.py
Freebuild templates are written for :
- either a BlockObject or a Location.
and represents the intent for the action: Freebuild.
This action intends for a generation model to complete or finish something that
is half-built.
Examples:
[Human, Freebuild, The, Colour, AbstractDescription, BlockObjectLocation]
- complete the red structure to the left of that grey shape.
- finish the blue thing at location: 2 , 3, 4 for me
[Human, Freebuild, BlockObjectThat, Size, Colour, AbstractDescription]
- complete that huge red structure
- finish that tiny blue thing for me please
etc
'''
from template_objects import *
FREEBUILD_WITH_CORRECTION = [
[[Human, FreebuildLocation, ThereTemplateCoref],
[HumanReplace, RelativeDirectionTemplate, LocationMobTemplate]],
[[Human, FreebuildLocation, HereTemplate],
[HumanReplace, RelativeDirectionTemplate, LocationMobTemplate]],
[[Human, FreebuildLocation, HereTemplateCoref],
[HumanReplace, RelativeDirectionTemplate, LocationMobTemplate]],
[[Human, FreebuildLocation, YouTemplate],
[HumanReplace, RelativeDirectionTemplate, LocationMobTemplate]],
[[Human, FreebuildLocation, ThereTemplateCoref],
[HumanReplace, RelativeDirectionTemplate, BlockObjectThat]],
[[Human, FreebuildLocation, HereTemplate],
[HumanReplace, RelativeDirectionTemplate, BlockObjectThat]],
[[Human, FreebuildLocation, HereTemplateCoref],
[HumanReplace, RelativeDirectionTemplate, BlockObjectThat]],
[[Human, FreebuildLocation, YouTemplate],
[HumanReplace, RelativeDirectionTemplate, BlockObjectThat]],
[[Human, Freebuild, BlockObjectThat, ForMe],
[HumanReplace, The, Colour, AbstractDescription]],
[[Human, Freebuild, BlockObjectThat, ForMe],
[HumanReplace, The, Size, AbstractDescription]],
[[Human, Freebuild, BlockObjectThat, ForMe],
[HumanReplace, The, Size, Colour, AbstractDescription]],
[[Human, Freebuild, BlockObjectThis, ForMe],
[HumanReplace, The, Colour, AbstractDescription]],
[[Human, Freebuild, BlockObjectThis, ForMe],
[HumanReplace, The, Size, AbstractDescription]],
[[Human, Freebuild, BlockObjectThis, ForMe],
[HumanReplace, The, Size, Colour, AbstractDescription]],
[[Human, Freebuild, BlockObjectIt, ForMe],
[HumanReplace, The, Colour, AbstractDescription]],
[[Human, Freebuild, BlockObjectIt, ForMe],
[HumanReplace, The, Size, AbstractDescription]],
[[Human, Freebuild, BlockObjectIt, ForMe],
[HumanReplace, The, Size, Colour, AbstractDescription]],
[[Human, Freebuild, BlockObjectThat, Colour, AbstractDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, BlockObjectThis, Colour, AbstractDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, The, Colour, AbstractDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, BlockObjectThat, Colour, ConcreteDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, BlockObjectThis, Colour, ConcreteDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, The, Colour, ConcreteDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, BlockObjectThat, AbstractDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, BlockObjectThat, AbstractDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, BlockObjectThat, AbstractDescription, ForMe],
[HumanReplace, The, Size, Colour, One]],
[[Human, Freebuild, BlockObjectThis, AbstractDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, BlockObjectThis, AbstractDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, BlockObjectThis, AbstractDescription, ForMe],
[HumanReplace, The, Size, Colour, One]],
[[Human, Freebuild, BlockObjectThat, ConcreteDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, BlockObjectThat, ConcreteDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, BlockObjectThat, ConcreteDescription, ForMe],
[HumanReplace, The, Size, Colour, One]],
[[Human, Freebuild, BlockObjectThis, ConcreteDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, BlockObjectThis, ConcreteDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, BlockObjectThis, ConcreteDescription, ForMe],
[HumanReplace, The, Size, Colour, One]],
[[Human, Freebuild, BlockObjectThat, Size, AbstractDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, BlockObjectThis, Size, AbstractDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, The, Size, AbstractDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, BlockObjectThat, Size, ConcreteDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, BlockObjectThis, Size, ConcreteDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, The, Size, ConcreteDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, The, Size, AbstractDescription, BlockObjectLocation, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, The, Size, ConcreteDescription, BlockObjectLocation, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, RepeatCount, ConcreteDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, RepeatCount, ConcreteDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, RepeatCount, ConcreteDescription, ForMe],
[HumanReplace, The, Size, Colour, One]],
[[Human, Freebuild, RepeatCount, Colour, ConcreteDescription, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, RepeatCount, Size, AbstractDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, RepeatCount, Size, ConcreteDescription, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, RepeatCount, Size, AbstractDescription, BlockObjectLocation, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, RepeatCount, Size, ConcreteDescription, BlockObjectLocation, ForMe],
[HumanReplace, The, Colour, One]],
[[Human, Freebuild, RepeatCount, Colour, AbstractDescription, BlockObjectLocation, ForMe],
[HumanReplace, The, Size, One]],
[[Human, Freebuild, RepeatCount, Colour, ConcreteDescription, BlockObjectLocation, ForMe],
[HumanReplace, The, Size, One]],
]
FREEBUILD_TEMPLATES = [
## Freebuild with only Location ##
[Human, FreebuildLocation, At, LocationWord, CoordinatesTemplate],
[Human, FreebuildLocation, RelativeDirectionTemplate, CoordinatesTemplate],
[Human, FreebuildLocation, Between, LocationBlockObjectTemplate, And, LocationMobTemplate],
[Human, FreebuildLocation, Between, LocationMobTemplate, And, LocationBlockObjectTemplate],
[Human, FreebuildLocation, RelativeDirectionTemplate, LocationBlockObjectTemplate],
[Human, FreebuildLocation, RelativeDirectionTemplate, LocationMobTemplate],
[Human, FreebuildLocation, RelativeDirectionTemplate, BlockObjectThat],
[Human, FreebuildLocation, ThereTemplate],
[Human, FreebuildLocation, ThereTemplateCoref],
[Human, FreebuildLocation, HereTemplate],
[Human, FreebuildLocation, HereTemplateCoref],
[Human, FreebuildLocation, YouTemplate],
[Human, FreebuildLocation, StepsTemplate, RelativeDirectionTemplate, CoordinatesTemplate],
[Human, FreebuildLocation, StepsTemplate, RelativeDirectionTemplate, LocationBlockObjectTemplate],
[Human, FreebuildLocation, StepsTemplate, RelativeDirectionTemplate, LocationMobTemplate],
[Human, FreebuildLocation, StepsTemplate, RelativeDirectionTemplate, BlockObjectThat],
[Human, FreebuildLocation, ALittle, RelativeDirectionTemplate, YouTemplate],
[Human, FreebuildLocation, ALittle, RelativeDirectionTemplate, LocationBlockObjectTemplate],
[Human, FreebuildLocation, ALittle, RelativeDirectionTemplate, LocationMobTemplate],
[Human, FreebuildLocation, ALittle, RelativeDirectionTemplate, CoordinatesTemplate],
[Human, FreebuildLocation, ALittle, RelativeDirectionTemplate, BlockObjectThat],
## Freebuild with only BlockObject ##
[Human, Freebuild, BlockObjectThat, ForMe],
[Human, Freebuild, BlockObjectThis, ForMe],
[Human, Freebuild, BlockObjectIt, ForMe],
[Human, Freebuild, BlockObjectThat, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThis, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThat, ConcreteDescription, ForMe],
[Human, Freebuild, BlockObjectThis, ConcreteDescription, ForMe],
[Human, Freebuild, The, ConcreteDescription, ForMe],
[Human, Freebuild, ConcreteDescription, ForMe],
[Human, Freebuild, The, AbstractDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, The, ConcreteDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, BlockObjectThat, Colour, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThis, Colour, AbstractDescription, ForMe],
[Human, Freebuild, The, Colour, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThat, Colour, ConcreteDescription, ForMe],
[Human, Freebuild, BlockObjectThis, Colour, ConcreteDescription, ForMe],
[Human, Freebuild, The, Colour, ConcreteDescription, ForMe],
[Human, Freebuild, BlockObjectThat, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThis, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThat, ConcreteDescription, ForMe],
[Human, Freebuild, BlockObjectThis, ConcreteDescription, ForMe],
[Human, Freebuild, BlockObjectThat, Size, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThis, Size, AbstractDescription, ForMe],
[Human, Freebuild, The, Size, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThat, Size, ConcreteDescription, ForMe],
[Human, Freebuild, BlockObjectThis, Size, ConcreteDescription, ForMe],
[Human, Freebuild, The, Size, ConcreteDescription, ForMe],
[Human, Freebuild, The, Size, AbstractDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, The, Size, ConcreteDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, The, Colour, AbstractDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, The, Colour, ConcreteDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, BlockObjectThat, Size, Colour, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThis, Size, Colour, AbstractDescription, ForMe],
[Human, Freebuild, The, Size, Colour, AbstractDescription, ForMe],
[Human, Freebuild, BlockObjectThat, Size, Colour, ConcreteDescription, ForMe],
[Human, Freebuild, BlockObjectThis, Size, Colour, ConcreteDescription, ForMe],
[Human, Freebuild, The, Size, Colour, ConcreteDescription, ForMe],
[Human, Freebuild, The, Size, Colour, AbstractDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, The, Size, Colour, ConcreteDescription, BlockObjectLocation, ForMe],
### Freebuild num X ###
[Human, Freebuild, RepeatCount, ConcreteDescription, ForMe],
[Human, Freebuild, RepeatCount, Colour, ConcreteDescription, ForMe],
[Human, Freebuild, RepeatCount, Size, AbstractDescription, ForMe],
[Human, Freebuild, RepeatCount, Size, ConcreteDescription, ForMe],
[Human, Freebuild, RepeatCount, Size, AbstractDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, ConcreteDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, RepeatCount, Colour, AbstractDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, RepeatCount, Colour, ConcreteDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, Colour, AbstractDescription, ForMe],
[Human, Freebuild, RepeatCount, Size, Colour, ConcreteDescription, ForMe],
[Human, Freebuild, RepeatCount, Size, Colour, AbstractDescription, BlockObjectLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, Colour, ConcreteDescription, BlockObjectLocation, ForMe],
### Freebuild X in front of num Y ###
[Human, Freebuild, The, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, The, Size, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, The, Colour, AbstractDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, The, Colour, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, The, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, The, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
### Freebuild num X in front of num Y ###
[Human, Freebuild, RepeatCount, AbstractDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, RepeatCount, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, AbstractDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, RepeatCount, Colour, AbstractDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, RepeatCount, Colour, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, ForMe],
### Freebuild All X in front of Y ###
[Human, Freebuild, All, ConcreteDescription, RepeatAll, ForMe],
[Human, Freebuild, Every, ConcreteDescription, RepeatAll, ForMe],
[Human, Freebuild, All, Colour, ConcreteDescription, RepeatAll, ForMe],
[Human, Freebuild, Every, Colour, ConcreteDescription, RepeatAll, ForMe],
[Human, Freebuild, All, Colour, AbstractDescription, RepeatAll, ForMe],
[Human, Freebuild, Every, Colour, AbstractDescription, RepeatAll, ForMe],
[Human, Freebuild, All, Size, AbstractDescription, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, AbstractDescription, RepeatAll, ForMe],
[Human, Freebuild, All, Size, ConcreteDescription, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, ConcreteDescription, RepeatAll, ForMe],
[Human, Freebuild, All, Size, AbstractDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, ConcreteDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, AbstractDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, ConcreteDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Colour, AbstractDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Colour, ConcreteDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Colour, AbstractDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Colour, ConcreteDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, Colour, AbstractDescription, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, Colour, AbstractDescription, RepeatAll, ForMe],
[Human, Freebuild, All, Size, Colour, ConcreteDescription, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, Colour, ConcreteDescription, RepeatAll, ForMe],
[Human, Freebuild, All, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatAll, ForMe],
### Freebuild X in front of all Ys ###
[Human, Freebuild, The, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, The, Size, AbstractDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, The, Size, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, The, Colour, AbstractDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, The, Colour, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, The, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, The, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
### Freebuild all X in front of all Ys ###
[Human, Freebuild, All, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, AbstractDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, AbstractDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Colour, AbstractDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Colour, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Colour, AbstractDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Colour, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, RepeatAll, ForMe],
### Freebuild all X in front of n Ys ###
[Human, Freebuild, All, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, AbstractDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, AbstractDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Colour, AbstractDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Colour, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Colour, AbstractDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Colour, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, All, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
[Human, Freebuild, Every, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatCountLocation, RepeatAll, ForMe],
### Freebuild n X in front of all Ys ###
[Human, Freebuild, RepeatCount, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, AbstractDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, RepeatCount, Colour, AbstractDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, RepeatCount, Colour, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, Colour, AbstractDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
[Human, Freebuild, RepeatCount, Size, Colour, ConcreteDescription, BlockObjectLocation, RepeatAllLocation, ForMe],
]
|
import babel from 'rollup-plugin-babel';
import pkg from './package.json';
export default [
{
input: pkg.module,
output: [
{
file: pkg.bin.gps,
format: 'cjs',
sourcemap: true,
banner: '#!/usr/bin/env node',
},
],
external: [
'debug',
'amqplib',
'serialport',
'redis',
'@mark48evo/usb-serialport-device-lister',
'@mark48evo/ubx-protocol-parser',
'@mark48evo/ubx-packet-parser',
'@mark48evo/rabbitmq-pubsub',
'@mark48evo/system-events',
'@mark48evo/system-state',
'@mark48evo/system-gps',
],
plugins: [
babel({
exclude: 'node_modules/**',
envName: 'rollup',
}),
],
},
];
|
# -*- coding: utf-8 -*-
import pandas as pd
## Uplaod Townlands CSV to dataframe
dataset = pd.read_csv("townlands.csv")
## As dataset doesn't have Dublin addresses
dataset = dataset[dataset.county != 'Dublin']
## Create townlands dictionary to check against addresses
townland_dict = dataset.to_dict('records')
## Upload addresses
addresses = pd.read_csv("addresses_clean.csv")
## Adding long & lat columns
addresses['long'] = ""
addresses['lat'] = ""
## Address search function
def address_geocoder(data, col):
for index, row in data.iterrows():
if row[col] != 'None':
for element in townland_dict:
if row['county'] == element['county']:
if row[col] == element['townland']:
row['long'] = str(element['X'])
row['lat'] = str(element['Y'])
return data
## Checking addresses columns staritng with the last one. On each stage separating
## geocoded addresses from the not-geocoded ones
address_geocoder(addresses,'rest')
addresses_rest_geocoded = addresses.loc[addresses['long'] != '']
addresses_rest = addresses.loc[addresses['long'] == '']
## 1665 hits
###################
address_geocoder(addresses_rest,'address_4')
addresses_4_geocoded = addresses_rest.loc[addresses_rest['long'] != '']
addresses_4 = addresses_rest.loc[addresses_rest['long'] == '']
## 0 hits
###################
address_geocoder(addresses_4,'address_3')
addresses_3_geocoded = addresses_4.loc[addresses_4['long'] != '']
addresses_3 = addresses_4.loc[addresses_4['long'] == '']
## 0 hits
##################
address_geocoder(addresses_3,'address_2')
addresses_2_geocoded = addresses_3.loc[addresses_3['long'] != '']
addresses_2 = addresses_3.loc[addresses_3['long'] == '']
## 24 hits
###################
address_geocoder(addresses_2,'address_1')
addresses_1_geocoded = addresses_2.loc[addresses_2['long'] != '']
addresses_1 = addresses_2.loc[addresses_2['long'] == '']
## 101 hits
###################
address_geocoder(addresses_1,'townland')
addresses_townland_geocoded = addresses_1.loc[addresses_1['long'] != '']
addresses_townland = addresses_1.loc[addresses_1['long'] == '']
## 914 hits
## Merging Geocoded addresses into one dataframe
geocoded_1 = pd.concat([addresses_rest_geocoded,addresses_4_geocoded,
addresses_3_geocoded, addresses_2_geocoded,
addresses_1_geocoded, addresses_townland_geocoded ] )
## Dataframe for addresses that still need to be geocoded
geocode = addresses_townland
## Preparing csv files for Stage 2
geocoded_1.to_csv("geocoded_1.csv", index=False,encoding = "utf-8")
geocode.to_csv("geocode.csv", index=False,encoding = "utf-8")
|
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><path d="M22 6H12l-2-2H2v16h20V6zm-2 12H4V8h16v10z" /></React.Fragment>
, 'FolderOpenSharp');
|
var debug = require('debug')('nodemon');
const statSync = require('fs').statSync;
var utils = require('../utils');
var bus = utils.bus;
var childProcess = require('child_process');
var spawn = childProcess.spawn;
var exec = childProcess.exec;
var fork = childProcess.fork;
var watch = require('./watch').watch;
var config = require('../config');
var child = null; // the actual child process we spawn
var killedAfterChange = false;
var noop = function () { };
var restart = null;
var psTree = require('pstree.remy');
var path = require('path');
var signals = require('./signals');
function run(options) {
var cmd = config.command.raw;
var runCmd = !options.runOnChangeOnly || config.lastStarted !== 0;
if (runCmd) {
utils.log.status('starting `' + config.command.string + '`');
}
/*jshint validthis:true*/
restart = run.bind(this, options);
run.restart = restart;
config.lastStarted = Date.now();
var stdio = ['pipe', 'pipe', 'pipe'];
if (config.options.stdout) {
stdio = ['pipe', process.stdout, process.stderr];
}
if (config.options.stdin === false) {
stdio = [process.stdin, process.stdout, process.stderr];
}
var sh = 'sh';
var shFlag = '-c';
const binPath = process.cwd() + '/node_modules/.bin';
const spawnOptions = {
env: Object.assign({}, process.env, options.execOptions.env, {
PATH: binPath + ':' + process.env.PATH,
}),
stdio: stdio,
}
var executable = cmd.executable;
if (utils.isWindows) {
// if the exec includes a forward slash, reverse it for windows compat
// but *only* apply to the first command, and none of the arguments.
// ref #1251 and #1236
if (executable.indexOf('/') !== -1) {
executable = executable.split(' ').map((e, i) => {
if (i === 0) {
return path.normalize(e);
}
return e;
}).join(' ');
}
// taken from npm's cli: https://git.io/vNFD4
sh = process.env.comspec || 'cmd';
shFlag = '/d /s /c';
spawnOptions.windowsVerbatimArguments = true;
}
var args = runCmd ? utils.stringify(executable, cmd.args) : ':';
var spawnArgs = [sh, [shFlag, args], spawnOptions];
const firstArg = cmd.args[0] || '';
var inBinPath = false;
try {
inBinPath = statSync(`${binPath}/${executable}`).isFile();
} catch (e) {}
// hasStdio allows us to correctly handle stdin piping
// see: https://git.io/vNtX3
const hasStdio = utils.satisfies('>= 6.4.0 || < 5');
// forking helps with sub-process handling and tends to clean up better
// than spawning, but it should only be used under specific conditions
const shouldFork =
!config.options.spawn &&
!inBinPath &&
firstArg.indexOf('-') === -1 && // don't fork if there's a node exec arg
firstArg !== 'inspect' && // don't fork it's `inspect` debugger
executable === 'node' && // only fork if node
utils.version.major > 4 // only fork if node version > 4
if (shouldFork) {
var forkArgs = cmd.args.slice(1);
var env = utils.merge(options.execOptions.env, process.env);
stdio.push('ipc');
child = fork(options.execOptions.script, forkArgs, {
env: env,
stdio: stdio,
silent: !hasStdio,
});
utils.log.detail('forking');
debug('fork', sh, shFlag, args)
} else {
utils.log.detail('spawning');
child = spawn.apply(null, spawnArgs);
debug('spawn', sh, shFlag, args)
}
if (config.required) {
var emit = {
stdout: function (data) {
bus.emit('stdout', data);
},
stderr: function (data) {
bus.emit('stderr', data);
},
};
// now work out what to bind to...
if (config.options.stdout) {
child.on('stdout', emit.stdout).on('stderr', emit.stderr);
} else {
child.stdout.on('data', emit.stdout);
child.stderr.on('data', emit.stderr);
bus.stdout = child.stdout;
bus.stderr = child.stderr;
}
}
bus.emit('start');
utils.log.detail('child pid: ' + child.pid);
child.on('error', function (error) {
bus.emit('error', error);
if (error.code === 'ENOENT') {
utils.log.error('unable to run executable: "' + cmd.executable + '"');
process.exit(1);
} else {
utils.log.error('failed to start child process: ' + error.code);
throw error;
}
});
child.on('exit', function (code, signal) {
if (child && child.stdin) {
process.stdin.unpipe(child.stdin);
}
if (code === 127) {
utils.log.error('failed to start process, "' + cmd.executable +
'" exec not found');
bus.emit('error', code);
process.exit();
}
// If the command failed with code 2, it may or may not be a syntax error
// See: http://git.io/fNOAR
// We will only assume a parse error, if the child failed quickly
if (code === 2 && Date.now() < config.lastStarted + 500) {
utils.log.error('process failed, unhandled exit code (2)');
utils.log.error('');
utils.log.error('Either the command has a syntax error,');
utils.log.error('or it is exiting with reserved code 2.');
utils.log.error('');
utils.log.error('To keep nodemon running even after a code 2,');
utils.log.error('add this to the end of your command: || exit 1');
utils.log.error('');
utils.log.error('Read more here: https://git.io/fNOAG');
utils.log.error('');
utils.log.error('nodemon will stop now so that you can fix the command.');
utils.log.error('');
bus.emit('error', code);
process.exit();
}
// In case we killed the app ourselves, set the signal thusly
if (killedAfterChange) {
killedAfterChange = false;
signal = config.signal;
}
// this is nasty, but it gives it windows support
if (utils.isWindows && signal === 'SIGTERM') {
signal = config.signal;
}
if (signal === config.signal || code === 0) {
// this was a clean exit, so emit exit, rather than crash
debug('bus.emit(exit) via ' + config.signal);
bus.emit('exit');
// exit the monitor, but do it gracefully
if (signal === config.signal) {
return restart();
}
if (code === 0) { // clean exit - wait until file change to restart
if (runCmd) {
utils.log.status('clean exit - waiting for changes before restart');
}
child = null;
}
} else {
bus.emit('crash');
if (options.exitcrash) {
utils.log.fail('app crashed');
if (!config.required) {
process.exit(1);
}
} else {
utils.log.fail('app crashed - waiting for file changes before' +
' starting...');
child = null;
}
}
if (config.options.restartable) {
// stdin needs to kick in again to be able to listen to the
// restart command
process.stdin.resume();
}
});
run.kill = function (noRestart, callback) {
// I hate code like this :( - Remy (author of said code)
if (typeof noRestart === 'function') {
callback = noRestart;
noRestart = false;
}
if (!callback) {
callback = noop;
}
if (child !== null) {
// if the stdin piping is on, we need to unpipe, but also close stdin on
// the child, otherwise linux can throw EPIPE or ECONNRESET errors.
if (options.stdin) {
process.stdin.unpipe(child.stdin);
}
// For the on('exit', ...) handler above the following looks like a
// crash, so we set the killedAfterChange flag if a restart is planned
if (!noRestart) {
killedAfterChange = true;
}
/* Now kill the entire subtree of processes belonging to nodemon */
var oldPid = child.pid;
if (child) {
kill(child, config.signal, function () {
// this seems to fix the 0.11.x issue with the "rs" restart command,
// though I'm unsure why. it seems like more data is streamed in to
// stdin after we close.
if (child && options.stdin && child.stdin && oldPid === child.pid) {
child.stdin.end();
}
callback();
});
}
} else if (!noRestart) {
// if there's no child, then we need to manually start the process
// this is because as there was no child, the child.on('exit') event
// handler doesn't exist which would normally trigger the restart.
bus.once('start', callback);
restart();
} else {
callback();
}
};
// connect stdin to the child process (options.stdin is on by default)
if (options.stdin) {
process.stdin.resume();
// FIXME decide whether or not we need to decide the encoding
// process.stdin.setEncoding('utf8');
// swallow the stdin error if it happens
// ref: https://github.com/remy/nodemon/issues/1195
if (hasStdio) {
child.stdin.on('error', () => { });
process.stdin.pipe(child.stdin);
} else {
if (child.stdout) {
child.stdout.pipe(process.stdout);
} else {
utils.log.error('running an unsupported version of node ' +
process.version);
utils.log.error('nodemon may not work as expected - ' +
'please consider upgrading to LTS');
}
}
bus.once('exit', function () {
if (child && process.stdin.unpipe) { // node > 0.8
process.stdin.unpipe(child.stdin);
}
});
}
debug('start watch on: %s', config.options.watch);
if (config.options.watch !== false) {
watch();
}
}
function kill(child, signal, callback) {
if (!callback) {
callback = function () { };
}
if (utils.isWindows) {
// When using CoffeeScript under Windows, child's process is not node.exe
// Instead coffee.cmd is launched, which launches cmd.exe, which starts
// node.exe as a child process child.kill() would only kill cmd.exe, not
// node.exe
// Therefore we use the Windows taskkill utility to kill the process and all
// its children (/T for tree).
// Force kill (/F) the whole child tree (/T) by PID (/PID 123)
exec('taskkill /pid ' + child.pid + ' /T /F');
callback();
} else {
// we use psTree to kill the full subtree of nodemon, because when
// spawning processes like `coffee` under the `--debug` flag, it'll spawn
// it's own child, and that can't be killed by nodemon, so psTree gives us
// an array of PIDs that have spawned under nodemon, and we send each the
// configured signal (default: SIGUSR2) signal, which fixes #335
// note that psTree also works if `ps` is missing by looking in /proc
const sig = signal.replace('SIG', '');
psTree(child.pid, function (err, kids) {
if (psTree.hasPS) {
spawn('kill', ['-s', sig, child.pid].concat(kids))
.on('close', callback);
} else {
// make sure we kill from smallest to largest
const pids = kids.concat(child.pid).sort();
pids.forEach(pid => {
exec('kill -' + signals[signal] + ' ' + pid, () => { });
});
callback();
}
});
}
}
// stubbed out for now, filled in during run
run.kill = function (flag, callback) {
if (callback) {
callback();
}
};
run.restart = noop;
bus.on('quit', function onQuit(code) {
if (code === undefined) {
code = 0;
}
// remove event listener
var exitTimer = null;
var exit = function () {
clearTimeout(exitTimer);
exit = noop; // null out in case of race condition
child = null;
if (!config.required) {
// Execute all other quit listeners.
bus.listeners('quit').forEach(function (listener) {
if (listener !== onQuit) {
listener();
}
});
process.exit(code);
} else {
bus.emit('exit');
}
};
// if we're not running already, don't bother with trying to kill
if (config.run === false) {
return exit();
}
// immediately try to stop any polling
config.run = false;
if (child) {
// give up waiting for the kids after 10 seconds
exitTimer = setTimeout(exit, 10 * 1000);
child.removeAllListeners('exit');
child.once('exit', exit);
kill(child, 'SIGINT');
} else {
exit();
}
});
bus.on('restart', function () {
// run.kill will send a SIGINT to the child process, which will cause it
// to terminate, which in turn uses the 'exit' event handler to restart
run.kill();
});
// remove the child file on exit
process.on('exit', function () {
utils.log.detail('exiting');
if (child) { child.kill(); }
});
// because windows borks when listening for the SIG* events
if (!utils.isWindows) {
bus.once('boot', () => {
// usual suspect: ctrl+c exit
process.once('SIGINT', () => bus.emit('quit', 130));
process.once('SIGTERM', () => {
bus.emit('quit', 143);
if (child) { child.kill('SIGTERM'); }
});
})
}
module.exports = run;
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=20
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
def make_circuit(n: int, input_qubit):
c = cirq.Circuit() # circuit begin
c.append(cirq.H.on(input_qubit[0])) # number=1
c.append(cirq.H.on(input_qubit[1])) # number=2
c.append(cirq.H.on(input_qubit[1])) # number=7
c.append(cirq.H.on(input_qubit[2])) # number=3
c.append(cirq.H.on(input_qubit[3])) # number=4
c.append(cirq.H.on(input_qubit[0])) # number=12
c.append(cirq.CZ.on(input_qubit[3],input_qubit[0])) # number=13
c.append(cirq.H.on(input_qubit[0])) # number=14
c.append(cirq.H.on(input_qubit[0])) # number=15
c.append(cirq.CZ.on(input_qubit[3],input_qubit[0])) # number=16
c.append(cirq.H.on(input_qubit[0])) # number=17
c.append(cirq.SWAP.on(input_qubit[1],input_qubit[0])) # number=8
c.append(cirq.SWAP.on(input_qubit[1],input_qubit[0])) # number=9
c.append(cirq.SWAP.on(input_qubit[1],input_qubit[0])) # number=10
c.append(cirq.SWAP.on(input_qubit[1],input_qubit[0])) # number=11
c.append(cirq.SWAP.on(input_qubit[1],input_qubit[0])) # number=18
c.append(cirq.SWAP.on(input_qubit[1],input_qubit[0])) # number=19
# circuit end
return c
def bitstring(bits):
return ''.join(str(int(b)) for b in bits)
if __name__ == '__main__':
qubit_count = 4
input_qubits = [cirq.GridQubit(i, 0) for i in range(qubit_count)]
circuit = make_circuit(qubit_count,input_qubits)
circuit = cg.optimized_for_sycamore(circuit, optimizer_type='sqrt_iswap')
circuit_sample_count =2820
info = cirq.final_state_vector(circuit)
qubits = round(log2(len(info)))
frequencies = {
np.binary_repr(i, qubits): round((info[i]*(info[i].conjugate())).real,3)
for i in range(2 ** qubits)
}
writefile = open("../data/startCirq_Class521.csv","w+")
print(format(frequencies),file=writefile)
print("results end", file=writefile)
print(circuit.__len__(), file=writefile)
print(circuit,file=writefile)
writefile.close()
|
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const mySchema = new Schema({
username: String,
password: String,
});
const model = mongoose.model('Auth', mySchema);
module.exports = model;
|
const Calc = require("./calculator.js");
class xmlconfig {
constructor(){
this.join = Calc.join.orders.order;
this.opdefine = (grammer, order, formula, groupid) => {
return new Calc.opdefine(grammer, order, formula, groupid);
};
this.ctrldefine = (grammer, formula, groupid) => {
return new Calc.ctrldefine(grammer, formula, groupid);
};
this.controls = [
this.ctrldefine(
[
(val, ptr, self) => {
if (val[0] !== '<') {
return false;
}
if (val.length === 1) {
return true;
}
// 真面目にするならば、属性値などの文字列内の>は無視するようにしないといけない。
if (val[val.length - 2] === '>') {
return false;
}
return true;
},
0.5,
(val, ptr, self) => {
if (self) {
// (属性とか空白を考慮していないけれども)開始タグとの比較
return val.slice(2) === self.starter.first.slice(1);
}
if (val[0] !== '<') {
return false;
}
if (val.length === 1) {
return ptr.slice(0, 1) === '/';
}
if (val[val.length - 2] === '>') {
return false;
}
return true;
}
]
,(args, meta, self) => {
},
'tag'
)
];
this.hooks = [];
this.ops = [
[
this.opdefine((val) => {
if (val[val.length - 1] == '<') {
return false;
}
return true;
}, this.join.left,
() => {
}),
]
];
this.config = new Calc.config(this.opdefs, [], [], this.hooks, [], this.controls);
}
set code(val) {
this.parser.code = val;
}
get value() {
return undefined;
}
get parser() {
if (this._parser === undefined) {
this._parser = new Calc.calculator(this.config)
}
return this._parser;
}
}
module.exports = new xmlconfig()
|
import BaseLogic from './base.logic';
import Repository from '../repository';
class TagLogic extends BaseLogic {
static model() {
return Repository.TagRepository.model();
}
static async get(id) {
return await Repository.TagRepository.get(id, TagLogic.model());
}
static async create(data) {
return await Repository.TagRepository.create(data, TagLogic.model());
}
static async iCreate(data, name = '') {
return await Repository.TagRepository.iCreate({ name }, data, TagLogic.model());
}
static async update(id, data) {
return await Repository.TagRepository.update(id, data, TagLogic.model());
}
static async list(page=1, limit=10, where={}, include=null, options={}) {
return await Repository.TagRepository.list(TagLogic.model(), '/tags/', page, limit, where, include, options);
}
static async search(query) {
return await Repository.TagRepository.search(query);
}
}
export default TagLogic;
|
import request from '@/utils/request'
let model = '/role'
export function getList(data) {
return request({
url: model + '/index',
method: 'get',
params: data
})
}
export function edit(data) {
return request({
url: model + '/edit',
method: 'post',
data
})
}
export function create(data) {
return request({
url: model + '/create',
method: 'post',
data
})
}
export function changeStatus(data) {
return request({
url: model + '/change-status',
method: 'post',
data
})
}
export function destroy(data) {
return request({
url: model + '/destroy',
method: 'post',
data
})
}
export function getRoleOptions() {
return request({
url: model + '/role-options',
method: 'get'
})
}
|
exports.getRemainingDailyQuotaImpl = (p_) => () => {
return p_.getRemainingDailyQuota();
}
exports.sendEmailWithObjectBlobsourcearrayStringStringStringStringObjectStringBooleanStringStringStringImpl = (message) => (attachments) => (bcc) => (body) => (cc) => (htmlBody) => (inlineImages) => (name) => (noReply) => (replyTo) => (subject) => (to) => (p_) => () => {
return p_.sendEmail(message, attachments, bcc, body, cc, htmlBody, inlineImages, name, noReply, replyTo, subject, to);
}
exports.sendEmailWithStringStringStringImpl = (recipient) => (subject) => (body) => (p_) => () => {
return p_.sendEmail(recipient, subject, body);
}
exports.sendEmailWithStringStringStringObjectBlobsourcearrayStringStringStringObjectStringBooleanStringImpl = (recipient) => (subject) => (body) => (options) => (attachments) => (bcc) => (cc) => (htmlBody) => (inlineImages) => (name) => (noReply) => (replyTo) => (p_) => () => {
return p_.sendEmail(recipient, subject, body, options, attachments, bcc, cc, htmlBody, inlineImages, name, noReply, replyTo);
}
exports.sendEmailWithStringStringStringStringImpl = (to) => (replyTo) => (subject) => (body) => (p_) => () => {
return p_.sendEmail(to, replyTo, subject, body);
}
|
"use strict";(self.webpackChunkgolpes_org=self.webpackChunkgolpes_org||[]).push([[179],{30:()=>{function se(n){return"function"==typeof n}function xs(n){const e=n(r=>{Error.call(r),r.stack=(new Error).stack});return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}const Xo=xs(n=>function(e){n(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((r,i)=>`${i+1}) ${r.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e});function gi(n,t){if(n){const e=n.indexOf(t);0<=e&&n.splice(e,1)}}class bt{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:e}=this;if(e)if(this._parentage=null,Array.isArray(e))for(const s of e)s.remove(this);else e.remove(this);const{initialTeardown:r}=this;if(se(r))try{r()}catch(s){t=s instanceof Xo?s.errors:[s]}const{_teardowns:i}=this;if(i){this._teardowns=null;for(const s of i)try{wp(s)}catch(o){t=null!=t?t:[],o instanceof Xo?t=[...t,...o.errors]:t.push(o)}}if(t)throw new Xo(t)}}add(t){var e;if(t&&t!==this)if(this.closed)wp(t);else{if(t instanceof bt){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(e=this._teardowns)&&void 0!==e?e:[]).push(t)}}_hasParent(t){const{_parentage:e}=this;return e===t||Array.isArray(e)&&e.includes(t)}_addParent(t){const{_parentage:e}=this;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t}_removeParent(t){const{_parentage:e}=this;e===t?this._parentage=null:Array.isArray(e)&&gi(e,t)}remove(t){const{_teardowns:e}=this;e&&gi(e,t),t instanceof bt&&t._removeParent(this)}}bt.EMPTY=(()=>{const n=new bt;return n.closed=!0,n})();const Dp=bt.EMPTY;function Ep(n){return n instanceof bt||n&&"closed"in n&&se(n.remove)&&se(n.add)&&se(n.unsubscribe)}function wp(n){se(n)?n():n.unsubscribe()}const Nr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Jo={setTimeout(...n){const{delegate:t}=Jo;return((null==t?void 0:t.setTimeout)||setTimeout)(...n)},clearTimeout(n){const{delegate:t}=Jo;return((null==t?void 0:t.clearTimeout)||clearTimeout)(n)},delegate:void 0};function xp(n){Jo.setTimeout(()=>{const{onUnhandledError:t}=Nr;if(!t)throw n;t(n)})}function As(){}const jx=wu("C",void 0,void 0);function wu(n,t,e){return{kind:n,value:t,error:e}}let kr=null;function ea(n){if(Nr.useDeprecatedSynchronousErrorHandling){const t=!kr;if(t&&(kr={errorThrown:!1,error:null}),n(),t){const{errorThrown:e,error:r}=kr;if(kr=null,e)throw r}}else n()}class xu extends bt{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Ep(t)&&t.add(this)):this.destination=$x}static create(t,e,r){return new Au(t,e,r)}next(t){this.isStopped?Su(function Ux(n){return wu("N",n,void 0)}(t),this):this._next(t)}error(t){this.isStopped?Su(function Hx(n){return wu("E",void 0,n)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Su(jx,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}class Au extends xu{constructor(t,e,r){let i;if(super(),se(t))i=t;else if(t){let s;({next:i,error:e,complete:r}=t),this&&Nr.useDeprecatedNextContext?(s=Object.create(t),s.unsubscribe=()=>this.unsubscribe()):s=t,i=null==i?void 0:i.bind(s),e=null==e?void 0:e.bind(s),r=null==r?void 0:r.bind(s)}this.destination={next:i?Mu(i):As,error:Mu(null!=e?e:Ap),complete:r?Mu(r):As}}}function Mu(n,t){return(...e)=>{try{n(...e)}catch(r){Nr.useDeprecatedSynchronousErrorHandling?function Gx(n){Nr.useDeprecatedSynchronousErrorHandling&&kr&&(kr.errorThrown=!0,kr.error=n)}(r):xp(r)}}}function Ap(n){throw n}function Su(n,t){const{onStoppedNotification:e}=Nr;e&&Jo.setTimeout(()=>e(n,t))}const $x={closed:!0,next:As,error:Ap,complete:As},Tu="function"==typeof Symbol&&Symbol.observable||"@@observable";function Pr(n){return n}let de=(()=>{class n{constructor(e){e&&(this._subscribe=e)}lift(e){const r=new n;return r.source=this,r.operator=e,r}subscribe(e,r,i){const s=function zx(n){return n&&n instanceof xu||function qx(n){return n&&se(n.next)&&se(n.error)&&se(n.complete)}(n)&&Ep(n)}(e)?e:new Au(e,r,i);return ea(()=>{const{operator:o,source:a}=this;s.add(o?o.call(s,a):a?this._subscribe(s):this._trySubscribe(s))}),s}_trySubscribe(e){try{return this._subscribe(e)}catch(r){e.error(r)}}forEach(e,r){return new(r=Sp(r))((i,s)=>{let o;o=this.subscribe(a=>{try{e(a)}catch(l){s(l),null==o||o.unsubscribe()}},s,i)})}_subscribe(e){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(e)}[Tu](){return this}pipe(...e){return function Mp(n){return 0===n.length?Pr:1===n.length?n[0]:function(e){return n.reduce((r,i)=>i(r),e)}}(e)(this)}toPromise(e){return new(e=Sp(e))((r,i)=>{let s;this.subscribe(o=>s=o,o=>i(o),()=>r(s))})}}return n.create=t=>new n(t),n})();function Sp(n){var t;return null!==(t=null!=n?n:Nr.Promise)&&void 0!==t?t:Promise}const Wx=xs(n=>function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let Xe=(()=>{class n extends de{constructor(){super(),this.closed=!1,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){const r=new Tp(this,this);return r.operator=e,r}_throwIfClosed(){if(this.closed)throw new Wx}next(e){ea(()=>{if(this._throwIfClosed(),!this.isStopped){const r=this.observers.slice();for(const i of r)i.next(e)}})}error(e){ea(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;const{observers:r}=this;for(;r.length;)r.shift().error(e)}})}complete(){ea(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:e}=this;for(;e.length;)e.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=null}get observed(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){const{hasError:r,isStopped:i,observers:s}=this;return r||i?Dp:(s.push(e),new bt(()=>gi(s,e)))}_checkFinalizedStatuses(e){const{hasError:r,thrownError:i,isStopped:s}=this;r?e.error(i):s&&e.complete()}asObservable(){const e=new de;return e.source=this,e}}return n.create=(t,e)=>new Tp(t,e),n})();class Tp extends Xe{constructor(t,e){super(),this.destination=t,this.source=e}next(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)}error(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)}complete(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)}_subscribe(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:Dp}}function Ip(n){return se(null==n?void 0:n.lift)}function Ge(n){return t=>{if(Ip(t))return t.lift(function(e){try{return n(e,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}class Le extends xu{constructor(t,e,r,i,s){super(t),this.onFinalize=s,this._next=e?function(o){try{e(o)}catch(a){t.error(a)}}:super._next,this._error=i?function(o){try{i(o)}catch(a){t.error(a)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(o){t.error(o)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;const{closed:e}=this;super.unsubscribe(),!e&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}function ee(n,t){return Ge((e,r)=>{let i=0;e.subscribe(new Le(r,s=>{r.next(n.call(t,s,i++))}))})}function Lr(n){return this instanceof Lr?(this.v=n,this):new Lr(n)}function Yx(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=e.apply(n,t||[]),s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(h){return new Promise(function(g,m){s.push([f,h,g,m])>1||a(f,h)})})}function a(f,h){try{!function l(f){f.value instanceof Lr?Promise.resolve(f.value.v).then(u,c):d(s[0][2],f)}(r[f](h))}catch(g){d(s[0][3],g)}}function u(f){a("next",f)}function c(f){a("throw",f)}function d(f,h){f(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Zx(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=n[Symbol.asyncIterator];return t?t.call(n):(n=function Op(n){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(s){e[s]=n[s]&&function(o){return new Promise(function(a,l){!function i(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}(a,l,(o=n[s](o)).done,o.value)})}}}const Fu=n=>n&&"number"==typeof n.length&&"function"!=typeof n;function Np(n){return se(null==n?void 0:n.then)}function kp(n){return se(n[Tu])}function Pp(n){return Symbol.asyncIterator&&se(null==n?void 0:n[Symbol.asyncIterator])}function Lp(n){return new TypeError(`You provided ${null!==n&&"object"==typeof n?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const Vp=function Jx(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function Bp(n){return se(null==n?void 0:n[Vp])}function jp(n){return Yx(this,arguments,function*(){const e=n.getReader();try{for(;;){const{value:r,done:i}=yield Lr(e.read());if(i)return yield Lr(void 0);yield yield Lr(r)}}finally{e.releaseLock()}})}function Hp(n){return se(null==n?void 0:n.getReader)}function $t(n){if(n instanceof de)return n;if(null!=n){if(kp(n))return function eA(n){return new de(t=>{const e=n[Tu]();if(se(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(n);if(Fu(n))return function tA(n){return new de(t=>{for(let e=0;e<n.length&&!t.closed;e++)t.next(n[e]);t.complete()})}(n);if(Np(n))return function nA(n){return new de(t=>{n.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,xp)})}(n);if(Pp(n))return Up(n);if(Bp(n))return function rA(n){return new de(t=>{for(const e of n)if(t.next(e),t.closed)return;t.complete()})}(n);if(Hp(n))return function iA(n){return Up(jp(n))}(n)}throw Lp(n)}function Up(n){return new de(t=>{(function sA(n,t){var e,r,i,s;return function Kx(n,t,e,r){return new(e||(e=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):function i(s){return s instanceof e?s:new e(function(o){o(s)})}(c.value).then(a,l)}u((r=r.apply(n,t||[])).next())})}(this,void 0,void 0,function*(){try{for(e=Zx(n);!(r=yield e.next()).done;)if(t.next(r.value),t.closed)return}catch(o){i={error:o}}finally{try{r&&!r.done&&(s=e.return)&&(yield s.call(e))}finally{if(i)throw i.error}}t.complete()})})(n,t).catch(e=>t.error(e))})}function Hn(n,t,e,r=0,i=!1){const s=t.schedule(function(){e(),i?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(s),!i)return s}function $e(n,t,e=1/0){return se(t)?$e((r,i)=>ee((s,o)=>t(r,s,i,o))($t(n(r,i))),e):("number"==typeof t&&(e=t),Ge((r,i)=>function oA(n,t,e,r,i,s,o,a){const l=[];let u=0,c=0,d=!1;const f=()=>{d&&!l.length&&!u&&t.complete()},h=m=>u<r?g(m):l.push(m),g=m=>{s&&t.next(m),u++;let _=!1;$t(e(m,c++)).subscribe(new Le(t,v=>{null==i||i(v),s?h(v):t.next(v)},()=>{_=!0},void 0,()=>{if(_)try{for(u--;l.length&&u<r;){const v=l.shift();o?Hn(t,o,()=>g(v)):g(v)}f()}catch(v){t.error(v)}}))};return n.subscribe(new Le(t,h,()=>{d=!0,f()})),()=>{null==a||a()}}(r,i,n,e)))}function Ms(n=1/0){return $e(Pr,n)}const Dn=new de(n=>n.complete());function Ru(n){return n[n.length-1]}function Gp(n){return se(Ru(n))?n.pop():void 0}function Ss(n){return function lA(n){return n&&se(n.schedule)}(Ru(n))?n.pop():void 0}function $p(n,t=0){return Ge((e,r)=>{e.subscribe(new Le(r,i=>Hn(r,n,()=>r.next(i),t),()=>Hn(r,n,()=>r.complete(),t),i=>Hn(r,n,()=>r.error(i),t)))})}function qp(n,t=0){return Ge((e,r)=>{r.add(n.schedule(()=>e.subscribe(r),t))})}function zp(n,t){if(!n)throw new Error("Iterable cannot be null");return new de(e=>{Hn(e,t,()=>{const r=n[Symbol.asyncIterator]();Hn(e,t,()=>{r.next().then(i=>{i.done?e.complete():e.next(i.value)})},0,!0)})})}function Qe(n,t){return t?function gA(n,t){if(null!=n){if(kp(n))return function cA(n,t){return $t(n).pipe(qp(t),$p(t))}(n,t);if(Fu(n))return function fA(n,t){return new de(e=>{let r=0;return t.schedule(function(){r===n.length?e.complete():(e.next(n[r++]),e.closed||this.schedule())})})}(n,t);if(Np(n))return function dA(n,t){return $t(n).pipe(qp(t),$p(t))}(n,t);if(Pp(n))return zp(n,t);if(Bp(n))return function hA(n,t){return new de(e=>{let r;return Hn(e,t,()=>{r=n[Vp](),Hn(e,t,()=>{let i,s;try{({value:i,done:s}=r.next())}catch(o){return void e.error(o)}s?e.complete():e.next(i)},0,!0)}),()=>se(null==r?void 0:r.return)&&r.return()})}(n,t);if(Hp(n))return function pA(n,t){return zp(jp(n),t)}(n,t)}throw Lp(n)}(n,t):$t(n)}function ta(...n){const t=Ss(n),e=function uA(n,t){return"number"==typeof Ru(n)?n.pop():t}(n,1/0),r=n;return r.length?1===r.length?$t(r[0]):Ms(e)(Qe(r,t)):Dn}function mi(n){return n<=0?()=>Dn:Ge((t,e)=>{let r=0;t.subscribe(new Le(e,i=>{++r<=n&&(e.next(i),n<=r&&e.complete())}))})}function Wp(n={}){const{connector:t=(()=>new Xe),resetOnError:e=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=n;return s=>{let o=null,a=null,l=null,u=0,c=!1,d=!1;const f=()=>{null==a||a.unsubscribe(),a=null},h=()=>{f(),o=l=null,c=d=!1},g=()=>{const m=o;h(),null==m||m.unsubscribe()};return Ge((m,_)=>{u++,!d&&!c&&f();const v=l=null!=l?l:t();_.add(()=>{u--,0===u&&!d&&!c&&(a=Ou(g,i))}),v.subscribe(_),o||(o=new Au({next:y=>v.next(y),error:y=>{d=!0,f(),a=Ou(h,e,y),v.error(y)},complete:()=>{c=!0,f(),a=Ou(h,r),v.complete()}}),Qe(m).subscribe(o))})(s)}}function Ou(n,t,...e){return!0===t?(n(),null):!1===t?null:t(...e).pipe(mi(1)).subscribe(()=>n())}function fe(n){for(let t in n)if(n[t]===fe)return t;throw Error("Could not find renamed property on target object.")}function Nu(n,t){for(const e in t)t.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(n[e]=t[e])}function le(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(le).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const t=n.toString();if(null==t)return""+t;const e=t.indexOf("\n");return-1===e?t:t.substring(0,e)}function ku(n,t){return null==n||""===n?null===t?"":t:null==t||""===t?n:n+" "+t}const mA=fe({__forward_ref__:fe});function ge(n){return n.__forward_ref__=ge,n.toString=function(){return le(this())},n}function z(n){return Kp(n)?n():n}function Kp(n){return"function"==typeof n&&n.hasOwnProperty(mA)&&n.__forward_ref__===ge}class ne extends Error{constructor(t,e){super(function Pu(n,t){return`NG0${Math.abs(n)}${t?": "+t:""}`}(t,e)),this.code=t}}function H(n){return"string"==typeof n?n:null==n?"":String(n)}function dt(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():H(n)}function na(n,t){const e=t?` in ${t}`:"";throw new ne(-201,`No provider for ${dt(n)} found${e}`)}function Mt(n,t){null==n&&function ve(n,t,e,r){throw new Error(`ASSERTION ERROR: ${n}`+(null==r?"":` [Expected=> ${e} ${r} ${t} <=Actual]`))}(t,n,null,"!=")}function w(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Ce(n){return{providers:n.providers||[],imports:n.imports||[]}}function Lu(n){return Qp(n,ra)||Qp(n,Zp)}function Qp(n,t){return n.hasOwnProperty(t)?n[t]:null}function Yp(n){return n&&(n.hasOwnProperty(Vu)||n.hasOwnProperty(EA))?n[Vu]:null}const ra=fe({\u0275prov:fe}),Vu=fe({\u0275inj:fe}),Zp=fe({ngInjectableDef:fe}),EA=fe({ngInjectorDef:fe});var G=(()=>((G=G||{})[G.Default=0]="Default",G[G.Host=1]="Host",G[G.Self=2]="Self",G[G.SkipSelf=4]="SkipSelf",G[G.Optional=8]="Optional",G))();let Bu;function cr(n){const t=Bu;return Bu=n,t}function Xp(n,t,e){const r=Lu(n);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:e&G.Optional?null:void 0!==t?t:void na(le(n),"Injector")}function dr(n){return{toString:n}.toString()}var on=(()=>((on=on||{})[on.OnPush=0]="OnPush",on[on.Default=1]="Default",on))(),an=(()=>{return(n=an||(an={}))[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom",an;var n})();const xA="undefined"!=typeof globalThis&&globalThis,AA="undefined"!=typeof window&&window,MA="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,ue=xA||"undefined"!=typeof global&&global||AA||MA,yi={},he=[],ia=fe({\u0275cmp:fe}),ju=fe({\u0275dir:fe}),Hu=fe({\u0275pipe:fe}),Jp=fe({\u0275mod:fe}),Gn=fe({\u0275fac:fe}),Ts=fe({__NG_ELEMENT_ID__:fe});let SA=0;function Vr(n){return dr(()=>{const e={},r={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===on.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||he,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||an.Emulated,id:"c",styles:n.styles||he,_:null,setInput:null,schemas:n.schemas||null,tView:null},i=n.directives,s=n.features,o=n.pipes;return r.id+=SA++,r.inputs=rg(n.inputs,e),r.outputs=rg(n.outputs),s&&s.forEach(a=>a(r)),r.directiveDefs=i?()=>("function"==typeof i?i():i).map(eg):null,r.pipeDefs=o?()=>("function"==typeof o?o():o).map(tg):null,r})}function eg(n){return rt(n)||function fr(n){return n[ju]||null}(n)}function tg(n){return function Br(n){return n[Hu]||null}(n)}const ng={};function De(n){return dr(()=>{const t={type:n.type,bootstrap:n.bootstrap||he,declarations:n.declarations||he,imports:n.imports||he,exports:n.exports||he,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(ng[n.id]=n.type),t})}function rg(n,t){if(null==n)return yi;const e={};for(const r in n)if(n.hasOwnProperty(r)){let i=n[r],s=i;Array.isArray(i)&&(s=i[1],i=i[0]),e[i]=r,t&&(t[i]=s)}return e}const b=Vr;function rt(n){return n[ia]||null}function qt(n,t){const e=n[Jp]||null;if(!e&&!0===t)throw new Error(`Type ${le(n)} does not have '\u0275mod' property.`);return e}const W=11;function En(n){return Array.isArray(n)&&"object"==typeof n[1]}function un(n){return Array.isArray(n)&&!0===n[1]}function $u(n){return 0!=(8&n.flags)}function la(n){return 2==(2&n.flags)}function ua(n){return 1==(1&n.flags)}function cn(n){return null!==n.template}function NA(n){return 0!=(512&n[2])}function Gr(n,t){return n.hasOwnProperty(Gn)?n[Gn]:null}class LA{constructor(t,e,r){this.previousValue=t,this.currentValue=e,this.firstChange=r}isFirstChange(){return this.firstChange}}function st(){return sg}function sg(n){return n.type.prototype.ngOnChanges&&(n.setInput=BA),VA}function VA(){const n=ag(this),t=null==n?void 0:n.current;if(t){const e=n.previous;if(e===yi)n.previous=t;else for(let r in t)e[r]=t[r];n.current=null,this.ngOnChanges(t)}}function BA(n,t,e,r){const i=ag(n)||function jA(n,t){return n[og]=t}(n,{previous:yi,current:null}),s=i.current||(i.current={}),o=i.previous,a=this.declaredInputs[e],l=o[a];s[a]=new LA(l&&l.currentValue,t,o===yi),n[r]=t}st.ngInherit=!0;const og="__ngSimpleChanges__";function ag(n){return n[og]||null}let Wu;function Ku(){return void 0!==Wu?Wu:"undefined"!=typeof document?document:void 0}function Fe(n){return!!n.listen}const cg={createRenderer:(n,t)=>Ku()};function Ve(n){for(;Array.isArray(n);)n=n[0];return n}function ca(n,t){return Ve(t[n])}function Kt(n,t){return Ve(t[n.index])}function Qu(n,t){return n.data[t]}function Tt(n,t){const e=t[n];return En(e)?e:e[0]}function dg(n){return 4==(4&n[2])}function Yu(n){return 128==(128&n[2])}function hr(n,t){return null==t?null:n[t]}function fg(n){n[18]=0}function Zu(n,t){n[5]+=t;let e=n,r=n[3];for(;null!==r&&(1===t&&1===e[5]||-1===t&&0===e[5]);)r[5]+=t,e=r,r=r[3]}const j={lFrame:Cg(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function hg(){return j.bindingsEnabled}function C(){return j.lFrame.lView}function re(){return j.lFrame.tView}function Os(n){return j.lFrame.contextLView=n,n[8]}function qe(){let n=pg();for(;null!==n&&64===n.type;)n=n.parent;return n}function pg(){return j.lFrame.currentTNode}function wn(n,t){const e=j.lFrame;e.currentTNode=n,e.isParent=t}function Xu(){return j.lFrame.isParent}function Ju(){j.lFrame.isParent=!1}function da(){return j.isInCheckNoChangesMode}function fa(n){j.isInCheckNoChangesMode=n}function Ei(){return j.lFrame.bindingIndex++}function eM(n,t){const e=j.lFrame;e.bindingIndex=e.bindingRootIndex=n,ec(t)}function ec(n){j.lFrame.currentDirectiveIndex=n}function yg(){return j.lFrame.currentQueryIndex}function nc(n){j.lFrame.currentQueryIndex=n}function nM(n){const t=n[1];return 2===t.type?t.declTNode:1===t.type?n[6]:null}function _g(n,t,e){if(e&G.SkipSelf){let i=t,s=n;for(;!(i=i.parent,null!==i||e&G.Host||(i=nM(s),null===i||(s=s[15],10&i.type))););if(null===i)return!1;t=i,n=s}const r=j.lFrame=vg();return r.currentTNode=t,r.lView=n,!0}function ha(n){const t=vg(),e=n[1];j.lFrame=t,t.currentTNode=e.firstChild,t.lView=n,t.tView=e,t.contextLView=n,t.bindingIndex=e.bindingStartIndex,t.inI18n=!1}function vg(){const n=j.lFrame,t=null===n?null:n.child;return null===t?Cg(n):t}function Cg(n){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=t),t}function bg(){const n=j.lFrame;return j.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const Dg=bg;function pa(){const n=bg();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function ht(){return j.lFrame.selectedIndex}function pr(n){j.lFrame.selectedIndex=n}function Re(){const n=j.lFrame;return Qu(n.tView,n.selectedIndex)}function ga(n,t){for(let e=t.directiveStart,r=t.directiveEnd;e<r;e++){const s=n.data[e].type.prototype,{ngAfterContentInit:o,ngAfterContentChecked:a,ngAfterViewInit:l,ngAfterViewChecked:u,ngOnDestroy:c}=s;o&&(n.contentHooks||(n.contentHooks=[])).push(-e,o),a&&((n.contentHooks||(n.contentHooks=[])).push(e,a),(n.contentCheckHooks||(n.contentCheckHooks=[])).push(e,a)),l&&(n.viewHooks||(n.viewHooks=[])).push(-e,l),u&&((n.viewHooks||(n.viewHooks=[])).push(e,u),(n.viewCheckHooks||(n.viewCheckHooks=[])).push(e,u)),null!=c&&(n.destroyHooks||(n.destroyHooks=[])).push(e,c)}}function ma(n,t,e){Eg(n,t,3,e)}function ya(n,t,e,r){(3&n[2])===e&&Eg(n,t,e,r)}function rc(n,t){let e=n[2];(3&e)===t&&(e&=2047,e+=1,n[2]=e)}function Eg(n,t,e,r){const s=null!=r?r:-1,o=t.length-1;let a=0;for(let l=void 0!==r?65535&n[18]:0;l<o;l++)if("number"==typeof t[l+1]){if(a=t[l],null!=r&&a>=r)break}else t[l]<0&&(n[18]+=65536),(a<s||-1==s)&&(dM(n,e,t,l),n[18]=(4294901760&n[18])+l+2),l++}function dM(n,t,e,r){const i=e[r]<0,s=e[r+1],a=n[i?-e[r]:e[r]];if(i){if(n[2]>>11<n[18]>>16&&(3&n[2])===t){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class ks{constructor(t,e,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=r}}function _a(n,t,e){const r=Fe(n);let i=0;for(;i<e.length;){const s=e[i];if("number"==typeof s){if(0!==s)break;i++;const o=e[i++],a=e[i++],l=e[i++];r?n.setAttribute(t,a,l,o):t.setAttributeNS(o,a,l)}else{const o=s,a=e[++i];sc(o)?r&&n.setProperty(t,o,a):r?n.setAttribute(t,o,a):t.setAttribute(o,a),i++}}return i}function wg(n){return 3===n||4===n||6===n}function sc(n){return 64===n.charCodeAt(0)}function va(n,t){if(null!==t&&0!==t.length)if(null===n||0===n.length)n=t.slice();else{let e=-1;for(let r=0;r<t.length;r++){const i=t[r];"number"==typeof i?e=i:0===e||xg(n,e,i,null,-1===e||2===e?t[++r]:null)}}return n}function xg(n,t,e,r,i){let s=0,o=n.length;if(-1===t)o=-1;else for(;s<n.length;){const a=n[s++];if("number"==typeof a){if(a===t){o=-1;break}if(a>t){o=s-1;break}}}for(;s<n.length;){const a=n[s];if("number"==typeof a)break;if(a===e){if(null===r)return void(null!==i&&(n[s+1]=i));if(r===n[s+1])return void(n[s+2]=i)}s++,null!==r&&s++,null!==i&&s++}-1!==o&&(n.splice(o,0,t),s=o+1),n.splice(s++,0,e),null!==r&&n.splice(s++,0,r),null!==i&&n.splice(s++,0,i)}function Ag(n){return-1!==n}function wi(n){return 32767&n}function xi(n,t){let e=function mM(n){return n>>16}(n),r=t;for(;e>0;)r=r[15],e--;return r}let oc=!0;function Ca(n){const t=oc;return oc=n,t}let yM=0;function Ls(n,t){const e=lc(n,t);if(-1!==e)return e;const r=t[1];r.firstCreatePass&&(n.injectorIndex=t.length,ac(r.data,n),ac(t,null),ac(r.blueprint,null));const i=ba(n,t),s=n.injectorIndex;if(Ag(i)){const o=wi(i),a=xi(i,t),l=a[1].data;for(let u=0;u<8;u++)t[s+u]=a[o+u]|l[o+u]}return t[s+8]=i,s}function ac(n,t){n.push(0,0,0,0,0,0,0,0,t)}function lc(n,t){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===t[n.injectorIndex+8]?-1:n.injectorIndex}function ba(n,t){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let e=0,r=null,i=t;for(;null!==i;){const s=i[1],o=s.type;if(r=2===o?s.declTNode:1===o?i[6]:null,null===r)return-1;if(e++,i=i[15],-1!==r.injectorIndex)return r.injectorIndex|e<<16}return-1}function Da(n,t,e){!function _M(n,t,e){let r;"string"==typeof e?r=e.charCodeAt(0)||0:e.hasOwnProperty(Ts)&&(r=e[Ts]),null==r&&(r=e[Ts]=yM++);const i=255&r;t.data[n+(i>>5)]|=1<<i}(n,t,e)}function Tg(n,t,e){if(e&G.Optional)return n;na(t,"NodeInjector")}function Ig(n,t,e,r){if(e&G.Optional&&void 0===r&&(r=null),0==(e&(G.Self|G.Host))){const i=n[9],s=cr(void 0);try{return i?i.get(t,r,e&G.Optional):Xp(t,r,e&G.Optional)}finally{cr(s)}}return Tg(r,t,e)}function Fg(n,t,e,r=G.Default,i){if(null!==n){const s=function DM(n){if("string"==typeof n)return n.charCodeAt(0)||0;const t=n.hasOwnProperty(Ts)?n[Ts]:void 0;return"number"==typeof t?t>=0?255&t:CM:t}(e);if("function"==typeof s){if(!_g(t,n,r))return r&G.Host?Tg(i,e,r):Ig(t,e,r,i);try{const o=s(r);if(null!=o||r&G.Optional)return o;na(e)}finally{Dg()}}else if("number"==typeof s){let o=null,a=lc(n,t),l=-1,u=r&G.Host?t[16][6]:null;for((-1===a||r&G.SkipSelf)&&(l=-1===a?ba(n,t):t[a+8],-1!==l&&Ng(r,!1)?(o=t[1],a=wi(l),t=xi(l,t)):a=-1);-1!==a;){const c=t[1];if(Og(s,a,c.data)){const d=bM(a,t,e,o,r,u);if(d!==Rg)return d}l=t[a+8],-1!==l&&Ng(r,t[1].data[a+8]===u)&&Og(s,a,t)?(o=c,a=wi(l),t=xi(l,t)):a=-1}}}return Ig(t,e,r,i)}const Rg={};function CM(){return new Ai(qe(),C())}function bM(n,t,e,r,i,s){const o=t[1],a=o.data[n+8],c=Ea(a,o,e,null==r?la(a)&&oc:r!=o&&0!=(3&a.type),i&G.Host&&s===a);return null!==c?Vs(t,o,c,a):Rg}function Ea(n,t,e,r,i){const s=n.providerIndexes,o=t.data,a=1048575&s,l=n.directiveStart,c=s>>20,f=i?a+c:n.directiveEnd;for(let h=r?a:a+c;h<f;h++){const g=o[h];if(h<l&&e===g||h>=l&&g.type===e)return h}if(i){const h=o[l];if(h&&cn(h)&&h.type===e)return l}return null}function Vs(n,t,e,r){let i=n[e];const s=t.data;if(function fM(n){return n instanceof ks}(i)){const o=i;o.resolving&&function yA(n,t){const e=t?`. Dependency path: ${t.join(" > ")} > ${n}`:"";throw new ne(-200,`Circular dependency in DI detected for ${n}${e}`)}(dt(s[e]));const a=Ca(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?cr(o.injectImpl):null;_g(n,r,G.Default);try{i=n[e]=o.factory(void 0,s,n,r),t.firstCreatePass&&e>=r.directiveStart&&function cM(n,t,e){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:s}=t.type.prototype;if(r){const o=sg(t);(e.preOrderHooks||(e.preOrderHooks=[])).push(n,o),(e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(n,o)}i&&(e.preOrderHooks||(e.preOrderHooks=[])).push(0-n,i),s&&((e.preOrderHooks||(e.preOrderHooks=[])).push(n,s),(e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(n,s))}(e,s[e],t)}finally{null!==l&&cr(l),Ca(a),o.resolving=!1,Dg()}}return i}function Og(n,t,e){return!!(e[t+(n>>5)]&1<<n)}function Ng(n,t){return!(n&G.Self||n&G.Host&&t)}class Ai{constructor(t,e){this._tNode=t,this._lView=e}get(t,e,r){return Fg(this._tNode,this._lView,t,r,e)}}function R(n){return dr(()=>{const t=n.prototype.constructor,e=t[Gn]||uc(t),r=Object.prototype;let i=Object.getPrototypeOf(n.prototype).constructor;for(;i&&i!==r;){const s=i[Gn]||uc(i);if(s&&s!==e)return s;i=Object.getPrototypeOf(i)}return s=>new s})}function uc(n){return Kp(n)?()=>{const t=uc(z(n));return t&&t()}:Gr(n)}function Mi(n){return function vM(n,t){if("class"===t)return n.classes;if("style"===t)return n.styles;const e=n.attrs;if(e){const r=e.length;let i=0;for(;i<r;){const s=e[i];if(wg(s))break;if(0===s)i+=2;else if("number"==typeof s)for(i++;i<r&&"string"==typeof e[i];)i++;else{if(s===t)return e[i+1];i+=2}}}return null}(qe(),n)}const Ti="__parameters__";function Fi(n,t,e){return dr(()=>{const r=function cc(n){return function(...e){if(n){const r=n(...e);for(const i in r)this[i]=r[i]}}}(t);function i(...s){if(this instanceof i)return r.apply(this,s),this;const o=new i(...s);return a.annotation=o,a;function a(l,u,c){const d=l.hasOwnProperty(Ti)?l[Ti]:Object.defineProperty(l,Ti,{value:[]})[Ti];for(;d.length<=c;)d.push(null);return(d[c]=d[c]||[]).push(o),l}}return e&&(i.prototype=Object.create(e.prototype)),i.prototype.ngMetadataName=n,i.annotationCls=i,i})}class F{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=w({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return`InjectionToken ${this._desc}`}}const wM=new F("AnalyzeForEntryComponents");function Qt(n,t){void 0===t&&(t=n);for(let e=0;e<n.length;e++){let r=n[e];Array.isArray(r)?(t===n&&(t=n.slice(0,e)),Qt(r,t)):t!==n&&t.push(r)}return t}function xn(n,t){n.forEach(e=>Array.isArray(e)?xn(e,t):t(e))}function Pg(n,t,e){t>=n.length?n.push(e):n.splice(t,0,e)}function wa(n,t){return t>=n.length-1?n.pop():n.splice(t,1)[0]}function Hs(n,t){const e=[];for(let r=0;r<n;r++)e.push(t);return e}function It(n,t,e){let r=Ri(n,t);return r>=0?n[1|r]=e:(r=~r,function MM(n,t,e,r){let i=n.length;if(i==t)n.push(e,r);else if(1===i)n.push(r,n[0]),n[0]=e;else{for(i--,n.push(n[i-1],n[i]);i>t;)n[i]=n[i-2],i--;n[t]=e,n[t+1]=r}}(n,r,t,e)),r}function fc(n,t){const e=Ri(n,t);if(e>=0)return n[1|e]}function Ri(n,t){return function Bg(n,t,e){let r=0,i=n.length>>e;for(;i!==r;){const s=r+(i-r>>1),o=n[s<<e];if(t===o)return s<<e;o>t?i=s:r=s+1}return~(i<<e)}(n,t,1)}const Us={},pc="__NG_DI_FLAG__",Aa="ngTempTokenPath",NM=/\n/gm,Hg="__source",PM=fe({provide:String,useValue:fe});let Gs;function Ug(n){const t=Gs;return Gs=n,t}function LM(n,t=G.Default){if(void 0===Gs)throw new ne(203,"");return null===Gs?Xp(n,void 0,t):Gs.get(n,t&G.Optional?null:void 0,t)}function D(n,t=G.Default){return(function wA(){return Bu}()||LM)(z(n),t)}const $s=D;function gc(n){const t=[];for(let e=0;e<n.length;e++){const r=z(n[e]);if(Array.isArray(r)){if(0===r.length)throw new ne(900,"");let i,s=G.Default;for(let o=0;o<r.length;o++){const a=r[o],l=VM(a);"number"==typeof l?-1===l?i=a.token:s|=l:i=a}t.push(D(i,s))}else t.push(D(r))}return t}function qs(n,t){return n[pc]=t,n.prototype[pc]=t,n}function VM(n){return n[pc]}const zs=qs(Fi("Inject",n=>({token:n})),-1),Ft=qs(Fi("Optional"),8),$r=qs(Fi("SkipSelf"),4);let Sa,Ta;function Ni(n){var t;return(null===(t=function yc(){if(void 0===Sa&&(Sa=null,ue.trustedTypes))try{Sa=ue.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Sa}())||void 0===t?void 0:t.createHTML(n))||n}function Kg(n){var t;return(null===(t=function _c(){if(void 0===Ta&&(Ta=null,ue.trustedTypes))try{Ta=ue.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Ta}())||void 0===t?void 0:t.createHTML(n))||n}class qr{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class ZM extends qr{getTypeName(){return"HTML"}}class XM extends qr{getTypeName(){return"Style"}}class JM extends qr{getTypeName(){return"Script"}}class e0 extends qr{getTypeName(){return"URL"}}class t0 extends qr{getTypeName(){return"ResourceURL"}}function Rt(n){return n instanceof qr?n.changingThisBreaksApplicationSecurity:n}function An(n,t){const e=Zg(n);if(null!=e&&e!==t){if("ResourceURL"===e&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${e} (see https://g.co/ng/security#xss)`)}return e===t}function Zg(n){return n instanceof qr&&n.getTypeName()||null}class l0{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t="<body><remove></remove>"+t;try{const e=(new window.DOMParser).parseFromString(Ni(t),"text/html").body;return null===e?this.inertDocumentHelper.getInertBodyElement(t):(e.removeChild(e.firstChild),e)}catch(e){return null}}}class u0{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e);const r=this.inertDocument.createElement("body");e.appendChild(r)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=Ni(t),e;const r=this.inertDocument.createElement("body");return r.innerHTML=Ni(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(r),r}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0<i;i--){const o=e.item(i).name;("xmlns:ns1"===o||0===o.indexOf("ns1:"))&&t.removeAttribute(o)}let r=t.firstChild;for(;r;)r.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(r),r=r.nextSibling}}const d0=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,f0=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function Ks(n){return(n=String(n)).match(d0)||n.match(f0)?n:"unsafe:"+n}function Mn(n){const t={};for(const e of n.split(","))t[e]=!0;return t}function Qs(...n){const t={};for(const e of n)for(const r in e)e.hasOwnProperty(r)&&(t[r]=!0);return t}const em=Mn("area,br,col,hr,img,wbr"),tm=Mn("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),nm=Mn("rp,rt"),vc=Qs(em,Qs(tm,Mn("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Qs(nm,Mn("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Qs(nm,tm)),Cc=Mn("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),bc=Mn("srcset"),rm=Qs(Cc,bc,Mn("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Mn("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),h0=Mn("script,style,template");class p0{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let e=t.firstChild,r=!0;for(;e;)if(e.nodeType===Node.ELEMENT_NODE?r=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,r&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let i=this.checkClobberedElement(e,e.nextSibling);if(i){e=i;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")}startElement(t){const e=t.nodeName.toLowerCase();if(!vc.hasOwnProperty(e))return this.sanitizedSomething=!0,!h0.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const r=t.attributes;for(let i=0;i<r.length;i++){const s=r.item(i),o=s.name,a=o.toLowerCase();if(!rm.hasOwnProperty(a)){this.sanitizedSomething=!0;continue}let l=s.value;Cc[a]&&(l=Ks(l)),bc[a]&&(n=l,l=(n=String(n)).split(",").map(t=>Ks(t.trim())).join(", ")),this.buf.push(" ",o,'="',im(l),'"')}var n;return this.buf.push(">"),!0}endElement(t){const e=t.nodeName.toLowerCase();vc.hasOwnProperty(e)&&!em.hasOwnProperty(e)&&(this.buf.push("</"),this.buf.push(e),this.buf.push(">"))}chars(t){this.buf.push(im(t))}checkClobberedElement(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`);return e}}const g0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,m0=/([^\#-~ |!])/g;function im(n){return n.replace(/&/g,"&").replace(g0,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(m0,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}let Ia;function sm(n,t){let e=null;try{Ia=Ia||function Xg(n){const t=new u0(n);return function c0(){try{return!!(new window.DOMParser).parseFromString(Ni(""),"text/html")}catch(n){return!1}}()?new l0(t):t}(n);let r=t?String(t):"";e=Ia.getInertBodyElement(r);let i=5,s=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=s,s=e.innerHTML,e=Ia.getInertBodyElement(r)}while(r!==s);return Ni((new p0).sanitizeChildren(Dc(e)||e))}finally{if(e){const r=Dc(e)||e;for(;r.firstChild;)r.removeChild(r.firstChild)}}}function Dc(n){return"content"in n&&function y0(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var ae=(()=>((ae=ae||{})[ae.NONE=0]="NONE",ae[ae.HTML=1]="HTML",ae[ae.STYLE=2]="STYLE",ae[ae.SCRIPT=3]="SCRIPT",ae[ae.URL=4]="URL",ae[ae.RESOURCE_URL=5]="RESOURCE_URL",ae))();function om(n){const t=Ys();return t?Kg(t.sanitize(ae.HTML,n)||""):An(n,"HTML")?Kg(Rt(n)):sm(Ku(),H(n))}function mr(n){const t=Ys();return t?t.sanitize(ae.URL,n)||"":An(n,"URL")?Rt(n):Ks(H(n))}function Ys(){const n=C();return n&&n[12]}const um="__ngContext__";function ot(n,t){n[um]=t}function wc(n){const t=function Zs(n){return n[um]||null}(n);return t?Array.isArray(t)?t:t.lView:null}function Ac(n){return n.ngOriginalError}function O0(n,...t){n.error(...t)}class zn{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),r=function R0(n){return n&&n.ngErrorLogger||O0}(t);r(this._console,"ERROR",t),e&&r(this._console,"ORIGINAL ERROR",e)}_findOriginalError(t){let e=t&&Ac(t);for(;e&&Ac(e);)e=Ac(e);return e||null}}const pm=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(ue))();function Sn(n){return n instanceof Function?n():n}var Ot=(()=>((Ot=Ot||{})[Ot.Important=1]="Important",Ot[Ot.DashCase=2]="DashCase",Ot))();function Sc(n,t){return undefined(n,t)}function Xs(n){const t=n[3];return un(t)?t[3]:t}function Tc(n){return vm(n[13])}function Ic(n){return vm(n[4])}function vm(n){for(;null!==n&&!un(n);)n=n[4];return n}function Pi(n,t,e,r,i){if(null!=r){let s,o=!1;un(r)?s=r:En(r)&&(o=!0,r=r[0]);const a=Ve(r);0===n&&null!==e?null==i?xm(t,e,a):zr(t,e,a,i||null,!0):1===n&&null!==e?zr(t,e,a,i||null,!0):2===n?function Rm(n,t,e){const r=Fa(n,t);r&&function nS(n,t,e,r){Fe(n)?n.removeChild(t,e,r):t.removeChild(e)}(n,r,t,e)}(t,a,o):3===n&&t.destroyNode(a),null!=s&&function sS(n,t,e,r,i){const s=e[7];s!==Ve(e)&&Pi(t,n,r,s,i);for(let a=10;a<e.length;a++){const l=e[a];Js(l[1],l,n,t,r,s)}}(t,n,s,e,i)}}function Rc(n,t,e){return Fe(n)?n.createElement(t,e):null===e?n.createElement(t):n.createElementNS(e,t)}function bm(n,t){const e=n[9],r=e.indexOf(t),i=t[3];1024&t[2]&&(t[2]&=-1025,Zu(i,-1)),e.splice(r,1)}function Oc(n,t){if(n.length<=10)return;const e=10+t,r=n[e];if(r){const i=r[17];null!==i&&i!==n&&bm(i,r),t>0&&(n[e-1][4]=r[4]);const s=wa(n,10+t);!function K0(n,t){Js(n,t,t[W],2,null,null),t[0]=null,t[6]=null}(r[1],r);const o=s[19];null!==o&&o.detachView(s[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function Dm(n,t){if(!(256&t[2])){const e=t[W];Fe(e)&&e.destroyNode&&Js(n,t,e,3,null,null),function Z0(n){let t=n[13];if(!t)return Nc(n[1],n);for(;t;){let e=null;if(En(t))e=t[13];else{const r=t[10];r&&(e=r)}if(!e){for(;t&&!t[4]&&t!==n;)En(t)&&Nc(t[1],t),t=t[3];null===t&&(t=n),En(t)&&Nc(t[1],t),e=t&&t[4]}t=e}}(t)}}function Nc(n,t){if(!(256&t[2])){t[2]&=-129,t[2]|=256,function tS(n,t){let e;if(null!=n&&null!=(e=n.destroyHooks))for(let r=0;r<e.length;r+=2){const i=t[e[r]];if(!(i instanceof ks)){const s=e[r+1];if(Array.isArray(s))for(let o=0;o<s.length;o+=2){const a=i[s[o]],l=s[o+1];try{l.call(a)}finally{}}else try{s.call(i)}finally{}}}}(n,t),function eS(n,t){const e=n.cleanup,r=t[7];let i=-1;if(null!==e)for(let s=0;s<e.length-1;s+=2)if("string"==typeof e[s]){const o=e[s+1],a="function"==typeof o?o(t):Ve(t[o]),l=r[i=e[s+2]],u=e[s+3];"boolean"==typeof u?a.removeEventListener(e[s],l,u):u>=0?r[i=u]():r[i=-u].unsubscribe(),s+=2}else{const o=r[i=e[s+1]];e[s].call(o)}if(null!==r){for(let s=i+1;s<r.length;s++)r[s]();t[7]=null}}(n,t),1===t[1].type&&Fe(t[W])&&t[W].destroy();const e=t[17];if(null!==e&&un(t[3])){e!==t[3]&&bm(e,t);const r=t[19];null!==r&&r.detachView(n)}}}function Em(n,t,e){return function wm(n,t,e){let r=t;for(;null!==r&&40&r.type;)r=(t=r).parent;if(null===r)return e[0];if(2&r.flags){const i=n.data[r.directiveStart].encapsulation;if(i===an.None||i===an.Emulated)return null}return Kt(r,e)}(n,t.parent,e)}function zr(n,t,e,r,i){Fe(n)?n.insertBefore(t,e,r,i):t.insertBefore(e,r,i)}function xm(n,t,e){Fe(n)?n.appendChild(t,e):t.appendChild(e)}function Am(n,t,e,r,i){null!==r?zr(n,t,e,r,i):xm(n,t,e)}function Fa(n,t){return Fe(n)?n.parentNode(t):t.parentNode}function Mm(n,t,e){return Tm(n,t,e)}let Tm=function Sm(n,t,e){return 40&n.type?Kt(n,e):null};function Ra(n,t,e,r){const i=Em(n,r,t),s=t[W],a=Mm(r.parent||t[6],r,t);if(null!=i)if(Array.isArray(e))for(let l=0;l<e.length;l++)Am(s,i,e[l],a,!1);else Am(s,i,e,a,!1)}function Oa(n,t){if(null!==t){const e=t.type;if(3&e)return Kt(t,n);if(4&e)return Pc(-1,n[t.index]);if(8&e){const r=t.child;if(null!==r)return Oa(n,r);{const i=n[t.index];return un(i)?Pc(-1,i):Ve(i)}}if(32&e)return Sc(t,n)()||Ve(n[t.index]);{const r=Fm(n,t);return null!==r?Array.isArray(r)?r[0]:Oa(Xs(n[16]),r):Oa(n,t.next)}}return null}function Fm(n,t){return null!==t?n[16][6].projection[t.projection]:null}function Pc(n,t){const e=10+n+1;if(e<t.length){const r=t[e],i=r[1].firstChild;if(null!==i)return Oa(r,i)}return t[7]}function Lc(n,t,e,r,i,s,o){for(;null!=e;){const a=r[e.index],l=e.type;if(o&&0===t&&(a&&ot(Ve(a),r),e.flags|=4),64!=(64&e.flags))if(8&l)Lc(n,t,e.child,r,i,s,!1),Pi(t,n,i,a,s);else if(32&l){const u=Sc(e,r);let c;for(;c=u();)Pi(t,n,i,c,s);Pi(t,n,i,a,s)}else 16&l?Om(n,t,r,e,i,s):Pi(t,n,i,a,s);e=o?e.projectionNext:e.next}}function Js(n,t,e,r,i,s){Lc(e,r,n.firstChild,t,i,s,!1)}function Om(n,t,e,r,i,s){const o=e[16],l=o[6].projection[r.projection];if(Array.isArray(l))for(let u=0;u<l.length;u++)Pi(t,n,i,l[u],s);else Lc(n,t,l,o[3],i,s,!0)}function Nm(n,t,e){Fe(n)?n.setAttribute(t,"style",e):t.style.cssText=e}function Vc(n,t,e){Fe(n)?""===e?n.removeAttribute(t,"class"):n.setAttribute(t,"class",e):t.className=e}function km(n,t,e){let r=n.length;for(;;){const i=n.indexOf(t,e);if(-1===i)return i;if(0===i||n.charCodeAt(i-1)<=32){const s=t.length;if(i+s===r||n.charCodeAt(i+s)<=32)return i}e=i+1}}const Pm="ng-template";function aS(n,t,e){let r=0;for(;r<n.length;){let i=n[r++];if(e&&"class"===i){if(i=n[r],-1!==km(i.toLowerCase(),t,0))return!0}else if(1===i){for(;r<n.length&&"string"==typeof(i=n[r++]);)if(i.toLowerCase()===t)return!0;return!1}}return!1}function Lm(n){return 4===n.type&&n.value!==Pm}function lS(n,t,e){return t===(4!==n.type||e?n.value:Pm)}function uS(n,t,e){let r=4;const i=n.attrs||[],s=function fS(n){for(let t=0;t<n.length;t++)if(wg(n[t]))return t;return n.length}(i);let o=!1;for(let a=0;a<t.length;a++){const l=t[a];if("number"!=typeof l){if(!o)if(4&r){if(r=2|1&r,""!==l&&!lS(n,l,e)||""===l&&1===t.length){if(dn(r))return!1;o=!0}}else{const u=8&r?l:t[++a];if(8&r&&null!==n.attrs){if(!aS(n.attrs,u,e)){if(dn(r))return!1;o=!0}continue}const d=cS(8&r?"class":l,i,Lm(n),e);if(-1===d){if(dn(r))return!1;o=!0;continue}if(""!==u){let f;f=d>s?"":i[d+1].toLowerCase();const h=8&r?f:null;if(h&&-1!==km(h,u,0)||2&r&&u!==f){if(dn(r))return!1;o=!0}}}}else{if(!o&&!dn(r)&&!dn(l))return!1;if(o&&dn(l))continue;o=!1,r=l|1&r}}return dn(r)||o}function dn(n){return 0==(1&n)}function cS(n,t,e,r){if(null===t)return-1;let i=0;if(r||!e){let s=!1;for(;i<t.length;){const o=t[i];if(o===n)return i;if(3===o||6===o)s=!0;else{if(1===o||2===o){let a=t[++i];for(;"string"==typeof a;)a=t[++i];continue}if(4===o)break;if(0===o){i+=4;continue}}i+=s?1:2}return-1}return function hS(n,t){let e=n.indexOf(4);if(e>-1)for(e++;e<n.length;){const r=n[e];if("number"==typeof r)return-1;if(r===t)return e;e++}return-1}(t,n)}function Vm(n,t,e=!1){for(let r=0;r<t.length;r++)if(uS(n,t[r],e))return!0;return!1}function pS(n,t){e:for(let e=0;e<t.length;e++){const r=t[e];if(n.length===r.length){for(let i=0;i<n.length;i++)if(n[i]!==r[i])continue e;return!0}}return!1}function Bm(n,t){return n?":not("+t.trim()+")":t}function gS(n){let t=n[0],e=1,r=2,i="",s=!1;for(;e<n.length;){let o=n[e];if("string"==typeof o)if(2&r){const a=n[++e];i+="["+o+(a.length>0?'="'+a+'"':"")+"]"}else 8&r?i+="."+o:4&r&&(i+=" "+o);else""!==i&&!dn(o)&&(t+=Bm(s,i),i=""),r=o,s=s||!dn(r);e++}return""!==i&&(t+=Bm(s,i)),t}const U={};function te(n){jm(re(),C(),ht()+n,da())}function jm(n,t,e,r){if(!r)if(3==(3&t[2])){const s=n.preOrderCheckHooks;null!==s&&ma(t,s,e)}else{const s=n.preOrderHooks;null!==s&&ya(t,s,0,e)}pr(e)}function Na(n,t){return n<<17|t<<2}function fn(n){return n>>17&32767}function Bc(n){return 2|n}function Wn(n){return(131068&n)>>2}function jc(n,t){return-131069&n|t<<2}function Hc(n){return 1|n}function Zm(n,t){const e=n.contentQueries;if(null!==e)for(let r=0;r<e.length;r+=2){const i=e[r],s=e[r+1];if(-1!==s){const o=n.data[s];nc(i),o.contentQueries(2,t[s],s)}}}function eo(n,t,e,r,i,s,o,a,l,u){const c=t.blueprint.slice();return c[0]=i,c[2]=140|r,fg(c),c[3]=c[15]=n,c[8]=e,c[10]=o||n&&n[10],c[W]=a||n&&n[W],c[12]=l||n&&n[12]||null,c[9]=u||n&&n[9]||null,c[6]=s,c[16]=2==t.type?n[16]:c,c}function Li(n,t,e,r,i){let s=n.data[t];if(null===s)s=function Yc(n,t,e,r,i){const s=pg(),o=Xu(),l=n.data[t]=function OS(n,t,e,r,i,s){return{type:e,index:r,insertBeforeIndex:null,injectorIndex:t?t.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,propertyBindings:null,flags:0,providerIndexes:0,value:i,attrs:s,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tViews:null,next:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,o?s:s&&s.parent,e,t,r,i);return null===n.firstChild&&(n.firstChild=l),null!==s&&(o?null==s.child&&null!==l.parent&&(s.child=l):null===s.next&&(s.next=l)),l}(n,t,e,r,i),function JA(){return j.lFrame.inI18n}()&&(s.flags|=64);else if(64&s.type){s.type=e,s.value=r,s.attrs=i;const o=function Ns(){const n=j.lFrame,t=n.currentTNode;return n.isParent?t:t.parent}();s.injectorIndex=null===o?-1:o.injectorIndex}return wn(s,!0),s}function Vi(n,t,e,r){if(0===e)return-1;const i=t.length;for(let s=0;s<e;s++)t.push(r),n.blueprint.push(r),n.data.push(null);return i}function to(n,t,e){ha(t);try{const r=n.viewQuery;null!==r&&sd(1,r,e);const i=n.template;null!==i&&Xm(n,t,i,1,e),n.firstCreatePass&&(n.firstCreatePass=!1),n.staticContentQueries&&Zm(n,t),n.staticViewQueries&&sd(2,n.viewQuery,e);const s=n.components;null!==s&&function IS(n,t){for(let e=0;e<t.length;e++)ZS(n,t[e])}(t,s)}catch(r){throw n.firstCreatePass&&(n.incompleteFirstPass=!0,n.firstCreatePass=!1),r}finally{t[2]&=-5,pa()}}function Bi(n,t,e,r){const i=t[2];if(256==(256&i))return;ha(t);const s=da();try{fg(t),function gg(n){return j.lFrame.bindingIndex=n}(n.bindingStartIndex),null!==e&&Xm(n,t,e,2,r);const o=3==(3&i);if(!s)if(o){const u=n.preOrderCheckHooks;null!==u&&ma(t,u,null)}else{const u=n.preOrderHooks;null!==u&&ya(t,u,0,null),rc(t,0)}if(function QS(n){for(let t=Tc(n);null!==t;t=Ic(t)){if(!t[2])continue;const e=t[9];for(let r=0;r<e.length;r++){const i=e[r],s=i[3];0==(1024&i[2])&&Zu(s,1),i[2]|=1024}}}(t),function KS(n){for(let t=Tc(n);null!==t;t=Ic(t))for(let e=10;e<t.length;e++){const r=t[e],i=r[1];Yu(r)&&Bi(i,r,i.template,r[8])}}(t),null!==n.contentQueries&&Zm(n,t),!s)if(o){const u=n.contentCheckHooks;null!==u&&ma(t,u)}else{const u=n.contentHooks;null!==u&&ya(t,u,1),rc(t,1)}!function SS(n,t){const e=n.hostBindingOpCodes;if(null!==e)try{for(let r=0;r<e.length;r++){const i=e[r];if(i<0)pr(~i);else{const s=i,o=e[++r],a=e[++r];eM(o,s),a(2,t[s])}}}finally{pr(-1)}}(n,t);const a=n.components;null!==a&&function TS(n,t){for(let e=0;e<t.length;e++)YS(n,t[e])}(t,a);const l=n.viewQuery;if(null!==l&&sd(2,l,r),!s)if(o){const u=n.viewCheckHooks;null!==u&&ma(t,u)}else{const u=n.viewHooks;null!==u&&ya(t,u,2),rc(t,2)}!0===n.firstUpdatePass&&(n.firstUpdatePass=!1),s||(t[2]&=-73),1024&t[2]&&(t[2]&=-1025,Zu(t[3],-1))}finally{pa()}}function FS(n,t,e,r){const i=t[10],s=!da(),o=dg(t);try{s&&!o&&i.begin&&i.begin(),o&&to(n,t,r),Bi(n,t,e,r)}finally{s&&!o&&i.end&&i.end()}}function Xm(n,t,e,r,i){const s=ht(),o=2&r;try{pr(-1),o&&t.length>20&&jm(n,t,20,da()),e(r,i)}finally{pr(s)}}function Jm(n,t,e){if($u(t)){const i=t.directiveEnd;for(let s=t.directiveStart;s<i;s++){const o=n.data[s];o.contentQueries&&o.contentQueries(1,e[s],s)}}}function Zc(n,t,e){!hg()||(function jS(n,t,e,r){const i=e.directiveStart,s=e.directiveEnd;n.firstCreatePass||Ls(e,t),ot(r,t);const o=e.initialInputs;for(let a=i;a<s;a++){const l=n.data[a],u=cn(l);u&&qS(t,e,l);const c=Vs(t,n,a,e);ot(c,t),null!==o&&zS(0,a-i,c,l,0,o),u&&(Tt(e.index,t)[8]=c)}}(n,t,e,Kt(e,t)),128==(128&e.flags)&&function HS(n,t,e){const r=e.directiveStart,i=e.directiveEnd,o=e.index,a=function tM(){return j.lFrame.currentDirectiveIndex}();try{pr(o);for(let l=r;l<i;l++){const u=n.data[l],c=t[l];ec(l),(null!==u.hostBindings||0!==u.hostVars||null!==u.hostAttrs)&&ay(u,c)}}finally{pr(-1),ec(a)}}(n,t,e))}function Xc(n,t,e=Kt){const r=t.localNames;if(null!==r){let i=t.index+1;for(let s=0;s<r.length;s+=2){const o=r[s+1],a=-1===o?e(t,n):n[o];n[i++]=a}}}function ey(n){const t=n.tView;return null===t||t.incompleteFirstPass?n.tView=La(1,null,n.template,n.decls,n.vars,n.directiveDefs,n.pipeDefs,n.viewQuery,n.schemas,n.consts):t}function La(n,t,e,r,i,s,o,a,l,u){const c=20+r,d=c+i,f=function RS(n,t){const e=[];for(let r=0;r<t;r++)e.push(r<n?null:U);return e}(c,d),h="function"==typeof u?u():u;return f[1]={type:n,blueprint:f,template:e,queries:null,viewQuery:a,declTNode:t,data:f.slice().fill(null,c),bindingStartIndex:c,expandoStartIndex:d,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof s?s():s,pipeRegistry:"function"==typeof o?o():o,firstChild:null,schemas:l,consts:h,incompleteFirstPass:!1}}function ry(n,t,e,r){const i=hy(t);null===e?i.push(r):(i.push(e),n.firstCreatePass&&py(n).push(r,i.length-1))}function iy(n,t,e){for(let r in n)if(n.hasOwnProperty(r)){const i=n[r];(e=null===e?{}:e).hasOwnProperty(r)?e[r].push(t,i):e[r]=[t,i]}return e}function Nt(n,t,e,r,i,s,o,a){const l=Kt(t,e);let c,u=t.inputs;!a&&null!=u&&(c=u[r])?(yy(n,e,c,r,i),la(t)&&function PS(n,t){const e=Tt(t,n);16&e[2]||(e[2]|=64)}(e,t.index)):3&t.type&&(r=function kS(n){return"class"===n?"className":"for"===n?"htmlFor":"formaction"===n?"formAction":"innerHtml"===n?"innerHTML":"readonly"===n?"readOnly":"tabindex"===n?"tabIndex":n}(r),i=null!=o?o(i,t.value||"",r):i,Fe(s)?s.setProperty(l,r,i):sc(r)||(l.setProperty?l.setProperty(r,i):l[r]=i))}function Jc(n,t,e,r){let i=!1;if(hg()){const s=function US(n,t,e){const r=n.directiveRegistry;let i=null;if(r)for(let s=0;s<r.length;s++){const o=r[s];Vm(e,o.selectors,!1)&&(i||(i=[]),Da(Ls(e,t),n,o.type),cn(o)?(ly(n,e),i.unshift(o)):i.push(o))}return i}(n,t,e),o=null===r?null:{"":-1};if(null!==s){i=!0,uy(e,n.data.length,s.length);for(let c=0;c<s.length;c++){const d=s[c];d.providersResolver&&d.providersResolver(d)}let a=!1,l=!1,u=Vi(n,t,s.length,null);for(let c=0;c<s.length;c++){const d=s[c];e.mergedAttrs=va(e.mergedAttrs,d.hostAttrs),cy(n,e,t,u,d),$S(u,d,o),null!==d.contentQueries&&(e.flags|=8),(null!==d.hostBindings||null!==d.hostAttrs||0!==d.hostVars)&&(e.flags|=128);const f=d.type.prototype;!a&&(f.ngOnChanges||f.ngOnInit||f.ngDoCheck)&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e.index),a=!0),!l&&(f.ngOnChanges||f.ngDoCheck)&&((n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e.index),l=!0),u++}!function NS(n,t){const r=t.directiveEnd,i=n.data,s=t.attrs,o=[];let a=null,l=null;for(let u=t.directiveStart;u<r;u++){const c=i[u],d=c.inputs,f=null===s||Lm(t)?null:WS(d,s);o.push(f),a=iy(d,u,a),l=iy(c.outputs,u,l)}null!==a&&(a.hasOwnProperty("class")&&(t.flags|=16),a.hasOwnProperty("style")&&(t.flags|=32)),t.initialInputs=o,t.inputs=a,t.outputs=l}(n,e)}o&&function GS(n,t,e){if(t){const r=n.localNames=[];for(let i=0;i<t.length;i+=2){const s=e[t[i+1]];if(null==s)throw new ne(-301,`Export of name '${t[i+1]}' not found!`);r.push(t[i],s)}}}(e,r,o)}return e.mergedAttrs=va(e.mergedAttrs,e.attrs),i}function oy(n,t,e,r,i,s){const o=s.hostBindings;if(o){let a=n.hostBindingOpCodes;null===a&&(a=n.hostBindingOpCodes=[]);const l=~t.index;(function BS(n){let t=n.length;for(;t>0;){const e=n[--t];if("number"==typeof e&&e<0)return e}return 0})(a)!=l&&a.push(l),a.push(r,i,o)}}function ay(n,t){null!==n.hostBindings&&n.hostBindings(1,t)}function ly(n,t){t.flags|=2,(n.components||(n.components=[])).push(t.index)}function $S(n,t,e){if(e){if(t.exportAs)for(let r=0;r<t.exportAs.length;r++)e[t.exportAs[r]]=n;cn(t)&&(e[""]=n)}}function uy(n,t,e){n.flags|=1,n.directiveStart=t,n.directiveEnd=t+e,n.providerIndexes=t}function cy(n,t,e,r,i){n.data[r]=i;const s=i.factory||(i.factory=Gr(i.type)),o=new ks(s,cn(i),null);n.blueprint[r]=o,e[r]=o,oy(n,t,0,r,Vi(n,e,i.hostVars,U),i)}function qS(n,t,e){const r=Kt(t,n),i=ey(e),s=n[10],o=Va(n,eo(n,i,null,e.onPush?64:16,r,t,s,s.createRenderer(r,e),null,null));n[t.index]=o}function Tn(n,t,e,r,i,s){const o=Kt(n,t);!function ed(n,t,e,r,i,s,o){if(null==s)Fe(n)?n.removeAttribute(t,i,e):t.removeAttribute(i);else{const a=null==o?H(s):o(s,r||"",i);Fe(n)?n.setAttribute(t,i,a,e):e?t.setAttributeNS(e,i,a):t.setAttribute(i,a)}}(t[W],o,s,n.value,e,r,i)}function zS(n,t,e,r,i,s){const o=s[t];if(null!==o){const a=r.setInput;for(let l=0;l<o.length;){const u=o[l++],c=o[l++],d=o[l++];null!==a?r.setInput(e,d,u,c):e[c]=d}}}function WS(n,t){let e=null,r=0;for(;r<t.length;){const i=t[r];if(0!==i)if(5!==i){if("number"==typeof i)break;n.hasOwnProperty(i)&&(null===e&&(e=[]),e.push(i,n[i],t[r+1])),r+=2}else r+=2;else r+=4}return e}function dy(n,t,e,r){return new Array(n,!0,!1,t,null,0,r,e,null,null)}function YS(n,t){const e=Tt(t,n);if(Yu(e)){const r=e[1];80&e[2]?Bi(r,e,r.template,e[8]):e[5]>0&&td(e)}}function td(n){for(let r=Tc(n);null!==r;r=Ic(r))for(let i=10;i<r.length;i++){const s=r[i];if(1024&s[2]){const o=s[1];Bi(o,s,o.template,s[8])}else s[5]>0&&td(s)}const e=n[1].components;if(null!==e)for(let r=0;r<e.length;r++){const i=Tt(e[r],n);Yu(i)&&i[5]>0&&td(i)}}function ZS(n,t){const e=Tt(t,n),r=e[1];(function XS(n,t){for(let e=t.length;e<n.blueprint.length;e++)t.push(n.blueprint[e])})(r,e),to(r,e,e[8])}function Va(n,t){return n[13]?n[14][4]=t:n[13]=t,n[14]=t,t}function nd(n){for(;n;){n[2]|=64;const t=Xs(n);if(NA(n)&&!t)return n;n=t}return null}function id(n,t,e){const r=t[10];r.begin&&r.begin();try{Bi(n,t,n.template,e)}catch(i){throw my(t,i),i}finally{r.end&&r.end()}}function fy(n){!function rd(n){for(let t=0;t<n.components.length;t++){const e=n.components[t],r=wc(e),i=r[1];FS(i,r,i.template,e)}}(n[8])}function sd(n,t,e){nc(0),t(n,e)}const nT=(()=>Promise.resolve(null))();function hy(n){return n[7]||(n[7]=[])}function py(n){return n.cleanup||(n.cleanup=[])}function my(n,t){const e=n[9],r=e?e.get(zn,null):null;r&&r.handleError(t)}function yy(n,t,e,r,i){for(let s=0;s<e.length;){const o=e[s++],a=e[s++],l=t[o],u=n.data[o];null!==u.setInput?u.setInput(l,i,r,a):l[a]=i}}function Kn(n,t,e){const r=ca(t,n);!function Cm(n,t,e){Fe(n)?n.setValue(t,e):t.textContent=e}(n[W],r,e)}function Ba(n,t,e){let r=e?n.styles:null,i=e?n.classes:null,s=0;if(null!==t)for(let o=0;o<t.length;o++){const a=t[o];"number"==typeof a?s=a:1==s?i=ku(i,a):2==s&&(r=ku(r,a+": "+t[++o]+";"))}e?n.styles=r:n.stylesWithoutHost=r,e?n.classes=i:n.classesWithoutHost=i}const od=new F("INJECTOR",-1);class _y{get(t,e=Us){if(e===Us){const r=new Error(`NullInjectorError: No provider for ${le(t)}!`);throw r.name="NullInjectorError",r}return e}}const ad=new F("Set Injector scope."),no={},sT={};let ld;function vy(){return void 0===ld&&(ld=new _y),ld}function Cy(n,t=null,e=null,r){const i=by(n,t,e,r);return i._resolveInjectorDefTypes(),i}function by(n,t=null,e=null,r){return new oT(n,e,t||vy(),r)}class oT{constructor(t,e,r,i=null){this.parent=r,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;const s=[];e&&xn(e,a=>this.processProvider(a,t,e)),xn([t],a=>this.processInjectorType(a,[],s)),this.records.set(od,ji(void 0,this));const o=this.records.get(ad);this.scope=null!=o?o.value:null,this.source=i||("object"==typeof t?null:le(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=Us,r=G.Default){this.assertNotDestroyed();const i=Ug(this),s=cr(void 0);try{if(!(r&G.SkipSelf)){let a=this.records.get(t);if(void 0===a){const l=function pT(n){return"function"==typeof n||"object"==typeof n&&n instanceof F}(t)&&Lu(t);a=l&&this.injectableDefInScope(l)?ji(ud(t),no):null,this.records.set(t,a)}if(null!=a)return this.hydrate(t,a)}return(r&G.Self?vy():this.parent).get(t,e=r&G.Optional&&e===Us?null:e)}catch(o){if("NullInjectorError"===o.name){if((o[Aa]=o[Aa]||[]).unshift(le(t)),i)throw o;return function BM(n,t,e,r){const i=n[Aa];throw t[Hg]&&i.unshift(t[Hg]),n.message=function jM(n,t,e,r=null){n=n&&"\n"===n.charAt(0)&&"\u0275"==n.charAt(1)?n.substr(2):n;let i=le(t);if(Array.isArray(t))i=t.map(le).join(" -> ");else if("object"==typeof t){let s=[];for(let o in t)if(t.hasOwnProperty(o)){let a=t[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):le(a)))}i=`{${s.join(", ")}}`}return`${e}${r?"("+r+")":""}[${i}]: ${n.replace(NM,"\n ")}`}("\n"+n.message,i,e,r),n.ngTokenPath=i,n[Aa]=null,n}(o,t,"R3InjectorError",this.source)}throw o}finally{cr(s),Ug(i)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((r,i)=>t.push(le(i))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new ne(205,"")}processInjectorType(t,e,r){if(!(t=z(t)))return!1;let i=Yp(t);const s=null==i&&t.ngModule||void 0,o=void 0===s?t:s,a=-1!==r.indexOf(o);if(void 0!==s&&(i=Yp(s)),null==i)return!1;if(null!=i.imports&&!a){let c;r.push(o);try{xn(i.imports,d=>{this.processInjectorType(d,e,r)&&(void 0===c&&(c=[]),c.push(d))})}finally{}if(void 0!==c)for(let d=0;d<c.length;d++){const{ngModule:f,providers:h}=c[d];xn(h,g=>this.processProvider(g,f,h||he))}}this.injectorDefTypes.add(o);const l=Gr(o)||(()=>new o);this.records.set(o,ji(l,no));const u=i.providers;if(null!=u&&!a){const c=t;xn(u,d=>this.processProvider(d,c,u))}return void 0!==s&&void 0!==t.providers}processProvider(t,e,r){let i=Hi(t=z(t))?t:z(t&&t.provide);const s=function lT(n,t,e){return Ey(n)?ji(void 0,n.useValue):ji(Dy(n),no)}(t);if(Hi(t)||!0!==t.multi)this.records.get(i);else{let o=this.records.get(i);o||(o=ji(void 0,no,!0),o.factory=()=>gc(o.multi),this.records.set(i,o)),i=t,o.multi.push(t)}this.records.set(i,s)}hydrate(t,e){return e.value===no&&(e.value=sT,e.value=e.factory()),"object"==typeof e.value&&e.value&&function hT(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(e.value)&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){if(!t.providedIn)return!1;const e=z(t.providedIn);return"string"==typeof e?"any"===e||e===this.scope:this.injectorDefTypes.has(e)}}function ud(n){const t=Lu(n),e=null!==t?t.factory:Gr(n);if(null!==e)return e;if(n instanceof F)throw new ne(204,"");if(n instanceof Function)return function aT(n){const t=n.length;if(t>0)throw Hs(t,"?"),new ne(204,"");const e=function bA(n){const t=n&&(n[ra]||n[Zp]);if(t){const e=function DA(n){if(n.hasOwnProperty("name"))return n.name;const t=(""+n).match(/^function\s*([^\s(]+)/);return null===t?"":t[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${e}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${e}" class.`),t}return null}(n);return null!==e?()=>e.factory(n):()=>new n}(n);throw new ne(204,"")}function Dy(n,t,e){let r;if(Hi(n)){const i=z(n);return Gr(i)||ud(i)}if(Ey(n))r=()=>z(n.useValue);else if(function cT(n){return!(!n||!n.useFactory)}(n))r=()=>n.useFactory(...gc(n.deps||[]));else if(function uT(n){return!(!n||!n.useExisting)}(n))r=()=>D(z(n.useExisting));else{const i=z(n&&(n.useClass||n.provide));if(!function fT(n){return!!n.deps}(n))return Gr(i)||ud(i);r=()=>new i(...gc(n.deps))}return r}function ji(n,t,e=!1){return{factory:n,value:t,multi:e?[]:void 0}}function Ey(n){return null!==n&&"object"==typeof n&&PM in n}function Hi(n){return"function"==typeof n}let Je=(()=>{class n{static create(e,r){var i;if(Array.isArray(e))return Cy({name:""},r,e,"");{const s=null!==(i=e.name)&&void 0!==i?i:"";return Cy({name:s},e.parent,e.providers,s)}}}return n.THROW_IF_NOT_FOUND=Us,n.NULL=new _y,n.\u0275prov=w({token:n,providedIn:"any",factory:()=>D(od)}),n.__NG_ELEMENT_ID__=-1,n})();function DT(n,t){ga(wc(n)[1],qe())}function x(n){let t=function ky(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),e=!0;const r=[n];for(;t;){let i;if(cn(n))i=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new ne(903,"");i=t.\u0275dir}if(i){if(e){r.push(i);const o=n;o.inputs=fd(n.inputs),o.declaredInputs=fd(n.declaredInputs),o.outputs=fd(n.outputs);const a=i.hostBindings;a&&AT(n,a);const l=i.viewQuery,u=i.contentQueries;if(l&&wT(n,l),u&&xT(n,u),Nu(n.inputs,i.inputs),Nu(n.declaredInputs,i.declaredInputs),Nu(n.outputs,i.outputs),cn(i)&&i.data.animation){const c=n.data;c.animation=(c.animation||[]).concat(i.data.animation)}}const s=i.features;if(s)for(let o=0;o<s.length;o++){const a=s[o];a&&a.ngInherit&&a(n),a===x&&(e=!1)}}t=Object.getPrototypeOf(t)}!function ET(n){let t=0,e=null;for(let r=n.length-1;r>=0;r--){const i=n[r];i.hostVars=t+=i.hostVars,i.hostAttrs=va(i.hostAttrs,e=va(e,i.hostAttrs))}}(r)}function fd(n){return n===yi?{}:n===he?[]:n}function wT(n,t){const e=n.viewQuery;n.viewQuery=e?(r,i)=>{t(r,i),e(r,i)}:t}function xT(n,t){const e=n.contentQueries;n.contentQueries=e?(r,i,s)=>{t(r,i,s),e(r,i,s)}:t}function AT(n,t){const e=n.hostBindings;n.hostBindings=e?(r,i)=>{t(r,i),e(r,i)}:t}let ja=null;function Ui(){if(!ja){const n=ue.Symbol;if(n&&n.iterator)ja=n.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;e<t.length;++e){const r=t[e];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(ja=r)}}}return ja}function ro(n){return!!hd(n)&&(Array.isArray(n)||!(n instanceof Map)&&Ui()in n)}function hd(n){return null!==n&&("function"==typeof n||"object"==typeof n)}function at(n,t,e){return!Object.is(n[t],e)&&(n[t]=e,!0)}function kt(n,t,e,r){const i=C();return at(i,Ei(),t)&&(re(),Tn(Re(),i,n,t,e,r)),kt}function $i(n,t,e,r){return at(n,Ei(),e)?t+H(e)+r:U}function Be(n,t,e,r,i,s,o,a){const l=C(),u=re(),c=n+20,d=u.firstCreatePass?function OT(n,t,e,r,i,s,o,a,l){const u=t.consts,c=Li(t,n,4,o||null,hr(u,a));Jc(t,e,c,hr(u,l)),ga(t,c);const d=c.tViews=La(2,c,r,i,s,t.directiveRegistry,t.pipeRegistry,null,t.schemas,u);return null!==t.queries&&(t.queries.template(t,c),d.queries=t.queries.embeddedTView(c)),c}(c,u,l,t,e,r,i,s,o):u.data[c];wn(d,!1);const f=l[W].createComment("");Ra(u,l,f,d),ot(f,l),Va(l,l[c]=dy(f,l,f,d)),ua(d)&&Zc(u,l,d),null!=o&&Xc(l,d,a)}function p(n,t=G.Default){const e=C();return null===e?D(n,t):Fg(qe(),e,z(n),t)}function _d(){throw new Error("invalid")}function ie(n,t,e){const r=C();return at(r,Ei(),t)&&Nt(re(),Re(),r,n,t,r[W],e,!1),ie}function vd(n,t,e,r,i){const o=i?"class":"style";yy(n,e,t.inputs[o],o,r)}function L(n,t,e,r){const i=C(),s=re(),o=20+n,a=i[W],l=i[o]=Rc(a,t,function uM(){return j.lFrame.currentNamespace}()),u=s.firstCreatePass?function eI(n,t,e,r,i,s,o){const a=t.consts,u=Li(t,n,2,i,hr(a,s));return Jc(t,e,u,hr(a,o)),null!==u.attrs&&Ba(u,u.attrs,!1),null!==u.mergedAttrs&&Ba(u,u.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,u),u}(o,s,i,0,t,e,r):s.data[o];wn(u,!0);const c=u.mergedAttrs;null!==c&&_a(a,l,c);const d=u.classes;null!==d&&Vc(a,l,d);const f=u.styles;null!==f&&Nm(a,l,f),64!=(64&u.flags)&&Ra(s,i,l,u),0===function WA(){return j.lFrame.elementDepthCount}()&&ot(l,i),function KA(){j.lFrame.elementDepthCount++}(),ua(u)&&(Zc(s,i,u),Jm(s,u,i)),null!==r&&Xc(i,u)}function V(){let n=qe();Xu()?Ju():(n=n.parent,wn(n,!1));const t=n;!function QA(){j.lFrame.elementDepthCount--}();const e=re();e.firstCreatePass&&(ga(e,n),$u(n)&&e.queries.elementEnd(n)),null!=t.classesWithoutHost&&function pM(n){return 0!=(16&n.flags)}(t)&&vd(e,t,C(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function gM(n){return 0!=(32&n.flags)}(t)&&vd(e,t,C(),t.stylesWithoutHost,!1)}function lt(n,t,e,r){L(n,t,e,r),V()}function vr(n,t,e){const r=C(),i=re(),s=n+20,o=i.firstCreatePass?function tI(n,t,e,r,i){const s=t.consts,o=hr(s,r),a=Li(t,n,8,"ng-container",o);return null!==o&&Ba(a,o,!0),Jc(t,e,a,hr(s,i)),null!==t.queries&&t.queries.elementStart(t,a),a}(s,i,r,t,e):i.data[s];wn(o,!0);const a=r[s]=r[W].createComment("");Ra(i,r,a,o),ot(a,r),ua(o)&&(Zc(i,r,o),Jm(i,o,r)),null!=e&&Xc(r,o)}function Cr(){let n=qe();const t=re();Xu()?Ju():(n=n.parent,wn(n,!1)),t.firstCreatePass&&(ga(t,n),$u(n)&&t.queries.elementEnd(n))}function so(){return C()}function oo(n){return!!n&&"function"==typeof n.then}const Cd=function n_(n){return!!n&&"function"==typeof n.subscribe};function je(n,t,e,r){const i=C(),s=re(),o=qe();return function i_(n,t,e,r,i,s,o,a){const l=ua(r),c=n.firstCreatePass&&py(n),d=t[8],f=hy(t);let h=!0;if(3&r.type||a){const _=Kt(r,t),v=a?a(_):_,y=f.length,E=a?T=>a(Ve(T[r.index])):r.index;if(Fe(e)){let T=null;if(!a&&l&&(T=function rI(n,t,e,r){const i=n.cleanup;if(null!=i)for(let s=0;s<i.length-1;s+=2){const o=i[s];if(o===e&&i[s+1]===r){const a=t[7],l=i[s+2];return a.length>l?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,t,i,r.index)),null!==T)(T.__ngLastListenerFn__||T).__ngNextListenerFn__=s,T.__ngLastListenerFn__=s,h=!1;else{s=bd(r,t,d,s,!1);const q=e.listen(v,i,s);f.push(s,q),c&&c.push(i,E,y,y+1)}}else s=bd(r,t,d,s,!0),v.addEventListener(i,s,o),f.push(s),c&&c.push(i,E,y,o)}else s=bd(r,t,d,s,!1);const g=r.outputs;let m;if(h&&null!==g&&(m=g[i])){const _=m.length;if(_)for(let v=0;v<_;v+=2){const Ae=t[m[v]][m[v+1]].subscribe(s),Te=f.length;f.push(s,Ae),c&&c.push(i,r.index,Te,-(Te+1))}}}(s,i,i[W],o,n,t,!!e,r),je}function s_(n,t,e,r){try{return!1!==e(r)}catch(i){return my(n,i),!1}}function bd(n,t,e,r,i){return function s(o){if(o===Function)return r;const a=2&n.flags?Tt(n.index,t):t;0==(32&t[2])&&nd(a);let l=s_(t,0,r,o),u=s.__ngNextListenerFn__;for(;u;)l=s_(t,0,u,o)&&l,u=u.__ngNextListenerFn__;return i&&!1===l&&(o.preventDefault(),o.returnValue=!1),l}}function Pt(n=1){return function rM(n){return(j.lFrame.contextLView=function iM(n,t){for(;n>0;)t=t[15],n--;return t}(n,j.lFrame.contextLView))[8]}(n)}function iI(n,t){let e=null;const r=function dS(n){const t=n.attrs;if(null!=t){const e=t.indexOf(5);if(0==(1&e))return t[e+1]}return null}(n);for(let i=0;i<t.length;i++){const s=t[i];if("*"!==s){if(null===r?Vm(n,s,!0):pS(r,s))return i}else e=i}return e}function Dd(n){const t=C()[16][6];if(!t.projection){const r=t.projection=Hs(n?n.length:1,null),i=r.slice();let s=t.child;for(;null!==s;){const o=n?iI(s,n):0;null!==o&&(i[o]?i[o].projectionNext=s:r[o]=s,i[o]=s),s=s.next}}}function Fn(n,t=0,e){const r=C(),i=re(),s=Li(i,20+n,16,null,e||null);null===s.projection&&(s.projection=t),Ju(),64!=(64&s.flags)&&function iS(n,t,e){Om(t[W],0,t,e,Em(n,e,t),Mm(e.parent||t[6],e,t))}(i,r,s)}function Ed(n,t,e){return wd(n,"",t,"",e),Ed}function wd(n,t,e,r,i){const s=C(),o=$i(s,t,e,r);return o!==U&&Nt(re(),Re(),s,n,o,s[W],i,!1),wd}function p_(n,t,e,r,i){const s=n[e+1],o=null===t;let a=r?fn(s):Wn(s),l=!1;for(;0!==a&&(!1===l||o);){const c=n[a+1];aI(n[a],t)&&(l=!0,n[a+1]=r?Hc(c):Bc(c)),a=r?fn(c):Wn(c)}l&&(n[e+1]=r?Bc(s):Hc(s))}function aI(n,t){return null===n||null==t||(Array.isArray(n)?n[1]:n)===t||!(!Array.isArray(n)||"string"!=typeof t)&&Ri(n,t)>=0}function Qn(n,t){return function pn(n,t,e,r){const i=C(),s=re(),o=function qn(n){const t=j.lFrame,e=t.bindingIndex;return t.bindingIndex=t.bindingIndex+n,e}(2);s.firstUpdatePass&&function E_(n,t,e,r){const i=n.data;if(null===i[e+1]){const s=i[ht()],o=function D_(n,t){return t>=n.expandoStartIndex}(n,e);(function M_(n,t){return 0!=(n.flags&(t?16:32))})(s,r)&&null===t&&!o&&(t=!1),t=function mI(n,t,e,r){const i=function tc(n){const t=j.lFrame.currentDirectiveIndex;return-1===t?null:n[t]}(n);let s=r?t.residualClasses:t.residualStyles;if(null===i)0===(r?t.classBindings:t.styleBindings)&&(e=ao(e=xd(null,n,t,e,r),t.attrs,r),s=null);else{const o=t.directiveStylingLast;if(-1===o||n[o]!==i)if(e=xd(i,n,t,e,r),null===s){let l=function yI(n,t,e){const r=e?t.classBindings:t.styleBindings;if(0!==Wn(r))return n[fn(r)]}(n,t,r);void 0!==l&&Array.isArray(l)&&(l=xd(null,n,t,l[1],r),l=ao(l,t.attrs,r),function _I(n,t,e,r){n[fn(e?t.classBindings:t.styleBindings)]=r}(n,t,r,l))}else s=function vI(n,t,e){let r;const i=t.directiveEnd;for(let s=1+t.directiveStylingLast;s<i;s++)r=ao(r,n[s].hostAttrs,e);return ao(r,t.attrs,e)}(n,t,r)}return void 0!==s&&(r?t.residualClasses=s:t.residualStyles=s),e}(i,s,t,r),function sI(n,t,e,r,i,s){let o=s?t.classBindings:t.styleBindings,a=fn(o),l=Wn(o);n[r]=e;let c,u=!1;if(Array.isArray(e)){const d=e;c=d[1],(null===c||Ri(d,c)>0)&&(u=!0)}else c=e;if(i)if(0!==l){const f=fn(n[a+1]);n[r+1]=Na(f,a),0!==f&&(n[f+1]=jc(n[f+1],r)),n[a+1]=function _S(n,t){return 131071&n|t<<17}(n[a+1],r)}else n[r+1]=Na(a,0),0!==a&&(n[a+1]=jc(n[a+1],r)),a=r;else n[r+1]=Na(l,0),0===a?a=r:n[l+1]=jc(n[l+1],r),l=r;u&&(n[r+1]=Bc(n[r+1])),p_(n,c,r,!0),p_(n,c,r,!1),function oI(n,t,e,r,i){const s=i?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof t&&Ri(s,t)>=0&&(e[r+1]=Hc(e[r+1]))}(t,c,n,r,s),o=Na(a,l),s?t.classBindings=o:t.styleBindings=o}(i,s,t,e,o,r)}}(s,n,o,r),t!==U&&at(i,o,t)&&function x_(n,t,e,r,i,s,o,a){if(!(3&t.type))return;const l=n.data,u=l[a+1];Ga(function Gm(n){return 1==(1&n)}(u)?A_(l,t,e,i,Wn(u),o):void 0)||(Ga(s)||function Um(n){return 2==(2&n)}(u)&&(s=A_(l,null,e,i,a,o)),function oS(n,t,e,r,i){const s=Fe(n);if(t)i?s?n.addClass(e,r):e.classList.add(r):s?n.removeClass(e,r):e.classList.remove(r);else{let o=-1===r.indexOf("-")?void 0:Ot.DashCase;if(null==i)s?n.removeStyle(e,r,o):e.style.removeProperty(r);else{const a="string"==typeof i&&i.endsWith("!important");a&&(i=i.slice(0,-10),o|=Ot.Important),s?n.setStyle(e,r,i,o):e.style.setProperty(r,i,a?"important":"")}}}(r,o,ca(ht(),e),i,s))}(s,s.data[ht()],i,i[W],n,i[o+1]=function DI(n,t){return null==n||("string"==typeof t?n+=t:"object"==typeof n&&(n=le(Rt(n)))),n}(t,e),r,o)}(n,t,null,!0),Qn}function xd(n,t,e,r,i){let s=null;const o=e.directiveEnd;let a=e.directiveStylingLast;for(-1===a?a=e.directiveStart:a++;a<o&&(s=t[a],r=ao(r,s.hostAttrs,i),s!==n);)a++;return null!==n&&(e.directiveStylingLast=a),r}function ao(n,t,e){const r=e?1:2;let i=-1;if(null!==t)for(let s=0;s<t.length;s++){const o=t[s];"number"==typeof o?i=o:i===r&&(Array.isArray(n)||(n=void 0===n?[]:["",n]),It(n,o,!!e||t[++s]))}return void 0===n?null:n}function A_(n,t,e,r,i,s){const o=null===t;let a;for(;i>0;){const l=n[i],u=Array.isArray(l),c=u?l[1]:l,d=null===c;let f=e[i+1];f===U&&(f=d?he:void 0);let h=d?fc(f,r):c===r?f:void 0;if(u&&!Ga(h)&&(h=fc(l,r)),Ga(h)&&(a=h,o))return a;const g=n[i+1];i=o?fn(g):Wn(g)}if(null!==t){let l=s?t.residualClasses:t.residualStyles;null!=l&&(a=fc(l,r))}return a}function Ga(n){return void 0!==n}function ut(n,t=""){const e=C(),r=re(),i=n+20,s=r.firstCreatePass?Li(r,i,1,t,null):r.data[i],o=e[i]=function Fc(n,t){return Fe(n)?n.createText(t):n.createTextNode(t)}(e[W],t);Ra(r,e,o,s),wn(s,!1)}function Kr(n){return Ad("",n,""),Kr}function Ad(n,t,e){const r=C(),i=$i(r,n,t,e);return i!==U&&Kn(r,ht(),i),Ad}function Md(n,t,e){const r=C();return at(r,Ei(),t)&&Nt(re(),Re(),r,n,t,r[W],e,!0),Md}const Qr=void 0;var UI=["en",[["a","p"],["AM","PM"],Qr],[["AM","PM"],Qr,Qr],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Qr,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Qr,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Qr,"{1} 'at' {0}",Qr],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function HI(n){const e=Math.floor(Math.abs(n)),r=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===r?1:5}];let es={};function W_(n){return n in es||(es[n]=ue.ng&&ue.ng.common&&ue.ng.common.locales&&ue.ng.common.locales[n]),es[n]}var S=(()=>((S=S||{})[S.LocaleId=0]="LocaleId",S[S.DayPeriodsFormat=1]="DayPeriodsFormat",S[S.DayPeriodsStandalone=2]="DayPeriodsStandalone",S[S.DaysFormat=3]="DaysFormat",S[S.DaysStandalone=4]="DaysStandalone",S[S.MonthsFormat=5]="MonthsFormat",S[S.MonthsStandalone=6]="MonthsStandalone",S[S.Eras=7]="Eras",S[S.FirstDayOfWeek=8]="FirstDayOfWeek",S[S.WeekendRange=9]="WeekendRange",S[S.DateFormat=10]="DateFormat",S[S.TimeFormat=11]="TimeFormat",S[S.DateTimeFormat=12]="DateTimeFormat",S[S.NumberSymbols=13]="NumberSymbols",S[S.NumberFormats=14]="NumberFormats",S[S.CurrencyCode=15]="CurrencyCode",S[S.CurrencySymbol=16]="CurrencySymbol",S[S.CurrencyName=17]="CurrencyName",S[S.Currencies=18]="Currencies",S[S.Directionality=19]="Directionality",S[S.PluralCase=20]="PluralCase",S[S.ExtraData=21]="ExtraData",S))();const $a="en-US";let K_=$a;function Id(n,t,e,r,i){if(n=z(n),Array.isArray(n))for(let s=0;s<n.length;s++)Id(n[s],t,e,r,i);else{const s=re(),o=C();let a=Hi(n)?n:z(n.provide),l=Dy(n);const u=qe(),c=1048575&u.providerIndexes,d=u.directiveStart,f=u.providerIndexes>>20;if(Hi(n)||!n.multi){const h=new ks(l,i,p),g=Rd(a,t,i?c:c+f,d);-1===g?(Da(Ls(u,o),s,a),Fd(s,n,t.length),t.push(a),u.directiveStart++,u.directiveEnd++,i&&(u.providerIndexes+=1048576),e.push(h),o.push(h)):(e[g]=h,o[g]=h)}else{const h=Rd(a,t,c+f,d),g=Rd(a,t,c,c+f),m=h>=0&&e[h],_=g>=0&&e[g];if(i&&!_||!i&&!m){Da(Ls(u,o),s,a);const v=function HF(n,t,e,r,i){const s=new ks(n,e,p);return s.multi=[],s.index=t,s.componentProviders=0,_v(s,i,r&&!e),s}(i?jF:BF,e.length,i,r,l);!i&&_&&(e[g].providerFactory=v),Fd(s,n,t.length,0),t.push(a),u.directiveStart++,u.directiveEnd++,i&&(u.providerIndexes+=1048576),e.push(v),o.push(v)}else Fd(s,n,h>-1?h:g,_v(e[i?g:h],l,!i&&r));!i&&r&&_&&e[g].componentProviders++}}}function Fd(n,t,e,r){const i=Hi(t),s=function dT(n){return!!n.useClass}(t);if(i||s){const l=(s?z(t.useClass):t).prototype.ngOnDestroy;if(l){const u=n.destroyHooks||(n.destroyHooks=[]);if(!i&&t.multi){const c=u.indexOf(e);-1===c?u.push(e,[r,l]):u[c+1].push(r,l)}else u.push(e,l)}}}function _v(n,t,e){return e&&n.componentProviders++,n.multi.push(t)-1}function Rd(n,t,e,r){for(let i=e;i<r;i++)if(t[i]===n)return i;return-1}function BF(n,t,e,r){return Od(this.multi,[])}function jF(n,t,e,r){const i=this.multi;let s;if(this.providerFactory){const o=this.providerFactory.componentProviders,a=Vs(e,e[1],this.providerFactory.index,r);s=a.slice(0,o),Od(i,s);for(let l=o;l<a.length;l++)s.push(a[l])}else s=[],Od(i,s);return s}function Od(n,t){for(let e=0;e<n.length;e++)t.push((0,n[e])());return t}function pe(n,t=[]){return e=>{e.providersResolver=(r,i)=>function VF(n,t,e){const r=re();if(r.firstCreatePass){const i=cn(n);Id(e,r.data,r.blueprint,i,!0),Id(t,r.data,r.blueprint,i,!1)}}(r,i?i(n):n,t)}}class vv{}class $F{resolveComponentFactory(t){throw function GF(n){const t=Error(`No component factory found for ${le(n)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=n,t}(t)}}let ns=(()=>{class n{}return n.NULL=new $F,n})();function qF(){return rs(qe(),C())}function rs(n,t){return new $(Kt(n,t))}let $=(()=>{class n{constructor(e){this.nativeElement=e}}return n.__NG_ELEMENT_ID__=qF,n})();function zF(n){return n instanceof $?n.nativeElement:n}class ho{}let mn=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>function KF(){const n=C(),e=Tt(qe().index,n);return function WF(n){return n[W]}(En(e)?e:n)}(),n})(),QF=(()=>{class n{}return n.\u0275prov=w({token:n,providedIn:"root",factory:()=>null}),n})();class br{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const YF=new br("13.1.3"),Nd={};function Qa(n,t,e,r,i=!1){for(;null!==e;){const s=t[e.index];if(null!==s&&r.push(Ve(s)),un(s))for(let a=10;a<s.length;a++){const l=s[a],u=l[1].firstChild;null!==u&&Qa(l[1],l,u,r)}const o=e.type;if(8&o)Qa(n,t,e.child,r);else if(32&o){const a=Sc(e,t);let l;for(;l=a();)r.push(l)}else if(16&o){const a=Fm(t,e);if(Array.isArray(a))r.push(...a);else{const l=Xs(t[16]);Qa(l[1],l,a,r,!0)}}e=i?e.projectionNext:e.next}return r}class po{constructor(t,e){this._lView=t,this._cdRefInjectingView=e,this._appRef=null,this._attachedToViewContainer=!1}get rootNodes(){const t=this._lView,e=t[1];return Qa(e,t,e.firstChild,[])}get context(){return this._lView[8]}set context(t){this._lView[8]=t}get destroyed(){return 256==(256&this._lView[2])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const t=this._lView[3];if(un(t)){const e=t[8],r=e?e.indexOf(this):-1;r>-1&&(Oc(t,r),wa(e,r))}this._attachedToViewContainer=!1}Dm(this._lView[1],this._lView)}onDestroy(t){ry(this._lView[1],this._lView,null,t)}markForCheck(){nd(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){id(this._lView[1],this._lView,this.context)}checkNoChanges(){!function eT(n,t,e){fa(!0);try{id(n,t,e)}finally{fa(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new ne(902,"");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function Y0(n,t){Js(n,t,t[W],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new ne(902,"");this._appRef=t}}class ZF extends po{constructor(t){super(t),this._view=t}detectChanges(){fy(this._view)}checkNoChanges(){!function tT(n){fa(!0);try{fy(n)}finally{fa(!1)}}(this._view)}get context(){return null}}class bv extends ns{constructor(t){super(),this.ngModule=t}resolveComponentFactory(t){const e=rt(t);return new kd(e,this.ngModule)}}function Dv(n){const t=[];for(let e in n)n.hasOwnProperty(e)&&t.push({propName:n[e],templateName:e});return t}const JF=new F("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>pm});class kd extends vv{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=function mS(n){return n.map(gS).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return Dv(this.componentDef.inputs)}get outputs(){return Dv(this.componentDef.outputs)}create(t,e,r,i){const s=(i=i||this.ngModule)?function eR(n,t){return{get:(e,r,i)=>{const s=n.get(e,Nd,i);return s!==Nd||r===Nd?s:t.get(e,r,i)}}}(t,i.injector):t,o=s.get(ho,cg),a=s.get(QF,null),l=o.createRenderer(null,this.componentDef),u=this.componentDef.selectors[0][0]||"div",c=r?function ny(n,t,e){if(Fe(n))return n.selectRootElement(t,e===an.ShadowDom);let r="string"==typeof t?n.querySelector(t):t;return r.textContent="",r}(l,r,this.componentDef.encapsulation):Rc(o.createRenderer(null,this.componentDef),u,function XF(n){const t=n.toLowerCase();return"svg"===t?"http://www.w3.org/2000/svg":"math"===t?"http://www.w3.org/1998/MathML/":null}(u)),d=this.componentDef.onPush?576:528,f=function Ny(n,t){return{components:[],scheduler:n||pm,clean:nT,playerHandler:t||null,flags:0}}(),h=La(0,null,null,1,0,null,null,null,null,null),g=eo(null,h,f,d,null,null,o,l,a,s);let m,_;ha(g);try{const v=function Ry(n,t,e,r,i,s){const o=e[1];e[20]=n;const l=Li(o,20,2,"#host",null),u=l.mergedAttrs=t.hostAttrs;null!==u&&(Ba(l,u,!0),null!==n&&(_a(i,n,u),null!==l.classes&&Vc(i,n,l.classes),null!==l.styles&&Nm(i,n,l.styles)));const c=r.createRenderer(n,t),d=eo(e,ey(t),null,t.onPush?64:16,e[20],l,r,c,s||null,null);return o.firstCreatePass&&(Da(Ls(l,e),o,t.type),ly(o,l),uy(l,e.length,1)),Va(e,d),e[20]=d}(c,this.componentDef,g,o,l);if(c)if(r)_a(l,c,["ng-version",YF.full]);else{const{attrs:y,classes:E}=function yS(n){const t=[],e=[];let r=1,i=2;for(;r<n.length;){let s=n[r];if("string"==typeof s)2===i?""!==s&&t.push(s,n[++r]):8===i&&e.push(s);else{if(!dn(i))break;i=s}r++}return{attrs:t,classes:e}}(this.componentDef.selectors[0]);y&&_a(l,c,y),E&&E.length>0&&Vc(l,c,E.join(" "))}if(_=Qu(h,20),void 0!==e){const y=_.projection=[];for(let E=0;E<this.ngContentSelectors.length;E++){const T=e[E];y.push(null!=T?Array.from(T):null)}}m=function Oy(n,t,e,r,i){const s=e[1],o=function VS(n,t,e){const r=qe();n.firstCreatePass&&(e.providersResolver&&e.providersResolver(e),cy(n,r,t,Vi(n,t,1,null),e));const i=Vs(t,n,r.directiveStart,r);ot(i,t);const s=Kt(r,t);return s&&ot(s,t),i}(s,e,t);if(r.components.push(o),n[8]=o,i&&i.forEach(l=>l(o,t)),t.contentQueries){const l=qe();t.contentQueries(1,o,l.directiveStart)}const a=qe();return!s.firstCreatePass||null===t.hostBindings&&null===t.hostAttrs||(pr(a.index),oy(e[1],a,0,a.directiveStart,a.directiveEnd,t),ay(t,o)),o}(v,this.componentDef,g,f,[DT]),to(h,g,null)}finally{pa()}return new nR(this.componentType,m,rs(_,g),g,_)}}class nR extends class UF{}{constructor(t,e,r,i,s){super(),this.location=r,this._rootLView=i,this._tNode=s,this.instance=e,this.hostView=this.changeDetectorRef=new ZF(i),this.componentType=t}get injector(){return new Ai(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}class Yn{}class Ev{}const is=new Map;class Av extends Yn{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new bv(this);const r=qt(t);this._bootstrapComponents=Sn(r.bootstrap),this._r3Injector=by(t,e,[{provide:Yn,useValue:this},{provide:ns,useValue:this.componentFactoryResolver}],le(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=Je.THROW_IF_NOT_FOUND,r=G.Default){return t===Je||t===Yn||t===od?this:this._r3Injector.get(t,e,r)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(e=>e()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Pd extends Ev{constructor(t){super(),this.moduleType=t,null!==qt(t)&&function iR(n){const t=new Set;!function e(r){const i=qt(r,!0),s=i.id;null!==s&&(function wv(n,t,e){if(t&&t!==e)throw new Error(`Duplicate module registered for ${n} - ${le(t)} vs ${le(t.name)}`)}(s,is.get(s),r),is.set(s,r));const o=Sn(i.imports);for(const a of o)t.has(a)||(t.add(a),e(a))}(n)}(t)}create(t){return new Av(this.moduleType,t)}}function Mv(n,t,e,r){return function Sv(n,t,e,r,i,s){const o=t+e;return at(n,o,i)?function In(n,t,e){return n[t]=e}(n,o+1,s?r.call(s,i):r(i)):function go(n,t){const e=n[t];return e===U?void 0:e}(n,o+1)}(C(),function ft(){const n=j.lFrame;let t=n.bindingRootIndex;return-1===t&&(t=n.bindingRootIndex=n.tView.bindingStartIndex),t}(),n,t,e,r)}function Ld(n){return t=>{setTimeout(n,void 0,t)}}const we=class bR extends Xe{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,r){var i,s,o;let a=t,l=e||(()=>null),u=r;if(t&&"object"==typeof t){const d=t;a=null===(i=d.next)||void 0===i?void 0:i.bind(d),l=null===(s=d.error)||void 0===s?void 0:s.bind(d),u=null===(o=d.complete)||void 0===o?void 0:o.bind(d)}this.__isAsync&&(l=Ld(l),a&&(a=Ld(a)),u&&(u=Ld(u)));const c=super.subscribe({next:a,error:l,complete:u});return t instanceof bt&&t.add(c),c}};function DR(){return this._results[Ui()]()}class Vd{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const e=Ui(),r=Vd.prototype;r[e]||(r[e]=DR)}get changes(){return this._changes||(this._changes=new we)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,e){const r=this;r.dirty=!1;const i=Qt(t);(this._changesDetected=!function xM(n,t,e){if(n.length!==t.length)return!1;for(let r=0;r<n.length;r++){let i=n[r],s=t[r];if(e&&(i=e(i),s=e(s)),s!==i)return!1}return!0}(r._results,i,e))&&(r._results=i,r.length=i.length,r.last=i[this.length-1],r.first=i[0])}notifyOnChanges(){this._changes&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}Symbol;let Zn=(()=>{class n{}return n.__NG_ELEMENT_ID__=xR,n})();const ER=Zn,wR=class extends ER{constructor(t,e,r){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=r}createEmbeddedView(t){const e=this._declarationTContainer.tViews,r=eo(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);r[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(r[19]=s.createEmbeddedView(e)),to(e,r,t),new po(r)}};function xR(){return Ya(qe(),C())}function Ya(n,t){return 4&n.type?new wR(t,n,rs(n,t)):null}let yn=(()=>{class n{}return n.__NG_ELEMENT_ID__=AR,n})();function AR(){return kv(qe(),C())}const MR=yn,Ov=class extends MR{constructor(t,e,r){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=r}get element(){return rs(this._hostTNode,this._hostLView)}get injector(){return new Ai(this._hostTNode,this._hostLView)}get parentInjector(){const t=ba(this._hostTNode,this._hostLView);if(Ag(t)){const e=xi(t,this._hostLView),r=wi(t);return new Ai(e[1].data[r+8],e)}return new Ai(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=Nv(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,e,r){const i=t.createEmbeddedView(e||{});return this.insert(i,r),i}createComponent(t,e,r,i,s){const o=t&&!function js(n){return"function"==typeof n}(t);let a;if(o)a=e;else{const d=e||{};a=d.index,r=d.injector,i=d.projectableNodes,s=d.ngModuleRef}const l=o?t:new kd(rt(t)),u=r||this.parentInjector;if(!s&&null==l.ngModule&&u){const d=u.get(Yn,null);d&&(s=d)}const c=l.create(u,i,void 0,s);return this.insert(c.hostView,a),c}insert(t,e){const r=t._lView,i=r[1];if(function zA(n){return un(n[3])}(r)){const c=this.indexOf(t);if(-1!==c)this.detach(c);else{const d=r[3],f=new Ov(d,d[6],d[3]);f.detach(f.indexOf(t))}}const s=this._adjustIndex(e),o=this._lContainer;!function X0(n,t,e,r){const i=10+r,s=e.length;r>0&&(e[i-1][4]=t),r<s-10?(t[4]=e[i],Pg(e,10+r,t)):(e.push(t),t[4]=null),t[3]=e;const o=t[17];null!==o&&e!==o&&function J0(n,t){const e=n[9];t[16]!==t[3][3][16]&&(n[2]=!0),null===e?n[9]=[t]:e.push(t)}(o,t);const a=t[19];null!==a&&a.insertView(n),t[2]|=128}(i,r,o,s);const a=Pc(s,o),l=r[W],u=Fa(l,o[7]);return null!==u&&function Q0(n,t,e,r,i,s){r[0]=i,r[6]=t,Js(n,r,e,1,i,s)}(i,o[6],l,r,u,a),t.attachToViewContainerRef(),Pg(Bd(o),s,t),t}move(t,e){return this.insert(t,e)}indexOf(t){const e=Nv(this._lContainer);return null!==e?e.indexOf(t):-1}remove(t){const e=this._adjustIndex(t,-1),r=Oc(this._lContainer,e);r&&(wa(Bd(this._lContainer),e),Dm(r[1],r))}detach(t){const e=this._adjustIndex(t,-1),r=Oc(this._lContainer,e);return r&&null!=wa(Bd(this._lContainer),e)?new po(r):null}_adjustIndex(t,e=0){return null==t?this.length+e:t}};function Nv(n){return n[8]}function Bd(n){return n[8]||(n[8]=[])}function kv(n,t){let e;const r=t[n.index];if(un(r))e=r;else{let i;if(8&n.type)i=Ve(r);else{const s=t[W];i=s.createComment("");const o=Kt(n,t);zr(s,Fa(s,o),i,function rS(n,t){return Fe(n)?n.nextSibling(t):t.nextSibling}(s,o),!1)}t[n.index]=e=dy(r,t,i,n),Va(t,e)}return new Ov(e,n,t)}class jd{constructor(t){this.queryList=t,this.matches=null}clone(){return new jd(this.queryList)}setDirty(){this.queryList.setDirty()}}class Hd{constructor(t=[]){this.queries=t}createEmbeddedView(t){const e=t.queries;if(null!==e){const r=null!==t.contentQueries?t.contentQueries[0]:e.length,i=[];for(let s=0;s<r;s++){const o=e.getByIndex(s);i.push(this.queries[o.indexInDeclarationView].clone())}return new Hd(i)}return null}insertView(t){this.dirtyQueriesWithMatches(t)}detachView(t){this.dirtyQueriesWithMatches(t)}dirtyQueriesWithMatches(t){for(let e=0;e<this.queries.length;e++)null!==jv(t,e).matches&&this.queries[e].setDirty()}}class Pv{constructor(t,e,r=null){this.predicate=t,this.flags=e,this.read=r}}class Ud{constructor(t=[]){this.queries=t}elementStart(t,e){for(let r=0;r<this.queries.length;r++)this.queries[r].elementStart(t,e)}elementEnd(t){for(let e=0;e<this.queries.length;e++)this.queries[e].elementEnd(t)}embeddedTView(t){let e=null;for(let r=0;r<this.length;r++){const i=null!==e?e.length:0,s=this.getByIndex(r).embeddedTView(t,i);s&&(s.indexInDeclarationView=r,null!==e?e.push(s):e=[s])}return null!==e?new Ud(e):null}template(t,e){for(let r=0;r<this.queries.length;r++)this.queries[r].template(t,e)}getByIndex(t){return this.queries[t]}get length(){return this.queries.length}track(t){this.queries.push(t)}}class Gd{constructor(t,e=-1){this.metadata=t,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=e}elementStart(t,e){this.isApplyingToNode(e)&&this.matchTNode(t,e)}elementEnd(t){this._declarationNodeIndex===t.index&&(this._appliesToNextNode=!1)}template(t,e){this.elementStart(t,e)}embeddedTView(t,e){return this.isApplyingToNode(t)?(this.crossesNgTemplate=!0,this.addMatch(-t.index,e),new Gd(this.metadata)):null}isApplyingToNode(t){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){const e=this._declarationNodeIndex;let r=t.parent;for(;null!==r&&8&r.type&&r.index!==e;)r=r.parent;return e===(null!==r?r.index:-1)}return this._appliesToNextNode}matchTNode(t,e){const r=this.metadata.predicate;if(Array.isArray(r))for(let i=0;i<r.length;i++){const s=r[i];this.matchTNodeWithReadOption(t,e,IR(e,s)),this.matchTNodeWithReadOption(t,e,Ea(e,t,s,!1,!1))}else r===Zn?4&e.type&&this.matchTNodeWithReadOption(t,e,-1):this.matchTNodeWithReadOption(t,e,Ea(e,t,r,!1,!1))}matchTNodeWithReadOption(t,e,r){if(null!==r){const i=this.metadata.read;if(null!==i)if(i===$||i===yn||i===Zn&&4&e.type)this.addMatch(e.index,-2);else{const s=Ea(e,t,i,!1,!1);null!==s&&this.addMatch(e.index,s)}else this.addMatch(e.index,r)}}addMatch(t,e){null===this.matches?this.matches=[t,e]:this.matches.push(t,e)}}function IR(n,t){const e=n.localNames;if(null!==e)for(let r=0;r<e.length;r+=2)if(e[r]===t)return e[r+1];return null}function RR(n,t,e,r){return-1===e?function FR(n,t){return 11&n.type?rs(n,t):4&n.type?Ya(n,t):null}(t,n):-2===e?function OR(n,t,e){return e===$?rs(t,n):e===Zn?Ya(t,n):e===yn?kv(t,n):void 0}(n,t,r):Vs(n,n[1],e,t)}function Lv(n,t,e,r){const i=t[19].queries[r];if(null===i.matches){const s=n.data,o=e.matches,a=[];for(let l=0;l<o.length;l+=2){const u=o[l];a.push(u<0?null:RR(t,s[u],o[l+1],e.metadata.read))}i.matches=a}return i.matches}function $d(n,t,e,r){const i=n.queries.getByIndex(e),s=i.matches;if(null!==s){const o=Lv(n,t,i,e);for(let a=0;a<s.length;a+=2){const l=s[a];if(l>0)r.push(o[a/2]);else{const u=s[a+1],c=t[-l];for(let d=10;d<c.length;d++){const f=c[d];f[17]===f[3]&&$d(f[1],f,u,r)}if(null!==c[9]){const d=c[9];for(let f=0;f<d.length;f++){const h=d[f];$d(h[1],h,u,r)}}}}}return r}function mt(n){const t=C(),e=re(),r=yg();nc(r+1);const i=jv(e,r);if(n.dirty&&dg(t)===(2==(2&i.metadata.flags))){if(null===i.matches)n.reset([]);else{const s=i.crossesNgTemplate?$d(e,t,r,[]):Lv(e,t,i,r);n.reset(s,zF),n.notifyOnChanges()}return!0}return!1}function Za(n,t,e){const r=re();r.firstCreatePass&&(Bv(r,new Pv(n,t,e),-1),2==(2&t)&&(r.staticViewQueries=!0)),Vv(r,C(),t)}function Zt(n,t,e,r){const i=re();if(i.firstCreatePass){const s=qe();Bv(i,new Pv(t,e,r),s.index),function kR(n,t){const e=n.contentQueries||(n.contentQueries=[]);t!==(e.length?e[e.length-1]:-1)&&e.push(n.queries.length-1,t)}(i,n),2==(2&e)&&(i.staticContentQueries=!0)}Vv(i,C(),e)}function yt(){return function NR(n,t){return n[19].queries[t].queryList}(C(),yg())}function Vv(n,t,e){const r=new Vd(4==(4&e));ry(n,t,r,r.destroy),null===t[19]&&(t[19]=new Hd),t[19].queries.push(new jd(r))}function Bv(n,t,e){null===n.queries&&(n.queries=new Ud),n.queries.track(new Gd(t,e))}function jv(n,t){return n.queries.getByIndex(t)}function Hv(n,t){return Ya(n,t)}function el(...n){}const tl=new F("Application Initializer");let os=(()=>{class n{constructor(e){this.appInits=e,this.resolve=el,this.reject=el,this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i})}runInitializers(){if(this.initialized)return;const e=[],r=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i<this.appInits.length;i++){const s=this.appInits[i]();if(oo(s))e.push(s);else if(Cd(s)){const o=new Promise((a,l)=>{s.subscribe({complete:a,error:l})});e.push(o)}}Promise.all(e).then(()=>{r()}).catch(i=>{this.reject(i)}),0===e.length&&r(),this.initialized=!0}}return n.\u0275fac=function(e){return new(e||n)(D(tl,8))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const _o=new F("AppId"),JR={provide:_o,useFactory:function XR(){return`${Yd()}${Yd()}${Yd()}`},deps:[]};function Yd(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const iC=new F("Platform Initializer"),Xt=new F("Platform ID"),Zd=new F("appBootstrapListener");let sC=(()=>{class n{log(e){console.log(e)}warn(e){console.warn(e)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const Xn=new F("LocaleId"),oC=new F("DefaultCurrencyCode");class eO{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}let nl=(()=>{class n{compileModuleSync(e){return new Pd(e)}compileModuleAsync(e){return Promise.resolve(this.compileModuleSync(e))}compileModuleAndAllComponentsSync(e){const r=this.compileModuleSync(e),s=Sn(qt(e).declarations).reduce((o,a)=>{const l=rt(a);return l&&o.push(new kd(l)),o},[]);return new eO(r,s)}compileModuleAndAllComponentsAsync(e){return Promise.resolve(this.compileModuleAndAllComponentsSync(e))}clearCache(){}clearCacheFor(e){}getModuleId(e){}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const nO=(()=>Promise.resolve(0))();function Xd(n){"undefined"==typeof Zone?nO.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class ce{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new we(!1),this.onMicrotaskEmpty=new we(!1),this.onStable=new we(!1),this.onError=new we(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!r&&e,i.shouldCoalesceRunChangeDetection=r,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function rO(){let n=ue.requestAnimationFrame,t=ue.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&t){const e=n[Zone.__symbol__("OriginalDelegate")];e&&(n=e);const r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function oO(n){const t=()=>{!function sO(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(ue,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,ef(n),n.isCheckStableRunning=!0,Jd(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),ef(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(e,r,i,s,o,a)=>{try{return aC(n),e.invokeTask(i,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&t(),lC(n)}},onInvoke:(e,r,i,s,o,a,l)=>{try{return aC(n),e.invoke(i,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&t(),lC(n)}},onHasTask:(e,r,i,s)=>{e.hasTask(i,s),r===i&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,ef(n),Jd(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(e,r,i,s)=>(e.handleError(i,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(i)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!ce.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(ce.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,r){return this._inner.run(t,e,r)}runTask(t,e,r,i){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+i,t,iO,el,el);try{return s.runTask(o,e,r)}finally{s.cancelTask(o)}}runGuarded(t,e,r){return this._inner.runGuarded(t,e,r)}runOutsideAngular(t){return this._outer.run(t)}}const iO={};function Jd(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function ef(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function aC(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function lC(n){n._nesting--,Jd(n)}class aO{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new we,this.onMicrotaskEmpty=new we,this.onStable=new we,this.onError=new we}run(t,e,r){return t.apply(e,r)}runGuarded(t,e,r){return t.apply(e,r)}runOutsideAngular(t){return t()}runTask(t,e,r,i){return t.apply(e,r)}}let tf=(()=>{class n{constructor(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),e.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{ce.assertNotInAngularZone(),Xd(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Xd(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(this._didWork)}this._didWork=!1});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(e)||(clearTimeout(r.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,r,i){let s=-1;r&&r>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),e(this._didWork,this.getPendingTasks())},r)),this._callbacks.push({doneCb:e,timeoutId:s,updateCb:i})}whenStable(e,r,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(e,r,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(e,r,i){return[]}}return n.\u0275fac=function(e){return new(e||n)(D(ce))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})(),uC=(()=>{class n{constructor(){this._applications=new Map,nf.addToWindow(this)}registerApplication(e,r){this._applications.set(e,r)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,r=!0){return nf.findTestabilityInTree(this,e,r)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();class lO{addToWindow(t){}findTestabilityInTree(t,e,r){return null}}let _n,nf=new lO;const cC=new F("AllowMultipleToken");class dC{constructor(t,e){this.name=t,this.token=e}}function fC(n,t,e=[]){const r=`Platform: ${t}`,i=new F(r);return(s=[])=>{let o=hC();if(!o||o.injector.get(cC,!1))if(n)n(e.concat(s).concat({provide:i,useValue:!0}));else{const a=e.concat(s).concat({provide:i,useValue:!0},{provide:ad,useValue:"platform"});!function fO(n){if(_n&&!_n.destroyed&&!_n.injector.get(cC,!1))throw new ne(400,"");_n=n.get(pC);const t=n.get(iC,null);t&&t.forEach(e=>e())}(Je.create({providers:a,name:r}))}return function hO(n){const t=hC();if(!t)throw new ne(401,"");return t}()}}function hC(){return _n&&!_n.destroyed?_n:null}let pC=(()=>{class n{constructor(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(e,r){const a=function pO(n,t){let e;return e="noop"===n?new aO:("zone.js"===n?void 0:n)||new ce({enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:!!(null==t?void 0:t.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==t?void 0:t.ngZoneRunCoalescing)}),e}(r?r.ngZone:void 0,{ngZoneEventCoalescing:r&&r.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:r&&r.ngZoneRunCoalescing||!1}),l=[{provide:ce,useValue:a}];return a.run(()=>{const u=Je.create({providers:l,parent:this.injector,name:e.moduleType.name}),c=e.create(u),d=c.injector.get(zn,null);if(!d)throw new ne(402,"");return a.runOutsideAngular(()=>{const f=a.onError.subscribe({next:h=>{d.handleError(h)}});c.onDestroy(()=>{rf(this._modules,c),f.unsubscribe()})}),function gO(n,t,e){try{const r=e();return oo(r)?r.catch(i=>{throw t.runOutsideAngular(()=>n.handleError(i)),i}):r}catch(r){throw t.runOutsideAngular(()=>n.handleError(r)),r}}(d,a,()=>{const f=c.injector.get(os);return f.runInitializers(),f.donePromise.then(()=>(function WI(n){Mt(n,"Expected localeId to be defined"),"string"==typeof n&&(K_=n.toLowerCase().replace(/_/g,"-"))}(c.injector.get(Xn,$a)||$a),this._moduleDoBootstrap(c),c))})})}bootstrapModule(e,r=[]){const i=gC({},r);return function cO(n,t,e){const r=new Pd(e);return Promise.resolve(r)}(0,0,e).then(s=>this.bootstrapModuleFactory(s,i))}_moduleDoBootstrap(e){const r=e.injector.get(vo);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!e.instance.ngDoBootstrap)throw new ne(403,"");e.instance.ngDoBootstrap(r)}this._modules.push(e)}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new ne(404,"");this._modules.slice().forEach(e=>e.destroy()),this._destroyListeners.forEach(e=>e()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(e){return new(e||n)(D(Je))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();function gC(n,t){return Array.isArray(t)?t.reduce(gC,n):Object.assign(Object.assign({},n),t)}let vo=(()=>{class n{constructor(e,r,i,s,o){this._zone=e,this._injector=r,this._exceptionHandler=i,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new de(u=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{u.next(this._stable),u.complete()})}),l=new de(u=>{let c;this._zone.runOutsideAngular(()=>{c=this._zone.onStable.subscribe(()=>{ce.assertNotInAngularZone(),Xd(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,u.next(!0))})})});const d=this._zone.onUnstable.subscribe(()=>{ce.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{u.next(!1)}))});return()=>{c.unsubscribe(),d.unsubscribe()}});this.isStable=ta(a,l.pipe(Wp()))}bootstrap(e,r){if(!this._initStatus.done)throw new ne(405,"");let i;i=e instanceof vv?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(i.componentType);const s=function dO(n){return n.isBoundToModule}(i)?void 0:this._injector.get(Yn),a=i.create(Je.NULL,[],r||i.selector,s),l=a.location.nativeElement,u=a.injector.get(tf,null),c=u&&a.injector.get(uC);return u&&c&&c.registerApplication(l,u),a.onDestroy(()=>{this.detachView(a.hostView),rf(this.components,a),c&&c.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new ne(101,"");try{this._runningTick=!0;for(let e of this._views)e.detectChanges()}catch(e){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(e))}finally{this._runningTick=!1}}attachView(e){const r=e;this._views.push(r),r.attachToAppRef(this)}detachView(e){const r=e;rf(this._views,r),r.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(Zd,[]).concat(this._bootstrapListeners).forEach(i=>i(e))}ngOnDestroy(){this._views.slice().forEach(e=>e.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(e){return new(e||n)(D(ce),D(Je),D(zn),D(ns),D(os))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();function rf(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}let yC=!0,rl=(()=>{class n{}return n.__NG_ELEMENT_ID__=_O,n})();function _O(n){return function vO(n,t,e){if(la(n)&&!e){const r=Tt(n.index,t);return new po(r,r)}return 47&n.type?new po(t[16],t):null}(qe(),C(),16==(16&n))}class wC{constructor(){}supports(t){return ro(t)}create(t){return new xO(t)}}const wO=(n,t)=>t;class xO{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||wO}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,r=this._removalsHead,i=0,s=null;for(;e||r;){const o=!r||e&&e.currentIndex<AC(r,i,s)?e:r,a=AC(o,i,s),l=o.currentIndex;if(o===r)i--,r=r._nextRemoved;else if(e=e._next,null==o.previousIndex)i++;else{s||(s=[]);const u=a-i,c=l-i;if(u!=c){for(let f=0;f<u;f++){const h=f<s.length?s[f]:s[f]=0,g=h+f;c<=g&&g<u&&(s[f]=h+1)}s[o.previousIndex]=c-u}}a!==l&&t(o,a,l)}}forEachPreviousItem(t){let e;for(e=this._previousItHead;null!==e;e=e._nextPrevious)t(e)}forEachAddedItem(t){let e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)}forEachMovedItem(t){let e;for(e=this._movesHead;null!==e;e=e._nextMoved)t(e)}forEachRemovedItem(t){let e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)}forEachIdentityChange(t){let e;for(e=this._identityChangesHead;null!==e;e=e._nextIdentityChange)t(e)}diff(t){if(null==t&&(t=[]),!ro(t))throw new ne(900,"");return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let i,s,o,e=this._itHead,r=!1;if(Array.isArray(t)){this.length=t.length;for(let a=0;a<this.length;a++)s=t[a],o=this._trackByFn(a,s),null!==e&&Object.is(e.trackById,o)?(r&&(e=this._verifyReinsertion(e,s,o,a)),Object.is(e.item,s)||this._addIdentityChange(e,s)):(e=this._mismatch(e,s,o,a),r=!0),e=e._next}else i=0,function RT(n,t){if(Array.isArray(n))for(let e=0;e<n.length;e++)t(n[e]);else{const e=n[Ui()]();let r;for(;!(r=e.next()).done;)t(r.value)}}(t,a=>{o=this._trackByFn(i,a),null!==e&&Object.is(e.trackById,o)?(r&&(e=this._verifyReinsertion(e,a,o,i)),Object.is(e.item,a)||this._addIdentityChange(e,a)):(e=this._mismatch(e,a,o,i),r=!0),e=e._next,i++}),this.length=i;return this._truncate(e),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,r,i){let s;return null===t?s=this._itTail:(s=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,s,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,s,i)):t=this._addAfter(new AO(e,r),s,i),t}_verifyReinsertion(t,e,r,i){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==s?t=this._reinsertAfter(s,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,s=t._nextRemoved;return null===i?this._removalsHead=s:i._nextRemoved=s,null===s?this._removalsTail=i:s._prevRemoved=i,this._insertAfter(t,e,r),this._addToMoves(t,r),t}_moveAfter(t,e,r){return this._unlink(t),this._insertAfter(t,e,r),this._addToMoves(t,r),t}_addAfter(t,e,r){return this._insertAfter(t,e,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,r){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new xC),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,r=t._next;return null===e?this._itHead=r:e._next=r,null===r?this._itTail=e:r._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new xC),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class AO{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class MO{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===e||e<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const e=t._prevDup,r=t._nextDup;return null===e?this._head=r:e._nextDup=r,null===r?this._tail=e:r._prevDup=e,null===this._head}}class xC{constructor(){this.map=new Map}put(t){const e=t.trackById;let r=this.map.get(e);r||(r=new MO,this.map.set(e,r)),r.add(t)}get(t,e){const i=this.map.get(t);return i?i.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function AC(n,t,e){const r=n.previousIndex;if(null===r)return r;let i=0;return e&&r<e.length&&(i=e[r]),r+t+i}class MC{constructor(){}supports(t){return t instanceof Map||hd(t)}create(){return new SO}}class SO{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(t){let e;for(e=this._mapHead;null!==e;e=e._next)t(e)}forEachPreviousItem(t){let e;for(e=this._previousMapHead;null!==e;e=e._nextPrevious)t(e)}forEachChangedItem(t){let e;for(e=this._changesHead;null!==e;e=e._nextChanged)t(e)}forEachAddedItem(t){let e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)}forEachRemovedItem(t){let e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)}diff(t){if(t){if(!(t instanceof Map||hd(t)))throw new ne(900,"")}else t=new Map;return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let e=this._mapHead;if(this._appendAfter=null,this._forEach(t,(r,i)=>{if(e&&e.key===i)this._maybeAddToChanges(e,r),this._appendAfter=e,e=e._next;else{const s=this._getOrCreateRecordForKey(i,r);e=this._insertBeforeOrAppend(e,s)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let r=e;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const r=t._prev;return e._next=t,e._prev=r,t._prev=e,r&&(r._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const i=this._records.get(t);this._maybeAddToChanges(i,e);const s=i._prev,o=i._next;return s&&(s._next=o),o&&(o._prev=s),i._next=null,i._prev=null,i}const r=new TO(t);return this._records.set(t,r),r.currentValue=e,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(r=>e(t[r],r))}}class TO{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function SC(){return new as([new wC])}let as=(()=>{class n{constructor(e){this.factories=e}static create(e,r){if(null!=r){const i=r.factories.slice();e=e.concat(i)}return new n(e)}static extend(e){return{provide:n,useFactory:r=>n.create(e,r||SC()),deps:[[n,new $r,new Ft]]}}find(e){const r=this.factories.find(i=>i.supports(e));if(null!=r)return r;throw new ne(901,"")}}return n.\u0275prov=w({token:n,providedIn:"root",factory:SC}),n})();function TC(){return new Dr([new MC])}let Dr=(()=>{class n{constructor(e){this.factories=e}static create(e,r){if(r){const i=r.factories.slice();e=e.concat(i)}return new n(e)}static extend(e){return{provide:n,useFactory:r=>n.create(e,r||TC()),deps:[[n,new $r,new Ft]]}}find(e){const r=this.factories.find(s=>s.supports(e));if(r)return r;throw new ne(901,"")}}return n.\u0275prov=w({token:n,providedIn:"root",factory:TC}),n})();const IO=[new MC],RO=new as([new wC]),OO=new Dr(IO),NO=fC(null,"core",[{provide:Xt,useValue:"unknown"},{provide:pC,deps:[Je]},{provide:uC,deps:[]},{provide:sC,deps:[]}]),BO=[{provide:vo,useClass:vo,deps:[ce,Je,zn,ns,os]},{provide:JF,deps:[ce],useFactory:function jO(n){let t=[];return n.onStable.subscribe(()=>{for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:os,useClass:os,deps:[[new Ft,tl]]},{provide:nl,useClass:nl,deps:[]},JR,{provide:as,useFactory:function kO(){return RO},deps:[]},{provide:Dr,useFactory:function PO(){return OO},deps:[]},{provide:Xn,useFactory:function LO(n){return n||function VO(){return"undefined"!=typeof $localize&&$localize.locale||$a}()},deps:[[new zs(Xn),new Ft,new $r]]},{provide:oC,useValue:"USD"}];let HO=(()=>{class n{constructor(e){}}return n.\u0275fac=function(e){return new(e||n)(D(vo))},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({providers:BO}),n})(),sl=null;function Nn(){return sl}const ye=new F("DocumentToken");let Zr=(()=>{class n{historyGo(e){throw new Error("Not implemented")}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:function(){return function qO(){return D(IC)}()},providedIn:"platform"}),n})();const zO=new F("Location Initialized");let IC=(()=>{class n extends Zr{constructor(e){super(),this._doc=e,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Nn().getBaseHref(this._doc)}onPopState(e){const r=Nn().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",e,!1),()=>r.removeEventListener("popstate",e)}onHashChange(e){const r=Nn().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",e,!1),()=>r.removeEventListener("hashchange",e)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(e){this.location.pathname=e}pushState(e,r,i){FC()?this._history.pushState(e,r,i):this.location.hash=i}replaceState(e,r,i){FC()?this._history.replaceState(e,r,i):this.location.hash=i}forward(){this._history.forward()}back(){this._history.back()}historyGo(e=0){this._history.go(e)}getState(){return this._history.state}}return n.\u0275fac=function(e){return new(e||n)(D(ye))},n.\u0275prov=w({token:n,factory:function(){return function WO(){return new IC(D(ye))}()},providedIn:"platform"}),n})();function FC(){return!!window.history.pushState}function cf(n,t){if(0==n.length)return t;if(0==t.length)return n;let e=0;return n.endsWith("/")&&e++,t.startsWith("/")&&e++,2==e?n+t.substring(1):1==e?n+t:n+"/"+t}function RC(n){const t=n.match(/#|\?|$/),e=t&&t.index||n.length;return n.slice(0,e-("/"===n[e-1]?1:0))+n.slice(e)}function Jn(n){return n&&"?"!==n[0]?"?"+n:n}let ls=(()=>{class n{historyGo(e){throw new Error("Not implemented")}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:function(){return function KO(n){const t=D(ye).location;return new OC(D(Zr),t&&t.origin||"")}()},providedIn:"root"}),n})();const df=new F("appBaseHref");let OC=(()=>{class n extends ls{constructor(e,r){if(super(),this._platformLocation=e,this._removeListenerFns=[],null==r&&(r=this._platformLocation.getBaseHrefFromDOM()),null==r)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=r}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return cf(this._baseHref,e)}path(e=!1){const r=this._platformLocation.pathname+Jn(this._platformLocation.search),i=this._platformLocation.hash;return i&&e?`${r}${i}`:r}pushState(e,r,i,s){const o=this.prepareExternalUrl(i+Jn(s));this._platformLocation.pushState(e,r,o)}replaceState(e,r,i,s){const o=this.prepareExternalUrl(i+Jn(s));this._platformLocation.replaceState(e,r,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(e=0){var r,i;null===(i=(r=this._platformLocation).historyGo)||void 0===i||i.call(r,e)}}return n.\u0275fac=function(e){return new(e||n)(D(Zr),D(df,8))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})(),QO=(()=>{class n extends ls{constructor(e,r){super(),this._platformLocation=e,this._baseHref="",this._removeListenerFns=[],null!=r&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}path(e=!1){let r=this._platformLocation.hash;return null==r&&(r="#"),r.length>0?r.substring(1):r}prepareExternalUrl(e){const r=cf(this._baseHref,e);return r.length>0?"#"+r:r}pushState(e,r,i,s){let o=this.prepareExternalUrl(i+Jn(s));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.pushState(e,r,o)}replaceState(e,r,i,s){let o=this.prepareExternalUrl(i+Jn(s));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.replaceState(e,r,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(e=0){var r,i;null===(i=(r=this._platformLocation).historyGo)||void 0===i||i.call(r,e)}}return n.\u0275fac=function(e){return new(e||n)(D(Zr),D(df,8))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})(),ff=(()=>{class n{constructor(e,r){this._subject=new we,this._urlChangeListeners=[],this._platformStrategy=e;const i=this._platformStrategy.getBaseHref();this._platformLocation=r,this._baseHref=RC(NC(i)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(e=!1){return this.normalize(this._platformStrategy.path(e))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(e,r=""){return this.path()==this.normalize(e+Jn(r))}normalize(e){return n.stripTrailingSlash(function ZO(n,t){return n&&t.startsWith(n)?t.substring(n.length):t}(this._baseHref,NC(e)))}prepareExternalUrl(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)}go(e,r="",i=null){this._platformStrategy.pushState(i,"",e,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+Jn(r)),i)}replaceState(e,r="",i=null){this._platformStrategy.replaceState(i,"",e,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+Jn(r)),i)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(e=0){var r,i;null===(i=(r=this._platformStrategy).historyGo)||void 0===i||i.call(r,e)}onUrlChange(e){this._urlChangeListeners.push(e),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}))}_notifyUrlChangeListeners(e="",r){this._urlChangeListeners.forEach(i=>i(e,r))}subscribe(e,r,i){return this._subject.subscribe({next:e,error:r,complete:i})}}return n.normalizeQueryParams=Jn,n.joinWithSlash=cf,n.stripTrailingSlash=RC,n.\u0275fac=function(e){return new(e||n)(D(ls),D(Zr))},n.\u0275prov=w({token:n,factory:function(){return function YO(){return new ff(D(ls),D(Zr))}()},providedIn:"root"}),n})();function NC(n){return n.replace(/\/index.html$/,"")}var He=(()=>((He=He||{})[He.Zero=0]="Zero",He[He.One=1]="One",He[He.Two=2]="Two",He[He.Few=3]="Few",He[He.Many=4]="Many",He[He.Other=5]="Other",He))();const iN=function z_(n){return function gt(n){const t=function GI(n){return n.toLowerCase().replace(/_/g,"-")}(n);let e=W_(t);if(e)return e;const r=t.split("-")[0];if(e=W_(r),e)return e;if("en"===r)return UI;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[S.PluralCase]};class gl{}let ON=(()=>{class n extends gl{constructor(e){super(),this.locale=e}getPluralCategory(e,r){switch(iN(r||this.locale)(e)){case He.Zero:return"zero";case He.One:return"one";case He.Two:return"two";case He.Few:return"few";case He.Many:return"many";default:return"other"}}}return n.\u0275fac=function(e){return new(e||n)(D(Xn))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();class PN{constructor(t,e,r,i){this.$implicit=t,this.ngForOf=e,this.index=r,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let GC=(()=>{class n{constructor(e,r,i){this._viewContainer=e,this._template=r,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const e=this._ngForOf;!this._differ&&e&&(this._differ=this._differs.find(e).create(this.ngForTrackBy))}if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const r=this._viewContainer;e.forEachOperation((i,s,o)=>{if(null==i.previousIndex)r.createEmbeddedView(this._template,new PN(i.item,this._ngForOf,-1,-1),null===o?void 0:o);else if(null==o)r.remove(null===s?void 0:s);else if(null!==s){const a=r.get(s);r.move(a,o),$C(a,i)}});for(let i=0,s=r.length;i<s;i++){const a=r.get(i).context;a.index=i,a.count=s,a.ngForOf=this._ngForOf}e.forEachIdentityChange(i=>{$C(r.get(i.currentIndex),i)})}static ngTemplateContextGuard(e,r){return!0}}return n.\u0275fac=function(e){return new(e||n)(p(yn),p(Zn),p(as))},n.\u0275dir=b({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();function $C(n,t){n.context.$implicit=t.item}let Df=(()=>{class n{constructor(e,r){this._viewContainer=e,this._context=new LN,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=r}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){qC("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){qC("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(e,r){return!0}}return n.\u0275fac=function(e){return new(e||n)(p(yn),p(Zn))},n.\u0275dir=b({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class LN{constructor(){this.$implicit=null,this.ngIf=null}}function qC(n,t){if(t&&!t.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${le(t)}'.`)}class Ef{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let ml=(()=>{class n{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(e){this._ngSwitch=e,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(e)}_matchCase(e){const r=e==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||r,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),r}_updateDefaultCases(e){if(this._defaultViews&&e!==this._defaultUsed){this._defaultUsed=e;for(let r=0;r<this._defaultViews.length;r++)this._defaultViews[r].enforceState(e)}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275dir=b({type:n,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}}),n})(),zC=(()=>{class n{constructor(e,r,i){this.ngSwitch=i,i._addCase(),this._view=new Ef(e,r)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(e){return new(e||n)(p(yn),p(Zn),p(ml,9))},n.\u0275dir=b({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),QC=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({providers:[{provide:gl,useClass:ON}]}),n})();const YC="browser";function Xr(n){return n===YC}function us(n){return"server"===n}let dk=(()=>{class n{}return n.\u0275prov=w({token:n,providedIn:"root",factory:()=>new fk(D(ye),window)}),n})();class fk{constructor(t,e){this.document=t,this.window=e,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(!this.supportsScrolling())return;const e=function hk(n,t){const e=n.getElementById(t)||n.getElementsByName(t)[0];if(e)return e;if("function"==typeof n.createTreeWalker&&n.body&&(n.body.createShadowRoot||n.body.attachShadow)){const r=n.createTreeWalker(n.body,NodeFilter.SHOW_ELEMENT);let i=r.currentNode;for(;i;){const s=i.shadowRoot;if(s){const o=s.getElementById(t)||s.querySelector(`[name="${t}"]`);if(o)return o}i=r.nextNode()}}return null}(this.document,t);e&&(this.scrollToElement(e),this.attemptFocus(e))}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}}scrollToElement(t){const e=t.getBoundingClientRect(),r=e.left+this.window.pageXOffset,i=e.top+this.window.pageYOffset,s=this.offset();this.window.scrollTo(r-s[0],i-s[1])}attemptFocus(t){return t.focus(),this.document.activeElement===t}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=ZC(this.window.history)||ZC(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch(t){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(t){return!1}}}function ZC(n){return Object.getOwnPropertyDescriptor(n,"scrollRestoration")}class Mf extends class gk extends class $O{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function GO(n){sl||(sl=n)}(new Mf)}onAndCancel(t,e,r){return t.addEventListener(e,r,!1),()=>{t.removeEventListener(e,r,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getBaseHref(t){const e=function mk(){return Do=Do||document.querySelector("base"),Do?Do.getAttribute("href"):null}();return null==e?null:function yk(n){yl=yl||document.createElement("a"),yl.setAttribute("href",n);const t=yl.pathname;return"/"===t.charAt(0)?t:`/${t}`}(e)}resetBaseElement(){Do=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function NN(n,t){t=encodeURIComponent(t);for(const e of n.split(";")){const r=e.indexOf("="),[i,s]=-1==r?[e,""]:[e.slice(0,r),e.slice(r+1)];if(i.trim()===t)return decodeURIComponent(s)}return null}(document.cookie,t)}}let yl,Do=null;const XC=new F("TRANSITION_ID"),vk=[{provide:tl,useFactory:function _k(n,t,e){return()=>{e.get(os).donePromise.then(()=>{const r=Nn(),i=t.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s<i.length;s++)r.remove(i[s])})}},deps:[XC,ye,Je],multi:!0}];class Sf{static init(){!function uO(n){nf=n}(new Sf)}addToWindow(t){ue.getAngularTestability=(r,i=!0)=>{const s=t.findTestabilityInTree(r,i);if(null==s)throw new Error("Could not find testability for element.");return s},ue.getAllAngularTestabilities=()=>t.getAllTestabilities(),ue.getAllAngularRootElements=()=>t.getAllRootElements(),ue.frameworkStabilizers||(ue.frameworkStabilizers=[]),ue.frameworkStabilizers.push(r=>{const i=ue.getAllAngularTestabilities();let s=i.length,o=!1;const a=function(l){o=o||l,s--,0==s&&r(o)};i.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(t,e,r){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:r?Nn().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}let Ck=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const _l=new F("EventManagerPlugins");let vl=(()=>{class n{constructor(e,r){this._zone=r,this._eventNameToPlugin=new Map,e.forEach(i=>i.manager=this),this._plugins=e.slice().reverse()}addEventListener(e,r,i){return this._findPluginFor(r).addEventListener(e,r,i)}addGlobalEventListener(e,r,i){return this._findPluginFor(r).addGlobalEventListener(e,r,i)}getZone(){return this._zone}_findPluginFor(e){const r=this._eventNameToPlugin.get(e);if(r)return r;const i=this._plugins;for(let s=0;s<i.length;s++){const o=i[s];if(o.supports(e))return this._eventNameToPlugin.set(e,o),o}throw new Error(`No event manager plugin found for event ${e}`)}}return n.\u0275fac=function(e){return new(e||n)(D(_l),D(ce))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();class JC{constructor(t){this._doc=t}addGlobalEventListener(t,e,r){const i=Nn().getGlobalEventTarget(this._doc,t);if(!i)throw new Error(`Unsupported event target ${i} for event ${e}`);return this.addEventListener(i,e,r)}}let eb=(()=>{class n{constructor(){this._stylesSet=new Set}addStyles(e){const r=new Set;e.forEach(i=>{this._stylesSet.has(i)||(this._stylesSet.add(i),r.add(i))}),this.onStylesAdded(r)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})(),Eo=(()=>{class n extends eb{constructor(e){super(),this._doc=e,this._hostNodes=new Map,this._hostNodes.set(e.head,[])}_addStylesToHost(e,r,i){e.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,i.push(r.appendChild(o))})}addHost(e){const r=[];this._addStylesToHost(this._stylesSet,e,r),this._hostNodes.set(e,r)}removeHost(e){const r=this._hostNodes.get(e);r&&r.forEach(tb),this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach((r,i)=>{this._addStylesToHost(e,i,r)})}ngOnDestroy(){this._hostNodes.forEach(e=>e.forEach(tb))}}return n.\u0275fac=function(e){return new(e||n)(D(ye))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();function tb(n){Nn().remove(n)}const Tf={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},If=/%COMP%/g;function Cl(n,t,e){for(let r=0;r<t.length;r++){let i=t[r];Array.isArray(i)?Cl(n,i,e):(i=i.replace(If,n),e.push(i))}return e}function ib(n){return t=>{if("__ngUnwrap__"===t)return n;!1===n(t)&&(t.preventDefault(),t.returnValue=!1)}}let bl=(()=>{class n{constructor(e,r,i){this.eventManager=e,this.sharedStylesHost=r,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new Ff(e)}createRenderer(e,r){if(!e||!r)return this.defaultRenderer;switch(r.encapsulation){case an.Emulated:{let i=this.rendererByCompId.get(r.id);return i||(i=new Ak(this.eventManager,this.sharedStylesHost,r,this.appId),this.rendererByCompId.set(r.id,i)),i.applyToHost(e),i}case 1:case an.ShadowDom:return new Mk(this.eventManager,this.sharedStylesHost,e,r);default:if(!this.rendererByCompId.has(r.id)){const i=Cl(r.id,r.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(r.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(e){return new(e||n)(D(vl),D(Eo),D(_o))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();class Ff{constructor(t){this.eventManager=t,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(t,e){return e?document.createElementNS(Tf[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,r){t&&t.insertBefore(e,r)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let r="string"==typeof t?document.querySelector(t):t;if(!r)throw new Error(`The selector "${t}" did not match any elements`);return e||(r.textContent=""),r}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,r,i){if(i){e=i+":"+e;const s=Tf[i];s?t.setAttributeNS(s,e,r):t.setAttribute(e,r)}else t.setAttribute(e,r)}removeAttribute(t,e,r){if(r){const i=Tf[r];i?t.removeAttributeNS(i,e):t.removeAttribute(`${r}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,r,i){i&(Ot.DashCase|Ot.Important)?t.style.setProperty(e,r,i&Ot.Important?"important":""):t.style[e]=r}removeStyle(t,e,r){r&Ot.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,r){t[e]=r}setValue(t,e){t.nodeValue=e}listen(t,e,r){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,ib(r)):this.eventManager.addEventListener(t,e,ib(r))}}class Ak extends Ff{constructor(t,e,r,i){super(t),this.component=r;const s=Cl(i+"-"+r.id,r.styles,[]);e.addStyles(s),this.contentAttr=function Ek(n){return"_ngcontent-%COMP%".replace(If,n)}(i+"-"+r.id),this.hostAttr=function wk(n){return"_nghost-%COMP%".replace(If,n)}(i+"-"+r.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const r=super.createElement(t,e);return super.setAttribute(r,this.contentAttr,""),r}}class Mk extends Ff{constructor(t,e,r,i){super(t),this.sharedStylesHost=e,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=Cl(i.id,i.styles,[]);for(let o=0;o<s.length;o++){const a=document.createElement("style");a.textContent=s[o],this.shadowRoot.appendChild(a)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,r){return super.insertBefore(this.nodeOrShadowRoot(t),e,r)}removeChild(t,e){return super.removeChild(this.nodeOrShadowRoot(t),e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}}let Sk=(()=>{class n extends JC{constructor(e){super(e)}supports(e){return!0}addEventListener(e,r,i){return e.addEventListener(r,i,!1),()=>this.removeEventListener(e,r,i)}removeEventListener(e,r,i){return e.removeEventListener(r,i)}}return n.\u0275fac=function(e){return new(e||n)(D(ye))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const ob=["alt","control","meta","shift"],Ik={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},ab={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},Fk={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Rk=(()=>{class n extends JC{constructor(e){super(e)}supports(e){return null!=n.parseEventName(e)}addEventListener(e,r,i){const s=n.parseEventName(r),o=n.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Nn().onAndCancel(e,s.domEventName,o))}static parseEventName(e){const r=e.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const s=n._normalizeKey(r.pop());let o="";if(ob.forEach(l=>{const u=r.indexOf(l);u>-1&&(r.splice(u,1),o+=l+".")}),o+=s,0!=r.length||0===s.length)return null;const a={};return a.domEventName=i,a.fullKey=o,a}static getEventFullKey(e){let r="",i=function Ok(n){let t=n.key;if(null==t){if(t=n.keyIdentifier,null==t)return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===n.location&&ab.hasOwnProperty(t)&&(t=ab[t]))}return Ik[t]||t}(e);return i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),ob.forEach(s=>{s!=i&&Fk[s](e)&&(r+=s+".")}),r+=i,r}static eventCallback(e,r,i){return s=>{n.getEventFullKey(s)===e&&i.runGuarded(()=>r(s))}}static _normalizeKey(e){return"esc"===e?"escape":e}}return n.\u0275fac=function(e){return new(e||n)(D(ye))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const Lk=fC(NO,"browser",[{provide:Xt,useValue:YC},{provide:iC,useValue:function Nk(){Mf.makeCurrent(),Sf.init()},multi:!0},{provide:ye,useFactory:function Pk(){return function UA(n){Wu=n}(document),document},deps:[]}]),Vk=[{provide:ad,useValue:"root"},{provide:zn,useFactory:function kk(){return new zn},deps:[]},{provide:_l,useClass:Sk,multi:!0,deps:[ye,ce,Xt]},{provide:_l,useClass:Rk,multi:!0,deps:[ye]},{provide:bl,useClass:bl,deps:[vl,Eo,_o]},{provide:ho,useExisting:bl},{provide:eb,useExisting:Eo},{provide:Eo,useClass:Eo,deps:[ye]},{provide:tf,useClass:tf,deps:[ce]},{provide:vl,useClass:vl,deps:[_l,ce]},{provide:class pk{},useClass:Ck,deps:[]}];let lb=(()=>{class n{constructor(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:n,providers:[{provide:_o,useValue:e.appId},{provide:XC,useExisting:_o},vk]}}}return n.\u0275fac=function(e){return new(e||n)(D(n,12))},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({providers:Vk,imports:[QC,HO]}),n})();"undefined"!=typeof window&&window;let Dl=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:function(e){let r=null;return r=e?new(e||n):D(db),r},providedIn:"root"}),n})(),db=(()=>{class n extends Dl{constructor(e){super(),this._doc=e}sanitize(e,r){if(null==r)return null;switch(e){case ae.NONE:return r;case ae.HTML:return An(r,"HTML")?Rt(r):sm(this._doc,String(r)).toString();case ae.STYLE:return An(r,"Style")?Rt(r):r;case ae.SCRIPT:if(An(r,"Script"))return Rt(r);throw new Error("unsafe value used in a script context");case ae.URL:return Zg(r),An(r,"URL")?Rt(r):Ks(String(r));case ae.RESOURCE_URL:if(An(r,"ResourceURL"))return Rt(r);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(e){return function n0(n){return new ZM(n)}(e)}bypassSecurityTrustStyle(e){return function r0(n){return new XM(n)}(e)}bypassSecurityTrustScript(e){return function s0(n){return new JM(n)}(e)}bypassSecurityTrustUrl(e){return function o0(n){return new e0(n)}(e)}bypassSecurityTrustResourceUrl(e){return function a0(n){return new t0(n)}(e)}}return n.\u0275fac=function(e){return new(e||n)(D(ye))},n.\u0275prov=w({token:n,factory:function(e){let r=null;return r=e?new e:function Kk(n){return new db(n.get(ye))}(D(Je)),r},providedIn:"root"}),n})();function B(...n){return Qe(n,Ss(n))}class tn extends Xe{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return!e.closed&&t.next(this._value),e}getValue(){const{hasError:t,thrownError:e,_value:r}=this;if(t)throw e;return this._throwIfClosed(),r}next(t){super.next(this._value=t)}}const{isArray:Qk}=Array,{getPrototypeOf:Yk,prototype:Zk,keys:Xk}=Object;function fb(n){if(1===n.length){const t=n[0];if(Qk(t))return{args:t,keys:null};if(function Jk(n){return n&&"object"==typeof n&&Yk(n)===Zk}(t)){const e=Xk(t);return{args:e.map(r=>t[r]),keys:e}}}return{args:n,keys:null}}const{isArray:eP}=Array;function Of(n){return ee(t=>function tP(n,t){return eP(t)?n(...t):n(t)}(n,t))}function hb(n,t){return n.reduce((e,r,i)=>(e[r]=t[i],e),{})}function pb(n,t,e){n?Hn(e,n,t):t()}const El=xs(n=>function(){n(this),this.name="EmptyError",this.message="no elements in sequence"});function Nf(...n){return function iP(){return Ms(1)}()(Qe(n,Ss(n)))}function gb(n){return new de(t=>{$t(n()).subscribe(t)})}function mb(){return Ge((n,t)=>{let e=null;n._refCount++;const r=new Le(t,void 0,void 0,void 0,()=>{if(!n||n._refCount<=0||0<--n._refCount)return void(e=null);const i=n._connection,s=e;e=null,i&&(!s||i===s)&&i.unsubscribe(),t.unsubscribe()});n.subscribe(r),r.closed||(e=n.connect())})}class sP extends de{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._subject=null,this._refCount=0,this._connection=null,Ip(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,null==t||t.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new bt;const e=this.getSubject();t.add(this.source.subscribe(new Le(e,void 0,()=>{this._teardown(),e.complete()},r=>{this._teardown(),e.error(r)},()=>this._teardown()))),t.closed&&(this._connection=null,t=bt.EMPTY)}return t}refCount(){return mb()(this)}}function Jr(n,t){return Ge((e,r)=>{let i=null,s=0,o=!1;const a=()=>o&&!i&&r.complete();e.subscribe(new Le(r,l=>{null==i||i.unsubscribe();let u=0;const c=s++;$t(n(l,c)).subscribe(i=new Le(r,d=>r.next(t?t(l,d,c,u++):d),()=>{i=null,a()}))},()=>{o=!0,a()}))})}function wl(...n){const t=Ss(n);return Ge((e,r)=>{(t?Nf(n,e,t):Nf(n,e)).subscribe(r)})}function oP(n,t,e,r,i){return(s,o)=>{let a=e,l=t,u=0;s.subscribe(new Le(o,c=>{const d=u++;l=a?n(l,c,d):(a=!0,c),r&&o.next(l)},i&&(()=>{a&&o.next(l),o.complete()})))}}function yb(n,t){return Ge(oP(n,t,arguments.length>=2,!0))}function kn(n,t){return Ge((e,r)=>{let i=0;e.subscribe(new Le(r,s=>n.call(t,s,i++)&&r.next(s)))})}function tr(n){return Ge((t,e)=>{let s,r=null,i=!1;r=t.subscribe(new Le(e,void 0,void 0,o=>{s=$t(n(o,tr(n)(t))),r?(r.unsubscribe(),r=null,s.subscribe(e)):i=!0})),i&&(r.unsubscribe(),r=null,s.subscribe(e))})}function cs(n,t){return se(t)?$e(n,t,1):$e(n,1)}function kf(n){return n<=0?()=>Dn:Ge((t,e)=>{let r=[];t.subscribe(new Le(e,i=>{r.push(i),n<r.length&&r.shift()},()=>{for(const i of r)e.next(i);e.complete()},void 0,()=>{r=null}))})}function _b(n=aP){return Ge((t,e)=>{let r=!1;t.subscribe(new Le(e,i=>{r=!0,e.next(i)},()=>r?e.complete():e.error(n())))})}function aP(){return new El}function vb(n){return Ge((t,e)=>{let r=!1;t.subscribe(new Le(e,i=>{r=!0,e.next(i)},()=>{r||e.next(n),e.complete()}))})}function ds(n,t){const e=arguments.length>=2;return r=>r.pipe(n?kn((i,s)=>n(i,s,r)):Pr,mi(1),e?vb(t):_b(()=>new El))}function et(n,t,e){const r=se(n)||t||e?{next:n,error:t,complete:e}:n;return r?Ge((i,s)=>{var o;null===(o=r.subscribe)||void 0===o||o.call(r);let a=!0;i.subscribe(new Le(s,l=>{var u;null===(u=r.next)||void 0===u||u.call(r,l),s.next(l)},()=>{var l;a=!1,null===(l=r.complete)||void 0===l||l.call(r),s.complete()},l=>{var u;a=!1,null===(u=r.error)||void 0===u||u.call(r,l),s.error(l)},()=>{var l,u;a&&(null===(l=r.unsubscribe)||void 0===l||l.call(r)),null===(u=r.finalize)||void 0===u||u.call(r)}))}):Pr}function Cb(n){return Ge((t,e)=>{try{t.subscribe(e)}finally{e.add(n)}})}class nr{constructor(t,e){this.id=t,this.url=e}}class Pf extends nr{constructor(t,e,r="imperative",i=null){super(t,e),this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class wo extends nr{constructor(t,e,r){super(t,e),this.urlAfterRedirects=r}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class bb extends nr{constructor(t,e,r){super(t,e),this.reason=r}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class uP extends nr{constructor(t,e,r){super(t,e),this.error=r}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class cP extends nr{constructor(t,e,r,i){super(t,e),this.urlAfterRedirects=r,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class dP extends nr{constructor(t,e,r,i){super(t,e),this.urlAfterRedirects=r,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class fP extends nr{constructor(t,e,r,i,s){super(t,e),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=s}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class hP extends nr{constructor(t,e,r,i){super(t,e),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class pP extends nr{constructor(t,e,r,i){super(t,e),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Db{constructor(t){this.route=t}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Eb{constructor(t){this.route=t}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class gP{constructor(t){this.snapshot=t}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class mP{constructor(t){this.snapshot=t}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class yP{constructor(t){this.snapshot=t}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class _P{constructor(t){this.snapshot=t}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class wb{constructor(t,e,r){this.routerEvent=t,this.position=e,this.anchor=r}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const Y="primary";class vP{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function fs(n){return new vP(n)}const xb="ngNavigationCancelingError";function Lf(n){const t=Error("NavigationCancelingError: "+n);return t[xb]=!0,t}function bP(n,t,e){const r=e.path.split("/");if(r.length>n.length||"full"===e.pathMatch&&(t.hasChildren()||r.length<n.length))return null;const i={};for(let s=0;s<r.length;s++){const o=r[s],a=n[s];if(o.startsWith(":"))i[o.substring(1)]=a;else if(o!==a.path)return null}return{consumed:n.slice(0,r.length),posParams:i}}function Pn(n,t){const e=n?Object.keys(n):void 0,r=t?Object.keys(t):void 0;if(!e||!r||e.length!=r.length)return!1;let i;for(let s=0;s<e.length;s++)if(i=e[s],!Ab(n[i],t[i]))return!1;return!0}function Ab(n,t){if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return!1;const e=[...n].sort(),r=[...t].sort();return e.every((i,s)=>r[s]===i)}return n===t}function Mb(n){return Array.prototype.concat.apply([],n)}function Sb(n){return n.length>0?n[n.length-1]:null}function tt(n,t){for(const e in n)n.hasOwnProperty(e)&&t(n[e],e)}function Ln(n){return Cd(n)?n:oo(n)?Qe(Promise.resolve(n)):B(n)}const wP={exact:function Fb(n,t,e){if(!ti(n.segments,t.segments)||!xl(n.segments,t.segments,e)||n.numberOfChildren!==t.numberOfChildren)return!1;for(const r in t.children)if(!n.children[r]||!Fb(n.children[r],t.children[r],e))return!1;return!0},subset:Rb},Tb={exact:function xP(n,t){return Pn(n,t)},subset:function AP(n,t){return Object.keys(t).length<=Object.keys(n).length&&Object.keys(t).every(e=>Ab(n[e],t[e]))},ignored:()=>!0};function Ib(n,t,e){return wP[e.paths](n.root,t.root,e.matrixParams)&&Tb[e.queryParams](n.queryParams,t.queryParams)&&!("exact"===e.fragment&&n.fragment!==t.fragment)}function Rb(n,t,e){return Ob(n,t,t.segments,e)}function Ob(n,t,e,r){if(n.segments.length>e.length){const i=n.segments.slice(0,e.length);return!(!ti(i,e)||t.hasChildren()||!xl(i,e,r))}if(n.segments.length===e.length){if(!ti(n.segments,e)||!xl(n.segments,e,r))return!1;for(const i in t.children)if(!n.children[i]||!Rb(n.children[i],t.children[i],r))return!1;return!0}{const i=e.slice(0,n.segments.length),s=e.slice(n.segments.length);return!!(ti(n.segments,i)&&xl(n.segments,i,r)&&n.children[Y])&&Ob(n.children[Y],t,s,r)}}function xl(n,t,e){return t.every((r,i)=>Tb[e](n[i].parameters,r.parameters))}class ei{constructor(t,e,r){this.root=t,this.queryParams=e,this.fragment=r}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=fs(this.queryParams)),this._queryParamMap}toString(){return TP.serialize(this)}}class J{constructor(t,e){this.segments=t,this.children=e,this.parent=null,tt(e,(r,i)=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return Al(this)}}class xo{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap||(this._parameterMap=fs(this.parameters)),this._parameterMap}toString(){return Vb(this)}}function ti(n,t){return n.length===t.length&&n.every((e,r)=>e.path===t[r].path)}class Nb{}class kb{parse(t){const e=new VP(t);return new ei(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){const e=`/${Ao(t.root,!0)}`,r=function RP(n){const t=Object.keys(n).map(e=>{const r=n[e];return Array.isArray(r)?r.map(i=>`${Ml(e)}=${Ml(i)}`).join("&"):`${Ml(e)}=${Ml(r)}`}).filter(e=>!!e);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${e}${r}${"string"==typeof t.fragment?`#${function IP(n){return encodeURI(n)}(t.fragment)}`:""}`}}const TP=new kb;function Al(n){return n.segments.map(t=>Vb(t)).join("/")}function Ao(n,t){if(!n.hasChildren())return Al(n);if(t){const e=n.children[Y]?Ao(n.children[Y],!1):"",r=[];return tt(n.children,(i,s)=>{s!==Y&&r.push(`${s}:${Ao(i,!1)}`)}),r.length>0?`${e}(${r.join("//")})`:e}{const e=function SP(n,t){let e=[];return tt(n.children,(r,i)=>{i===Y&&(e=e.concat(t(r,i)))}),tt(n.children,(r,i)=>{i!==Y&&(e=e.concat(t(r,i)))}),e}(n,(r,i)=>i===Y?[Ao(n.children[Y],!1)]:[`${i}:${Ao(r,!1)}`]);return 1===Object.keys(n.children).length&&null!=n.children[Y]?`${Al(n)}/${e[0]}`:`${Al(n)}/(${e.join("//")})`}}function Pb(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Ml(n){return Pb(n).replace(/%3B/gi,";")}function Vf(n){return Pb(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Sl(n){return decodeURIComponent(n)}function Lb(n){return Sl(n.replace(/\+/g,"%20"))}function Vb(n){return`${Vf(n.path)}${function FP(n){return Object.keys(n).map(t=>`;${Vf(t)}=${Vf(n[t])}`).join("")}(n.parameters)}`}const OP=/^[^\/()?;=#]+/;function Tl(n){const t=n.match(OP);return t?t[0]:""}const NP=/^[^=?&#]+/,PP=/^[^&#]+/;class VP{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new J([],{}):new J([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(r[Y]=new J(t,e)),r}parseSegment(){const t=Tl(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(t),new xo(Sl(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const e=Tl(this.remaining);if(!e)return;this.capture(e);let r="";if(this.consumeOptional("=")){const i=Tl(this.remaining);i&&(r=i,this.capture(r))}t[Sl(e)]=Sl(r)}parseQueryParam(t){const e=function kP(n){const t=n.match(NP);return t?t[0]:""}(this.remaining);if(!e)return;this.capture(e);let r="";if(this.consumeOptional("=")){const o=function LP(n){const t=n.match(PP);return t?t[0]:""}(this.remaining);o&&(r=o,this.capture(r))}const i=Lb(e),s=Lb(r);if(t.hasOwnProperty(i)){let o=t[i];Array.isArray(o)||(o=[o],t[i]=o),o.push(s)}else t[i]=s}parseParens(t){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=Tl(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let s;r.indexOf(":")>-1?(s=r.substr(0,r.indexOf(":")),this.capture(s),this.capture(":")):t&&(s=Y);const o=this.parseChildren();e[s]=1===Object.keys(o).length?o[Y]:new J([],o),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new Error(`Expected "${t}".`)}}class Bb{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){const e=Bf(t,this._root);return e?e.children.map(r=>r.value):[]}firstChild(t){const e=Bf(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){const e=jf(t,this._root);return e.length<2?[]:e[e.length-2].children.map(i=>i.value).filter(i=>i!==t)}pathFromRoot(t){return jf(t,this._root).map(e=>e.value)}}function Bf(n,t){if(n===t.value)return t;for(const e of t.children){const r=Bf(n,e);if(r)return r}return null}function jf(n,t){if(n===t.value)return[t];for(const e of t.children){const r=jf(n,e);if(r.length)return r.unshift(t),r}return[]}class rr{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}}function hs(n){const t={};return n&&n.children.forEach(e=>t[e.value.outlet]=e),t}class jb extends Bb{constructor(t,e){super(t),this.snapshot=e,Hf(this,t)}toString(){return this.snapshot.toString()}}function Hb(n,t){const e=function BP(n,t){const o=new Il([],{},{},"",{},Y,t,null,n.root,-1,{});return new Gb("",new rr(o,[]))}(n,t),r=new tn([new xo("",{})]),i=new tn({}),s=new tn({}),o=new tn({}),a=new tn(""),l=new ni(r,i,o,a,s,Y,t,e.root);return l.snapshot=e.root,new jb(new rr(l,[]),e)}class ni{constructor(t,e,r,i,s,o,a,l){this.url=t,this.params=e,this.queryParams=r,this.fragment=i,this.data=s,this.outlet=o,this.component=a,this._futureSnapshot=l}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(ee(t=>fs(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(ee(t=>fs(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Ub(n,t="emptyOnly"){const e=n.pathFromRoot;let r=0;if("always"!==t)for(r=e.length-1;r>=1;){const i=e[r],s=e[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(s.component)break;r--}}return function jP(n){return n.reduce((t,e)=>({params:Object.assign(Object.assign({},t.params),e.params),data:Object.assign(Object.assign({},t.data),e.data),resolve:Object.assign(Object.assign({},t.resolve),e._resolvedData)}),{params:{},data:{},resolve:{}})}(e.slice(r))}class Il{constructor(t,e,r,i,s,o,a,l,u,c,d){this.url=t,this.params=e,this.queryParams=r,this.fragment=i,this.data=s,this.outlet=o,this.component=a,this.routeConfig=l,this._urlSegment=u,this._lastPathIndex=c,this._resolve=d}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=fs(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=fs(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class Gb extends Bb{constructor(t,e){super(e),this.url=t,Hf(this,e)}toString(){return $b(this._root)}}function Hf(n,t){t.value._routerState=n,t.children.forEach(e=>Hf(n,e))}function $b(n){const t=n.children.length>0?` { ${n.children.map($b).join(", ")} } `:"";return`${n.value}${t}`}function Uf(n){if(n.snapshot){const t=n.snapshot,e=n._futureSnapshot;n.snapshot=e,Pn(t.queryParams,e.queryParams)||n.queryParams.next(e.queryParams),t.fragment!==e.fragment&&n.fragment.next(e.fragment),Pn(t.params,e.params)||n.params.next(e.params),function DP(n,t){if(n.length!==t.length)return!1;for(let e=0;e<n.length;++e)if(!Pn(n[e],t[e]))return!1;return!0}(t.url,e.url)||n.url.next(e.url),Pn(t.data,e.data)||n.data.next(e.data)}else n.snapshot=n._futureSnapshot,n.data.next(n._futureSnapshot.data)}function Gf(n,t){const e=Pn(n.params,t.params)&&function MP(n,t){return ti(n,t)&&n.every((e,r)=>Pn(e.parameters,t[r].parameters))}(n.url,t.url);return e&&!(!n.parent!=!t.parent)&&(!n.parent||Gf(n.parent,t.parent))}function Mo(n,t,e){if(e&&n.shouldReuseRoute(t.value,e.value.snapshot)){const r=e.value;r._futureSnapshot=t.value;const i=function UP(n,t,e){return t.children.map(r=>{for(const i of e.children)if(n.shouldReuseRoute(r.value,i.value.snapshot))return Mo(n,r,i);return Mo(n,r)})}(n,t,e);return new rr(r,i)}{if(n.shouldAttach(t.value)){const s=n.retrieve(t.value);if(null!==s){const o=s.route;return o.value._futureSnapshot=t.value,o.children=t.children.map(a=>Mo(n,a)),o}}const r=function GP(n){return new ni(new tn(n.url),new tn(n.params),new tn(n.queryParams),new tn(n.fragment),new tn(n.data),n.outlet,n.component,n)}(t.value),i=t.children.map(s=>Mo(n,s));return new rr(r,i)}}function Fl(n){return"object"==typeof n&&null!=n&&!n.outlets&&!n.segmentPath}function So(n){return"object"==typeof n&&null!=n&&n.outlets}function $f(n,t,e,r,i){let s={};return r&&tt(r,(o,a)=>{s[a]=Array.isArray(o)?o.map(l=>`${l}`):`${o}`}),new ei(e.root===n?t:qb(e.root,n,t),s,i)}function qb(n,t,e){const r={};return tt(n.children,(i,s)=>{r[s]=i===t?e:qb(i,t,e)}),new J(n.segments,r)}class zb{constructor(t,e,r){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=r,t&&r.length>0&&Fl(r[0]))throw new Error("Root segment cannot have matrix parameters");const i=r.find(So);if(i&&i!==Sb(r))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class qf{constructor(t,e,r){this.segmentGroup=t,this.processChildren=e,this.index=r}}function Wb(n,t,e){if(n||(n=new J([],{})),0===n.segments.length&&n.hasChildren())return Rl(n,t,e);const r=function QP(n,t,e){let r=0,i=t;const s={match:!1,pathIndex:0,commandIndex:0};for(;i<n.segments.length;){if(r>=e.length)return s;const o=n.segments[i],a=e[r];if(So(a))break;const l=`${a}`,u=r<e.length-1?e[r+1]:null;if(i>0&&void 0===l)break;if(l&&u&&"object"==typeof u&&void 0===u.outlets){if(!Qb(l,u,o))return s;r+=2}else{if(!Qb(l,{},o))return s;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(n,t,e),i=e.slice(r.commandIndex);if(r.match&&r.pathIndex<n.segments.length){const s=new J(n.segments.slice(0,r.pathIndex),{});return s.children[Y]=new J(n.segments.slice(r.pathIndex),n.children),Rl(s,0,i)}return r.match&&0===i.length?new J(n.segments,{}):r.match&&!n.hasChildren()?zf(n,t,e):r.match?Rl(n,0,i):zf(n,t,e)}function Rl(n,t,e){if(0===e.length)return new J(n.segments,{});{const r=function KP(n){return So(n[0])?n[0].outlets:{[Y]:n}}(e),i={};return tt(r,(s,o)=>{"string"==typeof s&&(s=[s]),null!==s&&(i[o]=Wb(n.children[o],t,s))}),tt(n.children,(s,o)=>{void 0===r[o]&&(i[o]=s)}),new J(n.segments,i)}}function zf(n,t,e){const r=n.segments.slice(0,t);let i=0;for(;i<e.length;){const s=e[i];if(So(s)){const l=YP(s.outlets);return new J(r,l)}if(0===i&&Fl(e[0])){r.push(new xo(n.segments[t].path,Kb(e[0]))),i++;continue}const o=So(s)?s.outlets[Y]:`${s}`,a=i<e.length-1?e[i+1]:null;o&&a&&Fl(a)?(r.push(new xo(o,Kb(a))),i+=2):(r.push(new xo(o,{})),i++)}return new J(r,{})}function YP(n){const t={};return tt(n,(e,r)=>{"string"==typeof e&&(e=[e]),null!==e&&(t[r]=zf(new J([],{}),0,e))}),t}function Kb(n){const t={};return tt(n,(e,r)=>t[r]=`${e}`),t}function Qb(n,t,e){return n==e.path&&Pn(t,e.parameters)}class XP{constructor(t,e,r,i){this.routeReuseStrategy=t,this.futureState=e,this.currState=r,this.forwardEvent=i}activate(t){const e=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,r,t),Uf(this.futureState.root),this.activateChildRoutes(e,r,t)}deactivateChildRoutes(t,e,r){const i=hs(e);t.children.forEach(s=>{const o=s.value.outlet;this.deactivateRoutes(s,i[o],r),delete i[o]}),tt(i,(s,o)=>{this.deactivateRouteAndItsChildren(s,r)})}deactivateRoutes(t,e,r){const i=t.value,s=e?e.value:null;if(i===s)if(i.component){const o=r.getContext(i.outlet);o&&this.deactivateChildRoutes(t,e,o.children)}else this.deactivateChildRoutes(t,e,r);else s&&this.deactivateRouteAndItsChildren(e,r)}deactivateRouteAndItsChildren(t,e){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){const r=e.getContext(t.value.outlet),i=r&&t.value.component?r.children:e,s=hs(t);for(const o of Object.keys(s))this.deactivateRouteAndItsChildren(s[o],i);if(r&&r.outlet){const o=r.outlet.detach(),a=r.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:o,route:t,contexts:a})}}deactivateRouteAndOutlet(t,e){const r=e.getContext(t.value.outlet),i=r&&t.value.component?r.children:e,s=hs(t);for(const o of Object.keys(s))this.deactivateRouteAndItsChildren(s[o],i);r&&r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated(),r.attachRef=null,r.resolver=null,r.route=null)}activateChildRoutes(t,e,r){const i=hs(e);t.children.forEach(s=>{this.activateRoutes(s,i[s.value.outlet],r),this.forwardEvent(new _P(s.value.snapshot))}),t.children.length&&this.forwardEvent(new mP(t.value.snapshot))}activateRoutes(t,e,r){const i=t.value,s=e?e.value:null;if(Uf(i),i===s)if(i.component){const o=r.getOrCreateContext(i.outlet);this.activateChildRoutes(t,e,o.children)}else this.activateChildRoutes(t,e,r);else if(i.component){const o=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const a=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),o.children.onOutletReAttached(a.contexts),o.attachRef=a.componentRef,o.route=a.route.value,o.outlet&&o.outlet.attach(a.componentRef,a.route.value),Uf(a.route.value),this.activateChildRoutes(t,null,o.children)}else{const a=function JP(n){for(let t=n.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig;if(e&&e.component)return null}return null}(i.snapshot),l=a?a.module.componentFactoryResolver:null;o.attachRef=null,o.route=i,o.resolver=l,o.outlet&&o.outlet.activateWith(i,l),this.activateChildRoutes(t,null,o.children)}}else this.activateChildRoutes(t,null,r)}}class Wf{constructor(t,e){this.routes=t,this.module=e}}function wr(n){return"function"==typeof n}function ri(n){return n instanceof ei}const To=Symbol("INITIAL_VALUE");function Io(){return Jr(n=>function nP(...n){const t=Ss(n),e=Gp(n),{args:r,keys:i}=fb(n);if(0===r.length)return Qe([],t);const s=new de(function rP(n,t,e=Pr){return r=>{pb(t,()=>{const{length:i}=n,s=new Array(i);let o=i,a=i;for(let l=0;l<i;l++)pb(t,()=>{const u=Qe(n[l],t);let c=!1;u.subscribe(new Le(r,d=>{s[l]=d,c||(c=!0,a--),a||r.next(e(s.slice()))},()=>{--o||r.complete()}))},r)},r)}}(r,t,i?o=>hb(i,o):Pr));return e?s.pipe(Of(e)):s}(n.map(t=>t.pipe(mi(1),wl(To)))).pipe(yb((t,e)=>{let r=!1;return e.reduce((i,s,o)=>i!==To?i:(s===To&&(r=!0),r||!1!==s&&o!==e.length-1&&!ri(s)?i:s),t)},To),kn(t=>t!==To),ee(t=>ri(t)?t:!0===t),mi(1)))}class o1{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Fo,this.attachRef=null}}class Fo{constructor(){this.contexts=new Map}onChildOutletCreated(t,e){const r=this.getOrCreateContext(t);r.outlet=e,this.contexts.set(t,r)}onChildOutletDestroyed(t){const e=this.getContext(t);e&&(e.outlet=null,e.attachRef=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let e=this.getContext(t);return e||(e=new o1,this.contexts.set(t,e)),e}getContext(t){return this.contexts.get(t)||null}}let Kf=(()=>{class n{constructor(e,r,i,s,o){this.parentContexts=e,this.location=r,this.resolver=i,this.changeDetector=o,this.activated=null,this._activatedRoute=null,this.activateEvents=new we,this.deactivateEvents=new we,this.attachEvents=new we,this.detachEvents=new we,this.name=s||Y,e.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const e=this.parentContexts.getContext(this.name);e&&e.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const e=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(e.instance),e}attach(e,r){this.activated=e,this._activatedRoute=r,this.location.insert(e.hostView),this.attachEvents.emit(e.instance)}deactivate(){if(this.activated){const e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,r){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=e;const o=(r=r||this.resolver).resolveComponentFactory(e._futureSnapshot.routeConfig.component),a=this.parentContexts.getOrCreateContext(this.name).children,l=new a1(e,a,this.location.injector);this.activated=this.location.createComponent(o,this.location.length,l),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return n.\u0275fac=function(e){return new(e||n)(p(Fo),p(yn),p(ns),Mi("name"),p(rl))},n.\u0275dir=b({type:n,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"]}),n})();class a1{constructor(t,e,r){this.route=t,this.childContexts=e,this.parent=r}get(t,e){return t===ni?this.route:t===Fo?this.childContexts:this.parent.get(t,e)}}let Yb=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=Vr({type:n,selectors:[["ng-component"]],decls:1,vars:0,template:function(e,r){1&e&<(0,"router-outlet")},directives:[Kf],encapsulation:2}),n})();function Zb(n,t=""){for(let e=0;e<n.length;e++){const r=n[e];l1(r,u1(t,r))}}function l1(n,t){n.children&&Zb(n.children,t)}function u1(n,t){return t?n||t.path?n&&!t.path?`${n}/`:!n&&t.path?t.path:`${n}/${t.path}`:"":n}function Qf(n){const t=n.children&&n.children.map(Qf),e=t?Object.assign(Object.assign({},n),{children:t}):Object.assign({},n);return!e.component&&(t||e.loadChildren)&&e.outlet&&e.outlet!==Y&&(e.component=Yb),e}function nn(n){return n.outlet||Y}function Xb(n,t){const e=n.filter(r=>nn(r)===t);return e.push(...n.filter(r=>nn(r)!==t)),e}const Jb={matched:!1,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};function Ol(n,t,e){var r;if(""===t.path)return"full"===t.pathMatch&&(n.hasChildren()||e.length>0)?Object.assign({},Jb):{matched:!0,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};const s=(t.matcher||bP)(e,n,t);if(!s)return Object.assign({},Jb);const o={};tt(s.posParams,(l,u)=>{o[u]=l.path});const a=s.consumed.length>0?Object.assign(Object.assign({},o),s.consumed[s.consumed.length-1].parameters):o;return{matched:!0,consumedSegments:s.consumed,lastChild:s.consumed.length,parameters:a,positionalParamSegments:null!==(r=s.posParams)&&void 0!==r?r:{}}}function Nl(n,t,e,r,i="corrected"){if(e.length>0&&function f1(n,t,e){return e.some(r=>kl(n,t,r)&&nn(r)!==Y)}(n,e,r)){const o=new J(t,function d1(n,t,e,r){const i={};i[Y]=r,r._sourceSegment=n,r._segmentIndexShift=t.length;for(const s of e)if(""===s.path&&nn(s)!==Y){const o=new J([],{});o._sourceSegment=n,o._segmentIndexShift=t.length,i[nn(s)]=o}return i}(n,t,r,new J(e,n.children)));return o._sourceSegment=n,o._segmentIndexShift=t.length,{segmentGroup:o,slicedSegments:[]}}if(0===e.length&&function h1(n,t,e){return e.some(r=>kl(n,t,r))}(n,e,r)){const o=new J(n.segments,function c1(n,t,e,r,i,s){const o={};for(const a of r)if(kl(n,e,a)&&!i[nn(a)]){const l=new J([],{});l._sourceSegment=n,l._segmentIndexShift="legacy"===s?n.segments.length:t.length,o[nn(a)]=l}return Object.assign(Object.assign({},i),o)}(n,t,e,r,n.children,i));return o._sourceSegment=n,o._segmentIndexShift=t.length,{segmentGroup:o,slicedSegments:e}}const s=new J(n.segments,n.children);return s._sourceSegment=n,s._segmentIndexShift=t.length,{segmentGroup:s,slicedSegments:e}}function kl(n,t,e){return(!(n.hasChildren()||t.length>0)||"full"!==e.pathMatch)&&""===e.path}function eD(n,t,e,r){return!!(nn(n)===r||r!==Y&&kl(t,e,n))&&("**"===n.path||Ol(t,n,e).matched)}function tD(n,t,e){return 0===t.length&&!n.children[e]}class Ro{constructor(t){this.segmentGroup=t||null}}class nD{constructor(t){this.urlTree=t}}function Pl(n){return new de(t=>t.error(new Ro(n)))}function rD(n){return new de(t=>t.error(new nD(n)))}function p1(n){return new de(t=>t.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${n}'`)))}class y1{constructor(t,e,r,i,s){this.configLoader=e,this.urlSerializer=r,this.urlTree=i,this.config=s,this.allowRedirects=!0,this.ngModule=t.get(Yn)}apply(){const t=Nl(this.urlTree.root,[],[],this.config).segmentGroup,e=new J(t.segments,t.children);return this.expandSegmentGroup(this.ngModule,this.config,e,Y).pipe(ee(s=>this.createUrlTree(Yf(s),this.urlTree.queryParams,this.urlTree.fragment))).pipe(tr(s=>{if(s instanceof nD)return this.allowRedirects=!1,this.match(s.urlTree);throw s instanceof Ro?this.noMatchError(s):s}))}match(t){return this.expandSegmentGroup(this.ngModule,this.config,t.root,Y).pipe(ee(i=>this.createUrlTree(Yf(i),t.queryParams,t.fragment))).pipe(tr(i=>{throw i instanceof Ro?this.noMatchError(i):i}))}noMatchError(t){return new Error(`Cannot match any routes. URL Segment: '${t.segmentGroup}'`)}createUrlTree(t,e,r){const i=t.segments.length>0?new J([],{[Y]:t}):t;return new ei(i,e,r)}expandSegmentGroup(t,e,r,i){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,e,r).pipe(ee(s=>new J([],s))):this.expandSegment(t,r,e,r.segments,i,!0)}expandChildren(t,e,r){const i=[];for(const s of Object.keys(r.children))"primary"===s?i.unshift(s):i.push(s);return Qe(i).pipe(cs(s=>{const o=r.children[s],a=Xb(e,s);return this.expandSegmentGroup(t,a,o,s).pipe(ee(l=>({segment:l,outlet:s})))}),yb((s,o)=>(s[o.outlet]=o.segment,s),{}),function lP(n,t){const e=arguments.length>=2;return r=>r.pipe(n?kn((i,s)=>n(i,s,r)):Pr,kf(1),e?vb(t):_b(()=>new El))}())}expandSegment(t,e,r,i,s,o){return Qe(r).pipe(cs(a=>this.expandSegmentAgainstRoute(t,e,r,a,i,s,o).pipe(tr(u=>{if(u instanceof Ro)return B(null);throw u}))),ds(a=>!!a),tr((a,l)=>{if(a instanceof El||"EmptyError"===a.name){if(tD(e,i,s))return B(new J([],{}));throw new Ro(e)}throw a}))}expandSegmentAgainstRoute(t,e,r,i,s,o,a){return eD(i,e,s,o)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,e,i,s,o):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,r,i,s,o):Pl(e):Pl(e)}expandSegmentAgainstRouteUsingRedirect(t,e,r,i,s,o){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,r,i,o):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,r,i,s,o)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,e,r,i){const s=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?rD(s):this.lineralizeSegments(r,s).pipe($e(o=>{const a=new J(o,{});return this.expandSegment(t,a,e,o,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,e,r,i,s,o){const{matched:a,consumedSegments:l,lastChild:u,positionalParamSegments:c}=Ol(e,i,s);if(!a)return Pl(e);const d=this.applyRedirectCommands(l,i.redirectTo,c);return i.redirectTo.startsWith("/")?rD(d):this.lineralizeSegments(i,d).pipe($e(f=>this.expandSegment(t,e,r,f.concat(s.slice(u)),o,!1)))}matchSegmentAgainstRoute(t,e,r,i,s){if("**"===r.path)return r.loadChildren?(r._loadedConfig?B(r._loadedConfig):this.configLoader.load(t.injector,r)).pipe(ee(f=>(r._loadedConfig=f,new J(i,{})))):B(new J(i,{}));const{matched:o,consumedSegments:a,lastChild:l}=Ol(e,r,i);if(!o)return Pl(e);const u=i.slice(l);return this.getChildConfig(t,r,i).pipe($e(d=>{const f=d.module,h=d.routes,{segmentGroup:g,slicedSegments:m}=Nl(e,a,u,h),_=new J(g.segments,g.children);if(0===m.length&&_.hasChildren())return this.expandChildren(f,h,_).pipe(ee(T=>new J(a,T)));if(0===h.length&&0===m.length)return B(new J(a,{}));const v=nn(r)===s;return this.expandSegment(f,_,h,m,v?Y:s,!0).pipe(ee(E=>new J(a.concat(E.segments),E.children)))}))}getChildConfig(t,e,r){return e.children?B(new Wf(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?B(e._loadedConfig):this.runCanLoadGuards(t.injector,e,r).pipe($e(i=>i?this.configLoader.load(t.injector,e).pipe(ee(s=>(e._loadedConfig=s,s))):function g1(n){return new de(t=>t.error(Lf(`Cannot load children because the guard of the route "path: '${n.path}'" returned false`)))}(e))):B(new Wf([],t))}runCanLoadGuards(t,e,r){const i=e.canLoad;return i&&0!==i.length?B(i.map(o=>{const a=t.get(o);let l;if(function t1(n){return n&&wr(n.canLoad)}(a))l=a.canLoad(e,r);else{if(!wr(a))throw new Error("Invalid CanLoad guard");l=a(e,r)}return Ln(l)})).pipe(Io(),et(o=>{if(!ri(o))return;const a=Lf(`Redirecting to "${this.urlSerializer.serialize(o)}"`);throw a.url=o,a}),ee(o=>!0===o)):B(!0)}lineralizeSegments(t,e){let r=[],i=e.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return B(r);if(i.numberOfChildren>1||!i.children[Y])return p1(t.redirectTo);i=i.children[Y]}}applyRedirectCommands(t,e,r){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,r)}applyRedirectCreatreUrlTree(t,e,r,i){const s=this.createSegmentGroup(t,e.root,r,i);return new ei(s,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){const r={};return tt(t,(i,s)=>{if("string"==typeof i&&i.startsWith(":")){const a=i.substring(1);r[s]=e[a]}else r[s]=i}),r}createSegmentGroup(t,e,r,i){const s=this.createSegments(t,e.segments,r,i);let o={};return tt(e.children,(a,l)=>{o[l]=this.createSegmentGroup(t,a,r,i)}),new J(s,o)}createSegments(t,e,r,i){return e.map(s=>s.path.startsWith(":")?this.findPosParam(t,s,i):this.findOrReturn(s,r))}findPosParam(t,e,r){const i=r[e.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${t}'. Cannot find '${e.path}'.`);return i}findOrReturn(t,e){let r=0;for(const i of e){if(i.path===t.path)return e.splice(r),i;r++}return t}}function Yf(n){const t={};for(const r of Object.keys(n.children)){const s=Yf(n.children[r]);(s.segments.length>0||s.hasChildren())&&(t[r]=s)}return function _1(n){if(1===n.numberOfChildren&&n.children[Y]){const t=n.children[Y];return new J(n.segments.concat(t.segments),t.children)}return n}(new J(n.segments,t))}class iD{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class Ll{constructor(t,e){this.component=t,this.route=e}}function C1(n,t,e){const r=n._root;return Oo(r,t?t._root:null,e,[r.value])}function Vl(n,t,e){const r=function D1(n){if(!n)return null;for(let t=n.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig}return null}(t);return(r?r.module.injector:e).get(n)}function Oo(n,t,e,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const s=hs(t);return n.children.forEach(o=>{(function E1(n,t,e,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const s=n.value,o=t?t.value:null,a=e?e.getContext(n.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){const l=function w1(n,t,e){if("function"==typeof e)return e(n,t);switch(e){case"pathParamsChange":return!ti(n.url,t.url);case"pathParamsOrQueryParamsChange":return!ti(n.url,t.url)||!Pn(n.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Gf(n,t)||!Pn(n.queryParams,t.queryParams);default:return!Gf(n,t)}}(o,s,s.routeConfig.runGuardsAndResolvers);l?i.canActivateChecks.push(new iD(r)):(s.data=o.data,s._resolvedData=o._resolvedData),Oo(n,t,s.component?a?a.children:null:e,r,i),l&&a&&a.outlet&&a.outlet.isActivated&&i.canDeactivateChecks.push(new Ll(a.outlet.component,o))}else o&&No(t,a,i),i.canActivateChecks.push(new iD(r)),Oo(n,null,s.component?a?a.children:null:e,r,i)})(o,s[o.value.outlet],e,r.concat([o.value]),i),delete s[o.value.outlet]}),tt(s,(o,a)=>No(o,e.getContext(a),i)),i}function No(n,t,e){const r=hs(n),i=n.value;tt(r,(s,o)=>{No(s,i.component?t?t.children.getContext(o):null:t,e)}),e.canDeactivateChecks.push(new Ll(i.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,i))}class O1{}function sD(n){return new de(t=>t.error(n))}class k1{constructor(t,e,r,i,s,o){this.rootComponentType=t,this.config=e,this.urlTree=r,this.url=i,this.paramsInheritanceStrategy=s,this.relativeLinkResolution=o}recognize(){const t=Nl(this.urlTree.root,[],[],this.config.filter(o=>void 0===o.redirectTo),this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,Y);if(null===e)return null;const r=new Il([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},Y,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new rr(r,e),s=new Gb(this.url,i);return this.inheritParamsAndData(s._root),s}inheritParamsAndData(t){const e=t.value,r=Ub(e,this.paramsInheritanceStrategy);e.params=Object.freeze(r.params),e.data=Object.freeze(r.data),t.children.forEach(i=>this.inheritParamsAndData(i))}processSegmentGroup(t,e,r){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,r)}processChildren(t,e){const r=[];for(const s of Object.keys(e.children)){const o=e.children[s],a=Xb(t,s),l=this.processSegmentGroup(a,o,s);if(null===l)return null;r.push(...l)}const i=oD(r);return function P1(n){n.sort((t,e)=>t.value.outlet===Y?-1:e.value.outlet===Y?1:t.value.outlet.localeCompare(e.value.outlet))}(i),i}processSegment(t,e,r,i){for(const s of t){const o=this.processSegmentAgainstRoute(s,e,r,i);if(null!==o)return o}return tD(e,r,i)?[]:null}processSegmentAgainstRoute(t,e,r,i){if(t.redirectTo||!eD(t,e,r,i))return null;let s,o=[],a=[];if("**"===t.path){const h=r.length>0?Sb(r).parameters:{};s=new Il(r,h,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,uD(t),nn(t),t.component,t,aD(e),lD(e)+r.length,cD(t))}else{const h=Ol(e,t,r);if(!h.matched)return null;o=h.consumedSegments,a=r.slice(h.lastChild),s=new Il(o,h.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,uD(t),nn(t),t.component,t,aD(e),lD(e)+o.length,cD(t))}const l=function L1(n){return n.children?n.children:n.loadChildren?n._loadedConfig.routes:[]}(t),{segmentGroup:u,slicedSegments:c}=Nl(e,o,a,l.filter(h=>void 0===h.redirectTo),this.relativeLinkResolution);if(0===c.length&&u.hasChildren()){const h=this.processChildren(l,u);return null===h?null:[new rr(s,h)]}if(0===l.length&&0===c.length)return[new rr(s,[])];const d=nn(t)===i,f=this.processSegment(l,u,c,d?Y:i);return null===f?null:[new rr(s,f)]}}function V1(n){const t=n.value.routeConfig;return t&&""===t.path&&void 0===t.redirectTo}function oD(n){const t=[],e=new Set;for(const r of n){if(!V1(r)){t.push(r);continue}const i=t.find(s=>r.value.routeConfig===s.value.routeConfig);void 0!==i?(i.children.push(...r.children),e.add(i)):t.push(r)}for(const r of e){const i=oD(r.children);t.push(new rr(r.value,i))}return t.filter(r=>!e.has(r))}function aD(n){let t=n;for(;t._sourceSegment;)t=t._sourceSegment;return t}function lD(n){let t=n,e=t._segmentIndexShift?t._segmentIndexShift:0;for(;t._sourceSegment;)t=t._sourceSegment,e+=t._segmentIndexShift?t._segmentIndexShift:0;return e-1}function uD(n){return n.data||{}}function cD(n){return n.resolve||{}}function Zf(n){return Jr(t=>{const e=n(t);return e?Qe(e).pipe(ee(()=>t)):B(t)})}class z1 extends class q1{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}}{}const Xf=new F("ROUTES");class dD{constructor(t,e,r,i){this.injector=t,this.compiler=e,this.onLoadStartListener=r,this.onLoadEndListener=i}load(t,e){if(e._loader$)return e._loader$;this.onLoadStartListener&&this.onLoadStartListener(e);const i=this.loadModuleFactory(e.loadChildren).pipe(ee(s=>{this.onLoadEndListener&&this.onLoadEndListener(e);const o=s.create(t);return new Wf(Mb(o.injector.get(Xf,void 0,G.Self|G.Optional)).map(Qf),o)}),tr(s=>{throw e._loader$=void 0,s}));return e._loader$=new sP(i,()=>new Xe).pipe(mb()),e._loader$}loadModuleFactory(t){return Ln(t()).pipe($e(e=>e instanceof Ev?B(e):Qe(this.compiler.compileModuleAsync(e))))}}class K1{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,e){return t}}function Q1(n){throw n}function Y1(n,t,e){return t.parse("/")}function fD(n,t){return B(null)}const Z1={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},X1={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let Lt=(()=>{class n{constructor(e,r,i,s,o,a,l){this.rootComponentType=e,this.urlSerializer=r,this.rootContexts=i,this.location=s,this.config=l,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new Xe,this.errorHandler=Q1,this.malformedUriErrorHandler=Y1,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:fD,afterPreactivation:fD},this.urlHandlingStrategy=new K1,this.routeReuseStrategy=new z1,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.ngModule=o.get(Yn),this.console=o.get(sC);const d=o.get(ce);this.isNgZoneEnabled=d instanceof ce&&ce.isInAngularZone(),this.resetConfig(l),this.currentUrlTree=function EP(){return new ei(new J([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new dD(o,a,f=>this.triggerEvent(new Db(f)),f=>this.triggerEvent(new Eb(f))),this.routerState=Hb(this.currentUrlTree,this.rootComponentType),this.transitions=new tn({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){var e;return null===(e=this.location.getState())||void 0===e?void 0:e.\u0275routerPageId}setupNavigations(e){const r=this.events;return e.pipe(kn(i=>0!==i.id),ee(i=>Object.assign(Object.assign({},i),{extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),Jr(i=>{let s=!1,o=!1;return B(i).pipe(et(a=>{this.currentNavigation={id:a.id,initialUrl:a.currentRawUrl,extractedUrl:a.extractedUrl,trigger:a.source,extras:a.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Jr(a=>{const l=this.browserUrlTree.toString(),u=!this.navigated||a.extractedUrl.toString()!==l||l!==this.currentUrlTree.toString();if(("reload"===this.onSameUrlNavigation||u)&&this.urlHandlingStrategy.shouldProcessUrl(a.rawUrl))return Bl(a.source)&&(this.browserUrlTree=a.extractedUrl),B(a).pipe(Jr(d=>{const f=this.transitions.getValue();return r.next(new Pf(d.id,this.serializeUrl(d.extractedUrl),d.source,d.restoredState)),f!==this.transitions.getValue()?Dn:Promise.resolve(d)}),function v1(n,t,e,r){return Jr(i=>function m1(n,t,e,r,i){return new y1(n,t,e,r,i).apply()}(n,t,e,i.extractedUrl,r).pipe(ee(s=>Object.assign(Object.assign({},i),{urlAfterRedirects:s}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),et(d=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:d.urlAfterRedirects})}),function B1(n,t,e,r,i){return $e(s=>function N1(n,t,e,r,i="emptyOnly",s="legacy"){try{const o=new k1(n,t,e,r,i,s).recognize();return null===o?sD(new O1):B(o)}catch(o){return sD(o)}}(n,t,s.urlAfterRedirects,e(s.urlAfterRedirects),r,i).pipe(ee(o=>Object.assign(Object.assign({},s),{targetSnapshot:o}))))}(this.rootComponentType,this.config,d=>this.serializeUrl(d),this.paramsInheritanceStrategy,this.relativeLinkResolution),et(d=>{if("eager"===this.urlUpdateStrategy){if(!d.extras.skipLocationChange){const h=this.urlHandlingStrategy.merge(d.urlAfterRedirects,d.rawUrl);this.setBrowserUrl(h,d)}this.browserUrlTree=d.urlAfterRedirects}const f=new cP(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot);r.next(f)}));if(u&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:f,extractedUrl:h,source:g,restoredState:m,extras:_}=a,v=new Pf(f,this.serializeUrl(h),g,m);r.next(v);const y=Hb(h,this.rootComponentType).snapshot;return B(Object.assign(Object.assign({},a),{targetSnapshot:y,urlAfterRedirects:h,extras:Object.assign(Object.assign({},_),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=a.rawUrl,a.resolve(null),Dn}),Zf(a=>{const{targetSnapshot:l,id:u,extractedUrl:c,rawUrl:d,extras:{skipLocationChange:f,replaceUrl:h}}=a;return this.hooks.beforePreactivation(l,{navigationId:u,appliedUrlTree:c,rawUrlTree:d,skipLocationChange:!!f,replaceUrl:!!h})}),et(a=>{const l=new dP(a.id,this.serializeUrl(a.extractedUrl),this.serializeUrl(a.urlAfterRedirects),a.targetSnapshot);this.triggerEvent(l)}),ee(a=>Object.assign(Object.assign({},a),{guards:C1(a.targetSnapshot,a.currentSnapshot,this.rootContexts)})),function x1(n,t){return $e(e=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:s,canDeactivateChecks:o}}=e;return 0===o.length&&0===s.length?B(Object.assign(Object.assign({},e),{guardsResult:!0})):function A1(n,t,e,r){return Qe(n).pipe($e(i=>function R1(n,t,e,r,i){const s=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return s&&0!==s.length?B(s.map(a=>{const l=Vl(a,t,i);let u;if(function s1(n){return n&&wr(n.canDeactivate)}(l))u=Ln(l.canDeactivate(n,t,e,r));else{if(!wr(l))throw new Error("Invalid CanDeactivate guard");u=Ln(l(n,t,e,r))}return u.pipe(ds())})).pipe(Io()):B(!0)}(i.component,i.route,e,t,r)),ds(i=>!0!==i,!0))}(o,r,i,n).pipe($e(a=>a&&function e1(n){return"boolean"==typeof n}(a)?function M1(n,t,e,r){return Qe(t).pipe(cs(i=>Nf(function T1(n,t){return null!==n&&t&&t(new gP(n)),B(!0)}(i.route.parent,r),function S1(n,t){return null!==n&&t&&t(new yP(n)),B(!0)}(i.route,r),function F1(n,t,e){const r=t[t.length-1],s=t.slice(0,t.length-1).reverse().map(o=>function b1(n){const t=n.routeConfig?n.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:n,guards:t}:null}(o)).filter(o=>null!==o).map(o=>gb(()=>B(o.guards.map(l=>{const u=Vl(l,o.node,e);let c;if(function r1(n){return n&&wr(n.canActivateChild)}(u))c=Ln(u.canActivateChild(r,n));else{if(!wr(u))throw new Error("Invalid CanActivateChild guard");c=Ln(u(r,n))}return c.pipe(ds())})).pipe(Io())));return B(s).pipe(Io())}(n,i.path,e),function I1(n,t,e){const r=t.routeConfig?t.routeConfig.canActivate:null;if(!r||0===r.length)return B(!0);const i=r.map(s=>gb(()=>{const o=Vl(s,t,e);let a;if(function n1(n){return n&&wr(n.canActivate)}(o))a=Ln(o.canActivate(t,n));else{if(!wr(o))throw new Error("Invalid CanActivate guard");a=Ln(o(t,n))}return a.pipe(ds())}));return B(i).pipe(Io())}(n,i.route,e))),ds(i=>!0!==i,!0))}(r,s,n,t):B(a)),ee(a=>Object.assign(Object.assign({},e),{guardsResult:a})))})}(this.ngModule.injector,a=>this.triggerEvent(a)),et(a=>{if(ri(a.guardsResult)){const u=Lf(`Redirecting to "${this.serializeUrl(a.guardsResult)}"`);throw u.url=a.guardsResult,u}const l=new fP(a.id,this.serializeUrl(a.extractedUrl),this.serializeUrl(a.urlAfterRedirects),a.targetSnapshot,!!a.guardsResult);this.triggerEvent(l)}),kn(a=>!!a.guardsResult||(this.restoreHistory(a),this.cancelNavigationTransition(a,""),!1)),Zf(a=>{if(a.guards.canActivateChecks.length)return B(a).pipe(et(l=>{const u=new hP(l.id,this.serializeUrl(l.extractedUrl),this.serializeUrl(l.urlAfterRedirects),l.targetSnapshot);this.triggerEvent(u)}),Jr(l=>{let u=!1;return B(l).pipe(function j1(n,t){return $e(e=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=e;if(!i.length)return B(e);let s=0;return Qe(i).pipe(cs(o=>function H1(n,t,e,r){return function U1(n,t,e,r){const i=Object.keys(n);if(0===i.length)return B({});const s={};return Qe(i).pipe($e(o=>function G1(n,t,e,r){const i=Vl(n,t,r);return Ln(i.resolve?i.resolve(t,e):i(t,e))}(n[o],t,e,r).pipe(et(a=>{s[o]=a}))),kf(1),$e(()=>Object.keys(s).length===i.length?B(s):Dn))}(n._resolve,n,t,r).pipe(ee(s=>(n._resolvedData=s,n.data=Object.assign(Object.assign({},n.data),Ub(n,e).resolve),null)))}(o.route,r,n,t)),et(()=>s++),kf(1),$e(o=>s===i.length?B(e):Dn))})}(this.paramsInheritanceStrategy,this.ngModule.injector),et({next:()=>u=!0,complete:()=>{u||(this.restoreHistory(l),this.cancelNavigationTransition(l,"At least one route resolver didn't emit any value."))}}))}),et(l=>{const u=new pP(l.id,this.serializeUrl(l.extractedUrl),this.serializeUrl(l.urlAfterRedirects),l.targetSnapshot);this.triggerEvent(u)}))}),Zf(a=>{const{targetSnapshot:l,id:u,extractedUrl:c,rawUrl:d,extras:{skipLocationChange:f,replaceUrl:h}}=a;return this.hooks.afterPreactivation(l,{navigationId:u,appliedUrlTree:c,rawUrlTree:d,skipLocationChange:!!f,replaceUrl:!!h})}),ee(a=>{const l=function HP(n,t,e){const r=Mo(n,t._root,e?e._root:void 0);return new jb(r,t)}(this.routeReuseStrategy,a.targetSnapshot,a.currentRouterState);return Object.assign(Object.assign({},a),{targetRouterState:l})}),et(a=>{this.currentUrlTree=a.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(a.urlAfterRedirects,a.rawUrl),this.routerState=a.targetRouterState,"deferred"===this.urlUpdateStrategy&&(a.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,a),this.browserUrlTree=a.urlAfterRedirects)}),((n,t,e)=>ee(r=>(new XP(t,r.targetRouterState,r.currentRouterState,e).activate(n),r)))(this.rootContexts,this.routeReuseStrategy,a=>this.triggerEvent(a)),et({next(){s=!0},complete(){s=!0}}),Cb(()=>{var a;s||o||this.cancelNavigationTransition(i,`Navigation ID ${i.id} is not equal to the current navigation id ${this.navigationId}`),(null===(a=this.currentNavigation)||void 0===a?void 0:a.id)===i.id&&(this.currentNavigation=null)}),tr(a=>{if(o=!0,function CP(n){return n&&n[xb]}(a)){const l=ri(a.url);l||(this.navigated=!0,this.restoreHistory(i,!0));const u=new bb(i.id,this.serializeUrl(i.extractedUrl),a.message);r.next(u),l?setTimeout(()=>{const c=this.urlHandlingStrategy.merge(a.url,this.rawUrlTree),d={skipLocationChange:i.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||Bl(i.source)};this.scheduleNavigation(c,"imperative",null,d,{resolve:i.resolve,reject:i.reject,promise:i.promise})},0):i.resolve(!1)}else{this.restoreHistory(i,!0);const l=new uP(i.id,this.serializeUrl(i.extractedUrl),a);r.next(l);try{i.resolve(this.errorHandler(a))}catch(u){i.reject(u)}}return Dn}))}))}resetRootComponentType(e){this.rootComponentType=e,this.routerState.root.component=this.rootComponentType}setTransition(e){this.transitions.next(Object.assign(Object.assign({},this.transitions.value),e))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(e=>{const r="popstate"===e.type?"popstate":"hashchange";"popstate"===r&&setTimeout(()=>{var i;const s={replaceUrl:!0},o=(null===(i=e.state)||void 0===i?void 0:i.navigationId)?e.state:null;if(o){const l=Object.assign({},o);delete l.navigationId,delete l.\u0275routerPageId,0!==Object.keys(l).length&&(s.state=l)}const a=this.parseUrl(e.url);this.scheduleNavigation(a,r,o,s)},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(e){this.events.next(e)}resetConfig(e){Zb(e),this.config=e.map(Qf),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(e,r={}){const{relativeTo:i,queryParams:s,fragment:o,queryParamsHandling:a,preserveFragment:l}=r,u=i||this.routerState.root,c=l?this.currentUrlTree.fragment:o;let d=null;switch(a){case"merge":d=Object.assign(Object.assign({},this.currentUrlTree.queryParams),s);break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=s||null}return null!==d&&(d=this.removeEmptyProps(d)),function $P(n,t,e,r,i){if(0===e.length)return $f(t.root,t.root,t,r,i);const s=function qP(n){if("string"==typeof n[0]&&1===n.length&&"/"===n[0])return new zb(!0,0,n);let t=0,e=!1;const r=n.reduce((i,s,o)=>{if("object"==typeof s&&null!=s){if(s.outlets){const a={};return tt(s.outlets,(l,u)=>{a[u]="string"==typeof l?l.split("/"):l}),[...i,{outlets:a}]}if(s.segmentPath)return[...i,s.segmentPath]}return"string"!=typeof s?[...i,s]:0===o?(s.split("/").forEach((a,l)=>{0==l&&"."===a||(0==l&&""===a?e=!0:".."===a?t++:""!=a&&i.push(a))}),i):[...i,s]},[]);return new zb(e,t,r)}(e);if(s.toRoot())return $f(t.root,new J([],{}),t,r,i);const o=function zP(n,t,e){if(n.isAbsolute)return new qf(t.root,!0,0);if(-1===e.snapshot._lastPathIndex){const s=e.snapshot._urlSegment;return new qf(s,s===t.root,0)}const r=Fl(n.commands[0])?0:1;return function WP(n,t,e){let r=n,i=t,s=e;for(;s>i;){if(s-=i,r=r.parent,!r)throw new Error("Invalid number of '../'");i=r.segments.length}return new qf(r,!1,i-s)}(e.snapshot._urlSegment,e.snapshot._lastPathIndex+r,n.numberOfDoubleDots)}(s,t,n),a=o.processChildren?Rl(o.segmentGroup,o.index,s.commands):Wb(o.segmentGroup,o.index,s.commands);return $f(o.segmentGroup,a,t,r,i)}(u,this.currentUrlTree,e,d,null!=c?c:null)}navigateByUrl(e,r={skipLocationChange:!1}){const i=ri(e)?e:this.parseUrl(e),s=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(s,"imperative",null,r)}navigate(e,r={skipLocationChange:!1}){return function J1(n){for(let t=0;t<n.length;t++){const e=n[t];if(null==e)throw new Error(`The requested path contains ${e} segment at index ${t}`)}}(e),this.navigateByUrl(this.createUrlTree(e,r),r)}serializeUrl(e){return this.urlSerializer.serialize(e)}parseUrl(e){let r;try{r=this.urlSerializer.parse(e)}catch(i){r=this.malformedUriErrorHandler(i,this.urlSerializer,e)}return r}isActive(e,r){let i;if(i=!0===r?Object.assign({},Z1):!1===r?Object.assign({},X1):r,ri(e))return Ib(this.currentUrlTree,e,i);const s=this.parseUrl(e);return Ib(this.currentUrlTree,s,i)}removeEmptyProps(e){return Object.keys(e).reduce((r,i)=>{const s=e[i];return null!=s&&(r[i]=s),r},{})}processNavigations(){this.navigations.subscribe(e=>{this.navigated=!0,this.lastSuccessfulId=e.id,this.currentPageId=e.targetPageId,this.events.next(new wo(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,e.resolve(!0)},e=>{this.console.warn(`Unhandled Navigation Error: ${e}`)})}scheduleNavigation(e,r,i,s,o){var a,l,u;if(this.disposed)return Promise.resolve(!1);const c=this.transitions.value,d=Bl(r)&&c&&!Bl(c.source),f=c.rawUrl.toString()===e.toString(),h=c.id===(null===(a=this.currentNavigation)||void 0===a?void 0:a.id);if(d&&f&&h)return Promise.resolve(!0);let m,_,v;o?(m=o.resolve,_=o.reject,v=o.promise):v=new Promise((T,q)=>{m=T,_=q});const y=++this.navigationId;let E;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(i=this.location.getState()),E=i&&i.\u0275routerPageId?i.\u0275routerPageId:s.replaceUrl||s.skipLocationChange?null!==(l=this.browserPageId)&&void 0!==l?l:0:(null!==(u=this.browserPageId)&&void 0!==u?u:0)+1):E=0,this.setTransition({id:y,targetPageId:E,source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:e,extras:s,resolve:m,reject:_,promise:v,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),v.catch(T=>Promise.reject(T))}setBrowserUrl(e,r){const i=this.urlSerializer.serialize(e),s=Object.assign(Object.assign({},r.extras.state),this.generateNgRouterState(r.id,r.targetPageId));this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl?this.location.replaceState(i,"",s):this.location.go(i,"",s)}restoreHistory(e,r=!1){var i,s;if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-e.targetPageId;"popstate"!==e.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==(null===(i=this.currentNavigation)||void 0===i?void 0:i.finalUrl)||0===o?this.currentUrlTree===(null===(s=this.currentNavigation)||void 0===s?void 0:s.finalUrl)&&0===o&&(this.resetState(e),this.browserUrlTree=e.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(o)}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(e),this.resetUrlToCurrentUrlTree())}resetState(e){this.routerState=e.currentRouterState,this.currentUrlTree=e.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(e,r){const i=new bb(e.id,this.serializeUrl(e.extractedUrl),r);this.triggerEvent(i),e.resolve(!1)}generateNgRouterState(e,r){return"computed"===this.canceledNavigationResolution?{navigationId:e,\u0275routerPageId:r}:{navigationId:e}}}return n.\u0275fac=function(e){_d()},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();function Bl(n){return"imperative"!==n}let jl=(()=>{class n{constructor(e,r,i,s,o){this.router=e,this.route=r,this.tabIndexAttribute=i,this.renderer=s,this.el=o,this.commands=null,this.onChanges=new Xe,this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(e){if(null!=this.tabIndexAttribute)return;const r=this.renderer,i=this.el.nativeElement;null!==e?r.setAttribute(i,"tabindex",e):r.removeAttribute(i,"tabindex")}ngOnChanges(e){this.onChanges.next(this)}set routerLink(e){null!=e?(this.commands=Array.isArray(e)?e:[e],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(){if(null===this.urlTree)return!0;const e={skipLocationChange:ps(this.skipLocationChange),replaceUrl:ps(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,e),!0}get urlTree(){return null===this.commands?null:this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:ps(this.preserveFragment)})}}return n.\u0275fac=function(e){return new(e||n)(p(Lt),p(ni),Mi("tabindex"),p(mn),p($))},n.\u0275dir=b({type:n,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(e,r){1&e&&je("click",function(){return r.onClick()})},inputs:{queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state",relativeTo:"relativeTo",routerLink:"routerLink"},features:[st]}),n})();function ps(n){return""===n||!!n}class hD{}class pD{preload(t,e){return B(null)}}let gD=(()=>{class n{constructor(e,r,i,s){this.router=e,this.injector=i,this.preloadingStrategy=s,this.loader=new dD(i,r,l=>e.triggerEvent(new Db(l)),l=>e.triggerEvent(new Eb(l)))}setUpPreloading(){this.subscription=this.router.events.pipe(kn(e=>e instanceof wo),cs(()=>this.preload())).subscribe(()=>{})}preload(){const e=this.injector.get(Yn);return this.processRoutes(e,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(e,r){const i=[];for(const s of r)if(s.loadChildren&&!s.canLoad&&s._loadedConfig){const o=s._loadedConfig;i.push(this.processRoutes(o.module,o.routes))}else s.loadChildren&&!s.canLoad?i.push(this.preloadConfig(e,s)):s.children&&i.push(this.processRoutes(e,s.children));return Qe(i).pipe(Ms(),ee(s=>{}))}preloadConfig(e,r){return this.preloadingStrategy.preload(r,()=>(r._loadedConfig?B(r._loadedConfig):this.loader.load(e.injector,r)).pipe($e(s=>(r._loadedConfig=s,this.processRoutes(s.module,s.routes)))))}}return n.\u0275fac=function(e){return new(e||n)(D(Lt),D(nl),D(Je),D(hD))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})(),eh=(()=>{class n{constructor(e,r,i={}){this.router=e,this.viewportScroller=r,this.options=i,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},i.scrollPositionRestoration=i.scrollPositionRestoration||"disabled",i.anchorScrolling=i.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(e=>{e instanceof Pf?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof wo&&(this.lastId=e.id,this.scheduleScrollEvent(e,this.router.parseUrl(e.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(e=>{e instanceof wb&&(e.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,r){this.router.triggerEvent(new wb(e,"popstate"===this.lastSource?this.store[this.restoredId]:null,r))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return n.\u0275fac=function(e){_d()},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const ii=new F("ROUTER_CONFIGURATION"),mD=new F("ROUTER_FORROOT_GUARD"),rL=[ff,{provide:Nb,useClass:kb},{provide:Lt,useFactory:function lL(n,t,e,r,i,s,o={},a,l){const u=new Lt(null,n,t,e,r,i,Mb(s));return a&&(u.urlHandlingStrategy=a),l&&(u.routeReuseStrategy=l),function uL(n,t){n.errorHandler&&(t.errorHandler=n.errorHandler),n.malformedUriErrorHandler&&(t.malformedUriErrorHandler=n.malformedUriErrorHandler),n.onSameUrlNavigation&&(t.onSameUrlNavigation=n.onSameUrlNavigation),n.paramsInheritanceStrategy&&(t.paramsInheritanceStrategy=n.paramsInheritanceStrategy),n.relativeLinkResolution&&(t.relativeLinkResolution=n.relativeLinkResolution),n.urlUpdateStrategy&&(t.urlUpdateStrategy=n.urlUpdateStrategy),n.canceledNavigationResolution&&(t.canceledNavigationResolution=n.canceledNavigationResolution)}(o,u),o.enableTracing&&u.events.subscribe(c=>{var d,f;null===(d=console.group)||void 0===d||d.call(console,`Router Event: ${c.constructor.name}`),console.log(c.toString()),console.log(c),null===(f=console.groupEnd)||void 0===f||f.call(console)}),u},deps:[Nb,Fo,ff,Je,nl,Xf,ii,[class W1{},new Ft],[class $1{},new Ft]]},Fo,{provide:ni,useFactory:function cL(n){return n.routerState.root},deps:[Lt]},gD,pD,class nL{preload(t,e){return e().pipe(tr(()=>B(null)))}},{provide:ii,useValue:{enableTracing:!1}}];function iL(){return new dC("Router",Lt)}let yD=(()=>{class n{constructor(e,r){}static forRoot(e,r){return{ngModule:n,providers:[rL,_D(e),{provide:mD,useFactory:aL,deps:[[Lt,new Ft,new $r]]},{provide:ii,useValue:r||{}},{provide:ls,useFactory:oL,deps:[Zr,[new zs(df),new Ft],ii]},{provide:eh,useFactory:sL,deps:[Lt,dk,ii]},{provide:hD,useExisting:r&&r.preloadingStrategy?r.preloadingStrategy:pD},{provide:dC,multi:!0,useFactory:iL},[th,{provide:tl,multi:!0,useFactory:dL,deps:[th]},{provide:vD,useFactory:fL,deps:[th]},{provide:Zd,multi:!0,useExisting:vD}]]}}static forChild(e){return{ngModule:n,providers:[_D(e)]}}}return n.\u0275fac=function(e){return new(e||n)(D(mD,8),D(Lt,8))},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({}),n})();function sL(n,t,e){return e.scrollOffset&&t.setOffset(e.scrollOffset),new eh(n,t,e)}function oL(n,t,e={}){return e.useHash?new QO(n,t):new OC(n,t)}function aL(n){return"guarded"}function _D(n){return[{provide:wM,multi:!0,useValue:n},{provide:Xf,multi:!0,useValue:n}]}let th=(()=>{class n{constructor(e){this.injector=e,this.initNavigation=!1,this.destroyed=!1,this.resultOfPreactivationDone=new Xe}appInitializer(){return this.injector.get(zO,Promise.resolve(null)).then(()=>{if(this.destroyed)return Promise.resolve(!0);let r=null;const i=new Promise(a=>r=a),s=this.injector.get(Lt),o=this.injector.get(ii);return"disabled"===o.initialNavigation?(s.setUpLocationChangeListener(),r(!0)):"enabled"===o.initialNavigation||"enabledBlocking"===o.initialNavigation?(s.hooks.afterPreactivation=()=>this.initNavigation?B(null):(this.initNavigation=!0,r(!0),this.resultOfPreactivationDone),s.initialNavigation()):r(!0),i})}bootstrapListener(e){const r=this.injector.get(ii),i=this.injector.get(gD),s=this.injector.get(eh),o=this.injector.get(Lt),a=this.injector.get(vo);e===a.components[0]&&(("enabledNonBlocking"===r.initialNavigation||void 0===r.initialNavigation)&&o.initialNavigation(),i.setUpPreloading(),s.init(),o.resetRootComponentType(a.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}ngOnDestroy(){this.destroyed=!0}}return n.\u0275fac=function(e){return new(e||n)(D(Je))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();function dL(n){return n.appInitializer.bind(n)}function fL(n){return n.bootstrapListener.bind(n)}const vD=new F("Router Initializer"),pL=new F("cdk-dir-doc",{providedIn:"root",factory:function gL(){return $s(ye)}}),mL=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;let nh=(()=>{class n{constructor(e){if(this.value="ltr",this.change=new we,e){const i=e.documentElement?e.documentElement.dir:null;this.value=function yL(n){const t=(null==n?void 0:n.toLowerCase())||"";return"auto"===t&&"undefined"!=typeof navigator&&(null==navigator?void 0:navigator.language)?mL.test(navigator.language)?"rtl":"ltr":"rtl"===t?"rtl":"ltr"}((e.body?e.body.dir:null)||i||"ltr")}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(e){return new(e||n)(D(pL,8))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),rh=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({}),n})();function CD(n){for(let t in n){let e=n[t]||"";switch(t){case"display":n.display="flex"===e?["-webkit-flex","flex"]:"inline-flex"===e?["-webkit-inline-flex","inline-flex"]:e;break;case"align-items":case"align-self":case"align-content":case"flex":case"flex-basis":case"flex-flow":case"flex-grow":case"flex-shrink":case"flex-wrap":case"justify-content":n["-webkit-"+t]=e;break;case"flex-direction":e=e||"row",n["-webkit-flex-direction"]=e,n["flex-direction"]=e;break;case"order":n.order=n["-webkit-"+t]=isNaN(+e)?"0":e}}return n}const ih="inline",Hl=["row","column","row-reverse","column-reverse"];function bD(n){let[t,e,r]=DD(n);return function vL(n,t=null,e=!1){return{display:e?"inline-flex":"flex","box-sizing":"border-box","flex-direction":n,"flex-wrap":t||null}}(t,e,r)}function DD(n){n=n?n.toLowerCase():"";let[t,e,r]=n.split(" ");return Hl.find(i=>i===t)||(t=Hl[0]),e===ih&&(e=r!==ih?r:"",r=ih),[t,_L(e),!!r]}function ko(n){let[t]=DD(n);return t.indexOf("row")>-1}function _L(n){if(n)switch(n.toLowerCase()){case"reverse":case"wrap-reverse":case"reverse-wrap":n="wrap-reverse";break;case"no":case"none":case"nowrap":n="nowrap";break;default:n="wrap"}return n}function ir(n,...t){if(null==n)throw TypeError("Cannot convert undefined or null to object");for(let e of t)if(null!=e)for(let r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}const bL={provide:Zd,useFactory:function CL(n,t){return()=>{if(Xr(t)){const e=Array.from(n.querySelectorAll(`[class*=${ED}]`)),r=/\bflex-layout-.+?\b/g;e.forEach(i=>{i.classList.contains(`${ED}ssr`)&&i.parentNode?i.parentNode.removeChild(i):i.className.replace(r,"")})}}},deps:[ye,Xt],multi:!0},ED="flex-layout-";let sh=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({providers:[bL]}),n})();class si{constructor(t=!1,e="all",r="",i="",s=0){this.matches=t,this.mediaQuery=e,this.mqAlias=r,this.suffix=i,this.priority=s,this.property=""}clone(){return new si(this.matches,this.mediaQuery,this.mqAlias,this.suffix)}}let DL=(()=>{class n{constructor(){this.stylesheet=new Map}addStyleToElement(e,r,i){const s=this.stylesheet.get(e);s?s.set(r,i):this.stylesheet.set(e,new Map([[r,i]]))}clearStyles(){this.stylesheet.clear()}getStyleForElement(e,r){const i=this.stylesheet.get(e);let s="";if(i){const o=i.get(r);("number"==typeof o||"string"==typeof o)&&(s=o+"")}return s}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const oh={addFlexToParent:!0,addOrientationBps:!1,disableDefaultBps:!1,disableVendorPrefixes:!1,serverLoaded:!1,useColumnBasisZero:!0,printWithBreakpoints:[],mediaTriggerAutoRestore:!0,ssrObserveBreakpoints:[]},xr=new F("Flex Layout token, config options for the library",{providedIn:"root",factory:()=>oh}),gs=new F("FlexLayoutServerLoaded",{providedIn:"root",factory:()=>!1}),ah=new F("Flex Layout token, collect all breakpoints into one provider",{providedIn:"root",factory:()=>null});function wD(n,t){return n=n?n.clone():new si,t&&(n.mqAlias=t.alias,n.mediaQuery=t.mediaQuery,n.suffix=t.suffix,n.priority=t.priority),n}class Ne{constructor(){this.shouldCache=!0}sideEffect(t,e,r){}}let be=(()=>{class n{constructor(e,r,i,s){this._serverStylesheet=e,this._serverModuleLoaded=r,this._platformId=i,this.layoutConfig=s}applyStyleToElement(e,r,i=null){let s={};"string"==typeof r&&(s[r]=i,r=s),s=this.layoutConfig.disableVendorPrefixes?r:CD(r),this._applyMultiValueStyleToElement(s,e)}applyStyleToElements(e,r=[]){const i=this.layoutConfig.disableVendorPrefixes?e:CD(e);r.forEach(s=>{this._applyMultiValueStyleToElement(i,s)})}getFlowDirection(e){const r="flex-direction";let i=this.lookupStyle(e,r);return[i||"row",this.lookupInlineStyle(e,r)||us(this._platformId)&&this._serverModuleLoaded?i:""]}hasWrap(e){return"wrap"===this.lookupStyle(e,"flex-wrap")}lookupAttributeValue(e,r){return e.getAttribute(r)||""}lookupInlineStyle(e,r){return Xr(this._platformId)?e.style.getPropertyValue(r):this._getServerStyle(e,r)}lookupStyle(e,r,i=!1){let s="";return e&&((s=this.lookupInlineStyle(e,r))||(Xr(this._platformId)?i||(s=getComputedStyle(e).getPropertyValue(r)):this._serverModuleLoaded&&(s=this._serverStylesheet.getStyleForElement(e,r)))),s?s.trim():""}_applyMultiValueStyleToElement(e,r){Object.keys(e).sort().forEach(i=>{const s=e[i],o=Array.isArray(s)?s:[s];o.sort();for(let a of o)a=a?a+"":"",Xr(this._platformId)||!this._serverModuleLoaded?Xr(this._platformId)?r.style.setProperty(i,a):this._setServerStyle(r,i,a):this._serverStylesheet.addStyleToElement(r,i,a)})}_setServerStyle(e,r,i){r=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();const s=this._readStyleAttribute(e);s[r]=i||"",this._writeStyleAttribute(e,s)}_getServerStyle(e,r){return this._readStyleAttribute(e)[r]||""}_readStyleAttribute(e){const r={},i=e.getAttribute("style");if(i){const s=i.split(/;+/g);for(let o=0;o<s.length;o++){const a=s[o].trim();if(a.length>0){const l=a.indexOf(":");if(-1===l)throw new Error(`Invalid CSS style: ${a}`);r[a.substr(0,l).trim()]=a.substr(l+1).trim()}}}return r}_writeStyleAttribute(e,r){let i="";for(const s in r)r[s]&&(i+=s+":"+r[s]+";");e.setAttribute("style",i)}}return n.\u0275fac=function(e){return new(e||n)(D(DL),D(gs),D(Xt),D(xr))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function Po(n,t){return(t&&t.priority||0)-(n&&n.priority||0)}function EL(n,t){return(n.priority||0)-(t.priority||0)}let lh=(()=>{class n{constructor(e,r,i){this._zone=e,this._platformId=r,this._document=i,this.source=new tn(new si(!0)),this.registry=new Map,this.pendingRemoveListenerFns=[],this._observable$=this.source.asObservable()}get activations(){const e=[];return this.registry.forEach((r,i)=>{r.matches&&e.push(i)}),e}isActive(e){const r=this.registry.get(e);return r?r.matches:this.registerQuery(e).some(i=>i.matches)}observe(e,r=!1){if(e&&e.length){const i=this._observable$.pipe(kn(o=>!r||e.indexOf(o.mediaQuery)>-1));return ta(new de(o=>{const a=this.registerQuery(e);if(a.length){const l=a.pop();a.forEach(u=>{o.next(u)}),this.source.next(l)}o.complete()}),i)}return this._observable$}registerQuery(e){const r=Array.isArray(e)?e:[e],i=[];return function wL(n,t){const e=n.filter(r=>!xD[r]);if(e.length>0){const r=e.join(", ");try{const i=t.createElement("style");i.setAttribute("type","text/css"),i.styleSheet||i.appendChild(t.createTextNode(`\n/*\n @angular/flex-layout - workaround for possible browser quirk with mediaQuery listeners\n see http://bit.ly/2sd4HMP\n*/\n@media ${r} {.fx-query-test{ }}\n`)),t.head.appendChild(i),e.forEach(s=>xD[s]=i)}catch(i){console.error(i)}}}(r,this._document),r.forEach(s=>{const o=l=>{this._zone.run(()=>this.source.next(new si(l.matches,s)))};let a=this.registry.get(s);a||(a=this.buildMQL(s),a.addListener(o),this.pendingRemoveListenerFns.push(()=>a.removeListener(o)),this.registry.set(s,a)),a.matches&&i.push(new si(!0,s))}),i}ngOnDestroy(){let e;for(;e=this.pendingRemoveListenerFns.pop();)e()}buildMQL(e){return function xL(n,t){return t&&window.matchMedia("all").addListener?window.matchMedia(n):{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{},onchange:null,addEventListener(){},removeEventListener(){},dispatchEvent:()=>!1}}(e,Xr(this._platformId))}}return n.\u0275fac=function(e){return new(e||n)(D(ce),D(Xt),D(ye))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const xD={},AL=[{alias:"xs",mediaQuery:"screen and (min-width: 0px) and (max-width: 599.98px)",priority:1e3},{alias:"sm",mediaQuery:"screen and (min-width: 600px) and (max-width: 959.98px)",priority:900},{alias:"md",mediaQuery:"screen and (min-width: 960px) and (max-width: 1279.98px)",priority:800},{alias:"lg",mediaQuery:"screen and (min-width: 1280px) and (max-width: 1919.98px)",priority:700},{alias:"xl",mediaQuery:"screen and (min-width: 1920px) and (max-width: 4999.98px)",priority:600},{alias:"lt-sm",overlapping:!0,mediaQuery:"screen and (max-width: 599.98px)",priority:950},{alias:"lt-md",overlapping:!0,mediaQuery:"screen and (max-width: 959.98px)",priority:850},{alias:"lt-lg",overlapping:!0,mediaQuery:"screen and (max-width: 1279.98px)",priority:750},{alias:"lt-xl",overlapping:!0,priority:650,mediaQuery:"screen and (max-width: 1919.98px)"},{alias:"gt-xs",overlapping:!0,mediaQuery:"screen and (min-width: 600px)",priority:-950},{alias:"gt-sm",overlapping:!0,mediaQuery:"screen and (min-width: 960px)",priority:-850},{alias:"gt-md",overlapping:!0,mediaQuery:"screen and (min-width: 1280px)",priority:-750},{alias:"gt-lg",overlapping:!0,mediaQuery:"screen and (min-width: 1920px)",priority:-650}],AD="(orientation: portrait) and (max-width: 599.98px)",MD="(orientation: landscape) and (max-width: 959.98px)",SD="(orientation: portrait) and (min-width: 600px) and (max-width: 839.98px)",TD="(orientation: landscape) and (min-width: 960px) and (max-width: 1279.98px)",ID="(orientation: portrait) and (min-width: 840px)",FD="(orientation: landscape) and (min-width: 1280px)",sr={HANDSET:`${AD}, ${MD}`,TABLET:`${SD} , ${TD}`,WEB:`${ID}, ${FD} `,HANDSET_PORTRAIT:`${AD}`,TABLET_PORTRAIT:`${SD} `,WEB_PORTRAIT:`${ID}`,HANDSET_LANDSCAPE:`${MD}`,TABLET_LANDSCAPE:`${TD}`,WEB_LANDSCAPE:`${FD}`},ML=[{alias:"handset",priority:2e3,mediaQuery:sr.HANDSET},{alias:"handset.landscape",priority:2e3,mediaQuery:sr.HANDSET_LANDSCAPE},{alias:"handset.portrait",priority:2e3,mediaQuery:sr.HANDSET_PORTRAIT},{alias:"tablet",priority:2100,mediaQuery:sr.TABLET},{alias:"tablet.landscape",priority:2100,mediaQuery:sr.TABLET_LANDSCAPE},{alias:"tablet.portrait",priority:2100,mediaQuery:sr.TABLET_PORTRAIT},{alias:"web",priority:2200,mediaQuery:sr.WEB,overlapping:!0},{alias:"web.landscape",priority:2200,mediaQuery:sr.WEB_LANDSCAPE,overlapping:!0},{alias:"web.portrait",priority:2200,mediaQuery:sr.WEB_PORTRAIT,overlapping:!0}],SL=/(\.|-|_)/g;function TL(n){let t=n.length>0?n.charAt(0):"",e=n.length>1?n.slice(1):"";return t.toUpperCase()+e}const OL=new F("Token (@angular/flex-layout) Breakpoints",{providedIn:"root",factory:()=>{const n=$s(ah),t=$s(xr),e=[].concat.apply([],(n||[]).map(i=>Array.isArray(i)?i:[i]));return function RL(n,t=[]){const e={};return n.forEach(r=>{e[r.alias]=r}),t.forEach(r=>{e[r.alias]?ir(e[r.alias],r):e[r.alias]=r}),function FL(n){return n.forEach(t=>{t.suffix||(t.suffix=function IL(n){return n.replace(SL,"|").split("|").map(TL).join("")}(t.alias),t.overlapping=!!t.overlapping)}),n}(Object.keys(e).map(r=>e[r]))}((t.disableDefaultBps?[]:AL).concat(t.addOrientationBps?ML:[]),e)}});let uh=(()=>{class n{constructor(e){this.findByMap=new Map,this.items=[...e].sort(EL)}findByAlias(e){return e?this.findWithPredicate(e,r=>r.alias==e):null}findByQuery(e){return this.findWithPredicate(e,r=>r.mediaQuery==e)}get overlappings(){return this.items.filter(e=>1==e.overlapping)}get aliases(){return this.items.map(e=>e.alias)}get suffixes(){return this.items.map(e=>e.suffix?e.suffix:"")}findWithPredicate(e,r){let i=this.findByMap.get(e);return i||(i=this.items.find(r)||null,this.findByMap.set(e,i)),i||null}}return n.\u0275fac=function(e){return new(e||n)(D(OL))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const ms="print",NL={alias:ms,mediaQuery:ms,priority:1e3};let kL=(()=>{class n{constructor(e,r,i){this.breakpoints=e,this.layoutConfig=r,this._document=i,this.registeredBeforeAfterPrintHooks=!1,this.isPrintingBeforeAfterEvent=!1,this.beforePrintEventListeners=[],this.afterPrintEventListeners=[],this.isPrinting=!1,this.queue=new PL,this.deactivations=[]}withPrintQuery(e){return[...e,ms]}isPrintEvent(e){return e.mediaQuery.startsWith(ms)}get printAlias(){return this.layoutConfig.printWithBreakpoints||[]}get printBreakPoints(){return this.printAlias.map(e=>this.breakpoints.findByAlias(e)).filter(e=>null!==e)}getEventBreakpoints({mediaQuery:e}){const r=this.breakpoints.findByQuery(e);return(r?[...this.printBreakPoints,r]:this.printBreakPoints).sort(Po)}updateEvent(e){let r=this.breakpoints.findByQuery(e.mediaQuery);return this.isPrintEvent(e)&&(r=this.getEventBreakpoints(e)[0],e.mediaQuery=r?r.mediaQuery:""),wD(e,r)}registerBeforeAfterPrintHooks(e){if(!this._document.defaultView||this.registeredBeforeAfterPrintHooks)return;this.registeredBeforeAfterPrintHooks=!0;const r=()=>{this.isPrinting||(this.isPrintingBeforeAfterEvent=!0,this.startPrinting(e,this.getEventBreakpoints(new si(!0,ms))),e.updateStyles())},i=()=>{this.isPrintingBeforeAfterEvent=!1,this.isPrinting&&(this.stopPrinting(e),e.updateStyles())};this._document.defaultView.addEventListener("beforeprint",r),this._document.defaultView.addEventListener("afterprint",i),this.beforePrintEventListeners.push(r),this.afterPrintEventListeners.push(i)}interceptEvents(e){return this.registerBeforeAfterPrintHooks(e),r=>{this.isPrintEvent(r)?r.matches&&!this.isPrinting?(this.startPrinting(e,this.getEventBreakpoints(r)),e.updateStyles()):!r.matches&&this.isPrinting&&!this.isPrintingBeforeAfterEvent&&(this.stopPrinting(e),e.updateStyles()):this.collectActivations(r)}}blockPropagation(){return e=>!(this.isPrinting||this.isPrintEvent(e))}startPrinting(e,r){this.isPrinting=!0,e.activatedBreakpoints=this.queue.addPrintBreakpoints(r)}stopPrinting(e){e.activatedBreakpoints=this.deactivations,this.deactivations=[],this.queue.clear(),this.isPrinting=!1}collectActivations(e){if(!this.isPrinting||this.isPrintingBeforeAfterEvent)if(e.matches)this.isPrintingBeforeAfterEvent||(this.deactivations=[]);else{const r=this.breakpoints.findByQuery(e.mediaQuery);r&&(this.deactivations.push(r),this.deactivations.sort(Po))}}ngOnDestroy(){this._document.defaultView&&(this.beforePrintEventListeners.forEach(e=>this._document.defaultView.removeEventListener("beforeprint",e)),this.afterPrintEventListeners.forEach(e=>this._document.defaultView.removeEventListener("afterprint",e)))}}return n.\u0275fac=function(e){return new(e||n)(D(uh),D(xr),D(ye))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();class PL{constructor(){this.printBreakpoints=[]}addPrintBreakpoints(t){return t.push(NL),t.sort(Po),t.forEach(e=>this.addBreakpoint(e)),this.printBreakpoints}addBreakpoint(t){t&&void 0===this.printBreakpoints.find(r=>r.mediaQuery===t.mediaQuery)&&(this.printBreakpoints=function LL(n){return!!n&&n.mediaQuery.startsWith(ms)}(t)?[t,...this.printBreakpoints]:[...this.printBreakpoints,t])}clear(){this.printBreakpoints=[]}}let xe=(()=>{class n{constructor(e,r,i){this.matchMedia=e,this.breakpoints=r,this.hook=i,this.activatedBreakpoints=[],this.elementMap=new Map,this.elementKeyMap=new WeakMap,this.watcherMap=new WeakMap,this.updateMap=new WeakMap,this.clearMap=new WeakMap,this.subject=new Xe,this.observeActivations()}get activatedAlias(){return this.activatedBreakpoints[0]?this.activatedBreakpoints[0].alias:""}onMediaChange(e){const r=this.findByQuery(e.mediaQuery);r&&((e=wD(e,r)).matches&&-1===this.activatedBreakpoints.indexOf(r)?(this.activatedBreakpoints.push(r),this.activatedBreakpoints.sort(Po),this.updateStyles()):!e.matches&&-1!==this.activatedBreakpoints.indexOf(r)&&(this.activatedBreakpoints.splice(this.activatedBreakpoints.indexOf(r),1),this.activatedBreakpoints.sort(Po),this.updateStyles()))}init(e,r,i,s,o=[]){RD(this.updateMap,e,r,i),RD(this.clearMap,e,r,s),this.buildElementKeyMap(e,r),this.watchExtraTriggers(e,r,o)}getValue(e,r,i){const s=this.elementMap.get(e);if(s){const o=void 0!==i?s.get(i):this.getActivatedValues(s,r);if(o)return o.get(r)}}hasValue(e,r){const i=this.elementMap.get(e);if(i){const s=this.getActivatedValues(i,r);if(s)return void 0!==s.get(r)||!1}return!1}setValue(e,r,i,s){let o=this.elementMap.get(e);if(o){const l=(o.get(s)||new Map).set(r,i);o.set(s,l),this.elementMap.set(e,o)}else o=(new Map).set(s,(new Map).set(r,i)),this.elementMap.set(e,o);const a=this.getValue(e,r);void 0!==a&&this.updateElement(e,r,a)}trackValue(e,r){return this.subject.asObservable().pipe(kn(i=>i.element===e&&i.key===r))}updateStyles(){this.elementMap.forEach((e,r)=>{const i=new Set(this.elementKeyMap.get(r));let s=this.getActivatedValues(e);s&&s.forEach((o,a)=>{this.updateElement(r,a,o),i.delete(a)}),i.forEach(o=>{if(s=this.getActivatedValues(e,o),s){const a=s.get(o);this.updateElement(r,o,a)}else this.clearElement(r,o)})})}clearElement(e,r){const i=this.clearMap.get(e);if(i){const s=i.get(r);s&&(s(),this.subject.next({element:e,key:r,value:""}))}}updateElement(e,r,i){const s=this.updateMap.get(e);if(s){const o=s.get(r);o&&(o(i),this.subject.next({element:e,key:r,value:i}))}}releaseElement(e){const r=this.watcherMap.get(e);r&&(r.forEach(s=>s.unsubscribe()),this.watcherMap.delete(e));const i=this.elementMap.get(e);i&&(i.forEach((s,o)=>i.delete(o)),this.elementMap.delete(e))}triggerUpdate(e,r){const i=this.elementMap.get(e);if(i){const s=this.getActivatedValues(i,r);s&&(r?this.updateElement(e,r,s.get(r)):s.forEach((o,a)=>this.updateElement(e,a,o)))}}buildElementKeyMap(e,r){let i=this.elementKeyMap.get(e);i||(i=new Set,this.elementKeyMap.set(e,i)),i.add(r)}watchExtraTriggers(e,r,i){if(i&&i.length){let s=this.watcherMap.get(e);if(s||(s=new Map,this.watcherMap.set(e,s)),!s.get(r)){const a=ta(...i).subscribe(()=>{const l=this.getValue(e,r);this.updateElement(e,r,l)});s.set(r,a)}}}findByQuery(e){return this.breakpoints.findByQuery(e)}getActivatedValues(e,r){for(let s=0;s<this.activatedBreakpoints.length;s++){const a=e.get(this.activatedBreakpoints[s].alias);if(a&&(void 0===r||a.has(r)&&null!=a.get(r)))return a}const i=e.get("");return void 0===r||i&&i.has(r)?i:void 0}observeActivations(){const r=this.breakpoints.items.map(i=>i.mediaQuery);this.matchMedia.observe(this.hook.withPrintQuery(r)).pipe(et(this.hook.interceptEvents(this)),kn(this.hook.blockPropagation())).subscribe(this.onMediaChange.bind(this))}}return n.\u0275fac=function(e){return new(e||n)(D(lh),D(uh),D(kL))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function RD(n,t,e,r){if(void 0!==r){let i=n.get(t);i||(i=new Map,n.set(t,i)),i.set(e,r)}}let Se=(()=>{class n{constructor(e,r,i,s){this.elementRef=e,this.styleBuilder=r,this.styler=i,this.marshal=s,this.DIRECTIVE_KEY="",this.inputs=[],this.mru={},this.destroySubject=new Xe,this.styleCache=new Map}get parentElement(){return this.elementRef.nativeElement.parentElement}get nativeElement(){return this.elementRef.nativeElement}get activatedValue(){return this.marshal.getValue(this.nativeElement,this.DIRECTIVE_KEY)}set activatedValue(e){this.marshal.setValue(this.nativeElement,this.DIRECTIVE_KEY,e,this.marshal.activatedAlias)}ngOnChanges(e){Object.keys(e).forEach(r=>{if(-1!==this.inputs.indexOf(r)){const i=r.split(".").slice(1).join(".");this.setValue(e[r].currentValue,i)}})}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete(),this.marshal.releaseElement(this.nativeElement)}init(e=[]){this.marshal.init(this.elementRef.nativeElement,this.DIRECTIVE_KEY,this.updateWithValue.bind(this),this.clearStyles.bind(this),e)}addStyles(e,r){const i=this.styleBuilder,s=i.shouldCache;let o=this.styleCache.get(e);(!o||!s)&&(o=i.buildStyles(e,r),s&&this.styleCache.set(e,o)),this.mru=Object.assign({},o),this.applyStyleToElement(o),i.sideEffect(e,o,r)}clearStyles(){Object.keys(this.mru).forEach(e=>{this.mru[e]=""}),this.applyStyleToElement(this.mru),this.mru={}}triggerUpdate(){this.marshal.triggerUpdate(this.nativeElement,this.DIRECTIVE_KEY)}getFlexFlowDirection(e,r=!1){if(e){const[i,s]=this.styler.getFlowDirection(e);if(!s&&r){const o=bD(i);this.styler.applyStyleToElements(o,[e])}return i.trim()}return"row"}hasWrap(e){return this.styler.hasWrap(e)}applyStyleToElement(e,r,i=this.nativeElement){this.styler.applyStyleToElement(i,e,r)}setValue(e,r){this.marshal.setValue(this.nativeElement,this.DIRECTIVE_KEY,e,r)}updateWithValue(e){this.currentValue!==e&&(this.addStyles(e),this.currentValue=e)}}return n.\u0275fac=function(e){return new(e||n)(p($),p(Ne),p(be),p(xe))},n.\u0275dir=b({type:n,features:[st]}),n})();function or(n){return Ge((t,e)=>{$t(n).subscribe(new Le(e,()=>e.complete(),As)),!e.closed&&t.subscribe(e)})}let jL=(()=>{class n extends Ne{buildStyles(e){return bD(e)}}return n.\u0275fac=function(){let t;return function(r){return(t||(t=R(n)))(r||n)}}(),n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const HL=["fxLayout","fxLayout.xs","fxLayout.sm","fxLayout.md","fxLayout.lg","fxLayout.xl","fxLayout.lt-sm","fxLayout.lt-md","fxLayout.lt-lg","fxLayout.lt-xl","fxLayout.gt-xs","fxLayout.gt-sm","fxLayout.gt-md","fxLayout.gt-lg"];let UL=(()=>{class n extends Se{constructor(e,r,i,s){super(e,i,r,s),this.DIRECTIVE_KEY="layout",this.styleCache=GL,this.init()}}return n.\u0275fac=function(e){return new(e||n)(p($),p(be),p(jL),p(xe))},n.\u0275dir=b({type:n,features:[x]}),n})(),kD=(()=>{class n extends UL{constructor(){super(...arguments),this.inputs=HL}}return n.\u0275fac=function(){let t;return function(r){return(t||(t=R(n)))(r||n)}}(),n.\u0275dir=b({type:n,selectors:[["","fxLayout",""],["","fxLayout.xs",""],["","fxLayout.sm",""],["","fxLayout.md",""],["","fxLayout.lg",""],["","fxLayout.xl",""],["","fxLayout.lt-sm",""],["","fxLayout.lt-md",""],["","fxLayout.lt-lg",""],["","fxLayout.lt-xl",""],["","fxLayout.gt-xs",""],["","fxLayout.gt-sm",""],["","fxLayout.gt-md",""],["","fxLayout.gt-lg",""]],inputs:{fxLayout:"fxLayout","fxLayout.xs":"fxLayout.xs","fxLayout.sm":"fxLayout.sm","fxLayout.md":"fxLayout.md","fxLayout.lg":"fxLayout.lg","fxLayout.xl":"fxLayout.xl","fxLayout.lt-sm":"fxLayout.lt-sm","fxLayout.lt-md":"fxLayout.lt-md","fxLayout.lt-lg":"fxLayout.lt-lg","fxLayout.lt-xl":"fxLayout.lt-xl","fxLayout.gt-xs":"fxLayout.gt-xs","fxLayout.gt-sm":"fxLayout.gt-sm","fxLayout.gt-md":"fxLayout.gt-md","fxLayout.gt-lg":"fxLayout.gt-lg"},features:[x]}),n})();const GL=new Map,PD={"margin-left":null,"margin-right":null,"margin-top":null,"margin-bottom":null};let $L=(()=>{class n extends Ne{constructor(e){super(),this._styler=e}buildStyles(e,r){return e.endsWith(Ul)?function XL(n,t){const[e,r]=n.split(" "),s=u=>`-${u}`;let o="0px",a=s(r||e),l="0px";return"rtl"===t?l=s(e):o=s(e),{margin:`0px ${o} ${a} ${l}`}}(e=e.slice(0,e.indexOf(Ul)),r.directionality):{}}sideEffect(e,r,i){const s=i.items;if(e.endsWith(Ul)){const o=function ZL(n,t){const[e,r]=n.split(" ");let s="0px",a="0px";return"rtl"===t?a=e:s=e,{padding:`0px ${s} ${r||e} ${a}`}}(e=e.slice(0,e.indexOf(Ul)),i.directionality);this._styler.applyStyleToElements(o,i.items)}else{const o=s.pop(),a=function JL(n,t){const e=VD(t.directionality,t.layout),r=Object.assign({},PD);return r[e]=n,r}(e,i);this._styler.applyStyleToElements(a,s),this._styler.applyStyleToElements(PD,[o])}}}return n.\u0275fac=function(e){return new(e||n)(D(be))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const qL=["fxLayoutGap","fxLayoutGap.xs","fxLayoutGap.sm","fxLayoutGap.md","fxLayoutGap.lg","fxLayoutGap.xl","fxLayoutGap.lt-sm","fxLayoutGap.lt-md","fxLayoutGap.lt-lg","fxLayoutGap.lt-xl","fxLayoutGap.gt-xs","fxLayoutGap.gt-sm","fxLayoutGap.gt-md","fxLayoutGap.gt-lg"];let zL=(()=>{class n extends Se{constructor(e,r,i,s,o,a){super(e,o,s,a),this.zone=r,this.directionality=i,this.styleUtils=s,this.layout="row",this.DIRECTIVE_KEY="layout-gap",this.observerSubject=new Xe;const l=[this.directionality.change,this.observerSubject.asObservable()];this.init(l),this.marshal.trackValue(this.nativeElement,"layout").pipe(or(this.destroySubject)).subscribe(this.onLayoutChange.bind(this))}get childrenNodes(){const e=this.nativeElement.children,r=[];for(let i=e.length;i--;)r[i]=e[i];return r}ngAfterContentInit(){this.buildChildObservable(),this.triggerUpdate()}ngOnDestroy(){super.ngOnDestroy(),this.observer&&this.observer.disconnect()}onLayoutChange(e){const i=e.value.split(" ");this.layout=i[0],Hl.find(s=>s===this.layout)||(this.layout="row"),this.triggerUpdate()}updateWithValue(e){const r=this.childrenNodes.filter(i=>1===i.nodeType&&this.willDisplay(i)).sort((i,s)=>{const o=+this.styler.lookupStyle(i,"order"),a=+this.styler.lookupStyle(s,"order");return isNaN(o)||isNaN(a)||o===a?0:o>a?1:-1});if(r.length>0){const i=this.directionality.value,s=this.layout;"row"===s&&"rtl"===i?this.styleCache=WL:"row"===s&&"rtl"!==i?this.styleCache=QL:"column"===s&&"rtl"===i?this.styleCache=KL:"column"===s&&"rtl"!==i&&(this.styleCache=YL),this.addStyles(e,{directionality:i,items:r,layout:s})}}clearStyles(){const e=Object.keys(this.mru).length>0,r=e?"padding":VD(this.directionality.value,this.layout);e&&super.clearStyles(),this.styleUtils.applyStyleToElements({[r]:""},this.childrenNodes)}willDisplay(e){const r=this.marshal.getValue(e,"show-hide");return!0===r||void 0===r&&"none"!==this.styleUtils.lookupStyle(e,"display")}buildChildObservable(){this.zone.runOutsideAngular(()=>{"undefined"!=typeof MutationObserver&&(this.observer=new MutationObserver(e=>{e.some(i=>i.addedNodes&&i.addedNodes.length>0||i.removedNodes&&i.removedNodes.length>0)&&this.observerSubject.next()}),this.observer.observe(this.nativeElement,{childList:!0}))})}}return n.\u0275fac=function(e){return new(e||n)(p($),p(ce),p(nh),p(be),p($L),p(xe))},n.\u0275dir=b({type:n,features:[x]}),n})(),LD=(()=>{class n extends zL{constructor(){super(...arguments),this.inputs=qL}}return n.\u0275fac=function(){let t;return function(r){return(t||(t=R(n)))(r||n)}}(),n.\u0275dir=b({type:n,selectors:[["","fxLayoutGap",""],["","fxLayoutGap.xs",""],["","fxLayoutGap.sm",""],["","fxLayoutGap.md",""],["","fxLayoutGap.lg",""],["","fxLayoutGap.xl",""],["","fxLayoutGap.lt-sm",""],["","fxLayoutGap.lt-md",""],["","fxLayoutGap.lt-lg",""],["","fxLayoutGap.lt-xl",""],["","fxLayoutGap.gt-xs",""],["","fxLayoutGap.gt-sm",""],["","fxLayoutGap.gt-md",""],["","fxLayoutGap.gt-lg",""]],inputs:{fxLayoutGap:"fxLayoutGap","fxLayoutGap.xs":"fxLayoutGap.xs","fxLayoutGap.sm":"fxLayoutGap.sm","fxLayoutGap.md":"fxLayoutGap.md","fxLayoutGap.lg":"fxLayoutGap.lg","fxLayoutGap.xl":"fxLayoutGap.xl","fxLayoutGap.lt-sm":"fxLayoutGap.lt-sm","fxLayoutGap.lt-md":"fxLayoutGap.lt-md","fxLayoutGap.lt-lg":"fxLayoutGap.lt-lg","fxLayoutGap.lt-xl":"fxLayoutGap.lt-xl","fxLayoutGap.gt-xs":"fxLayoutGap.gt-xs","fxLayoutGap.gt-sm":"fxLayoutGap.gt-sm","fxLayoutGap.gt-md":"fxLayoutGap.gt-md","fxLayoutGap.gt-lg":"fxLayoutGap.gt-lg"},features:[x]}),n})();const WL=new Map,KL=new Map,QL=new Map,YL=new Map,Ul=" grid";function VD(n,t){switch(t){case"column":return"margin-bottom";case"column-reverse":return"margin-top";case"row":default:return"rtl"===n?"margin-left":"margin-right";case"row-reverse":return"rtl"===n?"margin-right":"margin-left"}}let IV=(()=>{class n extends Ne{buildStyles(e,r){const i={},[s,o]=e.split(" ");switch(s){case"center":i["justify-content"]="center";break;case"space-around":i["justify-content"]="space-around";break;case"space-between":i["justify-content"]="space-between";break;case"space-evenly":i["justify-content"]="space-evenly";break;case"end":case"flex-end":i["justify-content"]="flex-end";break;default:i["justify-content"]="flex-start"}switch(o){case"start":case"flex-start":i["align-items"]=i["align-content"]="flex-start";break;case"center":i["align-items"]=i["align-content"]="center";break;case"end":case"flex-end":i["align-items"]=i["align-content"]="flex-end";break;case"space-between":i["align-content"]="space-between",i["align-items"]="stretch";break;case"space-around":i["align-content"]="space-around",i["align-items"]="stretch";break;case"baseline":i["align-content"]="stretch",i["align-items"]="baseline";break;default:i["align-items"]=i["align-content"]="stretch"}return ir(i,{display:r.inline?"inline-flex":"flex","flex-direction":r.layout,"box-sizing":"border-box","max-width":"stretch"===o?ko(r.layout)?null:"100%":null,"max-height":"stretch"===o&&ko(r.layout)?"100%":null})}}return n.\u0275fac=function(){let t;return function(r){return(t||(t=R(n)))(r||n)}}(),n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const FV=["fxLayoutAlign","fxLayoutAlign.xs","fxLayoutAlign.sm","fxLayoutAlign.md","fxLayoutAlign.lg","fxLayoutAlign.xl","fxLayoutAlign.lt-sm","fxLayoutAlign.lt-md","fxLayoutAlign.lt-lg","fxLayoutAlign.lt-xl","fxLayoutAlign.gt-xs","fxLayoutAlign.gt-sm","fxLayoutAlign.gt-md","fxLayoutAlign.gt-lg"];let RV=(()=>{class n extends Se{constructor(e,r,i,s){super(e,i,r,s),this.DIRECTIVE_KEY="layout-align",this.layout="row",this.inline=!1,this.init(),this.marshal.trackValue(this.nativeElement,"layout").pipe(or(this.destroySubject)).subscribe(this.onLayoutChange.bind(this))}updateWithValue(e){const r=this.layout||"row",i=this.inline;"row"===r&&i?this.styleCache=LV:"row"!==r||i?"row-reverse"===r&&i?this.styleCache=BV:"row-reverse"!==r||i?"column"===r&&i?this.styleCache=VV:"column"!==r||i?"column-reverse"===r&&i?this.styleCache=jV:"column-reverse"===r&&!i&&(this.styleCache=PV):this.styleCache=NV:this.styleCache=kV:this.styleCache=OV,this.addStyles(e,{layout:r,inline:i})}onLayoutChange(e){const r=e.value.split(" ");this.layout=r[0],this.inline=e.value.includes("inline"),Hl.find(i=>i===this.layout)||(this.layout="row"),this.triggerUpdate()}}return n.\u0275fac=function(e){return new(e||n)(p($),p(be),p(IV),p(xe))},n.\u0275dir=b({type:n,features:[x]}),n})(),ch=(()=>{class n extends RV{constructor(){super(...arguments),this.inputs=FV}}return n.\u0275fac=function(){let t;return function(r){return(t||(t=R(n)))(r||n)}}(),n.\u0275dir=b({type:n,selectors:[["","fxLayoutAlign",""],["","fxLayoutAlign.xs",""],["","fxLayoutAlign.sm",""],["","fxLayoutAlign.md",""],["","fxLayoutAlign.lg",""],["","fxLayoutAlign.xl",""],["","fxLayoutAlign.lt-sm",""],["","fxLayoutAlign.lt-md",""],["","fxLayoutAlign.lt-lg",""],["","fxLayoutAlign.lt-xl",""],["","fxLayoutAlign.gt-xs",""],["","fxLayoutAlign.gt-sm",""],["","fxLayoutAlign.gt-md",""],["","fxLayoutAlign.gt-lg",""]],inputs:{fxLayoutAlign:"fxLayoutAlign","fxLayoutAlign.xs":"fxLayoutAlign.xs","fxLayoutAlign.sm":"fxLayoutAlign.sm","fxLayoutAlign.md":"fxLayoutAlign.md","fxLayoutAlign.lg":"fxLayoutAlign.lg","fxLayoutAlign.xl":"fxLayoutAlign.xl","fxLayoutAlign.lt-sm":"fxLayoutAlign.lt-sm","fxLayoutAlign.lt-md":"fxLayoutAlign.lt-md","fxLayoutAlign.lt-lg":"fxLayoutAlign.lt-lg","fxLayoutAlign.lt-xl":"fxLayoutAlign.lt-xl","fxLayoutAlign.gt-xs":"fxLayoutAlign.gt-xs","fxLayoutAlign.gt-sm":"fxLayoutAlign.gt-sm","fxLayoutAlign.gt-md":"fxLayoutAlign.gt-md","fxLayoutAlign.gt-lg":"fxLayoutAlign.gt-lg"},features:[x]}),n})();const OV=new Map,NV=new Map,kV=new Map,PV=new Map,LV=new Map,VV=new Map,BV=new Map,jV=new Map;let BD=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[sh,rh]]}),n})();function jD(...n){const t=Gp(n),{args:e,keys:r}=fb(n),i=new de(s=>{const{length:o}=e;if(!o)return void s.complete();const a=new Array(o);let l=o,u=o;for(let c=0;c<o;c++){let d=!1;$t(e[c]).subscribe(new Le(s,f=>{d||(d=!0,u--),a[c]=f},()=>l--,void 0,()=>{(!l||!d)&&(u||s.next(r?hb(r,a):a),s.complete())}))}});return t?i.pipe(Of(t)):i}let HD=(()=>{class n{constructor(e,r){this._renderer=e,this._elementRef=r,this.onChange=i=>{},this.onTouched=()=>{}}setProperty(e,r){this._renderer.setProperty(this._elementRef.nativeElement,e,r)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}}return n.\u0275fac=function(e){return new(e||n)(p(mn),p($))},n.\u0275dir=b({type:n}),n})(),oi=(()=>{class n extends HD{}return n.\u0275fac=function(){let t;return function(r){return(t||(t=R(n)))(r||n)}}(),n.\u0275dir=b({type:n,features:[x]}),n})();const Vn=new F("NgValueAccessor"),UV={provide:Vn,useExisting:ge(()=>Gl),multi:!0},$V=new F("CompositionEventMode");let Gl=(()=>{class n extends HD{constructor(e,r,i){super(e,r),this._compositionMode=i,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function GV(){const n=Nn()?Nn().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(e){this.setProperty("value",null==e?"":e)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}return n.\u0275fac=function(e){return new(e||n)(p(mn),p($),p($V,8))},n.\u0275dir=b({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,r){1&e&&je("input",function(s){return r._handleInput(s.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(s){return r._compositionEnd(s.target.value)})},features:[pe([UV]),x]}),n})();function Ar(n){return null==n||0===n.length}function GD(n){return null!=n&&"number"==typeof n.length}const ct=new F("NgValidators"),Mr=new F("NgAsyncValidators"),qV=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class zV{static min(t){return function $D(n){return t=>{if(Ar(t.value)||Ar(n))return null;const e=parseFloat(t.value);return!isNaN(e)&&e<n?{min:{min:n,actual:t.value}}:null}}(t)}static max(t){return function qD(n){return t=>{if(Ar(t.value)||Ar(n))return null;const e=parseFloat(t.value);return!isNaN(e)&&e>n?{max:{max:n,actual:t.value}}:null}}(t)}static required(t){return function zD(n){return Ar(n.value)?{required:!0}:null}(t)}static requiredTrue(t){return function WD(n){return!0===n.value?null:{required:!0}}(t)}static email(t){return function KD(n){return Ar(n.value)||qV.test(n.value)?null:{email:!0}}(t)}static minLength(t){return function QD(n){return t=>Ar(t.value)||!GD(t.value)?null:t.value.length<n?{minlength:{requiredLength:n,actualLength:t.value.length}}:null}(t)}static maxLength(t){return function YD(n){return t=>GD(t.value)&&t.value.length>n?{maxlength:{requiredLength:n,actualLength:t.value.length}}:null}(t)}static pattern(t){return function ZD(n){if(!n)return Lo;let t,e;return"string"==typeof n?(e="","^"!==n.charAt(0)&&(e+="^"),e+=n,"$"!==n.charAt(n.length-1)&&(e+="$"),t=new RegExp(e)):(e=n.toString(),t=n),r=>{if(Ar(r.value))return null;const i=r.value;return t.test(i)?null:{pattern:{requiredPattern:e,actualValue:i}}}}(t)}static nullValidator(t){return null}static compose(t){return rE(t)}static composeAsync(t){return iE(t)}}function Lo(n){return null}function XD(n){return null!=n}function JD(n){const t=oo(n)?Qe(n):n;return Cd(t),t}function eE(n){let t={};return n.forEach(e=>{t=null!=e?Object.assign(Object.assign({},t),e):t}),0===Object.keys(t).length?null:t}function tE(n,t){return t.map(e=>e(n))}function nE(n){return n.map(t=>function WV(n){return!n.validate}(t)?t:e=>t.validate(e))}function rE(n){if(!n)return null;const t=n.filter(XD);return 0==t.length?null:function(e){return eE(tE(e,t))}}function dh(n){return null!=n?rE(nE(n)):null}function iE(n){if(!n)return null;const t=n.filter(XD);return 0==t.length?null:function(e){return jD(tE(e,t).map(JD)).pipe(ee(eE))}}function fh(n){return null!=n?iE(nE(n)):null}function sE(n,t){return null===n?[t]:Array.isArray(n)?[...n,t]:[n,t]}function oE(n){return n._rawValidators}function aE(n){return n._rawAsyncValidators}function hh(n){return n?Array.isArray(n)?n:[n]:[]}function $l(n,t){return Array.isArray(n)?n.includes(t):n===t}function lE(n,t){const e=hh(t);return hh(n).forEach(i=>{$l(e,i)||e.push(i)}),e}function uE(n,t){return hh(t).filter(e=>!$l(n,e))}class cE{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=dh(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=fh(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}class ar extends cE{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class vt extends cE{get formDirective(){return null}get path(){return null}}class dE{constructor(t){this._cd=t}is(t){var e,r,i;return"submitted"===t?!!(null===(e=this._cd)||void 0===e?void 0:e.submitted):!!(null===(i=null===(r=this._cd)||void 0===r?void 0:r.control)||void 0===i?void 0:i[t])}}let fE=(()=>{class n extends dE{constructor(e){super(e)}}return n.\u0275fac=function(e){return new(e||n)(p(ar,2))},n.\u0275dir=b({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,r){2&e&&Qn("ng-untouched",r.is("untouched"))("ng-touched",r.is("touched"))("ng-pristine",r.is("pristine"))("ng-dirty",r.is("dirty"))("ng-valid",r.is("valid"))("ng-invalid",r.is("invalid"))("ng-pending",r.is("pending"))},features:[x]}),n})(),hE=(()=>{class n extends dE{constructor(e){super(e)}}return n.\u0275fac=function(e){return new(e||n)(p(vt,10))},n.\u0275dir=b({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(e,r){2&e&&Qn("ng-untouched",r.is("untouched"))("ng-touched",r.is("touched"))("ng-pristine",r.is("pristine"))("ng-dirty",r.is("dirty"))("ng-valid",r.is("valid"))("ng-invalid",r.is("invalid"))("ng-pending",r.is("pending"))("ng-submitted",r.is("submitted"))},features:[x]}),n})();function Vo(n,t){mh(n,t),t.valueAccessor.writeValue(n.value),function tB(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&gE(n,t)})}(n,t),function rB(n,t){const e=(r,i)=>{t.valueAccessor.writeValue(r),i&&t.viewToModelUpdate(r)};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e)})}(n,t),function nB(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&gE(n,t),"submit"!==n.updateOn&&n.markAsTouched()})}(n,t),function eB(n,t){if(t.valueAccessor.setDisabledState){const e=r=>{t.valueAccessor.setDisabledState(r)};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e)})}}(n,t)}function Wl(n,t,e=!0){const r=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(r),t.valueAccessor.registerOnTouched(r)),Ql(n,t),n&&(t._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function Kl(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function mh(n,t){const e=oE(n);null!==t.validator?n.setValidators(sE(e,t.validator)):"function"==typeof e&&n.setValidators([e]);const r=aE(n);null!==t.asyncValidator?n.setAsyncValidators(sE(r,t.asyncValidator)):"function"==typeof r&&n.setAsyncValidators([r]);const i=()=>n.updateValueAndValidity();Kl(t._rawValidators,i),Kl(t._rawAsyncValidators,i)}function Ql(n,t){let e=!1;if(null!==n){if(null!==t.validator){const i=oE(n);if(Array.isArray(i)&&i.length>0){const s=i.filter(o=>o!==t.validator);s.length!==i.length&&(e=!0,n.setValidators(s))}}if(null!==t.asyncValidator){const i=aE(n);if(Array.isArray(i)&&i.length>0){const s=i.filter(o=>o!==t.asyncValidator);s.length!==i.length&&(e=!0,n.setAsyncValidators(s))}}}const r=()=>{};return Kl(t._rawValidators,r),Kl(t._rawAsyncValidators,r),e}function gE(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function mE(n,t){mh(n,t)}function yE(n,t){n._syncPendingControls(),t.forEach(e=>{const r=e.control;"submit"===r.updateOn&&r._pendingChange&&(e.viewToModelUpdate(r._pendingValue),r._pendingChange=!1)})}function Yl(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}const Bo="VALID",Zl="INVALID",ys="PENDING",jo="DISABLED";function Ch(n){return(Dh(n)?n.validators:n)||null}function _E(n){return Array.isArray(n)?dh(n):n||null}function bh(n,t){return(Dh(t)?t.asyncValidators:n)||null}function vE(n){return Array.isArray(n)?fh(n):n||null}function Dh(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}const CE=n=>n instanceof wE,Eh=n=>n instanceof xh;function bE(n){return CE(n)?n.value:n.getRawValue()}function DE(n,t){const e=Eh(n),r=n.controls;if(!(e?Object.keys(r):r).length)throw new ne(1e3,"");if(!r[t])throw new ne(1001,"")}function EE(n,t){Eh(n),n._forEachChild((r,i)=>{if(void 0===t[i])throw new ne(1002,"")})}class wh{constructor(t,e){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=_E(this._rawValidators),this._composedAsyncValidatorFn=vE(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===Bo}get invalid(){return this.status===Zl}get pending(){return this.status==ys}get disabled(){return this.status===jo}get enabled(){return this.status!==jo}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=_E(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=vE(t)}addValidators(t){this.setValidators(lE(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(lE(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(uE(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(uE(t,this._rawAsyncValidators))}hasValidator(t){return $l(this._rawValidators,t)}hasAsyncValidator(t){return $l(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=ys,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=jo,this.errors=null,this._forEachChild(r=>{r.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(r=>r(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=Bo,this._forEachChild(r=>{r.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Bo||this.status===ys)&&this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?jo:Bo}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=ys,this._hasOwnPendingAsyncValidator=!0;const e=JD(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(r=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(r,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function aB(n,t,e){if(null==t||(Array.isArray(t)||(t=t.split(e)),Array.isArray(t)&&0===t.length))return null;let r=n;return t.forEach(i=>{r=Eh(r)?r.controls.hasOwnProperty(i)?r.controls[i]:null:(n=>n instanceof uB)(r)&&r.at(i)||null}),r}(this,t,".")}getError(t,e){const r=e?this.get(e):this;return r&&r.errors?r.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new we,this.statusChanges=new we}_calculateStatus(){return this._allControlsDisabled()?jo:this.errors?Zl:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ys)?ys:this._anyControlsHaveStatus(Zl)?Zl:Bo}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){Dh(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class wE extends wh{constructor(t=null,e,r){super(Ch(e),bh(r,e)),this._onChange=[],this._pendingChange=!1,this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(r=>r(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Yl(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Yl(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class xh extends wh{constructor(t,e,r){super(Ch(e),bh(r,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,r={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,r={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){EE(this,t),Object.keys(t).forEach(r=>{DE(this,r),this.controls[r].setValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(Object.keys(t).forEach(r=>{this.controls[r]&&this.controls[r].patchValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((r,i)=>{r.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,r)=>(t[r]=bE(e),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,r)=>!!r._syncPendingControls()||e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{const r=this.controls[e];r&&t(r,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const r=this.controls[e];if(this.contains(e)&&t(r))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,r)=>((e.enabled||this.disabled)&&(t[r]=e.value),t))}_reduceChildren(t,e){let r=t;return this._forEachChild((i,s)=>{r=e(r,i,s)}),r}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}}class uB extends wh{constructor(t,e,r){super(Ch(e),bh(r,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(t){return this.controls[t]}push(t,e={}){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(t,e,r={}){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:r.emitEvent})}removeAt(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(t,e,r={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){EE(this,t),t.forEach((r,i)=>{DE(this,i),this.at(i).setValue(r,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(t.forEach((r,i)=>{this.at(i)&&this.at(i).patchValue(r,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t=[],e={}){this._forEachChild((r,i)=>{r.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>bE(t))}clear(t={}){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}))}_syncPendingControls(){let t=this.controls.reduce((e,r)=>!!r._syncPendingControls()||e,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){this.controls.forEach((e,r)=>{t(e,r)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}const cB={provide:vt,useExisting:ge(()=>Uo)},Ho=(()=>Promise.resolve(null))();let Uo=(()=>{class n extends vt{constructor(e,r){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new we,this.form=new xh({},dh(e),fh(r))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){Ho.then(()=>{const r=this._findContainer(e.path);e.control=r.registerControl(e.name,e.control),Vo(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){Ho.then(()=>{const r=this._findContainer(e.path);r&&r.removeControl(e.name),Yl(this._directives,e)})}addFormGroup(e){Ho.then(()=>{const r=this._findContainer(e.path),i=new xh({});mE(i,e),r.registerControl(e.name,i),i.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){Ho.then(()=>{const r=this._findContainer(e.path);r&&r.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,r){Ho.then(()=>{this.form.get(e.path).setValue(r)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submitted=!0,yE(this.form,this._directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}}return n.\u0275fac=function(e){return new(e||n)(p(ct,10),p(Mr,10))},n.\u0275dir=b({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(e,r){1&e&&je("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[pe([cB]),x]}),n})();const fB={provide:ar,useExisting:ge(()=>Ah)},ME=(()=>Promise.resolve(null))();let Ah=(()=>{class n extends ar{constructor(e,r,i,s){super(),this.control=new wE,this._registered=!1,this.update=new we,this._parent=e,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=function _h(n,t){if(!t)return null;let e,r,i;return Array.isArray(t),t.forEach(s=>{s.constructor===Gl?e=s:function oB(n){return Object.getPrototypeOf(n.constructor)===oi}(s)?r=s:i=s}),i||r||e||null}(0,s)}ngOnChanges(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),function yh(n,t){if(!n.hasOwnProperty("model"))return!1;const e=n.model;return!!e.isFirstChange()||!Object.is(t,e.currentValue)}(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function zl(n,t){return[...t.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Vo(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(e){ME.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1})})}_updateDisabled(e){const r=e.isDisabled.currentValue,i=""===r||r&&"false"!==r;ME.then(()=>{i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(e){return new(e||n)(p(vt,9),p(ct,10),p(Mr,10),p(Vn,10))},n.\u0275dir=b({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[pe([fB]),x,st]}),n})(),SE=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275dir=b({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),n})(),IE=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({}),n})();const _B={provide:vt,useExisting:ge(()=>Xl)};let Xl=(()=>{class n extends vt{constructor(e,r){super(),this.validators=e,this.asyncValidators=r,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new we,this._setValidators(e),this._setAsyncValidators(r)}ngOnChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Ql(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){const r=this.form.get(e.path);return Vo(r,e),r.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),r}getControl(e){return this.form.get(e.path)}removeControl(e){Wl(e.control||null,e,!1),Yl(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,r){this.form.get(e.path).setValue(r)}onSubmit(e){return this.submitted=!0,yE(this.form,this.directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_updateDomValue(){this.directives.forEach(e=>{const r=e.control,i=this.form.get(e.path);r!==i&&(Wl(r||null,e),CE(i)&&(Vo(i,e),e.control=i))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){const r=this.form.get(e.path);mE(r,e),r.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){const r=this.form.get(e.path);r&&function iB(n,t){return Ql(n,t)}(r,e)&&r.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){mh(this.form,this),this._oldForm&&Ql(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(e){return new(e||n)(p(ct,10),p(Mr,10))},n.\u0275dir=b({type:n,selectors:[["","formGroup",""]],hostBindings:function(e,r){1&e&&je("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[pe([_B]),x,st]}),n})(),PB=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[IE]]}),n})(),LB=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[PB]}),n})();function xt(n){return null!=n&&"false"!=`${n}`}function Rh(n){return n instanceof $?n.nativeElement:n}class jB extends bt{constructor(t,e){super()}schedule(t,e=0){return this}}const Jl={setInterval(...n){const{delegate:t}=Jl;return((null==t?void 0:t.setInterval)||setInterval)(...n)},clearInterval(n){const{delegate:t}=Jl;return((null==t?void 0:t.clearInterval)||clearInterval)(n)},delegate:void 0},KE={now:()=>(KE.delegate||Date).now(),delegate:void 0};class $o{constructor(t,e=$o.now){this.schedulerActionCtor=t,this.now=e}schedule(t,e=0,r){return new this.schedulerActionCtor(this,t).schedule(r,e)}}$o.now=KE.now;const GB=new class UB extends $o{constructor(t,e=$o.now){super(t,e),this.actions=[],this._active=!1,this._scheduled=void 0}flush(t){const{actions:e}=this;if(this._active)return void e.push(t);let r;this._active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}}(class HB extends jB{constructor(t,e){super(t,e),this.scheduler=t,this.work=e,this.pending=!1}schedule(t,e=0){if(this.closed)return this;this.state=t;const r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this}requestAsyncId(t,e,r=0){return Jl.setInterval(t.flush.bind(t,this),r)}recycleAsyncId(t,e,r=0){if(null!=r&&this.delay===r&&!1===this.pending)return e;Jl.clearInterval(e)}execute(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,e){let i,r=!1;try{this.work(t)}catch(s){r=!0,i=s||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){const{id:t,scheduler:e}=this,{actions:r}=e;this.work=this.state=this.scheduler=null,this.pending=!1,gi(r,this),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null,super.unsubscribe()}}});let Oh,QE=(()=>{class n{create(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),qB=(()=>{class n{constructor(e){this._mutationObserverFactory=e,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((e,r)=>this._cleanupObserver(r))}observe(e){const r=Rh(e);return new de(i=>{const o=this._observeElement(r).subscribe(i);return()=>{o.unsubscribe(),this._unobserveElement(r)}})}_observeElement(e){if(this._observedElements.has(e))this._observedElements.get(e).count++;else{const r=new Xe,i=this._mutationObserverFactory.create(s=>r.next(s));i&&i.observe(e,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(e,{observer:i,stream:r,count:1})}return this._observedElements.get(e).stream}_unobserveElement(e){this._observedElements.has(e)&&(this._observedElements.get(e).count--,this._observedElements.get(e).count||this._cleanupObserver(e))}_cleanupObserver(e){if(this._observedElements.has(e)){const{observer:r,stream:i}=this._observedElements.get(e);r&&r.disconnect(),i.complete(),this._observedElements.delete(e)}}}return n.\u0275fac=function(e){return new(e||n)(D(QE))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),zB=(()=>{class n{constructor(e,r,i){this._contentObserver=e,this._elementRef=r,this._ngZone=i,this.event=new we,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(e){this._disabled=xt(e),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(e){this._debounce=function VB(n,t=0){return function BB(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):t}(e),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const e=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?e.pipe(function $B(n,t=GB){return Ge((e,r)=>{let i=null,s=null,o=null;const a=()=>{if(i){i.unsubscribe(),i=null;const u=s;s=null,r.next(u)}};function l(){const u=o+n,c=t.now();if(c<u)return i=this.schedule(void 0,u-c),void r.add(i);a()}e.subscribe(new Le(r,u=>{s=u,o=t.now(),i||(i=t.schedule(l,n),r.add(i))},()=>{a(),r.complete()},void 0,()=>{s=i=null}))})}(this.debounce)):e).subscribe(this.event)})}_unsubscribe(){var e;null===(e=this._currentSubscription)||void 0===e||e.unsubscribe()}}return n.\u0275fac=function(e){return new(e||n)(p(qB),p($),p(ce))},n.\u0275dir=b({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),WB=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({providers:[QE]}),n})();try{Oh="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){Oh=!1}let _s,eu=(()=>{class n{constructor(e){this._platformId=e,this.isBrowser=this._platformId?Xr(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!Oh)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(e){return new(e||n)(D(Xt))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),KB=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({}),n})();const ZE=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function XE(){if(_s)return _s;if("object"!=typeof document||!document)return _s=new Set(ZE),_s;let n=document.createElement("input");return _s=new Set(ZE.filter(t=>(n.setAttribute("type",t),n.type===t))),_s}let qo;function tu(n){return function QB(){if(null==qo&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>qo=!0}))}finally{qo=qo||!1}return qo}()?n:!!n.capture}const nw="cdk-high-contrast-black-on-white",rw="cdk-high-contrast-white-on-black",kh="cdk-high-contrast-active";let dj=(()=>{class n{constructor(e,r){this._platform=e,this._document=r}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);const r=this._document.defaultView||window,i=r&&r.getComputedStyle?r.getComputedStyle(e):null,s=(i&&i.backgroundColor||"").replace(/ /g,"");switch(e.remove(),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const e=this._document.body.classList;e.remove(kh),e.remove(nw),e.remove(rw),this._hasCheckedHighContrastMode=!0;const r=this.getHighContrastMode();1===r?(e.add(kh),e.add(nw)):2===r&&(e.add(kh),e.add(rw))}}}return n.\u0275fac=function(e){return new(e||n)(D(eu),D(ye))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const hj=new F("mat-sanity-checks",{providedIn:"root",factory:function fj(){return!0}});let zo=(()=>{class n{constructor(e,r,i){this._sanityChecks=r,this._document=i,this._hasDoneGlobalChecks=!1,e._applyBodyHighContrastModeCssClasses(),this._hasDoneGlobalChecks||(this._hasDoneGlobalChecks=!0)}_checkIsEnabled(e){return!function ZB(){return"undefined"!=typeof __karma__&&!!__karma__||"undefined"!=typeof jasmine&&!!jasmine||"undefined"!=typeof jest&&!!jest||"undefined"!=typeof Mocha&&!!Mocha}()&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[e])}}return n.\u0275fac=function(e){return new(e||n)(D(dj),D(hj,8),D(ye))},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[rh],rh]}),n})();function sw(n,t){return class extends n{constructor(...e){super(...e),this.defaultColor=t,this.color=t}get color(){return this._color}set color(e){const r=e||this.defaultColor;r!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),r&&this._elementRef.nativeElement.classList.add(`mat-${r}`),this._color=r)}}}function pj(n){return class extends n{constructor(...t){super(...t),this.stateChanges=new Xe,this.errorState=!1}updateErrorState(){const t=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==t&&(this.errorState=s,this.stateChanges.next())}}}let ow=(()=>{class n{isErrorState(e,r){return!!(e&&e.invalid&&(e.touched||r&&r.submitted))}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const Cj=["addListener","removeListener"],bj=["addEventListener","removeEventListener"],Dj=["on","off"];function Lh(n,t,e,r){if(se(e)&&(r=e,e=void 0),r)return Lh(n,t,e).pipe(Of(r));const[i,s]=function xj(n){return se(n.addEventListener)&&se(n.removeEventListener)}(n)?bj.map(o=>a=>n[o](t,a,e)):function Ej(n){return se(n.addListener)&&se(n.removeListener)}(n)?Cj.map(cw(n,t)):function wj(n){return se(n.on)&&se(n.off)}(n)?Dj.map(cw(n,t)):[];if(!i&&Fu(n))return $e(o=>Lh(o,t,e))($t(n));if(!i)throw new TypeError("Invalid event target");return new de(o=>{const a=(...l)=>o.next(1<l.length?l:l[0]);return i(a),()=>s(a)})}function cw(n,t){return e=>r=>n[e](t,r)}class dw{}const lr="*";function Mj(n,t){return{type:7,name:n,definitions:t,options:{}}}function Sj(n,t=null){return{type:4,styles:t,timings:n}}function fw(n,t=null){return{type:2,steps:n,options:t}}function ru(n){return{type:6,styles:n,offset:null}}function Tj(n,t,e){return{type:0,name:n,styles:t,options:e}}function Ij(n,t,e=null){return{type:1,expr:n,animation:t,options:e}}function hw(n){Promise.resolve(null).then(n)}class vs{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){hw(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(r=>r()),e.length=0}}class pw{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,r=0,i=0;const s=this.players.length;0==s?hw(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++e==s&&this._onFinish()}),o.onDestroy(()=>{++r==s&&this._onDestroy()}),o.onStart(()=>{++i==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(r=>{const i=r.totalTime?Math.min(1,e/r.totalTime):1;r.setPosition(i)})}getPosition(){const t=this.players.reduce((e,r)=>null===e||r.totalTime>e.totalTime?r:e,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(r=>r()),e.length=0}}function gw(){return"undefined"!=typeof window&&void 0!==window.document}function Bh(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Sr(n){switch(n.length){case 0:return new vs;case 1:return n[0];default:return new pw(n)}}function mw(n,t,e,r,i={},s={}){const o=[],a=[];let l=-1,u=null;if(r.forEach(c=>{const d=c.offset,f=d==l,h=f&&u||{};Object.keys(c).forEach(g=>{let m=g,_=c[g];if("offset"!==g)switch(m=t.normalizePropertyName(m,o),_){case"!":_=i[g];break;case lr:_=s[g];break;default:_=t.normalizeStyleValue(g,m,_,o)}h[m]=_}),f||a.push(h),u=h,l=d}),o.length){const c="\n - ";throw new Error(`Unable to animate due to the following errors:${c}${o.join(c)}`)}return a}function jh(n,t,e,r){switch(t){case"start":n.onStart(()=>r(e&&Hh(e,"start",n)));break;case"done":n.onDone(()=>r(e&&Hh(e,"done",n)));break;case"destroy":n.onDestroy(()=>r(e&&Hh(e,"destroy",n)))}}function Hh(n,t,e){const r=e.totalTime,s=Uh(n.element,n.triggerName,n.fromState,n.toState,t||n.phaseName,null==r?n.totalTime:r,!!e.disabled),o=n._data;return null!=o&&(s._data=o),s}function Uh(n,t,e,r,i="",s=0,o){return{element:n,triggerName:t,fromState:e,toState:r,phaseName:i,totalTime:s,disabled:!!o}}function Vt(n,t,e){let r;return n instanceof Map?(r=n.get(t),r||n.set(t,r=e)):(r=n[t],r||(r=n[t]=e)),r}function yw(n){const t=n.indexOf(":");return[n.substring(1,t),n.substr(t+1)]}let Gh=(n,t)=>!1,_w=(n,t,e)=>[];(Bh()||"undefined"!=typeof Element)&&(Gh=gw()?(n,t)=>{for(;t&&t!==document.documentElement;){if(t===n)return!0;t=t.parentNode||t.host}return!1}:(n,t)=>n.contains(t),_w=(n,t,e)=>{if(e)return Array.from(n.querySelectorAll(t));const r=n.querySelector(t);return r?[r]:[]});let li=null,vw=!1;function $h(n){li||(li=function Rj(){return"undefined"!=typeof document?document.body:null}()||{},vw=!!li.style&&"WebkitAppearance"in li.style);let t=!0;return li.style&&!function Fj(n){return"ebkit"==n.substring(1,6)}(n)&&(t=n in li.style,!t&&vw&&(t="Webkit"+n.charAt(0).toUpperCase()+n.substr(1)in li.style)),t}const qh=Gh,zh=_w;function Cw(n){const t={};return Object.keys(n).forEach(e=>{const r=e.replace(/([a-z])([A-Z])/g,"$1-$2");t[r]=n[e]}),t}let bw=(()=>{class n{validateStyleProperty(e){return $h(e)}matchesElement(e,r){return!1}containsElement(e,r){return qh(e,r)}query(e,r,i){return zh(e,r,i)}computeStyle(e,r,i){return i||""}animate(e,r,i,s,o,a=[],l){return new vs(i,s)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})(),Wh=(()=>{class n{}return n.NOOP=new bw,n})();const Kh="ng-enter",iu="ng-leave",su="ng-trigger",ou=".ng-trigger",Ew="ng-animating",Qh=".ng-animating";function ui(n){if("number"==typeof n)return n;const t=n.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:Yh(parseFloat(t[1]),t[2])}function Yh(n,t){return"s"===t?1e3*n:n}function au(n,t,e){return n.hasOwnProperty("duration")?n:function kj(n,t,e){let i,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return t.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};i=Yh(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=Yh(parseFloat(l),a[4]));const u=a[5];u&&(o=u)}else i=n;if(!e){let a=!1,l=t.length;i<0&&(t.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(t.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&t.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:i,delay:s,easing:o}}(n,t,e)}function Cs(n,t={}){return Object.keys(n).forEach(e=>{t[e]=n[e]}),t}function Tr(n,t,e={}){if(t)for(let r in n)e[r]=n[r];else Cs(n,e);return e}function xw(n,t,e){return e?t+":"+e+";":""}function Aw(n){let t="";for(let e=0;e<n.style.length;e++){const r=n.style.item(e);t+=xw(0,r,n.style.getPropertyValue(r))}for(const e in n.style)n.style.hasOwnProperty(e)&&!e.startsWith("_")&&(t+=xw(0,Vj(e),n.style[e]));n.setAttribute("style",t)}function Bn(n,t,e){n.style&&(Object.keys(t).forEach(r=>{const i=Xh(r);e&&!e.hasOwnProperty(r)&&(e[r]=n.style[i]),n.style[i]=t[r]}),Bh()&&Aw(n))}function ci(n,t){n.style&&(Object.keys(t).forEach(e=>{const r=Xh(e);n.style[r]=""}),Bh()&&Aw(n))}function Ko(n){return Array.isArray(n)?1==n.length?n[0]:fw(n):n}const Zh=new RegExp("{{\\s*(.+?)\\s*}}","g");function Mw(n){let t=[];if("string"==typeof n){let e;for(;e=Zh.exec(n);)t.push(e[1]);Zh.lastIndex=0}return t}function lu(n,t,e){const r=n.toString(),i=r.replace(Zh,(s,o)=>{let a=t[o];return t.hasOwnProperty(o)||(e.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return i==r?n:i}function uu(n){const t=[];let e=n.next();for(;!e.done;)t.push(e.value),e=n.next();return t}const Lj=/-+([a-z0-9])/g;function Xh(n){return n.replace(Lj,(...t)=>t[1].toUpperCase())}function Vj(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Sw(n,t){return 0===n||0===t}function Tw(n,t,e){const r=Object.keys(e);if(r.length&&t.length){let s=t[0],o=[];if(r.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=e[a]}),o.length)for(var i=1;i<t.length;i++){let a=t[i];o.forEach(function(l){a[l]=Jh(n,l)})}}return t}function Bt(n,t,e){switch(t.type){case 7:return n.visitTrigger(t,e);case 0:return n.visitState(t,e);case 1:return n.visitTransition(t,e);case 2:return n.visitSequence(t,e);case 3:return n.visitGroup(t,e);case 4:return n.visitAnimate(t,e);case 5:return n.visitKeyframes(t,e);case 6:return n.visitStyle(t,e);case 8:return n.visitReference(t,e);case 9:return n.visitAnimateChild(t,e);case 10:return n.visitAnimateRef(t,e);case 11:return n.visitQuery(t,e);case 12:return n.visitStagger(t,e);default:throw new Error(`Unable to resolve animation metadata node #${t.type}`)}}function Jh(n,t){return window.getComputedStyle(n)[t]}function Bj(n,t){const e=[];return"string"==typeof n?n.split(/\s*,\s*/).forEach(r=>function jj(n,t,e){if(":"==n[0]){const l=function Hj(n,t){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,r)=>parseFloat(r)>parseFloat(e);case":decrement":return(e,r)=>parseFloat(r)<parseFloat(e);default:return t.push(`The transition alias value "${n}" is not supported`),"* => *"}}(n,e);if("function"==typeof l)return void t.push(l);n=l}const r=n.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==r||r.length<4)return e.push(`The provided transition expression "${n}" is not supported`),t;const i=r[1],s=r[2],o=r[3];t.push(Iw(i,o));"<"==s[0]&&!("*"==i&&"*"==o)&&t.push(Iw(o,i))}(r,e,t)):e.push(n),e}const du=new Set(["true","1"]),fu=new Set(["false","0"]);function Iw(n,t){const e=du.has(n)||fu.has(n),r=du.has(t)||fu.has(t);return(i,s)=>{let o="*"==n||n==i,a="*"==t||t==s;return!o&&e&&"boolean"==typeof i&&(o=i?du.has(n):fu.has(n)),!a&&r&&"boolean"==typeof s&&(a=s?du.has(t):fu.has(t)),o&&a}}const Uj=new RegExp("s*:selfs*,?","g");function ep(n,t,e){return new Gj(n).build(t,e)}class Gj{constructor(t){this._driver=t}build(t,e){const r=new zj(e);return this._resetContextStyleTimingState(r),Bt(this,Ko(t),r)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let r=e.queryCount=0,i=e.depCount=0;const s=[],o=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(a=>{if(this._resetContextStyleTimingState(e),0==a.type){const l=a,u=l.name;u.toString().split(/\s*,\s*/).forEach(c=>{l.name=c,s.push(this.visitState(l,e))}),l.name=u}else if(1==a.type){const l=this.visitTransition(a,e);r+=l.queryCount,i+=l.depCount,o.push(l)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:s,transitions:o,queryCount:r,depCount:i,options:null}}visitState(t,e){const r=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(r.containsDynamicStyles){const s=new Set,o=i||{};if(r.styles.forEach(a=>{if(hu(a)){const l=a;Object.keys(l).forEach(u=>{Mw(l[u]).forEach(c=>{o.hasOwnProperty(c)||s.add(c)})})}}),s.size){const a=uu(s.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:t.name,style:r,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const r=Bt(this,Ko(t.animation),e);return{type:1,matchers:Bj(t.expr,e.errors),animation:r,queryCount:e.queryCount,depCount:e.depCount,options:di(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(r=>Bt(this,r,e)),options:di(t.options)}}visitGroup(t,e){const r=e.currentTime;let i=0;const s=t.steps.map(o=>{e.currentTime=r;const a=Bt(this,o,e);return i=Math.max(i,e.currentTime),a});return e.currentTime=i,{type:3,steps:s,options:di(t.options)}}visitAnimate(t,e){const r=function Kj(n,t){let e=null;if(n.hasOwnProperty("duration"))e=n;else if("number"==typeof n)return tp(au(n,t).duration,0,"");const r=n;if(r.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=tp(0,0,"");return s.dynamic=!0,s.strValue=r,s}return e=e||au(r,t),tp(e.duration,e.delay,e.easing)}(t.timings,e.errors);e.currentAnimateTimings=r;let i,s=t.styles?t.styles:ru({});if(5==s.type)i=this.visitKeyframes(s,e);else{let o=t.styles,a=!1;if(!o){a=!0;const u={};r.easing&&(u.easing=r.easing),o=ru(u)}e.currentTime+=r.duration+r.delay;const l=this.visitStyle(o,e);l.isEmptyStep=a,i=l}return e.currentAnimateTimings=null,{type:4,timings:r,style:i,options:null}}visitStyle(t,e){const r=this._makeStyleAst(t,e);return this._validateStyleAst(r,e),r}_makeStyleAst(t,e){const r=[];Array.isArray(t.styles)?t.styles.forEach(o=>{"string"==typeof o?o==lr?r.push(o):e.errors.push(`The provided style string value ${o} is not allowed.`):r.push(o)}):r.push(t.styles);let i=!1,s=null;return r.forEach(o=>{if(hu(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!i)for(let u in a)if(a[u].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:r,easing:s,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const r=e.currentAnimateTimings;let i=e.currentTime,s=e.currentTime;r&&s>0&&(s-=r.duration+r.delay),t.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void e.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=e.collectedStyles[e.currentQuerySelector],u=l[a];let c=!0;u&&(s!=i&&s>=u.startTime&&i<=u.endTime&&(e.errors.push(`The CSS property "${a}" that exists between the times of "${u.startTime}ms" and "${u.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${i}ms"`),c=!1),s=u.startTime),c&&(l[a]={startTime:s,endTime:i}),e.options&&function Pj(n,t,e){const r=t.params||{},i=Mw(n);i.length&&i.forEach(s=>{r.hasOwnProperty(s)||e.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],e.options,e.errors)})})}visitKeyframes(t,e){const r={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),r;let s=0;const o=[];let a=!1,l=!1,u=0;const c=t.steps.map(v=>{const y=this._makeStyleAst(v,e);let E=null!=y.offset?y.offset:function Wj(n){if("string"==typeof n)return null;let t=null;if(Array.isArray(n))n.forEach(e=>{if(hu(e)&&e.hasOwnProperty("offset")){const r=e;t=parseFloat(r.offset),delete r.offset}});else if(hu(n)&&n.hasOwnProperty("offset")){const e=n;t=parseFloat(e.offset),delete e.offset}return t}(y.styles),T=0;return null!=E&&(s++,T=y.offset=E),l=l||T<0||T>1,a=a||T<u,u=T,o.push(T),y});l&&e.errors.push("Please ensure that all keyframe offsets are between 0 and 1"),a&&e.errors.push("Please ensure that all keyframe offsets are in order");const d=t.steps.length;let f=0;s>0&&s<d?e.errors.push("Not all style() steps within the declared keyframes() contain offsets"):0==s&&(f=1/(d-1));const h=d-1,g=e.currentTime,m=e.currentAnimateTimings,_=m.duration;return c.forEach((v,y)=>{const E=f>0?y==h?1:f*y:o[y],T=E*_;e.currentTime=g+m.delay+T,m.duration=T,this._validateStyleAst(v,e),v.offset=E,r.styles.push(v)}),r}visitReference(t,e){return{type:8,animation:Bt(this,Ko(t.animation),e),options:di(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:di(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:di(t.options)}}visitQuery(t,e){const r=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[s,o]=function $j(n){const t=!!n.split(/\s*,\s*/).find(e=>":self"==e);return t&&(n=n.replace(Uj,"")),n=n.replace(/@\*/g,ou).replace(/@\w+/g,e=>ou+"-"+e.substr(1)).replace(/:animating/g,Qh),[n,t]}(t.selector);e.currentQuerySelector=r.length?r+" "+s:s,Vt(e.collectedStyles,e.currentQuerySelector,{});const a=Bt(this,Ko(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=r,{type:11,selector:s,limit:i.limit||0,optional:!!i.optional,includeSelf:o,animation:a,originalSelector:t.selector,options:di(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const r="full"===t.timings?{duration:0,delay:0,easing:"full"}:au(t.timings,e.errors,!0);return{type:12,animation:Bt(this,Ko(t.animation),e),timings:r,options:null}}}class zj{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function hu(n){return!Array.isArray(n)&&"object"==typeof n}function di(n){return n?(n=Cs(n)).params&&(n.params=function qj(n){return n?Cs(n):null}(n.params)):n={},n}function tp(n,t,e){return{duration:n,delay:t,easing:e}}function np(n,t,e,r,i,s,o=null,a=!1){return{type:1,element:n,keyframes:t,preStyleProps:e,postStyleProps:r,duration:i,delay:s,totalTime:i+s,easing:o,subTimeline:a}}class pu{constructor(){this._map=new Map}get(t){return this._map.get(t)||[]}append(t,e){let r=this._map.get(t);r||this._map.set(t,r=[]),r.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const Zj=new RegExp(":enter","g"),Jj=new RegExp(":leave","g");function rp(n,t,e,r,i,s={},o={},a,l,u=[]){return(new eH).buildKeyframes(n,t,e,r,i,s,o,a,l,u)}class eH{buildKeyframes(t,e,r,i,s,o,a,l,u,c=[]){u=u||new pu;const d=new ip(t,e,u,i,s,c,[]);d.options=l,d.currentTimeline.setStyles([o],null,d.errors,l),Bt(this,r,d);const f=d.timelines.filter(h=>h.containsAnimation());if(Object.keys(a).length){let h;for(let g=f.length-1;g>=0;g--){const m=f[g];if(m.element===e){h=m;break}}h&&!h.allowOnlyTimelineStyles()&&h.setStyles([a],null,d.errors,l)}return f.length?f.map(h=>h.buildKeyframes()):[np(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const r=e.subInstructions.get(e.element);if(r){const i=e.createSubContext(t.options),s=e.currentTimeline.currentTime,o=this._visitSubInstructions(r,i,i.options);s!=o&&e.transformIntoNewTimeline(o)}e.previousNode=t}visitAnimateRef(t,e){const r=e.createSubContext(t.options);r.transformIntoNewTimeline(),this.visitReference(t.animation,r),e.transformIntoNewTimeline(r.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,r){let s=e.currentTimeline.currentTime;const o=null!=r.duration?ui(r.duration):null,a=null!=r.delay?ui(r.delay):null;return 0!==o&&t.forEach(l=>{const u=e.appendInstructionToTimeline(l,o,a);s=Math.max(s,u.duration+u.delay)}),s}visitReference(t,e){e.updateOptions(t.options,!0),Bt(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const r=e.subContextCount;let i=e;const s=t.options;if(s&&(s.params||s.delay)&&(i=e.createSubContext(s),i.transformIntoNewTimeline(),null!=s.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=gu);const o=ui(s.delay);i.delayNextStep(o)}t.steps.length&&(t.steps.forEach(o=>Bt(this,o,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const r=[];let i=e.currentTimeline.currentTime;const s=t.options&&t.options.delay?ui(t.options.delay):0;t.steps.forEach(o=>{const a=e.createSubContext(t.options);s&&a.delayNextStep(s),Bt(this,o,a),i=Math.max(i,a.currentTimeline.currentTime),r.push(a.currentTimeline)}),r.forEach(o=>e.currentTimeline.mergeTimelineCollectedStyles(o)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const r=t.strValue;return au(e.params?lu(r,e.params,e.errors):r,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const r=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;r.delay&&(e.incrementTime(r.delay),i.snapshotCurrentStyles());const s=t.style;5==s.type?this.visitKeyframes(s,e):(e.incrementTime(r.duration),this.visitStyle(s,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const r=e.currentTimeline,i=e.currentAnimateTimings;!i&&r.getCurrentStyleProperties().length&&r.forwardFrame();const s=i&&i.easing||t.easing;t.isEmptyStep?r.applyEmptyStep(s):r.setStyles(t.styles,s,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const r=e.currentAnimateTimings,i=e.currentTimeline.duration,s=r.duration,a=e.createSubContext().currentTimeline;a.easing=r.easing,t.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,e.errors,e.options),a.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(a),e.transformIntoNewTimeline(i+s),e.previousNode=t}visitQuery(t,e){const r=e.currentTimeline.currentTime,i=t.options||{},s=i.delay?ui(i.delay):0;s&&(6===e.previousNode.type||0==r&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=gu);let o=r;const a=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=a.length;let l=null;a.forEach((u,c)=>{e.currentQueryIndex=c;const d=e.createSubContext(t.options,u);s&&d.delayNextStep(s),u===e.element&&(l=d.currentTimeline),Bt(this,t.animation,d),d.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,d.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(o),l&&(e.currentTimeline.mergeTimelineCollectedStyles(l),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const r=e.parentContext,i=e.currentTimeline,s=t.timings,o=Math.abs(s.duration),a=o*(e.currentQueryTotal-1);let l=o*e.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=r.currentStaggerTime}const c=e.currentTimeline;l&&c.delayNextStep(l);const d=c.currentTime;Bt(this,t.animation,e),e.previousNode=t,r.currentStaggerTime=i.currentTime-d+(i.startTime-r.currentTimeline.startTime)}}const gu={};class ip{constructor(t,e,r,i,s,o,a,l){this._driver=t,this.element=e,this.subInstructions=r,this._enterClassName=i,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=gu,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new mu(this._driver,e,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const r=t;let i=this.options;null!=r.duration&&(i.duration=ui(r.duration)),null!=r.delay&&(i.delay=ui(r.delay));const s=r.params;if(s){let o=i.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!e||!o.hasOwnProperty(a))&&(o[a]=lu(s[a],o,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const r=t.params={};Object.keys(e).forEach(i=>{r[i]=e[i]})}}return t}createSubContext(t=null,e,r){const i=e||this.element,s=new ip(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(t),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(t){return this.previousNode=gu,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,r){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=r?r:0)+t.delay,easing:""},s=new tH(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(s),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,r,i,s,o){let a=[];if(i&&a.push(this.element),t.length>0){t=(t=t.replace(Zj,"."+this._enterClassName)).replace(Jj,"."+this._leaveClassName);let u=this._driver.query(this.element,t,1!=r);0!==r&&(u=r<0?u.slice(u.length+r,u.length):u.slice(0,r)),a.push(...u)}return!s&&0==a.length&&o.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),a}}class mu{constructor(t,e,r,i){this._driver=t,this.element=e,this.startTime=r,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new mu(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(e=>{this._backFill[e]=this._globalTimelineStyles[e]||lr,this._currentKeyframe[e]=lr}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,r,i){e&&(this._previousKeyframe.easing=e);const s=i&&i.params||{},o=function nH(n,t){const e={};let r;return n.forEach(i=>{"*"===i?(r=r||Object.keys(t),r.forEach(s=>{e[s]=lr})):Tr(i,!1,e)}),e}(t,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=lu(o[a],s,r);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:lr),this._updateStyle(a,l)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(r=>{this._currentKeyframe[r]=t[r]}),Object.keys(this._localTimelineStyles).forEach(r=>{this._currentKeyframe.hasOwnProperty(r)||(this._currentKeyframe[r]=this._localTimelineStyles[r])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const r=this._styleSummary[e],i=t._styleSummary[e];(!r||i.time>r.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,r=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((a,l)=>{const u=Tr(a,!0);Object.keys(u).forEach(c=>{const d=u[c];"!"==d?t.add(c):d==lr&&e.add(c)}),r||(u.offset=l/this.duration),i.push(u)});const s=t.size?uu(t.values()):[],o=e.size?uu(e.values()):[];if(r){const a=i[0],l=Cs(a);a.offset=0,l.offset=1,i=[a,l]}return np(this.element,i,s,o,this.duration,this.startTime,this.easing,!1)}}class tH extends mu{constructor(t,e,r,i,s,o,a=!1){super(t,e,o.delay),this.keyframes=r,this.preStyleProps=i,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:r,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const s=[],o=r+e,a=e/o,l=Tr(t[0],!1);l.offset=0,s.push(l);const u=Tr(t[0],!1);u.offset=Ow(a),s.push(u);const c=t.length-1;for(let d=1;d<=c;d++){let f=Tr(t[d],!1);f.offset=Ow((e+f.offset*r)/o),s.push(f)}r=o,e=0,i="",t=s}return np(this.element,t,this.preStyleProps,this.postStyleProps,r,e,i,!0)}}function Ow(n,t=3){const e=Math.pow(10,t-1);return Math.round(n*e)/e}class sp{}class rH extends sp{normalizePropertyName(t,e){return Xh(t)}normalizeStyleValue(t,e,r,i){let s="";const o=r.toString().trim();if(iH[e]&&0!==r&&"0"!==r)if("number"==typeof r)s="px";else{const a=r.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&i.push(`Please provide a CSS unit value for ${t}:${r}`)}return o+s}}const iH=(()=>function sH(n){const t={};return n.forEach(e=>t[e]=!0),t}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function Nw(n,t,e,r,i,s,o,a,l,u,c,d,f){return{type:0,element:n,triggerName:t,isRemovalTransition:i,fromState:e,fromStyles:s,toState:r,toStyles:o,timelines:a,queriedElements:l,preStyleProps:u,postStyleProps:c,totalTime:d,errors:f}}const op={};class kw{constructor(t,e,r){this._triggerName=t,this.ast=e,this._stateStyles=r}match(t,e,r,i){return function oH(n,t,e,r,i){return n.some(s=>s(t,e,r,i))}(this.ast.matchers,t,e,r,i)}buildStyles(t,e,r){const i=this._stateStyles["*"],s=this._stateStyles[t],o=i?i.buildStyles(e,r):{};return s?s.buildStyles(e,r):o}build(t,e,r,i,s,o,a,l,u,c){const d=[],f=this.ast.options&&this.ast.options.params||op,g=this.buildStyles(r,a&&a.params||op,d),m=l&&l.params||op,_=this.buildStyles(i,m,d),v=new Set,y=new Map,E=new Map,T="void"===i,q={params:Object.assign(Object.assign({},f),m)},Ae=c?[]:rp(t,e,this.ast.animation,s,o,g,_,q,u,d);let Te=0;if(Ae.forEach(Ht=>{Te=Math.max(Ht.duration+Ht.delay,Te)}),d.length)return Nw(e,this._triggerName,r,i,T,g,_,[],[],y,E,Te,d);Ae.forEach(Ht=>{const Ut=Ht.element,Ds=Vt(y,Ut,{});Ht.preStyleProps.forEach(bn=>Ds[bn]=!0);const ur=Vt(E,Ut,{});Ht.postStyleProps.forEach(bn=>ur[bn]=!0),Ut!==e&&v.add(Ut)});const jt=uu(v.values());return Nw(e,this._triggerName,r,i,T,g,_,Ae,jt,y,E,Te)}}class aH{constructor(t,e,r){this.styles=t,this.defaultParams=e,this.normalizer=r}buildStyles(t,e){const r={},i=Cs(this.defaultParams);return Object.keys(t).forEach(s=>{const o=t[s];null!=o&&(i[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=lu(l,i,e));const u=this.normalizer.normalizePropertyName(a,e);l=this.normalizer.normalizeStyleValue(a,u,l,e),r[u]=l})}}),r}}class uH{constructor(t,e,r){this.name=t,this.ast=e,this._normalizer=r,this.transitionFactories=[],this.states={},e.states.forEach(i=>{this.states[i.name]=new aH(i.style,i.options&&i.options.params||{},r)}),Pw(this.states,"true","1"),Pw(this.states,"false","0"),e.transitions.forEach(i=>{this.transitionFactories.push(new kw(t,i,this.states))}),this.fallbackTransition=function cH(n,t,e){return new kw(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},t)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,r,i){return this.transitionFactories.find(o=>o.match(t,e,r,i))||null}matchStyles(t,e,r){return this.fallbackTransition.buildStyles(t,e,r)}}function Pw(n,t,e){n.hasOwnProperty(t)?n.hasOwnProperty(e)||(n[e]=n[t]):n.hasOwnProperty(e)&&(n[t]=n[e])}const dH=new pu;class fH{constructor(t,e,r){this.bodyNode=t,this._driver=e,this._normalizer=r,this._animations={},this._playersById={},this.players=[]}register(t,e){const r=[],i=ep(this._driver,e,r);if(r.length)throw new Error(`Unable to build the animation due to the following errors: ${r.join("\n")}`);this._animations[t]=i}_buildPlayer(t,e,r){const i=t.element,s=mw(0,this._normalizer,0,t.keyframes,e,r);return this._driver.animate(i,s,t.duration,t.delay,t.easing,[],!0)}create(t,e,r={}){const i=[],s=this._animations[t];let o;const a=new Map;if(s?(o=rp(this._driver,e,s,Kh,iu,{},{},r,dH,i),o.forEach(c=>{const d=Vt(a,c.element,{});c.postStyleProps.forEach(f=>d[f]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),o=[]),i.length)throw new Error(`Unable to create the animation due to the following errors: ${i.join("\n")}`);a.forEach((c,d)=>{Object.keys(c).forEach(f=>{c[f]=this._driver.computeStyle(d,f,lr)})});const u=Sr(o.map(c=>{const d=a.get(c.element);return this._buildPlayer(c,{},d)}));return this._playersById[t]=u,u.onDestroy(()=>this.destroy(t)),this.players.push(u),u}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const r=this.players.indexOf(e);r>=0&&this.players.splice(r,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error(`Unable to find the timeline player referenced by ${t}`);return e}listen(t,e,r,i){const s=Uh(e,"","","");return jh(this._getPlayer(t),r,s,i),()=>{}}command(t,e,r,i){if("register"==r)return void this.register(t,i[0]);if("create"==r)return void this.create(t,e,i[0]||{});const s=this._getPlayer(t);switch(r){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const Lw="ng-animate-queued",ap="ng-animate-disabled",yH=[],Vw={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},_H={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},rn="__ng_removed";class lp{constructor(t,e=""){this.namespaceId=e;const r=t&&t.hasOwnProperty("value");if(this.value=function DH(n){return null!=n?n:null}(r?t.value:t),r){const s=Cs(t);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const r=this.options.params;Object.keys(e).forEach(i=>{null==r[i]&&(r[i]=e[i])})}}}const Qo="void",up=new lp(Qo);class vH{constructor(t,e,r){this.id=t,this.hostElement=e,this._engine=r,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,sn(e,this._hostClassName)}listen(t,e,r,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${r}" because the animation trigger "${e}" doesn't exist!`);if(null==r||0==r.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if(!function EH(n){return"start"==n||"done"==n}(r))throw new Error(`The provided animation trigger event "${r}" for the animation trigger "${e}" is not supported!`);const s=Vt(this._elementListeners,t,[]),o={name:e,phase:r,callback:i};s.push(o);const a=Vt(this._engine.statesByElement,t,{});return a.hasOwnProperty(e)||(sn(t,su),sn(t,su+"-"+e),a[e]=up),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[e]||delete a[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,r,i=!0){const s=this._getTrigger(e),o=new cp(this.id,e,t);let a=this._engine.statesByElement.get(t);a||(sn(t,su),sn(t,su+"-"+e),this._engine.statesByElement.set(t,a={}));let l=a[e];const u=new lp(r,this.id);if(!(r&&r.hasOwnProperty("value"))&&l&&u.absorbOptions(l.options),a[e]=u,l||(l=up),u.value!==Qo&&l.value===u.value){if(!function AH(n,t){const e=Object.keys(n),r=Object.keys(t);if(e.length!=r.length)return!1;for(let i=0;i<e.length;i++){const s=e[i];if(!t.hasOwnProperty(s)||n[s]!==t[s])return!1}return!0}(l.params,u.params)){const m=[],_=s.matchStyles(l.value,l.params,m),v=s.matchStyles(u.value,u.params,m);m.length?this._engine.reportError(m):this._engine.afterFlush(()=>{ci(t,_),Bn(t,v)})}return}const f=Vt(this._engine.playersByElement,t,[]);f.forEach(m=>{m.namespaceId==this.id&&m.triggerName==e&&m.queued&&m.destroy()});let h=s.matchTransition(l.value,u.value,t,u.params),g=!1;if(!h){if(!i)return;h=s.fallbackTransition,g=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:h,fromState:l,toState:u,player:o,isFallbackTransition:g}),g||(sn(t,Lw),o.onStart(()=>{bs(t,Lw)})),o.onDone(()=>{let m=this.players.indexOf(o);m>=0&&this.players.splice(m,1);const _=this._engine.playersByElement.get(t);if(_){let v=_.indexOf(o);v>=0&&_.splice(v,1)}}),this.players.push(o),f.push(o),o}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,r)=>{delete e[t]}),this._elementListeners.forEach((e,r)=>{this._elementListeners.set(r,e.filter(i=>i.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(r=>r.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const r=this._engine.driver.query(t,ou,!0);r.forEach(i=>{if(i[rn])return;const s=this._engine.fetchNamespacesByElement(i);s.size?s.forEach(o=>o.triggerLeaveAnimation(i,e,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>r.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(t,e,r,i){const s=this._engine.statesByElement.get(t),o=new Map;if(s){const a=[];if(Object.keys(s).forEach(l=>{if(o.set(l,s[l].value),this._triggers[l]){const u=this.trigger(t,l,Qo,i);u&&a.push(u)}}),a.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,o),r&&Sr(a).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t),r=this._engine.statesByElement.get(t);if(e&&r){const i=new Set;e.forEach(s=>{const o=s.name;if(i.has(o))return;i.add(o);const l=this._triggers[o].fallbackTransition,u=r[o]||up,c=new lp(Qo),d=new cp(this.id,o,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:o,transition:l,fromState:u,toState:c,player:d,isFallbackTransition:!0})})}}removeNode(t,e){const r=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(r.totalAnimations){const s=r.players.length?r.playersByQueriedElement.get(t):[];if(s&&s.length)i=!0;else{let o=t;for(;o=o.parentNode;)if(r.statesByElement.get(o)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)r.markElementAsRemoved(this.id,t,!1,e);else{const s=t[rn];(!s||s===Vw)&&(r.afterFlush(()=>this.clearElementCache(t)),r.destroyInnerAnimations(t),r._onRemovalComplete(t,e))}}insertNode(t,e){sn(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(r=>{const i=r.player;if(i.destroyed)return;const s=r.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==r.triggerName){const l=Uh(s,r.triggerName,r.fromState.value,r.toState.value);l._data=t,jh(r.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(r)}),this._queue=[],e.sort((r,i)=>{const s=r.transition.ast.depCount,o=i.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(r.element,i.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(r=>r.element===t)||e,e}}class CH{constructor(t,e,r){this.bodyNode=t,this.driver=e,this._normalizer=r,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(i,s)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(r=>{r.queued&&t.push(r)})}),t}createNamespace(t,e){const r=new vH(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(r,e):(this.newHostElements.set(e,r),this.collectEnterElement(e)),this._namespaceLookup[t]=r}_balanceNamespaceList(t,e){const r=this._namespaceList.length-1;if(r>=0){let i=!1;for(let s=r;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,e)){this._namespaceList.splice(s+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let r=this._namespaceLookup[t];return r||(r=this.createNamespace(t,e)),r}registerTrigger(t,e,r){let i=this._namespaceLookup[t];i&&i.register(e,r)&&this.totalAnimations++}destroy(t,e){if(!t)return;const r=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(r.hostElement),delete this._namespaceLookup[t];const i=this._namespaceList.indexOf(r);i>=0&&this._namespaceList.splice(i,1)}),this.afterFlushAnimationsDone(()=>r.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,r=this.statesByElement.get(t);if(r){const i=Object.keys(r);for(let s=0;s<i.length;s++){const o=r[i[s]].namespaceId;if(o){const a=this._fetchNamespace(o);a&&e.add(a)}}}return e}trigger(t,e,r,i){if(yu(e)){const s=this._fetchNamespace(t);if(s)return s.trigger(e,r,i),!0}return!1}insertNode(t,e,r,i){if(!yu(e))return;const s=e[rn];if(s&&s.setForRemoval){s.setForRemoval=!1,s.setForMove=!0;const o=this.collectedLeaveElements.indexOf(e);o>=0&&this.collectedLeaveElements.splice(o,1)}if(t){const o=this._fetchNamespace(t);o&&o.insertNode(e,r)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),sn(t,ap)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),bs(t,ap))}removeNode(t,e,r,i){if(yu(e)){const s=t?this._fetchNamespace(t):null;if(s?s.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),r){const o=this.namespacesByHostElement.get(e);o&&o.id!==t&&o.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,r,i,s){this.collectedLeaveElements.push(e),e[rn]={namespaceId:t,setForRemoval:i,hasAnimation:r,removedBeforeQueried:!1,previousTriggersValues:s}}listen(t,e,r,i,s){return yu(e)?this._fetchNamespace(t).listen(e,r,i,s):()=>{}}_buildInstruction(t,e,r,i,s){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,r,i,t.fromState.options,t.toState.options,e,s)}destroyInnerAnimations(t){let e=this.driver.query(t,ou,!0);e.forEach(r=>this.destroyActiveAnimationsForElement(r)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,Qh,!0),e.forEach(r=>this.finishActiveQueriedAnimationOnElement(r)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(r=>{r.queued?r.markedForDestroy=!0:r.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(r=>r.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return Sr(this.players).onDone(()=>t());t()})}processLeaveNode(t){var e;const r=t[rn];if(r&&r.setForRemoval){if(t[rn]=Vw,r.namespaceId){this.destroyInnerAnimations(t);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,r.setForRemoval)}(null===(e=t.classList)||void 0===e?void 0:e.contains(ap))&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((r,i)=>this._balanceNamespaceList(r,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let r=0;r<this.collectedEnterElements.length;r++)sn(this.collectedEnterElements[r],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){const r=[];try{e=this._flushAnimations(r,t)}finally{for(let i=0;i<r.length;i++)r[i]()}}else for(let r=0;r<this.collectedLeaveElements.length;r++)this.processLeaveNode(this.collectedLeaveElements[r]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(r=>r()),this._flushFns=[],this._whenQuietFns.length){const r=this._whenQuietFns;this._whenQuietFns=[],e.length?Sr(e).onDone(()=>{r.forEach(i=>i())}):r.forEach(i=>i())}}reportError(t){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${t.join("\n")}`)}_flushAnimations(t,e){const r=new pu,i=[],s=new Map,o=[],a=new Map,l=new Map,u=new Map,c=new Set;this.disabledNodes.forEach(I=>{c.add(I);const O=this.driver.query(I,".ng-animate-queued",!0);for(let k=0;k<O.length;k++)c.add(O[k])});const d=this.bodyNode,f=Array.from(this.statesByElement.keys()),h=Hw(f,this.collectedEnterElements),g=new Map;let m=0;h.forEach((I,O)=>{const k=Kh+m++;g.set(O,k),I.forEach(oe=>sn(oe,k))});const _=[],v=new Set,y=new Set;for(let I=0;I<this.collectedLeaveElements.length;I++){const O=this.collectedLeaveElements[I],k=O[rn];k&&k.setForRemoval&&(_.push(O),v.add(O),k.hasAnimation?this.driver.query(O,".ng-star-inserted",!0).forEach(oe=>v.add(oe)):y.add(O))}const E=new Map,T=Hw(f,Array.from(v));T.forEach((I,O)=>{const k=iu+m++;E.set(O,k),I.forEach(oe=>sn(oe,k))}),t.push(()=>{h.forEach((I,O)=>{const k=g.get(O);I.forEach(oe=>bs(oe,k))}),T.forEach((I,O)=>{const k=E.get(O);I.forEach(oe=>bs(oe,k))}),_.forEach(I=>{this.processLeaveNode(I)})});const q=[],Ae=[];for(let I=this._namespaceList.length-1;I>=0;I--)this._namespaceList[I].drainQueuedTransitions(e).forEach(k=>{const oe=k.player,Ze=k.element;if(q.push(oe),this.collectedEnterElements.length){const Ct=Ze[rn];if(Ct&&Ct.setForMove){if(Ct.previousTriggersValues&&Ct.previousTriggersValues.has(k.triggerName)){const hi=Ct.previousTriggersValues.get(k.triggerName),Or=this.statesByElement.get(k.element);Or&&Or[k.triggerName]&&(Or[k.triggerName].value=hi)}return void oe.destroy()}}const jn=!d||!this.driver.containsElement(d,Ze),Gt=E.get(Ze),Rr=g.get(Ze),Ie=this._buildInstruction(k,r,Rr,Gt,jn);if(Ie.errors&&Ie.errors.length)return void Ae.push(Ie);if(jn)return oe.onStart(()=>ci(Ze,Ie.fromStyles)),oe.onDestroy(()=>Bn(Ze,Ie.toStyles)),void i.push(oe);if(k.isFallbackTransition)return oe.onStart(()=>ci(Ze,Ie.fromStyles)),oe.onDestroy(()=>Bn(Ze,Ie.toStyles)),void i.push(oe);const Bx=[];Ie.timelines.forEach(Ct=>{Ct.stretchStartingKeyframe=!0,this.disabledNodes.has(Ct.element)||Bx.push(Ct)}),Ie.timelines=Bx,r.append(Ze,Ie.timelines),o.push({instruction:Ie,player:oe,element:Ze}),Ie.queriedElements.forEach(Ct=>Vt(a,Ct,[]).push(oe)),Ie.preStyleProps.forEach((Ct,hi)=>{const Or=Object.keys(Ct);if(Or.length){let pi=l.get(hi);pi||l.set(hi,pi=new Set),Or.forEach(bp=>pi.add(bp))}}),Ie.postStyleProps.forEach((Ct,hi)=>{const Or=Object.keys(Ct);let pi=u.get(hi);pi||u.set(hi,pi=new Set),Or.forEach(bp=>pi.add(bp))})});if(Ae.length){const I=[];Ae.forEach(O=>{I.push(`@${O.triggerName} has failed due to:\n`),O.errors.forEach(k=>I.push(`- ${k}\n`))}),q.forEach(O=>O.destroy()),this.reportError(I)}const Te=new Map,jt=new Map;o.forEach(I=>{const O=I.element;r.has(O)&&(jt.set(O,O),this._beforeAnimationBuild(I.player.namespaceId,I.instruction,Te))}),i.forEach(I=>{const O=I.element;this._getPreviousPlayers(O,!1,I.namespaceId,I.triggerName,null).forEach(oe=>{Vt(Te,O,[]).push(oe),oe.destroy()})});const Ht=_.filter(I=>Gw(I,l,u)),Ut=new Map;jw(Ut,this.driver,y,u,lr).forEach(I=>{Gw(I,l,u)&&Ht.push(I)});const ur=new Map;h.forEach((I,O)=>{jw(ur,this.driver,new Set(I),l,"!")}),Ht.forEach(I=>{const O=Ut.get(I),k=ur.get(I);Ut.set(I,Object.assign(Object.assign({},O),k))});const bn=[],Es=[],ws={};o.forEach(I=>{const{element:O,player:k,instruction:oe}=I;if(r.has(O)){if(c.has(O))return k.onDestroy(()=>Bn(O,oe.toStyles)),k.disabled=!0,k.overrideTotalTime(oe.totalTime),void i.push(k);let Ze=ws;if(jt.size>1){let Gt=O;const Rr=[];for(;Gt=Gt.parentNode;){const Ie=jt.get(Gt);if(Ie){Ze=Ie;break}Rr.push(Gt)}Rr.forEach(Ie=>jt.set(Ie,Ze))}const jn=this._buildAnimation(k.namespaceId,oe,Te,s,ur,Ut);if(k.setRealPlayer(jn),Ze===ws)bn.push(k);else{const Gt=this.playersByElement.get(Ze);Gt&&Gt.length&&(k.parentPlayer=Sr(Gt)),i.push(k)}}else ci(O,oe.fromStyles),k.onDestroy(()=>Bn(O,oe.toStyles)),Es.push(k),c.has(O)&&i.push(k)}),Es.forEach(I=>{const O=s.get(I.element);if(O&&O.length){const k=Sr(O);I.setRealPlayer(k)}}),i.forEach(I=>{I.parentPlayer?I.syncPlayerEvents(I.parentPlayer):I.destroy()});for(let I=0;I<_.length;I++){const O=_[I],k=O[rn];if(bs(O,iu),k&&k.hasAnimation)continue;let oe=[];if(a.size){let jn=a.get(O);jn&&jn.length&&oe.push(...jn);let Gt=this.driver.query(O,Qh,!0);for(let Rr=0;Rr<Gt.length;Rr++){let Ie=a.get(Gt[Rr]);Ie&&Ie.length&&oe.push(...Ie)}}const Ze=oe.filter(jn=>!jn.destroyed);Ze.length?wH(this,O,Ze):this.processLeaveNode(O)}return _.length=0,bn.forEach(I=>{this.players.push(I),I.onDone(()=>{I.destroy();const O=this.players.indexOf(I);this.players.splice(O,1)}),I.play()}),bn}elementContainsData(t,e){let r=!1;const i=e[rn];return i&&i.setForRemoval&&(r=!0),this.playersByElement.has(e)&&(r=!0),this.playersByQueriedElement.has(e)&&(r=!0),this.statesByElement.has(e)&&(r=!0),this._fetchNamespace(t).elementContainsData(e)||r}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,r,i,s){let o=[];if(e){const a=this.playersByQueriedElement.get(t);a&&(o=a)}else{const a=this.playersByElement.get(t);if(a){const l=!s||s==Qo;a.forEach(u=>{u.queued||!l&&u.triggerName!=i||o.push(u)})}}return(r||i)&&(o=o.filter(a=>!(r&&r!=a.namespaceId||i&&i!=a.triggerName))),o}_beforeAnimationBuild(t,e,r){const s=e.element,o=e.isRemovalTransition?void 0:t,a=e.isRemovalTransition?void 0:e.triggerName;for(const l of e.timelines){const u=l.element,c=u!==s,d=Vt(r,u,[]);this._getPreviousPlayers(u,c,o,a,e.toState).forEach(h=>{const g=h.getRealPlayer();g.beforeDestroy&&g.beforeDestroy(),h.destroy(),d.push(h)})}ci(s,e.fromStyles)}_buildAnimation(t,e,r,i,s,o){const a=e.triggerName,l=e.element,u=[],c=new Set,d=new Set,f=e.timelines.map(g=>{const m=g.element;c.add(m);const _=m[rn];if(_&&_.removedBeforeQueried)return new vs(g.duration,g.delay);const v=m!==l,y=function xH(n){const t=[];return Uw(n,t),t}((r.get(m)||yH).map(Te=>Te.getRealPlayer())).filter(Te=>!!Te.element&&Te.element===m),E=s.get(m),T=o.get(m),q=mw(0,this._normalizer,0,g.keyframes,E,T),Ae=this._buildPlayer(g,q,y);if(g.subTimeline&&i&&d.add(m),v){const Te=new cp(t,a,m);Te.setRealPlayer(Ae),u.push(Te)}return Ae});u.forEach(g=>{Vt(this.playersByQueriedElement,g.element,[]).push(g),g.onDone(()=>function bH(n,t,e){let r;if(n instanceof Map){if(r=n.get(t),r){if(r.length){const i=r.indexOf(e);r.splice(i,1)}0==r.length&&n.delete(t)}}else if(r=n[t],r){if(r.length){const i=r.indexOf(e);r.splice(i,1)}0==r.length&&delete n[t]}return r}(this.playersByQueriedElement,g.element,g))}),c.forEach(g=>sn(g,Ew));const h=Sr(f);return h.onDestroy(()=>{c.forEach(g=>bs(g,Ew)),Bn(l,e.toStyles)}),d.forEach(g=>{Vt(i,g,[]).push(h)}),h}_buildPlayer(t,e,r){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,r):new vs(t.duration,t.delay)}}class cp{constructor(t,e,r){this.namespaceId=t,this.triggerName=e,this.element=r,this._player=new vs,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(r=>jh(t,e,void 0,r))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){Vt(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function yu(n){return n&&1===n.nodeType}function Bw(n,t){const e=n.style.display;return n.style.display=null!=t?t:"none",e}function jw(n,t,e,r,i){const s=[];e.forEach(l=>s.push(Bw(l)));const o=[];r.forEach((l,u)=>{const c={};l.forEach(d=>{const f=c[d]=t.computeStyle(u,d,i);(!f||0==f.length)&&(u[rn]=_H,o.push(u))}),n.set(u,c)});let a=0;return e.forEach(l=>Bw(l,s[a++])),o}function Hw(n,t){const e=new Map;if(n.forEach(a=>e.set(a,[])),0==t.length)return e;const i=new Set(t),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const u=a.parentNode;return l=e.has(u)?u:i.has(u)?1:o(u),s.set(a,l),l}return t.forEach(a=>{const l=o(a);1!==l&&e.get(l).push(a)}),e}function sn(n,t){var e;null===(e=n.classList)||void 0===e||e.add(t)}function bs(n,t){var e;null===(e=n.classList)||void 0===e||e.remove(t)}function wH(n,t,e){Sr(e).onDone(()=>n.processLeaveNode(t))}function Uw(n,t){for(let e=0;e<n.length;e++){const r=n[e];r instanceof pw?Uw(r.players,t):t.push(r)}}function Gw(n,t,e){const r=e.get(n);if(!r)return!1;let i=t.get(n);return i?r.forEach(s=>i.add(s)):t.set(n,r),e.delete(n),!0}class _u{constructor(t,e,r){this.bodyNode=t,this._driver=e,this._normalizer=r,this._triggerCache={},this.onRemovalComplete=(i,s)=>{},this._transitionEngine=new CH(t,e,r),this._timelineEngine=new fH(t,e,r),this._transitionEngine.onRemovalComplete=(i,s)=>this.onRemovalComplete(i,s)}registerTrigger(t,e,r,i,s){const o=t+"-"+i;let a=this._triggerCache[o];if(!a){const l=[],u=ep(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function lH(n,t,e){return new uH(n,t,e)}(i,u,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(e,i,a)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,r,i){this._transitionEngine.insertNode(t,e,r,i)}onRemove(t,e,r,i){this._transitionEngine.removeNode(t,e,i||!1,r)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,r,i){if("@"==r.charAt(0)){const[s,o]=yw(r);this._timelineEngine.command(s,e,o,i)}else this._transitionEngine.trigger(t,e,r,i)}listen(t,e,r,i,s){if("@"==r.charAt(0)){const[o,a]=yw(r);return this._timelineEngine.listen(o,e,a,s)}return this._transitionEngine.listen(t,e,r,i,s)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function $w(n,t){let e=null,r=null;return Array.isArray(t)&&t.length?(e=dp(t[0]),t.length>1&&(r=dp(t[t.length-1]))):t&&(e=dp(t)),e||r?new MH(n,e,r):null}let MH=(()=>{class n{constructor(e,r,i){this._element=e,this._startStyles=r,this._endStyles=i,this._state=0;let s=n.initialStylesByElement.get(e);s||n.initialStylesByElement.set(e,s={}),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&Bn(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Bn(this._element,this._initialStyles),this._endStyles&&(Bn(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(ci(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ci(this._element,this._endStyles),this._endStyles=null),Bn(this._element,this._initialStyles),this._state=3)}}return n.initialStylesByElement=new WeakMap,n})();function dp(n){let t=null;const e=Object.keys(n);for(let r=0;r<e.length;r++){const i=e[r];SH(i)&&(t=t||{},t[i]=n[i])}return t}function SH(n){return"display"===n||"position"===n}const qw="animation",zw="animationend";class FH{constructor(t,e,r,i,s,o,a){this._element=t,this._name=e,this._duration=r,this._delay=i,this._easing=s,this._fillMode=o,this._onDoneFn=a,this._finished=!1,this._destroyed=!1,this._startTime=0,this._position=0,this._eventFn=l=>this._handleCallback(l)}apply(){(function RH(n,t){const e=hp(n,"").trim();let r=0;e.length&&(r=function NH(n,t){let e=0;for(let r=0;r<n.length;r++)n.charAt(r)===t&&e++;return e}(e,",")+1,t=`${e}, ${t}`),vu(n,"",t)})(this._element,`${this._duration}ms ${this._easing} ${this._delay}ms 1 normal ${this._fillMode} ${this._name}`),Qw(this._element,this._eventFn,!1),this._startTime=Date.now()}pause(){Ww(this._element,this._name,"paused")}resume(){Ww(this._element,this._name,"running")}setPosition(t){const e=Kw(this._element,this._name);this._position=t*this._duration,vu(this._element,"Delay",`-${this._position}ms`,e)}getPosition(){return this._position}_handleCallback(t){const e=t._ngTestManualTimestamp||Date.now(),r=1e3*parseFloat(t.elapsedTime.toFixed(3));t.animationName==this._name&&Math.max(e-this._startTime,0)>=this._delay&&r>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Qw(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function OH(n,t){const r=hp(n,"").split(","),i=fp(r,t);i>=0&&(r.splice(i,1),vu(n,"",r.join(",")))}(this._element,this._name))}}function Ww(n,t,e){vu(n,"PlayState",e,Kw(n,t))}function Kw(n,t){const e=hp(n,"");return e.indexOf(",")>0?fp(e.split(","),t):fp([e],t)}function fp(n,t){for(let e=0;e<n.length;e++)if(n[e].indexOf(t)>=0)return e;return-1}function Qw(n,t,e){e?n.removeEventListener(zw,t):n.addEventListener(zw,t)}function vu(n,t,e,r){const i=qw+t;if(null!=r){const s=n.style[i];if(s.length){const o=s.split(",");o[r]=e,e=o.join(",")}}n.style[i]=e}function hp(n,t){return n.style[qw+t]||""}class Yw{constructor(t,e,r,i,s,o,a,l){this.element=t,this.keyframes=e,this.animationName=r,this._duration=i,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=i+s,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new FH(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(r=>r()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(r=>{"offset"!=r&&(t[r]=e?this._finalStyles[r]:Jh(this.element,r))})}this.currentSnapshot=t}}class LH extends vs{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=Cw(e)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class Xw{constructor(){this._count=0}validateStyleProperty(t){return $h(t)}matchesElement(t,e){return!1}containsElement(t,e){return qh(t,e)}query(t,e,r){return zh(t,e,r)}computeStyle(t,e,r){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,r){r=r.map(a=>Cw(a));let i=`@keyframes ${e} {\n`,s="";r.forEach(a=>{s=" ";const l=parseFloat(a.offset);i+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(u=>{const c=a[u];switch(u){case"offset":return;case"easing":return void(c&&(i+=`${s}animation-timing-function: ${c};\n`));default:return void(i+=`${s}${u}: ${c};\n`)}}),i+=`${s}}\n`}),i+="}\n";const o=document.createElement("style");return o.textContent=i,o}animate(t,e,r,i,s,o=[],a){const l=o.filter(_=>_ instanceof Yw),u={};Sw(r,i)&&l.forEach(_=>{let v=_.currentSnapshot;Object.keys(v).forEach(y=>u[y]=v[y])});const c=function jH(n){let t={};return n&&(Array.isArray(n)?n:[n]).forEach(r=>{Object.keys(r).forEach(i=>{"offset"==i||"easing"==i||(t[i]=r[i])})}),t}(e=Tw(t,e,u));if(0==r)return new LH(t,c);const d="gen_css_kf_"+this._count++,f=this.buildKeyframeElement(t,d,e);(function BH(n){var t;const e=null===(t=n.getRootNode)||void 0===t?void 0:t.call(n);return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot?e:document.head})(t).appendChild(f);const g=$w(t,e),m=new Yw(t,e,d,r,i,s,c,g);return m.onDestroy(()=>function HH(n){n.parentNode.removeChild(n)}(f)),m}}class ex{constructor(t,e,r,i){this.element=t,this.keyframes=e,this.options=r,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=r.duration,this._delay=r.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,r){return t.animate(e,r)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};if(this.hasStarted()){const e=this._finalKeyframe;Object.keys(e).forEach(r=>{"offset"!=r&&(t[r]=this._finished?e[r]:Jh(this.element,r))})}this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(r=>r()),e.length=0}}class UH{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(tx().toString()),this._cssKeyframesDriver=new Xw}validateStyleProperty(t){return $h(t)}matchesElement(t,e){return!1}containsElement(t,e){return qh(t,e)}query(t,e,r){return zh(t,e,r)}computeStyle(t,e,r){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,r,i,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,r,i,s,o);const c={duration:r,delay:i,fill:0==i?"both":"forwards"};s&&(c.easing=s);const d={},f=o.filter(g=>g instanceof ex);Sw(r,i)&&f.forEach(g=>{let m=g.currentSnapshot;Object.keys(m).forEach(_=>d[_]=m[_])});const h=$w(t,e=Tw(t,e=e.map(g=>Tr(g,!1)),d));return new ex(t,e,c,h)}}function tx(){return gw()&&Element.prototype.animate||{}}let $H=(()=>{class n extends dw{constructor(e,r){super(),this._nextAnimationId=0,this._renderer=e.createRenderer(r.body,{id:"0",encapsulation:an.None,styles:[],data:{animation:[]}})}build(e){const r=this._nextAnimationId.toString();this._nextAnimationId++;const i=Array.isArray(e)?fw(e):e;return nx(this._renderer,null,r,"register",[i]),new qH(r,this._renderer)}}return n.\u0275fac=function(e){return new(e||n)(D(ho),D(ye))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();class qH extends class Aj{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new zH(this._id,t,e||{},this._renderer)}}class zH{constructor(t,e,r,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",r)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return nx(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function nx(n,t,e,r,i){return n.setProperty(t,`@@${e}:${r}`,i)}const rx="@.disabled";let WH=(()=>{class n{constructor(e,r,i){this.delegate=e,this.engine=r,this._zone=i,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),r.onRemovalComplete=(s,o)=>{const a=null==o?void 0:o.parentNode(s);a&&o.removeChild(a,s)}}createRenderer(e,r){const s=this.delegate.createRenderer(e,r);if(!(e&&r&&r.data&&r.data.animation)){let c=this._rendererCache.get(s);return c||(c=new ix("",s,this.engine),this._rendererCache.set(s,c)),c}const o=r.id,a=r.id+"-"+this._currentId;this._currentId++,this.engine.register(a,e);const l=c=>{Array.isArray(c)?c.forEach(l):this.engine.registerTrigger(o,a,e,c.name,c)};return r.data.animation.forEach(l),new KH(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(e,r,i){e>=0&&e<this._microtaskId?this._zone.run(()=>r(i)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([r,i]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return n.\u0275fac=function(e){return new(e||n)(D(ho),D(_u),D(ce))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();class ix{constructor(t,e,r){this.namespaceId=t,this.delegate=e,this.engine=r,this.destroyNode=this.delegate.destroyNode?i=>e.destroyNode(i):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,r,i=!0){this.delegate.insertBefore(t,e,r),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,r){this.engine.onRemove(this.namespaceId,e,this.delegate,r)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,r,i){this.delegate.setAttribute(t,e,r,i)}removeAttribute(t,e,r){this.delegate.removeAttribute(t,e,r)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,r,i){this.delegate.setStyle(t,e,r,i)}removeStyle(t,e,r){this.delegate.removeStyle(t,e,r)}setProperty(t,e,r){"@"==e.charAt(0)&&e==rx?this.disableAnimations(t,!!r):this.delegate.setProperty(t,e,r)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,r){return this.delegate.listen(t,e,r)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class KH extends ix{constructor(t,e,r,i){super(e,r,i),this.factory=t,this.namespaceId=e}setProperty(t,e,r){"@"==e.charAt(0)?"."==e.charAt(1)&&e==rx?this.disableAnimations(t,r=void 0===r||!!r):this.engine.process(this.namespaceId,t,e.substr(1),r):this.delegate.setProperty(t,e,r)}listen(t,e,r){if("@"==e.charAt(0)){const i=function QH(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(t);let s=e.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function YH(n){const t=n.indexOf(".");return[n.substring(0,t),n.substr(t+1)]}(s)),this.engine.listen(this.namespaceId,i,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,r,a)})}return this.delegate.listen(t,e,r)}}let ZH=(()=>{class n extends _u{constructor(e,r,i){super(e.body,r,i)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(e){return new(e||n)(D(ye),D(Wh),D(sp))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const pp=new F("AnimationModuleType"),sx=[{provide:dw,useClass:$H},{provide:sp,useFactory:function JH(){return new rH}},{provide:_u,useClass:ZH},{provide:ho,useFactory:function e2(n,t,e){return new WH(n,t,e)},deps:[bl,_u,ce]}],ox=[{provide:Wh,useFactory:function XH(){return function GH(){return"function"==typeof tx()}()?new UH:new Xw}},{provide:pp,useValue:"BrowserAnimations"},...sx],t2=[{provide:Wh,useClass:bw},{provide:pp,useValue:"NoopAnimations"},...sx];let n2=(()=>{class n{static withConfig(e){return{ngModule:n,providers:e.disableAnimations?t2:ox}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({providers:ox,imports:[lb]}),n})();const r2=["connectionContainer"],i2=["inputContainer"],s2=["label"];function o2(n,t){1&n&&(vr(0),L(1,"div",14),lt(2,"div",15),lt(3,"div",16),lt(4,"div",17),V(),L(5,"div",18),lt(6,"div",15),lt(7,"div",16),lt(8,"div",17),V(),Cr())}function a2(n,t){if(1&n){const e=so();L(0,"div",19),je("cdkObserveContent",function(){return Os(e),Pt().updateOutlineGap()}),Fn(1,1),V()}2&n&&ie("cdkObserveContentDisabled","outline"!=Pt().appearance)}function l2(n,t){if(1&n&&(vr(0),Fn(1,2),L(2,"span"),ut(3),V(),Cr()),2&n){const e=Pt(2);te(3),Kr(e._control.placeholder)}}function u2(n,t){1&n&&Fn(0,3,["*ngSwitchCase","true"])}function c2(n,t){1&n&&(L(0,"span",23),ut(1," *"),V())}function d2(n,t){if(1&n){const e=so();L(0,"label",20,21),je("cdkObserveContent",function(){return Os(e),Pt().updateOutlineGap()}),Be(2,l2,4,1,"ng-container",12),Be(3,u2,1,0,"ng-content",12),Be(4,c2,2,0,"span",22),V()}if(2&n){const e=Pt();Qn("mat-empty",e._control.empty&&!e._shouldAlwaysFloat())("mat-form-field-empty",e._control.empty&&!e._shouldAlwaysFloat())("mat-accent","accent"==e.color)("mat-warn","warn"==e.color),ie("cdkObserveContentDisabled","outline"!=e.appearance)("id",e._labelId)("ngSwitch",e._hasLabel()),kt("for",e._control.id)("aria-owns",e._control.id),te(2),ie("ngSwitchCase",!1),te(1),ie("ngSwitchCase",!0),te(1),ie("ngIf",!e.hideRequiredMarker&&e._control.required&&!e._control.disabled)}}function f2(n,t){1&n&&(L(0,"div",24),Fn(1,4),V())}function h2(n,t){if(1&n&&(L(0,"div",25),lt(1,"span",26),V()),2&n){const e=Pt();te(1),Qn("mat-accent","accent"==e.color)("mat-warn","warn"==e.color)}}function p2(n,t){1&n&&(L(0,"div"),Fn(1,5),V()),2&n&&ie("@transitionMessages",Pt()._subscriptAnimationState)}function g2(n,t){if(1&n&&(L(0,"div",30),ut(1),V()),2&n){const e=Pt(2);ie("id",e._hintLabelId),te(1),Kr(e.hintLabel)}}function m2(n,t){if(1&n&&(L(0,"div",27),Be(1,g2,2,2,"div",28),Fn(2,6),lt(3,"div",29),Fn(4,7),V()),2&n){const e=Pt();ie("@transitionMessages",e._subscriptAnimationState),te(1),ie("ngIf",e.hintLabel)}}const y2=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],_2=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],v2=new F("MatError"),C2={transitionMessages:Mj("transitionMessages",[Tj("enter",ru({opacity:1,transform:"translateY(0%)"})),Ij("void => enter",[ru({opacity:0,transform:"translateY(-5px)"}),Sj("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let gp=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275dir=b({type:n}),n})();const b2=new F("MatHint");let mp=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275dir=b({type:n,selectors:[["mat-label"]]}),n})(),D2=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275dir=b({type:n,selectors:[["mat-placeholder"]]}),n})();const E2=new F("MatPrefix"),ax=new F("MatSuffix");let w2=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275dir=b({type:n,selectors:[["","matSuffix",""]],features:[pe([{provide:ax,useExisting:n}])]}),n})(),lx=0;const A2=sw(class{constructor(n){this._elementRef=n}},"primary"),M2=new F("MAT_FORM_FIELD_DEFAULT_OPTIONS"),cx=new F("MatFormField");let S2=(()=>{class n extends A2{constructor(e,r,i,s,o,a,l){super(e),this._changeDetectorRef=r,this._dir=i,this._defaults=s,this._platform=o,this._ngZone=a,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new Xe,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+lx++,this._labelId="mat-form-field-label-"+lx++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==l,this.appearance=s&&s.appearance?s.appearance:"legacy",this._hideRequiredMarker=!(!s||null==s.hideRequiredMarker)&&s.hideRequiredMarker}get appearance(){return this._appearance}set appearance(e){const r=this._appearance;this._appearance=e||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&r!==e&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=xt(e)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(e){this._explicitFormFieldControl=e}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const e=this._control;e.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${e.controlType}`),e.stateChanges.pipe(wl(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),e.ngControl&&e.ngControl.valueChanges&&e.ngControl.valueChanges.pipe(or(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(or(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),ta(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(wl(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(wl(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(or(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(e){const r=this._control?this._control.ngControl:null;return r&&r[e]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,Lh(this._label.nativeElement,"transitionend").pipe(mi(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&e.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const r=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,i=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),i&&e.push(i.id)}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));this._control.setDescribedByIds(e)}}_validateControlChild(){}updateOutlineGap(){const e=this._label?this._label.nativeElement:null,r=this._connectionContainerRef.nativeElement,i=".mat-form-field-outline-start",s=".mat-form-field-outline-gap";if("outline"!==this.appearance||!this._platform.isBrowser)return;if(!e||!e.children.length||!e.textContent.trim()){const c=r.querySelectorAll(`${i}, ${s}`);for(let d=0;d<c.length;d++)c[d].style.width="0";return}if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let o=0,a=0;const l=r.querySelectorAll(i),u=r.querySelectorAll(s);if(this._label&&this._label.nativeElement.children.length){const c=r.getBoundingClientRect();if(0===c.width&&0===c.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const d=this._getStartEnd(c),f=e.children,h=this._getStartEnd(f[0].getBoundingClientRect());let g=0;for(let m=0;m<f.length;m++)g+=f[m].offsetWidth;o=Math.abs(h-d)-5,a=g>0?.75*g+10:0}for(let c=0;c<l.length;c++)l[c].style.width=`${o}px`;for(let c=0;c<u.length;c++)u[c].style.width=`${a}px`;this._outlineGapCalculationNeededOnStable=this._outlineGapCalculationNeededImmediately=!1}_getStartEnd(e){return this._dir&&"rtl"===this._dir.value?e.right:e.left}_isAttachedToDOM(){const e=this._elementRef.nativeElement;if(e.getRootNode){const r=e.getRootNode();return r&&r!==e}return document.documentElement.contains(e)}}return n.\u0275fac=function(e){return new(e||n)(p($),p(rl),p(nh,8),p(M2,8),p(eu),p(ce),p(pp,8))},n.\u0275cmp=Vr({type:n,selectors:[["mat-form-field"]],contentQueries:function(e,r,i){if(1&e&&(Zt(i,gp,5),Zt(i,gp,7),Zt(i,mp,5),Zt(i,mp,7),Zt(i,D2,5),Zt(i,v2,5),Zt(i,b2,5),Zt(i,E2,5),Zt(i,ax,5)),2&e){let s;mt(s=yt())&&(r._controlNonStatic=s.first),mt(s=yt())&&(r._controlStatic=s.first),mt(s=yt())&&(r._labelChildNonStatic=s.first),mt(s=yt())&&(r._labelChildStatic=s.first),mt(s=yt())&&(r._placeholderChild=s.first),mt(s=yt())&&(r._errorChildren=s),mt(s=yt())&&(r._hintChildren=s),mt(s=yt())&&(r._prefixChildren=s),mt(s=yt())&&(r._suffixChildren=s)}},viewQuery:function(e,r){if(1&e&&(Za(r2,7),Za(i2,5),Za(s2,5)),2&e){let i;mt(i=yt())&&(r._connectionContainerRef=i.first),mt(i=yt())&&(r._inputContainerRef=i.first),mt(i=yt())&&(r._label=i.first)}},hostAttrs:[1,"mat-form-field"],hostVars:40,hostBindings:function(e,r){2&e&&Qn("mat-form-field-appearance-standard","standard"==r.appearance)("mat-form-field-appearance-fill","fill"==r.appearance)("mat-form-field-appearance-outline","outline"==r.appearance)("mat-form-field-appearance-legacy","legacy"==r.appearance)("mat-form-field-invalid",r._control.errorState)("mat-form-field-can-float",r._canLabelFloat())("mat-form-field-should-float",r._shouldLabelFloat())("mat-form-field-has-label",r._hasFloatingLabel())("mat-form-field-hide-placeholder",r._hideControlPlaceholder())("mat-form-field-disabled",r._control.disabled)("mat-form-field-autofilled",r._control.autofilled)("mat-focused",r._control.focused)("ng-untouched",r._shouldForward("untouched"))("ng-touched",r._shouldForward("touched"))("ng-pristine",r._shouldForward("pristine"))("ng-dirty",r._shouldForward("dirty"))("ng-valid",r._shouldForward("valid"))("ng-invalid",r._shouldForward("invalid"))("ng-pending",r._shouldForward("pending"))("_mat-animation-noopable",!r._animationsEnabled)},inputs:{color:"color",appearance:"appearance",hideRequiredMarker:"hideRequiredMarker",hintLabel:"hintLabel",floatLabel:"floatLabel"},exportAs:["matFormField"],features:[pe([{provide:cx,useExisting:n}]),x],ngContentSelectors:_2,decls:15,vars:8,consts:[[1,"mat-form-field-wrapper"],[1,"mat-form-field-flex",3,"click"],["connectionContainer",""],[4,"ngIf"],["class","mat-form-field-prefix",3,"cdkObserveContentDisabled","cdkObserveContent",4,"ngIf"],[1,"mat-form-field-infix"],["inputContainer",""],[1,"mat-form-field-label-wrapper"],["class","mat-form-field-label",3,"cdkObserveContentDisabled","id","mat-empty","mat-form-field-empty","mat-accent","mat-warn","ngSwitch","cdkObserveContent",4,"ngIf"],["class","mat-form-field-suffix",4,"ngIf"],["class","mat-form-field-underline",4,"ngIf"],[1,"mat-form-field-subscript-wrapper",3,"ngSwitch"],[4,"ngSwitchCase"],["class","mat-form-field-hint-wrapper",4,"ngSwitchCase"],[1,"mat-form-field-outline"],[1,"mat-form-field-outline-start"],[1,"mat-form-field-outline-gap"],[1,"mat-form-field-outline-end"],[1,"mat-form-field-outline","mat-form-field-outline-thick"],[1,"mat-form-field-prefix",3,"cdkObserveContentDisabled","cdkObserveContent"],[1,"mat-form-field-label",3,"cdkObserveContentDisabled","id","ngSwitch","cdkObserveContent"],["label",""],["class","mat-placeholder-required mat-form-field-required-marker","aria-hidden","true",4,"ngIf"],["aria-hidden","true",1,"mat-placeholder-required","mat-form-field-required-marker"],[1,"mat-form-field-suffix"],[1,"mat-form-field-underline"],[1,"mat-form-field-ripple"],[1,"mat-form-field-hint-wrapper"],["class","mat-hint",3,"id",4,"ngIf"],[1,"mat-form-field-hint-spacer"],[1,"mat-hint",3,"id"]],template:function(e,r){1&e&&(Dd(y2),L(0,"div",0),L(1,"div",1,2),je("click",function(s){return r._control.onContainerClick&&r._control.onContainerClick(s)}),Be(3,o2,9,0,"ng-container",3),Be(4,a2,2,1,"div",4),L(5,"div",5,6),Fn(7),L(8,"span",7),Be(9,d2,5,16,"label",8),V(),V(),Be(10,f2,2,0,"div",9),V(),Be(11,h2,2,4,"div",10),L(12,"div",11),Be(13,p2,2,1,"div",12),Be(14,m2,5,2,"div",13),V(),V()),2&e&&(te(3),ie("ngIf","outline"==r.appearance),te(1),ie("ngIf",r._prefixChildren.length),te(5),ie("ngIf",r._hasFloatingLabel()),te(1),ie("ngIf",r._suffixChildren.length),te(1),ie("ngIf","outline"!=r.appearance),te(1),ie("ngSwitch",r._getDisplayedMessages()),te(1),ie("ngSwitchCase","error"),te(1),ie("ngSwitchCase","hint"))},directives:[Df,zB,ml,zC],styles:[".mat-form-field{display:inline-block;position:relative;text-align:left}[dir=rtl] .mat-form-field{text-align:right}.mat-form-field-wrapper{position:relative}.mat-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-form-field-prefix,.mat-form-field-suffix{white-space:nowrap;flex:none;position:relative}.mat-form-field-infix{display:block;position:relative;flex:auto;min-width:0;width:180px}.cdk-high-contrast-active .mat-form-field-infix{border-image:linear-gradient(transparent, transparent)}.mat-form-field-label-wrapper{position:absolute;left:0;box-sizing:content-box;width:100%;height:100%;overflow:hidden;pointer-events:none}[dir=rtl] .mat-form-field-label-wrapper{left:auto;right:0}.mat-form-field-label{position:absolute;left:0;font:inherit;pointer-events:none;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),width 400ms cubic-bezier(0.25, 0.8, 0.25, 1);display:none}[dir=rtl] .mat-form-field-label{transform-origin:100% 0;left:auto;right:0}.mat-form-field-empty.mat-form-field-label,.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label{display:block}.mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-label-wrapper .mat-form-field-label{display:none}.mat-form-field-can-float .mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-label-wrapper .mat-form-field-label{display:block;transition:none}.mat-input-server:focus+.mat-form-field-label-wrapper .mat-form-field-label,.mat-input-server[placeholder]:not(:placeholder-shown)+.mat-form-field-label-wrapper .mat-form-field-label{display:none}.mat-form-field-can-float .mat-input-server:focus+.mat-form-field-label-wrapper .mat-form-field-label,.mat-form-field-can-float .mat-input-server[placeholder]:not(:placeholder-shown)+.mat-form-field-label-wrapper .mat-form-field-label{display:block}.mat-form-field-label:not(.mat-form-field-empty){transition:none}.mat-form-field-underline{position:absolute;width:100%;pointer-events:none;transform:scale3d(1, 1.0001, 1)}.mat-form-field-ripple{position:absolute;left:0;width:100%;transform-origin:50%;transform:scaleX(0.5);opacity:0;transition:background-color 300ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-form-field.mat-focused .mat-form-field-ripple,.mat-form-field.mat-form-field-invalid .mat-form-field-ripple{opacity:1;transform:none;transition:transform 300ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 100ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 300ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-form-field-subscript-wrapper{position:absolute;box-sizing:border-box;width:100%;overflow:hidden}.mat-form-field-subscript-wrapper .mat-icon,.mat-form-field-label-wrapper .mat-icon{width:1em;height:1em;font-size:inherit;vertical-align:baseline}.mat-form-field-hint-wrapper{display:flex}.mat-form-field-hint-spacer{flex:1 0 1em}.mat-error{display:block}.mat-form-field-control-wrapper{position:relative}.mat-form-field-hint-end{order:1}.mat-form-field._mat-animation-noopable .mat-form-field-label,.mat-form-field._mat-animation-noopable .mat-form-field-ripple{transition:none}\n",'.mat-form-field-appearance-fill .mat-form-field-flex{border-radius:4px 4px 0 0;padding:.75em .75em 0 .75em}.cdk-high-contrast-active .mat-form-field-appearance-fill .mat-form-field-flex{outline:solid 1px}.cdk-high-contrast-active .mat-form-field-appearance-fill.mat-focused .mat-form-field-flex{outline:dashed 3px}.mat-form-field-appearance-fill .mat-form-field-underline::before{content:"";display:block;position:absolute;bottom:0;height:1px;width:100%}.mat-form-field-appearance-fill .mat-form-field-ripple{bottom:0;height:2px}.cdk-high-contrast-active .mat-form-field-appearance-fill .mat-form-field-ripple{height:0}.mat-form-field-appearance-fill:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:none;transition:opacity 600ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-form-field-appearance-fill._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{transition:none}.mat-form-field-appearance-fill .mat-form-field-subscript-wrapper{padding:0 1em}\n','.mat-input-element{font:inherit;background:transparent;color:currentColor;border:none;outline:none;padding:0;margin:0;width:100%;max-width:100%;vertical-align:bottom;text-align:inherit;box-sizing:content-box}.mat-input-element:-moz-ui-invalid{box-shadow:none}.mat-input-element,.mat-input-element::-webkit-search-cancel-button,.mat-input-element::-webkit-search-decoration,.mat-input-element::-webkit-search-results-button,.mat-input-element::-webkit-search-results-decoration{-webkit-appearance:none}.mat-input-element::-webkit-contacts-auto-fill-button,.mat-input-element::-webkit-caps-lock-indicator,.mat-input-element:not([type=password])::-webkit-credentials-auto-fill-button{visibility:hidden}.mat-input-element[type=date],.mat-input-element[type=datetime],.mat-input-element[type=datetime-local],.mat-input-element[type=month],.mat-input-element[type=week],.mat-input-element[type=time]{line-height:1}.mat-input-element[type=date]::after,.mat-input-element[type=datetime]::after,.mat-input-element[type=datetime-local]::after,.mat-input-element[type=month]::after,.mat-input-element[type=week]::after,.mat-input-element[type=time]::after{content:" ";white-space:pre;width:1px}.mat-input-element::-webkit-inner-spin-button,.mat-input-element::-webkit-calendar-picker-indicator,.mat-input-element::-webkit-clear-button{font-size:.75em}.mat-input-element::placeholder{-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-input-element::-moz-placeholder{-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-input-element::-webkit-input-placeholder{-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-input-element:-ms-input-placeholder{-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-form-field-hide-placeholder .mat-input-element::placeholder{color:transparent !important;-webkit-text-fill-color:transparent;transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-input-element::placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-input-element::-moz-placeholder{color:transparent !important;-webkit-text-fill-color:transparent;transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-input-element::-moz-placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-input-element::-webkit-input-placeholder{color:transparent !important;-webkit-text-fill-color:transparent;transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-input-element::-webkit-input-placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-input-element:-ms-input-placeholder{color:transparent !important;-webkit-text-fill-color:transparent;transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-input-element:-ms-input-placeholder{opacity:0}textarea.mat-input-element{resize:vertical;overflow:auto}textarea.mat-input-element.cdk-textarea-autosize{resize:none}textarea.mat-input-element{padding:2px 0;margin:-2px 0}select.mat-input-element{-moz-appearance:none;-webkit-appearance:none;position:relative;background-color:transparent;display:inline-flex;box-sizing:border-box;padding-top:1em;top:-1em;margin-bottom:-1em}select.mat-input-element::-moz-focus-inner{border:0}select.mat-input-element:not(:disabled){cursor:pointer}.mat-form-field-type-mat-native-select .mat-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;position:absolute;top:50%;right:0;margin-top:-2.5px;pointer-events:none}[dir=rtl] .mat-form-field-type-mat-native-select .mat-form-field-infix::after{right:auto;left:0}.mat-form-field-type-mat-native-select .mat-input-element{padding-right:15px}[dir=rtl] .mat-form-field-type-mat-native-select .mat-input-element{padding-right:0;padding-left:15px}.mat-form-field-type-mat-native-select .mat-form-field-label-wrapper{max-width:calc(100% - 10px)}.mat-form-field-type-mat-native-select.mat-form-field-appearance-outline .mat-form-field-infix::after{margin-top:-5px}.mat-form-field-type-mat-native-select.mat-form-field-appearance-fill .mat-form-field-infix::after{margin-top:-10px}\n',".mat-form-field-appearance-legacy .mat-form-field-label{transform:perspective(100px)}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon{width:1em}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon-button,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon-button{font:inherit;vertical-align:baseline}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon-button .mat-icon{font-size:inherit}.mat-form-field-appearance-legacy .mat-form-field-underline{height:1px}.cdk-high-contrast-active .mat-form-field-appearance-legacy .mat-form-field-underline{height:0;border-top:solid 1px}.mat-form-field-appearance-legacy .mat-form-field-ripple{top:0;height:2px;overflow:hidden}.cdk-high-contrast-active .mat-form-field-appearance-legacy .mat-form-field-ripple{height:0;border-top:solid 2px}.mat-form-field-appearance-legacy.mat-form-field-disabled .mat-form-field-underline{background-position:0;background-color:transparent}.cdk-high-contrast-active .mat-form-field-appearance-legacy.mat-form-field-disabled .mat-form-field-underline{border-top-style:dotted;border-top-width:2px}.mat-form-field-appearance-legacy.mat-form-field-invalid:not(.mat-focused) .mat-form-field-ripple{height:1px}\n",".mat-form-field-appearance-outline .mat-form-field-wrapper{margin:.25em 0}.mat-form-field-appearance-outline .mat-form-field-flex{padding:0 .75em 0 .75em;margin-top:-0.25em;position:relative}.mat-form-field-appearance-outline .mat-form-field-prefix,.mat-form-field-appearance-outline .mat-form-field-suffix{top:.25em}.mat-form-field-appearance-outline .mat-form-field-outline{display:flex;position:absolute;top:.25em;left:0;right:0;bottom:0;pointer-events:none}.mat-form-field-appearance-outline .mat-form-field-outline-start,.mat-form-field-appearance-outline .mat-form-field-outline-end{border:1px solid currentColor;min-width:5px}.mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:5px 0 0 5px;border-right-style:none}[dir=rtl] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-right-style:solid;border-left-style:none;border-radius:0 5px 5px 0}.mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 5px 5px 0;border-left-style:none;flex-grow:1}[dir=rtl] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-left-style:solid;border-right-style:none;border-radius:5px 0 0 5px}.mat-form-field-appearance-outline .mat-form-field-outline-gap{border-radius:.000001px;border:1px solid currentColor;border-left-style:none;border-right-style:none}.mat-form-field-appearance-outline.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-outline-gap{border-top-color:transparent}.mat-form-field-appearance-outline .mat-form-field-outline-thick{opacity:0}.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-start,.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-end,.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-gap{border-width:2px}.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline,.mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline{opacity:0;transition:opacity 100ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,.mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline-thick{opacity:1}.cdk-high-contrast-active .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick{border:3px dashed}.mat-form-field-appearance-outline:not(.mat-form-field-disabled) .mat-form-field-flex:hover .mat-form-field-outline{opacity:0;transition:opacity 600ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-form-field-appearance-outline:not(.mat-form-field-disabled) .mat-form-field-flex:hover .mat-form-field-outline-thick{opacity:1}.mat-form-field-appearance-outline .mat-form-field-subscript-wrapper{padding:0 1em}.mat-form-field-appearance-outline._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-outline,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-start,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-end,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-gap{transition:none}\n",".mat-form-field-appearance-standard .mat-form-field-flex{padding-top:.75em}.mat-form-field-appearance-standard .mat-form-field-underline{height:1px}.cdk-high-contrast-active .mat-form-field-appearance-standard .mat-form-field-underline{height:0;border-top:solid 1px}.mat-form-field-appearance-standard .mat-form-field-ripple{bottom:0;height:2px}.cdk-high-contrast-active .mat-form-field-appearance-standard .mat-form-field-ripple{height:0;border-top:solid 2px}.mat-form-field-appearance-standard.mat-form-field-disabled .mat-form-field-underline{background-position:0;background-color:transparent}.cdk-high-contrast-active .mat-form-field-appearance-standard.mat-form-field-disabled .mat-form-field-underline{border-top-style:dotted;border-top-width:2px}.mat-form-field-appearance-standard:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:none;transition:opacity 600ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-form-field-appearance-standard._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{transition:none}\n"],encapsulation:2,data:{animation:[C2.transitionMessages]},changeDetection:0}),n})(),yp=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[QC,zo,WB],zo]}),n})();const dx=tu({passive:!0});let T2=(()=>{class n{constructor(e,r){this._platform=e,this._ngZone=r,this._monitoredElements=new Map}monitor(e){if(!this._platform.isBrowser)return Dn;const r=Rh(e),i=this._monitoredElements.get(r);if(i)return i.subject;const s=new Xe,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||r.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&r.classList.contains(o)&&(r.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(r.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{r.addEventListener("animationstart",a,dx),r.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(r,{subject:s,unlisten:()=>{r.removeEventListener("animationstart",a,dx)}}),s}stopMonitoring(e){const r=Rh(e),i=this._monitoredElements.get(r);i&&(i.unlisten(),i.subject.complete(),r.classList.remove("cdk-text-field-autofill-monitored"),r.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(r))}ngOnDestroy(){this._monitoredElements.forEach((e,r)=>this.stopMonitoring(r))}}return n.\u0275fac=function(e){return new(e||n)(D(eu),D(ce))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),fx=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[KB]]}),n})();const I2=new F("MAT_INPUT_VALUE_ACCESSOR"),F2=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let R2=0;const O2=pj(class{constructor(n,t,e,r){this._defaultErrorStateMatcher=n,this._parentForm=t,this._parentFormGroup=e,this.ngControl=r}});let N2=(()=>{class n extends O2{constructor(e,r,i,s,o,a,l,u,c,d){super(a,s,o,i),this._elementRef=e,this._platform=r,this._autofillMonitor=u,this._formField=d,this._uid="mat-input-"+R2++,this.focused=!1,this.stateChanges=new Xe,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(g=>XE().has(g));const f=this._elementRef.nativeElement,h=f.nodeName.toLowerCase();this._inputValueAccessor=l||f,this._previousNativeValue=this.value,this.id=this.id,r.IOS&&c.runOutsideAngular(()=>{e.nativeElement.addEventListener("keyup",g=>{const m=g.target;!m.value&&0===m.selectionStart&&0===m.selectionEnd&&(m.setSelectionRange(1,1),m.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===h,this._isTextarea="textarea"===h,this._isInFormField=!!d,this._isNativeSelect&&(this.controlType=f.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(e){this._disabled=xt(e),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(e){this._id=e||this._uid}get required(){var e,r,i,s;return null!==(s=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(r=this.ngControl)||void 0===r?void 0:r.control)||void 0===i?void 0:i.hasValidator(zV.required))&&void 0!==s&&s}set required(e){this._required=xt(e)}get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&XE().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(e){e!==this.value&&(this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=xt(e)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}_focusChanged(e){e!==this.focused&&(this.focused=e,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var e,r;const i=(null===(r=null===(e=this._formField)||void 0===e?void 0:e._hideControlPlaceholder)||void 0===r?void 0:r.call(e))?null:this.placeholder;if(i!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=i,i?s.setAttribute("placeholder",i):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_validateType(){F2.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const e=this._elementRef.nativeElement,r=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&r&&r.label)}return this.focused||!this.empty}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){const e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}}return n.\u0275fac=function(e){return new(e||n)(p($),p(eu),p(ar,10),p(Uo,8),p(Xl,8),p(ow),p(I2,10),p(T2),p(ce),p(cx,8))},n.\u0275dir=b({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:12,hostBindings:function(e,r){1&e&&je("focus",function(){return r._focusChanged(!0)})("blur",function(){return r._focusChanged(!1)})("input",function(){return r._onInput()}),2&e&&(Md("disabled",r.disabled)("required",r.required),kt("id",r.id)("data-placeholder",r.placeholder)("name",r.name||null)("readonly",r.readonly&&!r._isNativeSelect||null)("aria-invalid",r.empty&&r.required?null:r.errorState)("aria-required",r.required),Qn("mat-input-server",r._isServer)("mat-native-select-inline",r._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly"},exportAs:["matInput"],features:[pe([{provide:gp,useExisting:n}]),x,st]}),n})(),k2=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({providers:[ow],imports:[[fx,yp,zo],fx,yp]}),n})();class L2{}class Ir{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(e=>{const r=e.indexOf(":");if(r>0){const i=e.slice(0,r),s=i.toLowerCase(),o=e.slice(r+1).trim();this.maybeSetNormalizedName(i,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let r=t[e];const i=e.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(i,r),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof Ir?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new Ir;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof Ir?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let r=t.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...r),this.headers.set(e,i);break;case"d":const s=t.value;if(s){let o=this.headers.get(e);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,o)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class V2{encodeKey(t){return hx(t)}encodeValue(t){return hx(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const j2=/%(\d[a-f0-9])/gi,H2={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function hx(n){return encodeURIComponent(n).replace(j2,(t,e)=>{var r;return null!==(r=H2[e])&&void 0!==r?r:t})}function px(n){return`${n}`}class Fr{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new V2,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function B2(n,t){const e=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(i=>{const s=i.indexOf("="),[o,a]=-1==s?[t.decodeKey(i),""]:[t.decodeKey(i.slice(0,s)),t.decodeValue(i.slice(s+1))],l=e.get(o)||[];l.push(a),e.set(o,l)}),e}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const r=t.fromObject[e];this.map.set(e,Array.isArray(r)?r:[r])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){const e=[];return Object.keys(t).forEach(r=>{const i=t[r];Array.isArray(i)?i.forEach(s=>{e.push({param:r,value:s,op:"a"})}):e.push({param:r,value:i,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(r=>e+"="+this.encoder.encodeValue(r)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Fr({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(px(t.value)),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let r=this.map.get(t.param)||[];const i=r.indexOf(px(t.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(t.param,r):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class U2{constructor(){this.map=new Map}set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}}function gx(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function mx(n){return"undefined"!=typeof Blob&&n instanceof Blob}function yx(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Yo{constructor(t,e,r,i){let s;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function G2(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,s=i):s=r,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Ir),this.context||(this.context=new U2),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=e;else{const a=e.indexOf("?");this.urlWithParams=e+(-1===a?"?":a<e.length-1?"&":"")+o}}else this.params=new Fr,this.urlWithParams=e}serializeBody(){return null===this.body?null:gx(this.body)||mx(this.body)||yx(this.body)||function $2(n){return"undefined"!=typeof URLSearchParams&&n instanceof URLSearchParams}(this.body)||"string"==typeof this.body?this.body:this.body instanceof Fr?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body||yx(this.body)?null:mx(this.body)?this.body.type||null:gx(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof Fr?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||"boolean"==typeof this.body?"application/json":null}clone(t={}){var e;const r=t.method||this.method,i=t.url||this.url,s=t.responseType||this.responseType,o=void 0!==t.body?t.body:this.body,a=void 0!==t.withCredentials?t.withCredentials:this.withCredentials,l=void 0!==t.reportProgress?t.reportProgress:this.reportProgress;let u=t.headers||this.headers,c=t.params||this.params;const d=null!==(e=t.context)&&void 0!==e?e:this.context;return void 0!==t.setHeaders&&(u=Object.keys(t.setHeaders).reduce((f,h)=>f.set(h,t.setHeaders[h]),u)),t.setParams&&(c=Object.keys(t.setParams).reduce((f,h)=>f.set(h,t.setParams[h]),c)),new Yo(r,i,o,{params:c,headers:u,context:d,reportProgress:l,responseType:s,withCredentials:a})}}var nt=(()=>((nt=nt||{})[nt.Sent=0]="Sent",nt[nt.UploadProgress=1]="UploadProgress",nt[nt.ResponseHeader=2]="ResponseHeader",nt[nt.DownloadProgress=3]="DownloadProgress",nt[nt.Response=4]="Response",nt[nt.User=5]="User",nt))();class _p extends class q2{constructor(t,e=200,r="OK"){this.headers=t.headers||new Ir,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||r,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}{constructor(t={}){super(t),this.type=nt.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new _p({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}function vp(n,t){return{body:t,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let vx=(()=>{class n{constructor(e){this.handler=e}request(e,r,i={}){let s;if(e instanceof Yo)s=e;else{let l,u;l=i.headers instanceof Ir?i.headers:new Ir(i.headers),i.params&&(u=i.params instanceof Fr?i.params:new Fr({fromObject:i.params})),s=new Yo(e,r,void 0!==i.body?i.body:null,{headers:l,context:i.context,params:u,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const o=B(s).pipe(cs(l=>this.handler.handle(l)));if(e instanceof Yo||"events"===i.observe)return o;const a=o.pipe(kn(l=>l instanceof _p));switch(i.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(ee(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(ee(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(ee(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));default:return a.pipe(ee(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(e,r={}){return this.request("DELETE",e,r)}get(e,r={}){return this.request("GET",e,r)}head(e,r={}){return this.request("HEAD",e,r)}jsonp(e,r){return this.request("JSONP",e,{params:(new Fr).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,r={}){return this.request("OPTIONS",e,r)}patch(e,r,i={}){return this.request("PATCH",e,vp(i,r))}post(e,r,i={}){return this.request("POST",e,vp(i,r))}put(e,r,i={}){return this.request("PUT",e,vp(i,r))}}return n.\u0275fac=function(e){return new(e||n)(D(L2))},n.\u0275prov=w({token:n,factory:n.\u0275fac}),n})();const W2=["*"];let bu;function Zo(n){var t;return(null===(t=function K2(){if(void 0===bu&&(bu=null,"undefined"!=typeof window)){const n=window;void 0!==n.trustedTypes&&(bu=n.trustedTypes.createPolicy("angular#components",{createHTML:t=>t}))}return bu}())||void 0===t?void 0:t.createHTML(n))||n}function Cx(n){return Error(`Unable to find icon with the name "${n}"`)}function bx(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function Dx(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class fi{constructor(t,e,r){this.url=t,this.svgText=e,this.options=r}}let Du=(()=>{class n{constructor(e,r,i,s){this._httpClient=e,this._sanitizer=r,this._errorHandler=s,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=i}addSvgIcon(e,r,i){return this.addSvgIconInNamespace("",e,r,i)}addSvgIconLiteral(e,r,i){return this.addSvgIconLiteralInNamespace("",e,r,i)}addSvgIconInNamespace(e,r,i,s){return this._addSvgIconConfig(e,r,new fi(i,null,s))}addSvgIconResolver(e){return this._resolvers.push(e),this}addSvgIconLiteralInNamespace(e,r,i,s){const o=this._sanitizer.sanitize(ae.HTML,i);if(!o)throw Dx(i);const a=Zo(o);return this._addSvgIconConfig(e,r,new fi("",a,s))}addSvgIconSet(e,r){return this.addSvgIconSetInNamespace("",e,r)}addSvgIconSetLiteral(e,r){return this.addSvgIconSetLiteralInNamespace("",e,r)}addSvgIconSetInNamespace(e,r,i){return this._addSvgIconSetConfig(e,new fi(r,null,i))}addSvgIconSetLiteralInNamespace(e,r,i){const s=this._sanitizer.sanitize(ae.HTML,r);if(!s)throw Dx(r);const o=Zo(s);return this._addSvgIconSetConfig(e,new fi("",o,i))}registerFontClassAlias(e,r=e){return this._fontCssClassesByAlias.set(e,r),this}classNameForFontAlias(e){return this._fontCssClassesByAlias.get(e)||e}setDefaultFontSetClass(e){return this._defaultFontSetClass=e,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(e){const r=this._sanitizer.sanitize(ae.RESOURCE_URL,e);if(!r)throw bx(e);const i=this._cachedIconsByUrl.get(r);return i?B(Eu(i)):this._loadSvgIconFromConfig(new fi(e,null)).pipe(et(s=>this._cachedIconsByUrl.set(r,s)),ee(s=>Eu(s)))}getNamedSvgIcon(e,r=""){const i=Ex(r,e);let s=this._svgIconConfigs.get(i);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(r,e),s)return this._svgIconConfigs.set(i,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(r);return o?this._getSvgFromIconSetConfigs(e,o):function P2(n,t){const e=se(n)?n:()=>n,r=i=>i.error(e());return new de(t?i=>t.schedule(r,0,i):r)}(Cx(i))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(e){return e.svgText?B(Eu(this._svgElementFromConfig(e))):this._loadSvgIconFromConfig(e).pipe(ee(r=>Eu(r)))}_getSvgFromIconSetConfigs(e,r){const i=this._extractIconWithNameFromAnySet(e,r);return i?B(i):jD(r.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(tr(a=>{const u=`Loading icon set URL: ${this._sanitizer.sanitize(ae.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(u)),B(null)})))).pipe(ee(()=>{const o=this._extractIconWithNameFromAnySet(e,r);if(!o)throw Cx(e);return o}))}_extractIconWithNameFromAnySet(e,r){for(let i=r.length-1;i>=0;i--){const s=r[i];if(s.svgText&&s.svgText.toString().indexOf(e)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,e,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(e){return this._fetchIcon(e).pipe(et(r=>e.svgText=r),ee(()=>this._svgElementFromConfig(e)))}_loadSvgIconSetFromConfig(e){return e.svgText?B(null):this._fetchIcon(e).pipe(et(r=>e.svgText=r))}_extractSvgIconFromSet(e,r,i){const s=e.querySelector(`[id="${r}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,i);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),i);const a=this._svgElementFromString(Zo("<svg></svg>"));return a.appendChild(o),this._setSvgAttributes(a,i)}_svgElementFromString(e){const r=this._document.createElement("DIV");r.innerHTML=e;const i=r.querySelector("svg");if(!i)throw Error("<svg> tag not found");return i}_toSvgElement(e){const r=this._svgElementFromString(Zo("<svg></svg>")),i=e.attributes;for(let s=0;s<i.length;s++){const{name:o,value:a}=i[s];"id"!==o&&r.setAttribute(o,a)}for(let s=0;s<e.childNodes.length;s++)e.childNodes[s].nodeType===this._document.ELEMENT_NODE&&r.appendChild(e.childNodes[s].cloneNode(!0));return r}_setSvgAttributes(e,r){return e.setAttribute("fit",""),e.setAttribute("height","100%"),e.setAttribute("width","100%"),e.setAttribute("preserveAspectRatio","xMidYMid meet"),e.setAttribute("focusable","false"),r&&r.viewBox&&e.setAttribute("viewBox",r.viewBox),e}_fetchIcon(e){var r;const{url:i,options:s}=e,o=null!==(r=null==s?void 0:s.withCredentials)&&void 0!==r&&r;if(!this._httpClient)throw function Q2(){return Error("Could not find HttpClient provider for use with Angular Material icons. Please include the HttpClientModule from @angular/common/http in your app imports.")}();if(null==i)throw Error(`Cannot fetch icon from URL "${i}".`);const a=this._sanitizer.sanitize(ae.RESOURCE_URL,i);if(!a)throw bx(i);const l=this._inProgressUrlFetches.get(a);if(l)return l;const u=this._httpClient.get(a,{responseType:"text",withCredentials:o}).pipe(ee(c=>Zo(c)),Cb(()=>this._inProgressUrlFetches.delete(a)),Wp());return this._inProgressUrlFetches.set(a,u),u}_addSvgIconConfig(e,r,i){return this._svgIconConfigs.set(Ex(e,r),i),this}_addSvgIconSetConfig(e,r){const i=this._iconSetConfigs.get(e);return i?i.push(r):this._iconSetConfigs.set(e,[r]),this}_svgElementFromConfig(e){if(!e.svgElement){const r=this._svgElementFromString(e.svgText);this._setSvgAttributes(r,e.options),e.svgElement=r}return e.svgElement}_getIconConfigFromResolvers(e,r){for(let i=0;i<this._resolvers.length;i++){const s=this._resolvers[i](r,e);if(s)return Z2(s)?new fi(s.url,null,s.options):new fi(s,null)}}}return n.\u0275fac=function(e){return new(e||n)(D(vx,8),D(Dl),D(ye,8),D(zn))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function Eu(n){return n.cloneNode(!0)}function Ex(n,t){return n+":"+t}function Z2(n){return!(!n.url||!n.options)}const X2=sw(class{constructor(n){this._elementRef=n}}),J2=new F("mat-icon-location",{providedIn:"root",factory:function eU(){const n=$s(ye),t=n?n.location:null;return{getPathname:()=>t?t.pathname+t.search:""}}}),wx=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],tU=wx.map(n=>`[${n}]`).join(", "),nU=/^url\(['"]?#(.*?)['"]?\)$/;let rU=(()=>{class n extends X2{constructor(e,r,i,s,o){super(e),this._iconRegistry=r,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=bt.EMPTY,i||e.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(e){this._inline=xt(e)}get svgIcon(){return this._svgIcon}set svgIcon(e){e!==this._svgIcon&&(e?this._updateSvgIcon(e):this._svgIcon&&this._clearSvgElement(),this._svgIcon=e)}get fontSet(){return this._fontSet}set fontSet(e){const r=this._cleanupFontValue(e);r!==this._fontSet&&(this._fontSet=r,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(e){const r=this._cleanupFontValue(e);r!==this._fontIcon&&(this._fontIcon=r,this._updateFontIconClasses())}_splitIconName(e){if(!e)return["",""];const r=e.split(":");switch(r.length){case 1:return["",r[0]];case 2:return r;default:throw Error(`Invalid icon name: "${e}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const e=this._elementsWithExternalReferences;if(e&&e.size){const r=this._location.getPathname();r!==this._previousPath&&(this._previousPath=r,this._prependPathToReferences(r))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(e){this._clearSvgElement();const r=e.querySelectorAll("style");for(let s=0;s<r.length;s++)r[s].textContent+=" ";const i=this._location.getPathname();this._previousPath=i,this._cacheChildrenWithExternalReferences(e),this._prependPathToReferences(i),this._elementRef.nativeElement.appendChild(e)}_clearSvgElement(){const e=this._elementRef.nativeElement;let r=e.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();r--;){const i=e.childNodes[r];(1!==i.nodeType||"svg"===i.nodeName.toLowerCase())&&i.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;const e=this._elementRef.nativeElement,r=this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet):this._iconRegistry.getDefaultFontSetClass();r!=this._previousFontSetClass&&(this._previousFontSetClass&&e.classList.remove(this._previousFontSetClass),r&&e.classList.add(r),this._previousFontSetClass=r),this.fontIcon!=this._previousFontIconClass&&(this._previousFontIconClass&&e.classList.remove(this._previousFontIconClass),this.fontIcon&&e.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(e){return"string"==typeof e?e.trim().split(" ")[0]:e}_prependPathToReferences(e){const r=this._elementsWithExternalReferences;r&&r.forEach((i,s)=>{i.forEach(o=>{s.setAttribute(o.name,`url('${e}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(e){const r=e.querySelectorAll(tU),i=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s<r.length;s++)wx.forEach(o=>{const a=r[s],l=a.getAttribute(o),u=l?l.match(nU):null;if(u){let c=i.get(a);c||(c=[],i.set(a,c)),c.push({name:o,value:u[1]})}})}_updateSvgIcon(e){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),e){const[r,i]=this._splitIconName(e);r&&(this._svgNamespace=r),i&&(this._svgName=i),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(i,r).pipe(mi(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${r}:${i}! ${s.message}`))})}}}return n.\u0275fac=function(e){return new(e||n)(p($),p(Du),Mi("aria-hidden"),p(J2),p(zn))},n.\u0275cmp=Vr({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(e,r){2&e&&(kt("data-mat-icon-type",r._usingFontIcon()?"font":"svg")("data-mat-icon-name",r._svgName||r.fontIcon)("data-mat-icon-namespace",r._svgNamespace||r.fontSet),Qn("mat-icon-inline",r.inline)("mat-icon-no-color","primary"!==r.color&&"accent"!==r.color&&"warn"!==r.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[x],ngContentSelectors:W2,decls:1,vars:0,template:function(e,r){1&e&&(Dd(),Fn(0))},styles:[".mat-icon{-webkit-user-select:none;-moz-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),n})(),iU=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[zo],zo]}),n})();function sU(n,t){1&n&&(vr(0),lt(1,"img",13),Cr())}function oU(n,t){if(1&n&&(L(0,"div"),lt(1,"h3",24),V()),2&n){const e=t.$implicit;te(1),Ed("innerHTML",e,om)}}function aU(n,t){if(1&n&&(vr(0),L(1,"div",23),L(2,"h1"),ut(3),V(),Be(4,oU,2,1,"div",10),V(),Cr()),2&n){const e=t.$implicit;te(3),Kr(e.title),te(1),ie("ngForOf",e.description)}}function lU(n,t){if(1&n&&(L(0,"div",14),L(1,"div",15),lt(2,"img",16),V(),L(3,"h2"),ut(4),V(),L(5,"h3",17),L(6,"h1"),ut(7,"Como Funciona"),V(),lt(8,"p",18),V(),L(9,"div",19),Be(10,aU,5,2,"ng-container",10),V(),L(11,"div",20),L(12,"a",21),ut(13,"Compartilhe Agora Via Whatsapp"),V(),V(),L(14,"div",22),L(15,"a",21),ut(16,"Reportar Golpe"),V(),V(),L(17,"p"),ut(18,"*Conte\xfado produzido com a colabora\xe7\xe3o de informa\xe7\xf5es das Pol\xedcias Civis do Distrito Federal (PC/DF) e do Rio Grande do Sul (PC/RS)."),V(),V()),2&n){const e=Pt();te(2),ie("src",e.selectedGolpe.img,mr),te(2),Kr(e.selectedGolpe.title),te(4),ie("innerText",e.selectedGolpe.description),te(2),ie("ngForOf",e.selectedGolpe.steps),te(2),ie("href","https://api.whatsapp.com/send?text=Saiba como se proteger de golpes!! acesse https://golpes.org?g="+e.selectedGolpe.id,mr),te(3),ie("href","https://airtable.com/shrRgqT7toNlyleJ5",mr)}}function uU(n,t){1&n&&(L(0,"div",25),ut(1,"N\xe3o encontramos nenhum golpe com esse nome"),V())}const cU=function(n){return{g:n}};function dU(n,t){if(1&n){const e=so();vr(0),L(1,"div",26),je("click",function(){return Os(e),Pt().scrollUp()}),lt(2,"img",16),L(3,"span"),ut(4),V(),V(),Cr()}if(2&n){const e=t.$implicit;te(1),ie("queryParams",Mv(3,cU,e.id)),te(1),ie("src",e.img,mr),te(2),Kr(e.title)}}function fU(n,t){1&n&&(L(0,"div",22),L(1,"a",21),ut(2,"Reportar Golpe"),V(),V()),2&n&&(te(1),ie("href","https://airtable.com/shrRgqT7toNlyleJ5",mr))}function hU(n,t){if(1&n){const e=so();vr(0),L(1,"img",27),je("click",function(){return Os(e),Pt().scrollUp()}),V(),Cr()}}const pU=[{path:"",component:(()=>{class n{constructor(e){this.route=e,this.golpes=[{id:"WhatsApp",title:"WhatsApp",description:"Os criminosos vinculam uma imagem de perfil da v\xedtima, geralmente retirada do seu pr\xf3prio perfil de WhatsApp ou redes sociais. Com uma conta falsa, eles se passam pela v\xedtima e solicitam dinheiro para amigos, familiares e conhecidos.",img:"https://i.ibb.co/cNnHyRc/Ellipse-50.png",steps:[{title:"Como Prevenir?",description:["Ajuste a visualiza\xe7\xe3o da imagem da conta do WhatsApp apenas para contatos autorizados;","Fique atento a mensagens de conhecidos ou familiares solicitando dep\xf3sito e/ou transfer\xeancias banc\xe1rias (ainda mais se for em nome de terceiros);","Desconfie de contas com fotos de conhecidos, mas com n\xfameros diferentes;"]},{title:"O que Fazer?",description:['Registre um Boletim de Ocorr\xeancia e denunciar ao WhatsApp atrav\xe9s do e-mail: suporte@whatsapp.com. Tamb\xe9m \xe9 poss\xedvel denunciar clicando no n\xfamero do golpe, clicar no campo "Dados do contato" e clicar em "denunciar". Avisar familiares e conhecidos, no caso de detectar que est\xe3o utilizando seu nome para aplicar o golpe.']}]},{id:"GolpeDoAmor",title:"Golpe do Amor",description:"Os golpistas buscam dados de suas v\xedtimas em aplicativos de relacionamento e namoro.\n\n O primeiro contato \xe9 feito pelo site de relacionamento e depois pelo WhatsApp.\n\n - Ap\xf3s iniciar conversas amorosas com fotos de uma pessoa fict\xedcia, surgem as falsas declara\xe7\xf5es de amor e conversas sobre o desejo de se mudar para o Brasil e assim poder viver perto da v\xedtima;\n\n - Na sequ\xeancia, pedem o endere\xe7o residencial da v\xedtima e depois afirmam que est\xe3o enviando uma caixa (muitas vezes mandam fotos) com joias, numer\xe1rios e outros itens, que supostamente foram retidos pela Receita Federal. Para retir\xe1-la, a v\xedtima precisa fazer um dep\xf3sito de um valor, que geralmente varia de R$ 2.500 a R$ 4.000.\n\n - Em alguns casos, o golpista afirma que tem um intermedi\xe1rio no envio da tal caixa e pede que todo o dep\xf3sito ou parte dele seja feito no nome dessa pessoa. Fazem amea\xe7as \xe0 v\xedtima e seus familiares caso n\xe3o efetue o dep\xf3sito.",img:"https://i.ibb.co/YRrrYCx/Ellipse-49.png",steps:[{title:"Como Prevenir?",description:["Nunca compartilhe fotos e v\xeddeos \xedntimas atrav\xe9s de mensagens;"]},{title:"O que Fazer?",description:["Se for v\xedtima de extors\xe3o, procure a Delegacia de Pol\xedcia mais pr\xf3xima;","N\xe3o deposite o valor solicitado."]}]},{id:"FalsoEmprestimo",title:"Falso Empr\xe9stimo",description:"Os criminosos fazem an\xfancios em redes sociais se passando por institui\xe7\xf5es financeiras de cr\xe9dito r\xe1pido com ofertas tentadoras.\n - Ap\xf3s contato da v\xedtima, os criminosos solicitam o pagamento de uma taxa para a libera\xe7\xe3o do empr\xe9stimo;\n - S\xe3o solicitados diversos pagamentos, at\xe9 que v\xedtima perceba que se trata de um golpe e pare de pagar.",img:"https://i.ibb.co/9tC3ZD1/Ellipse-48.png",steps:[{title:"Como Prevenir?",description:["Institui\xe7\xf5es financeiras nunca solicitam pagamentos pr\xe9vios para a libera\xe7\xe3o de valores;","Sempre desconfie de ofertas imperd\xedveis, na d\xfavida, procure os canais de comunica\xe7\xe3o da institui\xe7\xe3o."]},{title:"O que Fazer?",description:["Registre um Boletim de Ocorr\xeancia"]}]},{id:"plataformaCompraVenda",title:"Golpe OLX",description:"A v\xedtima faz um an\xfancio em plataformas de compra/venda online e deixa o n\xfamero de contato acess\xedvel ao p\xfablico; Os criminosos, de posse do n\xfamero, se passam pelo suporte da plataforma e pedem para que a v\xedtima passe um c\xf3digo de valida\xe7\xe3o recebido por mensagem;\n O c\xf3digo recebido \xe9 de autentica\xe7\xe3o do WhatsApp da v\xedtima, que ter\xe1 o 'aplicativo clonado, caso passe o c\xf3digo recebido ao criminoso.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Nunca informe c\xf3digos recebidos por mensagem para ningu\xe9m e habilite a autentica\xe7\xe3o de dois fatores em sua conta;","Na d\xfavida, entre em contato atrav\xe9s dos canais oficiais da plataforma."]},{title:"O que Fazer?",description:['Registre um Boletim de Ocorr\xeancia e denunciar ao WhatsApp atrav\xe9s do e-mail: suporte@whatsapp.com, tamb\xe9m \xe9 poss\xedvel denunciar clicando no n\xfamero do golpe, clicar no campo "Dados do contato" e clicar em "denunciar".\n Ap\xf3s o envio do e-mail, realize o procedimento para recupera\xe7\xe3o da conta sucessivas vezes, para bloquear a conta e o criminoso n\xe3o conseguir mais utiliz\xe1-la.']}]},{id:"linksFalsos",title:"Golpe dos links falsos",description:"Atrav\xe9s de mensagens os criminosos dizem que a v\xedtima se enquadrou para o recebimento de alguma promo\xe7\xe3o, sorteio, aux\xedlio emergencial, ou encaminham algum alerta dizendo que ocorreu uma opera\xe7\xe3o indevida em sua conta.\n \u2013 O criminoso ent\xe3o encaminha um link malicioso dizendo que deve ser acessado para que a v\xedtima receba o pr\xeamio o benef\xedcio ou para evitar que a conta seja bloqueada;\n \u2013 Ao acionar o link, a v\xedtima \xe9 redirecionada para sites falsos de cadastros, ou baixa automaticamente aplicativos maliciosos no telefone, todos com objetivo de obter informa\xe7\xf5es pessoais da v\xedtima;",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Sempre desconfie de links encaminhados via WhatsApp ou SMS, na d\xfavida, entre em contato direto com os canais oficiais de comunica\xe7\xe3o;"]},{title:"O que Fazer?",description:["No caso de acionar o link ou realizar o cadastro em algum site, informe seu banco e leve seu telefone em alguma assist\xeancia para verificar a exist\xeancia de aplicativos maliciosos."]}]},{id:"intermediadorVendas",title:"Golpe do falso intermediador de vendas",description:"O criminoso consegue o telefone da v\xedtima em sites de vendas online;\n Ele copia o an\xfancio feito pela v\xedtima e cria um novo an\xfancio falso, entretanto, com o valor mais baixo.\n - O golpista diz que comprar\xe1 o bem anunciado e que pagar\xe1 uma d\xedvida que possui com algum cliente, s\xf3cio, amigo ou irm\xe3o, e, portanto, pede sil\xeancio no momento de apresentar o objeto para a segunda v\xedtima, prometendo algum lucro financeiro nesta negocia\xe7\xe3o silenciosa;\n - A v\xedtima interessada em comprar tamb\xe9m \xe9 orientada a se manter em sil\xeancio e por isso ganhar\xe1 um desconto;\n - Com o enredo pronto, o criminoso fornece contas de terceiro para receber o pagamento;\n \u2013 Ap\xf3s recebido valor, o criminoso combina de assinar o recibo em cart\xf3rio com ambas as v\xedtimas, as quais descobrem que ca\xedram em um golpe.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Mantenha sempre um di\xe1logo aberto com o vendedor/comprador;","Fa\xe7a quest\xe3o de ver o bem pessoalmente;","Busque outras formas de confirmar que realmente a pessoa que esta vendendo \xe9 a mesma que esta sendo feita a negocia\xe7\xe3o;","Confirme se a conta informada pertence ao vendedor, ou algum familiar pr\xf3ximo (filho, esposa, pai, m\xe3e, etc.);","Quando dispon\xedvel, utilize os meios de pagamentos oferecidos pelas plataformas de venda."]},{title:"O que Fazer?",description:["Registre um Boletim de Ocorr\xeancia"]}]},{id:"falsoSequestro",title:"Golpe do falso sequestro",description:"Os criminosos ligam para a v\xedtima se passando por algum familiar. Com voz de choro, o suposto familiar diz que foi sequestrado e que os criminosos v\xe3o tirar a sua vida. A v\xedtima, assustada, acaba informando o nome de familiares aos criminosos, informa\xe7\xe3o utilizada por eles para dar mais autenticidade ao golpe;\n \u2013 Os criminosos solicitam o dep\xf3sito de valores em algumas contas ou pedem que coloquem cr\xe9ditos em alguns n\xfameros telef\xf4nicos;\n \u2013 Em algumas modalidades, os criminosos determinam que a v\xedtima saia de casa, v\xe1 at\xe9 um local reservado, que n\xe3o alerte ningu\xe9m e que n\xe3o entre em contato com seus familiares. Solicitam ent\xe3o o telefone de outra pessoa da fam\xedlia, para que este consiga o dinheiro solicitado;\n \u2013 De posse do telefone de outro familiar, o criminoso entra em contato, dizendo que sequestrou a v\xedtima, esta, incomunic\xe1vel e fora de casa, n\xe3o consegue entrar em contato, deixando a impress\xe3o que realmente foi sequestrada;",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["No caso de receber alguma liga\xe7\xe3o deste tipo, desligue e tente entrar em contato com o familiar que supostamente foi sequestrado;","Na d\xfavida, solicite ajuda a algu\xe9m pr\xf3ximo para entrar em contato com o familiar; o nervosismo pode induzir a v\xedtima a erro, algu\xe9m que n\xe3o esteja sofrendo o golpe pode ajudar a localiz\xe1-lo e perceber que se trata de um golpe;","Caso n\xe3o consiga entrar em contato com o familiar, procure em locais pr\xf3ximos, como shoppings, pra\xe7as, bares e at\xe9 mesmo hot\xe9is, \xe0s vezes o familiar supostamente sequestrado tamb\xe9m esta sendo induzido a erro."]},{title:"O que Fazer?",description:["Registre um Boletim de Ocorr\xeancia"]}]},{id:"trocaCartao",title:"Golpe da troca do cart\xe3o",description:"Os criminosos entram em contato com a v\xedtima se passando pela institui\xe7\xe3o financeira do cart\xe3o de cr\xe9dito e alegam que houve uma compra duvidosa.\n Com isso, solicitam que a v\xedtima ligue no n\xfamero indicado no verso do cart\xe3o para efetuar o seu cancelamento.\n\n - O golpista continua na linha, coloca uma m\xfasica similar \xe0quela utilizada pela institui\xe7\xe3o banc\xe1ria e solicita algumas informa\xe7\xf5es. Sem perceber a v\xedtima repassa dados pessoais e a senha do cart\xe3o;\n\n - Na sequ\xeancia, o golpista informa que um funcion\xe1rio da institui\xe7\xe3o ir\xe1 at\xe9 \xe0 resid\xeancia da v\xedtima para efetuar a troca do cart\xe3o;\n\n - De posse do cart\xe3o, os criminosos efetuam diversas transa\xe7\xf5es banc\xe1rias.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Nunca forne\xe7a seus dados pessoais ou banc\xe1rios via telefone;","Caso receba liga\xe7\xf5es de institui\xe7\xf5es financeiras, dirija-se \xe0 ag\xeancia banc\xe1ria para confirmar a informa\xe7\xe3o;","Na impossibilidade de se dirigir at\xe9 uma ag\xeancia, encerre a liga\xe7\xe3o, espere alguns minutos e entre em contato com os canais oficiais do estabelecimento."]},{title:"O que Fazer?",description:["Registre um boletim de ocorr\xeancia"]}]},{id:"falsoSiteLeilao",title:"Golpe do falso site de leil\xe3o",description:"Os criminosos criam sites falsos de leil\xe3o de ve\xedculos e vinculam imagens oficiais do Detran e do Tribunal de Justi\xe7a para dar veracidade.\n Eles utilizam endere\xe7os onlines como: leil\xe3o-oficial, leil\xe3o-detran-oficial, entre outros.\n\n - A negocia\xe7\xe3o ocorre via aplicativo de mensagens;\n\n - O dep\xf3sito \xe9 realizado em contas banc\xe1rias de terceiros.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Nunca deposite valores antecipadamente e n\xe3o caia na tenta\xe7\xe3o de comprar ve\xedculos com valores abaixo do mercado;","Veja o ve\xedculo antes de fechar o neg\xf3cio;","V\xe1 at\xe9 o endere\xe7o indicado nos sites para confirmar que se trata de um local oficial de leil\xe3o. Se for em outra cidade, entre em contato com a Pol\xedcia da cidade e tente confirmar se existe este estabelecimento."]},{title:"O que Fazer?",description:["Entre em contato com o Detran da sua cidade, ou se dirija at\xe9 a Delegacia de Pol\xedcia mais pr\xf3xima para confirmar a informa\xe7\xe3o;"]}]},{id:"sextorsao",title:"Golpe da sextors\xe3o/nudes",description:"Os golpistas estudam o perfil de suas v\xedtimas atrav\xe9s das redes sociais.\n Geralmente as v\xedtimas em potencial s\xe3o homens (podendo tamb\xe9m ser mulheres) de meia idade ou mais, casados e com c\xedrculo familiar, amigos ou profissional vis\xedvel nas redes sociais.\n O golpista utiliza um perfil falso, muitas vezes com a fotografia de uma jovem bonita e atraente. O contato inicial quase sempre ocorre atrav\xe9s do Facebook onde eles come\xe7am uma amizade.\n Logo a conversa privada passa para o WhatsApp onde a mo\xe7a encaminha fotos \xedntimas suas e pede para que a v\xedtima fa\xe7a o mesmo.\n A partir dai, outro golpista entra em cena:\n o suposto pai ou padrasto da jovem, alegando que ela \xe9 \u201cmenor de idade\u201d e que a v\xedtima estaria praticando pedofilia atrav\xe9s da internet, inicia a extors\xe3o.\n Para que o caso n\xe3o seja levado \xe0 pol\xedcia, ou para que as fotos \xedntimas e as conversas privadas n\xe3o sejam compartilhadas com a esposa, parentes ou amigos da v\xedtima, o golpista exige que seja paga certa quantia em dinheiro por meio de dep\xf3sito banc\xe1rio.\n *ATEN\xc7\xc3O:Algumas vezes os golpistas tamb\xe9m se fazem passar por supostos advogados, policiais civis ou delegados, alegando que as fotos j\xe1 fazem parte de uma investiga\xe7\xe3o policial e solicitam dep\xf3sitos em dinheiro para\n que o \u201cinqu\xe9rito\u201d seja arquivado. A v\xedtima, temendo ser presa ou \xe0 exposi\xe7\xe3o social cede \xe0 extors\xe3o e acaba fazendo o dep\xf3sito dos valores solicitados pelos golpistas.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Nunca compartilhe fotos \xedntimas pela internet. Depois de compartilhado, a foto ou o v\xeddeo podem circular entre milhares de pessoas;","Desconfie sempre de solicita\xe7\xf5es de amizade, atrav\xe9s das redes sociais, de pessoas que voc\xea n\xe3o conhece;","N\xe3o forne\xe7a seus dados pessoais (como nome completo, CPF, RG, endere\xe7o, n\xfamero de conta banc\xe1ria e senha) para estranhos, em liga\xe7\xf5es telef\xf4nicas, mensagens SMS ou WhatsApp;","Cuidado com opera\xe7\xf5es banc\xe1rias (dep\xf3sitos ou transfer\xeancias em dinheiro) para pessoas do seu c\xedrculo familiar ou de amigos, principalmente quando isso \xe9 solicitado exclusivamente atrav\xe9s do WhatsApp;"]},{title:"O que Fazer?",description:["Se voc\xea sabe de algu\xe9m que pode estar praticando algum destes golpes, denuncie pelo telefone 181 ou WhatsApp da Pol\xedcia Civil (48) 98844-0011 ou procure a Delegacia de Pol\xedcia mais pr\xf3xima;\n Caso voc\xea tenha sido v\xedtima de algum destes golpes, procure imediatamente a Pol\xedcia Civil. Voc\xea tamb\xe9m pode registrar o boletim de ocorr\xeancia atrav\xe9s da Delegacia de Pol\xedcia Virtual de Santa Catarina, acess\xedvel em:\n https://delegaciavirtual.sc.gov.br/inicio.aspx."]}]},{id:"clonagemWhatsapp",title:"Golpe da clonagem do whatsapp",description:"Os criminosos possuem diversas formas de obter o n\xfamero de telefone das v\xedtimas, mas o mais usual \xe9 que seja retirado de an\xfancios em plataformas de sites de compras ou an\xfancios p\xfablicos em redes sociais.\n O golpista se passa por funcion\xe1rio da plataforma de an\xfancio e, sob o pretexto de corrigir uma duplicidade no an\xfancio com valores diferentes, ou mesmo ativar o an\xfancio, solicita \xe0 v\xedtima para que informe seus dados pessoais (nome, RG, CPF, endere\xe7o) e um c\xf3digo de 6 d\xedgitos que receber\xe1 no telefone.\n Esse c\xf3digo, na verdade, \xe9 uma verifica\xe7\xe3o do WhatsApp, ou seja, a partir do fornecimento dessa chave o golpista desviar\xe1 o WhatsApp da v\xedtima para o aplicativo dele.\n Nesse caso a v\xedtima perde o acesso ao aplicativo de mensagens.\n A partir disso o criminoso se passa pela v\xedtima e, alegando algum problema na conta ou com cart\xe3o de cr\xe9dito bloqueado solicita dinheiro emprestado se comprometendo a pagar no dia seguinte.\n O parente ou amigo da v\xedtima, acreditando estar falando com a pessoa de sua confian\xe7a, acaba transferindo o dinheiro para a conta banc\xe1ria informada, e assim se torna tamb\xe9m v\xedtima do golpe.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Habilite a \u201cconfirma\xe7\xe3o em duas etapas\u201d no aplicativo WhatsApp. Para isso, dentro do seu aplicativo clique em \u201cconfigura\xe7\xf5es/ajustes\u201d e depois clique em \u201cconta\u201d, escolha a op\xe7\xe3o \u201cconfirma\xe7\xe3o em duas etapas\u201d e habilite a senha de 6 d\xedgitos num\xe9ricos. Isso impede que golpistas fa\xe7am a clonagem do WhatsApp.","**Esse c\xf3digo num\xe9rico \xe9 uma senha, portanto n\xe3o envie para ningu\xe9m."]},{title:"O que Fazer?",description:["Caso tenha enviado o c\xf3digo recebido por torpedo SMS e ca\xeddo no golpe, encaminhe um e-mail para: support@whatsapp.com pedindo a desativa\xe7\xe3o tempor\xe1ria de sua conta do WhatsApp. Posteriormente, ap\xf3s receber o e-mail do WhatsApp no prazo de 30 dias, configure-o novamente com o seu n\xfamero de celular. Caso voc\xea receba uma mensagem de algum amigo ou parente solicitando empr\xe9stimo em dinheiro, ou dep\xf3sito de algum valor em uma determinada conta, verifique com cautela a veracidade desta solicita\xe7\xe3o. E, caso seja verdade, antes de qualquer confirma\xe7\xe3o de dep\xf3sito, verifique o destinat\xe1rio (nome, CPF, ag\xeancia banc\xe1ria)."]}]},{id:"bilhetePremiado",title:"Golpe do bilhete premiado",description:"A v\xedtima, geralmente pessoa idosa, \xe9 abordada por uma pessoa com apar\xeancia humilde, que pede algumas informa\xe7\xf5es, dizendo ter um bilhete de loteria premiado.\n O criminoso, supostamente ganhador da loteria, alega ter medo de ser enganado na hora de resgatar o pr\xeamio ou que tem a\xe7\xf5es na justi\xe7a que o impediriam de receber o pr\xeamio.\n Em seguida entra em cena um segundo golpista, um sujeito bem arrumado, que diz ter ouvido a conversa.\n A partir da\xed se inicia toda uma encena\xe7\xe3o, onde o segundo golpista simula falar com algu\xe9m da Caixa Econ\xf4mica Federal para confirmar a legitimidade do pr\xeamio.\n Ent\xe3o, ele sugere que a v\xedtima fique com o bilhete premiado, mas, em contrapartida, repasse algum dinheiro para o suposto ganhador.\n Geralmente eles acompanham a v\xedtima at\xe9 uma ag\xeancia banc\xe1ria para fazer o saque do dinheiro, ou a transfer\xeancia como garantia de que o humilde suposto ganhador n\xe3o seja enganado, e ent\xe3o entregam o bilhete premiado.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Caso se depare com algu\xe9m pedindo ajuda em situa\xe7\xe3o semelhante diga que n\xe3o pode ajudar e procure uma Delegacia de Pol\xedcia mais pr\xf3xima para informar o fato.","*ATEN\xc7\xc3O: Saiba que n\xe3o se ganha dinheiro f\xe1cil, principalmente em abordagens de rua por desconhecidos. Sempre desconfie!"]},{title:"O que Fazer?",description:["Chame a pol\xedcia"]}]},{id:"parenteCarroQuebrado",title:"Golpe do parente que quebrou o carro",description:"O golpista liga aleatoriamente para as vitimas, geralmente no per\xedodo noturno.\n Independentemente de quem atende o telefone, o golpista logo fala: \u201coi tio (a), ou oi primo (a), sabe quem est\xe1 falando?\n Caso a v\xedtima diga um nome, achando ser algum sobrinho ou outro parente distante, j\xe1 deu ao golpista o que ele queria.\n Muitas vezes a v\xedtima fala que n\xe3o se recorda e ent\xe3o o golpista usa do artif\xedcio \u201cnossa, n\xe3o lembra mais de mim!\u201d, dialogando com a v\xedtima at\xe9 que seja poss\xedvel extrair dela um nome de um parente que mora distante.\n Com isso, ele forja uma hist\xf3ria de que estaria viajando ou chegando pr\xf3ximo \xe0 cidade onde a v\xedtima reside, e relata que sofreu algum acidente ou que o carro de quebrou.\n Ent\xe3o o criminoso solicita que a v\xedtima fa\xe7a uma transfer\xeancia em dinheiro para determinada conta banc\xe1ria do mec\xe2nico, do guincho ou da borracharia onde o ve\xedculo est\xe1 sendo consertado.\n Ele promete devolver o dinheiro no dia seguinte quando chegar \xe0 cidade da v\xedtima.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["N\xe3o fa\xe7a transfer\xeancias ou entregue dinheiro para terceiros;","Desligue o telefone e fa\xe7a contato com o familiar que voc\xea achava estar falando. Caso a pessoa esteja realmente em apuros, voc\xea ainda poder\xe1ajud\xe1-la."]},{title:"O que Fazer?",description:["Reporte no golpes.org"]}]},{id:"depositoEnvelopeVazio",title:"Golpe do dep\xf3sito com envelope vazio",description:"Geralmente a v\xedtima fez algum tipo de an\xfancio para a venda de um determinado bem/objeto em sites de compras pela internet ou atrav\xe9s de redes sociais.\n Ap\xf3s a negocia\xe7\xe3o, o golpista simula o dep\xf3sito do valor acertado inserindo um envelope vazio no caixa eletr\xf4nico (ou na lot\xe9rica).\n O golpista ent\xe3o encaminha uma fotografia do comprovante de dep\xf3sito e a v\xedtima confirma o recebimento em consulta \xe0 sua conta pelo aplicativo do banco.\n Como a verifica\xe7\xe3o banc\xe1ria do dep\xf3sito demora algumas horas ou, \xe0s vezes, \xe9 feita apenas no pr\xf3ximo dia \xfatil, o valor fica aparecendo como depositado at\xe9 que se verifique que dep\xf3sito n\xe3o foi satisfeito.\n Assim, a v\xedtima efetua a entrega do bem/objeto (normalmente o golpista manda um motorista de aplicativo para apanhar o objeto no mesmo dia do dep\xf3sito).",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Quando realizada uma negocia\xe7\xe3o pela internet aguarde sempre a compensa\xe7\xe3o do dep\xf3sito banc\xe1rio. Se poss\xedvel, aguarde at\xe9 o pr\xf3ximo dia \xfatil para que haja a confirma\xe7\xe3o da entrada do dinheiro na conta. Isso vale para qualquer situa\xe7\xe3o.","*ATEN\xc7\xc3O: O golpe do envelope vazio tamb\xe9m \xe9 aplicado de outras formas. Geralmente, o golpista se passa por uma suposta autoridade p\xfablica ou servidor de algum \xf3rg\xe3o p\xfablico. \xc9 um golpe bastante comum, por exemplo, na \xe9poca das elei\xe7\xf5es. O golpista se passa por suposto servidor da justi\xe7a eleitoral ou promotor, requisitando os servi\xe7os de \u201cmotorista\u201d de alguma institui\xe7\xe3o ou empresa, sob o pagamento de supostas di\xe1rias para a fiscaliza\xe7\xe3o de se\xe7\xf5es eleitorais nos munic\xedpios da regi\xe3o. O dep\xf3sito dos valores (di\xe1rias) \xe9 feito de forma antecipada diretamente na conta do \u201cmotorista\u201d, e o golpista envia a foto do comprovante. Logo em seguida, o golpista novamente entra em contato alegando que, por equ\xedvoco, efetuou o dep\xf3sito de valor superior e necessita que seja imediatamente restitu\xedda a diferen\xe7a por se tratar de verba p\xfablica. Ocorre que a v\xedtima confirma o recebimento em consulta \xe0 sua conta pelo aplicativo do banco. Como a verifica\xe7\xe3o banc\xe1ria do dep\xf3sito demora algumas horas ou, \xe0s vezes, \xe9 feita apenas no pr\xf3ximo dia \xfatil, o valor fica aparecendo como depositado at\xe9 que se verifique que o dep\xf3sito n\xe3o foi satisfeito. Assim, a v\xedtima acreditando se tratar de uma situa\xe7\xe3o real, efetua a transfer\xeancia do valor recebido a mais. *ATEN\xc7\xc3O: Nenhum servidor p\xfablico, de qualquer \xf3rg\xe3o que seja, requisitar\xe1 servi\xe7os de \u201cmotorista\u201d por telefone mediante pagamento de di\xe1rias antecipadas. "]},{title:"O que Fazer?",description:["Reporte no golpes.org e fa\xe7a um BO"]}]},{id:"falsaLiga\xe7\xe3oBanco",title:"Golpe da falsa liga\xe7\xe3o do banco",description:"O golpista liga para a v\xedtima como se fosse o banco no qual a v\xedtima possui conta, fala que precisa liberar algumas chaves de acesso e passa um endere\xe7o de site supostamente do banco, para ela acessar.\n Este site \xe9 falso e redireciona a v\xedtima para uma p\xe1gina semelhante a p\xe1gina oficial, mas que pertence ao golpista, o qual vai roubar todas as credenciais da v\xedtima, como n\xfamero da conta e senhas.\n Ap\xf3s a v\xedtima digitar os seus dados na p\xe1gina falsa e de posse dessas informa\xe7\xf5es, o golpista transfere todo o dinheiro da conta da v\xedtima para sua conta.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["Nunca forne\xe7a dados pessoais ou realize atendimentos banc\xe1rios de liga\xe7\xf5es recebidas no telefone, caso seja urgente, ligue para o n\xfamero do banco ou v\xe1 pessoalmente na ag\xeancia."]},{title:"O que Fazer?",description:["Procure uma Delegacia de Pol\xedcia mais pr\xf3xima para informar o fato."]}]},{id:"golpeDoMecanico",title:"Golpe do Mec\xe2nico",description:"-O golpe do mec\xe2nico se inicia com um suposto mec\xe2nico te abordando no tr\xe2nsito e dizendo que o seu carro est\xe1 com problemas e at\xe9 que pode ter ca\xeddo uma pe\xe7a. Neste momento muitas confiam no golpista e deixam que o carro seja examinado.,\n -Na sequ\xeancia, o golpista pode, por exemplo, desligar o fio da bateria e a\xed que o carro realmente apresenta defeito. Depois disso, o suposto mec\xe2nico realiza o conserto e acaba cobrando muito mais.,\n - Muitas vezes a \xfanica coisa que ele faz \xe9 religar o fio da bateria ou ent\xe3o o que ele mesmo desligou para acusar suposto defeito.,\n -O golpista muitas das vezes pode ser um frentista, querendo resolver um problema que ele mesmo cria em seu ve\xedculo, fazendo barulhos na lataria do carro.",img:"assets/images/logo.png",steps:[{title:"Como Prevenir?",description:["-Evite consertar seu ve\xedculo em mec\xe2nicos desconhecidos, leve a um de sua confian\xe7a;","-Desconfie quando afirmarem que seu carro est\xe1 quebrado, pois muitas pessoas acabam se convencendo pelas palavras do golpista e nem chegam a se questionar se o entranho que acabou de abord\xe1-la de fato \xe9 mec\xe2nico;","-Antes de consertar seu ve\xedculo fa\xe7a um or\xe7amento, mesmo que precise consertar na rua, n\xe3o aceite qualquer manuten\xe7\xe3o sem um or\xe7amento;","-Fa\xe7a revis\xf5es peri\xf3dicas e evite problemas com seu carro;","-Sempre desconfie de abordagem no tr\xe2nsito, n\xe3o confie na primeira informa\xe7\xe3o que voc\xea receber de um desconhecido at\xe9 mesmo de um frentista, mesmo que pare\xe7a convincente;"]},{title:"O que Fazer?",description:["Reporte no golpes.org e fa\xe7a um BO."]}]}],this.searchText="",this.onHome=!0,this.route.queryParams.subscribe(r=>{r.g?(this.golpes.map(i=>{i.id===r.g&&(this.selectedGolpe=i)}),this.onHome=!1):this.onHome=!0})}ngOnInit(){}get filteredList(){return this.searchText?this.golpes.filter(e=>e.title.toLocaleUpperCase().includes(this.searchText.toLocaleUpperCase())):this.golpes}scrollUp(){window.scrollTo({top:0,behavior:"smooth"})}}return n.\u0275fac=function(e){return new(e||n)(p(ni))},n.\u0275cmp=Vr({type:n,selectors:[["app-template"]],decls:19,vars:7,consts:[[1,"template-container"],[4,"ngIf","ngIfElse"],["ActiveGolpe",""],["fxLayout","column","fxLayoutAlign","center center",1,"search-box"],[1,"search"],["appearance","outline"],["autocomplete","off","name","text","type","text","matInput","","placeholder","Ex: WhatsApp",3,"ngModel","ngModelChange"],["matSuffix",""],["fxLayout","row","fxLayoutAlign","space-around start",1,"list"],["class","not-found",4,"ngIf"],[4,"ngFor","ngForOf"],["class","reportar-golpe",4,"ngIf"],[4,"ngIf"],["routerLink","/","src","assets/images/app-background.png","alt","",2,"width","100%","height","100%"],["fxLayout","column","fxLayoutAlign","center center",1,"selected-golpe"],[1,"img-content"],["alt","",3,"src"],[1,"step","mb-step"],[3,"innerText"],["fxLayout","column","fxLayoutGap","20px"],[1,"whats-link"],["target","_blank","data-text","Saiba como se proteger de golpes!! acesse https://golpes-org",2,"text-decoration","none",3,"href"],[1,"reportar-golpe"],["fxLayout","column",1,"step"],[3,"innerHTML"],[1,"not-found"],["routerLink","/","fxLayout","column","fxLayoutAlign","center center",3,"queryParams","click"],["routerLink","/","src","assets/images/app-background.png","alt","",2,"width","100%","height","100%",3,"click"]],template:function(e,r){if(1&e&&(L(0,"div",0),Be(1,sU,2,0,"ng-container",1),Be(2,lU,19,6,"ng-template",null,2,Hv),L(4,"div",3),ut(5," Digite na barra de busca o golpe que deseja obter informa\xe7\xf5es! "),L(6,"div",4),L(7,"form"),L(8,"mat-form-field",5),L(9,"mat-label"),ut(10,"Pesquisar Golpe"),V(),L(11,"input",6),je("ngModelChange",function(s){return r.searchText=s}),V(),L(12,"mat-icon",7),ut(13,"search"),V(),V(),V(),V(),L(14,"div",8),Be(15,uU,2,0,"div",9),Be(16,dU,5,5,"ng-container",10),V(),V(),Be(17,fU,3,1,"div",11),Be(18,hU,2,0,"ng-container",12),V()),2&e){const i=function qy(n){return function Di(n,t){return n[t]}(function XA(){return j.lFrame.contextLView}(),20+n)}(3);te(1),ie("ngIf",r.onHome)("ngIfElse",i),te(10),ie("ngModel",r.searchText),te(4),ie("ngIf",!r.filteredList.length),te(1),ie("ngForOf",r.filteredList),te(1),ie("ngIf",r.onHome),te(1),ie("ngIf",!r.onHome)}},directives:[Df,jl,kD,ch,LD,GC,SE,hE,Uo,S2,mp,N2,Gl,fE,Ah,rU,w2],styles:[".template-container[_ngcontent-%COMP%]{width:100vw;max-width:450px;min-height:100vh;margin:0;background-size:cover}.search-box[_ngcontent-%COMP%]{padding:0 25px;font-size:25px;font-family:opendyslexic!important;font-weight:700;text-align:center;gap:25px}.search-box[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{width:100%;background-color:#fff;border-radius:5px}.search-box[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .mat-form-field[_ngcontent-%COMP%]{width:100%;font-size:16px}.list[_ngcontent-%COMP%]{font-size:18px;max-width:100vw;flex-wrap:wrap;gap:10px}.list[_ngcontent-%COMP%] .not-found[_ngcontent-%COMP%]{width:100%;font-size:14px;opacity:.7}.list[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{width:30%;gap:10px;padding-bottom:20px}.list[_ngcontent-%COMP%] div[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:70px;height:70px}.selected-golpe[_ngcontent-%COMP%]{font-family:opendyslexic!important;padding:15px}.selected-golpe[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0 0 10px;text-align:center;font-size:30px}.selected-golpe[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 10px}.selected-golpe[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0}.selected-golpe[_ngcontent-%COMP%] .step[_ngcontent-%COMP%]{background-color:#fff;padding:20px 10px 30px;border-radius:15px;gap:10px;box-shadow:#444 1px 7px}.mb-step[_ngcontent-%COMP%]{margin-bottom:20px!important}.whats-link[_ngcontent-%COMP%]{margin-top:15px;font-family:opendyslexic!important;font-size:20px;display:flex;justify-content:center;align-items:center;width:100%;padding:25px 0;background-color:#228b22;border-radius:15px}.whats-link[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#fff;text-decoration:none}.reportar-golpe[_ngcontent-%COMP%]{margin-top:15px;font-family:opendyslexic!important;font-size:20px;display:flex;justify-content:center;align-items:center;width:100%;padding:25px 0;background-color:#000;border-radius:15px}.reportar-golpe[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#fff;text-decoration:none}"]}),n})()}];let gU=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[yD.forRoot(pU)],yD]}),n})(),mU=(()=>{class n{constructor(){this.title="golpes-front"}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=Vr({type:n,selectors:[["app-root"]],decls:2,vars:0,consts:[["fxLayoutAlign","center center"]],template:function(e,r){1&e&&(L(0,"div",0),lt(1,"router-outlet"),V())},directives:[ch,Kf],styles:[""]}),n})(),Ix=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[sh]]}),n})(),Vx=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[sh]]}),n})(),n$=(()=>{class n{constructor(e,r){us(r)&&!e&&console.warn("Warning: Flex Layout loaded on the server without FlexLayoutServerModule")}static withConfig(e,r=[]){return{ngModule:n,providers:e.serverLoaded?[{provide:xr,useValue:Object.assign(Object.assign({},oh),e)},{provide:ah,useValue:r,multi:!0},{provide:gs,useValue:!0}]:[{provide:xr,useValue:Object.assign(Object.assign({},oh),e)},{provide:ah,useValue:r,multi:!0}]}}}return n.\u0275fac=function(e){return new(e||n)(D(gs),D(Xt))},n.\u0275mod=De({type:n}),n.\u0275inj=Ce({imports:[[BD,Ix,Vx],BD,Ix,Vx]}),n})(),r$=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=De({type:n,bootstrap:[mU]}),n.\u0275inj=Ce({providers:[],imports:[[lb,n2,LB,gU,n$,yp,k2,iU]]}),n})();(function yO(){yC=!1})(),Lk().bootstrapModule(r$).catch(n=>console.error(n))}},se=>{se(se.s=30)}]);
|
/* -----------H-ui前端框架-------------
* H-ui.admin.js v2.3.1
* http://www.h-ui.net/
* Created & Modified by guojunhui
* Date modified 15:42 2015.08.19
*
* Copyright 2013-2015 北京颖杰联创科技有限公司 All rights reserved.
* Licensed under MIT license.
* http://opensource.org/licenses/MIT
*
*/
var num=0,oUl=$("#min_title_list"),hide_nav=$("#Hui-tabNav");
/*获取顶部选项卡总长度*/
function tabNavallwidth(){
var taballwidth=0,
$tabNav = hide_nav.find(".acrossTab"),
$tabNavWp = hide_nav.find(".Hui-tabNav-wp"),
$tabNavitem = hide_nav.find(".acrossTab li"),
$tabNavmore =hide_nav.find(".Hui-tabNav-more");
if (!$tabNav[0]){return}
$tabNavitem.each(function(index, element) {
taballwidth+=Number(parseFloat($(this).width()+60))
});
$tabNav.width(taballwidth+25);
var w = $tabNavWp.width();
if(taballwidth+25>w){
$tabNavmore.show()}
else{
$tabNavmore.hide();
$tabNav.css({left:0})
}
}
/*左侧菜单响应式*/
function Huiasidedisplay(){
if($(window).width()>=768){
$(".Hui-aside").show()
}
}
function getskincookie(){
var v = getCookie("Huiskin");
if(v==null||v==""){
v="default";
}
$("#skin").attr("href","/T_ball/Public/Admin/skin/"+v+"/skin.css");
}
function Hui_admin_tab(obj){
if($(obj).attr('_href')){
var bStop=false;
var bStopIndex=0;
var _href=$(obj).attr('_href');
var _titleName=$(obj).attr("data-title");
var topWindow=$(window.parent.document);
var show_navLi=topWindow.find("#min_title_list li");
show_navLi.each(function() {
if($(this).find('span').attr("data-href")==_href){
bStop=true;
bStopIndex=show_navLi.index($(this));
return false;
}
});
if(!bStop){
creatIframe(_href,_titleName);
min_titleList();
}
else{
show_navLi.removeClass("active").eq(bStopIndex).addClass("active");
var iframe_box=topWindow.find("#iframe_box");
iframe_box.find(".show_iframe").hide().eq(bStopIndex).show().find("iframe").attr("src",_href);
}
}
}
function min_titleList(){
var topWindow=$(window.parent.document);
var show_nav=topWindow.find("#min_title_list");
var aLi=show_nav.find("li");
};
function creatIframe(href,titleName){
var topWindow=$(window.parent.document);
var show_nav=topWindow.find('#min_title_list');
show_nav.find('li').removeClass("active");
var iframe_box=topWindow.find('#iframe_box');
show_nav.append('<li class="active"><span data-href="'+href+'">'+titleName+'</span><i></i><em></em></li>');
var taballwidth=0,
$tabNav = topWindow.find(".acrossTab"),
$tabNavWp = topWindow.find(".Hui-tabNav-wp"),
$tabNavitem = topWindow.find(".acrossTab li"),
$tabNavmore =topWindow.find(".Hui-tabNav-more");
if (!$tabNav[0]){return}
$tabNavitem.each(function(index, element) {
taballwidth+=Number(parseFloat($(this).width()+60))
});
$tabNav.width(taballwidth+25);
var w = $tabNavWp.width();
if(taballwidth+25>w){
$tabNavmore.show()}
else{
$tabNavmore.hide();
$tabNav.css({left:0})
}
var iframeBox=iframe_box.find('.show_iframe');
iframeBox.hide();
iframe_box.append('<div class="show_iframe"><div class="loading"></div><iframe frameborder="0" src='+href+'></iframe></div>');
var showBox=iframe_box.find('.show_iframe:visible');
showBox.find('iframe').load(function(){
showBox.find('.loading').hide();
});
}
function removeIframe(){
var topWindow = $(window.parent.document);
var iframe = topWindow.find('#iframe_box .show_iframe');
var tab = topWindow.find(".acrossTab li");
var showTab = topWindow.find(".acrossTab li.active");
var showBox=topWindow.find('.show_iframe:visible');
var i = showTab.index();
tab.eq(i-1).addClass("active");
iframe.eq(i-1).show();
tab.eq(i).remove();
iframe.eq(i).remove();
}
/*弹出层*/
/*
参数解释:
title 标题
url 请求的url
id 需要操作的数据id
w 弹出层宽度(缺省调默认值)
h 弹出层高度(缺省调默认值)
*/
function layer_show(title,url,w,h){
if (title == null || title == '') {
title=false;
};
if (url == null || url == '') {
url="404.html";
};
if (w == null || w == '') {
w=800;
};
if (h == null || h == '') {
h=($(window).height() - 50);
};
layer.open({
type: 2,
area: [w+'px', h +'px'],
fix: false, //不固定
maxmin: true,
shade:0.4,
title: title,
content: url
});
}
/*关闭弹出框口*/
function layer_close(){
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
$(function(){
getskincookie();
//layer.config({extend: 'extend/layer.ext.js'});
Huiasidedisplay();
var resizeID;
$(window).resize(function(){
clearTimeout(resizeID);
resizeID = setTimeout(function(){
Huiasidedisplay();
},500);
});
$(".Hui-nav-toggle").click(function(){
$(".Hui-aside").slideToggle();
});
$(".Hui-aside").on("click",".menu_dropdown dd li a",function(){
if($(window).width()<768){
$(".Hui-aside").slideToggle();
}
});
/*左侧菜单*/
$.Huifold(".menu_dropdown dl dt",".menu_dropdown dl dd","fast",1,"click");
/*选项卡导航*/
$(".Hui-aside").on("click",".menu_dropdown a",function(){
Hui_admin_tab(this);
});
$(document).on("click","#min_title_list li",function(){
var bStopIndex=$(this).index();
var iframe_box=$("#iframe_box");
$("#min_title_list li").removeClass("active").eq(bStopIndex).addClass("active");
iframe_box.find(".show_iframe").hide().eq(bStopIndex).show();
});
$(document).on("click","#min_title_list li i",function(){
var aCloseIndex=$(this).parents("li").index();
$(this).parent().remove();
$('#iframe_box').find('.show_iframe').eq(aCloseIndex).remove();
num==0?num=0:num--;
tabNavallwidth();
});
$(document).on("dblclick","#min_title_list li",function(){
var aCloseIndex=$(this).index();
var iframe_box=$("#iframe_box");
if(aCloseIndex>0){
$(this).remove();
$('#iframe_box').find('.show_iframe').eq(aCloseIndex).remove();
num==0?num=0:num--;
$("#min_title_list li").removeClass("active").eq(aCloseIndex-1).addClass("active");
iframe_box.find(".show_iframe").hide().eq(aCloseIndex-1).show();
tabNavallwidth();
}else{
return false;
}
});
tabNavallwidth();
$('#js-tabNav-next').click(function(){
num==oUl.find('li').length-1?num=oUl.find('li').length-1:num++;
toNavPos();
});
$('#js-tabNav-prev').click(function(){
num==0?num=0:num--;
toNavPos();
});
function toNavPos(){
oUl.stop().animate({'left':-num*100},100);
}
/*换肤*/
$("#Hui-skin .dropDown-menu a").click(function(){
var v = $(this).attr("data-val");
setCookie("Huiskin", v);
$("#skin").attr("href","/T_ball/Public/Admin/skin/"+v+"/skin.css");
$(window.frames.document).contents().find("#skin").attr("href","/T_ball/Public/Admin/skin/"+v+"/skin.css");
});
});
|
from utils.data_utils import next_batch
from torch.optim.lr_scheduler import *
from utils.eval_utils import AverageMeter
import wandb
_available_lr_scheduler = [LambdaLR, StepLR, MultiStepLR, ExponentialLR, ReduceLROnPlateau]
class StnTrainer(object):
""" A STN trainer that trains the model on a dataset."""
def __init__(self, step_optimizer, train_loader, valid_loader, test_loader,
evaluate_fnc, h_container, lr_scheduler, warmup_epochs, total_epochs, device=None,
train_steps=5, valid_steps=1, log_interval=10, patience=None):
""" Initialize a class StnTrainer.
:param step_optimizer: BaseStepOptimizer
:param train_loader: DataLoader
:param valid_loader: DataLoader
:param test_loader: DataLoader
:param evaluate_fnc: function
:param h_container: HyperContainer
:param lr_scheduler: Scheduler
:param warmup_epochs: int
:param total_epochs: int
:param device: Device
:param train_steps: int
:param valid_steps: int
:param log_interval: int
:param patience: int
"""
self.step_optimizer = step_optimizer
self.train_loader = train_loader
self.valid_loader = valid_loader
self.test_loader = test_loader
self.lr_scheduler = lr_scheduler
# Learning rate schedules may receive a list.
if not isinstance(self.lr_scheduler, list):
self.lr_scheduler = [self.lr_scheduler]
for clr in self.lr_scheduler:
is_valid_lr_scheduler = False
for lrs in _available_lr_scheduler:
if isinstance(clr, lrs):
is_valid_lr_scheduler = True
break
if not is_valid_lr_scheduler and clr is not None:
raise Exception("Not a valid lr scheduler. "
"Please select {}".format(str(_available_lr_scheduler)))
self.evaluate_fnc = evaluate_fnc
self.h_container = h_container
self.warmup_epochs = warmup_epochs
self.total_epochs = total_epochs
self.train_steps = train_steps
self.valid_steps = valid_steps
self.log_interval = log_interval
self.patience = patience
if device is not None:
self.device = device
else:
# If device is not set, just use what is being used for model.
self.device = self.step_optimizer.model.device
def lr_step(self, val_loss):
for lrs in self.lr_scheduler:
if lrs is None:
continue
try:
lrs.step(val_loss, epoch=None)
except:
lrs.step()
def train(self):
""" Train the network.
:return: None
"""
train_iter = iter(self.train_loader)
valid_iter = iter(self.valid_loader)
global_step = warmup_step = 0
train_step = valid_step = 0
train_epoch = valid_epoch = 0
curr_train_epoch = 0
# Keep track of losses.
losses = AverageMeter()
val_losses = []
best_val_loss = float("inf")
best_val_epoch = 0
try:
self.evaluate_fnc(train_epoch)
except:
raise Exception("Please check your evaluation function {}.".format(str(self.evaluate_fnc)))
while train_epoch < self.warmup_epochs:
# Reset the data augmentation parameters.
self.train_loader.dataset.reset_hyper_params()
perturbed_h_tensor = self.h_container.get_perturbed_hyper(self.train_loader.batch_size)
# Set the data augmentation hyperparameters.
self.train_loader.dataset.set_h_container(self.h_container, perturbed_h_tensor)
inputs, augmented_inputs, labels, train_iter, train_epoch = \
next_batch(train_iter, self.train_loader, train_epoch, self.device)
if curr_train_epoch != train_epoch:
# When train_epoch changes, evaluate validation & test losses.
val_loss = self.evaluate_fnc(train_epoch, losses.avg)
val_losses.append(val_loss)
losses.reset()
curr_train_epoch = train_epoch
self.lr_step(val_loss)
if val_loss < best_val_loss:
best_val_loss = val_loss
best_val_epoch = curr_train_epoch
wandb.log({
"best_val_loss": best_val_loss,
"best_val_epoch": best_val_epoch})
# Taking care of the last batch.
if inputs.size(0) != self.train_loader.batch_size:
perturbed_h_tensor = perturbed_h_tensor[:inputs.size(0), :]
_, loss = self.step_optimizer.step(inputs, labels, perturbed_h_tensor=perturbed_h_tensor,
augmented_inputs=augmented_inputs, tune_hyper=False)
losses.update(loss.item(), inputs.size(0))
if warmup_step % self.log_interval == 0 and global_step > 0:
print("Global Step: {} Train Epoch: {} Warmup step: {} Loss: {:.3f}".format(
global_step, train_epoch, warmup_step, loss))
warmup_step += 1
global_step += 1
print("Warm-up finished.")
if self.patience is None:
self.patience = self.total_epochs
patience_elapsed = 0
while patience_elapsed < self.patience and train_epoch < self.total_epochs:
for _ in range(self.train_steps):
# Perform training steps:
self.train_loader.dataset.reset_hyper_params()
perturbed_h_tensor = self.h_container.get_perturbed_hyper(self.train_loader.batch_size)
self.train_loader.dataset.set_h_container(self.h_container, perturbed_h_tensor)
inputs, augmented_inputs, labels, train_iter, train_epoch = \
next_batch(train_iter, self.train_loader, train_epoch, self.device)
if curr_train_epoch != train_epoch:
val_loss = self.evaluate_fnc(train_epoch, losses.avg)
val_losses.append(val_loss)
losses.reset()
curr_train_epoch = train_epoch
self.lr_step(val_loss)
if val_loss < best_val_loss:
best_val_loss = val_loss
best_val_epoch = curr_train_epoch
patience_elapsed = 0
else:
patience_elapsed += 1
wandb.log(
{"best_val_loss": best_val_loss, "best_val_epoch": best_val_epoch}
)
# Again, take care of the last batch.
if inputs.size(0) != self.train_loader.batch_size:
perturbed_h_tensor = perturbed_h_tensor[:inputs.size(0), :]
_, loss = self.step_optimizer.step(inputs, labels, perturbed_h_tensor=perturbed_h_tensor,
augmented_inputs=augmented_inputs, tune_hyper=False)
losses.update(loss.item(), inputs.size(0))
if train_step % self.log_interval == 0 and global_step > 0:
print(
"Train - Global Step: {} Train Epoch: {} Train step:{} "
"Loss: {:.3f}".format(
global_step, train_epoch, train_step, loss))
train_step += 1
global_step += 1
for _ in range(self.valid_steps):
inputs, _, labels, valid_iter, valid_epoch = \
next_batch(valid_iter, self.valid_loader, valid_epoch, self.device)
perturbed_h_tensor = self.h_container.get_perturbed_hyper(inputs.size(0))
_, loss = self.step_optimizer.step(inputs, labels, perturbed_h_tensor=perturbed_h_tensor,
augmented_inputs=None, tune_hyper=True)
if valid_step % self.log_interval == 0 and global_step > 0:
print(
"Valid - Global Step: {} Valid Epoch: {} Valid step:{} "
"Loss: {:.3f}".format(global_step, valid_epoch, valid_step, loss))
wandb.log(self.h_container.generate_summary())
valid_step += 1
global_step += 1
|
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import test from 'tape';
import {isValidMapInfo} from 'utils/map-info-utils';
test('mapInfoUtils -> isValidMapInfo', t => {
t.equal(
isValidMapInfo({title: 'example', description: ''}),
true,
'Should validate map info with no description'
);
t.equal(
isValidMapInfo({title: 'example', description: 'this is a map'}),
true,
'Should validate map info with description'
);
t.equal(
isValidMapInfo({
title:
'this is a really long title for a map that is not going to work because i really do not like this kind of long title',
description: 'this is a map'
}),
false,
'Should validate map with a really long title'
);
t.equal(
isValidMapInfo({
description:
'this is a really long description for a map that is not going to work because i really do not like this kind of long title',
title: 'this is a map'
}),
false,
'Should validate map with a really long description'
);
t.end();
});
|
(() => {
angular
.module('winter')
.config(($routeProvider) => {
$routeProvider
.when('/', {
templateUrl: 'views/login/login.html',
controller: 'LoginController as main'
})
.when('/timeline', {
templateUrl: 'views/timeline/timeline.html',
controller: 'TimelineController',
controllerAs: 'timeline'
})
.otherwise('/');
});
})();
|
from django.views.generic import FormView
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import login
from django.shortcuts import redirect, reverse, render
from django import forms
from user_profile.models import User
class CustomUserCreationForm(UserCreationForm):
avatar = forms.ImageField()
class Meta:
model = User
fields = ('username', 'email')
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for visible in self.visible_fields():
visible.field.widget.attrs['class'] = 'form-control'
def save(self, commit=True):
user = super().save(commit=False)
user.avatar = self.cleaned_data['avatar']
user.set_password(self.cleaned_data["password1"])
if commit:
user.save()
return user
class RegistrationView(FormView):
template_name = "registration/registration.html"
form_class = CustomUserCreationForm
def form_valid(self, form):
user = form.save()
user.avatar = form.cleaned_data.get('avatar', None)
user.save()
login(self.request, user)
return redirect(reverse('profile', args=(user.username,)))
|
const redux = require('redux');
const createStore = redux.createStore;
const initialState = {
counter:0
}
const rootReducer = (state=initialState, action) =>{
if(action.type=== "INC_COUNTER"){
return {
...state,
counter:state.counter + 1
}
}
if(action.type=== "ADD_COUNTER"){
return {
...state,
counter:state.counter + action.user
}
}
return state;
}
const store = createStore(rootReducer);
console.log(store.getState());
store.subscribe(()=>{
console.log("[Subscription]", store.getState());
});
store.dispatch({type: "INC_COUNTER"});
store.dispatch({type: "ADD_COUNTER", user:10});
console.log(store.getState());
|
module.exports={A:{A:{"2":"H D G E A B mB"},B:{"1":"K","2":"C L q M O I J"},C:{"1":"HB IB JB KB","2":"0 1 2 3 4 5 6 8 9 jB AB F H D G E A B C L q M O I J P Q R S T U V W X Y Z a b c d f g h i j k l m n o p N r s t u v w x y z LB BB CB DB EB FB dB cB"},D:{"1":"0 1 2 3 4 6 9 t u v w x y z LB BB CB DB EB FB HB IB JB KB bB WB QB K pB RB SB TB UB","2":"5 8 F H D G E A B C L q M O I J P Q R S T U V W X Y Z a b c d f g h i j k l m n o p N r s"},E:{"1":"7 B C L e eB","2":"5 F H D G E A VB OB XB YB ZB aB NB"},F:{"1":"0 1 2 3 4 g h i j k l m n o p N r s t u v w x y z","2":"7 8 E B C M O I J P Q R S T U V W X Y Z a b c d f fB gB hB iB e MB kB"},G:{"1":"wB xB yB zB","2":"G OB lB GB nB oB PB qB rB sB tB uB","16":"vB"},H:{"2":"0B"},I:{"1":"K","2":"AB F 1B 2B 3B 4B GB 5B 6B"},J:{"2":"D A"},K:{"1":"N","2":"7 A B C e MB"},L:{"1":"K"},M:{"2":"6"},N:{"2":"A B"},O:{"1":"7B"},P:{"1":"8B 9B AC BC CC NB","2":"F"},Q:{"2":"DC"},R:{"2":"EC"},S:{"2":"FC"}},B:1,C:"unhandledrejection/rejectionhandled events"};
|
// Hooks
import { datasetsBeforeEnter } from 'new-dashboard/router/hooks/check-navigation';
import store from '../../store';
// Lazy Pages
const Data = () => import('new-dashboard/pages/Data/Data');
const Datasets = () => import('new-dashboard/pages/Data/Datasets');
const Subscriptions = () => import('new-dashboard/pages/Data/Subscriptions');
const Catalog = () => import('new-dashboard/pages/Data/Catalog');
const CatalogDataset = () => import('new-dashboard/pages/Data/CatalogDataset');
const CatalogDatasetMap = () => import('new-dashboard/pages/Data/CatalogDatasetMap');
const CatalogDatasetData = () => import('new-dashboard/pages/Data/CatalogDatasetData');
const CatalogDatasetSummary = () => import('new-dashboard/pages/Data/CatalogDatasetSummary');
const routes = [
{
path: '/datasets/:filter?',
component: Data,
meta: {
title: () => 'Data | CARTO'
},
children: [
{
path: 'spatial-data-catalog',
name: 'spatial-data-catalog',
component: Catalog,
meta: {
title: () => 'Spatial Data Catalog | CARTO'
}
},
{
path: '',
component: Datasets,
name: 'datasets',
props: (route) => ({ datasetId: route.query.id, createVis: /^true$/i.test(route.query.create) }),
meta: {
title: () => 'Data | CARTO'
},
beforeEnter: datasetsBeforeEnter
}
]
},
{
path: '/datasets/spatial-data-catalog/:entity_type/:entity_id',
component: CatalogDataset,
meta: {
title: () => 'Spatial Data Catalog | CARTO'
},
children: [
{
path: 'map',
name: 'catalog-dataset-map',
component: CatalogDatasetMap,
meta: {
title: () => 'Spatial Data Catalog | CARTO'
}
},
{
path: 'data',
name: 'catalog-dataset-data',
component: CatalogDatasetData,
meta: {
title: () => 'Spatial Data Catalog | CARTO'
}
},
{
path: '',
name: 'catalog-dataset-summary',
component: CatalogDatasetSummary,
meta: {
title: () => 'Spatial Data Catalog | CARTO'
}
}
]
}
];
if (store.state.user.do_enabled) {
routes[0].children.unshift({
path: 'subscriptions',
name: 'subscriptions',
component: Subscriptions,
meta: {
title: () => 'Subscriptions | CARTO'
}
});
}
export default routes;
|
const chai = require('chai');
const expect = chai.expect;
describe('chai test', () => {
it('should compare some values', () => {
expect(1).to.equal(1);
});
it('should test the object data', () => {
expect({ name: 'foo' }).to.deep.equal({ name: 'foo' });
expect({ name: 'foo' }).to.have.property('name').to.equal('foo');
expect(5 > 8).to.be.false;
expect({}).to.be.a('object');
expect('foo').to.be.a('string');
expect(3).to.be.a('number');
expect('bar').to.be.a('string').with.lengthOf(3);
expect([1,2,3].length).to.equal(3);
expect(null).to.be.null;
expect(undefined).to.not.exist;
expect(1).to.exist;
});
});
|
module.exports = require('./tslintrc')
|
import axios from 'axios';
const API_URL = 'https://api.pokemontcg.io/v1';
export const getPokemonCatalog = () => new Promise((resolve, reject) => {
axios.get(`${API_URL}/cards?subtype=Basic`)
.then((response) => {
const { data } = response;
const { cards } = data;
if (cards.length > 0) {
resolve(cards);
} else {
resolve([]);
}
})
.catch((error) => {
reject(error);
});
});
|
/**
* Amazon Elastic Compute Cloud
* <fullname>Amazon Elastic Compute Cloud</fullname> <p>Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing capacity in the AWS cloud. Using Amazon EC2 eliminates the need to invest in hardware up front, so you can develop and deploy applications faster.</p> <p>To learn more, see the following resources:</p> <ul> <li> <p>Amazon EC2: <a href=\"http://aws.amazon.com/ec2\">AmazonEC2 product page</a>, <a href=\"http://aws.amazon.com/documentation/ec2\">Amazon EC2 documentation</a> </p> </li> <li> <p>Amazon EBS: <a href=\"http://aws.amazon.com/ebs\">Amazon EBS product page</a>, <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html\">Amazon EBS documentation</a> </p> </li> <li> <p>Amazon VPC: <a href=\"http://aws.amazon.com/vpc\">Amazon VPC product page</a>, <a href=\"http://aws.amazon.com/documentation/vpc\">Amazon VPC documentation</a> </p> </li> <li> <p>AWS VPN: <a href=\"http://aws.amazon.com/vpn\">AWS VPN product page</a>, <a href=\"http://aws.amazon.com/documentation/vpn\">AWS VPN documentation</a> </p> </li> </ul>
*
* The version of the OpenAPI document: 2016-11-15
* Contact: mike.ralphson@gmail.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AmazonEc2);
}
}(this, function(expect, AmazonEc2) {
'use strict';
var instance;
beforeEach(function() {
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('DatafeedSubscriptionState', function() {
it('should create an instance of DatafeedSubscriptionState', function() {
// uncomment below and update the code to test DatafeedSubscriptionState
//var instane = new AmazonEc2.DatafeedSubscriptionState();
//expect(instance).to.be.a(AmazonEc2.DatafeedSubscriptionState);
});
});
}));
|
import Taro, {useEffect, useState} from '@tarojs/taro'
import {Block, View, Text, ScrollView, Canvas, Image, Swiper, SwiperItem, Button} from '@tarojs/components'
import { useSelector, useDispatch } from '@tarojs/redux'
import moment from 'moment'
import _ from 'lodash/lodash.min'
import Core from '@antv/f2/lib/core'
import Guide from '@antv/f2/lib/plugin/guide'
import '@antv/f2/lib/geom/line'; // 只加载折线图
import '@antv/f2/lib/component/guide/text'; // 只加载 Guide.Text 组件
import '@antv/f2/lib/scale/time-cat'; // 加载 timeCat 类型的度量
import QQMapWX from '../../../utils/qqmap-wx-jssdk'
import {QQ_MAP_SDK_KEY} from '../../../apis/config'
import './index.scss'
import {useAsyncEffect, getNodeRect, getSystemInfo, getWindParams, setNavStyle} from '../../../utils'
import {getWeatherNow, getWeatherHourly, getWeatherDaily, getAlarms} from '../../../apis/weather'
import {getAirNow} from '../../../apis/air'
import {getLifeSuggestion} from '../../../apis/life'
import {getGeoSun} from '../../../apis/goe'
import {
// setLng,
// setLat,
setProvince,
setCity,
setDistrict,
setStreetNum,
setAddress,
setName,
setIsDay,
setLatAndLon
} from '../../../redux/location/action'
import {
setSystemInfo,
setUserLocation,
setUserIsCurAddr,
setUserGeoSun,
setUserLifeSuggestion, setUserTheme
} from '../../../redux/user/action'
import ComponentBaseNavigation from '../../../components/base/navigation'
import ComponentIconWindDirection from '../../../components/icon/wind_dir'
import ComponentIconWeather from '../../../components/icon/weather'
// import ComponentTagName from '../../components/common/component_tag_name'
import Skeleton from '../../../components/common/skeleton'
import xzLogoGrayImg from '../../../assets/images/xinzhi_logo_gray.png'
import hfLogoGrayImg from '../../../assets/images/hefeng_logo_gray.png'
import themeMatch from '../../../assets/json/theme_match.json'
import Renderer from '../../../utils/renderer'
function Index() {
const location = useSelector(state => state.location);
const user = useSelector(state => state.user);
const dispatch = useDispatch();
const [now, setNow] = useState({});
const [updateTime, setUpdateTime] = useState('');
const [hourly, setHourly] = useState([]);
const [daily, setDaily] = useState([]);
const [suggestion, setSuggestion] = useState({});
const [nowAir, setNowAir] = useState({});
const [sun, setSun] = useState({});
const [alarms, setAlarms] = useState([]);
const [tmpLineImgPath, setTmpLineImgPath] = useState('');
const [scrollHeight, setScrollHeight] = useState(0);
const [scrollTop, setScrollTop] = useState(0);
const [scrollToTop, setScrollToTop] = useState(0);
const [showSkeleton, setShowSkeleton] = useState(true);
const [previous , setPrevious ] = useState(0);
const [userLocationAuth, setUserLocationAuth] = useState(true);
const [tabBarCircular, setTabBarCircular] = useState(false); // 设置tanBar
const [tabBarItemNum, setTabBarItemNum] = useState(5); // 设置tanBar
const [tabBarSlideUpHide, setTabBarSlideUpHide] = useState(false); // 设置tanBar
const [startPageY, setStartPageY] = useState(0);
const [tabBarAnimation, setTabBarAnimation] = useState(null);
const [tabBarHeight, setTabBarHeight] = useState(0);
const [isTabBarHide, setIsTabBarHide] = useState(false); // 通过tabBar是否隐藏来显示数据来源View,间接解决生活指数可能错位的问题
const lifeSuggestion = [
{type: 'comfort', name: '舒适度指数'},
{type: 'dressing', name: '穿衣指数'},
{type: 'flu', name: '感冒指数'},
{type: 'sport', name: '运动指数'},
{type: 'travel', name:'旅游指数'},
{type: 'car_washing', name:'洗车指数'},
// {type: 'allergy', name: '过敏指数'},
{type: 'uv', name: '紫外线指数'},
{type: 'air_pollution', name:'空气污染扩散条件指数'}
];
// 隐藏骨架屏
useEffect(() => {
let tId = setTimeout(() => {
setShowSkeleton(false);
clearTimeout(tId);
}, 5000); // 默认设置最多5s就移除,还有就是画完图立即移除
}, []);
// 设置主题颜色,本地没有就使用默认主题
useEffect(() => {
const theme = Taro.getStorageSync('THEME');
if (theme) {
dispatch(setUserTheme(theme));
}
}, []);
// 设置tabBar
useEffect(() => {
const TAB_BAR_SETTING = Taro.getStorageSync('TAB_BAR_SETTING');
if (TAB_BAR_SETTING) {
const {displayMultipleItems, circular, slideUpHide} = TAB_BAR_SETTING;
setTabBarCircular(circular); // 是否循环滚动
setTabBarItemNum(displayMultipleItems); // 显示item的数量
setTabBarSlideUpHide(slideUpHide); // 上滑隐藏
if (!slideUpHide) { // 不存在
return;
}
this.animation = Taro.createAnimation({
duration: 300,
timingFunction: 'ease',
});
} else {
Taro.setStorageSync('TAB_BAR_SETTING', {circular: tabBarCircular, displayMultipleItems: tabBarItemNum, slideUpHide: tabBarSlideUpHide});
}
}, []);
// 日出日落
useAsyncEffect(async () => {
const {from} = this.$router.params;
// console.log(user.isCurrentAddr);
// console.log(user.geo);
if (user.isCurrentAddr && user.geoSun && from !== 'SHARE') { // 当前用户,且日出日落已存在, 比如当用户点击当行定位按钮就不会在此发请求
setSun(user.geoSun);
setDayNight(user.geoSun);
} else { // 否则就去请求
const {latitude, longitude} = location.latAndLon;
const res = await getGeoSun({location: `${latitude}:${longitude}`, days: 1});
if (!res) {return}
const {sun} = res;
setSun(sun[0]);
setDayNight(sun[0]);
if (user.isCurrentAddr) {
dispatch(setUserGeoSun(sun[0]));
}
}
}, [location.latAndLon]);
// 实时天气
useAsyncEffect(async () => {
const {latitude, longitude} = location.latAndLon;
const res = await getWeatherNow({location: `${latitude}:${longitude}`});
// console.log(res);
if (!res) {return}
const {now, last_update} = res;
setNow(now);
setUpdateTime(last_update);
}, [location.latAndLon]);
// 空气质量
useAsyncEffect(async () => {
const {latitude, longitude} = location.latAndLon;
const res = await getAirNow({location: `${latitude}:${longitude}`, scope: 'all'});
// console.log(res);
if (!res) {return}
const {air, last_update} = res;
air.last_update = last_update;
setNowAir(air);
Taro.setStorageSync('NOW_AIR', air);
}, [location.latAndLon]);
// 逐小时预报
useAsyncEffect(async () => {
const {latitude, longitude} = location.latAndLon;
const res = await getWeatherHourly({location: `${latitude}:${longitude}`});
// console.log(res);
if (!res) {return}
const {hourly} = res;
for (let [, v] of hourly.entries()) {
// console.log(v,i);
v.temperature = Number(v.temperature);
}
setHourly(hourly);
}, [location.latAndLon]);
// 3日预报
useAsyncEffect(async () => {
const {latitude, longitude} = location.latAndLon;
const res = await getWeatherDaily({location: `${latitude}:${longitude}`, days: 15});
// console.log(res);
if (!res) {return}
const {daily} = res;
setDaily(daily);
Taro.setStorageSync('DAILY_FORECAST', daily);
}, [location.latAndLon]);
// 生活指数
useAsyncEffect(async () => {
const {from} = this.$router.params;
if (user.isCurrentAddr && user.lifeSuggestion && from !== 'SHARE') { // 当前用户,且生活指数已存在, 比如当用户点击当行定位按钮就不会在此发请求
setSuggestion(user.lifeSuggestion);
} else {
const res = await getLifeSuggestion({location: `${location.city}`});
// console.log(res);
if (!res) {return}
const {suggestion} = res;
setSuggestion(suggestion);
dispatch(setUserLifeSuggestion(suggestion));
}
}, [location.latAndLon]);
// 气象预警
useAsyncEffect(async () => {
const {latitude, longitude} = location.latAndLon;
const res = await getAlarms({location: `${latitude}:${longitude}`});
// console.log(res);
if (!res) {return}
const {alarms} = res;
setAlarms(alarms);
Taro.setStorageSync('ALARMS', alarms); // alarm详情不用再次请求,直接取本地数据
}, [location.latAndLon]);
// 设备信息
useEffect(async () => {
const res = await getSystemInfo();
dispatch(setSystemInfo(res));
const res1 = await getNodeRect('#tabBar');
if (!res1) {return;}
setTabBarHeight(res1.height);
setScrollHeight(res.windowHeight - res1.height - 44 - user.systemInfo.statusBarHeight); // 自定义导航固定44
}, [showSkeleton]);
// 处理hourly数据,让其和now的数据更衔接吻合
useEffect(() => {
if (!hourly.length || !updateTime) {
return;
}
const {code, humidity, temperature, text, wind_direction, wind_speed} = now;
let firstHourly = {code, humidity, temperature: Number(temperature), text, wind_direction, wind_speed, time: updateTime};
let _hourly = hourly;
if (moment().isBefore(hourly[0].time)) { // 在hourly第一个时间前直接加上
_hourly.unshift(firstHourly);
} else { // 和hourly第一个时间相等或在hourly第一个时间之后, 替换hourly第一个
_hourly.splice(0, 1, firstHourly);
}
setHourly(_hourly);
}, [updateTime, hourly]);
// 画逐小时图
useEffect(() => {
// setTmpLineImgPath('');
// setCanvasHeight(100);
drawTmpLine();
}, [hourly]);
// 授权获取用户位置信息
useAsyncEffect(() => {
Taro.getSetting({ // 获取设置
success(res) {
Taro.setStorageSync('AUTH_SETTING', res.authSetting);
if (!res.authSetting['scope.userLocation']) {
Taro.authorize({ // 地理位置授权
scope: 'scope.userLocation',
success() {
getUserLocation();
},
fail() {
Taro.showToast({title: '地理位置授权失败,请在设置里面开启', icon: 'none'});
setUserLocationAuth(false);
dispatch(setLatAndLon({longitude: '', latitude: ''}));
dispatch(setUserLocation({longitude: '', latitude: ''}));
}
})
} else {
getUserLocation();
}
}
})
}, []);
// 显示转发按钮
useEffect(() => {
Taro.showShareMenu({
withShareTicket: true
});
onShareAppMessage();
}, [now]);
// 设置日出日落
const setDayNight = (sun) => {
let {date, sunrise, sunset} = sun;
let sr = `${date} ${sunrise}`;
let ss= `${date} ${sunset}`;
let isDay = moment().isAfter(sr) && moment().isBefore(ss); // 判断是不是在白天
dispatch(setIsDay(isDay));
setNavStyle(isDay, user.theme);
};
// 获取用户位置信息
const getUserLocation = () => {
Taro.getLocation({
type: 'gcj02',
success: res => {
// console.log(res);
qqMapSetLocation({latitude: res.latitude, longitude: res.longitude, isUser: true});
},
fail: res => {
console.log(res);
Taro.showToast({title: '获取位置信息失败', icon: 'none'});
}
})
.then();
};
// qqmapsdk根据经纬度查询位置信息
const qqMapSetLocation = ({latitude, longitude, isUser, name = ''}) => {
const qqmapsdk = new QQMapWX({key: QQ_MAP_SDK_KEY});
qqmapsdk.reverseGeocoder({
location: {
latitude: latitude,
longitude: longitude
},
success: (_res) => {
// console.log(_res);
const {province, city, district, street_number} = _res.result.address_component;
dispatch(setLatAndLon({longitude, latitude}));
// dispatch(setLat(latitude));
dispatch(setProvince(province));
dispatch(setCity(city));
dispatch(setDistrict(district));
dispatch(setStreetNum(street_number));
dispatch(setAddress(_res.result.address));
dispatch(setName(name));
if (isUser) {
const userLocation = {
latitude: latitude,
longitude: longitude,
province,
city,
district,
streetNum: street_number,
address: _res.result.address,
name: ''
};
dispatch(setUserLocation(userLocation));
}
dispatch(setUserIsCurAddr(isUser));
},
fail: _res => {
// console.log(_res);
Taro.showToast({title: _res.message, icon: 'none'});
},
// complete: _res => {
// // console.log(res);
// }
});
};
// 画逐小时图
const drawTmpLine = async () => {
const nodeRect = await getNodeRect('#tmpLine');
if (!nodeRect) {return}
const lineColor = '#ffffff';
const rowWidth = nodeRect.width / hourly.length;
const min = _.minBy(hourly, 'temperature').temperature;
const max = _.maxBy(hourly, 'temperature').temperature;
const {width, height} = nodeRect;
const ctx = Taro.createCanvasContext('tmpLine', this.$scope);
const canvas = new Renderer(ctx);
Core.Chart.plugins.register(Guide);
let chart = new Core.Chart({
el: canvas,
width,
height,
animate: false,
pixelRatio: user.systemInfo.pixelRatio,
padding: ['auto', rowWidth / 2, 'auto', rowWidth / 2]
});
// console.log(chart);
const defs = {
time: {
type: 'timeCat',
mask: 'MM/DD',
tickCount: 3,
range: [0, 1]
},
temperature: {
tickCount: max - min,
min: min,
alias: '逐小时温度'
}
};
chart.source(hourly, defs);
chart.axis(false);
hourly.map(function(obj) {
chart.guide().text({
position: [obj.time, obj.temperature],
content: obj.temperature + '℃',
style: {
fill: lineColor,
textAlign: 'center'
},
offsetY: -15
});
});
chart.line().position('time*temperature').shape('smooth').style({
stroke: lineColor
});
chart.render();
setTimeout(() => {
canvasToImg();
}, 300);
};
// canvas 换图片,因为canvas层级高,自定义导航栏遮不住
const canvasToImg = async () => {
const canvasNode = await getNodeRect('#tmpLine');
const {width, height} = canvasNode;
Taro.canvasToTempFilePath({
x: 0,
y: 0,
width,
height,
// destWidth: width * pixelRatio * 2,
// destHeight: height * pixelRatio * 2,
canvasId: 'tmpLine',
}).then(res => {
// console.log(res);
// console.log('canvasToImg end');
setTmpLineImgPath(res.tempFilePath);
setShowSkeleton(false); // 画完图立即移除骨架屏
}).catch(err => {
// console.log('canvasToImg err');
console.log(err);
setShowSkeleton(false); // 画完图立即移除骨架屏
Taro.showToast({title: '逐时温度曲线图绘制失败,请刷新页面重新绘制', icon: 'none', duration: 2500});
})
};
// 点击导航栏打开地图,定位当前
const chooseLocation = () => {
Taro.chooseLocation({
success: res => {
// console.log(res);
dispatch(setUserIsCurAddr(false));
const {address, name, longitude, latitude} = res;
if (name === '') { // 没选地址就点确定
Taro.showToast({title: '未选择地址', icon: 'none'});
}
qqMapSetLocation({latitude, longitude, isUser: false, name});
}
})
};
// 定位自己,自己写节流,lodash的节流函数在这里不管用,不知道为什么
const locationSelf = () => {
let _now = Date.now();
if (_now - previous > 5000) {
const {latitude, longitude,} = user.location;
qqMapSetLocation({latitude, longitude, isUser: true});
scrollToPageTop();
setPrevious(_now);
} else {
Taro.showToast({title: '客官,手速太快了', icon: 'none'});
}
};
// 分享的事件
const onShareAppMessage = () => {
this.$scope.onShareAppMessage = (res) => {
return {
title: `我这儿天气${now.text},气温${now.temperature}℃,你那儿呢?`,
path: `/pages/tab_bar/index/index?from=SHARE`,
}
};
};
// scroll container 滚动事件
const onContainerScroll = async (e) => {
const {scrollTop} = e.detail;
setScrollTop(scrollTop);
};
// 滚动到顶部
const scrollToPageTop = () => {
setScrollToTop(prev => prev === 0 ? 0.1 : 0);
};
// 去空气质量
const goAir = () => {
Taro.navigateTo({url: `../../forecast/pages/air/index`});
};
// 去气象预警
const goAlarms = () => {
Taro.navigateTo({url: `../../forecast/pages/alarm/index`});
};
// 去15天天气预报
const goDailyDetails = () => {
const {longitude, latitude} = location.latAndLon;
Taro.navigateTo({url: `../../forecast/pages/daily_forecast/index?lon=${longitude}&lat=${latitude}`});
};
// 去更多生活指数
const goLifeSuggestion = () => {
Taro.navigateTo({url: `../../forecast/pages/life_suggestion/index`});
};
// 去城市收藏夹
const goLocationCollection = () => {
Taro.navigateTo({
url: `../../tab_bar/location_collection/index`,
events: {
acceptDataFromLocationCollection(data) { // 监听事件
// console.log('acceptDataFromLocationCollection');
// console.log(data);
const {lat, lon, cityName} = data;
qqMapSetLocation({latitude: lat, longitude: lon, isUser: false, name: cityName}); // 重新获取数据
scrollToPageTop();
}
}
});
};
// 去城市搜索
const goLocationSearch = () => {
Taro.navigateTo({
url: `../../tab_bar/location_search/index`,
events: {
acceptDataFromLocationSearch(data) { // 监听事件
// console.log('acceptDataFromLocationSearch');
// console.log(data);
const {lat, lon, cityName} = data;
qqMapSetLocation({latitude: lat, longitude: lon, isUser: false, name: cityName}); // 重新获取数据
scrollToPageTop();
}
}
});
};
// 去设置界面
const goSetting = () => {
Taro.navigateTo({
url: `../../tab_bar/setting/index`,
events: {
acceptDataFromSetting(data) { // 监听事件
// console.log('acceptDataFromSetting');
// console.log(data);
}
}
});
};
// 去语音
const goVoice = () => {
Taro.navigateTo({url: `../../tab_bar/robot/index`});
};
// 打开授权
const openSetting = () => {
Taro.openSetting({
success(res) {
const AUTH_SETTING = Taro.getStorageSync('AUTH_SETTING');
// console.log(AUTH_SETTING === res.authSetting);
// console.log(res);
const isEqual = _.isEqual(AUTH_SETTING, res.authSetting);
if (!isEqual) { // 不一样,更新权限,返回首页
Taro.setStorageSync('AUTH_SETTING', res.authSetting);
Taro.showToast({title: '权限设置已更新,即将重启', icon: 'none', duration: 2000});
let tId = setTimeout(() => {
Taro.reLaunch({url: '/pages/tab_bar/index/index'});
clearTimeout(tId);
}, 2000);
}
// console.log(isEqual);
}
});
};
// 页面的touchStart事件
const pageTouchStart = (e) => {
if (!tabBarSlideUpHide) {
return;
}
const {pageY} = e.changedTouches[0];
setStartPageY(pageY);
};
// 页面的touchEnd事件,显示/隐藏tabBar
const pageTouchEnd = (e) => {
if (!tabBarSlideUpHide) {
return;
}
const {pageY} = e.changedTouches[0];
if (pageY - startPageY < -tabBarHeight) { // 上滑
// console.log('up');
this.animation.translateY(tabBarHeight + 10).step(); // +10隐藏box-shadow
setScrollHeight(user.systemInfo.windowHeight - 44 - user.systemInfo.statusBarHeight);
setTabBarAnimation(this.animation.export());
setIsTabBarHide(true);
} else if (pageY - startPageY > tabBarHeight) { //下滑
// console.log('down');
this.animation.translateY(0).step();
setTabBarAnimation(this.animation.export());
let tId = setTimeout(() => {
setScrollHeight(user.systemInfo.windowHeight - tabBarHeight - 44 - user.systemInfo.statusBarHeight);
clearTimeout(tId);
}, 300);
setIsTabBarHide(false);
}
};
return (
<Block>
{showSkeleton && (
<Skeleton
selector='skeleton'
loading='spin'
bgcolor='#FFF'
/>
)}
<View className={`weather h-100-per skeleton theme-${user.theme} white`}>
{/*<ComponentTagName />*/}
<ComponentBaseNavigation backgroundColor={location.isDay ? themeMatch[user.theme]['day'] : themeMatch[user.theme]['night']}
color={location.isDay ? themeMatch[user.theme]['dayFontColor'] : themeMatch[user.theme]['nightFontColor']}
statusBarHeight={user.systemInfo.statusBarHeight}
>
<View className='flex-row flex-start-center w-100-per pd-lr-20' onClick={_.debounce(chooseLocation, 5000, {leading: true, trailing: false})}>
<View className='iconfont mg-r-10 fs-36'></View>
<View className={`flex-col ${scrollTop > 200 ? 'flex-spb-start' : 'flex-center-start'}`}>
{scrollTop > 200 && <View className='flex-row flex-start-baseline fs-26'>
<Text>{now.temperature}℃</Text>
<Text className='mg-l-10'>{now.text}</Text>
</View>}
<View className={`flex-row flex-start-baseline ${scrollTop > 200 ? 'fs-26' : 'fs-30'}`}>
{userLocationAuth && user.isCurrentAddr && <View className='nav-addr-box'>{user.location.district} {user.location.streetNum}</View>}
{userLocationAuth && !user.isCurrentAddr && <View className='nav-addr-box'>{location.name ? location.name : `${location.district} ${location.streetNum}`}</View>}
{!userLocationAuth && <View className='nav-addr-box' onClick={() => openSetting()}>用户地理位置权限已关闭,点击开启</View>}
</View>
</View>
</View>
</ComponentBaseNavigation>
<ScrollView
className={`flex-col relative ${location.isDay ? 'day-bg-lg' : 'night-bg-lg'}`}
scrollY
scrollWithAnimation
style={{height: `${scrollHeight}px`}}
onScroll={e => onContainerScroll(e)}
scrollTop={scrollToTop}
onTouchStart={(e) => pageTouchStart(e)} onTouchEnd={(e) => pageTouchEnd(e)}
>
{JSON.stringify(now) !== '{}' && <View className='flex-col flex-center relative' id='nowContainer'>
<View className='flex-row flex-center mg-t-40'>
<View className='fs-100 flex-row'>
<Text className=''>{now.temperature}</Text>
<Text className='mg-t-24 fs-28'>℃</Text>
</View>
<ComponentIconWeather code={now.code} fontSize='fs-100' />
</View>
<View className='mg-20 fs-50'>{now.text}</View>
<View className='flex-row flex-center mg-b-40 mg-t-20'>
<View className='flex-row flex-center-baseline'>
<ComponentIconWindDirection windDirection={now.wind_direction} />
<View className='mg-l-4'>{`${getWindParams(now.wind_speed)['windScale']}级`}</View>
</View>
<View className='mg-l-10 mg-r-10 h-28 v-line-white' />
<View className='flex-row flex-center-baseline'>
<View className='iconfont mg-r-4 fs-28'></View>
<View className=''>湿度 {now.humidity}%</View>
</View>
{JSON.stringify(nowAir) !== '{}' && <View className='mg-l-10 mg-r-10 h-28 v-line-white' />}
{JSON.stringify(nowAir) !== '{}' && <View className='flex-row flex-center-baseline' onClick={() => goAir()}>
<View className='iconfont mg-r-4 fs-26'></View>
<View className=''>空气{nowAir.city.quality} {nowAir.city.aqi}</View>
</View>}
</View>
{/*<View className='mg-b-40 fs-24'>天气数据更新于 {moment(updateTime).format('HH:mm')}</View>*/}
{/*气象预警*/}
{alarms.length && <View className='flex-row flex-center circle w-120 h-120 pd-10 alarm' onClick={() => goAlarms()}>
<View className='flex-row flex-center w-40 h-40 circle sound'>
<View className='iconfont red-A700 fs-40'></View>
</View>
</View>}
</View>}
{/*{fixedContainerNow && <View style={{height: `${boxNowInitHeight - boxNowSmallHeight}px`}} />}*/}
{/*24小时预报*/}
{hourly.length && <View className={`mg-20 bd-radius-20 ${location.isDay ? 'day-bg-opacity' : 'night-bg-opacity'}`}>
<View className='text-center fs-30 pd-30'>24小时逐时预报</View>
{/*<View className='h-line-white' />*/}
<ScrollView
className='flex-col'
scrollX
scrollWithAnimation
scrollLeft={0}
style={{height: '300px'}}
>
<View className='flex-row flex-start-stretch pd-t-20 pd-b-40 h-100-per relative box-hd-x' style={{width: `${Taro.pxTransform(hourly.length * 150)}`}}>
<Canvas className='tmp-line' canvasId='tmpLine' id='tmpLine'
style={{
width: `${Taro.pxTransform(hourly.length * 150)}`,
height: `100px`,
left: '9999px'
}}
/>
{tmpLineImgPath && <Image className='tmp-line' src={tmpLineImgPath}
style={{
width: `${Taro.pxTransform(hourly.length * 150)}`,
height: '100px',
}}
/>}
{hourly.map((h, index) => {
return (
<View className='flex-col flex-spa-center w-150 flex-center fs-24' key={h.time}>
<View className='flex-col flex-center'>
<ComponentIconWeather code={h.code} fontSize='fs-40' />
<View className='cond-txt'>{h.text}</View>
{/*<View className='text-right cond-txt'>{h.tmp}℃</View>*/}
</View>
<View className='' style={{flex: `0 0 100px`}} />
<View className='flex-row flex-center-baseline'>
<ComponentIconWindDirection windDirection={h.wind_direction} />
<View className='mg-l-4'>{`${getWindParams(h.wind_speed)['windScale']}级`}</View>
</View>
<View className='flex-row flex-center-baseline'>
<View className='iconfont mg-r-4 fs-26'></View>
<View>{h.humidity}%</View>
</View>
<View className='h-line-white line w-100-per' />
<View className='text-center'>
{index === 0 ? '现在' : moment(h.time).format('HH:mm') === '00:00' ? moment(h.time).format('MM-DD') : moment(h.time).format('HH:mm')}
</View>
</View>
)
})}
</View>
</ScrollView>
</View>}
{/*3天预报*/}
{daily.length && <View className={`mg-20 bd-radius-20 ${location.isDay ? 'day-bg-opacity' : 'night-bg-opacity'}`}>
<View className='pd-t-10 pd-b-10'>
{daily.slice(0, 3).map((df, index) => {
return (
<View className='flex-row flex-spb-start pd-t-30 pd-b-30 pd-l-40 pd-r-40' key={df.date}>
<View className='flex-row'>
{index === 0 && <View>今天</View>}
{index === 1 && <View>明天</View>}
{index > 1 && <View className=''>{moment(df.date).format('dddd')}</View>}
<View className='mg-r-10 mg-l-10'>·</View>
{df.text_day !== df.text_night && <View className='cond-txt'>{df.text_day}转{df.text_night}</View>}
{df.text_day === df.text_night && <View className='cond-txt'>{df.text_day}</View>}
</View>
<View className='flex-row'>
{location.isDay && <ComponentIconWeather code={df.code_day} fontSize='fs-40' />}
{!location.isDay && <ComponentIconWeather code={df.code_night} fontSize='fs-40' />}
<View className='text-right mg-l-20 cond-txt'>{df.high}/{df.low}℃</View>
</View>
</View>
)
})}
</View>
<View className='h-line-white' />
<View className='text-center fs-30 pd-30' onClick={() => goDailyDetails()}>15天天气趋势预报</View>
</View>}
{/*今日生活指数,香港澳门没有数据*/}
{location.name !== '香港' && location.name !== '澳门' && JSON.stringify(suggestion) !== '{}'
&& <View className={`mg-lr-20 mg-t-20 bd-radius-20 ${location.isDay ? 'day-bg-opacity' : 'night-bg-opacity'}`}>
<View className='text-center fs-30 pd-30'>今日生活指数</View>
{/*<View className='h-line-white' />*/}
<Swiper
className='pd-t-10 pd-b-10'
circular
autoplay
indicatorDots
indicatorColor='#FFFFFF'
indicatorActiveColor={location.isDay ? themeMatch[user.theme]['day'] : themeMatch[user.theme]['night']}
>
{lifeSuggestion.map((ls) => {
return (
<SwiperItem className='lifestyle-item bd-radius-20 pd-20 bd-box' key={ls.type}>
<View className='flex-row flex-start-baseline'>
{ls.type === 'comfort' && <View className='iconfont mg-r-6 fs-26'></View>}
{ls.type === 'dressing' && <View className='iconfont mg-r-6 fs-30'></View>}
{ls.type === 'flu' && <View className='iconfont mg-r-6 fs-28'></View>}
{ls.type === 'sport' && <View className='iconfont mg-r-6 fs-26'></View>}
{ls.type === 'travel' && <View className='iconfont mg-r-6 fs-26'></View>}
{ls.type === 'car_washing' && <View className='iconfont mg-r-6 fs-26'></View>}
{ls.type === 'uv' && <View className='iconfont mg-r-6 fs-26'></View>}
{ls.type === 'air_pollution' && <View className='iconfont mg-r-6 fs-26'></View>}
<View className='font30 mg-b-10'>{ls.name}</View>
</View>
<View className=''>- {suggestion[ls.type]['brief']} -</View>
<View className='h-line-white mg-t-10 mg-b-10' />
<View>{suggestion[ls.type]['details']}</View>
</SwiperItem>
)
})}
</Swiper>
<View className='h-line-white' />
<View className='text-center fs-30 pd-30' onClick={() => goLifeSuggestion()}>更多生活指数</View>
</View>}
{JSON.stringify(now) !== '{}' && (tabBarSlideUpHide ? isTabBarHide : true) && <View className='fs-24 text-center h-88 lh-88 flex-row flex-center'>
<Text className='gray-700'>天气数据来源于</Text>
<Image className='h-50 w-144' src={xzLogoGrayImg} />
<Image className='h-30 w-120' src={hfLogoGrayImg} />
</View>}
</ScrollView>
{!showSkeleton && <View className='flex-row h-88 w-100-per bg-white bd-tl-radius-40 bd-tr-radius-40 tab-bar' id='tabBar' animation={tabBarAnimation}>
<Swiper
className='h-100-per w-100-per'
circular={tabBarCircular}
displayMultipleItems={tabBarItemNum}
easingFunction='linear'
>
<SwiperItem className='flex-row flex-center'>
<View className={`iconfont text-center fs-50 bold ${location.isDay ? 'day-color' : 'night-color'}`} onClick={() => goLocationCollection()}></View>{/**收藏**/}
</SwiperItem>
<SwiperItem className='flex-row flex-center'>
<View className={`iconfont text-center fs-50 bold ${location.isDay ? 'day-color' : 'night-color'}`} onClick={() => goLocationSearch()}></View>{/**搜索**/}
</SwiperItem>
<SwiperItem className='flex-row flex-center'>
<View className={`iconfont text-center fs-50 bold ${location.isDay ? 'day-color' : 'night-color'} ${user.isCurrentAddr ? '' : 'self-loc-anim red-A700'}`} onClick={() => locationSelf()}></View>{/**定位**/}
</SwiperItem>
<SwiperItem className='flex-row flex-center'>
<View className={`iconfont text-center fs-50 text-center ${location.isDay ? 'day-color' : 'night-color'}`} onClick={() => goVoice()}></View>{/**聊天**/}
</SwiperItem>
<SwiperItem className='flex-row flex-center'>
<Button className={`iconfont text-center fs-50 bold mg-0 pd-0 h-54 w-50 icon-btn ${location.isDay ? 'day-color' : 'night-color'}`} hoverClass='icon-btn-hover' openType='share'></Button>{/**分享**/}
</SwiperItem>
<SwiperItem className='flex-row flex-center'>
<View className={`iconfont text-center fs-52 bold ${location.isDay ? 'day-color' : 'night-color'}`} onClick={() => goSetting()}></View>{/**设置**/}
</SwiperItem>
</Swiper>
</View>}
</View>
</Block>
)
}
Index.config = {
navigationBarTitleText: '天气晴报',
backgroundTextStyle: 'light',
navigationBarBackgroundColor: 'white',
navigationBarTextStyle: 'black',
navigationStyle: 'custom'
};
export default Index;
|
/*
1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
Medium
418
51
Add to List
Share
Given an array of integers arr and two integers k and threshold.
Return the number of sub-arrays of size k and average greater than or equal to threshold.
Example 1:
Input: arr = [2,2,2,2,5,5,5,8], k = 3, threshold = 4
Output: 3
Explanation: Sub-arrays [2,5,5],[5,5,5] and [5,5,8] have averages 4, 5 and 6 respectively. All other sub-arrays of size 3 have averages less than 4 (the threshold).
*/
//O(N) time and O(1) space
var numOfSubarrays = function(arr, k, threshold) {
var count = 0;
var start = 0;
var currSum = 0;
for (var end = 0; end < arr.length; end++) {
currSum+=arr[end];
if (end-start+1 === k) {
if (currSum/k >= threshold) {
count++;
}
currSum-=arr[start];
start++;
}
}
return count;
};
|
import React from 'react'
const AccessDenied = () => {
return (
<div className="page-layout centered">
<h3>Tillträde beviljas ej</h3>
<p>
You don't have the required privileges to access this page.
</p>
</div>
)
}
export default AccessDenied;
|
"""
Tests for POSIX-compatible `basename`.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html
"""
from helpers import check, check_version, run
def test_version():
"""Check that we're using Boreutil's implementation."""
assert check_version("basename")
def test_missing_args():
"""No args => error of the form `basename: ...`"""
assert run(["basename"]).stderr.startswith("basename:")
assert run(["basename"]).returncode > 0
def test_extra_args():
"""Too many args => error of the form `basename: ...`"""
assert run(["basename", "a", "b", "c"]).stderr.startswith("basename:")
assert run(["basename", "a", "b", "c"]).returncode > 0
def test_help():
"""Passing -h or --help => print help text."""
assert run(["basename", "-h"]).stdout.split(' ')[0] == 'Usage:'
assert run(["basename", "--help"]).stdout.split(' ')[0] == 'Usage:'
assert run(["basename", "-h"]).returncode > 0
assert run(["basename", "--help"]).returncode > 0
def test_main():
"""This was split into the test_step[1-6] functions below."""
pass
# Test the various steps:
def test_step1():
"""1. Empty string results in an empty string."""
assert check(["basename", ""]).stdout == "\n"
def test_step2():
"""2. We _do not_ skip steps 3-6 if given "//", so this should return "/".
If we do skip step 3-6, this should return "//"!
"""
assert check(["basename", "//"]).stdout == "/\n"
def test_step3():
"""3. If string is entirely slash characters, we get a single slash."""
assert check(["basename", "///"]).stdout == "/\n"
def test_step4():
"""4. Remove trailing slash characters."""
assert check(["basename", "owo/"]).stdout == "owo\n"
# ! Potential edge case if we change behavior for step 2.
assert check(["basename", "owo//"]).stdout == "owo\n"
assert check(["basename", "owo///"]).stdout == "owo\n"
def test_step5():
"""5. If there are remaining slash characters, remove everything up to
and including the last slash."""
assert check(["basename", "/a/b/c/d/owo"]).stdout == "owo\n"
# ! Potential edge case exercising steps 4+5 together.
assert check(["basename", "/a/b/c/d/owo///"]).stdout == "owo\n"
assert check(["basename", "///a/b/c/d/owo///"]).stdout == "owo\n"
def test_step6():
"""6. Remove suffix if it exists and isn't the whole string."""
assert check(["basename", "///a/b/owo.ext//", ".ext"]).stdout == "owo\n"
assert check(["basename", "///a/b/owo.ext2//", ".ext"]).stdout == "owo.ext2\n"
assert check(["basename", "///a/b/owo.ext", ".ext"]).stdout == "owo\n"
assert check(["basename", "///a/b/owo.ex", ".ext"]).stdout == "owo.ex\n"
|
import { createLocalVue, mount } from '@vue/test-utils';
import VueCallStore from '.';
const identifier = 'identifier';
let localVue;
let wrapper;
const component = {
template: `
<div>
<div v-call:done="'${identifier}'" class="done">Hello World</div>
<div v-call:failed="['${identifier}', 'second']" class="failed">Hello World</div>
<div v-call:pending="['${identifier}', 'third']" class="pending">Hello World</div>
</div>
`,
};
beforeEach(() => {
localVue = createLocalVue();
localVue.use(VueCallStore);
wrapper = mount(component, { localVue });
});
describe('directive.js', () => {
it('should update components', async () => {
await wrapper.vm.$startCall(identifier);
await wrapper.vm.$forceUpdate();
expect(wrapper.find('.done').exists()).toBeFalsy();
expect(wrapper.find('.failed').exists()).toBeFalsy();
expect(wrapper.find('.pending').exists()).toBeTruthy();
await wrapper.vm.$endCall(identifier);
await wrapper.vm.$forceUpdate();
expect(wrapper.find('.done').exists()).toBeTruthy();
expect(wrapper.find('.failed').exists()).toBeFalsy();
expect(wrapper.find('.pending').exists()).toBeFalsy();
await wrapper.vm.$failCall(identifier);
await wrapper.vm.$forceUpdate();
expect(wrapper.find('.done').exists()).toBeFalsy();
expect(wrapper.find('.failed').exists()).toBeTruthy();
expect(wrapper.find('.pending').exists()).toBeFalsy();
});
});
|
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import type {Thenable} from 'shared/ReactTypes';
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {Instance, TextInstance} from './ReactTestHostConfig';
import * as Scheduler from 'scheduler/unstable_mock';
import {
getPublicRootInstance,
createContainer,
updateContainer,
flushSync,
injectIntoDevTools,
batchedUpdates,
act,
IsThisRendererActing,
} from 'react-reconciler/src/ReactFiberReconciler';
import {findCurrentFiberUsingSlowPath} from 'react-reconciler/src/ReactFiberTreeReflection';
import {
Fragment,
FunctionComponent,
ClassComponent,
HostComponent,
HostPortal,
HostText,
HostRoot,
ContextConsumer,
ContextProvider,
Mode,
ForwardRef,
Profiler,
MemoComponent,
SimpleMemoComponent,
IncompleteClassComponent,
ScopeComponent,
} from 'react-reconciler/src/ReactWorkTags';
import invariant from 'shared/invariant';
import isArray from 'shared/isArray';
import getComponentNameFromType from 'shared/getComponentNameFromType';
import ReactVersion from 'shared/ReactVersion';
import ReactSharedInternals from 'shared/ReactSharedInternals';
import enqueueTask from 'shared/enqueueTask';
import {getPublicInstance} from './ReactTestHostConfig';
import {ConcurrentRoot, LegacyRoot} from 'react-reconciler/src/ReactRootTags';
const {IsSomeRendererActing} = ReactSharedInternals;
type TestRendererOptions = {
createNodeMock: (element: React$Element<any>) => any,
unstable_isConcurrent: boolean,
unstable_strictModeLevel: number,
...
};
type ReactTestRendererJSON = {|
type: string,
props: {[propName: string]: any, ...},
children: null | Array<ReactTestRendererNode>,
$$typeof?: Symbol, // Optional because we add it with defineProperty().
|};
type ReactTestRendererNode = ReactTestRendererJSON | string;
type FindOptions = $Shape<{
// performs a "greedy" search: if a matching node is found, will continue
// to search within the matching node's children. (default: true)
deep: boolean,
...
}>;
export type Predicate = (node: ReactTestInstance) => ?boolean;
const defaultTestOptions = {
createNodeMock: function() {
return null;
},
};
function toJSON(inst: Instance | TextInstance): ReactTestRendererNode | null {
if (inst.isHidden) {
// Omit timed out children from output entirely. This seems like the least
// surprising behavior. We could perhaps add a separate API that includes
// them, if it turns out people need it.
return null;
}
switch (inst.tag) {
case 'TEXT':
return inst.text;
case 'INSTANCE': {
/* eslint-disable no-unused-vars */
// We don't include the `children` prop in JSON.
// Instead, we will include the actual rendered children.
const {children, ...props} = inst.props;
/* eslint-enable */
let renderedChildren = null;
if (inst.children && inst.children.length) {
for (let i = 0; i < inst.children.length; i++) {
const renderedChild = toJSON(inst.children[i]);
if (renderedChild !== null) {
if (renderedChildren === null) {
renderedChildren = [renderedChild];
} else {
renderedChildren.push(renderedChild);
}
}
}
}
const json: ReactTestRendererJSON = {
type: inst.type,
props: props,
children: renderedChildren,
};
Object.defineProperty(json, '$$typeof', {
value: Symbol.for('react.test.json'),
});
return json;
}
default:
throw new Error(`Unexpected node type in toJSON: ${inst.tag}`);
}
}
function childrenToTree(node) {
if (!node) {
return null;
}
const children = nodeAndSiblingsArray(node);
if (children.length === 0) {
return null;
} else if (children.length === 1) {
return toTree(children[0]);
}
return flatten(children.map(toTree));
}
function nodeAndSiblingsArray(nodeWithSibling) {
const array = [];
let node = nodeWithSibling;
while (node != null) {
array.push(node);
node = node.sibling;
}
return array;
}
function flatten(arr) {
const result = [];
const stack = [{i: 0, array: arr}];
while (stack.length) {
const n = stack.pop();
while (n.i < n.array.length) {
const el = n.array[n.i];
n.i += 1;
if (isArray(el)) {
stack.push(n);
stack.push({i: 0, array: el});
break;
}
result.push(el);
}
}
return result;
}
function toTree(node: ?Fiber) {
if (node == null) {
return null;
}
switch (node.tag) {
case HostRoot:
return childrenToTree(node.child);
case HostPortal:
return childrenToTree(node.child);
case ClassComponent:
return {
nodeType: 'component',
type: node.type,
props: {...node.memoizedProps},
instance: node.stateNode,
rendered: childrenToTree(node.child),
};
case FunctionComponent:
case SimpleMemoComponent:
return {
nodeType: 'component',
type: node.type,
props: {...node.memoizedProps},
instance: null,
rendered: childrenToTree(node.child),
};
case HostComponent: {
return {
nodeType: 'host',
type: node.type,
props: {...node.memoizedProps},
instance: null, // TODO: use createNodeMock here somehow?
rendered: flatten(nodeAndSiblingsArray(node.child).map(toTree)),
};
}
case HostText:
return node.stateNode.text;
case Fragment:
case ContextProvider:
case ContextConsumer:
case Mode:
case Profiler:
case ForwardRef:
case MemoComponent:
case IncompleteClassComponent:
case ScopeComponent:
return childrenToTree(node.child);
default:
invariant(
false,
'toTree() does not yet know how to handle nodes with tag=%s',
node.tag,
);
}
}
const validWrapperTypes = new Set([
FunctionComponent,
ClassComponent,
HostComponent,
ForwardRef,
MemoComponent,
SimpleMemoComponent,
// Normally skipped, but used when there's more than one root child.
HostRoot,
]);
function getChildren(parent: Fiber) {
const children = [];
const startingNode = parent;
let node: Fiber = startingNode;
if (node.child === null) {
return children;
}
node.child.return = node;
node = node.child;
outer: while (true) {
let descend = false;
if (validWrapperTypes.has(node.tag)) {
children.push(wrapFiber(node));
} else if (node.tag === HostText) {
children.push('' + node.memoizedProps);
} else {
descend = true;
}
if (descend && node.child !== null) {
node.child.return = node;
node = node.child;
continue;
}
while (node.sibling === null) {
if (node.return === startingNode) {
break outer;
}
node = (node.return: any);
}
(node.sibling: any).return = node.return;
node = (node.sibling: any);
}
return children;
}
class ReactTestInstance {
_fiber: Fiber;
_currentFiber(): Fiber {
// Throws if this component has been unmounted.
const fiber = findCurrentFiberUsingSlowPath(this._fiber);
invariant(
fiber !== null,
"Can't read from currently-mounting component. This error is likely " +
'caused by a bug in React. Please file an issue.',
);
return fiber;
}
constructor(fiber: Fiber) {
invariant(
validWrapperTypes.has(fiber.tag),
'Unexpected object passed to ReactTestInstance constructor (tag: %s). ' +
'This is probably a bug in React.',
fiber.tag,
);
this._fiber = fiber;
}
get instance() {
if (this._fiber.tag === HostComponent) {
return getPublicInstance(this._fiber.stateNode);
} else {
return this._fiber.stateNode;
}
}
get type() {
return this._fiber.type;
}
get props(): Object {
return this._currentFiber().memoizedProps;
}
get parent(): ?ReactTestInstance {
let parent = this._fiber.return;
while (parent !== null) {
if (validWrapperTypes.has(parent.tag)) {
if (parent.tag === HostRoot) {
// Special case: we only "materialize" instances for roots
// if they have more than a single child. So we'll check that now.
if (getChildren(parent).length < 2) {
return null;
}
}
return wrapFiber(parent);
}
parent = parent.return;
}
return null;
}
get children(): Array<ReactTestInstance | string> {
return getChildren(this._currentFiber());
}
// Custom search functions
find(predicate: Predicate): ReactTestInstance {
return expectOne(
this.findAll(predicate, {deep: false}),
`matching custom predicate: ${predicate.toString()}`,
);
}
findByType(type: any): ReactTestInstance {
return expectOne(
this.findAllByType(type, {deep: false}),
`with node type: "${getComponentNameFromType(type) || 'Unknown'}"`,
);
}
findByProps(props: Object): ReactTestInstance {
return expectOne(
this.findAllByProps(props, {deep: false}),
`with props: ${JSON.stringify(props)}`,
);
}
findAll(
predicate: Predicate,
options: ?FindOptions = null,
): Array<ReactTestInstance> {
return findAll(this, predicate, options);
}
findAllByType(
type: any,
options: ?FindOptions = null,
): Array<ReactTestInstance> {
return findAll(this, node => node.type === type, options);
}
findAllByProps(
props: Object,
options: ?FindOptions = null,
): Array<ReactTestInstance> {
return findAll(
this,
node => node.props && propsMatch(node.props, props),
options,
);
}
}
function findAll(
root: ReactTestInstance,
predicate: Predicate,
options: ?FindOptions,
): Array<ReactTestInstance> {
const deep = options ? options.deep : true;
const results = [];
if (predicate(root)) {
results.push(root);
if (!deep) {
return results;
}
}
root.children.forEach(child => {
if (typeof child === 'string') {
return;
}
results.push(...findAll(child, predicate, options));
});
return results;
}
function expectOne(
all: Array<ReactTestInstance>,
message: string,
): ReactTestInstance {
if (all.length === 1) {
return all[0];
}
const prefix =
all.length === 0
? 'No instances found '
: `Expected 1 but found ${all.length} instances `;
throw new Error(prefix + message);
}
function propsMatch(props: Object, filter: Object): boolean {
for (const key in filter) {
if (props[key] !== filter[key]) {
return false;
}
}
return true;
}
function create(element: React$Element<any>, options: TestRendererOptions) {
let createNodeMock = defaultTestOptions.createNodeMock;
let isConcurrent = false;
let strictModeLevel = null;
if (typeof options === 'object' && options !== null) {
if (typeof options.createNodeMock === 'function') {
createNodeMock = options.createNodeMock;
}
if (options.unstable_isConcurrent === true) {
isConcurrent = true;
}
if (options.unstable_strictModeLevel !== undefined) {
strictModeLevel = options.unstable_strictModeLevel;
}
}
let container = {
children: [],
createNodeMock,
tag: 'CONTAINER',
};
let root: FiberRoot | null = createContainer(
container,
isConcurrent ? ConcurrentRoot : LegacyRoot,
false,
null,
strictModeLevel,
);
invariant(root != null, 'something went wrong');
updateContainer(element, root, null, null);
const entry = {
_Scheduler: Scheduler,
root: undefined, // makes flow happy
// we define a 'getter' for 'root' below using 'Object.defineProperty'
toJSON(): Array<ReactTestRendererNode> | ReactTestRendererNode | null {
if (root == null || root.current == null || container == null) {
return null;
}
if (container.children.length === 0) {
return null;
}
if (container.children.length === 1) {
return toJSON(container.children[0]);
}
if (
container.children.length === 2 &&
container.children[0].isHidden === true &&
container.children[1].isHidden === false
) {
// Omit timed out children from output entirely, including the fact that we
// temporarily wrap fallback and timed out children in an array.
return toJSON(container.children[1]);
}
let renderedChildren = null;
if (container.children && container.children.length) {
for (let i = 0; i < container.children.length; i++) {
const renderedChild = toJSON(container.children[i]);
if (renderedChild !== null) {
if (renderedChildren === null) {
renderedChildren = [renderedChild];
} else {
renderedChildren.push(renderedChild);
}
}
}
}
return renderedChildren;
},
toTree() {
if (root == null || root.current == null) {
return null;
}
return toTree(root.current);
},
update(newElement: React$Element<any>) {
if (root == null || root.current == null) {
return;
}
updateContainer(newElement, root, null, null);
},
unmount() {
if (root == null || root.current == null) {
return;
}
updateContainer(null, root, null, null);
container = null;
root = null;
},
getInstance() {
if (root == null || root.current == null) {
return null;
}
return getPublicRootInstance(root);
},
unstable_flushSync<T>(fn: () => T): T {
return flushSync(fn);
},
};
Object.defineProperty(
entry,
'root',
({
configurable: true,
enumerable: true,
get: function() {
if (root === null) {
throw new Error("Can't access .root on unmounted test renderer");
}
const children = getChildren(root.current);
if (children.length === 0) {
throw new Error("Can't access .root on unmounted test renderer");
} else if (children.length === 1) {
// Normally, we skip the root and just give you the child.
return children[0];
} else {
// However, we give you the root if there's more than one root child.
// We could make this the behavior for all cases but it would be a breaking change.
return wrapFiber(root.current);
}
},
}: Object),
);
return entry;
}
const fiberToWrapper = new WeakMap();
function wrapFiber(fiber: Fiber): ReactTestInstance {
let wrapper = fiberToWrapper.get(fiber);
if (wrapper === undefined && fiber.alternate !== null) {
wrapper = fiberToWrapper.get(fiber.alternate);
}
if (wrapper === undefined) {
wrapper = new ReactTestInstance(fiber);
fiberToWrapper.set(fiber, wrapper);
}
return wrapper;
}
// Enable ReactTestRenderer to be used to test DevTools integration.
injectIntoDevTools({
findFiberByHostInstance: (() => {
throw new Error('TestRenderer does not support findFiberByHostInstance()');
}: any),
bundleType: __DEV__ ? 1 : 0,
version: ReactVersion,
rendererPackageName: 'react-test-renderer',
});
let actingUpdatesScopeDepth = 0;
// This version of `act` is only used by our tests. Unlike the public version
// of `act`, it's designed to work identically in both production and
// development. It may have slightly different behavior from the public
// version, too, since our constraints in our test suite are not the same as
// those of developers using React — we're testing React itself, as opposed to
// building an app with React.
// TODO: Migrate our tests to use ReactNoop. Although we would need to figure
// out a solution for Relay, which has some Concurrent Mode tests.
function unstable_concurrentAct(scope: () => Thenable<mixed> | void) {
if (Scheduler.unstable_flushAllWithoutAsserting === undefined) {
throw Error(
'This version of `act` requires a special mock build of Scheduler.',
);
}
if (setTimeout._isMockFunction !== true) {
throw Error(
"This version of `act` requires Jest's timer mocks " +
'(i.e. jest.useFakeTimers).',
);
}
const previousActingUpdatesScopeDepth = actingUpdatesScopeDepth;
const previousIsSomeRendererActing = IsSomeRendererActing.current;
const previousIsThisRendererActing = IsThisRendererActing.current;
IsSomeRendererActing.current = true;
IsThisRendererActing.current = true;
actingUpdatesScopeDepth++;
const unwind = () => {
actingUpdatesScopeDepth--;
IsSomeRendererActing.current = previousIsSomeRendererActing;
IsThisRendererActing.current = previousIsThisRendererActing;
if (__DEV__) {
if (actingUpdatesScopeDepth > previousActingUpdatesScopeDepth) {
// if it's _less than_ previousActingUpdatesScopeDepth, then we can
// assume the 'other' one has warned
console.error(
'You seem to have overlapping act() calls, this is not supported. ' +
'Be sure to await previous act() calls before making a new one. ',
);
}
}
};
// TODO: This would be way simpler if 1) we required a promise to be
// returned and 2) we could use async/await. Since it's only our used in
// our test suite, we should be able to.
try {
const thenable = batchedUpdates(scope);
if (
typeof thenable === 'object' &&
thenable !== null &&
typeof thenable.then === 'function'
) {
return {
then(resolve: () => void, reject: (error: mixed) => void) {
thenable.then(
() => {
flushActWork(
() => {
unwind();
resolve();
},
error => {
unwind();
reject(error);
},
);
},
error => {
unwind();
reject(error);
},
);
},
};
} else {
try {
// TODO: Let's not support non-async scopes at all in our tests. Need to
// migrate existing tests.
let didFlushWork;
do {
didFlushWork = Scheduler.unstable_flushAllWithoutAsserting();
} while (didFlushWork);
} finally {
unwind();
}
}
} catch (error) {
unwind();
throw error;
}
}
function flushActWork(resolve, reject) {
// Flush suspended fallbacks
// $FlowFixMe: Flow doesn't know about global Jest object
jest.runOnlyPendingTimers();
enqueueTask(() => {
try {
const didFlushWork = Scheduler.unstable_flushAllWithoutAsserting();
if (didFlushWork) {
flushActWork(resolve, reject);
} else {
resolve();
}
} catch (error) {
reject(error);
}
});
}
export {
Scheduler as _Scheduler,
create,
/* eslint-disable-next-line camelcase */
batchedUpdates as unstable_batchedUpdates,
act,
unstable_concurrentAct,
};
|
import test from 'ava'
import m from '../../../../../'
test('default', t => {
t.false(m('xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp'))
t.false(m('//xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp'))
t.false(m('http://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp'))
t.false(m('https://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp'))
t.false(m('ftp://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp'))
})
test('inside last', t => {
t.false(m('xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/index.asp'))
t.false(m('//xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/index.asp'))
t.false(m('http://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/index.asp'))
t.false(m('https://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/index.asp'))
t.false(m('ftp://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/index.asp'))
})
test('inside last with path dots', t => {
t.false(m('xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1/index.asp'))
t.false(m('//xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1/index.asp'))
t.false(m('http://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1/index.asp'))
t.false(m('https://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1/index.asp'))
t.false(m('ftp://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1/index.asp'))
t.false(m('xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1/index.asp'))
t.false(m('//xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1/index.asp'))
t.false(m('http://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1/index.asp'))
t.false(m('https://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1/index.asp'))
t.false(m('ftp://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1/index.asp'))
})
test('after index', t => {
t.false(m('xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8'))
t.false(m('//xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8'))
t.false(m('http://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8'))
t.false(m('https://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8'))
t.false(m('ftp://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8'))
})
test('after index with path dots', t => {
t.false(m('xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1'))
t.false(m('//xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1'))
t.false(m('http://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1'))
t.false(m('https://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1'))
t.false(m('ftp://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/./%D0%B0/%D0%B1'))
t.false(m('xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1'))
t.false(m('//xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1'))
t.false(m('http://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1'))
t.false(m('https://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1'))
t.false(m('ftp://xn--2-gtb3ad.xn--d1atc.xn--80aswg.xn--p1ai/index.asp/%D0%B2%D0%BD%D1%83/%D1%82%D1%80%D0%B8/../%D0%B0/%D0%B1'))
})
|
'use strict';
const os = require('os');
const npmlog = require('npmlog');
const chalk = require('chalk');
const read = require('readline-sync');
const copyPaste = require('copy-paste');
const store = require('./store');
const libpick = require('./libpick');
let accumulatedOutput = '';
let cliOptions = {
raw: false,
async: false,
force: false
};
function run(libver) {
const [ query, ver ] = libver.split('@');
return store.fetchLibrary(query)
.then(library => {
if (library === null) {
return store.fetchAllLibraries().then(allLibs => libpick.pickLibrary(query, allLibs, () => ''));
}
return library;
}).then(library => library && store.fetchLibrary(library.name))
.then(library => {
if (library === null) {
npmlog.error('Library', 'No match found for %j :(', query);
return;
}
const pickedVersion = libpick.pickVersion(ver || '', library, options => '');
printFancyVersion(pickedVersion);
});
}
function determineSuffix(url) {
return url.split('.').pop();
}
function wrapUrl(url) {
if (cliOptions.raw) {
return url;
}
switch (determineSuffix(url)) {
case 'js':
const asyncAttr = cliOptions.async ? 'async ' : '';
return `<script type="text/javascript" ${asyncAttr}src="${url}"></script>`;
case 'css':
return `<link rel="stylesheet" href="${url}" />`;
default:
return `<!-- ${url} -->`;
}
}
function yieldOutput(str = '') {
accumulatedOutput += str + os.EOL;
return str;
}
function copyAll(caption = 'all') {
copyPaste.copy(accumulatedOutput);
npmlog.info(`Copied ${caption}`);
}
function printFancyVersion(asset, isLatest = false) {
if (!asset) {
return;
}
let printPrompt = chalk.cyan;
let printOutput = chalk.green;
let stability = 'stable';
if (asset.isUnstable) {
printPrompt = chalk.yellow;
printOutput = chalk.magenta;
stability = 'unstable';
}
console.error(printPrompt(`Found ${isLatest?'latest ':''}${stability} version ${asset.version}`));
asset.urls.forEach(url =>
console.log(
printOutput(
yieldOutput(
wrapUrl(url)))));
console.error('');
}
function confirmLibraryAsync(lib) {
npmlog.enableProgress();
npmlog.http('Index', 'Fetching all libraries...');
return store.fetchAllLibraries().then(libs => {
npmlog.disableProgress();
const pickedLib = libpick.pickLibrary(lib, libs, options => {
console.log(chalk.cyan('Which one?'));
options.forEach(lib => console.log(chalk.bold(lib.name)));
return read.question(`library full name(default to ${options[0].name}):`);
});
if (pickedLib === null) {
npmlog.error('Library', 'No match found for %j :(', lib);
process.exit(0);
}
return store.fetchLibrary(pickedLib.name);
});
}
function confirmVersion(lib) {
function pickVersion(versionToPick) {
const pickedVersion = libpick.pickVersion(versionToPick, lib, options => {
console.log(chalk.cyan('Which one?'));
options.forEach(version => console.log(chalk.bold(version.version)));
return read.question(`version full name(default to ${options[0].version}):`);
});
if (pickedVersion !== null) {
// copy selected version only
accumulatedOutput = '';
printFancyVersion(pickedVersion);
copyAll('selected version');
}
}
while (true) {
const otherVersion = read.question('Enter a specified version(type all to see all):').trim();
if (otherVersion === '') {
break;
}
if (otherVersion === 'all') {
lib.assets.forEach(asset => console.log(chalk.bold(asset.version)));
continue;
}
pickVersion(otherVersion);
}
}
function pickLibraryAsync({ query, lib }) {
if (lib === null) {
// Not found?
npmlog.warn('Library', '%j not found', query);
return confirmLibraryAsync(query);
} else {
npmlog.disableProgress();
return lib;
}
}
function displayVersion(library) {
const { latestStable, latestUnstable } = libpick.getLatestVersion(library);
printFancyVersion(latestUnstable, true);
// copy latest stable version by default
accumulatedOutput = '';
printFancyVersion(latestStable, true);
copyAll('latest stable version');
// Ask if user wants more
confirmVersion(library);
}
function queryLibraryAsync() {
const query = read.question('Which library to select:').trim();
if (query === '') {
npmlog.warn('Input', 'Empty input!');
process.exit(0);
}
npmlog.enableProgress();
npmlog.http('Library', 'Fetching library info for %j ...', query);
return store.fetchLibrary(query)
.then(lib => ({ query, lib }));
}
module.exports = function cli(commands) {
cliOptions = {
raw: !!commands.raw,
async: !!commands.async,
force: !!commands.force
};
const p = cliOptions.force ? store.refresh() : store.init();
if (commands.args.length === 0) {
npmlog.info('Using interactive CLI');
p
.then(queryLibraryAsync)
.then(
pickLibraryAsync,
err => (npmlog.error('Library', 'Failed fetching library: ' + err), Promise.reject(err)))
.then(
displayVersion,
err => (npmlog.error('Library', 'Failed fetching library: ' + err), Promise.reject(err)))
.then(() => process.exit(0));
} else {
const args = commands.args;
args.unshift(p);
Array.from(commands.args).reduce(
(prev, next) => prev.then(() => run(next)))
.then(() => {
if (accumulatedOutput.length > 0) {
copyAll();
}
process.exit(0);
});
}
process.on('unhandledRejection', (r, s) => {
npmlog.error('Global', r);
console.error(s);
});
}
|
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.naive_bayes import GaussianNB
input_file = 'adult.data.txt'
# Reading the data
X = []
y = []
count_lessthan50k = 0
count_morethan50k = 0
num_images_threshold = 30000
with open(input_file, 'r') as f:
for line in f.readlines():
if '?' in line:
continue
data = line[:-1].split(', ')
if data[-1] == '<=50K' and count_lessthan50k < num_images_threshold:
X.append(data)
count_lessthan50k = count_lessthan50k + 1
elif data[-1] == '>50K' and count_morethan50k < num_images_threshold:
X.append(data)
count_morethan50k = count_morethan50k + 1
if count_lessthan50k >= num_images_threshold and count_morethan50k >= num_images_threshold:
break
X = np.array(X)
# Convert string data to numerical data
label_encoder = []
X_encoded = np.empty(X.shape)
for i,item in enumerate(X[0]):
if item.isdigit():
X_encoded[:, i] = X[:, i]
else:
label_encoder.append(preprocessing.LabelEncoder())
X_encoded[:, i] = label_encoder[-1].fit_transform(X[:, i])
X = X_encoded[:, :-1].astype(int)
y = X_encoded[:, -1].astype(int)
# Build a classifier
classifier_gaussiannb = GaussianNB()
classifier_gaussiannb.fit(X, y)
# Cross validation
from sklearn import cross_validation
X_train, X_test, y_train, y_test = cross_validation.train_test_split(X, y, test_size=0.25, random_state=5)
classifier_gaussiannb = GaussianNB()
classifier_gaussiannb.fit(X_train, y_train)
y_test_pred = classifier_gaussiannb.predict(X_test)
# compute F1 score of the classifier
f1 = cross_validation.cross_val_score(classifier_gaussiannb,
X, y, scoring='f1_weighted', cv=5)
print "F1 score: " + str(round(100*f1.mean(), 2)) + "%"
# Testing encoding on single data instance
input_data = ['39', 'State-gov', '77516', 'Bachelors', '13', 'Never-married', 'Adm-clerical', 'Not-in-family', 'White', 'Male', '2174', '0', '40', 'United-States']
count = 0
input_data_encoded = [-1] * len(input_data)
for i,item in enumerate(input_data):
if item.isdigit():
input_data_encoded[i] = int(input_data[i])
else:
input_data_encoded[i] = int(label_encoder[count].transform(input_data[i]))
count = count + 1
input_data_encoded = np.array(input_data_encoded)
# Predict and print output for a particular datapoint
output_class = classifier_gaussiannb.predict(input_data_encoded)
print label_encoder[-1].inverse_transform(output_class)[0]
|
# (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
import sys
import mock
import pytest
from datadog_checks.kubelet import KubeletCheck, KubeletCredentials
# Skip the whole tests module on Windows
pytestmark = pytest.mark.skipif(sys.platform == 'win32', reason='tests for linux only')
# Constants
HERE = os.path.abspath(os.path.dirname(__file__))
QUANTITIES = {
'12k': 12 * 1000,
'12M': 12 * (1000 * 1000),
'12Ki': 12. * 1024,
'12K': 12.,
'12test': 12.,
}
NODE_SPEC = {
u'cloud_provider': u'GCE',
u'instance_type': u'n1-standard-1',
u'num_cores': 1,
u'system_uuid': u'5556DC4F-C198-07C8-BE37-ACB98B1BA490',
u'network_devices': [{u'mtu': 1460, u'speed': 0, u'name': u'eth0', u'mac_address': u'42:01:0a:84:00:04'}],
u'hugepages': [{u'num_pages': 0, u'page_size': 2048}],
u'memory_capacity': 3885424640,
u'instance_id': u'8153046835786593062',
u'boot_id': u'789bf9ff-77be-4f43-8352-62f84d5e4356',
u'cpu_frequency_khz': 2600000,
u'machine_id': u'5556dc4fc19807c8be37acb98b1ba490'
}
EXPECTED_METRICS_COMMON = [
'kubernetes.cpu.capacity',
'kubernetes.cpu.usage.total',
'kubernetes.cpu.limits',
'kubernetes.cpu.requests',
'kubernetes.filesystem.usage',
'kubernetes.filesystem.usage_pct',
'kubernetes.memory.capacity',
'kubernetes.memory.limits',
'kubernetes.memory.requests',
'kubernetes.memory.usage',
'kubernetes.network.rx_bytes',
'kubernetes.network.tx_bytes'
]
EXPECTED_METRICS_PROMETHEUS = [
'kubernetes.memory.usage_pct',
'kubernetes.network.rx_dropped',
'kubernetes.network.rx_errors',
'kubernetes.network.tx_dropped',
'kubernetes.network.tx_errors',
'kubernetes.io.write_bytes',
'kubernetes.io.read_bytes',
'kubernetes.apiserver.certificate.expiration.count',
'kubernetes.apiserver.certificate.expiration.sum',
'kubernetes.rest.client.requests',
'kubernetes.rest.client.latency.count',
'kubernetes.rest.client.latency.sum',
'kubernetes.kubelet.runtime.operations',
'kubernetes.kubelet.runtime.errors',
'kubernetes.kubelet.network_plugin.latency.sum',
'kubernetes.kubelet.network_plugin.latency.count',
'kubernetes.kubelet.network_plugin.latency.quantile',
]
@pytest.fixture
def aggregator():
from datadog_checks.stubs import aggregator
aggregator.reset()
return aggregator
def mock_kubelet_check(monkeypatch, instances):
"""
Returns a check that uses mocked data for responses from prometheus endpoints, pod list,
and node spec.
"""
check = KubeletCheck('kubelet', None, {}, instances)
monkeypatch.setattr(check, 'retrieve_pod_list', mock.Mock(return_value=json.loads(mock_from_file('pods.json'))))
monkeypatch.setattr(check, '_retrieve_node_spec', mock.Mock(return_value=NODE_SPEC))
monkeypatch.setattr(check, '_perform_kubelet_check', mock.Mock(return_value=None))
def mocked_poll(*args, **kwargs):
scraper_config = args[0]
prometheus_url = scraper_config['prometheus_url']
attrs = None
if prometheus_url.endswith('/metrics/cadvisor'):
# Mock response for "/metrics/cadvisor"
attrs = {
'close.return_value': True,
'iter_lines.return_value': mock_from_file('cadvisor_metrics.txt').split('\n')
}
elif prometheus_url.endswith('/metrics'):
# Mock response for "/metrics"
attrs = {
'close.return_value': True,
'iter_lines.return_value': mock_from_file('kubelet_metrics.txt').split('\n')
}
else:
raise Exception("Must be a valid endpoint")
return mock.Mock(headers={'Content-Type': 'text/plain'}, **attrs)
monkeypatch.setattr(check, 'poll', mock.Mock(side_effect=mocked_poll))
return check
def mock_from_file(fname):
with open(os.path.join(HERE, 'fixtures', fname)) as f:
return f.read()
def test_bad_config():
with pytest.raises(Exception):
KubeletCheck('kubelet', None, {}, [{}, {}])
def test_parse_quantity():
for raw, res in QUANTITIES.iteritems():
assert KubeletCheck.parse_quantity(raw) == res
def test_kubelet_default_options():
check = KubeletCheck('kubelet', None, {}, [{}])
assert check.cadvisor_scraper_config['namespace'] == 'kubernetes'
assert check.kubelet_scraper_config['namespace'] == 'kubernetes'
assert isinstance(check.cadvisor_scraper_config, dict)
assert isinstance(check.kubelet_scraper_config, dict)
def test_kubelet_check_prometheus_instance_tags(monkeypatch, aggregator):
_test_kubelet_check_prometheus(monkeypatch, aggregator, ["instance:tag"])
def test_kubelet_check_prometheus_no_instance_tags(monkeypatch, aggregator):
_test_kubelet_check_prometheus(monkeypatch, aggregator, None)
def _test_kubelet_check_prometheus(monkeypatch, aggregator, instance_tags):
instance = {}
if instance_tags:
instance["tags"] = instance_tags
check = mock_kubelet_check(monkeypatch, [instance])
monkeypatch.setattr(check, 'process_cadvisor', mock.Mock(return_value=None))
check.check(instance)
assert check.cadvisor_legacy_url is None
check.retrieve_pod_list.assert_called_once()
check._retrieve_node_spec.assert_called_once()
check._perform_kubelet_check.assert_called_once()
check.process_cadvisor.assert_not_called()
# called twice so pct metrics are guaranteed to be there
check.check(instance)
for metric in EXPECTED_METRICS_COMMON:
aggregator.assert_metric(metric)
if instance_tags:
for tag in instance_tags:
aggregator.assert_metric_has_tag(metric, tag)
for metric in EXPECTED_METRICS_PROMETHEUS:
aggregator.assert_metric(metric)
if instance_tags:
for tag in instance_tags:
aggregator.assert_metric_has_tag(metric, tag)
assert aggregator.metrics_asserted_pct == 100.0
def test_prometheus_cpu_summed(monkeypatch, aggregator):
check = mock_kubelet_check(monkeypatch, [{}])
monkeypatch.setattr(check, 'rate', mock.Mock())
with mock.patch("datadog_checks.kubelet.prometheus.get_tags", side_effect=mocked_get_tags):
check.check({"cadvisor_metrics_endpoint": "http://dummy/metrics/cadvisor", "kubelet_metrics_endpoint": ""})
# Make sure we submit the summed rates correctly for containers:
# - fluentd-gcp-v2.0.10-9q9t4 uses two cpus, we need to sum (1228.32 + 825.32) * 10**9 = 2053640000000
# - demo-app-success-c485bc67b-klj45 is mono-threaded, we submit 7.756358313 * 10**9 = 7756358313
#
calls = [
mock.call('kubernetes.cpu.usage.total', 2053640000000.0, [
'kube_container_name:fluentd-gcp',
'kube_deployment:fluentd-gcp-v2.0.10'
]),
mock.call('kubernetes.cpu.usage.total', 7756358313.0, ['pod_name=demo-app-success-c485bc67b-klj45']),
]
check.rate.assert_has_calls(calls, any_order=True)
# Make sure the per-core metrics are not submitted
bad_calls = [
mock.call('kubernetes.cpu.usage.total', 1228320000000.0, [
'kube_container_name:fluentd-gcp',
'kube_deployment:fluentd-gcp-v2.0.10'
]),
mock.call('kubernetes.cpu.usage.total', 825320000000.0, [
'kube_container_name:fluentd-gcp',
'kube_deployment:fluentd-gcp-v2.0.10'
]),
]
for c in bad_calls:
assert c not in check.rate.mock_calls
def test_prometheus_net_summed(monkeypatch, aggregator):
check = mock_kubelet_check(monkeypatch, [{}])
monkeypatch.setattr(check, 'rate', mock.Mock())
with mock.patch("datadog_checks.kubelet.prometheus.get_tags", side_effect=mocked_get_tags):
check.check({"cadvisor_metrics_endpoint": "http://dummy/metrics/cadvisor", "kubelet_metrics_endpoint": ""})
# Make sure we submit the summed rates correctly for pods:
# - dd-agent-q6hpw has two interfaces, we need to sum (1.2638051777 + 2.2638051777) * 10**10 = 35276103554
# - fluentd-gcp-v2.0.10-9q9t4 has one interface only, we submit 5.8107648 * 10**07 = 58107648
#
calls = [
mock.call('kubernetes.network.rx_bytes', 35276103554.0, ['pod_name:dd-agent-q6hpw']),
mock.call('kubernetes.network.rx_bytes', 58107648.0, ['pod_name:fluentd-gcp-v2.0.10-fkeuj']),
]
check.rate.assert_has_calls(calls, any_order=True)
bad_calls = [
# Make sure the per-interface metrics are not submitted
mock.call('kubernetes.network.rx_bytes', 12638051777.0, ['pod_name:dd-agent-q6hpw']),
mock.call('kubernetes.network.rx_bytes', 22638051777.0, ['pod_name:dd-agent-q6hpw']),
# Make sure hostNetwork pod metrics are not submitted, test with and without sum to be sure
mock.call('kubernetes.network.rx_bytes', (4917138204.0 + 698882782.0),
['pod_name:kube-proxy-gke-haissam-default-pool-be5066f1-wnvn']),
mock.call('kubernetes.network.rx_bytes', 4917138204.0,
['pod_name:kube-proxy-gke-haissam-default-pool-be5066f1-wnvn']),
mock.call('kubernetes.network.rx_bytes', 698882782.0,
['pod_name:kube-proxy-gke-haissam-default-pool-be5066f1-wnvn']),
]
for c in bad_calls:
assert c not in check.rate.mock_calls
def test_prometheus_filtering(monkeypatch, aggregator):
# Let's intercept the container_cpu_usage_seconds_total
# metric to make sure no sample with an empty pod_name
# goes through input filtering
# 12 out of the 45 samples should pass through the filter
method_name = "datadog_checks.kubelet.prometheus.CadvisorPrometheusScraperMixin.container_cpu_usage_seconds_total"
with mock.patch(method_name) as mock_method:
check = mock_kubelet_check(monkeypatch, [{}])
check.check({"cadvisor_metrics_endpoint": "http://dummy/metrics/cadvisor", "kubelet_metrics_endpoint": ""})
mock_method.assert_called_once()
metric = mock_method.call_args[0][0]
assert len(metric.samples) == 12
for name, labels, value in metric.samples:
assert name == "container_cpu_usage_seconds_total"
assert labels["pod_name"] != ""
def test_kubelet_check_instance_config(monkeypatch):
def mock_kubelet_check_no_prom():
check = mock_kubelet_check(monkeypatch, [{}])
monkeypatch.setattr(check, 'process', mock.Mock(return_value=None))
monkeypatch.setattr(check, 'process_cadvisor', mock.Mock(return_value=None))
return check
check = mock_kubelet_check_no_prom()
check.check({"cadvisor_port": 0, "cadvisor_metrics_endpoint": "", "kubelet_metrics_endpoint": ""})
assert check.cadvisor_legacy_url is None
check.retrieve_pod_list.assert_called_once()
check._retrieve_node_spec.assert_called_once()
check._perform_kubelet_check.assert_called_once()
check.process_cadvisor.assert_not_called()
check = mock_kubelet_check_no_prom()
check.check({"cadvisor_port": 0, "metrics_endpoint": "", "kubelet_metrics_endpoint": "http://dummy"})
def mocked_get_tags(entity, _):
tag_store = {
"kubernetes_pod://2edfd4d9-10ce-11e8-bd5a-42010af00137": [
"pod_name:fluentd-gcp-v2.0.10-9q9t4"
],
"kubernetes_pod://2fdfd4d9-10ce-11e8-bd5a-42010af00137": [
"pod_name:fluentd-gcp-v2.0.10-fkeuj"
],
'docker://5741ed2471c0e458b6b95db40ba05d1a5ee168256638a0264f08703e48d76561': [
'kube_container_name:fluentd-gcp',
'kube_deployment:fluentd-gcp-v2.0.10'
],
"docker://580cb469826a10317fd63cc780441920f49913ae63918d4c7b19a72347645b05": [
'kube_container_name:prometheus-to-sd-exporter',
'kube_deployment:fluentd-gcp-v2.0.10'
],
'docker://6941ed2471c0e458b6b95db40ba05d1a5ee168256638a0264f08703e48d76561': [
'kube_container_name:fluentd-gcp',
'kube_deployment:fluentd-gcp-v2.0.10'
],
"docker://690cb469826a10317fd63cc780441920f49913ae63918d4c7b19a72347645b05": [
'kube_container_name:prometheus-to-sd-exporter',
'kube_deployment:fluentd-gcp-v2.0.10'
],
"docker://5f93d91c7aee0230f77fbe9ec642dd60958f5098e76de270a933285c24dfdc6f": [
"pod_name=demo-app-success-c485bc67b-klj45"
],
"kubernetes_pod://d2e71e36-10d0-11e8-bd5a-42010af00137": [
'pod_name:dd-agent-q6hpw'
],
"kubernetes_pod://260c2b1d43b094af6d6b4ccba082c2db": [
'pod_name:kube-proxy-gke-haissam-default-pool-be5066f1-wnvn'
]
}
# Match agent 6.5 behaviour of not accepting None
if entity is None:
raise ValueError("None is not a valid entity id")
return tag_store.get(entity, [])
def test_report_pods_running(monkeypatch):
check = KubeletCheck('kubelet', None, {}, [{}])
monkeypatch.setattr(check, 'retrieve_pod_list', mock.Mock(return_value=json.loads(mock_from_file('pods.json'))))
monkeypatch.setattr(check, 'gauge', mock.Mock())
pod_list = check.retrieve_pod_list()
with mock.patch("datadog_checks.kubelet.kubelet.get_tags", side_effect=mocked_get_tags):
check._report_pods_running(pod_list, [])
calls = [
mock.call('kubernetes.pods.running', 1, ["pod_name:fluentd-gcp-v2.0.10-9q9t4"]),
mock.call('kubernetes.pods.running', 1, ["pod_name:fluentd-gcp-v2.0.10-fkeuj"]),
mock.call('kubernetes.containers.running', 2, [
"kube_container_name:fluentd-gcp",
"kube_deployment:fluentd-gcp-v2.0.10"
]),
mock.call('kubernetes.containers.running', 2, [
"kube_container_name:prometheus-to-sd-exporter",
"kube_deployment:fluentd-gcp-v2.0.10"
]),
]
check.gauge.assert_has_calls(calls, any_order=True)
def test_report_pods_running_none_ids(monkeypatch):
# Make sure the method is resilient to inconsistent podlists
podlist = json.loads(mock_from_file('pods.json'))
podlist["items"][0]['metadata']['uid'] = None
podlist["items"][1]['status']['containerStatuses'][0]['containerID'] = None
check = KubeletCheck('kubelet', None, {}, [{}])
monkeypatch.setattr(check, 'retrieve_pod_list', mock.Mock(return_value=podlist))
monkeypatch.setattr(check, 'gauge', mock.Mock())
pod_list = check.retrieve_pod_list()
with mock.patch("datadog_checks.kubelet.kubelet.get_tags", side_effect=mocked_get_tags):
check._report_pods_running(pod_list, [])
calls = [
mock.call('kubernetes.pods.running', 1, ["pod_name:fluentd-gcp-v2.0.10-9q9t4"]),
mock.call('kubernetes.containers.running', 2, [
"kube_container_name:prometheus-to-sd-exporter",
"kube_deployment:fluentd-gcp-v2.0.10"
]),
]
check.gauge.assert_has_calls(calls, any_order=True)
def test_report_container_spec_metrics(monkeypatch):
check = KubeletCheck('kubelet', None, {}, [{}])
monkeypatch.setattr(check, 'retrieve_pod_list', mock.Mock(return_value=json.loads(mock_from_file('pods.json'))))
monkeypatch.setattr(check, 'gauge', mock.Mock())
attrs = {'is_excluded.return_value': False}
check.pod_list_utils = mock.Mock(**attrs)
pod_list = check.retrieve_pod_list()
instance_tags = ["one:1", "two:2"]
with mock.patch("datadog_checks.kubelet.kubelet.get_tags", side_effect=mocked_get_tags):
check._report_container_spec_metrics(pod_list, instance_tags)
calls = [
mock.call('kubernetes.cpu.requests', 0.1, [
'kube_container_name:fluentd-gcp',
'kube_deployment:fluentd-gcp-v2.0.10'
] + instance_tags),
mock.call('kubernetes.memory.requests', 209715200.0, [
'kube_container_name:fluentd-gcp',
'kube_deployment:fluentd-gcp-v2.0.10'
] + instance_tags),
mock.call('kubernetes.memory.limits', 314572800.0, [
'kube_container_name:fluentd-gcp',
'kube_deployment:fluentd-gcp-v2.0.10'
] + instance_tags),
mock.call('kubernetes.cpu.requests', 0.1, instance_tags),
mock.call('kubernetes.cpu.requests', 0.1, instance_tags),
mock.call('kubernetes.memory.requests', 134217728.0, instance_tags),
mock.call('kubernetes.cpu.limits', 0.25, instance_tags),
mock.call('kubernetes.memory.limits', 536870912.0, instance_tags),
mock.call('kubernetes.cpu.requests', 0.1, ["pod_name=demo-app-success-c485bc67b-klj45"] + instance_tags),
]
check.gauge.assert_has_calls(calls, any_order=True)
class MockResponse(mock.Mock):
@staticmethod
def iter_lines():
return []
def test_perform_kubelet_check(monkeypatch):
check = KubeletCheck('kubelet', None, {}, [{}])
check.kube_health_url = "http://127.0.0.1:10255/healthz"
check.kubelet_credentials = KubeletCredentials({})
monkeypatch.setattr(check, 'service_check', mock.Mock())
instance_tags = ["one:1"]
get = MockResponse()
with mock.patch("requests.get", side_effect=get):
check._perform_kubelet_check(instance_tags)
get.assert_has_calls([
mock.call('http://127.0.0.1:10255/healthz', cert=None, headers=None, params={'verbose': True}, timeout=10,
verify=None)])
calls = [mock.call('kubernetes.kubelet.check', 0, tags=instance_tags)]
check.service_check.assert_has_calls(calls)
def test_report_node_metrics(monkeypatch):
check = KubeletCheck('kubelet', None, {}, [{}])
monkeypatch.setattr(check, '_retrieve_node_spec', mock.Mock(return_value={'num_cores': 4, 'memory_capacity': 512}))
monkeypatch.setattr(check, 'gauge', mock.Mock())
check._report_node_metrics(['foo:bar'])
calls = [
mock.call('kubernetes.cpu.capacity', 4.0, ['foo:bar']),
mock.call('kubernetes.memory.capacity', 512.0, ['foo:bar'])
]
check.gauge.assert_has_calls(calls, any_order=False)
def test_retrieve_pod_list_success(monkeypatch):
class MockResponse:
def __init__(self, json_data):
self.json_data = json_data
def json(self):
return (json.loads(self.json_data))
check = KubeletCheck('kubelet', None, {}, [{}])
check.pod_list_url = "dummyurl"
monkeypatch.setattr(check, 'perform_kubelet_query',
mock.Mock(return_value=MockResponse(mock_from_file('pod_list_raw.dat'))))
retrieved = check.retrieve_pod_list()
expected = json.loads(mock_from_file("pod_list_raw.json"))
assert (json.dumps(retrieved, sort_keys=True) == json.dumps(expected, sort_keys=True))
def test_retrieved_pod_list_failure(monkeypatch):
def mock_perform_kubelet_query(s):
raise Exception("network error")
check = KubeletCheck('kubelet', None, {}, [{}])
check.pod_list_url = "dummyurl"
monkeypatch.setattr(check, 'perform_kubelet_query', mock_perform_kubelet_query)
retrieved = check.retrieve_pod_list()
assert retrieved is None
|
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'vueproject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (C) 2017 University of Dundee. All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
"""
Run Gaussian Filter from Scipy on Project/Dataset/Image/Screen/Plate/Well.
This an OMERO script that runs server-side.
"""
import omero
import time
import omero.scripts as scripts
from omero.rtypes import rlong, robject, rstring, wrap
from omero.gateway import MapAnnotationWrapper, DatasetWrapper
from omero.gateway import BlitzGateway
from omero.rtypes import * # noqa
import json
from cStringIO import StringIO
import scipy.ndimage as spi
def run(conn, params):
"""
For each image, apply filter and load the result into OMERO.
Returns the number of images processed or -1 if there is a
parameter error.
@param conn The BlitzGateway connection
@param params The script parameters
"""
# Get parameters. These are 'required' so we know they will be populated
window_size = params.get("Kernel_Window_Size")
sigma = params.get("Sigma")
images = []
if params.get("Data_Type") == 'Dataset':
for dsId in params["IDs"]:
dataset = conn.getObject("Dataset", dsId)
if dataset:
for image in dataset.listChildren():
images.append(image)
elif params.get("Data_Type") == 'Image':
images = list(conn.getObjects('Image', params["IDs"]))
if len(images) == 0:
return None
# Create new Dataset
new_dataset = DatasetWrapper(conn, omero.model.DatasetI())
new_dataset.setName('Scipy_Gaussian_Filter')
new_dataset.save()
# Extract images
image_ids = []
for image in images:
sizeZ = image.getSizeZ()
sizeC = image.getSizeC()
sizeT = image.getSizeT()
zctList = []
for z in range(sizeZ):
for c in range(sizeC):
for t in range(sizeT):
zctList.append((z, c, t))
plane = planeGen(image, zctList, window_size, sigma)
name = image.getName() + "_gaussian"
i = conn.createImageFromNumpySeq(plane, name, sizeZ, sizeC,
sizeT, description="Gaussian Filter",
dataset=new_dataset,
sourceImageId=image.id)
image_ids.append(i.getId())
add_map_annotation(conn, i, params)
return image_ids, new_dataset
def planeGen(image, zctList, window, sigma):
"""Generator will yield planes."""
planes = image.getPrimaryPixels().getPlanes(zctList)
for p in planes:
data = spi.filters.gaussian_filter(p, sigma=sigma)
yield data
def add_map_annotation(conn, image, params):
"""Add key-value pairs from params onto image."""
window_size = params.get("Kernel_Window_Size")
sigma = params.get("Sigma")
key_value_data = [["Kernel Window Size", str(window_size)],
["Sigma", str(sigma)]]
print("Adding MAP", key_value_data, image.getId())
map_ann = MapAnnotationWrapper(conn)
# Use 'client' namespace to allow editing in Insight & web
map_ann.setNs(omero.constants.metadata.NSCLIENTMAPANNOTATION)
map_ann.setValue(key_value_data)
map_ann.save()
# NB: only link a client map annotation to a single object
image.linkAnnotation(map_ann)
# OMERO Figure Methods
def get_panel_json(image, x, y, width, height, channel=None):
"""Export the results as OMERO.figure."""
rv = imageMarshal(image)
if channel is not None:
for idx, ch in enumerate(rv['channels']):
ch['active'] = idx == channel
img_json = {
"labels": [],
"height": height,
"channels": rv['channels'],
"width": width,
"sizeT": rv['size']['t'],
"sizeZ": rv['size']['z'],
"dx": 0,
"dy": 0,
"rotation": 0,
"imageId": image.getId(),
"name": image.getName(),
"orig_width": rv['size']['width'],
"zoom": 100,
"shapes": [],
"orig_height": rv['size']['height'],
"theZ": rv['rdefs']['defaultZ'],
"y": y,
"x": x,
"theT": rv['rdefs']['defaultT']
}
return img_json
def channelMarshal(channel):
"""
Return a dict with all there is to know about a channel.
@param channel: L{omero.gateway.ChannelWrapper}
@return: Dict
"""
chan = {'emissionWave': channel.getEmissionWave(),
'label': channel.getLabel(),
'color': channel.getColor().getHtml(),
# 'reverseIntensity' is deprecated. Use 'inverted'
'inverted': channel.isInverted(),
'reverseIntensity': channel.isInverted(),
'window': {'min': channel.getWindowMin(),
'max': channel.getWindowMax(),
'start': channel.getWindowStart(),
'end': channel.getWindowEnd()},
'active': channel.isActive()}
lut = channel.getLut()
if lut and len(lut) > 0:
chan['lut'] = lut
return chan
def imageMarshal(image, key=None, request=None):
"""
Return a dict with pretty much everything we know and care about an image.
@param image: L{omero.gateway.ImageWrapper}
@param key: key of specific attributes to select
@return: Dict
"""
image.loadRenderOptions()
pr = image.getProject()
ds = None
wellsample = None
well = None
parents = image.listParents()
if parents is not None:
datasets = [p for p in parents if p.OMERO_CLASS == 'Dataset']
well_smpls = [p for p in parents if p.OMERO_CLASS == 'WellSample']
if len(datasets) == 1:
ds = datasets[0]
if len(well_smpls) == 1:
if well_smpls[0].well is not None:
well = well_smpls[0].well
rv = {
'id': image.id,
'meta': {
'imageName': image.name or '',
'imageDescription': image.description or '',
'imageAuthor': image.getAuthor(),
'projectName': pr and pr.name or 'Multiple',
'projectId': pr and pr.id or None,
'projectDescription': pr and pr.description or '',
'datasetName': ds and ds.name or 'Multiple',
'datasetId': ds and ds.id or None,
'datasetDescription': ds and ds.description or '',
'wellSampleId': wellsample and wellsample.id or '',
'wellId': well and well.id.val or '',
'imageTimestamp': time.mktime(
image.getDate().timetuple()),
'imageId': image.id,
'pixelsType': image.getPixelsType(),
},
'perms': {
'canAnnotate': image.canAnnotate(),
'canEdit': image.canEdit(),
'canDelete': image.canDelete(),
'canLink': image.canLink()
}
}
image._prepareRenderingEngine()
def pixel_size_in_microns(method):
try:
size = method('MICROMETER')
return size.getValue() if size else None
except Exception:
return None
rv.update({
'size': {'width': image.getSizeX(),
'height': image.getSizeY(),
'z': image.getSizeZ(),
't': image.getSizeT(),
'c': image.getSizeC()},
'pixel_size': {'x': pixel_size_in_microns(image.getPixelSizeX),
'y': pixel_size_in_microns(image.getPixelSizeY),
'z': pixel_size_in_microns(image.getPixelSizeZ)},
})
try:
rv['pixel_range'] = image.getPixelRange()
rv['channels'] = map(lambda x: channelMarshal(x),
image.getChannels())
rv['split_channel'] = image.splitChannelDims()
rv['rdefs'] = {'model': (image.isGreyscaleRenderingModel() and
'greyscale' or 'color'),
'projection': image.getProjection(),
'defaultZ': image._re.getDefaultZ(),
'defaultT': image._re.getDefaultT(),
'invertAxis': image.isInvertedAxis()}
except AttributeError:
rv = None
raise
return rv
def get_labels_json(panel_json, column, row):
"""Return dict of labels data for figure JSON."""
labels = []
channels = panel_json['channels']
imagename = panel_json['name']
if row == 0:
labels.append({"text": channels[column]['label'],
"size": 8,
"position": "top",
"color": "000000"})
if column == 0:
labels.append({"text": imagename,
"size": 8,
"position": "leftvert",
"color": "000000"})
return labels
def create_figure_file(conn, image_ids):
"""Create an OMERO.figure file with the specified images."""
width = 100
height = 100
spacing_x = 5
spacing_y = 5
JSON_FILEANN_NS = "omero.web.figure.json"
figure_json = {"version": 2,
"paper_width": 595,
"paper_height": 842,
"page_size": "A4",
"figureName": "Scipy Gaussian Filter",
}
curr_x = 0
curr_y = 0
panels_json = []
offset = 40
gid = -1
for row, image_id in enumerate(image_ids):
image = conn.getObject('Image', image_id)
curr_y = row * (height + spacing_y) + offset
if row == 0:
gid = image.getDetails().getGroup().getId()
for col in range(image.getSizeC()):
curr_x = col * (width + spacing_x) + offset
j = get_panel_json(image, curr_x, curr_y, width, height, col)
j['labels'] = get_labels_json(j, col, row)
panels_json.append(j)
figure_json['panels'] = panels_json
figure_name = figure_json['figureName']
if len(figure_json['panels']) == 0:
raise Exception('No Panels')
first_img_id = figure_json['panels'][0]['imageId']
# we store json in description field...
description = {}
description['name'] = figure_name
description['imageId'] = first_img_id
# Try to set Group context to the same as first image
conn.SERVICE_OPTS.setOmeroGroup(gid)
json_string = json.dumps(figure_json)
file_size = len(json_string)
f = StringIO()
json.dump(figure_json, f)
update = conn.getUpdateService()
orig_file = conn.createOriginalFileFromFileObj(f, '', figure_name,
file_size,
mimetype="application/json")
fa = omero.model.FileAnnotationI()
fa.setFile(omero.model.OriginalFileI(orig_file.getId(), False))
fa.setNs(wrap(JSON_FILEANN_NS))
desc = json.dumps(description)
fa.setDescription(wrap(desc))
fa = update.saveAndReturnObject(fa, conn.SERVICE_OPTS)
return fa.getId().getValue()
if __name__ == "__main__":
dataTypes = [rstring('Dataset'), rstring('Image')]
client = scripts.client(
'Scipy_Gaussian_Filter.py',
"""
This script applies a gaussian filter to the selected images,
uploads the generated images to OMERO and creates an OMERO.figure
""",
scripts.String(
"Data_Type", optional=False, grouping="1",
description="Choose source of images",
values=dataTypes, default="Dataset"),
scripts.List(
"IDs", optional=False, grouping="2",
description="Dataset IDs.").ofType(rlong(0)),
scripts.Int(
"Kernel_Window_Size", optional=False, grouping="3", default=20,
description="Window size for the gaussian filter"),
scripts.Int(
"Sigma", optional=False, grouping="4", default=2,
description="Sigma for the gaussian filter"),
scripts.Bool(
"Create_Omero_Figure", default=True, grouping="5",
description="Create An OMERO.Figure from the resultant images"),
authors=["Balaji Ramalingam", "OME Team"],
institutions=["University of Dundee"],
contact="ome-users@lists.openmicroscopy.org.uk",
)
try:
# process the list of args above.
scriptParams = {}
for key in client.getInputKeys():
if client.getInput(key):
scriptParams[key] = client.getInput(key, unwrap=True)
print(scriptParams)
# wrap client to use the Blitz Gateway
conn = BlitzGateway(client_obj=client)
# # Call the main script - returns the number of images processed
result = run(conn, scriptParams)
if result is None:
message = "No images found"
else:
image_ids, dataset = result
message = "Created %s images" % len(image_ids)
if scriptParams["Create_Omero_Figure"]:
create_figure_file(conn, image_ids)
message += " and new Figure"
client.setOutput("Dataset", robject(dataset._obj))
client.setOutput("Message", rstring(message))
finally:
client.closeSession()
|
import aiohttp
from backend import Status
class DynClient():
def __init__(self, custom_checker = None):
self._checker = custom_checker
async def check_binding(self, libra_address, url):
if self._checker is None:
return True
else:
return await self._checker(libra_address, url)
async def check_other_claim(self, claim):
async with aiohttp.ClientSession() as session:
if await self.check_binding(claim['vasp_libra_address'], claim['verification_endpoint']):
async with session.post(claim['verification_endpoint'] + '/check', json=claim) as resp:
response = await resp.json()
return Status[response['status']]
else:
return Status.incorrect_address
async def get_subaddress_from_subaddress(self, url, subaddress):
request = {
'subaddress' : subaddress,
}
async with aiohttp.ClientSession() as session:
if await self.check_binding(subaddress, url):
async with session.post(url + '/generate', json=request) as resp:
response = await resp.json()
return (Status[response['status']], response.get('dynamic_subaddress', None))
else:
return Status.incorrect_address
async def get_attestation(self, originator_record, beneficiary_record, amount):
request = {
'beneficiary_travel_rule_record' : beneficiary_record,
'originator_travel_rule_record' : originator_record,
'amount' : amount,
}
url = beneficiary_record['verification_endpoint'] + '/attest'
async with aiohttp.ClientSession() as session:
if await self.check_binding(beneficiary_record['vasp_libra_address'], beneficiary_record['verification_endpoint']):
async with session.post(url, json=request) as resp:
response = await resp.json()
if Status[response['status']] != Status.compliance_signature:
return Status[response['status']]
else:
return (Status[response['status']], response['reference_id'], response['compliance_signature'])
else:
return Status.incorrect_address
|
var searchData=
[
['run',['Run',['../class_server_1_1_lobby.html#a03f85d30bb1f855c4138c7f515ee1717',1,'Server::Lobby']]],
['rungame',['runGame',['../class_server_1_1_game.html#aedfb6f3fb863eb0966e0ea5fdb89fbb0',1,'Server::Game']]]
];
|
import pytest
import capnp
import os
import socket
import test_capability_capnp
class Server(test_capability_capnp.TestInterface.Server):
def __init__(self, val=1):
self.val = val
def foo(self, i, j, **kwargs):
return str(i * 5 + self.val)
def restore_func(ref_id):
return Server(100)
class SimpleRestorer(test_capability_capnp.TestSturdyRefObjectId.Restorer):
def restore(self, ref_id):
assert ref_id.tag == 'testInterface'
return Server(100)
def test_simple_rpc():
read, write = socket.socketpair(socket.AF_UNIX)
restorer = SimpleRestorer()
server = capnp.TwoPartyServer(write, restorer)
client = capnp.TwoPartyClient(read)
ref = test_capability_capnp.TestSturdyRefObjectId.new_message(tag='testInterface')
cap = client.restore(ref)
cap = cap.cast_as(test_capability_capnp.TestInterface)
remote = cap.foo(i=5)
response = remote.wait()
assert response.x == '125'
def test_simple_rpc_restore_func():
read, write = socket.socketpair(socket.AF_UNIX)
server = capnp.TwoPartyServer(write, restore_func)
client = capnp.TwoPartyClient(read)
ref = test_capability_capnp.TestSturdyRefObjectId.new_message(tag='testInterface')
cap = client.restore(ref)
cap = cap.cast_as(test_capability_capnp.TestInterface)
remote = cap.foo(i=5)
response = remote.wait()
assert response.x == '125'
def text_restore_func(objectId):
text = objectId.as_text()
assert text == 'testInterface'
return Server(100)
def test_ez_rpc():
read, write = socket.socketpair(socket.AF_UNIX)
server = capnp.TwoPartyServer(write, text_restore_func)
client = capnp.TwoPartyClient(read)
cap = client.ez_restore('testInterface')
cap = cap.cast_as(test_capability_capnp.TestInterface)
remote = cap.foo(i=5)
response = remote.wait()
assert response.x == '125'
cap = client.restore(test_capability_capnp.TestSturdyRefObjectId.new_message())
cap = cap.cast_as(test_capability_capnp.TestInterface)
remote = cap.foo(i=5)
with pytest.raises(capnp.KjException):
response = remote.wait()
def test_simple_rpc_bootstrap():
read, write = socket.socketpair(socket.AF_UNIX)
server = capnp.TwoPartyServer(write, bootstrap=Server(100))
client = capnp.TwoPartyClient(read)
cap = client.bootstrap()
cap = cap.cast_as(test_capability_capnp.TestInterface)
remote = cap.foo(i=5)
response = remote.wait()
assert response.x == '125'
|
import { connectToDatabase } from "../../util/mongodb";
export default async (req, res) => {
if (req.method == "POST") {
const { db } = await connectToDatabase();
await db
.collection("contact")
.insertOne({
message: req.body.message,
email: req.body.email,
date: new Date(),
})
.then((e) => res.status(200).send("message stored"));
} else {
res.status(404).send({ status: "error", value: "wrong method" });
}
};
|
import {fromJS, Map} from 'immutable';
import * as authUtils from '../utils/auth-utils';
import userDataReducer from './user-data-reducer';
const INITIAL_CREDENTIALS = Map({});
const INITIAL_USER_DATA = fromJS({
userSettings: {},
userSettingsUpdating: false,
userSettingsError: null,
flashcards: {},
repetitions: {},
currentRepetition: null,
recentlyDeletedFlashcard: null,
lastSyncServerTime: 0,
lastSyncClientTime: 0,
lastSyncRequestClientTime: null,
searchString: '',
lastCurrentDate: '',
initialLoadingCompleted: false,
dateUpdateIntervalId: null,
syncError: null
});
const INITIAL_STATE = fromJS({
credentials: INITIAL_CREDENTIALS,
userData: INITIAL_USER_DATA,
online: true,
requestingLoginOrSignup: null,
login: {
error: null
},
signup: {
error: null
}
});
export default function reducer (state = INITIAL_STATE, action = {}) {
const updatedState = getUpdatedState(state, action);
return updatedState;
}
function getUpdatedState (state, action) {
switch (action.type) {
case 'STORE_CREDENTIALS':
return state
.update('credentials',
credentials => credentials.merge(action.credentials));
case 'OPEN_LOCAL_DB_REQUEST':
return state
.set('indexedDB', action.indexedDB)
.set('openLocalDbPromise', action.promise);
case 'RESET_LOGGED_IN_STATE':
return state
.set('credentials', INITIAL_CREDENTIALS)
.set('userData', INITIAL_USER_DATA)
.delete('openLocalDbPromise');
case 'LOGIN_REQUEST':
return state
.set('requestingLoginOrSignup', true);
case 'LOGIN_FAILURE':
return state
.set('requestingLoginOrSignup', false)
.setIn(['login', 'error'], action.errorCode);
case 'LOGIN_SUCCESS':
return state
.set('requestingLoginOrSignup', false)
.setIn(['login', 'error'], null)
.setIn(['signup', 'error'], null);
case 'SIGNUP_REQUEST':
return state
.set('requestingLoginOrSignup', true);
case 'SIGNUP_FAILURE':
return state
.set('requestingLoginOrSignup', false)
.setIn(['signup', 'error'], action.errorCode);
case 'SET_ONLINE': {
return state
.set('online', action.online);
}
case 'STORE_USER_AGENT': {
return state
.set('userAgent', action.userAgent);
}
default:
return state
.update('userData', userData =>
authUtils.isLoggedIn(state) ?
userDataReducer(userData, action) :
userData
);
}
}
|
import React from "react";
import {render} from "react-dom";
import {Header} from "./components/Header";
import {Home} from "./components/Home";
class App extends React.Component {
onGreet(){
alert("Hello!")
};
constructor(){
super();
this.state={
homeLink:"Home",
homeMounted: true
};
}
onChangeHomeMounted() {
this.setState({
homeMounted: !this.state.homeMounted
});
}
onChangeLinkName(newName){
this.setState({
homeLink:newName
});
};
render() {
let homeCmp = "";
if (this.state.homeMounted) {
homeCmp = (
<Home
name={"Max"}
initialAge={27}
greet={this.onGreet}
changeLink={this.onChangeLinkName.bind(this)}
initialLinkName={this.state.homeLink} />
);
}
return (
<div className="container">
<div className="row">
<div className="col-xs-10 col-xs-offset-1">
<Header homeLink={this.state.homeLink}/>
</div>
</div>
<div className="row">
<div className="col-xs-10 col-xs-offset-1">
{homeCmp}
</div>
</div>
<div className="row">
<div className="col-xs-10 col-xs-offset-1">
<button onClick={this.onChangeHomeMounted.bind(this)} className="btn btn-primary">(Un)mount Home Component</button>
</div>
</div>
</div>
);
}
}
render(<App/>, window.document.getElementById("app"));
|
//
// contentblocker.js
// DuckDuckGo
//
// Copyright © 2017 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
(function() {
function surrogateInjected(data) {
try {
webkit.messageHandlers.trackerDetectedMessage.postMessage(data);
} catch(error) {
// webkit might not be defined
}
}
// tld.js
var tldjs = {
parse: function(url) {
if (url.startsWith("//")) {
url = "http:" + url;
}
try {
var parsed = new URL(url);
return {
domain: parsed.hostname,
hostname: parsed.hostname
}
} catch(error) {
return {
domain: "",
hostname: ""
}
}
}
};
// tld.js
// util.js
var utils = {
extractHostFromURL: function(url, shouldKeepWWW) {
if (!url) return ''
let urlObj = tldjs.parse(url)
let hostname = urlObj.hostname || ''
if (!shouldKeepWWW) {
hostname = hostname.replace(/^www\./, '')
}
return hostname
}
};
// util.js
// Base64
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/
var Base64 = {
// private property
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
// public method for encoding
encode : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = Base64._utf8_encode(input);
while (i < input.length) {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output +
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
}
return output;
},
// private method for UTF-8 encoding
_utf8_encode : function (string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
},
}
// Base64
// Buffer
class Buffer {
static from(string, type) {
return new Buffer(string);
}
constructor(string) {
this.string = string;
}
toString(type) {
return Base64.encode(this.string)
}
}
// Buffer
// trackers.js - https://raw.githubusercontent.com/duckduckgo/privacy-grade/298ddcbdd9d55808233643d90639578cd063a439/src/classes/trackers.js
(function () {
class Trackers {
constructor (ops) {
this.tldjs = ops.tldjs
this.utils = ops.utils
}
setLists (lists) {
lists.forEach(list => {
if (list.name === 'tds') {
this.entityList = this.processEntityList(list.data.entities)
this.trackerList = this.processTrackerList(list.data.trackers)
this.domains = list.data.domains
} else if (list.name === 'surrogates') {
this.surrogateList = this.processSurrogateList(list.data)
}
})
}
processTrackerList (data) {
for (let name in data) {
if (data[name].rules) {
for (let i in data[name].rules) {
data[name].rules[i].rule = new RegExp(data[name].rules[i].rule, 'ig')
}
}
}
return data
}
processEntityList (data) {
const processed = {}
for (let entity in data) {
data[entity].domains.forEach(domain => {
processed[domain] = entity
})
}
return processed
}
processSurrogateList (text) {
const b64dataheader = 'data:application/javascript;base64,'
const surrogateList = {}
const splitSurrogateList = text.trim().split('\n\n')
splitSurrogateList.forEach(sur => {
// remove comment lines
const lines = sur.split('\n').filter((line) => {
return !(/^#.*/).test(line)
})
// remove first line, store it
const firstLine = lines.shift()
// take identifier from first line
const pattern = firstLine.split(' ')[0].split('/')[1]
const b64surrogate = Buffer.from(lines.join('\n').toString(), 'binary').toString('base64')
surrogateList[pattern] = b64dataheader + b64surrogate
})
return surrogateList
}
getTrackerData (urlToCheck, siteUrl, request, ops) {
ops = ops || {}
if (!this.entityList || !this.trackerList) {
throw new Error('tried to detect trackers before rules were loaded')
}
// single object with all of our requeest and site data split and
// processed into the correct format for the tracker set/get functions.
// This avoids repeat calls to split and util functions.
const requestData = {
ops: ops,
siteUrl: siteUrl,
request: request,
siteDomain: this.tldjs.parse(siteUrl).domain,
siteUrlSplit: this.utils.extractHostFromURL(siteUrl).split('.'),
urlToCheck: urlToCheck,
urlToCheckDomain: this.tldjs.parse(urlToCheck).domain,
urlToCheckSplit: this.utils.extractHostFromURL(urlToCheck).split('.')
}
// finds a tracker definition by iterating over the whole trackerList and finding the matching tracker.
const tracker = this.findTracker(requestData)
if (!tracker) {
return null
}
// finds a matching rule by iterating over the rules in tracker.data and sets redirectUrl.
const matchedRule = this.findRule(tracker, requestData)
const redirectUrl = (matchedRule && matchedRule.surrogate) ? this.surrogateList[matchedRule.surrogate] : false
// sets tracker.exception by looking at tracker.rule exceptions (if any)
const matchedRuleException = matchedRule ? this.matchesRuleDefinition(matchedRule, 'exceptions', requestData) : false
const trackerOwner = this.findTrackerOwner(requestData.urlToCheckDomain)
const websiteOwner = this.findWebsiteOwner(requestData)
const firstParty = (trackerOwner && websiteOwner) ? trackerOwner === websiteOwner : false
const fullTrackerDomain = requestData.urlToCheckSplit.join('.')
const {action, reason} = this.getAction({
firstParty,
matchedRule,
matchedRuleException,
defaultAction: tracker.default,
redirectUrl
})
return {
action,
reason,
firstParty,
redirectUrl,
matchedRule,
matchedRuleException,
tracker,
fullTrackerDomain
}
}
/*
* Pull subdomains off of the reqeust rule and look for a matching tracker object in our data
*/
findTracker (requestData) {
let urlList = Array.from(requestData.urlToCheckSplit)
while (urlList.length > 1) {
let trackerDomain = urlList.join('.')
urlList.shift()
const matchedTracker = this.trackerList[trackerDomain]
if (matchedTracker) {
return matchedTracker
}
}
}
findTrackerOwner (trackerDomain) {
return this.entityList[trackerDomain]
}
/*
* Set parent and first party values on tracker
*/
findWebsiteOwner (requestData) {
// find the site owner
let siteUrlList = Array.from(requestData.siteUrlSplit)
while (siteUrlList.length > 1) {
let siteToCheck = siteUrlList.join('.')
siteUrlList.shift()
if (this.entityList[siteToCheck]) {
return this.entityList[siteToCheck]
}
}
}
/*
* Iterate through a tracker rule list and return the first matching rule, if any.
*/
findRule (tracker, requestData) {
let matchedRule = null
// Find a matching rule from this tracker
if (tracker.rules && tracker.rules.length) {
tracker.rules.some(ruleObj => {
if (this.requestMatchesRule(requestData, ruleObj)) {
matchedRule = ruleObj
return true
}
})
}
return matchedRule
}
requestMatchesRule (requestData, ruleObj) {
if (requestData.urlToCheck.match(ruleObj.rule)) {
if (ruleObj.options) {
return this.matchesRuleDefinition(ruleObj, 'options', requestData)
} else {
return true
}
} else {
return false
}
}
/* Check the matched rule options against the request data
* return: true (all options matched)
*/
matchesRuleDefinition (rule, type, requestData) {
if (!rule[type]) {
return false
}
const ruleDefinition = rule[type]
const matchTypes = (ruleDefinition.types && ruleDefinition.types.length)
? ruleDefinition.types.includes(requestData.request.type) : true
const matchDomains = (ruleDefinition.domains && ruleDefinition.domains.length)
? ruleDefinition.domains.some(domain => domain.match(requestData.siteDomain)) : true
return (matchTypes && matchDomains)
}
getAction (tracker) {
// Determine the blocking decision and reason.
let action, reason
if (tracker.firstParty) {
action = 'ignore'
reason = 'first party'
} else if (tracker.matchedRuleException) {
action = 'ignore'
reason = 'matched rule - exception'
} else if (!tracker.matchedRule && tracker.defaultAction === 'ignore') {
action = 'ignore'
reason = 'default ignore'
} else if (tracker.matchedRule && tracker.matchedRule.action === 'ignore') {
action = 'ignore'
reason = 'matched rule - ignore'
} else if (!tracker.matchedRule && tracker.defaultAction === 'block') {
action = 'block'
reason = 'default block'
} else if (tracker.matchedRule) {
if (tracker.redirectUrl) {
action = 'redirect'
reason = 'matched rule - surrogate'
} else {
action = 'block'
reason = 'matched rule - block'
}
}
return {action, reason}
}
}
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined')
module.exports = Trackers
else
window.Trackers = Trackers
})()
// trackers.js
// surrogates
let surrogates = `
${surrogates}
`
// surrogates
// tracker data set
let trackerData = ${trackerData}
// tracker data set
let blockingEnabled = ${blockingEnabled}
// overrides
Trackers.prototype.findTrackerOwner = function(domain) {
var parts = domain.split(".")
while (parts.length > 1) {
let entityName = trackerData.domains[parts.join(".")]
if (entityName) {
return entityName
}
parts = parts.slice(1)
}
return null;
}
// create an instance to use
let trackers = new Trackers({
tldjs: tldjs,
utils: utils
});
// update algorithm with the data it needs
trackers.setLists([{
name: "tds",
data: trackerData
},
{
name: "surrogates",
data: surrogates
}
]);
let topLevelUrl = getTopLevelURL();
var unprotectedDomain = false;
var domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split(".") : [];
// walk up the domain to see if it's unprotected
while (domainParts && domainParts.length > 1 && !unprotectedDomain) {
let partialDomain = domainParts.join(".")
unprotectedDomain = `
${unprotectedDomains}
`.split("\n").filter(domain => domain.trim() == partialDomain).length > 0;
domainParts.shift()
}
// private
function getTopLevelURL() {
try {
// FROM: https://stackoverflow.com/a/7739035/73479
// FIX: Better capturing of top level URL so that trackers in embedded documents are not considered first party
return new URL(window.location != window.parent.location ? document.referrer : document.location.href)
} catch(error) {
return new URL(location.href)
}
}
var loadedSurrogates = {}
// private
function loadSurrogate(surrogatePattern) {
var s = document.createElement("script")
s.type = "application/javascript"
s.async = true
s.src = trackers.surrogateList[surrogatePattern]
var scripts = document.getElementsByTagName("script")
if (scripts && scripts.length > 0) {
scripts[0].parentNode.insertBefore(s, scripts[0])
}
}
// public
function shouldBlock(trackerUrl, type) {
let startTime = performance.now()
if (!blockingEnabled) {
return false;
}
let result = trackers.getTrackerData(trackerUrl.toString(), topLevelUrl.toString(), {
type: type
}, null);
if (result == null) {
return false;
}
var blocked = false;
if (unprotectedDomain) {
result.reason = "unprotectedDomain";
} else if (result.action !== 'ignore') {
// other actions are "block" or "redirect" - anything that is not ignored should be blocked. Surrogates are handled below since
// we can't do a redirect.
blocked = true;
}
var isSurrogate = !!(result.matchedRule && result.matchedRule.surrogate)
// Tracker blocking is dealt with by content rules
// Only handle surrogates here
if (blocked && isSurrogate) {
if (!loadedSurrogates[result.matchedRule.surrogate]) {
loadSurrogate(result.matchedRule.surrogate)
loadedSurrogates[result.matchedRule.surrogate] = true
}
surrogateInjected({
url: trackerUrl,
blocked: blocked,
reason: result.reason,
isSurrogate: isSurrogate
})
duckduckgoDebugMessaging.signpostEvent({event: "Tracker Blocked",
url: trackerUrl,
time: performance.now() - startTime})
return true
}
return false
}
function processPage() {
[].slice.apply(document.scripts).forEach(function(el) {
if (shouldBlock(el.src, 'SCRIPT')) {
duckduckgoDebugMessaging.log("blocking load")
} else {
duckduckgoDebugMessaging.log("don't block " + el.src);
return
}
});
[].slice.apply(document.images).forEach(function(el) {
// If the image's natural width is zero, then it has not loaded so we
// can assume that it may have been blocked.
if (el.naturalWidth === 0) {
if (shouldBlock(el.src, 'IMG')) {
duckduckgoDebugMessaging.log("blocking load")
} else {
duckduckgoDebugMessaging.log("don't block " + el.src);
return
}
}
});
[].slice.apply(document.querySelectorAll('link')).forEach(function(el) {
if (shouldBlock(el.href, 'LINK')) {
duckduckgoDebugMessaging.log("blocking load")
} else {
duckduckgoDebugMessaging.log("don't block " + el.href);
return
}
});
[].slice.apply(document.querySelectorAll('iframe')).forEach(function(el) {
if (shouldBlock(el.src, 'IFRAME')) {
duckduckgoDebugMessaging.log("blocking load")
} else {
duckduckgoDebugMessaging.log("don't block " + el.src);
return
}
});
scheduleProcessPage()
}
var interval = 1
function scheduleProcessPage() {
interval *= 2
setTimeout(processPage, interval * 1000)
}
// Init
(function() {
duckduckgoDebugMessaging.log("installing load detection")
window.addEventListener("load", function(event) {
processPage()
}, false)
try {
duckduckgoDebugMessaging.log("installing image src detection")
var originalImageSrc = Object.getOwnPropertyDescriptor(Image.prototype, 'src')
Object.defineProperty(Image.prototype, 'src', {
writable: true, // Needs to be writable for the content blocking rules script. Will be locked down in that script
get: function() {
return originalImageSrc.get.call(this)
},
set: function(value) {
var instance = this
if (shouldBlock(value, "image")) {
duckduckgoDebugMessaging.log("blocking image src: " + value)
} else {
originalImageSrc.set.call(instance, value);
duckduckgoDebugMessaging.log("allowing image src: " + value)
}
}
})
} catch(error) {
duckduckgoDebugMessaging.log("failed to install image src detection")
}
try {
duckduckgoDebugMessaging.log("installing xhr detection")
var xhr = XMLHttpRequest.prototype
var originalOpen = xhr.open
xhr.open = function() {
var args = arguments
var url = arguments[1]
if (shouldBlock(url, "xmlhttprequest")) {
args[1] = "about:blank"
}
duckduckgoDebugMessaging.log("sending xhr " + url + " to " + args[1])
return originalOpen.apply(this, args);
}
} catch(error) {
duckduckgoDebugMessaging.log("failed to install xhr detection")
}
duckduckgoDebugMessaging.log("content blocking initialised")
})()
return {
shouldBlock: shouldBlock
}
})()
|
/* eslint jsx-a11y/no-noninteractive-element-interactions: 0, jsx-a11y/no-noninteractive-tabindex: 0 */
import React, { Component } from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
export default class ShowMore extends Component {
constructor() {
super();
this.state = {
isFocused: false,
isHidden: true
};
}
componentDidMount() {
if (typeof window !== 'undefined') {
window.addEventListener('click', this.close);
window.addEventListener('keydown', this.onKeyDown);
}
}
shouldComponentUpdate(nextProps, nextState) {
const { children, isShown, hasChildSelected } = this.props;
return (
children.length !== nextProps.children.length ||
isShown !== nextProps.isShown ||
hasChildSelected !== nextProps.hasChildSelected ||
this.state !== nextState
);
}
componentWillUnmount() {
if (typeof window !== 'undefined') {
window.removeEventListener('click', this.close);
window.removeEventListener('keydown', this.onKeyDown);
}
}
onFocus = () => this.setState({ isFocused: true });
onBlur = () => this.setState({ isFocused: false });
onKeyDown = event => {
const { isFocused, isHidden } = this.state;
if (event.keyCode === 13) {
if (isFocused) {
this.setState({ isHidden: !isHidden });
} else if (!isHidden) {
this.setState({ isHidden: true });
}
}
};
close = () => {
const { isHidden } = this.state;
if (!isHidden) {
this.setState({ isHidden: true });
}
};
toggleVisibility = event => {
const { isHidden } = this.state;
event.stopPropagation();
this.setState({ isHidden: !isHidden });
};
render() {
const { isShown, children, onShowMoreChanged, hasChildSelected, label } = this.props;
const { isHidden } = this.state;
if (!isShown || !children || !children.length) {
return null;
}
const isListHidden = isHidden;
const showMoreStyles = classNames({
RRT__showmore: true,
'RRT__showmore--selected': hasChildSelected
});
const listStyles = classNames({
'RRT__showmore-list': true,
'RRT__showmore-list--opened': !isListHidden
});
const showMoreLabelStyles = classNames({
'RRT__showmore-label': true,
'RRT__showmore-label--selected': !isListHidden
});
return (
<div
ref={onShowMoreChanged}
className={showMoreStyles}
role="navigation"
tabIndex="0"
onFocus={this.onFocus}
onBlur={this.onBlur}
onClick={this.toggleVisibility}
>
<div className={showMoreLabelStyles}>{label}</div>
<div id={"moreMenuTab-1"} className={listStyles} aria-hidden={isListHidden} role={isListHidden ? "menu-Opened" : "menu-Closed"}>
{children}
</div>
</div>
);
}
}
ShowMore.propTypes = {
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
hasChildSelected: PropTypes.bool,
isShown: PropTypes.bool.isRequired,
onShowMoreChanged: PropTypes.func,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
};
ShowMore.defaultProps = {
children: undefined,
hasChildSelected: false,
label: '...',
onShowMoreChanged: () => null
};
|
var a = 1;
module.exports = function myOtherMod(x) {
return x + a;
};
|
"""
WSGI config for oh_proj_management project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "oh_proj_management.settings")
application = get_wsgi_application()
application = DjangoWhiteNoise(application)
|
module.exports = new Date(2014, 2, 25)
|
"""
Fatture in Cloud API v2 - API Reference
Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. # noqa: E501
The version of the OpenAPI document: 2.0.15
Contact: info@fattureincloud.it
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fattureincloud_python_sdk.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiModel
)
from fattureincloud_python_sdk.exceptions import ApiAttributeError
def lazy_import():
from fattureincloud_python_sdk.model.monthly_total import MonthlyTotal
globals()['MonthlyTotal'] = MonthlyTotal
class GetReceiptsMonthlyTotalsResponse(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
}
validations = {
}
@cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = True
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy_import()
return {
'data': ([MonthlyTotal], none_type,), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {
'data': 'data', # noqa: E501
}
read_only_vars = {
}
_composed_schemas = {}
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
"""GetReceiptsMonthlyTotalsResponse - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
data ([MonthlyTotal], none_type): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
self = super(OpenApiModel, cls).__new__(cls)
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
return self
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""GetReceiptsMonthlyTotalsResponse - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
data ([MonthlyTotal], none_type): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
if var_name in self.read_only_vars:
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
f"class with read only attributes.")
|
import CSSEditor from './CSSEditor';
import './CSSEditor.scss';
export default CSSEditor;
|
import React from 'react'
import PropTypes from 'prop-types'
import { routerRedux } from 'dva/router'
import { connect } from 'dva'
import queryString from 'query-string'
import { Row, Col, Button } from 'antd'
import { Filter } from '../../components/index'
import EngineImageList from './EngineImageList'
import CreateEngineImage from './CreateEngineImage'
import { filterEngineImage } from '../../utils/filter'
class EngineImage extends React.Component {
render() {
const { dispatch, loading, location } = this.props
const { data, createEngineImageModalVisible, createEngineImageModalKey } = this.props.engineimage
const { field, value } = queryString.parse(this.props.location.search)
let engineimages = data
if (field && value) {
engineimages = filterEngineImage(data, field, value)
}
const engineImageListProps = {
dataSource: engineimages,
loading,
deleteEngineImage(record) {
dispatch({
type: 'engineimage/delete',
payload: record,
})
},
}
const createEngineImageModalProps = {
item: {
image: '',
},
visible: createEngineImageModalVisible,
onOk(newEngineImage) {
dispatch({
type: 'engineimage/create',
payload: newEngineImage,
})
},
onCancel() {
dispatch({
type: 'engineimage/hideCreateEngineImageModal',
})
dispatch({
type: 'app/changeBlur',
payload: false,
})
},
}
const engineImageFilterProps = {
location,
defaultField: 'image',
fieldOption: [
{ value: 'image', name: 'Image' },
],
onSearch(filter) {
const { field: filterField, value: filterValue } = filter
filterField && filterValue ? dispatch(routerRedux.push({
pathname: '/engineimage',
search: queryString.stringify({
...queryString.parse(location.search),
field: filterField,
value: filterValue,
}),
})) : dispatch(routerRedux.push({
pathname: '/engineimage',
search: queryString.stringify({}),
}))
},
}
const addEngineImage = () => {
dispatch({
type: 'engineimage/showCreateEngineImageModal',
})
this.setState({
CreateEngineImageGen() {
return <CreateEngineImage {...createEngineImageModalProps} />
},
})
}
return (
<div className="content-inner">
<Row gutter={24}>
<Col lg={{ offset: 18, span: 6 }} md={{ offset: 16, span: 8 }} sm={24} xs={24} style={{ marginBottom: 16 }}>
<Filter {...engineImageFilterProps} />
</Col>
</Row>
<Button style={{ position: 'absolute', top: '-50px', right: '0px' }} size="large" type="primary" onClick={addEngineImage}>Deploy Engine Image</Button>
<EngineImageList {...engineImageListProps} />
{ createEngineImageModalVisible ? <CreateEngineImage key={createEngineImageModalKey} {...createEngineImageModalProps} /> : ''}
</div>
)
}
}
EngineImage.propTypes = {
engineimage: PropTypes.object,
loading: PropTypes.bool,
location: PropTypes.object,
dispatch: PropTypes.func,
}
export default connect(({ engineimage, loading }) => ({ engineimage, loading: loading.models.engineimage }))(EngineImage)
|
const nav = require('./utils/nav').default
const sidebar = require('./utils/sidebar').default
const i18n = {
path: '/',
guide: '教程',
changelog: '更新日志',
essentials: '基础',
advanced: '进阶'
}
// 站点配置
exports.default = {
lang: 'zh-CN',
title: 'Vue Router Tab',
description: '基于 Vue Router 的路由页签组件'
}
// 主题配置
exports.theme = {
// 多语言下拉菜单的标题
selectText: 'Languages',
// 该语言在下拉菜单中的标签
label: '简体中文',
// 编辑链接文字
editLinkText: '在 GitHub 上编辑此页',
lastUpdated: '上次更新',
// 页头导航
nav: nav(i18n),
// 侧边栏
sidebar: sidebar(i18n)
}
|
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Ordnance Survey Grid Reference functions (c) Chris Veness 2005-2019 */
/* MIT Licence */
/* www.movable-type.co.uk/scripts/latlong-gridref.html */
/* www.movable-type.co.uk/scripts/geodesy-library.html#osgridref */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
import LatLonEllipsoidal, { Dms } from "./latlon-ellipsoidal-datum.js";
/**
* Ordnance Survey OSGB grid references provide geocoordinate references for UK mapping purposes.
*
* Formulation implemented here due to Thomas, Redfearn, etc is as published by OS, but is inferior
* to Krüger as used by e.g. Karney 2011.
*
* www.ordnancesurvey.co.uk/docs/support/guide-coordinate-systems-great-britain.pdf.
*
* Note OSGB grid references cover Great Britain only; Ireland and the Channel Islands have their
* own references.
*
* Note that these formulae are based on ellipsoidal calculations, and according to the OS are
* accurate to about 4–5 metres – for greater accuracy, a geoid-based transformation (OSTN15) must
* be used.
*/
/*
* Converted 2015 to work with WGS84 by default, OSGB36 as option;
* www.ordnancesurvey.co.uk/blog/2014/12/confirmation-on-changes-to-latitude-and-longitude
*/
/* OsGridRef - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/**
* OS grid references with methods to parse and convert them to latitude/longitude points.
*
* @module osgridref
*/
class OsGridRef {
/**
* Creates an OsGridRef object.
*
* @param {number} easting - Easting in metres from OS false origin.
* @param {number} northing - Northing in metres from OS false origin.
*
* @example
* import OsGridRef from '/js/geodesy/osgridref.js';
* const gridref = new OsGridRef(651409, 313177);
*/
constructor(easting, northing) {
this.easting = Number(easting);
this.northing = Number(northing);
//Rather than throw an error return NA.
if (isNaN(easting) || this.easting < 0 || this.easting > 700e3)
return "NA";
if (isNaN(northing) || this.northing < 0 || this.northing > 1300e3)
return "NA";
}
/**
* Converts ‘this’ Ordnance Survey grid reference easting/northing coordinate to latitude/longitude
* (SW corner of grid square).
*
* While OS grid references are based on OSGB-36, the Ordnance Survey have deprecated the use of
* OSGB-36 for latitude/longitude coordinates (in favour of WGS-84), hence this function returns
* WGS-84 by default, with OSGB-36 as an option. See www.ordnancesurvey.co.uk/blog/2014/12/2.
*
* Note formulation implemented here due to Thomas, Redfearn, etc is as published by OS, but is
* inferior to Krüger as used by e.g. Karney 2011.
*
* @param {LatLon.datum} [datum=WGS84] - Datum to convert grid reference into.
* @returns {LatLon} Latitude/longitude of supplied grid reference.
*
* @example
* const gridref = new OsGridRef(651409.903, 313177.270);
* const pWgs84 = gridref.toLatLon(); // 52°39′28.723″N, 001°42′57.787″E
* // to obtain (historical) OSGB36 lat/lon point:
* const pOsgb = gridref.toLatLon(LatLon.datums.OSGB36); // 52°39′27.253″N, 001°43′04.518″E
*/
toLatLon(datum = LatLonEllipsoidal.datums.WGS84) {
const { easting: E, northing: N } = this;
const a = 6377563.396,
b = 6356256.909; // Airy 1830 major & minor semi-axes
const F0 = 0.9996012717; // NatGrid scale factor on central meridian
const φ0 = (49).toRadians(),
λ0 = (-2).toRadians(); // NatGrid true origin is 49°N,2°W
const N0 = -100e3,
E0 = 400e3; // northing & easting of true origin, metres
const e2 = 1 - (b * b) / (a * a); // eccentricity squared
const n = (a - b) / (a + b),
n2 = n * n,
n3 = n * n * n; // n, n², n³
let φ = φ0,
M = 0;
do {
φ = (N - N0 - M) / (a * F0) + φ;
const Ma = (1 + n + (5 / 4) * n2 + (5 / 4) * n3) * (φ - φ0);
const Mb =
(3 * n + 3 * n * n + (21 / 8) * n3) *
Math.sin(φ - φ0) *
Math.cos(φ + φ0);
const Mc =
((15 / 8) * n2 + (15 / 8) * n3) *
Math.sin(2 * (φ - φ0)) *
Math.cos(2 * (φ + φ0));
const Md =
(35 / 24) *
n3 *
Math.sin(3 * (φ - φ0)) *
Math.cos(3 * (φ + φ0));
M = b * F0 * (Ma - Mb + Mc - Md); // meridional arc
} while (Math.abs(N - N0 - M) >= 0.00001); // ie until < 0.01mm
const cosφ = Math.cos(φ),
sinφ = Math.sin(φ);
const ν = (a * F0) / Math.sqrt(1 - e2 * sinφ * sinφ); // nu = transverse radius of curvature
const ρ = (a * F0 * (1 - e2)) / Math.pow(1 - e2 * sinφ * sinφ, 1.5); // rho = meridional radius of curvature
const η2 = ν / ρ - 1; // eta = ?
const tanφ = Math.tan(φ);
const tan2φ = tanφ * tanφ,
tan4φ = tan2φ * tan2φ,
tan6φ = tan4φ * tan2φ;
const secφ = 1 / cosφ;
const ν3 = ν * ν * ν,
ν5 = ν3 * ν * ν,
ν7 = ν5 * ν * ν;
const VII = tanφ / (2 * ρ * ν);
const VIII =
(tanφ / (24 * ρ * ν3)) * (5 + 3 * tan2φ + η2 - 9 * tan2φ * η2);
const IX = (tanφ / (720 * ρ * ν5)) * (61 + 90 * tan2φ + 45 * tan4φ);
const X = secφ / ν;
const XI = (secφ / (6 * ν3)) * (ν / ρ + 2 * tan2φ);
const XII = (secφ / (120 * ν5)) * (5 + 28 * tan2φ + 24 * tan4φ);
const XIIA =
(secφ / (5040 * ν7)) *
(61 + 662 * tan2φ + 1320 * tan4φ + 720 * tan6φ);
const dE = E - E0,
dE2 = dE * dE,
dE3 = dE2 * dE,
dE4 = dE2 * dE2,
dE5 = dE3 * dE2,
dE6 = dE4 * dE2,
dE7 = dE5 * dE2;
φ = φ - VII * dE2 + VIII * dE4 - IX * dE6;
const λ = λ0 + X * dE - XI * dE3 + XII * dE5 - XIIA * dE7;
let point = new LatLon_OsGridRef(
φ.toDegrees(),
λ.toDegrees(),
0,
LatLonEllipsoidal.datums.OSGB36
);
if (datum != LatLonEllipsoidal.datums.OSGB36) {
// if point is required in datum other than OSGB36, convert it
point = point.convertDatum(datum);
// convertDatum() gives us a LatLon: convert to LatLon_OsGridRef which includes toOsGrid()
point = new LatLon_OsGridRef(
point.lat,
point.lon,
point.height,
point.datum
);
}
return point;
}
/**
* Parses grid reference to OsGridRef object.
*
* Accepts standard grid references (eg 'SU 387 148'), with or without whitespace separators, from
* two-digit references up to 10-digit references (1m × 1m square), or fully numeric comma-separated
* references in metres (eg '438700,114800').
*
* @param {string} gridref - Standard format OS grid reference.
* @returns {OsGridRef} Numeric version of grid reference in metres from false origin (SW corner of
* supplied grid square).
* @throws {Error} Invalid grid reference.
*
* @example
* const grid = OsGridRef.parse('TG 51409 13177'); // grid: { easting: 651409, northing: 313177 }
*/
static parse(gridref) {
gridref = String(gridref).trim();
// check for fully numeric comma-separated gridref format
let match = gridref.match(/^(\d+),\s*(\d+)$/);
if (match) return new OsGridRef(match[1], match[2]);
// validate format
match = gridref.match(/^[A-Z]{2}\s*[0-9]+\s*[0-9]+$/i);
if (!match) throw new Error(`invalid grid reference ‘${gridref}’`);
// get numeric values of letter references, mapping A->0, B->1, C->2, etc:
let l1 = gridref.toUpperCase().charCodeAt(0) - "A".charCodeAt(0);
let l2 = gridref.toUpperCase().charCodeAt(1) - "A".charCodeAt(0);
// shuffle down letters after 'I' since 'I' is not used in grid:
if (l1 > 7) l1--;
if (l2 > 7) l2--;
// sanity check
if (l1 < 8 || l1 > 18)
throw new Error(`invalid grid reference ‘${gridref}’`);
// convert grid letters into 100km-square indexes from false origin (grid square SV):
const e100km = ((l1 - 2) % 5) * 5 + (l2 % 5);
const n100km = 19 - Math.floor(l1 / 5) * 5 - Math.floor(l2 / 5);
// skip grid letters to get numeric (easting/northing) part of ref
let en = gridref
.slice(2)
.trim()
.split(/\s+/);
// if e/n not whitespace separated, split half way
if (en.length == 1)
en = [
en[0].slice(0, en[0].length / 2),
en[0].slice(en[0].length / 2)
];
// validation
if (en[0].length != en[1].length)
throw new Error(`invalid grid reference ‘${gridref}’`);
// standardise to 10-digit refs (metres)
en[0] = en[0].padEnd(5, "0");
en[1] = en[1].padEnd(5, "0");
const e = e100km + en[0];
const n = n100km + en[1];
return new OsGridRef(e, n);
}
/**
* Converts ‘this’ numeric grid reference to standard OS grid reference.
*
* @param {number} [digits=10] - Precision of returned grid reference (10 digits = metres);
* digits=0 will return grid reference in numeric format.
* @returns {string} This grid reference in standard format.
*
* @example
* const gridref = new OsGridRef(651409, 313177).toString(8); // 'TG 5140 1317'
* const gridref = new OsGridRef(651409, 313177).toString(0); // '651409,313177'
*/
toString(digits = 10) {
if (![0, 2, 4, 6, 8, 10, 12, 14, 16].includes(Number(digits)))
throw new RangeError(`invalid precision ‘${digits}’`); // eslint-disable-line comma-spacing
let { easting: e, northing: n } = this;
// use digits = 0 to return numeric format (in metres) - note northing may be >= 1e7
if (digits == 0) {
const format = {
useGrouping: false,
minimumIntegerDigits: 6,
maximumFractionDigits: 3
};
const ePad = e.toLocaleString("en", format);
const nPad = n.toLocaleString("en", format);
return `${ePad},${nPad}`;
}
// get the 100km-grid indices
const e100km = Math.floor(e / 100000),
n100km = Math.floor(n / 100000);
// translate those into numeric equivalents of the grid letters
let l1 =
19 - n100km - ((19 - n100km) % 5) + Math.floor((e100km + 10) / 5);
let l2 = (((19 - n100km) * 5) % 25) + (e100km % 5);
// compensate for skipped 'I' and build grid letter-pairs
if (l1 > 7) l1++;
if (l2 > 7) l2++;
const letterPair = String.fromCharCode(
l1 + "A".charCodeAt(0),
l2 + "A".charCodeAt(0)
);
// strip 100km-grid indices from easting & northing, and reduce precision
e = Math.floor((e % 100000) / Math.pow(10, 5 - digits / 2));
n = Math.floor((n % 100000) / Math.pow(10, 5 - digits / 2));
// pad eastings & northings with leading zeros
e = e.toString().padStart(digits / 2, "0");
n = n.toString().padStart(digits / 2, "0");
return `${letterPair} ${e} ${n}`;
}
}
/* LatLon_OsGridRef - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/**
* Extends LatLon class with method to convert LatLon point to OS grid reference.
*
* @extends LatLon
*/
class LatLon_OsGridRef extends LatLonEllipsoidal {
/**
* Converts latitude/longitude to Ordnance Survey grid reference easting/northing coordinate.
*
* @returns {OsGridRef} OS Grid Reference easting/northing.
*
* @example
* const grid = new LatLon(52.65798, 1.71605).toOsGrid(); // TG 51409 13177
* // for conversion of (historical) OSGB36 latitude/longitude point:
* const grid = new LatLon(52.65798, 1.71605).toOsGrid(LatLon.datums.OSGB36);
*/
toOsGrid() {
// if necessary convert to OSGB36 first
const point =
this.datum == LatLonEllipsoidal.datums.OSGB36
? this
: this.convertDatum(LatLonEllipsoidal.datums.OSGB36);
const φ = point.lat.toRadians();
const λ = point.lon.toRadians();
const a = 6377563.396,
b = 6356256.909; // Airy 1830 major & minor semi-axes
const F0 = 0.9996012717; // NatGrid scale factor on central meridian
const φ0 = (49).toRadians(),
λ0 = (-2).toRadians(); // NatGrid true origin is 49°N,2°W
const N0 = -100000,
E0 = 400000; // northing & easting of true origin, metres
const e2 = 1 - (b * b) / (a * a); // eccentricity squared
const n = (a - b) / (a + b),
n2 = n * n,
n3 = n * n * n; // n, n², n³
const cosφ = Math.cos(φ),
sinφ = Math.sin(φ);
const ν = (a * F0) / Math.sqrt(1 - e2 * sinφ * sinφ); // nu = transverse radius of curvature
const ρ = (a * F0 * (1 - e2)) / Math.pow(1 - e2 * sinφ * sinφ, 1.5); // rho = meridional radius of curvature
const η2 = ν / ρ - 1; // eta = ?
const Ma = (1 + n + (5 / 4) * n2 + (5 / 4) * n3) * (φ - φ0);
const Mb =
(3 * n + 3 * n * n + (21 / 8) * n3) *
Math.sin(φ - φ0) *
Math.cos(φ + φ0);
const Mc =
((15 / 8) * n2 + (15 / 8) * n3) *
Math.sin(2 * (φ - φ0)) *
Math.cos(2 * (φ + φ0));
const Md =
(35 / 24) * n3 * Math.sin(3 * (φ - φ0)) * Math.cos(3 * (φ + φ0));
const M = b * F0 * (Ma - Mb + Mc - Md); // meridional arc
const cos3φ = cosφ * cosφ * cosφ;
const cos5φ = cos3φ * cosφ * cosφ;
const tan2φ = Math.tan(φ) * Math.tan(φ);
const tan4φ = tan2φ * tan2φ;
const I = M + N0;
const II = (ν / 2) * sinφ * cosφ;
const III = (ν / 24) * sinφ * cos3φ * (5 - tan2φ + 9 * η2);
const IIIA = (ν / 720) * sinφ * cos5φ * (61 - 58 * tan2φ + tan4φ);
const IV = ν * cosφ;
const V = (ν / 6) * cos3φ * (ν / ρ - tan2φ);
const VI =
(ν / 120) *
cos5φ *
(5 - 18 * tan2φ + tan4φ + 14 * η2 - 58 * tan2φ * η2);
const Δλ = λ - λ0;
const Δλ2 = Δλ * Δλ,
Δλ3 = Δλ2 * Δλ,
Δλ4 = Δλ3 * Δλ,
Δλ5 = Δλ4 * Δλ,
Δλ6 = Δλ5 * Δλ;
let N = I + II * Δλ2 + III * Δλ4 + IIIA * Δλ6;
let E = E0 + IV * Δλ + V * Δλ3 + VI * Δλ5;
N = Number(N.toFixed(3)); // round to mm precision
E = Number(E.toFixed(3));
return new OsGridRef(E, N); // gets truncated to SW corner of 1m grid square
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
export { OsGridRef as default, LatLon_OsGridRef as LatLon, Dms };
|
export const featureWithScenarioTags = `@search @google
Feature: Google Search
As an internet user
In order to find out more about Keg-Hub
# Test comment in the feature meta
I want to be able to search for information about the Keg-Hub
@scenario
Scenario: Search the web for google
Given I open the site https://www.google.com
When I set keg-hub to the input .gLFyf
When I press enter
# comment for testing in the scenario steps
When I wait for the page to load
Then the element #search contains the text KegHub/keg-hub`
|
const bcrypt = require('bcrypt');
const commander = require('./commander');
const Emitter = require('events').EventEmitter;
const m = require('../models');
const redis = require('redis');
const roli = require('roli');
const WS = require('uws');
const reg = (message, client) =>
message.replace(/:([\w]+):/g, (match, property) => client.current[property] || match);
const closeSocket = (data, socket) => {
const socketData = typeof data === 'string' ? { message: data } : data;
socketData.channel = socket.current.channel;
socketData.message = reg(socketData.message, socket);
socket.close(1011, JSON.stringify(socketData));
socket.current = null;
return null;
};
const socketState = async (socket, channel) => {
if (!socket.current.session) {
return closeSocket('You need a valid session.', socket);
}
const plainPassword = socket.current.password;
socket.current.password = socket.current.password
? await bcrypt.hash(socket.current.password, 12)
: null;
if (channel.connectedUsers.length === channel.maxUsers) {
return closeSocket('This channel does not accept more users.', socket);
}
if (channel.password) {
if (!socket.current.password) {
return closeSocket('This is a private channel; you need a password.', socket);
}
const match = await bcrypt.compare(plainPassword, channel.password);
if (!match) {
return closeSocket("Your password does not match this channel's.", socket);
}
}
if (channel.connectedUsers.find((user) => user.user === socket.current.user)) {
return closeSocket('This username (:user:) is already in use in this channel.', socket);
}
return true;
};
class Whir extends Emitter {
constructor({ port, redisConf }) {
super();
this.wss = new WS.Server({ port }, () => {
this.emit('info', `Whir: Listening on port ${port}`);
});
try {
this.redis = redis.createClient(redisConf.url || redisConf);
this.redis.prefix = redisConf.prefix;
this.redis.on('error', (error) => {
const message = error.origin ? error.origin.message : error.message;
this.emit('error', `Redis: ${message}`);
});
this.redis.on('warning', (error) => {
this.emit('warning', error);
});
commander.redis = this.redis;
this.serverEvents();
} catch (error) {
this.emit('error', `Redis: ${error.message}`);
}
}
serverEvents() {
this.wss.on('connection', async (socket) => {
this.socketEvents(socket);
const channel = await m.channel.connect(socket.current);
if (!(await socketState(socket, channel))) {
return null;
}
channel.connectedUsers.push(socket.current);
await channel.save();
this.redis.zadd(socket.current.channel, 'NX', 1, 'channelMessages');
this.send(
{
message: 'Welcome to the _:channel:_ channel!',
currentUsers: channel.connectedUsers
.map((user) => {
const current = user.user;
return current !== socket.current.user ? current : null;
})
.filter((user) => user)
},
socket
);
this.broadcast({ message: '-I joined the channel.-', action: 'join' }, socket);
return true;
});
this.wss.on('close', (socket) => {
this.emit('info', `A socket has been closed: ${socket}`);
});
}
socketEvents(socket) {
socket.current = {
channel: socket.upgradeReq.headers['x-whir-channel'] || roli({ case: 'lower' }),
user: socket.upgradeReq.headers['x-whir-user'],
password: socket.upgradeReq.headers['x-whir-pass'] || null,
session: socket.upgradeReq.headers['x-whir-session'] || null
};
socket.on('message', this.messageHandler.bind(this, socket));
socket.on('close', async () => {
if (!socket.current) {
return;
}
await m.channel.removeUser(socket.current);
this.broadcast(
{
user: socket.current.user,
message: '-I left the channel.-',
action: 'leave'
},
socket
);
});
}
async messageHandler(socket, data) {
try {
const payload = Buffer.from(data).toString('utf8');
let parsedData = JSON.parse(payload);
if (parsedData.message.match(/^\/[\w]/)) {
parsedData = await commander.run(socket.current, parsedData.message);
return this.send(parsedData, socket);
}
return this.broadcast(parsedData, socket);
} catch (error) {
return this.emit('error', `Incoming message: ${error.message}`);
}
}
send(data, client) {
data.channel = client.current.channel;
if (data.alert) {
data.message = data.alert;
data.alert = true;
}
data.message = reg(data.message, client);
client.send(JSON.stringify(data), { binary: true, mask: true }, (error) => {
if (error) {
this.emit('error', `Outgoing message: ${error.message}`);
}
});
return this;
}
/**
* Broadcast a message to all connected clients, except the
* one initiating the request.
*
* @param data - The data being broadcast.
* @param client - The current client.
*/
broadcast(data, client) {
if (this.wss && this.wss.clients) {
if (this.redis) {
this.redis.zincrby(client.current.channel, 1, 'channelMessages');
this.redis.zincrby(client.current.channel, 1, client.current.user);
}
this.wss.clients.forEach((socket) => {
if (socket.current.channel === client.current.channel && socket !== client) {
data.user = client.current.user;
this.send(data, socket);
}
});
}
}
}
module.exports = Whir;
|
"""
Module: libfmp.c4.c4s4_novelty_kernel
Author: Meinard Müller, Julian Reck
License: The MIT license, https://opensource.org/licenses/MIT
This file is part of the FMP Notebooks (https://www.audiolabs-erlangen.de/FMP)
"""
import numpy as np
from numba import jit
def compute_kernel_checkerboard_box(L):
"""Compute box-like checkerboard kernel [FMP, Section 4.4.1]
Notebook: C4/C4S4_NoveltySegmentation.ipynb
Args:
L: Parameter specifying the kernel size 2*L+1
Returns:
kernel: Kernel matrix of size (2*L+1) x (2*L+1)
"""
axis = np.arange(-L, L+1)
kernel = np.outer(np.sign(axis), np.sign(axis))
return kernel
@jit(nopython=True)
def compute_kernel_checkerboard_gaussian(L, var=1, normalize=True):
"""Compute Guassian-like checkerboard kernel [FMP, Section 4.4.1]
See also: https://scipython.com/blog/visualizing-the-bivariate-gaussian-distribution/
Notebook: C4/C4S4_NoveltySegmentation.ipynb
Args:
L: Parameter specifying the kernel size M=2*L+1
var: Variance parameter determing the tapering (epsilon)
Returns:
kernel: Kernel matrix of size M x M
"""
taper = np.sqrt(1/2) / (L * var)
axis = np.arange(-L, L+1)
gaussian1D = np.exp(-taper**2 * (axis**2))
gaussian2D = np.outer(gaussian1D, gaussian1D)
kernel_box = np.outer(np.sign(axis), np.sign(axis))
kernel = kernel_box * gaussian2D
if normalize:
kernel = kernel / np.sum(np.abs(kernel))
return kernel
# @jit(nopython=True)
def compute_novelty_ssm(S, kernel=None, L=10, var=0.5, exclude=False):
"""Compute novelty function from SSM [FMP, Section 4.4.1]
Notebook: C4/C4S4_NoveltySegmentation.ipynb
Args:
S: SSM
kernel: Checkerboard kernel (if kernel==None, it will be computed)
L: Parameter specifying the kernel size M=2*L+1
var: Variance parameter determing the tapering (epsilon)
exclude: Sets the first L and last L values of novelty function to zero
Returns:
nov: Novelty function
"""
if kernel is None:
kernel = compute_kernel_checkerboard_gaussian(L=L, var=var)
N = S.shape[0]
M = 2*L + 1
nov = np.zeros(N)
# np.pad does not work with numba/jit
S_padded = np.pad(S, L, mode='constant')
for n in range(N):
# Does not work with numba/jit
nov[n] = np.sum(S_padded[n:n+M, n:n+M] * kernel)
if exclude:
right = np.min([L, N])
left = np.max([0, N-L])
nov[0:right] = 0
nov[left:N] = 0
return nov
|
import numpy as np
from .pymatlab import isempty, length, size
from .qpcplexopt import cvxlpbnd
def scale(H, f, A, Aeq, UB, idxU):
# SCALE scales the part of UB indexed by 'idxU' to 1, assuming that LB(idxU)==0
m, _ = A.shape
n, _ = H.shape
meq, _ = Aeq.shape
if idxU.size > 0:
idxUc = np.setdiff1d(np.arange(n), idxU)
ub = UB[idxU]
H[np.ix_(idxU, idxU)] = np.diag(ub) @ H[np.ix_(idxU, idxU)] @ np.diag(ub)
H[np.ix_(idxUc, idxU)] = H[np.ix_(idxUc, idxU)] @ np.diag(ub)
H[np.ix_(idxU, idxUc)] = np.diag(ub) @ H[np.ix_(idxU, idxUc)]
f[idxU] = np.multiply(ub, f[idxU])
if m > 0:
A[:, idxU] = A[:, idxU] @ np.diag(ub)
if meq > 0:
Aeq[:, idxU] = Aeq[:, idxU] @ np.diag(ub)
UB[idxU] = 1
return H, A, Aeq, f, UB
def shift(H, f, A, b, Aeq, beq, LB, UB, cons, idxL):
# SHIFT shifts L(idxL) to zero.
m, _ = A.shape
n, _ = H.shape
meq, _ = Aeq.shape
if idxL.size > 0:
idxLc = np.setdiff1d(np.arange(n), idxL)
lb = LB[idxL]
cons = cons + 0.5 * np.transpose(lb) @ H[np.ix_(idxL, idxL)] @ lb + np.transpose(f[idxL]) @ lb
f[idxL] = f[idxL] + H[np.ix_(idxL, idxL)] @ lb
# if idxLc is empty, then dimension will not agree on the following equations
# so add a check here
if idxLc.size > 0:
f[idxLc] = f[idxLc] + H[np.ix_(idxL, idxL)] @ lb
if m > 0:
b = b - A[:, idxL] @ lb
if meq > 0:
beq = beq - Aeq[:, idxL] @ lb
UB[idxL] = UB[idxL] - lb
LB[idxL] = 0
return f, b, beq, LB, UB, cons
def checkinputs(H, LB, UB):
n, p = H.shape
if LB.ndim > 1 or UB.ndim > 1:
raise Exception('Both LB and UB must be column vectors.')
lp, = LB.shape
up, = UB.shape
if lp != up:
raise Exception('Both LB and UB must have dimension.')
if n * p == 0 or np.linalg.norm(H, ord='fro') == 0:
raise Exception('H should be nonzero.')
if np.any(UB < LB):
raise Exception('Need UB >= LB.')
def getsol(x, sstruct):
# it reverse the transformation made, and return the solution to the original problem
if not isempty(x):
x = x[0:sstruct["n"]]
else:
x = sstruct["xx"]
if isempty(x):
x = x[0:sstruct["n"]]
if sstruct.flag == 0:
x = (sstruct["ub6"] - sstruct["lb6"]) * x + sstruct["lb6"]
if not isempty(sstruct["idxU5"]):
x[sstruct["idxU5"]] = sstruct["ub5"] * x[sstruct["idxU5"]]
if not isempty(sstruct["idxL5"]):
x[sstruct["idxL5"]] = x[sstruct["idxL5"]] + sstruct["lb5"]
if not isempty(sstruct["idxU4"]):
x[sstruct["idxU4"]] = sstruct["ub4"] * x[sstruct["idxU4"]]
if not isempty(sstruct["idxL3"]):
x[sstruct["idxL3"]] = x[sstruct["idxL3"]] + sstruct["lb3"]
if not isempty(sstruct["idxU2"]):
x[sstruct["idxU2"]] = sstruct["ub2"] - x[sstruct["idxU2"]]
if not isempty(sstruct["fx1"]):
lenn = length(sstruct["fx1"]) + length(x)
y = np.zeros(lenn)
y[sstruct["fx1"]] = sstruct["fxval1"]
y[np.setdiff1d(np.arange(lenn), sstruct["fx1"])] = x
x = y
return x
def fixedAb(A, b, L, U):
tol = 1.0e-15
m, n = size(A, None)
local_A = A
local_b = b
I = np.where(abs(U - L) < tol)[0]
for i in range(length(I)):
j = I[i]
local_b = local_b - U[j] * local_A[:, j]
local_A[:, j] = np.zeros((m, 1))
tmp = np.eye(n)
tmp = tmp[I, :]
local_A = np.concatenate((local_A, tmp), axis=0)
local_b = np.concatenate((local_b, U[I]), axis=0)
return local_A, local_b
def isfeasible(A, b, L, U):
m, n = size(A, None)
# cplexopts = cplexoptimset('Display', 'off');
# [x, tmp, exitflag, output] = cplexlp(zeros(n, 1), [], [], A, b, L, U, [], cplexopts);
# cvxlpbnd(c, A, lb, ub, lhs, rhs, Aeq=[], beq=[], solver=None):
solution = cvxlpbnd(np.zeros((n, 1)), np.array([]), L, U, np.array([]), np.array([]), A, b)
# solstat
if solution['status'] != 'optimal':
yes_or_no = False
else:
yes_or_no = True
return yes_or_no
|
const PlaybackStrategy = {
MSE: 'msestrategy',
HYBRID: 'hybridstrategy',
NATIVE: 'nativestrategy',
BASIC: 'basicstrategy'
}
export default PlaybackStrategy
|
import { useState, useEffect, useContext } from 'react';
import {
Box,
Button,
Card,
CardContent,
CardHeader,
Divider,
Grid,
TextField
} from '@mui/material';
import {useFormik} from 'formik';
import {useRouter} from "next/router";
import {useWarningProvider} from "../../providers/contexts/WarningContext";
import * as Yup from 'yup';
import api from "../../providers/services/api"
import {parseCookies} from "nookies";
export const AccountProfileDetails = (props) => {
const {emitMessage} = useWarningProvider()
const router = useRouter();
// const getData = () => {
// api.get("/auth/user").then(response => {
// setValues(response.data)
// }).catch(error => {
// console.log(error);
// const {"forense-refresh-token": refreshToken} = parseCookies();
// api.post("/auth/token/refresh/", {"refresh": refreshToken}).then(response => {
// const {"access": token} = response.data
// api.defaults.headers["Authorization"] = `Bearer ${token}`
// api.get("/auth/user").then(response => {
// setValues(response.data)
// })
// })
// })
// }
const getData = () => {
api.get("/auth/me/").then(response => {
setValues(response.data)
});
}
const [values, setValues] = useState({
first_name: "",
last_name: "",
email: "",
phone_number: "",
});
const formik = useFormik({
initialValues: values,
enableReinitialize: true,
onSubmit: (values) => {
putData(values);
}
})
useEffect(() => {
getData();
}, []);
const putData = (values) => {
api.put("/auth/me/", values).then(response => {
console.log(response.data)
emitMessage("success", "Atualizado com sucesso")
setTimeout(() => {
router.push("/")
}, 1000);
}).catch(err => {
emitMessage("error", "Erro ao atualizar os dados")
setTimeout(() => {
router.reload();
}, 1000)
console.log(err)
}) ;
}
const patchData = (values) => {
api.patch("/auth/me/", values).then(response => {
console.log(response.data)
}).catch(err => {
emitMessage("error", "Erro ao atualizar os dados")
setTimeout(() => {
router.reload();
}, 1000);
console.log(err);
})
}
return (
<form
onSubmit={formik.handleSubmit}
>
<Card>
<CardHeader
title="Perfil"
/>
<Divider />
<CardContent>
<Grid
container
spacing={3}
>
<Grid
item
md={6}
xs={12}
>
<TextField
fullWidth
error={Boolean(formik.touched.first_name && formik.errors.first_name)}
helperText={formik.touched.first_name && formik.errors.first_name}
label="Nome"
name="first_name"
onChange={formik.handleChange}
onBlur={formik.handleBlur}
value={formik.values.first_name}
variant="outlined"
/>
</Grid>
<Grid
item
md={6}
xs={12}
>
<TextField
fullWidth
error={Boolean(formik.touched.last_name && formik.errors.last_name)}
helperText={formik.touched.last_name && formik.errors.last_name}
label="Sobrenome"
name="last_name"
onChange={formik.handleChange}
onBlur={formik.handleBlur}
value={formik.values.last_name}
variant="outlined"
/>
</Grid>
<Grid
item
md={6}
xs={12}
>
<TextField
fullWidth
disabled
label="Email"
error={Boolean(formik.touched.email && formik.errors.email)}
helperText={formik.touched.email && formik.errors.email}
name="email"
onChange={formik.handleChange}
onBlur={formik.handleBlur}
value={formik.values.email}
variant="outlined"
/>
</Grid>
<Grid
item
md={6}
xs={12}
>
<TextField
fullWidth
label="Telefone"
name="phone_number"
onChange={formik.handleChange}
type="text"
value={formik.values.phone_number}
onBlur={formik.handleBlur}
variant="outlined"
/>
</Grid>
</Grid>
</CardContent>
<Divider />
<Box
sx={{
display: 'flex',
justifyContent: 'flex-end',
p: 2
}}
>
<Button
color="primary"
variant="contained"
type="submit"
disabled={formik.isSubmitting}
>
Salvar
</Button>
</Box>
</Card>
</form>
);
};
|
import MarkInlineShortcut from '../helpers/mark-inline-shortcut'
export default options => {
const { onKeyDown } = MarkInlineShortcut({
type: 'bold',
regex: /\*{2}([^\*]+)\*{2}/g,
})
return {
onKeyDown
}
}
|
#!/usr/bin/env python
# Main entry point for shot manager
import os
from os import sys, path
sys.path.append(os.path.realpath(''))
import shotManager
from dronekit import connect
from dronekit_solo import SoloVehicle
from dronekit.mavlink import MAVConnection
# First get an instance of the API endpoint
vehicle = connect(sys.argv[1], wait_ready=False, vehicle_class=SoloVehicle, source_system=255, use_native=True, heartbeat_timeout=-1)
if 'SOLOLINK_SANDBOX' in os.environ:
from sim import rc_ipc_shim
rc_ipc_shim.pixrc_start()
out = MAVConnection(sys.argv[2], source_system=254)
vehicle._handler.pipe(out)
out.start()
mgr = shotManager.ShotManager()
mgr.Start(vehicle)
mgr.Run()
|
from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DataFrame,
DatetimeIndex,
Index,
NaT,
Period,
PeriodIndex,
RangeIndex,
Series,
Timedelta,
TimedeltaIndex,
Timestamp,
date_range,
isna,
timedelta_range,
to_timedelta,
)
import pandas._testing as tm
from pandas.core import nanops
def get_objs():
indexes = [
tm.makeBoolIndex(10, name="a"),
tm.makeIntIndex(10, name="a"),
tm.makeFloatIndex(10, name="a"),
tm.makeDateIndex(10, name="a"),
tm.makeDateIndex(10, name="a").tz_localize(tz="US/Eastern"),
tm.makePeriodIndex(10, name="a"),
tm.makeStringIndex(10, name="a"),
tm.makeUnicodeIndex(10, name="a"),
]
arr = np.random.randn(10)
series = [Series(arr, index=idx, name="a") for idx in indexes]
objs = indexes + series
return objs
objs = get_objs()
class TestReductions:
@pytest.mark.parametrize("opname", ["max", "min"])
@pytest.mark.parametrize("obj", objs)
def test_ops(self, opname, obj):
result = getattr(obj, opname)()
if not isinstance(obj, PeriodIndex):
expected = getattr(obj.values, opname)()
else:
expected = Period(ordinal=getattr(obj.asi8, opname)(), freq=obj.freq)
if getattr(obj, "tz", None) is not None:
# We need to de-localize before comparing to the numpy-produced result
expected = expected.astype("M8[ns]").astype("int64")
assert result.value == expected
else:
assert result == expected
@pytest.mark.parametrize("opname", ["max", "min"])
@pytest.mark.parametrize(
"dtype, val",
[
("object", 2.0),
("float64", 2.0),
("datetime64[ns]", datetime(2011, 11, 1)),
("Int64", 2),
("boolean", True),
],
)
def test_nanminmax(self, opname, dtype, val, index_or_series):
# GH#7261
klass = index_or_series
def check_missing(res):
if dtype == "datetime64[ns]":
return res is NaT
elif dtype in ["Int64", "boolean"]:
return res is pd.NA
else:
return isna(res)
obj = klass([None], dtype=dtype)
assert check_missing(getattr(obj, opname)())
assert check_missing(getattr(obj, opname)(skipna=False))
obj = klass([], dtype=dtype)
assert check_missing(getattr(obj, opname)())
assert check_missing(getattr(obj, opname)(skipna=False))
if dtype == "object":
# generic test with object only works for empty / all NaN
return
obj = klass([None, val], dtype=dtype)
assert getattr(obj, opname)() == val
assert check_missing(getattr(obj, opname)(skipna=False))
obj = klass([None, val, None], dtype=dtype)
assert getattr(obj, opname)() == val
assert check_missing(getattr(obj, opname)(skipna=False))
@pytest.mark.parametrize("opname", ["max", "min"])
def test_nanargminmax(self, opname, index_or_series):
# GH#7261
klass = index_or_series
arg_op = "arg" + opname if klass is Index else "idx" + opname
obj = klass([NaT, datetime(2011, 11, 1)])
assert getattr(obj, arg_op)() == 1
result = getattr(obj, arg_op)(skipna=False)
if klass is Series:
assert np.isnan(result)
else:
assert result == -1
obj = klass([NaT, datetime(2011, 11, 1), NaT])
# check DatetimeIndex non-monotonic path
assert getattr(obj, arg_op)() == 1
result = getattr(obj, arg_op)(skipna=False)
if klass is Series:
assert np.isnan(result)
else:
assert result == -1
@pytest.mark.parametrize("opname", ["max", "min"])
@pytest.mark.parametrize("dtype", ["M8[ns]", "datetime64[ns, UTC]"])
def test_nanops_empty_object(self, opname, index_or_series, dtype):
klass = index_or_series
arg_op = "arg" + opname if klass is Index else "idx" + opname
obj = klass([], dtype=dtype)
assert getattr(obj, opname)() is NaT
assert getattr(obj, opname)(skipna=False) is NaT
with pytest.raises(ValueError, match="empty sequence"):
getattr(obj, arg_op)()
with pytest.raises(ValueError, match="empty sequence"):
getattr(obj, arg_op)(skipna=False)
def test_argminmax(self):
obj = Index(np.arange(5, dtype="int64"))
assert obj.argmin() == 0
assert obj.argmax() == 4
obj = Index([np.nan, 1, np.nan, 2])
assert obj.argmin() == 1
assert obj.argmax() == 3
assert obj.argmin(skipna=False) == -1
assert obj.argmax(skipna=False) == -1
obj = Index([np.nan])
assert obj.argmin() == -1
assert obj.argmax() == -1
assert obj.argmin(skipna=False) == -1
assert obj.argmax(skipna=False) == -1
obj = Index([NaT, datetime(2011, 11, 1), datetime(2011, 11, 2), NaT])
assert obj.argmin() == 1
assert obj.argmax() == 2
assert obj.argmin(skipna=False) == -1
assert obj.argmax(skipna=False) == -1
obj = Index([NaT])
assert obj.argmin() == -1
assert obj.argmax() == -1
assert obj.argmin(skipna=False) == -1
assert obj.argmax(skipna=False) == -1
@pytest.mark.parametrize("op, expected_col", [["max", "a"], ["min", "b"]])
def test_same_tz_min_max_axis_1(self, op, expected_col):
# GH 10390
df = DataFrame(
date_range("2016-01-01 00:00:00", periods=3, tz="UTC"), columns=["a"]
)
df["b"] = df.a.subtract(Timedelta(seconds=3600))
result = getattr(df, op)(axis=1)
expected = df[expected_col].rename(None)
tm.assert_series_equal(result, expected)
@pytest.mark.parametrize("func", ["maximum", "minimum"])
def test_numpy_reduction_with_tz_aware_dtype(self, tz_aware_fixture, func):
# GH 15552
tz = tz_aware_fixture
arg = pd.to_datetime(["2019"]).tz_localize(tz)
expected = Series(arg)
result = getattr(np, func)(expected, expected)
tm.assert_series_equal(result, expected)
class TestIndexReductions:
# Note: the name TestIndexReductions indicates these tests
# were moved from a Index-specific test file, _not_ that these tests are
# intended long-term to be Index-specific
@pytest.mark.parametrize(
"start,stop,step",
[
(0, 400, 3),
(500, 0, -6),
(-(10 ** 6), 10 ** 6, 4),
(10 ** 6, -(10 ** 6), -4),
(0, 10, 20),
],
)
def test_max_min_range(self, start, stop, step):
# GH#17607
idx = RangeIndex(start, stop, step)
expected = idx._values.max()
result = idx.max()
assert result == expected
# skipna should be irrelevant since RangeIndex should never have NAs
result2 = idx.max(skipna=False)
assert result2 == expected
expected = idx._values.min()
result = idx.min()
assert result == expected
# skipna should be irrelevant since RangeIndex should never have NAs
result2 = idx.min(skipna=False)
assert result2 == expected
# empty
idx = RangeIndex(start, stop, -step)
assert isna(idx.max())
assert isna(idx.min())
def test_minmax_timedelta64(self):
# monotonic
idx1 = TimedeltaIndex(["1 days", "2 days", "3 days"])
assert idx1.is_monotonic_increasing
# non-monotonic
idx2 = TimedeltaIndex(["1 days", np.nan, "3 days", "NaT"])
assert not idx2.is_monotonic_increasing
for idx in [idx1, idx2]:
assert idx.min() == Timedelta("1 days")
assert idx.max() == Timedelta("3 days")
assert idx.argmin() == 0
assert idx.argmax() == 2
@pytest.mark.parametrize("op", ["min", "max"])
def test_minmax_timedelta_empty_or_na(self, op):
# Return NaT
obj = TimedeltaIndex([])
assert getattr(obj, op)() is NaT
obj = TimedeltaIndex([NaT])
assert getattr(obj, op)() is NaT
obj = TimedeltaIndex([NaT, NaT, NaT])
assert getattr(obj, op)() is NaT
def test_numpy_minmax_timedelta64(self):
td = timedelta_range("16815 days", "16820 days", freq="D")
assert np.min(td) == Timedelta("16815 days")
assert np.max(td) == Timedelta("16820 days")
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.min(td, out=0)
with pytest.raises(ValueError, match=errmsg):
np.max(td, out=0)
assert np.argmin(td) == 0
assert np.argmax(td) == 5
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.argmin(td, out=0)
with pytest.raises(ValueError, match=errmsg):
np.argmax(td, out=0)
def test_timedelta_ops(self):
# GH#4984
# make sure ops return Timedelta
s = Series(
[Timestamp("20130101") + timedelta(seconds=i * i) for i in range(10)]
)
td = s.diff()
result = td.mean()
expected = to_timedelta(timedelta(seconds=9))
assert result == expected
result = td.to_frame().mean()
assert result[0] == expected
result = td.quantile(0.1)
expected = Timedelta(np.timedelta64(2600, "ms"))
assert result == expected
result = td.median()
expected = to_timedelta("00:00:09")
assert result == expected
result = td.to_frame().median()
assert result[0] == expected
# GH#6462
# consistency in returned values for sum
result = td.sum()
expected = to_timedelta("00:01:21")
assert result == expected
result = td.to_frame().sum()
assert result[0] == expected
# std
result = td.std()
expected = to_timedelta(Series(td.dropna().values).std())
assert result == expected
result = td.to_frame().std()
assert result[0] == expected
# GH#10040
# make sure NaT is properly handled by median()
s = Series([Timestamp("2015-02-03"), Timestamp("2015-02-07")])
assert s.diff().median() == timedelta(days=4)
s = Series(
[Timestamp("2015-02-03"), Timestamp("2015-02-07"), Timestamp("2015-02-15")]
)
assert s.diff().median() == timedelta(days=6)
@pytest.mark.parametrize("opname", ["skew", "kurt", "sem", "prod", "var"])
def test_invalid_td64_reductions(self, opname):
s = Series(
[Timestamp("20130101") + timedelta(seconds=i * i) for i in range(10)]
)
td = s.diff()
msg = "|".join(
[
f"reduction operation '{opname}' not allowed for this dtype",
rf"cannot perform {opname} with type timedelta64\[ns\]",
f"does not support reduction '{opname}'",
]
)
with pytest.raises(TypeError, match=msg):
getattr(td, opname)()
with pytest.raises(TypeError, match=msg):
getattr(td.to_frame(), opname)(numeric_only=False)
def test_minmax_tz(self, tz_naive_fixture):
tz = tz_naive_fixture
# monotonic
idx1 = DatetimeIndex(["2011-01-01", "2011-01-02", "2011-01-03"], tz=tz)
assert idx1.is_monotonic_increasing
# non-monotonic
idx2 = DatetimeIndex(
["2011-01-01", NaT, "2011-01-03", "2011-01-02", NaT], tz=tz
)
assert not idx2.is_monotonic_increasing
for idx in [idx1, idx2]:
assert idx.min() == Timestamp("2011-01-01", tz=tz)
assert idx.max() == Timestamp("2011-01-03", tz=tz)
assert idx.argmin() == 0
assert idx.argmax() == 2
@pytest.mark.parametrize("op", ["min", "max"])
def test_minmax_nat_datetime64(self, op):
# Return NaT
obj = DatetimeIndex([])
assert isna(getattr(obj, op)())
obj = DatetimeIndex([NaT])
assert isna(getattr(obj, op)())
obj = DatetimeIndex([NaT, NaT, NaT])
assert isna(getattr(obj, op)())
def test_numpy_minmax_integer(self):
# GH#26125
idx = Index([1, 2, 3])
expected = idx.values.max()
result = np.max(idx)
assert result == expected
expected = idx.values.min()
result = np.min(idx)
assert result == expected
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.min(idx, out=0)
with pytest.raises(ValueError, match=errmsg):
np.max(idx, out=0)
expected = idx.values.argmax()
result = np.argmax(idx)
assert result == expected
expected = idx.values.argmin()
result = np.argmin(idx)
assert result == expected
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.argmin(idx, out=0)
with pytest.raises(ValueError, match=errmsg):
np.argmax(idx, out=0)
def test_numpy_minmax_range(self):
# GH#26125
idx = RangeIndex(0, 10, 3)
result = np.max(idx)
assert result == 9
result = np.min(idx)
assert result == 0
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.min(idx, out=0)
with pytest.raises(ValueError, match=errmsg):
np.max(idx, out=0)
# No need to test again argmax/argmin compat since the implementation
# is the same as basic integer index
def test_numpy_minmax_datetime64(self):
dr = date_range(start="2016-01-15", end="2016-01-20")
assert np.min(dr) == Timestamp("2016-01-15 00:00:00")
assert np.max(dr) == Timestamp("2016-01-20 00:00:00")
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.min(dr, out=0)
with pytest.raises(ValueError, match=errmsg):
np.max(dr, out=0)
assert np.argmin(dr) == 0
assert np.argmax(dr) == 5
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.argmin(dr, out=0)
with pytest.raises(ValueError, match=errmsg):
np.argmax(dr, out=0)
def test_minmax_period(self):
# monotonic
idx1 = PeriodIndex([NaT, "2011-01-01", "2011-01-02", "2011-01-03"], freq="D")
assert not idx1.is_monotonic_increasing
assert idx1[1:].is_monotonic_increasing
# non-monotonic
idx2 = PeriodIndex(
["2011-01-01", NaT, "2011-01-03", "2011-01-02", NaT], freq="D"
)
assert not idx2.is_monotonic_increasing
for idx in [idx1, idx2]:
assert idx.min() == Period("2011-01-01", freq="D")
assert idx.max() == Period("2011-01-03", freq="D")
assert idx1.argmin() == 1
assert idx2.argmin() == 0
assert idx1.argmax() == 3
assert idx2.argmax() == 2
@pytest.mark.parametrize("op", ["min", "max"])
@pytest.mark.parametrize("data", [[], [NaT], [NaT, NaT, NaT]])
def test_minmax_period_empty_nat(self, op, data):
# Return NaT
obj = PeriodIndex(data, freq="M")
result = getattr(obj, op)()
assert result is NaT
def test_numpy_minmax_period(self):
pr = pd.period_range(start="2016-01-15", end="2016-01-20")
assert np.min(pr) == Period("2016-01-15", freq="D")
assert np.max(pr) == Period("2016-01-20", freq="D")
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.min(pr, out=0)
with pytest.raises(ValueError, match=errmsg):
np.max(pr, out=0)
assert np.argmin(pr) == 0
assert np.argmax(pr) == 5
errmsg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=errmsg):
np.argmin(pr, out=0)
with pytest.raises(ValueError, match=errmsg):
np.argmax(pr, out=0)
def test_min_max_categorical(self):
ci = pd.CategoricalIndex(list("aabbca"), categories=list("cab"), ordered=False)
msg = (
r"Categorical is not ordered for operation min\n"
r"you can use .as_ordered\(\) to change the Categorical to an ordered one\n"
)
with pytest.raises(TypeError, match=msg):
ci.min()
msg = (
r"Categorical is not ordered for operation max\n"
r"you can use .as_ordered\(\) to change the Categorical to an ordered one\n"
)
with pytest.raises(TypeError, match=msg):
ci.max()
ci = pd.CategoricalIndex(list("aabbca"), categories=list("cab"), ordered=True)
assert ci.min() == "c"
assert ci.max() == "b"
class TestSeriesReductions:
# Note: the name TestSeriesReductions indicates these tests
# were moved from a series-specific test file, _not_ that these tests are
# intended long-term to be series-specific
def test_sum_inf(self):
s = Series(np.random.randn(10))
s2 = s.copy()
s[5:8] = np.inf
s2[5:8] = np.nan
assert np.isinf(s.sum())
arr = np.random.randn(100, 100).astype("f4")
arr[:, 2] = np.inf
with pd.option_context("mode.use_inf_as_na", True):
tm.assert_almost_equal(s.sum(), s2.sum())
res = nanops.nansum(arr, axis=1)
assert np.isinf(res).all()
@pytest.mark.parametrize(
"dtype", ["float64", "Float32", "Int64", "boolean", "object"]
)
@pytest.mark.parametrize("use_bottleneck", [True, False])
@pytest.mark.parametrize("method, unit", [("sum", 0.0), ("prod", 1.0)])
def test_empty(self, method, unit, use_bottleneck, dtype):
with pd.option_context("use_bottleneck", use_bottleneck):
# GH#9422 / GH#18921
# Entirely empty
s = Series([], dtype=dtype)
# NA by default
result = getattr(s, method)()
assert result == unit
# Explicit
result = getattr(s, method)(min_count=0)
assert result == unit
result = getattr(s, method)(min_count=1)
assert isna(result)
# Skipna, default
result = getattr(s, method)(skipna=True)
result == unit
# Skipna, explicit
result = getattr(s, method)(skipna=True, min_count=0)
assert result == unit
result = getattr(s, method)(skipna=True, min_count=1)
assert isna(result)
result = getattr(s, method)(skipna=False, min_count=0)
assert result == unit
result = getattr(s, method)(skipna=False, min_count=1)
assert isna(result)
# All-NA
s = Series([np.nan], dtype=dtype)
# NA by default
result = getattr(s, method)()
assert result == unit
# Explicit
result = getattr(s, method)(min_count=0)
assert result == unit
result = getattr(s, method)(min_count=1)
assert isna(result)
# Skipna, default
result = getattr(s, method)(skipna=True)
result == unit
# skipna, explicit
result = getattr(s, method)(skipna=True, min_count=0)
assert result == unit
result = getattr(s, method)(skipna=True, min_count=1)
assert isna(result)
# Mix of valid, empty
s = Series([np.nan, 1], dtype=dtype)
# Default
result = getattr(s, method)()
assert result == 1.0
# Explicit
result = getattr(s, method)(min_count=0)
assert result == 1.0
result = getattr(s, method)(min_count=1)
assert result == 1.0
# Skipna
result = getattr(s, method)(skipna=True)
assert result == 1.0
result = getattr(s, method)(skipna=True, min_count=0)
assert result == 1.0
# GH#844 (changed in GH#9422)
df = DataFrame(np.empty((10, 0)), dtype=dtype)
assert (getattr(df, method)(1) == unit).all()
s = Series([1], dtype=dtype)
result = getattr(s, method)(min_count=2)
assert isna(result)
result = getattr(s, method)(skipna=False, min_count=2)
assert isna(result)
s = Series([np.nan], dtype=dtype)
result = getattr(s, method)(min_count=2)
assert isna(result)
s = Series([np.nan, 1], dtype=dtype)
result = getattr(s, method)(min_count=2)
assert isna(result)
@pytest.mark.parametrize("method, unit", [("sum", 0.0), ("prod", 1.0)])
def test_empty_multi(self, method, unit):
s = Series(
[1, np.nan, np.nan, np.nan],
index=pd.MultiIndex.from_product([("a", "b"), (0, 1)]),
)
# 1 / 0 by default
with tm.assert_produces_warning(FutureWarning):
result = getattr(s, method)(level=0)
expected = Series([1, unit], index=["a", "b"])
tm.assert_series_equal(result, expected)
# min_count=0
with tm.assert_produces_warning(FutureWarning):
result = getattr(s, method)(level=0, min_count=0)
expected = Series([1, unit], index=["a", "b"])
tm.assert_series_equal(result, expected)
# min_count=1
with tm.assert_produces_warning(FutureWarning):
result = getattr(s, method)(level=0, min_count=1)
expected = Series([1, np.nan], index=["a", "b"])
tm.assert_series_equal(result, expected)
@pytest.mark.parametrize("method", ["mean"])
@pytest.mark.parametrize("dtype", ["Float64", "Int64", "boolean"])
def test_ops_consistency_on_empty_nullable(self, method, dtype):
# GH#34814
# consistency for nullable dtypes on empty or ALL-NA mean
# empty series
eser = Series([], dtype=dtype)
result = getattr(eser, method)()
assert result is pd.NA
# ALL-NA series
nser = Series([np.nan], dtype=dtype)
result = getattr(nser, method)()
assert result is pd.NA
@pytest.mark.parametrize("method", ["mean", "median", "std", "var"])
def test_ops_consistency_on_empty(self, method):
# GH#7869
# consistency on empty
# float
result = getattr(Series(dtype=float), method)()
assert isna(result)
# timedelta64[ns]
tdser = Series([], dtype="m8[ns]")
if method == "var":
msg = "|".join(
[
"operation 'var' not allowed",
r"cannot perform var with type timedelta64\[ns\]",
"does not support reduction 'var'",
]
)
with pytest.raises(TypeError, match=msg):
getattr(tdser, method)()
else:
result = getattr(tdser, method)()
assert result is NaT
def test_nansum_buglet(self):
ser = Series([1.0, np.nan], index=[0, 1])
result = np.nansum(ser)
tm.assert_almost_equal(result, 1)
@pytest.mark.parametrize("use_bottleneck", [True, False])
@pytest.mark.parametrize("dtype", ["int32", "int64"])
def test_sum_overflow_int(self, use_bottleneck, dtype):
with pd.option_context("use_bottleneck", use_bottleneck):
# GH#6915
# overflowing on the smaller int dtypes
v = np.arange(5000000, dtype=dtype)
s = Series(v)
result = s.sum(skipna=False)
assert int(result) == v.sum(dtype="int64")
result = s.min(skipna=False)
assert int(result) == 0
result = s.max(skipna=False)
assert int(result) == v[-1]
@pytest.mark.parametrize("use_bottleneck", [True, False])
@pytest.mark.parametrize("dtype", ["float32", "float64"])
def test_sum_overflow_float(self, use_bottleneck, dtype):
with pd.option_context("use_bottleneck", use_bottleneck):
v = np.arange(5000000, dtype=dtype)
s = Series(v)
result = s.sum(skipna=False)
assert result == v.sum(dtype=dtype)
result = s.min(skipna=False)
assert np.allclose(float(result), 0.0)
result = s.max(skipna=False)
assert np.allclose(float(result), v[-1])
@pytest.mark.parametrize("dtype", ("m8[ns]", "m8[ns]", "M8[ns]", "M8[ns, UTC]"))
@pytest.mark.parametrize("skipna", [True, False])
def test_empty_timeseries_reductions_return_nat(self, dtype, skipna):
# covers GH#11245
assert Series([], dtype=dtype).min(skipna=skipna) is NaT
assert Series([], dtype=dtype).max(skipna=skipna) is NaT
def test_numpy_argmin(self):
# See GH#16830
data = np.arange(1, 11)
s = Series(data, index=data)
result = np.argmin(s)
expected = np.argmin(data)
assert result == expected
result = s.argmin()
assert result == expected
msg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=msg):
np.argmin(s, out=data)
def test_numpy_argmax(self):
# See GH#16830
data = np.arange(1, 11)
s = Series(data, index=data)
result = np.argmax(s)
expected = np.argmax(data)
assert result == expected
result = s.argmax()
assert result == expected
msg = "the 'out' parameter is not supported"
with pytest.raises(ValueError, match=msg):
np.argmax(s, out=data)
def test_idxmin(self):
# test idxmin
# _check_stat_op approach can not be used here because of isna check.
string_series = tm.makeStringSeries().rename("series")
# add some NaNs
string_series[5:15] = np.NaN
# skipna or no
assert string_series[string_series.idxmin()] == string_series.min()
assert isna(string_series.idxmin(skipna=False))
# no NaNs
nona = string_series.dropna()
assert nona[nona.idxmin()] == nona.min()
assert nona.index.values.tolist().index(nona.idxmin()) == nona.values.argmin()
# all NaNs
allna = string_series * np.nan
assert isna(allna.idxmin())
# datetime64[ns]
s = Series(date_range("20130102", periods=6))
result = s.idxmin()
assert result == 0
s[0] = np.nan
result = s.idxmin()
assert result == 1
def test_idxmax(self):
# test idxmax
# _check_stat_op approach can not be used here because of isna check.
string_series = tm.makeStringSeries().rename("series")
# add some NaNs
string_series[5:15] = np.NaN
# skipna or no
assert string_series[string_series.idxmax()] == string_series.max()
assert isna(string_series.idxmax(skipna=False))
# no NaNs
nona = string_series.dropna()
assert nona[nona.idxmax()] == nona.max()
assert nona.index.values.tolist().index(nona.idxmax()) == nona.values.argmax()
# all NaNs
allna = string_series * np.nan
assert isna(allna.idxmax())
from pandas import date_range
s = Series(date_range("20130102", periods=6))
result = s.idxmax()
assert result == 5
s[5] = np.nan
result = s.idxmax()
assert result == 4
# Float64Index
# GH#5914
s = Series([1, 2, 3], [1.1, 2.1, 3.1])
result = s.idxmax()
assert result == 3.1
result = s.idxmin()
assert result == 1.1
s = Series(s.index, s.index)
result = s.idxmax()
assert result == 3.1
result = s.idxmin()
assert result == 1.1
def test_all_any(self):
ts = tm.makeTimeSeries()
bool_series = ts > 0
assert not bool_series.all()
assert bool_series.any()
# Alternative types, with implicit 'object' dtype.
s = Series(["abc", True])
assert s.any()
@pytest.mark.parametrize("klass", [Index, Series])
def test_numpy_all_any(self, klass):
# GH#40180
idx = klass([0, 1, 2])
assert not np.all(idx)
assert np.any(idx)
idx = Index([1, 2, 3])
assert np.all(idx)
def test_all_any_params(self):
# Check skipna, with implicit 'object' dtype.
s1 = Series([np.nan, True])
s2 = Series([np.nan, False])
assert s1.all(skipna=False) # nan && True => True
assert s1.all(skipna=True)
assert s2.any(skipna=False)
assert not s2.any(skipna=True)
# Check level.
s = Series([False, False, True, True, False, True], index=[0, 0, 1, 1, 2, 2])
with tm.assert_produces_warning(FutureWarning):
tm.assert_series_equal(s.all(level=0), Series([False, True, False]))
with tm.assert_produces_warning(FutureWarning):
tm.assert_series_equal(s.any(level=0), Series([False, True, True]))
msg = "Option bool_only is not implemented with option level"
with pytest.raises(NotImplementedError, match=msg):
with tm.assert_produces_warning(FutureWarning):
s.any(bool_only=True, level=0)
with pytest.raises(NotImplementedError, match=msg):
with tm.assert_produces_warning(FutureWarning):
s.all(bool_only=True, level=0)
# GH#38810 bool_only is not implemented alone.
msg = "Series.any does not implement bool_only"
with pytest.raises(NotImplementedError, match=msg):
s.any(bool_only=True)
msg = "Series.all does not implement bool_only."
with pytest.raises(NotImplementedError, match=msg):
s.all(bool_only=True)
@pytest.mark.parametrize("bool_agg_func", ["any", "all"])
@pytest.mark.parametrize("skipna", [True, False])
def test_any_all_object_dtype(self, bool_agg_func, skipna):
# GH#12863
ser = Series(["a", "b", "c", "d", "e"], dtype=object)
result = getattr(ser, bool_agg_func)(skipna=skipna)
expected = True
assert result == expected
@pytest.mark.parametrize("bool_agg_func", ["any", "all"])
@pytest.mark.parametrize(
"data", [[False, None], [None, False], [False, np.nan], [np.nan, False]]
)
def test_any_all_object_dtype_missing(self, data, bool_agg_func):
# GH#27709
ser = Series(data)
result = getattr(ser, bool_agg_func)(skipna=False)
# None is treated is False, but np.nan is treated as True
expected = bool_agg_func == "any" and None not in data
assert result == expected
@pytest.mark.parametrize("dtype", ["boolean", "Int64", "UInt64", "Float64"])
@pytest.mark.parametrize("bool_agg_func", ["any", "all"])
@pytest.mark.parametrize("skipna", [True, False])
@pytest.mark.parametrize(
# expected_data indexed as [[skipna=False/any, skipna=False/all],
# [skipna=True/any, skipna=True/all]]
"data,expected_data",
[
([0, 0, 0], [[False, False], [False, False]]),
([1, 1, 1], [[True, True], [True, True]]),
([pd.NA, pd.NA, pd.NA], [[pd.NA, pd.NA], [False, True]]),
([0, pd.NA, 0], [[pd.NA, False], [False, False]]),
([1, pd.NA, 1], [[True, pd.NA], [True, True]]),
([1, pd.NA, 0], [[True, False], [True, False]]),
],
)
def test_any_all_nullable_kleene_logic(
self, bool_agg_func, skipna, data, dtype, expected_data
):
# GH-37506, GH-41967
ser = Series(data, dtype=dtype)
expected = expected_data[skipna][bool_agg_func == "all"]
result = getattr(ser, bool_agg_func)(skipna=skipna)
assert (result is pd.NA and expected is pd.NA) or result == expected
@pytest.mark.parametrize(
"bool_agg_func,expected",
[("all", [False, True, False]), ("any", [False, True, True])],
)
def test_any_all_boolean_level(self, bool_agg_func, expected):
# GH#33449
ser = Series(
[False, False, True, True, False, True],
index=[0, 0, 1, 1, 2, 2],
dtype="boolean",
)
with tm.assert_produces_warning(FutureWarning):
result = getattr(ser, bool_agg_func)(level=0)
expected = Series(expected, dtype="boolean")
tm.assert_series_equal(result, expected)
def test_any_axis1_bool_only(self):
# GH#32432
df = DataFrame({"A": [True, False], "B": [1, 2]})
result = df.any(axis=1, bool_only=True)
expected = Series([True, False])
tm.assert_series_equal(result, expected)
def test_any_all_datetimelike(self):
# GH#38723 these may not be the desired long-term behavior (GH#34479)
# but in the interim should be internally consistent
dta = date_range("1995-01-02", periods=3)._data
ser = Series(dta)
df = DataFrame(ser)
assert dta.all()
assert dta.any()
assert ser.all()
assert ser.any()
assert df.any().all()
assert df.all().all()
dta = dta.tz_localize("UTC")
ser = Series(dta)
df = DataFrame(ser)
assert dta.all()
assert dta.any()
assert ser.all()
assert ser.any()
assert df.any().all()
assert df.all().all()
tda = dta - dta[0]
ser = Series(tda)
df = DataFrame(ser)
assert tda.any()
assert not tda.all()
assert ser.any()
assert not ser.all()
assert df.any().all()
assert not df.all().any()
def test_timedelta64_analytics(self):
# index min/max
dti = date_range("2012-1-1", periods=3, freq="D")
td = Series(dti) - Timestamp("20120101")
result = td.idxmin()
assert result == 0
result = td.idxmax()
assert result == 2
# GH#2982
# with NaT
td[0] = np.nan
result = td.idxmin()
assert result == 1
result = td.idxmax()
assert result == 2
# abs
s1 = Series(date_range("20120101", periods=3))
s2 = Series(date_range("20120102", periods=3))
expected = Series(s2 - s1)
result = np.abs(s1 - s2)
tm.assert_series_equal(result, expected)
result = (s1 - s2).abs()
tm.assert_series_equal(result, expected)
# max/min
result = td.max()
expected = Timedelta("2 days")
assert result == expected
result = td.min()
expected = Timedelta("1 days")
assert result == expected
@pytest.mark.parametrize(
"test_input,error_type",
[
(Series([], dtype="float64"), ValueError),
# For strings, or any Series with dtype 'O'
(Series(["foo", "bar", "baz"]), TypeError),
(Series([(1,), (2,)]), TypeError),
# For mixed data types
(Series(["foo", "foo", "bar", "bar", None, np.nan, "baz"]), TypeError),
],
)
def test_assert_idxminmax_raises(self, test_input, error_type):
"""
Cases where ``Series.argmax`` and related should raise an exception
"""
msg = (
"reduction operation 'argmin' not allowed for this dtype|"
"attempt to get argmin of an empty sequence"
)
with pytest.raises(error_type, match=msg):
test_input.idxmin()
with pytest.raises(error_type, match=msg):
test_input.idxmin(skipna=False)
msg = (
"reduction operation 'argmax' not allowed for this dtype|"
"attempt to get argmax of an empty sequence"
)
with pytest.raises(error_type, match=msg):
test_input.idxmax()
with pytest.raises(error_type, match=msg):
test_input.idxmax(skipna=False)
def test_idxminmax_with_inf(self):
# For numeric data with NA and Inf (GH #13595)
s = Series([0, -np.inf, np.inf, np.nan])
assert s.idxmin() == 1
assert np.isnan(s.idxmin(skipna=False))
assert s.idxmax() == 2
assert np.isnan(s.idxmax(skipna=False))
# Using old-style behavior that treats floating point nan, -inf, and
# +inf as missing
with pd.option_context("mode.use_inf_as_na", True):
assert s.idxmin() == 0
assert np.isnan(s.idxmin(skipna=False))
assert s.idxmax() == 0
np.isnan(s.idxmax(skipna=False))
class TestDatetime64SeriesReductions:
# Note: the name TestDatetime64SeriesReductions indicates these tests
# were moved from a series-specific test file, _not_ that these tests are
# intended long-term to be series-specific
@pytest.mark.parametrize(
"nat_ser",
[
Series([NaT, NaT]),
Series([NaT, Timedelta("nat")]),
Series([Timedelta("nat"), Timedelta("nat")]),
],
)
def test_minmax_nat_series(self, nat_ser):
# GH#23282
assert nat_ser.min() is NaT
assert nat_ser.max() is NaT
assert nat_ser.min(skipna=False) is NaT
assert nat_ser.max(skipna=False) is NaT
@pytest.mark.parametrize(
"nat_df",
[
DataFrame([NaT, NaT]),
DataFrame([NaT, Timedelta("nat")]),
DataFrame([Timedelta("nat"), Timedelta("nat")]),
],
)
def test_minmax_nat_dataframe(self, nat_df):
# GH#23282
assert nat_df.min()[0] is NaT
assert nat_df.max()[0] is NaT
assert nat_df.min(skipna=False)[0] is NaT
assert nat_df.max(skipna=False)[0] is NaT
def test_min_max(self):
rng = date_range("1/1/2000", "12/31/2000")
rng2 = rng.take(np.random.permutation(len(rng)))
the_min = rng2.min()
the_max = rng2.max()
assert isinstance(the_min, Timestamp)
assert isinstance(the_max, Timestamp)
assert the_min == rng[0]
assert the_max == rng[-1]
assert rng.min() == rng[0]
assert rng.max() == rng[-1]
def test_min_max_series(self):
rng = date_range("1/1/2000", periods=10, freq="4h")
lvls = ["A", "A", "A", "B", "B", "B", "C", "C", "C", "C"]
df = DataFrame({"TS": rng, "V": np.random.randn(len(rng)), "L": lvls})
result = df.TS.max()
exp = Timestamp(df.TS.iat[-1])
assert isinstance(result, Timestamp)
assert result == exp
result = df.TS.min()
exp = Timestamp(df.TS.iat[0])
assert isinstance(result, Timestamp)
assert result == exp
class TestCategoricalSeriesReductions:
# Note: the name TestCategoricalSeriesReductions indicates these tests
# were moved from a series-specific test file, _not_ that these tests are
# intended long-term to be series-specific
@pytest.mark.parametrize("function", ["min", "max"])
def test_min_max_unordered_raises(self, function):
# unordered cats have no min/max
cat = Series(Categorical(["a", "b", "c", "d"], ordered=False))
msg = f"Categorical is not ordered for operation {function}"
with pytest.raises(TypeError, match=msg):
getattr(cat, function)()
@pytest.mark.parametrize(
"values, categories",
[
(list("abc"), list("abc")),
(list("abc"), list("cba")),
(list("abc") + [np.nan], list("cba")),
([1, 2, 3], [3, 2, 1]),
([1, 2, 3, np.nan], [3, 2, 1]),
],
)
@pytest.mark.parametrize("function", ["min", "max"])
def test_min_max_ordered(self, values, categories, function):
# GH 25303
cat = Series(Categorical(values, categories=categories, ordered=True))
result = getattr(cat, function)(skipna=True)
expected = categories[0] if function == "min" else categories[2]
assert result == expected
@pytest.mark.parametrize("function", ["min", "max"])
@pytest.mark.parametrize("skipna", [True, False])
def test_min_max_ordered_with_nan_only(self, function, skipna):
# https://github.com/pandas-dev/pandas/issues/33450
cat = Series(Categorical([np.nan], categories=[1, 2], ordered=True))
result = getattr(cat, function)(skipna=skipna)
assert result is np.nan
@pytest.mark.parametrize("function", ["min", "max"])
@pytest.mark.parametrize("skipna", [True, False])
def test_min_max_skipna(self, function, skipna):
cat = Series(
Categorical(["a", "b", np.nan, "a"], categories=["b", "a"], ordered=True)
)
result = getattr(cat, function)(skipna=skipna)
if skipna is True:
expected = "b" if function == "min" else "a"
assert result == expected
else:
assert result is np.nan
class TestSeriesMode:
# Note: the name TestSeriesMode indicates these tests
# were moved from a series-specific test file, _not_ that these tests are
# intended long-term to be series-specific
@pytest.mark.parametrize(
"dropna, expected",
[(True, Series([], dtype=np.float64)), (False, Series([], dtype=np.float64))],
)
def test_mode_empty(self, dropna, expected):
s = Series([], dtype=np.float64)
result = s.mode(dropna)
tm.assert_series_equal(result, expected)
@pytest.mark.parametrize(
"dropna, data, expected",
[
(True, [1, 1, 1, 2], [1]),
(True, [1, 1, 1, 2, 3, 3, 3], [1, 3]),
(False, [1, 1, 1, 2], [1]),
(False, [1, 1, 1, 2, 3, 3, 3], [1, 3]),
],
)
@pytest.mark.parametrize(
"dt", list(np.typecodes["AllInteger"] + np.typecodes["Float"])
)
def test_mode_numerical(self, dropna, data, expected, dt):
s = Series(data, dtype=dt)
result = s.mode(dropna)
expected = Series(expected, dtype=dt)
tm.assert_series_equal(result, expected)
@pytest.mark.parametrize("dropna, expected", [(True, [1.0]), (False, [1, np.nan])])
def test_mode_numerical_nan(self, dropna, expected):
s = Series([1, 1, 2, np.nan, np.nan])
result = s.mode(dropna)
expected = Series(expected)
tm.assert_series_equal(result, expected)
@pytest.mark.parametrize(
"dropna, expected1, expected2, expected3",
[(True, ["b"], ["bar"], ["nan"]), (False, ["b"], [np.nan], ["nan"])],
)
def test_mode_str_obj(self, dropna, expected1, expected2, expected3):
# Test string and object types.
data = ["a"] * 2 + ["b"] * 3
s = Series(data, dtype="c")
result = s.mode(dropna)
expected1 = Series(expected1, dtype="c")
tm.assert_series_equal(result, expected1)
data = ["foo", "bar", "bar", np.nan, np.nan, np.nan]
s = Series(data, dtype=object)
result = s.mode(dropna)
expected2 = Series(expected2, dtype=object)
tm.assert_series_equal(result, expected2)
data = ["foo", "bar", "bar", np.nan, np.nan, np.nan]
s = Series(data, dtype=object).astype(str)
result = s.mode(dropna)
expected3 = Series(expected3, dtype=str)
tm.assert_series_equal(result, expected3)
@pytest.mark.parametrize(
"dropna, expected1, expected2",
[(True, ["foo"], ["foo"]), (False, ["foo"], [np.nan])],
)
def test_mode_mixeddtype(self, dropna, expected1, expected2):
s = Series([1, "foo", "foo"])
result = s.mode(dropna)
expected = Series(expected1)
tm.assert_series_equal(result, expected)
s = Series([1, "foo", "foo", np.nan, np.nan, np.nan])
result = s.mode(dropna)
expected = Series(expected2, dtype=object)
tm.assert_series_equal(result, expected)
@pytest.mark.parametrize(
"dropna, expected1, expected2",
[
(
True,
["1900-05-03", "2011-01-03", "2013-01-02"],
["2011-01-03", "2013-01-02"],
),
(False, [np.nan], [np.nan, "2011-01-03", "2013-01-02"]),
],
)
def test_mode_datetime(self, dropna, expected1, expected2):
s = Series(
["2011-01-03", "2013-01-02", "1900-05-03", "nan", "nan"], dtype="M8[ns]"
)
result = s.mode(dropna)
expected1 = Series(expected1, dtype="M8[ns]")
tm.assert_series_equal(result, expected1)
s = Series(
[
"2011-01-03",
"2013-01-02",
"1900-05-03",
"2011-01-03",
"2013-01-02",
"nan",
"nan",
],
dtype="M8[ns]",
)
result = s.mode(dropna)
expected2 = Series(expected2, dtype="M8[ns]")
tm.assert_series_equal(result, expected2)
@pytest.mark.parametrize(
"dropna, expected1, expected2",
[
(True, ["-1 days", "0 days", "1 days"], ["2 min", "1 day"]),
(False, [np.nan], [np.nan, "2 min", "1 day"]),
],
)
def test_mode_timedelta(self, dropna, expected1, expected2):
# gh-5986: Test timedelta types.
s = Series(
["1 days", "-1 days", "0 days", "nan", "nan"], dtype="timedelta64[ns]"
)
result = s.mode(dropna)
expected1 = Series(expected1, dtype="timedelta64[ns]")
tm.assert_series_equal(result, expected1)
s = Series(
[
"1 day",
"1 day",
"-1 day",
"-1 day 2 min",
"2 min",
"2 min",
"nan",
"nan",
],
dtype="timedelta64[ns]",
)
result = s.mode(dropna)
expected2 = Series(expected2, dtype="timedelta64[ns]")
tm.assert_series_equal(result, expected2)
@pytest.mark.parametrize(
"dropna, expected1, expected2, expected3",
[
(
True,
Categorical([1, 2], categories=[1, 2]),
Categorical(["a"], categories=[1, "a"]),
Categorical([3, 1], categories=[3, 2, 1], ordered=True),
),
(
False,
Categorical([np.nan], categories=[1, 2]),
Categorical([np.nan, "a"], categories=[1, "a"]),
Categorical([np.nan, 3, 1], categories=[3, 2, 1], ordered=True),
),
],
)
def test_mode_category(self, dropna, expected1, expected2, expected3):
s = Series(Categorical([1, 2, np.nan, np.nan]))
result = s.mode(dropna)
expected1 = Series(expected1, dtype="category")
tm.assert_series_equal(result, expected1)
s = Series(Categorical([1, "a", "a", np.nan, np.nan]))
result = s.mode(dropna)
expected2 = Series(expected2, dtype="category")
tm.assert_series_equal(result, expected2)
s = Series(
Categorical(
[1, 1, 2, 3, 3, np.nan, np.nan], categories=[3, 2, 1], ordered=True
)
)
result = s.mode(dropna)
expected3 = Series(expected3, dtype="category")
tm.assert_series_equal(result, expected3)
@pytest.mark.parametrize(
"dropna, expected1, expected2",
[(True, [2 ** 63], [1, 2 ** 63]), (False, [2 ** 63], [1, 2 ** 63])],
)
def test_mode_intoverflow(self, dropna, expected1, expected2):
# Test for uint64 overflow.
s = Series([1, 2 ** 63, 2 ** 63], dtype=np.uint64)
result = s.mode(dropna)
expected1 = Series(expected1, dtype=np.uint64)
tm.assert_series_equal(result, expected1)
s = Series([1, 2 ** 63], dtype=np.uint64)
result = s.mode(dropna)
expected2 = Series(expected2, dtype=np.uint64)
tm.assert_series_equal(result, expected2)
def test_mode_sortwarning(self):
# Check for the warning that is raised when the mode
# results cannot be sorted
expected = Series(["foo", np.nan])
s = Series([1, "foo", "foo", np.nan, np.nan])
with tm.assert_produces_warning(UserWarning):
result = s.mode(dropna=False)
result = result.sort_values().reset_index(drop=True)
tm.assert_series_equal(result, expected)
def test_mode_boolean_with_na(self):
# GH#42107
ser = Series([True, False, True, pd.NA], dtype="boolean")
result = ser.mode()
expected = Series({0: True}, dtype="boolean")
tm.assert_series_equal(result, expected)
@pytest.mark.parametrize(
"array,expected,dtype",
[
(
[0, 1j, 1, 1, 1 + 1j, 1 + 2j],
Series([1], dtype=np.complex128),
np.complex128,
),
(
[0, 1j, 1, 1, 1 + 1j, 1 + 2j],
Series([1], dtype=np.complex64),
np.complex64,
),
(
[1 + 1j, 2j, 1 + 1j],
Series([1 + 1j], dtype=np.complex128),
np.complex128,
),
],
)
def test_single_mode_value_complex(self, array, expected, dtype):
result = Series(array, dtype=dtype).mode()
tm.assert_series_equal(result, expected)
@pytest.mark.parametrize(
"array,expected,dtype",
[
(
# no modes
[0, 1j, 1, 1 + 1j, 1 + 2j],
Series([0j, 1j, 1 + 0j, 1 + 1j, 1 + 2j], dtype=np.complex128),
np.complex128,
),
(
[1 + 1j, 2j, 1 + 1j, 2j, 3],
Series([2j, 1 + 1j], dtype=np.complex64),
np.complex64,
),
],
)
def test_multimode_complex(self, array, expected, dtype):
# GH 17927
# mode tries to sort multimodal series.
# Complex numbers are sorted by their magnitude
result = Series(array, dtype=dtype).mode()
tm.assert_series_equal(result, expected)
|
'use strict';
var tape = require('tape');
var wrtc = require('..');
var getUserMedia = wrtc.getUserMedia;
var MediaStream = wrtc.MediaStream;
var RTCPeerConnection = wrtc.RTCPeerConnection;
var RTCSessionDescription = wrtc.RTCSessionDescription;
var sdp = [
'v=0',
'o=- 0 1 IN IP4 0.0.0.0',
's=-',
't=0 0',
'a=group:BUNDLE audio video',
'a=msid-semantic:WMS *',
'a=ice-ufrag:0000',
'a=ice-pwd:0000000000000000000000',
'a=fingerprint:sha-256 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00',
'm=audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8 101',
'c=IN IP4 0.0.0.0',
'a=mid:audio',
'a=sendrecv',
'a=rtpmap:109 opus/48000/2',
'a=rtpmap:9 G722/8000/1',
'a=rtpmap:0 PCMU/8000',
'a=rtpmap:8 PCMA/8000',
'a=rtpmap:101 PCMA/16000',
'a=rtcp-mux',
'a=ssrc:1 cname:0',
'a=ssrc:1 msid:stream 123',
'm=video 9 UDP/TLS/RTP/SAVPF 120 121 126 97',
'c=IN IP4 0.0.0.0',
'a=mid:video',
'a=sendrecv',
'a=rtpmap:120 VP8/90000',
'a=rtpmap:121 VP9/90000',
'a=rtpmap:126 H264/90000',
'a=rtpmap:97 H264/180000',
'a=rtcp-mux',
'a=ssrc:2 cname:0',
'a=ssrc:2 msid:stream 456'
].join('\r\n') + '\r\n';
tape('new MediaStream()', function(t) {
var stream = new MediaStream();
t.equal(stream.getTracks().length, 0, 'the MediaStream does not contain any MediaStreamTracks');
t.end();
});
tape('new MediaStream(stream)', function(t) {
return getRemoteMediaStream().then(function(stream1) {
var stream2 = new MediaStream(stream1);
t.notEqual(stream2.id, stream1.id, 'the MediaStream .ids do not match');
t.ok(stream2.getTracks().every(function(track, i) {
return track === stream1.getTracks()[i];
}) && stream1.getTracks().every(function(track, i) {
return track === stream2.getTracks()[i];
}), 'the MediaStreams\' MediaStreamTracks are the same');
t.end();
});
});
tape('new MediaStream(tracks)', function(t) {
return getRemoteMediaStream().then(function(stream1) {
var tracks = stream1.getTracks();
var stream2 = new MediaStream(tracks);
t.ok(stream2.getTracks().every(function(track, i) {
return track === tracks[i];
}) && tracks.every(function(track, i) {
return track === stream2.getTracks()[i];
}), 'the MediaStream\'s MediaStreamTracks match tracks');
t.end();
});
});
tape('.clone', function(t) {
return getRemoteMediaStream().then(function(stream1) {
var stream2 = stream1.clone();
var stream3 = stream2.clone();
// NOTE(mroberts): Weirdly, cloned video MediaStreamTracks have .readyState
// "live"; we'll .stop them, at least until that bug is fixed.
// stream2.getVideoTracks().forEach(function(track) {
stream2.getTracks().forEach(function(track) {
track.stop();
});
// stream3.getVideoTracks().forEach(function(track) {
stream3.getTracks().forEach(function(track) {
track.stop();
});
t.ok(
stream1.id !== stream2.id &&
stream2.id !== stream3.id &&
stream3.id !== stream1.id,
'the cloned MediaStreams have different IDs');
t.ok(
stream1.getTracks().length === stream2.getTracks().length &&
stream1.getTracks().length === stream3.getTracks().length,
'the cloned MediaStreams contain the same number of MediaStreamTracks');
t.ok(stream1.getTracks().every(function(track, i) {
return track.kind === stream2.getTracks()[i].kind &&
track.kind === stream3.getTracks()[i].kind;
}), 'the cloned MediaStreams contain the same kinds of MediaStreamTracks');
t.ok(stream1.getTracks().every(function(track, i) {
return track.id !== stream2.getTracks()[i].id &&
track.id !== stream3.getTracks()[i].id;
}), 'the cloned MediaStreams\'s MediaStreamTracks do not have the same .ids');
t.end();
});
});
tape.skip('.clone and .stop', function(t) {
getUserMedia({ audio: true }).then(function(stream1) {
var track1 = stream1.getTracks()[0];
t.ok(stream1.active, 'stream1 is active');
t.equal(track1.readyState, 'live', 'track1 is live');
var stream2 = stream1.clone();
var track2 = stream2.getTracks()[0];
t.ok(stream2.active, 'stream2 is active');
t.equal(track2.readyState, 'live', 'track2 is live');
t.notEqual(stream1, stream2, 'stream1 and stream2 are different');
t.notEqual(track1, track2, 'track1 and track2 are different');
track1.stop();
t.ok(!stream1.active, 'stream1 is inactive');
t.ok(stream2.active, 'stream2 is active');
t.equal(track1.readyState, 'ended', 'track1 is ended');
t.equal(track2.readyState, 'live', 'track2 is live');
track2.stop();
t.ok(!stream2.active, 'stream2 is inactive');
t.equal(track2.readyState, 'ended', 'track2 is ended');
t.end();
});
});
tape('.removeTrack and .addTrack on remote MediaStream', function(t) {
return getRemoteMediaStream().then(function(stream) {
var tracks = stream.getTracks();
tracks.forEach(function(track) {
stream.removeTrack(track);
});
t.equal(stream.getTracks().length, 0, 'all MediaStreamTracks are removed');
tracks.forEach(function(track) {
stream.addTrack(track);
});
t.equal(stream.getTracks().length, tracks.length, 'all MediaStreamTracks are added back');
t.ok(stream.getTracks().every(function(track, i) {
return track === tracks[i];
}), 'all MediaStreamTracks added back are the same (and in the same order)');
t.end();
});
});
function testSettingEnabled(t, stream) {
const tracks = stream.getTracks();
tracks.forEach(track => { track.enabled = false; });
t.ok(tracks.every(track => !track.enabled),
'enabled can initially be set to false on all MediaStreamTracks');
tracks.forEach(track => { track.enabled = true; });
t.ok(tracks.every(track => track.enabled),
'enabled can then be set to true on all MediaStreamTracks');
tracks.forEach(track => track.stop());
t.ok(tracks.every(track => track.enabled),
'enabled remains true for all MediaStreamTracks after stopping');
tracks.forEach(track => { track.enabled = false; });
t.ok(tracks.every(track => !track.enabled),
'enabled can still be set on stopped MediaStreamTracks');
t.end();
}
tape('.enabled on local MediaStreamTrack', t => {
getLocalMediaStream().then(stream => testSettingEnabled(t, stream));
});
tape('.enabled on remote MediaStreamTrack', t => {
getRemoteMediaStream().then(stream => testSettingEnabled(t, stream));
});
function getRemoteMediaStream() {
var pc = new RTCPeerConnection();
var offer = new RTCSessionDescription({ type: 'offer', sdp: sdp });
var trackEventPromise = new Promise(function(resolve) {
pc.ontrack = resolve;
});
return pc.setRemoteDescription(offer).then(function() {
return trackEventPromise;
}).then(function(trackEvent) {
pc.close();
return trackEvent.streams[0];
});
}
function getLocalMediaStream() {
return getUserMedia({ audio: true, video: true });
}
|
// quarantine
const fs = require('fs');
const mkdirp = require('mkdirp');
const path = require('path');
exports.register = function () {
const plugin = this;
plugin.load_quarantine_ini();
plugin.register_hook('queue', 'quarantine');
plugin.register_hook('queue_outbound', 'quarantine');
}
exports.hook_init_master = function (next, server) {
this.init_quarantine_dir(() => {
this.clean_tmp_directory(next);
});
}
exports.load_quarantine_ini = function () {
const plugin = this;
plugin.cfg = plugin.config.get('quarantine.ini', () => {
plugin.load_quarantine_ini();
})
}
const zeroPad = exports.zeroPad = function (n, digits) {
n = n.toString();
while (n.length < digits) {
n = '0' + n;
}
return n;
}
exports.clean_tmp_directory = function (next) {
// At start-up; delete any files in the temporary directory
// NOTE: This is deliberately syncronous to ensure that this
// is completed prior to any messages being received.
const plugin = this;
const tmp_dir = path.join(plugin.get_base_dir(), 'tmp');
if (fs.existsSync(tmp_dir)) {
const dirent = fs.readdirSync(tmp_dir);
plugin.loginfo('Removing temporary files from: ' + tmp_dir);
for (let i=0; i<dirent.length; i++) {
fs.unlinkSync(path.join(tmp_dir, dirent[i]));
}
}
next();
}
function wants_quarantine (connection) {
if (connection.notes.quarantine)
return connection.notes.quarantine;
if (connection.transaction.notes.quarantine)
return connection.transaction.notes.quarantine;
if (connection.transaction.notes.get('queue.wants') === 'quarantine')
return true;
return false;
}
exports.get_base_dir = function () {
if (this.cfg.main.quarantine_path) return this.cfg.main.quarantine_path;
return '/var/spool/haraka/quarantine';
}
exports.init_quarantine_dir = function (done) {
const plugin = this;
const tmp_dir = path.join(plugin.get_base_dir(), 'tmp');
mkdirp(tmp_dir, function (err) {
if (err) {
plugin.logerror(`Unable to create ${tmp_dir}`);
}
plugin.loginfo(`created ${tmp_dir}`);
done();
});
}
exports.quarantine = function (next, connection) {
const plugin = this;
const quarantine = wants_quarantine(connection);
plugin.logdebug(`quarantine: ${quarantine}`);
if (!quarantine) return next();
// Calculate date in YYYYMMDD format
const d = new Date();
const yyyymmdd = d.getFullYear() + zeroPad(d.getMonth()+1, 2)
+ this.zeroPad(d.getDate(), 2);
let subdir = yyyymmdd;
// Allow either boolean or a sub-directory to be specified
if (typeof quarantine !== 'boolean' && quarantine !== 1) {
subdir = path.join(quarantine, yyyymmdd);
}
const txn = connection.transaction;
const base_dir = plugin.get_base_dir();
const msg_dir = path.join(base_dir, subdir);
const tmp_path = path.join(base_dir, 'tmp', txn.uuid);
const msg_path = path.join(msg_dir, txn.uuid);
// Create all the directories recursively if they do not exist.
// Then write the file to a temporary directory first, once this is
// successful we hardlink the file to the final destination and then
// remove the temporary file to guarantee a complete file in the
// final destination.
mkdirp(msg_dir, function (error) {
if (error) {
connection.logerror(plugin, 'Error creating directory: ' + msg_dir);
return next();
}
const ws = fs.createWriteStream(tmp_path);
ws.on('error', function (err) {
connection.logerror(plugin, 'Error writing quarantine file: ' + err.message);
return next();
});
ws.on('close', function () {
fs.link(tmp_path, msg_path, function (err) {
if (err) {
connection.logerror(plugin, 'Error writing quarantine file: ' + err);
}
else {
// Add a note to where we stored the message
txn.notes.quarantined = msg_path;
txn.results.add(plugin, { pass: msg_path, emit: true });
// Now delete the temporary file
fs.unlink(tmp_path, function () {});
}
// Using notes.quarantine_action to decide what to do after the message is quarantined.
// Format can be either action = [ code, msg ] or action = code
const action = (connection.notes.quarantine_action || txn.notes.quarantine_action);
if (!action) return next();
if (Array.isArray(action)) return next(action[0], action[1]);
return next(action);
});
});
txn.message_stream.pipe(ws, { line_endings: '\n' });
});
}
|
from django.core.management.base import BaseCommand
from six import moves
from auditlog.models import LogEntry
class Command(BaseCommand):
help = 'Deletes all log entries from the database.'
def handle(self, *args, **options):
answer = None
while answer not in ['', 'y', 'n']:
answer = moves.input("Are you sure? [y/N]: ").lower().strip()
if answer == 'y':
count = LogEntry.objects.all().count()
LogEntry.objects.all().delete()
print("Deleted %d objects." % count)
|
var searchData=
[
['ostream',['ostream',['../classhwlib_1_1ostream.html',1,'hwlib']]]
];
|
"use strict";
const Path = require('path');
const File = require('fs');
const Mime = require('mime-types');
const {Octokit} = require('@octokit/rest');
async function publish(options) {
options || (options = {})
const verbose = !!options.verbose
function log(message) {
console.log(message)
}
function debug(message) {
if ( verbose ) console.log(`[DEBUG] ${message}`)
}
const stageDir = Path.resolve(process.cwd(), './build/stage')
// Validate token
const token = process.env['NODE_PRE_GYP_GITHUB_TOKEN']
if ( !token ) {
throw new Error('NODE_PRE_GYP_GITHUB_TOKEN environment variable not found')
}
// Read package.json
let metadata
try {
const packagePath = Path.resolve(process.cwd(), './package.json')
const content = await File.promises.readFile(packagePath)
metadata = JSON.parse(content)
} catch (err) {
throw new Error(`Unable to read package.json (${err.message})`)
}
// Validate repository
const {repository} = metadata
if ( !repository || !repository.url ) {
throw new Error('Missing repository.url in package.json');
}
const match = repository.url.match(/https?:\/\/([^\/]+)\/(.*)(?=\.git)/i);
if( !match ) {
throw new Error('A correctly formatted GitHub repository.url was not found within package.json');
}
const [, repositoryHost, repositoryUri] = match;
const [owner, repo] = repositoryUri.split('/');
// Validate binary
const hostPrefix = `https://${repositoryHost}/${owner}/${repo}/releases/download/`;
const {binary} = metadata
if ( !binary || !binary.host ) {
throw new Error('Missing binary.host in package.json');
}
if ( hostPrefix !== binary.host ) {
throw new Error(`Invalid binary.host: Should be ${hostPrefix}`)
}
// Validate remote path
if ( !binary.remote_path ) {
throw new Error('Missing binary.remote_path')
}
const tagName = binary.remote_path.replace(/\{version\}/g, metadata.version);
const tagDir = Path.join(stageDir, tagName);
// Github API client
const client = new Octokit({
auth: token,
baseUrl: `https://api.${repositoryHost}`
})
const {data: releases} = await client.repos.listReleases({
owner, repo
})
let release = releases.find(release => release.tag_name === tagName)
// Create a release if none found
if( !release ) {
release = await client.repos.createRelease( {
'host': repositoryHost,
'owner': owner,
'repo': repo,
'tag_name': metadata.version,
'target_commitish': 'master',
'name': 'v' + metadata.version,
'body': `$[metadata.name} ${metadata.version}`,
'draft': !!options.draft,
'prerelease': false
});
}
// List stage dir assets
const files = await File.promises.readdir(tagDir)
if( files.length === 0 ) {
throw new Error('No files found within the stage directory: ' + tagDir);
}
// Upload assets to Github
await files.reduce(async (p, file) => {
await p
if( release && release.assets ) {
const asset = release.assets.find(asset => asset.name === file)
if( asset ) {
// TODO: Should be a warning
log("Staged file " + file + " found but it already exists in release " + release.tag_name + ". If you would like to replace it, you must first manually delete it within GitHub.");
return;
}
}
const fileName = file
const filePath = Path.resolve(tagDir, file)
const fileContent = await File.promises.readFile(filePath)
log("Staged file " + file + " found. Proceeding to upload it.");
await client.repos.uploadReleaseAsset({
url: release.upload_url,
owner: owner,
id: release.id,
repo: repo,
name: fileName,
data: fileContent,
contentType: Mime.contentType(fileName) || 'application/octet-stream',
contentLength: fileContent.length
})
log('Staged file ' + fileName + ' saved to ' + owner + '/' + repo + ' release ' + release.tag_name + ' successfully.');
}, Promise.resolve());
log('Done')
}
module.exports = {publish};
|
import React from 'react';
import ReactTooltip from 'react-tooltip';
import '@mu5h3r/uikit/core/help.scss';
type Props = {
text: string
}
export default function Help(props: Props) {
const id = Math.random().toString(36).substr(2, 9);
return <div data-tip='' data-for={id} className="help">
?
<ReactTooltip id={id} type="light" border={true} className="tooltip">{props.text}</ReactTooltip>
</div>
}
|
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const karmaTypescriptConfig = {
tsconfig: 'tsconfig.test.json',
// Disable coverage reports and instrumentation by default for tests
coverageOptions: {instrumentation: false},
reports: {},
bundlerOptions: {
sourceMap: true, // Process any non es5 code through
// karma-typescript-es6-transform (babel)
acornOptions: {ecmaVersion: 8},
transforms: [
require('karma-typescript-es6-transform')({
presets: [
// ensure we get es5 by adding IE 11 as a target
['@babel/env', {'targets': {'ie': '11'}, 'loose': true}]
]
}),
]
}
};
// Enable coverage reports and instrumentation under KARMA_COVERAGE=1 env
const coverageEnabled = !!process.env.KARMA_COVERAGE;
if (coverageEnabled) {
karmaTypescriptConfig.coverageOptions.instrumentation = true;
karmaTypescriptConfig.coverageOptions.exclude = [
/test_browser\.ts/,
/test_util\.ts/,
/_test\.ts/
];
karmaTypescriptConfig.reports = {html: 'coverage', 'text-summary': ''};
}
module.exports = function(config) {
const args = [];
if (config.testEnv) {
args.push('--testEnv', config.testEnv);
}
if (config.grep) {
args.push('--grep', config.grep);
}
if (config.flags) {
args.push('--flags', config.flags);
}
config.set({
basePath: '',
frameworks: ['jasmine', 'karma-typescript'],
files: [
{pattern: './node_modules/@babel/polyfill/dist/polyfill.js'},
'src/test_browser.ts',
{pattern: 'src/**/*.ts'},
],
exclude: ['src/test_node.ts'],
preprocessors: {'**/*.ts': ['karma-typescript']},
karmaTypescriptConfig,
reporters: ['progress', 'karma-typescript'],
port: 9866,
colors: true,
browsers: ['Chrome'],
client: {jasmine: {random: false}, args: args},
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_KEY,
tunnelIdentifier:
`tfjs_automl_${Date.now()}_${Math.floor(Math.random() * 1000)}`
},
captureTimeout: 120000,
reportSlowerThan: 500,
browserNoActivityTimeout: 180000,
customLaunchers: {
bs_chrome_mac: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: 'latest',
os: 'OS X',
os_version: 'High Sierra'
},
bs_firefox_mac: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: 'latest',
os: 'OS X',
os_version: 'High Sierra'
},
bs_safari_mac: {
base: 'BrowserStack',
browser: 'safari',
browser_version: 'latest',
os: 'OS X',
os_version: 'High Sierra'
},
bs_ios_11: {
base: 'BrowserStack',
device: 'iPhone X',
os: 'iOS',
os_version: '11.0',
real_mobile: true
},
}
})
}
|
/**
* @fileOverview This file define global objects which created by flight-framework.
*/
/**
* Holds global scope objects which created by flight-framework.
* @module flight/global
*/
/**
* @ignore
*/
var flight = flight || {};
/**
* @undocumented
*/
var __flightRoot
, __projectRoot
, __filename
, __dirname
, __nop
, __inherit
, JSON
, exit
, getStackTrace
, require
, module
, exports;
(function(ns) {
/**
* @private
* @memberOf flight
* @namespace global
*/
var global = global || {};
(function(ns) {
/**
* The character string which shows the root directory of flight-framework.
* @global
* @var __flightRoot
* @type {string}
*/
ns.__flightRoot = null;
/**
* The character string which shows the root directory of script.
* @global
* @var __projectRoot
* @type {string}
*/
ns.__projectRoot = null;
/**
* The character string which shows the file of the script under present execution.
* @global
* @var __filename
* @type {string}
*/
ns.__filename = null;
/**
* The character string which shows the directory of the script under present execution.
* @global
* @var __dirname
* @type {string}
*/
ns.__dirname = null;
/**
* No operand.
* @global
* @name __nop
* @function
*/
ns.__nop = function() {};
/**
* Inherit class.
* @global
* @name __inherit
* @function
* @param {function} child - The class made into a child
* @param {function} parent - The class made into parent
*/
ns.__inherit = function(child, parent) {
function Extended() {
this.constructor = child;
}
Extended.prototype = parent.prototype;
child.prototype = new Extended();
};
ns.JSON = (function(undefined) {
/**
* @inner
*/
var getClass = Object.prototype.toString
, hasOwnProperty = Object.prototype.hasOwnProperty
, escapeable = /["\\\x00-\x1f\x7f-\x9f]/g
, metaKeyStr = '\b\t\n\f\r"\\'
, meta = {
"\b": "\\b"
, "\t": "\\t"
, "\n": "\\n"
, "\f": "\\f"
, "\r": "\\r"
, '"' : '\\"'
, "\\": "\\\\"
};
/**
* @private
* @name formatDigits
* @function
* @inner
* @param {number} digits - The maximum display digit.
* @param {number} num - Format for.
* @returns {string} character string with format digit.
*/
var formatDigits = function(digits, num) {
return ("000000000000" + (num || 0)).slice(-digits);
};
/**
* @private
* @name quote
* @function
* @inner
* @param {string} str - Quote for.
* @returns {string} character string with quoted.
*/
var quote = function(str) {
var prefix = '"'
, suffix = '"'
, body = ""
, i = 0
, char = "";
for (; char = str.charAt(i); i++) {
if (metaKeyStr.indexOf(char) != -1) {
body += meta[char];
} else if (char < " ") {
body += "\\u00" + formatDigits(2, char.charCodeAt(0).toString(16));
} else {
body += char;
}
}
return prefix + body + suffix;
};
/**
* Create a new JSON object
* (, but The interfaces of JSON is static only).
* @global
* @class JSON object is used to encode to JSON string and parse JSON.
*/
function JSON() {};
/**
* @memberOf JSON
* @name stringify
* @function
* @static
* @param {Object} object - The object to create a JSON string for.
* @param {Array.<*>|Object|Function} filter - unused(reserved).
* @param {number} width - unused(reserved).
* @returns {string} The JSON string presenting object.
*/
JSON.stringify = function(object, filter, width) {
var type = typeof object;
if (object === null) { return "null"; }
if (type === "undefined") { return "null"; }
if (type === "string") { return quote(object); }
if (type === "number") { return (object > -1 / 0) && (object < 1 / 0) ? "" + object : "null"; }
if (type === "boolean") { return "" + object; }
if (type === "object") {
// type of Date
if (object.constructor === Date) {
var fullYear = object.getUTCFullYear()
, month = object.getUTCMonth() + 1
, day = object.getUTCDate()
, hours = object.getUTCHours()
, minutes = object.getUTCMinutes()
, seconds = object.getUTCSeconds()
, milliseconds = object.getUTCMilliseconds();
month = formatDigits(2, month);
day = formatDigits(2, day);
hours = formatDigits(2, hours);
minutes = formatDigits(2, minutes);
seconds = formatDigits(2, seconds);
milliseconds = formatDigits(3, milliseconds);
var dateFormatted = '"' + fullYear + "-" + month + "-" + day +
"T" + hours + ":" + minutes + ":" + seconds +
"." + milliseconds + 'Z"';
return dateFormatted;
}
// typeof Array
if (object.constructor === Array) {
var array = [];
for (var i = 0; i < object.length; i++) {
var item = JSON.stringify(object[i]);
if (!item) { item = "null" };
array.push(item);
}
var arrayFormatted = "[" + array.join(",") + "]";
return arrayFormatted;
}
// typeof Object
var name,
value,
pairs = [];
for (var key in object) {
if (!hasOwnProperty.call(object, key)) { continue; }
type = typeof key;
if (type === "number") {
name = '"' + key + '"';
} else if (type === "string") {
name = quote(key);
} else {
continue;
}
type = typeof object[key];
if (type === "function" || type === "undefined") {
continue;
}
value = JSON.stringify(object[key]);
pairs.push(name + ":" + value);
}
var objectFormatted = "{" + pairs.join(",") + "}";
return objectFormatted;
};
};
/**
* @memberOf JSON
* @name parse
* @function
* @param {string} source - The JSON string presenting the object.
* @param {Function} callback - unused(reserved).
* @returns {Object} The object as specified by source.
*/
JSON.parse = function(source, callback) {
if(source != null && source != "" && source != undefined) {
return eval("(" + source + ")");
}
return null;
};
return JSON;
})();
/**
* Exit Flash IDE.
* @memberOf module:flight/global
* @name exit
* @function
* @global
* @param {boolean=true} promptNeeded - When displaying the prompt for saving the changed document,
*/
ns.exit = function(promptNeeded) {
if (promptNeeded !== false) { promptNeeded = true; }
fl.quit(promptNeeded);
};
/**
* Returns the stack trace.
* @global
* @name getStackTrace
* @function
* @returns {string} The stack trace.
*/
ns.getStackTrace = function() {
var error = new Error();
var stacks = error.stack.split("\n");
stacks.shift();
stacks.shift();
return stacks.join("\n");
};
/**
* @var require
* @type {function(id:string):*}
* @global
*/
ns.require = null;
/**
* The module object of the script file under present execution.
* @global
* @var module
* @type {module:flight/module.Module}
*/
ns.module = null;
/**
* A value is assigned to the member of this property
* to exhibit an object as a module.
* @global
* @var exports
* @type {Object}
*/
ns.exports = null;
/**
* Set require property on global scope.
* @undocumented
* @memberOf module:flight/global
* @name setRequire
* @function
* @param {module:flight/module.Module} value - require object.
*/
ns.setRequire = function(value) {
require = ns.require = value;
};
/**
* Set module property on global scope.
* @undocumented
* @memberOf module:flight/global
* @name setModule
* @function
* @param {module:flight/module.Module} value - module object.
*/
ns.setModule = function(value) {
module = ns.module = value;
};
/**
* Set exports property on global scope.
* @undocumented
* @memberOf module:flight/global
* @name setExports
* @function
* @param {Object} value - exports object.
*/
ns.setExports = function(value) {
exports = ns.exports = value;
};
/**
* Set __filename property on global scope.
* @undocumented
* @memberOf module:flight/global
* @name setFilename
* @function
* @param {string} value - filename.
*/
ns.setFilename = function(value) {
__filename = ns.__filename = value;
};
/**
* Set __dirname property on global scope.
* @undocumented
* @memberOf module:flight/global
* @name setDirname
* @function
* @param {string} value - directory uri.
*/
ns.setDirname = function(value) {
__dirname = ns.__dirname = value;
};
/**
* Initialize flight/global module.
* @undocumented
* @memberOf module:flight/global
* @name init
* @function
* @param {!Window} global - Global scope.
* @param {!string} flightRoot - The root directory of the flight-framework.
* @param {!string} projectRoot - The root directory of the project using flight-framework.
*/
ns.init = function(global, flightRoot, projectRoot) {
__flightRoot = ns.__flightRoot = flightRoot;
__projectRoot = ns.__projectRoot = projectRoot;
__nop = ns.__nop;
__inherit = ns.__inherit;
__filename = ns.__filename;
__dirname = ns.__dirname;
JSON = ns.JSON;
exit = ns.exit;
getStackTrace = ns.getStackTrace;
require = ns.__nop;
module = ns.module;
exports = ns.exports;
};
})(global);
ns.global = global;
})(flight);
/**
* Alias of module:flight/global#init
* @name global$init
* @function
* @param {!Window} global - Global scope.
* @param {!string} flightRoot - The root directory of the flight-framework.
* @param {!string} projectRoot - The root directory of the project using flight-framework.
*/
var global$init = function(scope, flightRoot, projectRoot) {
flight.global.init(scope, flightRoot, projectRoot);
};
|
describe('getSampleMigration()', () => {
it.todo('test')
})
describe('getPendingJobs()', () => {
it.todo('test')
})
describe('up()', () => {
it.todo('test')
})
|
import logging
import pytest
import retrying
import sdk_cmd
import sdk_install
import sdk_marathon
import sdk_plan
from tests import config
log = logging.getLogger(__name__)
@pytest.fixture(scope='module', autouse=True)
def configure_package(configure_security):
try:
sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME)
options = {
"service": {
# empty yaml: start in dynamic multiservice mode
"yaml": ""
}
}
# do not poll scheduler-level deploy plan, there is none:
sdk_install.install(config.PACKAGE_NAME, config.SERVICE_NAME, 0, additional_options=options, wait_for_deployment=False)
# use yaml list as a proxy for checking that the scheduler is up:
yamls = sdk_cmd.service_request('GET', config.SERVICE_NAME, '/v1/multi/yaml').json()
assert 'svc' in yamls
yield # let the test session execute
finally:
sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME)
@pytest.mark.sanity
@pytest.mark.smoke
def test_add_deploy_restart_remove():
svc1 = 'test1'
# add svc as test1:
sdk_cmd.service_request('POST', config.SERVICE_NAME, '/v1/multi/{}?yaml=svc'.format(svc1), json=service_params(svc1))
# get list, should immediately have new entry:
service = get_service_list()[0]
assert service['service'] == svc1
assert service['yaml'] == 'svc'
assert not service['uninstall']
sdk_plan.wait_for_plan_status(config.SERVICE_NAME, 'deploy', 'COMPLETE', multiservice_name=svc1)
# restart and check that service is recovered:
sdk_marathon.restart_app(config.SERVICE_NAME)
service = wait_for_service_count(1)[0]
assert service['service'] == svc1
assert service['yaml'] == 'svc'
assert not service['uninstall']
plan = sdk_plan.wait_for_plan_status(config.SERVICE_NAME, 'deploy', 'COMPLETE', multiservice_name=svc1)
# verify that svc.yml was deployed as svc1:
assert sdk_plan.get_all_step_names(plan) == ['hello-0:[server]', 'world-0:[server]', 'world-1:[server]']
# trigger service removal, wait for removal:
sdk_cmd.service_request('DELETE', config.SERVICE_NAME, '/v1/multi/{}'.format(svc1))
# check delete bit is set. however, be permissive of service being removed VERY quickly:
services = get_service_list()
assert len(services) <= 1
for service in services:
assert service['service'] == svc1
assert service['yaml'] == 'svc'
assert service['uninstall']
wait_for_service_count(0)
@pytest.mark.sanity
@pytest.mark.smoke
def test_add_multiple_uninstall():
# add two services:
svc1 = 'test1'
sdk_cmd.service_request('POST', config.SERVICE_NAME, '/v1/multi/{}?yaml=svc'.format(svc1), json=service_params(svc1))
svc2 = 'test2'
sdk_cmd.service_request('POST', config.SERVICE_NAME, '/v1/multi/{}?yaml=simple'.format(svc2), json=service_params(svc2))
# get list, should immediately have new entries:
services = get_service_list()
assert len(services) == 2
for service in services:
name = service['service']
assert name in (svc1, svc2)
if name == svc1:
assert service['yaml'] == 'svc'
else:
assert service['yaml'] == 'simple'
assert not service['uninstall']
plan = sdk_plan.wait_for_plan_status(config.SERVICE_NAME, 'deploy', 'COMPLETE', multiservice_name=svc1)
# verify that svc.yml was deployed as svc1:
assert sdk_plan.get_all_step_names(plan) == ['hello-0:[server]', 'world-0:[server]', 'world-1:[server]']
plan = sdk_plan.wait_for_plan_status(config.SERVICE_NAME, 'deploy', 'COMPLETE', multiservice_name=svc2)
# verify that simple.yml was deployed as svc2:
assert sdk_plan.get_all_step_names(plan) == ['hello-0:[server]']
# remove one service, then immediately restart app to verify recovery during service removal:
sdk_cmd.service_request('DELETE', config.SERVICE_NAME, '/v1/multi/{}'.format(svc2))
# check delete bits is set. however, be permissive of service potentially being removed VERY quickly:
services = get_service_list()
assert len(services) in (1, 2)
for service in services:
name = service['service']
assert name in (svc1, svc2)
if name == svc1:
assert service['yaml'] == 'svc'
else:
assert service['yaml'] == 'simple'
# svc2 should be getting uninstalled, svc1 shouldn't:
assert service['uninstall'] == (name == svc2)
# restart app and wait for removal to succeed after restart:
sdk_marathon.restart_app(config.SERVICE_NAME)
wait_for_service_count(1)
plan = sdk_plan.wait_for_plan_status(config.SERVICE_NAME, 'deploy', 'COMPLETE', multiservice_name=svc1)
# verify that svc.yml is still deployed as svc1:
assert sdk_plan.get_all_step_names(plan) == ['hello-0:[server]', 'world-0:[server]', 'world-1:[server]']
# leave suite teardown to do the uninstall, verifying successful winding down of svc1
def get_service_list():
return sdk_cmd.service_request('GET', config.SERVICE_NAME, '/v1/multi').json()
@retrying.retry(
wait_fixed=1000,
stop_max_delay=5*60*1000)
def wait_for_service_count(count):
services = get_service_list()
log.info('Waiting for scheduler to have {} services, got {}: {}'.format(
count, len(services), services))
if len(services) is not count:
raise Exception('Expected {} services, got: {}'.format(count, services))
return services
def service_params(service_name):
# we just override the service name in the YAML, otherwise we use the scheduler env:
return {
'FRAMEWORK_NAME': service_name
}
|